@coolms/ui-react 0.1.0-alpha.20 → 0.1.0-alpha.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
- import { jsx as e, jsxs as o, Fragment as C } from "react/jsx-runtime";
2
- import { useId as q, useState as A, useRef as K, useEffect as J, useCallback as _e, useMemo as He, useLayoutEffect as xe, useContext as Oe, createContext as Ue } from "react";
1
+ import { jsx as e, jsxs as u, Fragment as M } from "react/jsx-runtime";
2
+ import { useId as G, useState as E, useRef as R, useEffect as Y, useCallback as be, useMemo as Oe, useLayoutEffect as xe, useContext as Ke, createContext as Ue } from "react";
3
3
  import { createPortal as Me } from "react-dom";
4
4
  function ce(n, l) {
5
5
  const t = { ...n };
6
- for (const u of Object.keys(l ?? {})) {
7
- const d = l == null ? void 0 : l[u];
8
- d !== void 0 && (t[u] = d);
6
+ for (const o of Object.keys(l ?? {})) {
7
+ const i = l == null ? void 0 : l[o];
8
+ i !== void 0 && (t[o] = i);
9
9
  }
10
10
  return t;
11
11
  }
12
- function E(...n) {
12
+ function A(...n) {
13
13
  return n.filter(Boolean).join(" ");
14
14
  }
15
- function R({ name: n }) {
15
+ function z({ name: n }) {
16
16
  const l = { width: 16, height: 16, viewBox: "0 0 16 16", "aria-hidden": !0, focusable: !1 };
17
17
  switch (n) {
18
18
  case "lock":
@@ -31,51 +31,51 @@ function R({ name: n }) {
31
31
  return /* @__PURE__ */ e("svg", { ...l, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 5.5a1 1 0 0 0-1 1V11a1 1 0 1 0 2 0V7.5a1 1 0 0 0-1-1ZM8 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" }) });
32
32
  }
33
33
  }
34
- function ne({
34
+ function le({
35
35
  variant: n = "secondary",
36
36
  busy: l = !1,
37
37
  busyLabel: t,
38
- locked: u = !1,
39
- lockedReason: d,
40
- icon: a,
38
+ locked: o = !1,
39
+ lockedReason: i,
40
+ icon: s,
41
41
  disabled: r,
42
- className: s,
43
- children: m,
44
- type: b = "button",
45
- title: c,
46
- ...h
42
+ className: a,
43
+ children: h,
44
+ type: _ = "button",
45
+ title: d,
46
+ ...m
47
47
  }) {
48
- const i = !!r || l;
49
- return /* @__PURE__ */ o(
48
+ const c = !!r || l;
49
+ return /* @__PURE__ */ u(
50
50
  "button",
51
51
  {
52
- ...h,
53
- type: b,
54
- className: E("cms-button", `cms-button--${n}`, l && "is-busy", u && "is-locked", s),
55
- disabled: i,
52
+ ...m,
53
+ type: _,
54
+ className: A("cms-button", `cms-button--${n}`, l && "is-busy", o && "is-locked", a),
55
+ disabled: c,
56
56
  "aria-busy": l || void 0,
57
- title: u ? d ?? c : c,
57
+ title: o ? i ?? d : d,
58
58
  children: [
59
- l ? /* @__PURE__ */ e(R, { name: "spinner" }) : u ? /* @__PURE__ */ e(R, { name: "lock" }) : a,
60
- /* @__PURE__ */ e("span", { className: "cms-button__label", children: l && t !== void 0 ? t : m }),
61
- u && d ? /* @__PURE__ */ o("span", { className: "cms-visually-hidden", children: [
59
+ l ? /* @__PURE__ */ e(z, { name: "spinner" }) : o ? /* @__PURE__ */ e(z, { name: "lock" }) : s,
60
+ /* @__PURE__ */ e("span", { className: "cms-button__label", children: l && t !== void 0 ? t : h }),
61
+ o && i ? /* @__PURE__ */ u("span", { className: "cms-visually-hidden", children: [
62
62
  ", ",
63
- d
63
+ i
64
64
  ] }) : null
65
65
  ]
66
66
  }
67
67
  );
68
68
  }
69
- function Ce({ id: n, label: l, help: t, error: u, pinned: d, children: a }) {
70
- return /* @__PURE__ */ o("div", { className: E("cms-field", u != null && "is-invalid"), children: [
69
+ function Ce({ id: n, label: l, help: t, error: o, pinned: i, children: s }) {
70
+ return /* @__PURE__ */ u("div", { className: A("cms-field", o != null && "is-invalid"), children: [
71
71
  /* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: n, children: l }),
72
- a,
73
- d != null ? /* @__PURE__ */ o("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
74
- /* @__PURE__ */ e(R, { name: "lock" }),
72
+ s,
73
+ i != null ? /* @__PURE__ */ u("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
74
+ /* @__PURE__ */ e(z, { name: "lock" }),
75
75
  " ",
76
- d
76
+ i
77
77
  ] }) : null,
78
- u != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: u }) : null,
78
+ o != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: o }) : null,
79
79
  t != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${n}-help`, children: t }) : null
80
80
  ] });
81
81
  }
@@ -83,165 +83,165 @@ function Se(n, l) {
83
83
  const t = [l.error != null && `${n}-error`, l.pinned != null && `${n}-pinned`, l.help != null && `${n}-help`].filter(Boolean).join(" ");
84
84
  return t === "" ? void 0 : t;
85
85
  }
86
- const Re = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, ze = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
87
- function Ze(n, l, t) {
88
- const u = (a, r, s, m = 0, b = 0, c = 0) => {
89
- const h = new Date(Date.UTC(a, r - 1, s, m, b, c));
90
- return h.setUTCFullYear(a), h.getUTCFullYear() === a && h.getUTCMonth() === r - 1 && h.getUTCDate() === s && h.getUTCHours() === m && h.getUTCMinutes() === b && h.getUTCSeconds() === c ? h : null;
91
- }, d = (a) => ({ hour: Number(a[1]), minute: Number(a[2]), second: Number(a[3] ?? 0) });
86
+ const ze = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Ze = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
87
+ function Ve(n, l, t) {
88
+ const o = (s, r, a, h = 0, _ = 0, d = 0) => {
89
+ const m = new Date(Date.UTC(s, r - 1, a, h, _, d));
90
+ return m.setUTCFullYear(s), m.getUTCFullYear() === s && m.getUTCMonth() === r - 1 && m.getUTCDate() === a && m.getUTCHours() === h && m.getUTCMinutes() === _ && m.getUTCSeconds() === d ? m : null;
91
+ }, i = (s) => ({ hour: Number(s[1]), minute: Number(s[2]), second: Number(s[3] ?? 0) });
92
92
  try {
93
93
  if (n === "time") {
94
- const r = l.match(ze);
94
+ const r = l.match(Ze);
95
95
  if (r === null) return l;
96
- const s = d(r), m = u(2e3, 1, 1, s.hour, s.minute, s.second);
97
- return m === null ? l : new Intl.DateTimeFormat(t, { timeStyle: r[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(m);
96
+ const a = i(r), h = o(2e3, 1, 1, a.hour, a.minute, a.second);
97
+ return h === null ? l : new Intl.DateTimeFormat(t, { timeStyle: r[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(h);
98
98
  }
99
- const a = l.match(Re);
100
- if (a === null) return l;
101
- if (n === "date" && a[4] === void 0) {
102
- const r = u(Number(a[1]), Number(a[2]), Number(a[3]));
99
+ const s = l.match(ze);
100
+ if (s === null) return l;
101
+ if (n === "date" && s[4] === void 0) {
102
+ const r = o(Number(s[1]), Number(s[2]), Number(s[3]));
103
103
  return r === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeZone: "UTC" }).format(r);
104
104
  }
105
- if (n === "datetime-local" && a[4] !== void 0) {
106
- const r = u(Number(a[1]), Number(a[2]), Number(a[3]), Number(a[4]), Number(a[5]), Number(a[6] ?? 0));
107
- return r === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeStyle: a[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(r);
105
+ if (n === "datetime-local" && s[4] !== void 0) {
106
+ const r = o(Number(s[1]), Number(s[2]), Number(s[3]), Number(s[4]), Number(s[5]), Number(s[6] ?? 0));
107
+ return r === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeStyle: s[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(r);
108
108
  }
109
109
  } catch {
110
110
  return l;
111
111
  }
112
112
  return l;
113
113
  }
114
- const Ve = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
115
- function Dn({ label: n, help: l, error: t, disabled: u, readOnly: d, pinned: a, value: r, onChange: s, placeholder: m, type: b = "text", name: c, locale: h, min: i, max: f, step: p, minLength: g, maxLength: N, required: y }) {
116
- const x = q(), S = d === !0 || a != null, M = S && Ve.has(b), z = b === "number" && (p === "any" || typeof p == "number" && !Number.isInteger(p));
117
- return /* @__PURE__ */ e(Ce, { id: x, label: n, help: l, error: t, pinned: a, children: /* @__PURE__ */ e(
114
+ const We = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
115
+ function Bn({ label: n, help: l, error: t, disabled: o, readOnly: i, pinned: s, value: r, onChange: a, placeholder: h, type: _ = "text", name: d, locale: m, min: c, max: f, step: p, minLength: g, maxLength: N, required: w }) {
116
+ const x = G(), S = i === !0 || s != null, C = S && We.has(_), F = _ === "number" && (p === "any" || typeof p == "number" && !Number.isInteger(p));
117
+ return /* @__PURE__ */ e(Ce, { id: x, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
118
118
  "input",
119
119
  {
120
120
  id: x,
121
- name: c,
122
- type: M ? "text" : b,
121
+ name: d,
122
+ type: C ? "text" : _,
123
123
  className: "cms-input",
124
- value: M ? Ze(b, r, h) : r,
125
- ...M ? { "data-value": r } : {},
126
- lang: h,
127
- placeholder: m,
128
- disabled: u,
124
+ value: C ? Ve(_, r, m) : r,
125
+ ...C ? { "data-value": r } : {},
126
+ lang: m,
127
+ placeholder: h,
128
+ disabled: o,
129
129
  readOnly: S,
130
- required: y,
131
- "aria-required": y || void 0,
132
- min: M ? void 0 : i,
133
- max: M ? void 0 : f,
134
- step: M ? void 0 : p,
130
+ required: w,
131
+ "aria-required": w || void 0,
132
+ min: C ? void 0 : c,
133
+ max: C ? void 0 : f,
134
+ step: C ? void 0 : p,
135
135
  minLength: g,
136
136
  maxLength: N,
137
- inputMode: b === "number" ? z ? "decimal" : "numeric" : void 0,
137
+ inputMode: _ === "number" ? F ? "decimal" : "numeric" : void 0,
138
138
  "aria-invalid": t != null || void 0,
139
- "aria-describedby": Se(x, { help: l, error: t, pinned: a }),
140
- onChange: (H) => s == null ? void 0 : s(H.target.value)
139
+ "aria-describedby": Se(x, { help: l, error: t, pinned: s }),
140
+ onChange: (H) => a == null ? void 0 : a(H.target.value)
141
141
  }
142
142
  ) });
143
143
  }
144
- function Tn({ label: n, help: l, error: t, disabled: u, readOnly: d, pinned: a, value: r, onChange: s, placeholder: m, rows: b = 4, name: c, locale: h, minLength: i, maxLength: f, required: p }) {
145
- const g = q();
146
- return /* @__PURE__ */ e(Ce, { id: g, label: n, help: l, error: t, pinned: a, children: /* @__PURE__ */ e(
144
+ function Fn({ label: n, help: l, error: t, disabled: o, readOnly: i, pinned: s, value: r, onChange: a, placeholder: h, rows: _ = 4, name: d, locale: m, minLength: c, maxLength: f, required: p }) {
145
+ const g = G();
146
+ return /* @__PURE__ */ e(Ce, { id: g, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
147
147
  "textarea",
148
148
  {
149
149
  id: g,
150
- name: c,
150
+ name: d,
151
151
  className: "cms-input cms-textarea",
152
- rows: b,
152
+ rows: _,
153
153
  value: r,
154
- lang: h,
155
- placeholder: m,
156
- disabled: u,
157
- readOnly: d === !0 || a != null,
154
+ lang: m,
155
+ placeholder: h,
156
+ disabled: o,
157
+ readOnly: i === !0 || s != null,
158
158
  required: p,
159
159
  "aria-required": p || void 0,
160
- minLength: i,
160
+ minLength: c,
161
161
  maxLength: f,
162
162
  "aria-invalid": t != null || void 0,
163
- "aria-describedby": Se(g, { help: l, error: t, pinned: a }),
164
- onChange: (N) => s == null ? void 0 : s(N.target.value)
163
+ "aria-describedby": Se(g, { help: l, error: t, pinned: s }),
164
+ onChange: (N) => a == null ? void 0 : a(N.target.value)
165
165
  }
166
166
  ) });
167
167
  }
168
- function Ln({ label: n, help: l, error: t, disabled: u, readOnly: d, value: a, options: r, onChange: s, emptyText: m = "Nothing to choose from yet.", name: b }) {
169
- const c = q(), h = r.length === 0;
170
- return /* @__PURE__ */ e(Ce, { id: c, label: n, help: h ? m : l, error: t, children: /* @__PURE__ */ e(
168
+ function Hn({ label: n, help: l, error: t, disabled: o, readOnly: i, value: s, options: r, onChange: a, emptyText: h = "Nothing to choose from yet.", name: _ }) {
169
+ const d = G(), m = r.length === 0;
170
+ return /* @__PURE__ */ e(Ce, { id: d, label: n, help: m ? h : l, error: t, children: /* @__PURE__ */ e(
171
171
  "select",
172
172
  {
173
- id: c,
174
- name: b,
173
+ id: d,
174
+ name: _,
175
175
  className: "cms-input cms-select",
176
- value: a,
177
- disabled: u || h,
178
- "aria-readonly": d || void 0,
176
+ value: s,
177
+ disabled: o || m,
178
+ "aria-readonly": i || void 0,
179
179
  "aria-invalid": t != null || void 0,
180
- "aria-describedby": Se(c, { help: h ? m : l, error: t }),
181
- onChange: (i) => {
182
- d || s == null || s(i.target.value);
180
+ "aria-describedby": Se(d, { help: m ? h : l, error: t }),
181
+ onChange: (c) => {
182
+ i || a == null || a(c.target.value);
183
183
  },
184
- children: r.map((i) => /* @__PURE__ */ e("option", { value: i.value, disabled: d && i.value !== a, children: i.label }, i.value))
184
+ children: r.map((c) => /* @__PURE__ */ e("option", { value: c.value, disabled: i && c.value !== s, children: c.label }, c.value))
185
185
  }
186
186
  ) });
187
187
  }
188
- function $n({ label: n, checked: l, onChange: t, disabled: u, readOnly: d, help: a }) {
189
- const r = q();
190
- return /* @__PURE__ */ o("div", { className: "cms-toggle-row", children: [
188
+ function Rn({ label: n, checked: l, onChange: t, disabled: o, readOnly: i, help: s }) {
189
+ const r = G();
190
+ return /* @__PURE__ */ u("div", { className: "cms-toggle-row", children: [
191
191
  /* @__PURE__ */ e(
192
192
  "button",
193
193
  {
194
194
  id: r,
195
195
  type: "button",
196
196
  role: "switch",
197
- className: E("cms-toggle", l && "is-on"),
197
+ className: A("cms-toggle", l && "is-on"),
198
198
  "aria-checked": l,
199
- "aria-readonly": d || void 0,
200
- "aria-describedby": a != null ? `${r}-help` : void 0,
201
- disabled: u,
199
+ "aria-readonly": i || void 0,
200
+ "aria-describedby": s != null ? `${r}-help` : void 0,
201
+ disabled: o,
202
202
  onClick: () => {
203
- d || t == null || t(!l);
203
+ i || t == null || t(!l);
204
204
  },
205
205
  children: /* @__PURE__ */ e("span", { className: "cms-toggle__thumb" })
206
206
  }
207
207
  ),
208
208
  /* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor: r, children: n }),
209
- a != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${r}-help`, children: a }) : null
209
+ s != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${r}-help`, children: s }) : null
210
210
  ] });
211
211
  }
212
- const We = 150;
213
- function Pe({ open: n, title: l, onClose: t, dirty: u = !1, onDirtyClose: d, children: a, footer: r, closeLabel: s = "Close", initialFocus: m, className: b }) {
214
- const [c, h] = A(n), [i, f] = A(!1), p = K(null), g = K(null), N = q();
215
- if (J(() => {
212
+ const je = 150;
213
+ function Pe({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: i, children: s, footer: r, closeLabel: a = "Close", initialFocus: h, className: _ }) {
214
+ const [d, m] = E(n), [c, f] = E(!1), p = R(null), g = R(null), N = G();
215
+ if (Y(() => {
216
216
  if (n) {
217
- g.current = document.activeElement, h(!0), f(!1);
217
+ g.current = document.activeElement, m(!0), f(!1);
218
218
  return;
219
219
  }
220
- if (!c) return;
220
+ if (!d) return;
221
221
  f(!0);
222
222
  const x = window.setTimeout(() => {
223
- var S, M;
224
- h(!1), f(!1), (M = (S = g.current) == null ? void 0 : S.focus) == null || M.call(S);
225
- }, We);
223
+ var S, C;
224
+ m(!1), f(!1), (C = (S = g.current) == null ? void 0 : S.focus) == null || C.call(S);
225
+ }, je);
226
226
  return () => window.clearTimeout(x);
227
- }, [n, c]), J(() => {
227
+ }, [n, d]), Y(() => {
228
228
  var x, S;
229
- if (n && c) {
230
- const M = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
231
- (S = (m == null ? void 0 : m.current) ?? ((x = p.current) == null ? void 0 : x.querySelector(`.cms-modal__body :is(${M}), .cms-modal__foot :is(${M})`)) ?? p.current) == null || S.focus();
229
+ if (n && d) {
230
+ const C = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
231
+ (S = (h == null ? void 0 : h.current) ?? ((x = p.current) == null ? void 0 : x.querySelector(`.cms-modal__body :is(${C}), .cms-modal__foot :is(${C})`)) ?? p.current) == null || S.focus();
232
232
  }
233
- }, [n, c, m]), !c) return null;
234
- const y = () => {
235
- u ? d == null || d() : t();
233
+ }, [n, d, h]), !d) return null;
234
+ const w = () => {
235
+ o ? i == null || i() : t();
236
236
  };
237
237
  return Me(
238
- /* @__PURE__ */ e("div", { className: E("cms-modal-scrim", i && "is-closing"), onMouseDown: (x) => {
239
- x.target === x.currentTarget && y();
240
- }, children: /* @__PURE__ */ o(
238
+ /* @__PURE__ */ e("div", { className: A("cms-modal-scrim", c && "is-closing"), onMouseDown: (x) => {
239
+ x.target === x.currentTarget && w();
240
+ }, children: /* @__PURE__ */ u(
241
241
  "div",
242
242
  {
243
243
  ref: p,
244
- className: E("cms-modal", b, i && "is-closing", u && "is-dirty"),
244
+ className: A("cms-modal", _, c && "is-closing", o && "is-dirty"),
245
245
  role: "dialog",
246
246
  "aria-modal": "true",
247
247
  "aria-labelledby": N,
@@ -249,20 +249,20 @@ function Pe({ open: n, title: l, onClose: t, dirty: u = !1, onDirtyClose: d, chi
249
249
  onKeyDown: (x) => {
250
250
  var S;
251
251
  if (x.key === "Escape")
252
- x.stopPropagation(), y();
252
+ x.stopPropagation(), w();
253
253
  else if (x.key === "Tab") {
254
- const M = (S = p.current) == null ? void 0 : S.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
255
- if (!M || M.length === 0) return;
256
- const z = M[0], H = M[M.length - 1];
257
- x.shiftKey && document.activeElement === z ? (x.preventDefault(), H.focus()) : !x.shiftKey && document.activeElement === H && (x.preventDefault(), z.focus());
254
+ const C = (S = p.current) == null ? void 0 : S.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
255
+ if (!C || C.length === 0) return;
256
+ const F = C[0], H = C[C.length - 1];
257
+ x.shiftKey && document.activeElement === F ? (x.preventDefault(), H.focus()) : !x.shiftKey && document.activeElement === H && (x.preventDefault(), F.focus());
258
258
  }
259
259
  },
260
260
  children: [
261
- /* @__PURE__ */ o("header", { className: "cms-modal__head", children: [
261
+ /* @__PURE__ */ u("header", { className: "cms-modal__head", children: [
262
262
  /* @__PURE__ */ e("h2", { className: "cms-modal__title", id: N, children: l }),
263
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": s, onClick: y, children: /* @__PURE__ */ e(R, { name: "close" }) })
263
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": a, onClick: w, children: /* @__PURE__ */ e(z, { name: "close" }) })
264
264
  ] }),
265
- /* @__PURE__ */ e("div", { className: "cms-modal__body", children: a }),
265
+ /* @__PURE__ */ e("div", { className: "cms-modal__body", children: s }),
266
266
  r != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: r }) : null
267
267
  ]
268
268
  }
@@ -270,56 +270,56 @@ function Pe({ open: n, title: l, onClose: t, dirty: u = !1, onDirtyClose: d, chi
270
270
  document.body
271
271
  );
272
272
  }
273
- function Pn({ open: n, title: l, message: t, kind: u = "default", confirmLabel: d, cancelLabel: a, closeLabel: r, onConfirm: s, onCancel: m }) {
274
- const b = u === "discard-changes";
273
+ function On({ open: n, title: l, message: t, kind: o = "default", confirmLabel: i, cancelLabel: s, closeLabel: r, onConfirm: a, onCancel: h }) {
274
+ const _ = o === "discard-changes";
275
275
  return /* @__PURE__ */ e(
276
276
  Pe,
277
277
  {
278
278
  open: n,
279
279
  title: l,
280
- onClose: m,
280
+ onClose: h,
281
281
  ...r === void 0 ? {} : { closeLabel: r },
282
- footer: /* @__PURE__ */ o(C, { children: [
283
- /* @__PURE__ */ e(ne, { onClick: m, children: a ?? (b ? "Keep editing" : "Cancel") }),
284
- /* @__PURE__ */ e(ne, { variant: u === "default" ? "primary" : "danger", onClick: s, children: d ?? (b ? "Discard changes" : "Confirm") })
282
+ footer: /* @__PURE__ */ u(M, { children: [
283
+ /* @__PURE__ */ e(le, { onClick: h, children: s ?? (_ ? "Keep editing" : "Cancel") }),
284
+ /* @__PURE__ */ e(le, { variant: o === "default" ? "primary" : "danger", onClick: a, children: i ?? (_ ? "Discard changes" : "Confirm") })
285
285
  ] }),
286
- children: u !== "default" ? /* @__PURE__ */ o("p", { className: "cms-confirm__warning", children: [
287
- /* @__PURE__ */ e(R, { name: "warning" }),
286
+ children: o !== "default" ? /* @__PURE__ */ u("p", { className: "cms-confirm__warning", children: [
287
+ /* @__PURE__ */ e(z, { name: "warning" }),
288
288
  " ",
289
289
  t
290
290
  ] }) : /* @__PURE__ */ e("p", { children: t })
291
291
  }
292
292
  );
293
293
  }
294
- function In({ kind: n, message: l, action: t, onDismiss: u, dismissLabel: d = "Dismiss" }) {
295
- return /* @__PURE__ */ o("div", { className: E("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
296
- /* @__PURE__ */ e(R, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
294
+ function Kn({ kind: n, message: l, action: t, onDismiss: o, dismissLabel: i = "Dismiss" }) {
295
+ return /* @__PURE__ */ u("div", { className: A("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
296
+ /* @__PURE__ */ e(z, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
297
297
  /* @__PURE__ */ e("span", { className: "cms-toast__message", children: l }),
298
- t ? /* @__PURE__ */ e(ne, { className: "cms-toast__action", onClick: t.onAction, children: t.label }) : null,
299
- u ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": d, onClick: u, children: /* @__PURE__ */ e(R, { name: "close" }) }) : null
298
+ t ? /* @__PURE__ */ e(le, { className: "cms-toast__action", onClick: t.onAction, children: t.label }) : null,
299
+ o ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i, onClick: o, children: /* @__PURE__ */ e(z, { name: "close" }) }) : null
300
300
  ] });
301
301
  }
302
- function Bn({ children: n }) {
302
+ function Un({ children: n }) {
303
303
  return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: n });
304
304
  }
305
- function je({ what: n, layout: l = "inline" }) {
306
- return /* @__PURE__ */ o("div", { className: E("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
307
- /* @__PURE__ */ e(R, { name: "spinner" }),
305
+ function qe({ what: n, layout: l = "inline" }) {
306
+ return /* @__PURE__ */ u("div", { className: A("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
307
+ /* @__PURE__ */ e(z, { name: "spinner" }),
308
308
  /* @__PURE__ */ e("span", { children: n })
309
309
  ] });
310
310
  }
311
- function qe({ title: n, hint: l, action: t }) {
312
- return /* @__PURE__ */ o("div", { className: "cms-empty", children: [
311
+ function Ye({ title: n, hint: l, action: t }) {
312
+ return /* @__PURE__ */ u("div", { className: "cms-empty", children: [
313
313
  /* @__PURE__ */ e("p", { className: "cms-empty__title", children: n }),
314
314
  l != null ? /* @__PURE__ */ e("p", { className: "cms-empty__hint", children: l }) : null,
315
315
  t != null ? /* @__PURE__ */ e("div", { className: "cms-empty__action", children: t }) : null
316
316
  ] });
317
317
  }
318
- function Ye({ message: n, onRetry: l, retryLabel: t = "Try again" }) {
319
- return /* @__PURE__ */ o("div", { className: "cms-error-banner", role: "alert", children: [
320
- /* @__PURE__ */ e(R, { name: "warning" }),
318
+ function Ge({ message: n, onRetry: l, retryLabel: t = "Try again" }) {
319
+ return /* @__PURE__ */ u("div", { className: "cms-error-banner", role: "alert", children: [
320
+ /* @__PURE__ */ e(z, { name: "warning" }),
321
321
  /* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: n }),
322
- l ? /* @__PURE__ */ e(ne, { onClick: l, children: t }) : null
322
+ l ? /* @__PURE__ */ e(le, { onClick: l, children: t }) : null
323
323
  ] });
324
324
  }
325
325
  const ye = 300;
@@ -328,157 +328,168 @@ function Xe() {
328
328
  const n = getComputedStyle(document.documentElement).getPropertyValue("--cms-state-delay").trim(), l = n.endsWith("ms") ? Number.parseFloat(n) : n.endsWith("s") ? Number.parseFloat(n) * 1e3 : Number.NaN;
329
329
  return Number.isFinite(l) && l >= 0 ? l : ye;
330
330
  }
331
- function Ge() {
332
- return /* @__PURE__ */ o("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
331
+ function Je() {
332
+ return /* @__PURE__ */ u("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
333
333
  /* @__PURE__ */ e("circle", { className: "cms-state__track", cx: "12", cy: "12", r: "10", fill: "none" }),
334
334
  /* @__PURE__ */ e("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
335
335
  ] });
336
336
  }
337
- function ee({ kind: n, title: l, description: t, action: u, placement: d = "block" }) {
338
- const [a, r] = A(n !== "loading");
339
- return J(() => {
337
+ function ne({ kind: n, title: l, description: t, action: o, placement: i = "block" }) {
338
+ const [s, r] = E(n !== "loading");
339
+ return Y(() => {
340
340
  if (n !== "loading") {
341
341
  r(!0);
342
342
  return;
343
343
  }
344
344
  r(!1);
345
- const s = window.setTimeout(() => r(!0), Xe());
346
- return () => window.clearTimeout(s);
347
- }, [n]), /* @__PURE__ */ o(
345
+ const a = window.setTimeout(() => r(!0), Xe());
346
+ return () => window.clearTimeout(a);
347
+ }, [n]), /* @__PURE__ */ u(
348
348
  "div",
349
349
  {
350
- className: E("cms-state", `cms-state--${n}`, `cms-state--${d}`, !a && "is-waiting"),
350
+ className: A("cms-state", `cms-state--${n}`, `cms-state--${i}`, !s && "is-waiting"),
351
351
  role: "status",
352
352
  "aria-live": "polite",
353
353
  "data-kind": n,
354
354
  children: [
355
- n === "loading" ? /* @__PURE__ */ e(Ge, {}) : null,
356
- n === "error" || n === "denied" ? /* @__PURE__ */ e(R, { name: n === "error" ? "warning" : "lock" }) : null,
357
- /* @__PURE__ */ o("span", { className: "cms-state__text", children: [
355
+ n === "loading" ? /* @__PURE__ */ e(Je, {}) : null,
356
+ n === "error" || n === "denied" ? /* @__PURE__ */ e(z, { name: n === "error" ? "warning" : "lock" }) : null,
357
+ /* @__PURE__ */ u("span", { className: "cms-state__text", children: [
358
358
  /* @__PURE__ */ e("span", { className: "cms-state__title", children: l }),
359
359
  t !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-state__description", children: t }) : null
360
360
  ] }),
361
- u !== void 0 && n !== "denied" ? /* @__PURE__ */ e(ne, { className: "cms-state__action", onClick: u.onAction, children: u.label }) : null
361
+ o !== void 0 && n !== "denied" ? /* @__PURE__ */ e(le, { className: "cms-state__action", onClick: o.onAction, children: o.label }) : null
362
362
  ]
363
363
  }
364
364
  );
365
365
  }
366
- const Ie = {
367
- mail: /* @__PURE__ */ o(C, { children: [
366
+ const Be = {
367
+ mail: /* @__PURE__ */ u(M, { children: [
368
368
  /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
369
369
  /* @__PURE__ */ e("path", { d: "m3 7 9 6 9-6" })
370
370
  ] }),
371
371
  // The envelope with its flap open above it: a message read, or the message itself again.
372
- "mail-open": /* @__PURE__ */ o(C, { children: [
372
+ "mail-open": /* @__PURE__ */ u(M, { children: [
373
373
  /* @__PURE__ */ e("path", { d: "M3 10v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9" }),
374
374
  /* @__PURE__ */ e("path", { d: "m3 10 9-6 9 6" }),
375
375
  /* @__PURE__ */ e("path", { d: "m3 10 9 6 9-6" })
376
376
  ] }),
377
377
  // A clipboard: copy what is shown.
378
- copy: /* @__PURE__ */ o(C, { children: [
378
+ copy: /* @__PURE__ */ u(M, { children: [
379
379
  /* @__PURE__ */ e("rect", { x: "6", y: "4", width: "12", height: "17", rx: "2" }),
380
380
  /* @__PURE__ */ e("path", { d: "M9 4V3h6v1" }),
381
381
  /* @__PURE__ */ e("path", { d: "M9 10h6M9 14h6M9 18h3" })
382
382
  ] }),
383
383
  chat: /* @__PURE__ */ e("path", { d: "M4 12a8 8 0 1 1 4 6.9L4 20l1.1-4A8 8 0 0 1 4 12Z" }),
384
384
  phone: /* @__PURE__ */ e("path", { d: "M5 3h3l2 5-2.5 1.5a11 11 0 0 0 7 7L16 14l5 2v3a2 2 0 0 1-2 2A16 16 0 0 1 3 5a2 2 0 0 1 2-2Z" }),
385
- calendar: /* @__PURE__ */ o(C, { children: [
385
+ calendar: /* @__PURE__ */ u(M, { children: [
386
386
  /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "16", rx: "2" }),
387
387
  /* @__PURE__ */ e("path", { d: "M3 10h18M8 3v4M16 3v4" })
388
388
  ] }),
389
- file: /* @__PURE__ */ o(C, { children: [
389
+ file: /* @__PURE__ */ u(M, { children: [
390
390
  /* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
391
391
  /* @__PURE__ */ e("path", { d: "M14 3v6h6M8 13h8M8 17h6" })
392
392
  ] }),
393
393
  // The file, with code's angle brackets in place of its lines: a message's source.
394
- "file-code": /* @__PURE__ */ o(C, { children: [
394
+ "file-code": /* @__PURE__ */ u(M, { children: [
395
395
  /* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
396
396
  /* @__PURE__ */ e("path", { d: "M14 3v6h6" }),
397
397
  /* @__PURE__ */ e("path", { d: "m10 12-2 2.5 2 2.5M14 12l2 2.5-2 2.5" })
398
398
  ] }),
399
- image: /* @__PURE__ */ o(C, { children: [
399
+ image: /* @__PURE__ */ u(M, { children: [
400
400
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
401
401
  /* @__PURE__ */ e("circle", { cx: "9", cy: "10", r: "2" }),
402
402
  /* @__PURE__ */ e("path", { d: "m21 17-5-5-9 8" })
403
403
  ] }),
404
- search: /* @__PURE__ */ o(C, { children: [
404
+ search: /* @__PURE__ */ u(M, { children: [
405
405
  /* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "7" }),
406
406
  /* @__PURE__ */ e("path", { d: "m20 20-4-4" })
407
407
  ] }),
408
- bell: /* @__PURE__ */ o(C, { children: [
408
+ bell: /* @__PURE__ */ u(M, { children: [
409
409
  /* @__PURE__ */ e("path", { d: "M6 9a6 6 0 1 1 12 0c0 6 2 8 2 8H4s2-2 2-8Z" }),
410
410
  /* @__PURE__ */ e("path", { d: "M10 20a2 2 0 0 0 4 0" })
411
411
  ] }),
412
- pencil: /* @__PURE__ */ o(C, { children: [
412
+ pencil: /* @__PURE__ */ u(M, { children: [
413
413
  /* @__PURE__ */ e("path", { d: "M4 20h4L19 9l-4-4L4 16Z" }),
414
414
  /* @__PURE__ */ e("path", { d: "m13 7 4 4" })
415
415
  ] }),
416
- download: /* @__PURE__ */ o(C, { children: [
416
+ download: /* @__PURE__ */ u(M, { children: [
417
417
  /* @__PURE__ */ e("path", { d: "M12 4v11" }),
418
418
  /* @__PURE__ */ e("path", { d: "m7 11 5 5 5-5" }),
419
419
  /* @__PURE__ */ e("path", { d: "M4 20h16" })
420
420
  ] }),
421
- print: /* @__PURE__ */ o(C, { children: [
421
+ // Download's arrow turned up, from the line: a file sent up.
422
+ upload: /* @__PURE__ */ u(M, { children: [
423
+ /* @__PURE__ */ e("path", { d: "M12 20V9" }),
424
+ /* @__PURE__ */ e("path", { d: "m7 13 5-5 5 5" }),
425
+ /* @__PURE__ */ e("path", { d: "M4 4h16" })
426
+ ] }),
427
+ print: /* @__PURE__ */ u(M, { children: [
422
428
  /* @__PURE__ */ e("path", { d: "M7 8V4h10v4" }),
423
429
  /* @__PURE__ */ e("rect", { x: "3", y: "8", width: "18", height: "8", rx: "2" }),
424
430
  /* @__PURE__ */ e("path", { d: "M7 14h10v6H7Z" })
425
431
  ] }),
426
- "open-separately": /* @__PURE__ */ o(C, { children: [
432
+ "open-separately": /* @__PURE__ */ u(M, { children: [
427
433
  /* @__PURE__ */ e("path", { d: "M14 4h6v6" }),
428
434
  /* @__PURE__ */ e("path", { d: "m20 4-9 9" }),
429
435
  /* @__PURE__ */ e("path", { d: "M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5" })
430
436
  ] }),
431
437
  star: /* @__PURE__ */ e("path", { d: "m12 3 2.8 5.8 6.2.9-4.5 4.4 1 6.2L12 17.4l-5.5 2.9 1-6.2L3 9.7l6.2-.9Z" }),
432
- send: /* @__PURE__ */ o(C, { children: [
438
+ send: /* @__PURE__ */ u(M, { children: [
433
439
  /* @__PURE__ */ e("path", { d: "M21 3 10 14" }),
434
440
  /* @__PURE__ */ e("path", { d: "M21 3 14 21l-4-7-7-4Z" })
435
441
  ] }),
436
- inbox: /* @__PURE__ */ o(C, { children: [
442
+ inbox: /* @__PURE__ */ u(M, { children: [
437
443
  /* @__PURE__ */ e("path", { d: "M3 13h5l1 3h6l1-3h5" }),
438
444
  /* @__PURE__ */ e("path", { d: "M5 5h14l2 8v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" })
439
445
  ] }),
440
- archive: /* @__PURE__ */ o(C, { children: [
446
+ archive: /* @__PURE__ */ u(M, { children: [
441
447
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "5", rx: "1" }),
442
448
  /* @__PURE__ */ e("path", { d: "M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4" })
443
449
  ] }),
444
- trash: /* @__PURE__ */ o(C, { children: [
450
+ trash: /* @__PURE__ */ u(M, { children: [
445
451
  /* @__PURE__ */ e("path", { d: "M4 7h16M10 11v6M14 11v6" }),
446
452
  /* @__PURE__ */ e("path", { d: "M6 7l1 13a2 2 0 0 0 2 1h6a2 2 0 0 0 2-1l1-13M9 7V4h6v3" })
447
453
  ] }),
448
454
  paperclip: /* @__PURE__ */ e("path", { d: "m20 11-8.5 8.5a5 5 0 0 1-7-7L13 4a3.5 3.5 0 0 1 5 5l-8.5 8.5a2 2 0 0 1-3-3L14 7" }),
449
- mic: /* @__PURE__ */ o(C, { children: [
455
+ mic: /* @__PURE__ */ u(M, { children: [
450
456
  /* @__PURE__ */ e("rect", { x: "9", y: "3", width: "6", height: "11", rx: "3" }),
451
457
  /* @__PURE__ */ e("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v3" })
452
458
  ] }),
453
- speaker: /* @__PURE__ */ o(C, { children: [
459
+ speaker: /* @__PURE__ */ u(M, { children: [
454
460
  /* @__PURE__ */ e("path", { d: "M4 9h4l5-4v14l-5-4H4Z" }),
455
461
  /* @__PURE__ */ e("path", { d: "M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12" })
456
462
  ] }),
457
- "user-plus": /* @__PURE__ */ o(C, { children: [
463
+ "user-plus": /* @__PURE__ */ u(M, { children: [
458
464
  /* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
459
465
  /* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M19 8v6M16 11h6" })
460
466
  ] }),
461
467
  // A person, nothing more: one whose account is gone.
462
- user: /* @__PURE__ */ o(C, { children: [
468
+ user: /* @__PURE__ */ u(M, { children: [
463
469
  /* @__PURE__ */ e("circle", { cx: "12", cy: "8", r: "4" }),
464
470
  /* @__PURE__ */ e("path", { d: "M4 21a8 8 0 0 1 16 0" })
465
471
  ] }),
466
472
  // A person with a tick: someone allowed.
467
- "user-check": /* @__PURE__ */ o(C, { children: [
473
+ "user-check": /* @__PURE__ */ u(M, { children: [
468
474
  /* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
469
475
  /* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M16 11l2 2 4-4" })
470
476
  ] }),
471
477
  // A person with a cross: someone no longer allowed.
472
- "user-x": /* @__PURE__ */ o(C, { children: [
478
+ "user-x": /* @__PURE__ */ u(M, { children: [
473
479
  /* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
474
480
  /* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M17 8l4 4M21 8l-4 4" })
475
481
  ] }),
482
+ // Two people: the members of a group.
483
+ users: /* @__PURE__ */ u(M, { children: [
484
+ /* @__PURE__ */ e("circle", { cx: "9", cy: "8", r: "3.5" }),
485
+ /* @__PURE__ */ e("path", { d: "M2.5 20a6.5 6.5 0 0 1 13 0M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14a6.5 6.5 0 0 1 3.5 6" })
486
+ ] }),
476
487
  "phone-off": /* @__PURE__ */ e("path", { d: "M3 14c5-5 13-5 18 0l-2 3-4-1v-3a10 10 0 0 0-6 0v3l-4 1Z" }),
477
- video: /* @__PURE__ */ o(C, { children: [
488
+ video: /* @__PURE__ */ u(M, { children: [
478
489
  /* @__PURE__ */ e("rect", { x: "3", y: "6", width: "13", height: "12", rx: "2" }),
479
490
  /* @__PURE__ */ e("path", { d: "m16 10 5-3v10l-5-3" })
480
491
  ] }),
481
- info: /* @__PURE__ */ o(C, { children: [
492
+ info: /* @__PURE__ */ u(M, { children: [
482
493
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
483
494
  /* @__PURE__ */ e("path", { d: "M12 11v6M12 7.5v.5" })
484
495
  ] }),
@@ -487,17 +498,17 @@ const Ie = {
487
498
  plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
488
499
  folder: /* @__PURE__ */ e("path", { d: "M3 6a2 2 0 0 1 2-2h4l2 3h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z" }),
489
500
  // The folder with a plus inside: a new folder.
490
- "folder-plus": /* @__PURE__ */ o(C, { children: [
501
+ "folder-plus": /* @__PURE__ */ u(M, { children: [
491
502
  /* @__PURE__ */ e("path", { d: "M3 6a2 2 0 0 1 2-2h4l2 3h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z" }),
492
503
  /* @__PURE__ */ e("path", { d: "M12 10.5v6M9 13.5h6" })
493
504
  ] }),
494
505
  // The folder with a cross inside: a folder removed.
495
- "folder-x": /* @__PURE__ */ o(C, { children: [
506
+ "folder-x": /* @__PURE__ */ u(M, { children: [
496
507
  /* @__PURE__ */ e("path", { d: "M3 6a2 2 0 0 1 2-2h4l2 3h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z" }),
497
508
  /* @__PURE__ */ e("path", { d: "m9.5 11 5 5M14.5 11l-5 5" })
498
509
  ] }),
499
510
  check: /* @__PURE__ */ e("path", { d: "m5 12 5 5 9-10" }),
500
- server: /* @__PURE__ */ o(C, { children: [
511
+ server: /* @__PURE__ */ u(M, { children: [
501
512
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "7", rx: "2" }),
502
513
  /* @__PURE__ */ e("rect", { x: "3", y: "13", width: "18", height: "7", rx: "2" }),
503
514
  /* @__PURE__ */ e("path", { d: "M7 7.5h.5M7 16.5h.5" })
@@ -524,11 +535,11 @@ function T({ name: n, size: l = 20, label: t }) {
524
535
  strokeLinejoin: "round",
525
536
  focusable: !1,
526
537
  ...t ? { role: "img", "aria-label": t } : { "aria-hidden": !0 },
527
- children: Ie[n]
538
+ children: Be[n]
528
539
  }
529
540
  );
530
541
  }
531
- const Fn = Object.keys(Ie), Ee = {
542
+ const zn = Object.keys(Be), Ae = {
532
543
  reply: "reply",
533
544
  "reply-all": "reply",
534
545
  forward: "forward",
@@ -552,147 +563,153 @@ const Fn = Object.keys(Ie), Ee = {
552
563
  "folder-x": "folder-x",
553
564
  image: "image",
554
565
  "person-check": "user-check",
555
- "person-x": "user-x"
566
+ "person-x": "user-x",
567
+ "arrow-left": "chevron-left",
568
+ "pencil-square": "pencil",
569
+ "cloud-upload": "upload",
570
+ people: "users",
571
+ "file-earmark-word": "file",
572
+ "file-earmark-spreadsheet": "file"
556
573
  };
557
574
  function re(n) {
558
- return Object.prototype.hasOwnProperty.call(Ee, n) ? Ee[n] : null;
575
+ return Object.prototype.hasOwnProperty.call(Ae, n) ? Ae[n] : null;
559
576
  }
560
- function Je() {
577
+ function Qe() {
561
578
  try {
562
579
  return process.env.NODE_ENV !== "production";
563
580
  } catch {
564
581
  return !1;
565
582
  }
566
583
  }
567
- const De = /* @__PURE__ */ new Set();
568
- function Kn({ name: n, size: l = 18 }) {
584
+ const Le = /* @__PURE__ */ new Set();
585
+ function Zn({ name: n, size: l = 18 }) {
569
586
  if (n === "") return null;
570
587
  const t = re(n);
571
- return t !== null ? /* @__PURE__ */ e(T, { name: t, size: l }) : (!De.has(n) && Je() && (De.add(n), console.warn(`@coolms/ui-react: no icon for the server's icon name "${n}"; its space is kept empty`)), /* @__PURE__ */ e("span", { className: "cms-icon cms-icon--blank", style: { width: l, height: l }, "aria-hidden": "true", "data-icon-name": n }));
588
+ return t !== null ? /* @__PURE__ */ e(T, { name: t, size: l }) : (!Le.has(n) && Qe() && (Le.add(n), console.warn(`@coolms/ui-react: no icon for the server's icon name "${n}"; its space is kept empty`)), /* @__PURE__ */ e("span", { className: "cms-icon cms-icon--blank", style: { width: l, height: l }, "aria-hidden": "true", "data-icon-name": n }));
572
589
  }
573
- const Qe = 'input, select, textarea, button:not([disabled]), iframe, [href], [tabindex]:not([tabindex="-1"])', en = 60;
574
- function nn(n) {
590
+ const en = 'input, select, textarea, button:not([disabled]), iframe, [href], [tabindex]:not([tabindex="-1"])', nn = 60;
591
+ function ln(n) {
575
592
  return n instanceof Element && n.closest('input, select, textarea, [contenteditable="true"], [data-viewer-keys]') !== null;
576
593
  }
577
- function ln(n) {
594
+ function tn(n) {
578
595
  return n instanceof Element && n.closest("[data-viewer-gestures]") !== null;
579
596
  }
580
- function tn(n) {
597
+ function an(n) {
581
598
  return n.getClientRects().length > 0;
582
599
  }
583
- function Hn(n) {
584
- const { name: l, badge: t, closeLabel: u, onClose: d, actions: a = [], moreLabel: r = "More", edit: s, editing: m, state: b, siblings: c, bar: h, thumbnails: i, strip: f, onZoom: p, children: g } = n, N = K(null), y = K(null), x = q(), [S, M] = A(!1), z = K(null);
585
- J(() => {
600
+ function Vn(n) {
601
+ const { name: l, badge: t, closeLabel: o, onClose: i, actions: s = [], moreLabel: r = "More", edit: a, editing: h, state: _, siblings: d, bar: m, thumbnails: c, strip: f, onZoom: p, children: g } = n, N = R(null), w = R(null), x = G(), [S, C] = E(!1), F = R(null);
602
+ Y(() => {
586
603
  var V;
587
- const w = document.activeElement, B = document.body.style.overflow;
588
- return document.body.style.overflow = "hidden", (V = y.current) == null || V.focus(), () => {
589
- var L;
590
- document.body.style.overflow = B, (L = w == null ? void 0 : w.focus) == null || L.call(w);
604
+ const y = document.activeElement, P = document.body.style.overflow;
605
+ return document.body.style.overflow = "hidden", (V = w.current) == null || V.focus(), () => {
606
+ var D;
607
+ document.body.style.overflow = P, (D = y == null ? void 0 : y.focus) == null || D.call(y);
591
608
  };
592
609
  }, []);
593
610
  const H = () => {
594
- m != null && m.dirty ? m.onDirtyClose() : d();
595
- }, le = (w) => {
596
- const B = w.touches.length === 1 ? w.touches[0] : void 0;
597
- z.current = B === void 0 || m !== void 0 || ln(w.target) ? null : { x: B.clientX, y: B.clientY };
598
- }, Q = (w) => {
599
- var Y, F;
600
- const B = z.current, V = w.changedTouches[0];
601
- if (z.current = null, B === null || V === void 0) return;
602
- const L = V.clientX - B.x;
603
- Math.abs(L) < en || Math.abs(L) < Math.abs(V.clientY - B.y) || (L > 0 ? (Y = c == null ? void 0 : c.onPrevious) == null || Y.call(c) : (F = c == null ? void 0 : c.onNext) == null || F.call(c));
611
+ h != null && h.dirty ? h.onDirtyClose() : i();
612
+ }, ee = (y) => {
613
+ const P = y.touches.length === 1 ? y.touches[0] : void 0;
614
+ F.current = P === void 0 || h !== void 0 || tn(y.target) ? null : { x: P.clientX, y: P.clientY };
615
+ }, j = (y) => {
616
+ var X, O;
617
+ const P = F.current, V = y.changedTouches[0];
618
+ if (F.current = null, P === null || V === void 0) return;
619
+ const D = V.clientX - P.x;
620
+ Math.abs(D) < nn || Math.abs(D) < Math.abs(V.clientY - P.y) || (D > 0 ? (X = d == null ? void 0 : d.onPrevious) == null || X.call(d) : (O = d == null ? void 0 : d.onNext) == null || O.call(d));
604
621
  };
605
622
  return Me(
606
- /* @__PURE__ */ o(
623
+ /* @__PURE__ */ u(
607
624
  "div",
608
625
  {
609
626
  ref: N,
610
- className: E("cms-viewer", m !== void 0 && "is-editing"),
627
+ className: A("cms-viewer", h !== void 0 && "is-editing"),
611
628
  role: "dialog",
612
629
  "aria-modal": "true",
613
630
  "aria-labelledby": x,
614
631
  tabIndex: -1,
615
- onKeyDown: (w) => {
616
- var B, V, L;
617
- if (w.key === "Escape") {
618
- if (m !== void 0) return;
619
- w.stopPropagation(), S ? M(!1) : d();
620
- } else if (w.key === "Tab") {
621
- const Y = Array.from(((B = N.current) == null ? void 0 : B.querySelectorAll(Qe)) ?? []).filter(tn);
622
- if (Y.length === 0) return;
623
- const F = Y[0], X = Y[Y.length - 1];
624
- w.shiftKey && document.activeElement === F ? (w.preventDefault(), X.focus()) : !w.shiftKey && document.activeElement === X && (w.preventDefault(), F.focus());
625
- } else m === void 0 && !nn(w.target) && !w.ctrlKey && !w.metaKey && !w.altKey && (w.key === "ArrowLeft" ? (V = c == null ? void 0 : c.onPrevious) == null || V.call(c) : w.key === "ArrowRight" ? (L = c == null ? void 0 : c.onNext) == null || L.call(c) : w.key === "+" || w.key === "=" ? p == null || p("in") : w.key === "-" ? p == null || p("out") : w.key === "0" && (p == null || p("reset")));
632
+ onKeyDown: (y) => {
633
+ var P, V, D;
634
+ if (y.key === "Escape") {
635
+ if (h !== void 0) return;
636
+ y.stopPropagation(), S ? C(!1) : i();
637
+ } else if (y.key === "Tab") {
638
+ const X = Array.from(((P = N.current) == null ? void 0 : P.querySelectorAll(en)) ?? []).filter(an);
639
+ if (X.length === 0) return;
640
+ const O = X[0], J = X[X.length - 1];
641
+ y.shiftKey && document.activeElement === O ? (y.preventDefault(), J.focus()) : !y.shiftKey && document.activeElement === J && (y.preventDefault(), O.focus());
642
+ } else h === void 0 && !ln(y.target) && !y.ctrlKey && !y.metaKey && !y.altKey && (y.key === "ArrowLeft" ? (V = d == null ? void 0 : d.onPrevious) == null || V.call(d) : y.key === "ArrowRight" ? (D = d == null ? void 0 : d.onNext) == null || D.call(d) : y.key === "+" || y.key === "=" ? p == null || p("in") : y.key === "-" ? p == null || p("out") : y.key === "0" && (p == null || p("reset")));
626
643
  },
627
644
  children: [
628
- c !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${c.position}` }) : null,
629
- /* @__PURE__ */ o("header", { className: "cms-viewer__top", children: [
630
- /* @__PURE__ */ e("button", { ref: y, type: "button", className: "cms-viewer__icon", "aria-label": u, onClick: H, children: /* @__PURE__ */ e(R, { name: "close" }) }),
645
+ d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${d.position}` }) : null,
646
+ /* @__PURE__ */ u("header", { className: "cms-viewer__top", children: [
647
+ /* @__PURE__ */ e("button", { ref: w, type: "button", className: "cms-viewer__icon", "aria-label": o, onClick: H, children: /* @__PURE__ */ e(z, { name: "close" }) }),
631
648
  /* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: t }),
632
649
  /* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: x, title: l, children: l }),
633
- c !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: c.position }) : null,
650
+ d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: d.position }) : null,
634
651
  /* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
635
- m !== void 0 ? /* @__PURE__ */ o(C, { children: [
636
- /* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: m.status }),
637
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: m.onDone, children: m.doneLabel })
638
- ] }) : /* @__PURE__ */ o(C, { children: [
639
- /* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: a.map((w) => /* @__PURE__ */ o("button", { type: "button", className: "cms-viewer__button", onClick: w.onSelect, children: [
640
- w.icon,
641
- w.label
642
- ] }, w.label)) }),
643
- s !== void 0 ? /* @__PURE__ */ o("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": s.label, onClick: s.onEdit, children: [
644
- s.icon,
645
- /* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: s.label })
652
+ h !== void 0 ? /* @__PURE__ */ u(M, { children: [
653
+ /* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: h.status }),
654
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: h.onDone, children: h.doneLabel })
655
+ ] }) : /* @__PURE__ */ u(M, { children: [
656
+ /* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: s.map((y) => /* @__PURE__ */ u("button", { type: "button", className: "cms-viewer__button", onClick: y.onSelect, children: [
657
+ y.icon,
658
+ y.label
659
+ ] }, y.label)) }),
660
+ a !== void 0 ? /* @__PURE__ */ u("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": a.label, onClick: a.onEdit, children: [
661
+ a.icon,
662
+ /* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: a.label })
646
663
  ] }) : null,
647
- a.length > 0 ? /* @__PURE__ */ o("span", { className: "cms-viewer__more", children: [
648
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": r, "aria-expanded": S, onClick: () => M((w) => !w), children: /* @__PURE__ */ e(T, { name: "more" }) }),
649
- S ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: a.map((w) => /* @__PURE__ */ o(
664
+ s.length > 0 ? /* @__PURE__ */ u("span", { className: "cms-viewer__more", children: [
665
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": r, "aria-expanded": S, onClick: () => C((y) => !y), children: /* @__PURE__ */ e(T, { name: "more" }) }),
666
+ S ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: s.map((y) => /* @__PURE__ */ u(
650
667
  "button",
651
668
  {
652
669
  type: "button",
653
670
  className: "cms-viewer__button",
654
671
  onClick: () => {
655
- M(!1), w.onSelect();
672
+ C(!1), y.onSelect();
656
673
  },
657
674
  children: [
658
- w.icon,
659
- w.label
675
+ y.icon,
676
+ y.label
660
677
  ]
661
678
  },
662
- w.label
679
+ y.label
663
680
  )) }) : null
664
681
  ] }) : null
665
682
  ] })
666
683
  ] }),
667
- /* @__PURE__ */ o("div", { className: "cms-viewer__body", children: [
668
- i != null && m === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: i }) : null,
669
- /* @__PURE__ */ o("div", { className: "cms-viewer__content", onTouchStart: le, onTouchEnd: Q, children: [
670
- (m == null ? void 0 : m.conflict) !== void 0 ? /* @__PURE__ */ o("div", { className: "cms-viewer__conflict", role: "alert", children: [
671
- /* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children: m.conflict.message }),
672
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick: m.conflict.onOverwrite, children: m.conflict.overwriteLabel }),
673
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: m.conflict.onKeepBoth, children: m.conflict.keepBothLabel })
684
+ /* @__PURE__ */ u("div", { className: "cms-viewer__body", children: [
685
+ c != null && h === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: c }) : null,
686
+ /* @__PURE__ */ u("div", { className: "cms-viewer__content", onTouchStart: ee, onTouchEnd: j, children: [
687
+ (h == null ? void 0 : h.conflict) !== void 0 ? /* @__PURE__ */ u("div", { className: "cms-viewer__conflict", role: "alert", children: [
688
+ /* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children: h.conflict.message }),
689
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick: h.conflict.onOverwrite, children: h.conflict.overwriteLabel }),
690
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: h.conflict.onKeepBoth, children: h.conflict.keepBothLabel })
674
691
  ] }) : null,
675
- b === void 0 ? g : /* @__PURE__ */ e(an, { state: b }),
676
- m === void 0 && (c != null && c.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": c.previousLabel, title: c.previousLabel, onClick: c.onPrevious, children: /* @__PURE__ */ e(R, { name: "back" }) }) : null,
677
- m === void 0 && (c != null && c.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": c.nextLabel, title: c.nextLabel, onClick: c.onNext, children: /* @__PURE__ */ e(R, { name: "back" }) }) : null,
678
- m === void 0 && c !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(c.total, 7) }, (w, B) => /* @__PURE__ */ e("i", { className: B === Math.min(c.index, 6) ? "is-current" : void 0 }, B)) }) : null
692
+ _ === void 0 ? g : /* @__PURE__ */ e(sn, { state: _ }),
693
+ h === void 0 && (d != null && d.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": d.previousLabel, title: d.previousLabel, onClick: d.onPrevious, children: /* @__PURE__ */ e(z, { name: "back" }) }) : null,
694
+ h === void 0 && (d != null && d.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": d.nextLabel, title: d.nextLabel, onClick: d.onNext, children: /* @__PURE__ */ e(z, { name: "back" }) }) : null,
695
+ h === void 0 && d !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(d.total, 7) }, (y, P) => /* @__PURE__ */ e("i", { className: P === Math.min(d.index, 6) ? "is-current" : void 0 }, P)) }) : null
679
696
  ] })
680
697
  ] }),
681
- m === void 0 && f != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: f }) : null,
682
- h != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: h }) : null
698
+ h === void 0 && f != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: f }) : null,
699
+ m != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: m }) : null
683
700
  ]
684
701
  }
685
702
  ),
686
703
  document.body
687
704
  );
688
705
  }
689
- function an({ state: n }) {
706
+ function sn({ state: n }) {
690
707
  switch (n.kind) {
691
708
  case "loading":
692
- return /* @__PURE__ */ e(ee, { kind: "loading", title: n.title, placement: "page" });
709
+ return /* @__PURE__ */ e(ne, { kind: "loading", title: n.title, placement: "page" });
693
710
  case "error":
694
711
  return /* @__PURE__ */ e(
695
- ee,
712
+ ne,
696
713
  {
697
714
  kind: "error",
698
715
  title: n.title,
@@ -703,7 +720,7 @@ function an({ state: n }) {
703
720
  );
704
721
  case "no-preview":
705
722
  return /* @__PURE__ */ e(
706
- ee,
723
+ ne,
707
724
  {
708
725
  kind: "empty",
709
726
  title: n.title,
@@ -714,156 +731,156 @@ function an({ state: n }) {
714
731
  );
715
732
  }
716
733
  }
717
- class sn extends Error {
734
+ class rn extends Error {
718
735
  constructor(l = "denied") {
719
736
  super(l), this.name = "FilePickerDenied";
720
737
  }
721
738
  }
722
739
  const Ne = (n, l) => `${n}
723
- ${l}`, rn = (n, l) => n === "" ? l : `${n}/${l}`, cn = 48;
724
- function On(n) {
740
+ ${l}`, cn = (n, l) => n === "" ? l : `${n}/${l}`, on = 48;
741
+ function Wn(n) {
725
742
  var me, he;
726
- const { open: l, spaces: t, list: u, disabledReason: d, budget: a, formatSize: r, labels: s, onConfirm: m, onCancel: b } = n, [c, h] = A(((me = t[0]) == null ? void 0 : me.id) ?? ""), [i, f] = A(""), [p, g] = A({ status: "loading" }), [N, y] = A(0), [x, S] = A(/* @__PURE__ */ new Map()), [M, z] = A(0), [H, le] = A(!1), Q = K(null), w = q();
727
- J(() => {
728
- var _;
729
- l && (h(((_ = t[0]) == null ? void 0 : _.id) ?? ""), f(""), S(/* @__PURE__ */ new Map()), le(!1));
730
- }, [l]), J(() => {
731
- if (!l || c === "") return;
732
- let _ = !0;
733
- return g({ status: "loading" }), z(0), u(c, i).then(
734
- (k) => _ && g({ status: "ready", entries: k.entries, next: k.next ?? null, paging: !1 }),
735
- (k) => _ && g({ status: k instanceof sn ? "denied" : "error" })
743
+ const { open: l, spaces: t, list: o, disabledReason: i, budget: s, formatSize: r, labels: a, onConfirm: h, onCancel: _ } = n, [d, m] = E(((me = t[0]) == null ? void 0 : me.id) ?? ""), [c, f] = E(""), [p, g] = E({ status: "loading" }), [N, w] = E(0), [x, S] = E(/* @__PURE__ */ new Map()), [C, F] = E(0), [H, ee] = E(!1), j = R(null), y = G();
744
+ Y(() => {
745
+ var b;
746
+ l && (m(((b = t[0]) == null ? void 0 : b.id) ?? ""), f(""), S(/* @__PURE__ */ new Map()), ee(!1));
747
+ }, [l]), Y(() => {
748
+ if (!l || d === "") return;
749
+ let b = !0;
750
+ return g({ status: "loading" }), F(0), o(d, c).then(
751
+ (k) => b && g({ status: "ready", entries: k.entries, next: k.next ?? null, paging: !1 }),
752
+ (k) => b && g({ status: k instanceof rn ? "denied" : "error" })
736
753
  ), () => {
737
- _ = !1;
754
+ b = !1;
738
755
  };
739
- }, [l, c, i, u, N]);
740
- const B = _e(() => {
756
+ }, [l, d, c, o, N]);
757
+ const P = be(() => {
741
758
  if (p.status !== "ready" || p.next === null || p.paging) return;
742
- const _ = p.next, k = p.entries;
743
- g({ ...p, paging: !0 }), u(c, i, _).then(
744
- (I) => g({ status: "ready", entries: [...k, ...I.entries], next: I.next ?? null, paging: !1 }),
745
- () => g({ status: "ready", entries: k, next: _, paging: !1 })
759
+ const b = p.next, k = p.entries;
760
+ g({ ...p, paging: !0 }), o(d, c, b).then(
761
+ (B) => g({ status: "ready", entries: [...k, ...B.entries], next: B.next ?? null, paging: !1 }),
762
+ () => g({ status: "ready", entries: k, next: b, paging: !1 })
746
763
  );
747
- }, [p, u, c, i]), V = _e((_) => {
764
+ }, [p, o, d, c]), V = be((b) => {
748
765
  var k;
749
- return ((k = a == null ? void 0 : a.cost) == null ? void 0 : k.call(a, _)) ?? _.size ?? 0;
750
- }, [a]), L = He(() => [...x.values()], [x]), Y = L.reduce((_, k) => _ + (k.size ?? 0), 0), F = a === void 0 ? null : a.limitBytes - a.usedBytes - L.reduce((_, k) => _ + V(k), 0), X = F !== null && F < 0, ie = (_) => {
751
- if (_.kind !== "file") return null;
752
- const k = d == null ? void 0 : d(_);
753
- return k || (F !== null && !x.has(Ne(c, _.id)) && V(_) > F ? s.overBudget : null);
754
- }, oe = (_) => {
755
- const k = Ne(c, _.id);
756
- !x.has(k) && ie(_) !== null || S((I) => {
757
- const O = new Map(I);
758
- return O.has(k) ? O.delete(k) : O.set(k, { ..._, space: c, path: i }), O;
766
+ return ((k = s == null ? void 0 : s.cost) == null ? void 0 : k.call(s, b)) ?? b.size ?? 0;
767
+ }, [s]), D = Oe(() => [...x.values()], [x]), X = D.reduce((b, k) => b + (k.size ?? 0), 0), O = s === void 0 ? null : s.limitBytes - s.usedBytes - D.reduce((b, k) => b + V(k), 0), J = O !== null && O < 0, ie = (b) => {
768
+ if (b.kind !== "file") return null;
769
+ const k = i == null ? void 0 : i(b);
770
+ return k || (O !== null && !x.has(Ne(d, b.id)) && V(b) > O ? a.overBudget : null);
771
+ }, oe = (b) => {
772
+ const k = Ne(d, b.id);
773
+ !x.has(k) && ie(b) !== null || S((B) => {
774
+ const K = new Map(B);
775
+ return K.has(k) ? K.delete(k) : K.set(k, { ...b, space: d, path: c }), K;
759
776
  });
760
- }, v = (_) => f(rn(i, _.name)), D = () => f(i.includes("/") ? i.slice(0, i.lastIndexOf("/")) : ""), Z = (_) => S((k) => {
761
- const I = new Map(k);
762
- return I.delete(_), I;
763
- }), W = p.status === "ready" ? p.entries : [], $ = (_) => {
764
- const k = W[M];
765
- if (_.key === "ArrowDown" || _.key === "ArrowUp" || _.key === "Home" || _.key === "End") {
766
- _.preventDefault();
767
- const I = W.length - 1, O = _.key === "Home" ? 0 : _.key === "End" ? I : Math.min(I, Math.max(0, M + (_.key === "ArrowDown" ? 1 : -1)));
768
- z(O), O >= I - 1 && B();
769
- } else _.key === "Enter" && (k == null ? void 0 : k.kind) === "folder" ? (_.preventDefault(), v(k)) : _.key === " " && (k == null ? void 0 : k.kind) === "file" ? (_.preventDefault(), oe(k)) : _.key === "Backspace" && i !== "" && (_.preventDefault(), D());
770
- }, j = i === "" ? [] : i.split("/"), de = ((he = t.find((_) => _.id === c)) == null ? void 0 : he.name) ?? "", ue = (_) => `${w}-entry-${String(_)}`;
771
- return /* @__PURE__ */ o(
777
+ }, v = (b) => f(cn(c, b.name)), L = () => f(c.includes("/") ? c.slice(0, c.lastIndexOf("/")) : ""), Z = (b) => S((k) => {
778
+ const B = new Map(k);
779
+ return B.delete(b), B;
780
+ }), W = p.status === "ready" ? p.entries : [], $ = (b) => {
781
+ const k = W[C];
782
+ if (b.key === "ArrowDown" || b.key === "ArrowUp" || b.key === "Home" || b.key === "End") {
783
+ b.preventDefault();
784
+ const B = W.length - 1, K = b.key === "Home" ? 0 : b.key === "End" ? B : Math.min(B, Math.max(0, C + (b.key === "ArrowDown" ? 1 : -1)));
785
+ F(K), K >= B - 1 && P();
786
+ } else b.key === "Enter" && (k == null ? void 0 : k.kind) === "folder" ? (b.preventDefault(), v(k)) : b.key === " " && (k == null ? void 0 : k.kind) === "file" ? (b.preventDefault(), oe(k)) : b.key === "Backspace" && c !== "" && (b.preventDefault(), L());
787
+ }, q = c === "" ? [] : c.split("/"), de = ((he = t.find((b) => b.id === d)) == null ? void 0 : he.name) ?? "", ue = (b) => `${y}-entry-${String(b)}`;
788
+ return /* @__PURE__ */ u(
772
789
  Pe,
773
790
  {
774
791
  open: l,
775
- title: s.title,
776
- onClose: b,
777
- closeLabel: s.close,
778
- initialFocus: Q,
792
+ title: a.title,
793
+ onClose: _,
794
+ closeLabel: a.close,
795
+ initialFocus: j,
779
796
  className: "cms-file-picker",
780
- footer: /* @__PURE__ */ o("div", { className: "cms-file-picker__foot", children: [
781
- /* @__PURE__ */ o("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
782
- L.length > 0 ? /* @__PURE__ */ e("span", { children: s.total(L.length, r(Y)) }) : null,
783
- a !== void 0 && F !== null ? /* @__PURE__ */ e("span", { className: E(X && "is-over"), children: X ? s.overBudget : s.left(r(Math.max(0, F)), r(a.limitBytes)) }) : null
797
+ footer: /* @__PURE__ */ u("div", { className: "cms-file-picker__foot", children: [
798
+ /* @__PURE__ */ u("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
799
+ D.length > 0 ? /* @__PURE__ */ e("span", { children: a.total(D.length, r(X)) }) : null,
800
+ s !== void 0 && O !== null ? /* @__PURE__ */ e("span", { className: A(J && "is-over"), children: J ? a.overBudget : a.left(r(Math.max(0, O)), r(s.limitBytes)) }) : null
784
801
  ] }),
785
- /* @__PURE__ */ o("div", { className: "cms-file-picker__actions", children: [
786
- /* @__PURE__ */ e(ne, { variant: "secondary", onClick: b, children: s.cancel }),
787
- /* @__PURE__ */ e(ne, { variant: "primary", disabled: L.length === 0 || X, onClick: () => m(L), children: s.confirm(L.length) })
802
+ /* @__PURE__ */ u("div", { className: "cms-file-picker__actions", children: [
803
+ /* @__PURE__ */ e(le, { variant: "secondary", onClick: _, children: a.cancel }),
804
+ /* @__PURE__ */ e(le, { variant: "primary", disabled: D.length === 0 || J, onClick: () => h(D), children: a.confirm(D.length) })
788
805
  ] })
789
806
  ] }),
790
807
  children: [
791
- /* @__PURE__ */ o("div", { className: "cms-file-picker__top", children: [
792
- t.length > 1 ? /* @__PURE__ */ o("label", { className: "cms-file-picker__space", children: [
793
- /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: s.space }),
794
- /* @__PURE__ */ e("select", { className: "cms-input cms-select", value: c, onChange: (_) => {
795
- h(_.target.value), f("");
796
- }, children: t.map((_) => /* @__PURE__ */ e("option", { value: _.id, children: _.name }, _.id)) })
808
+ /* @__PURE__ */ u("div", { className: "cms-file-picker__top", children: [
809
+ t.length > 1 ? /* @__PURE__ */ u("label", { className: "cms-file-picker__space", children: [
810
+ /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: a.space }),
811
+ /* @__PURE__ */ e("select", { className: "cms-input cms-select", value: d, onChange: (b) => {
812
+ m(b.target.value), f("");
813
+ }, children: t.map((b) => /* @__PURE__ */ e("option", { value: b.id, children: b.name }, b.id)) })
797
814
  ] }) : null,
798
- /* @__PURE__ */ o("nav", { className: "cms-file-picker__path", "aria-label": s.path, children: [
799
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": s.up, disabled: i === "", onClick: D, children: /* @__PURE__ */ e(T, { name: "chevron-left" }) }),
800
- /* @__PURE__ */ o("ol", { children: [
801
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": i === "" ? "location" : void 0, onClick: () => f(""), children: de }) }),
802
- j.map((_, k) => {
803
- const I = j.slice(0, k + 1).join("/");
804
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": I === i ? "location" : void 0, onClick: () => f(I), children: _ }) }, I);
815
+ /* @__PURE__ */ u("nav", { className: "cms-file-picker__path", "aria-label": a.path, children: [
816
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": a.up, disabled: c === "", onClick: L, children: /* @__PURE__ */ e(T, { name: "chevron-left" }) }),
817
+ /* @__PURE__ */ u("ol", { children: [
818
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": c === "" ? "location" : void 0, onClick: () => f(""), children: de }) }),
819
+ q.map((b, k) => {
820
+ const B = q.slice(0, k + 1).join("/");
821
+ return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": B === c ? "location" : void 0, onClick: () => f(B), children: b }) }, B);
805
822
  })
806
823
  ] })
807
824
  ] }),
808
- L.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": H, onClick: () => le((_) => !_), children: s.selected(L.length) }) : null
825
+ D.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": H, onClick: () => ee((b) => !b), children: a.selected(D.length) }) : null
809
826
  ] }),
810
- H && L.length > 0 ? /* @__PURE__ */ o("div", { className: "cms-file-picker__chosen", children: [
811
- /* @__PURE__ */ e("ul", { children: [...x.entries()].map(([_, k]) => /* @__PURE__ */ o("li", { children: [
827
+ H && D.length > 0 ? /* @__PURE__ */ u("div", { className: "cms-file-picker__chosen", children: [
828
+ /* @__PURE__ */ e("ul", { children: [...x.entries()].map(([b, k]) => /* @__PURE__ */ u("li", { children: [
812
829
  /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: k.name }),
813
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": s.remove(k.name), onClick: () => Z(_), children: /* @__PURE__ */ e(R, { name: "close" }) })
814
- ] }, _)) }),
815
- /* @__PURE__ */ e(ne, { variant: "secondary", onClick: () => {
816
- S(/* @__PURE__ */ new Map()), le(!1);
817
- }, children: s.clear })
830
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": a.remove(k.name), onClick: () => Z(b), children: /* @__PURE__ */ e(z, { name: "close" }) })
831
+ ] }, b)) }),
832
+ /* @__PURE__ */ e(le, { variant: "secondary", onClick: () => {
833
+ S(/* @__PURE__ */ new Map()), ee(!1);
834
+ }, children: a.clear })
818
835
  ] }) : null,
819
- /* @__PURE__ */ o("div", { className: "cms-file-picker__list", onScroll: (_) => {
820
- const k = _.currentTarget;
821
- k.scrollTop + k.clientHeight >= k.scrollHeight - cn && B();
836
+ /* @__PURE__ */ u("div", { className: "cms-file-picker__list", onScroll: (b) => {
837
+ const k = b.currentTarget;
838
+ k.scrollTop + k.clientHeight >= k.scrollHeight - on && P();
822
839
  }, children: [
823
- p.status === "loading" ? /* @__PURE__ */ e(ee, { kind: "loading", title: s.loading, placement: "block" }) : null,
824
- p.status === "error" ? /* @__PURE__ */ e(ee, { kind: "error", title: s.error, placement: "block", action: { label: s.retry, onAction: () => y((_) => _ + 1) } }) : null,
825
- p.status === "denied" ? /* @__PURE__ */ e(ee, { kind: "denied", title: s.denied, placement: "block" }) : null,
826
- p.status === "ready" && W.length === 0 ? /* @__PURE__ */ e(ee, { kind: "empty", title: s.empty, placement: "block" }) : null,
827
- /* @__PURE__ */ o(
840
+ p.status === "loading" ? /* @__PURE__ */ e(ne, { kind: "loading", title: a.loading, placement: "block" }) : null,
841
+ p.status === "error" ? /* @__PURE__ */ e(ne, { kind: "error", title: a.error, placement: "block", action: { label: a.retry, onAction: () => w((b) => b + 1) } }) : null,
842
+ p.status === "denied" ? /* @__PURE__ */ e(ne, { kind: "denied", title: a.denied, placement: "block" }) : null,
843
+ p.status === "ready" && W.length === 0 ? /* @__PURE__ */ e(ne, { kind: "empty", title: a.empty, placement: "block" }) : null,
844
+ /* @__PURE__ */ u(
828
845
  "div",
829
846
  {
830
- ref: Q,
847
+ ref: j,
831
848
  role: "listbox",
832
849
  "aria-multiselectable": "true",
833
- "aria-label": s.files,
834
- "aria-activedescendant": W.length > 0 ? ue(M) : void 0,
850
+ "aria-label": a.files,
851
+ "aria-activedescendant": W.length > 0 ? ue(C) : void 0,
835
852
  tabIndex: 0,
836
853
  className: "cms-file-picker__entries",
837
854
  hidden: p.status !== "ready" || W.length === 0,
838
855
  onKeyDown: $,
839
856
  children: [
840
- W.map((_, k) => {
841
- const I = _.kind === "file" && x.has(Ne(c, _.id)), O = ie(_);
842
- return /* @__PURE__ */ o(
857
+ W.map((b, k) => {
858
+ const B = b.kind === "file" && x.has(Ne(d, b.id)), K = ie(b);
859
+ return /* @__PURE__ */ u(
843
860
  "div",
844
861
  {
845
862
  id: ue(k),
846
863
  role: "option",
847
- "aria-selected": _.kind === "file" ? I : void 0,
848
- "aria-disabled": O !== null || void 0,
849
- className: E("cms-file-picker__entry", k === M && "is-active", I && "is-ticked", O !== null && "is-disabled"),
864
+ "aria-selected": b.kind === "file" ? B : void 0,
865
+ "aria-disabled": K !== null || void 0,
866
+ className: A("cms-file-picker__entry", k === C && "is-active", B && "is-ticked", K !== null && "is-disabled"),
850
867
  onClick: () => {
851
- z(k), _.kind === "folder" ? v(_) : oe(_);
868
+ F(k), b.kind === "folder" ? v(b) : oe(b);
852
869
  },
853
870
  children: [
854
- /* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: I ? /* @__PURE__ */ e(T, { name: "check" }) : null }),
855
- /* @__PURE__ */ e(T, { name: _.kind === "folder" ? "folder" : "file" }),
856
- /* @__PURE__ */ o("span", { className: "cms-file-picker__text", children: [
857
- /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: _.name }),
858
- O !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: O }) : null
871
+ /* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: B ? /* @__PURE__ */ e(T, { name: "check" }) : null }),
872
+ /* @__PURE__ */ e(T, { name: b.kind === "folder" ? "folder" : "file" }),
873
+ /* @__PURE__ */ u("span", { className: "cms-file-picker__text", children: [
874
+ /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: b.name }),
875
+ K !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: K }) : null
859
876
  ] }),
860
- _.kind === "file" && _.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: r(_.size) }) : null
877
+ b.kind === "file" && b.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: r(b.size) }) : null
861
878
  ]
862
879
  },
863
- _.id
880
+ b.id
864
881
  );
865
882
  }),
866
- p.status === "ready" && p.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(ee, { kind: "loading", title: s.loading, placement: "inline" }) }) : null
883
+ p.status === "ready" && p.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(ne, { kind: "loading", title: a.loading, placement: "inline" }) }) : null
867
884
  ]
868
885
  }
869
886
  )
@@ -872,25 +889,25 @@ function On(n) {
872
889
  }
873
890
  );
874
891
  }
875
- function Un({ title: n, scope: l, actions: t, backLink: u }) {
876
- return /* @__PURE__ */ o("header", { className: "cms-page-header", children: [
877
- u ? /* @__PURE__ */ o(
892
+ function jn({ title: n, scope: l, actions: t, backLink: o }) {
893
+ return /* @__PURE__ */ u("header", { className: "cms-page-header", children: [
894
+ o ? /* @__PURE__ */ u(
878
895
  "a",
879
896
  {
880
897
  className: "cms-page-header__back",
881
- href: u.href ?? "#",
882
- onClick: (d) => {
883
- u.onBack && (d.preventDefault(), u.onBack());
898
+ href: o.href ?? "#",
899
+ onClick: (i) => {
900
+ o.onBack && (i.preventDefault(), o.onBack());
884
901
  },
885
902
  children: [
886
- /* @__PURE__ */ e(R, { name: "back" }),
903
+ /* @__PURE__ */ e(z, { name: "back" }),
887
904
  " ",
888
- u.label
905
+ o.label
889
906
  ]
890
907
  }
891
908
  ) : null,
892
- /* @__PURE__ */ o("div", { className: "cms-page-header__row", children: [
893
- /* @__PURE__ */ o("div", { className: "cms-page-header__titles", children: [
909
+ /* @__PURE__ */ u("div", { className: "cms-page-header__row", children: [
910
+ /* @__PURE__ */ u("div", { className: "cms-page-header__titles", children: [
894
911
  /* @__PURE__ */ e("h1", { className: "cms-page-header__title", children: n }),
895
912
  l != null ? /* @__PURE__ */ e("p", { className: "cms-page-header__scope", children: l }) : null
896
913
  ] }),
@@ -898,30 +915,30 @@ function Un({ title: n, scope: l, actions: t, backLink: u }) {
898
915
  ] })
899
916
  ] });
900
917
  }
901
- function Rn({ tabs: n, active: l, onSelect: t, label: u }) {
902
- const d = K([]), a = (r, s) => {
903
- var h;
904
- const m = n.length - 1, b = r.key === "ArrowRight" ? s === m ? 0 : s + 1 : r.key === "ArrowLeft" ? s === 0 ? m : s - 1 : r.key === "Home" ? 0 : r.key === "End" ? m : null;
905
- if (b === null) return;
918
+ function qn({ tabs: n, active: l, onSelect: t, label: o }) {
919
+ const i = R([]), s = (r, a) => {
920
+ var m;
921
+ const h = n.length - 1, _ = r.key === "ArrowRight" ? a === h ? 0 : a + 1 : r.key === "ArrowLeft" ? a === 0 ? h : a - 1 : r.key === "Home" ? 0 : r.key === "End" ? h : null;
922
+ if (_ === null) return;
906
923
  r.preventDefault();
907
- const c = n[b];
908
- c && (t(c.id), (h = d.current[b]) == null || h.focus());
924
+ const d = n[_];
925
+ d && (t(d.id), (m = i.current[_]) == null || m.focus());
909
926
  };
910
- return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": u, children: n.map((r, s) => {
911
- const m = r.id === l;
912
- return /* @__PURE__ */ o(
927
+ return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": o, children: n.map((r, a) => {
928
+ const h = r.id === l;
929
+ return /* @__PURE__ */ u(
913
930
  "button",
914
931
  {
915
- ref: (b) => {
916
- d.current[s] = b;
932
+ ref: (_) => {
933
+ i.current[a] = _;
917
934
  },
918
935
  type: "button",
919
936
  role: "tab",
920
- className: E("cms-tab", m && "is-active"),
921
- "aria-selected": m,
922
- tabIndex: m ? 0 : -1,
937
+ className: A("cms-tab", h && "is-active"),
938
+ "aria-selected": h,
939
+ tabIndex: h ? 0 : -1,
923
940
  onClick: () => t(r.id),
924
- onKeyDown: (b) => a(b, s),
941
+ onKeyDown: (_) => s(_, a),
925
942
  children: [
926
943
  r.label,
927
944
  r.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: r.count }) : null
@@ -931,86 +948,86 @@ function Rn({ tabs: n, active: l, onSelect: t, label: u }) {
931
948
  );
932
949
  }) });
933
950
  }
934
- function on(n) {
935
- const l = n.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), t = (d) => {
936
- var a;
937
- return (a = d == null ? void 0 : d.match(/[\p{L}\p{N}]/u)) == null ? void 0 : a[0];
951
+ function dn(n) {
952
+ const l = n.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), t = (i) => {
953
+ var s;
954
+ return (s = i == null ? void 0 : i.match(/[\p{L}\p{N}]/u)) == null ? void 0 : s[0];
938
955
  };
939
956
  return (l.length > 1 ? [t(l[0]), t(l[l.length - 1])] : [t(l[0])]).filter(Boolean).join("").toUpperCase();
940
957
  }
941
- function dn(n) {
958
+ function un(n) {
942
959
  let l = 0;
943
960
  for (const t of n.trim().toLowerCase())
944
961
  l = l * 31 + (t.codePointAt(0) ?? 0) >>> 0;
945
962
  return l % 6 + 1;
946
963
  }
947
- function ve({ name: n, pictureUrl: l, presence: t, connection: u, deleted: d = !1, size: a = 32 }) {
948
- const r = u !== void 0 ? `is-${u.state === "offline" ? "disconnected" : u.state}` : t === void 0 ? null : `is-${t === "busy" ? "away" : t}`, s = u !== void 0 ? `${n}, ${u.label}` : t ? `${n}, ${t}` : n;
949
- return /* @__PURE__ */ o(
964
+ function ve({ name: n, pictureUrl: l, presence: t, connection: o, deleted: i = !1, size: s = 32 }) {
965
+ const r = o !== void 0 ? `is-${o.state === "offline" ? "disconnected" : o.state}` : t === void 0 ? null : `is-${t === "busy" ? "away" : t}`, a = o !== void 0 ? `${n}, ${o.label}` : t ? `${n}, ${t}` : n;
966
+ return /* @__PURE__ */ u(
950
967
  "span",
951
968
  {
952
- className: E("cms-avatar", d ? "cms-avatar--deleted" : `cms-avatar--tint-${dn(n)}`),
953
- style: { width: a, height: a, fontSize: Math.round(a * 0.4) },
969
+ className: A("cms-avatar", i ? "cms-avatar--deleted" : `cms-avatar--tint-${un(n)}`),
970
+ style: { width: s, height: s, fontSize: Math.round(s * 0.4) },
954
971
  role: "img",
955
- "aria-label": s,
956
- ...u === void 0 ? {} : { title: u.label },
972
+ "aria-label": a,
973
+ ...o === void 0 ? {} : { title: o.label },
957
974
  children: [
958
- d ? /* @__PURE__ */ e(T, { name: "user", size: Math.round(a * 0.6) }) : l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: on(n) }),
959
- r === null ? null : /* @__PURE__ */ e("span", { className: E("cms-avatar__presence", r), "aria-hidden": "true" })
975
+ i ? /* @__PURE__ */ e(T, { name: "user", size: Math.round(s * 0.6) }) : l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: dn(n) }),
976
+ r === null ? null : /* @__PURE__ */ e("span", { className: A("cms-avatar__presence", r), "aria-hidden": "true" })
960
977
  ]
961
978
  }
962
979
  );
963
980
  }
964
- function un({ count: n, label: l, max: t = 99 }) {
965
- return n <= 0 ? null : /* @__PURE__ */ o("span", { className: "cms-badge", children: [
981
+ function mn({ count: n, label: l, max: t = 99 }) {
982
+ return n <= 0 ? null : /* @__PURE__ */ u("span", { className: "cms-badge", children: [
966
983
  /* @__PURE__ */ e("span", { "aria-hidden": "true", children: n > t ? `${t}+` : n }),
967
984
  /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: l })
968
985
  ] });
969
986
  }
970
- function zn({ product: n, mark: l, rail: t, active: u, onNavigate: d, server: a, search: r, account: s, children: m, railLabel: b = "Sections" }) {
971
- return /* @__PURE__ */ o("div", { className: "cms-shell", children: [
972
- /* @__PURE__ */ o("nav", { className: "cms-shell__rail", "aria-label": b, children: [
987
+ function Yn({ product: n, mark: l, rail: t, active: o, onNavigate: i, server: s, search: r, account: a, children: h, railLabel: _ = "Sections" }) {
988
+ return /* @__PURE__ */ u("div", { className: "cms-shell", children: [
989
+ /* @__PURE__ */ u("nav", { className: "cms-shell__rail", "aria-label": _, children: [
973
990
  /* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: l }),
974
- /* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((c) => {
975
- const h = c.id === u;
976
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
991
+ /* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((d) => {
992
+ const m = d.id === o;
993
+ return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ u(
977
994
  "a",
978
995
  {
979
- href: c.href,
980
- className: E("cms-shell__item", h && "is-active"),
981
- "aria-current": h ? "page" : void 0,
982
- title: c.label,
983
- onClick: (i) => {
984
- d && (i.preventDefault(), d(c.id));
996
+ href: d.href,
997
+ className: A("cms-shell__item", m && "is-active"),
998
+ "aria-current": m ? "page" : void 0,
999
+ title: d.label,
1000
+ onClick: (c) => {
1001
+ i && (c.preventDefault(), i(d.id));
985
1002
  },
986
1003
  children: [
987
- /* @__PURE__ */ o("span", { className: "cms-shell__icon", children: [
988
- /* @__PURE__ */ e(T, { name: c.icon, size: 22 }),
989
- c.badge ? /* @__PURE__ */ e(un, { count: c.badge.count, label: c.badge.label }) : null
1004
+ /* @__PURE__ */ u("span", { className: "cms-shell__icon", children: [
1005
+ /* @__PURE__ */ e(T, { name: d.icon, size: 22 }),
1006
+ d.badge ? /* @__PURE__ */ e(mn, { count: d.badge.count, label: d.badge.label }) : null
990
1007
  ] }),
991
- /* @__PURE__ */ e("span", { className: "cms-shell__label", children: c.label })
1008
+ /* @__PURE__ */ e("span", { className: "cms-shell__label", children: d.label })
992
1009
  ]
993
1010
  }
994
- ) }, c.id);
1011
+ ) }, d.id);
995
1012
  }) })
996
1013
  ] }),
997
- /* @__PURE__ */ o("header", { className: "cms-shell__top", children: [
1014
+ /* @__PURE__ */ u("header", { className: "cms-shell__top", children: [
998
1015
  /* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
999
- a != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: a }) : null,
1016
+ s != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: s }) : null,
1000
1017
  r != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: r }) : null,
1001
- s != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: s }) : null
1018
+ a != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: a }) : null
1002
1019
  ] }),
1003
- /* @__PURE__ */ e("main", { className: "cms-shell__main", children: m })
1020
+ /* @__PURE__ */ e("main", { className: "cms-shell__main", children: h })
1004
1021
  ] });
1005
1022
  }
1006
- function Zn({ label: n, placeholder: l, value: t, onChange: u, onSearch: d }) {
1007
- return /* @__PURE__ */ o(
1023
+ function Gn({ label: n, placeholder: l, value: t, onChange: o, onSearch: i }) {
1024
+ return /* @__PURE__ */ u(
1008
1025
  "form",
1009
1026
  {
1010
1027
  role: "search",
1011
1028
  className: "cms-search",
1012
- onSubmit: (a) => {
1013
- a.preventDefault(), d == null || d(t);
1029
+ onSubmit: (s) => {
1030
+ s.preventDefault(), i == null || i(t);
1014
1031
  },
1015
1032
  children: [
1016
1033
  /* @__PURE__ */ e(T, { name: "search", size: 18 }),
@@ -1022,39 +1039,39 @@ function Zn({ label: n, placeholder: l, value: t, onChange: u, onSearch: d }) {
1022
1039
  "aria-label": n,
1023
1040
  placeholder: l,
1024
1041
  value: t,
1025
- onChange: (a) => u(a.target.value)
1042
+ onChange: (s) => o(s.target.value)
1026
1043
  }
1027
1044
  )
1028
1045
  ]
1029
1046
  }
1030
1047
  );
1031
1048
  }
1032
- function mn({ options: n, value: l, onChange: t, label: u }) {
1033
- const d = K([]), a = (r, s) => {
1034
- var h;
1035
- const m = n.length - 1, b = r.key === "ArrowRight" || r.key === "ArrowDown" ? s === m ? 0 : s + 1 : r.key === "ArrowLeft" || r.key === "ArrowUp" ? s === 0 ? m : s - 1 : null;
1036
- if (b === null) return;
1049
+ function hn({ options: n, value: l, onChange: t, label: o }) {
1050
+ const i = R([]), s = (r, a) => {
1051
+ var m;
1052
+ const h = n.length - 1, _ = r.key === "ArrowRight" || r.key === "ArrowDown" ? a === h ? 0 : a + 1 : r.key === "ArrowLeft" || r.key === "ArrowUp" ? a === 0 ? h : a - 1 : null;
1053
+ if (_ === null) return;
1037
1054
  r.preventDefault();
1038
- const c = n[b];
1039
- c && (t(c.id), (h = d.current[b]) == null || h.focus());
1055
+ const d = n[_];
1056
+ d && (t(d.id), (m = i.current[_]) == null || m.focus());
1040
1057
  };
1041
- return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": u, children: n.map((r, s) => {
1042
- const m = r.id === l;
1043
- return /* @__PURE__ */ o(
1058
+ return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": o, children: n.map((r, a) => {
1059
+ const h = r.id === l;
1060
+ return /* @__PURE__ */ u(
1044
1061
  "button",
1045
1062
  {
1046
- ref: (b) => {
1047
- d.current[s] = b;
1063
+ ref: (_) => {
1064
+ i.current[a] = _;
1048
1065
  },
1049
1066
  type: "button",
1050
1067
  role: "radio",
1051
- "aria-checked": m,
1052
- tabIndex: m ? 0 : -1,
1053
- className: E("cms-chip", m && "is-on"),
1068
+ "aria-checked": h,
1069
+ tabIndex: h ? 0 : -1,
1070
+ className: A("cms-chip", h && "is-on"),
1054
1071
  onClick: () => t(r.id),
1055
- onKeyDown: (b) => a(b, s),
1072
+ onKeyDown: (_) => s(_, a),
1056
1073
  children: [
1057
- m ? /* @__PURE__ */ e(T, { name: "check", size: 16 }) : null,
1074
+ h ? /* @__PURE__ */ e(T, { name: "check", size: 16 }) : null,
1058
1075
  r.label
1059
1076
  ]
1060
1077
  },
@@ -1063,17 +1080,17 @@ function mn({ options: n, value: l, onChange: t, label: u }) {
1063
1080
  }) });
1064
1081
  }
1065
1082
  const Te = 16;
1066
- function hn(n, l, t) {
1067
- const u = n.map((a) => Math.min(Math.max(a.width, a.min), a.max));
1068
- let d = u.reduce((a, r) => a + r, 0) + t - l;
1069
- for (let a = u.length - 1; a >= 0 && d > 0; a -= 1) {
1070
- const r = Math.min(d, u[a] - n[a].min);
1071
- u[a] = u[a] - r, d -= r;
1083
+ function fn(n, l, t) {
1084
+ const o = n.map((s) => Math.min(Math.max(s.width, s.min), s.max));
1085
+ let i = o.reduce((s, r) => s + r, 0) + t - l;
1086
+ for (let s = o.length - 1; s >= 0 && i > 0; s -= 1) {
1087
+ const r = Math.min(i, o[s] - n[s].min);
1088
+ o[s] = o[s] - r, i -= r;
1072
1089
  }
1073
- return u;
1090
+ return o;
1074
1091
  }
1075
- function fn({ index: n, size: l, shown: t, others: u, room: d, lastMin: a, onResize: r }) {
1076
- const s = Math.max(l.min, Math.min(l.max, d > 0 ? d - u - a : l.max)), m = (h) => Math.round(Math.min(Math.max(h, l.min), s)), b = K(null), c = (h, i) => r == null ? void 0 : r(n, m(h), i);
1092
+ function pn({ index: n, size: l, shown: t, others: o, room: i, lastMin: s, onResize: r }) {
1093
+ const a = Math.max(l.min, Math.min(l.max, i > 0 ? i - o - s : l.max)), h = (m) => Math.round(Math.min(Math.max(m, l.min), a)), _ = R(null), d = (m, c) => r == null ? void 0 : r(n, h(m), c);
1077
1094
  return /* @__PURE__ */ e(
1078
1095
  "div",
1079
1096
  {
@@ -1083,74 +1100,74 @@ function fn({ index: n, size: l, shown: t, others: u, room: d, lastMin: a, onRes
1083
1100
  "aria-label": l.label,
1084
1101
  "aria-valuenow": t,
1085
1102
  "aria-valuemin": l.min,
1086
- "aria-valuemax": s,
1103
+ "aria-valuemax": a,
1087
1104
  className: "cms-panes__splitter",
1088
1105
  style: { "--split-at": `var(--split-pane-end-${String(n)})` },
1089
- onPointerDown: (h) => {
1090
- var i, f, p;
1091
- h.button > 0 || (h.preventDefault(), (f = (i = h.currentTarget).setPointerCapture) == null || f.call(i, h.pointerId), b.current = { x: h.clientX, from: t, last: t }, (p = h.currentTarget.closest(".cms-panes")) == null || p.classList.add("is-resizing"));
1106
+ onPointerDown: (m) => {
1107
+ var c, f, p;
1108
+ m.button > 0 || (m.preventDefault(), (f = (c = m.currentTarget).setPointerCapture) == null || f.call(c, m.pointerId), _.current = { x: m.clientX, from: t, last: t }, (p = m.currentTarget.closest(".cms-panes")) == null || p.classList.add("is-resizing"));
1092
1109
  },
1093
- onPointerMove: (h) => {
1094
- const i = b.current;
1095
- i === null || !Number.isFinite(h.clientX) || (i.last = m(i.from + h.clientX - i.x), c(i.last, !1));
1110
+ onPointerMove: (m) => {
1111
+ const c = _.current;
1112
+ c === null || !Number.isFinite(m.clientX) || (c.last = h(c.from + m.clientX - c.x), d(c.last, !1));
1096
1113
  },
1097
- onPointerUp: (h) => {
1114
+ onPointerUp: (m) => {
1098
1115
  var f;
1099
- const i = b.current;
1100
- i !== null && (b.current = null, (f = h.currentTarget.closest(".cms-panes")) == null || f.classList.remove("is-resizing"), c(i.last, !0));
1116
+ const c = _.current;
1117
+ c !== null && (_.current = null, (f = m.currentTarget.closest(".cms-panes")) == null || f.classList.remove("is-resizing"), d(c.last, !0));
1101
1118
  },
1102
- onPointerCancel: (h) => {
1119
+ onPointerCancel: (m) => {
1103
1120
  var f;
1104
- const i = b.current;
1105
- b.current = null, (f = h.currentTarget.closest(".cms-panes")) == null || f.classList.remove("is-resizing"), i !== null && c(i.last, !0);
1121
+ const c = _.current;
1122
+ _.current = null, (f = m.currentTarget.closest(".cms-panes")) == null || f.classList.remove("is-resizing"), c !== null && d(c.last, !0);
1106
1123
  },
1107
- onDoubleClick: () => c(l.reset, !0),
1108
- onKeyDown: (h) => {
1109
- const i = h.key === "ArrowLeft" ? t - Te : h.key === "ArrowRight" ? t + Te : h.key === "Home" ? l.min : h.key === "End" ? s : h.key === "Enter" ? l.reset : null;
1110
- i !== null && (h.preventDefault(), c(i, !0));
1124
+ onDoubleClick: () => d(l.reset, !0),
1125
+ onKeyDown: (m) => {
1126
+ const c = m.key === "ArrowLeft" ? t - Te : m.key === "ArrowRight" ? t + Te : m.key === "Home" ? l.min : m.key === "End" ? a : m.key === "Enter" ? l.reset : null;
1127
+ c !== null && (m.preventDefault(), d(c, !0));
1111
1128
  }
1112
1129
  }
1113
1130
  );
1114
1131
  }
1115
- function Vn({ panes: n, active: l, back: t, sizes: u, lastMin: d = 360, onResize: a }) {
1116
- const r = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), s = K(null), [m, b] = A(0), c = (u ?? []).slice(0, n.length - 1), h = c.length === n.length - 1 && c.every((p) => p !== void 0);
1132
+ function Xn({ panes: n, active: l, back: t, sizes: o, lastMin: i = 360, onResize: s }) {
1133
+ const r = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), a = R(null), [h, _] = E(0), d = (o ?? []).slice(0, n.length - 1), m = d.length === n.length - 1 && d.every((p) => p !== void 0);
1117
1134
  xe(() => {
1118
- const p = s.current;
1119
- if (p === null || !h) return;
1120
- const g = () => b(p.clientWidth);
1135
+ const p = a.current;
1136
+ if (p === null || !m) return;
1137
+ const g = () => _(p.clientWidth);
1121
1138
  if (g(), typeof ResizeObserver > "u") return;
1122
1139
  const N = new ResizeObserver(g);
1123
1140
  return N.observe(p), () => N.disconnect();
1124
- }, [h]);
1125
- const i = h ? hn(c, m > 0 ? m : Number.POSITIVE_INFINITY, d) : [], f = h ? Object.fromEntries(i.flatMap((p, g) => [
1141
+ }, [m]);
1142
+ const c = m ? fn(d, h > 0 ? h : Number.POSITIVE_INFINITY, i) : [], f = m ? Object.fromEntries(c.flatMap((p, g) => [
1126
1143
  [`--split-pane-${String(g)}`, `${String(p)}px`],
1127
- [`--split-pane-end-${String(g)}`, `${String(i.slice(0, g + 1).reduce((N, y) => N + y, 0))}px`]
1144
+ [`--split-pane-end-${String(g)}`, `${String(c.slice(0, g + 1).reduce((N, w) => N + w, 0))}px`]
1128
1145
  ])) : void 0;
1129
- return /* @__PURE__ */ o(
1146
+ return /* @__PURE__ */ u(
1130
1147
  "div",
1131
1148
  {
1132
- ref: s,
1133
- className: E("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", h && "cms-panes--sized"),
1149
+ ref: a,
1150
+ className: A("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", m && "cms-panes--sized"),
1134
1151
  "data-active": r,
1135
1152
  style: f,
1136
1153
  children: [
1137
- n.map((p, g) => /* @__PURE__ */ o("section", { className: "cms-panes__pane", "aria-label": p.label, "data-offset": r - g, children: [
1138
- g === r && t ? /* @__PURE__ */ o("a", { className: "cms-panes__back", href: t.href, children: [
1154
+ n.map((p, g) => /* @__PURE__ */ u("section", { className: "cms-panes__pane", "aria-label": p.label, "data-offset": r - g, children: [
1155
+ g === r && t ? /* @__PURE__ */ u("a", { className: "cms-panes__back", href: t.href, children: [
1139
1156
  /* @__PURE__ */ e(T, { name: "chevron-left", size: 18 }),
1140
1157
  t.label
1141
1158
  ] }) : null,
1142
1159
  p.content
1143
1160
  ] }, p.label)),
1144
- h ? c.map((p, g) => /* @__PURE__ */ e(
1145
- fn,
1161
+ m ? d.map((p, g) => /* @__PURE__ */ e(
1162
+ pn,
1146
1163
  {
1147
1164
  index: g,
1148
1165
  size: p,
1149
- shown: i[g],
1150
- others: i.reduce((N, y, x) => x === g ? N : N + y, 0),
1151
- room: m,
1152
- lastMin: d,
1153
- onResize: a
1166
+ shown: c[g],
1167
+ others: c.reduce((N, w, x) => x === g ? N : N + w, 0),
1168
+ room: h,
1169
+ lastMin: i,
1170
+ onResize: s
1154
1171
  },
1155
1172
  p.label
1156
1173
  )) : null
@@ -1158,27 +1175,27 @@ function Vn({ panes: n, active: l, back: t, sizes: u, lastMin: d = 360, onResize
1158
1175
  }
1159
1176
  );
1160
1177
  }
1161
- const pn = { attachment: "Has an attachment", unread: "Unread" };
1162
- function Wn({ from: n, subject: l, preview: t, time: u, unread: d, hasAttachment: a, selected: r, onOpen: s, labels: m }) {
1163
- const b = ce(pn, m);
1164
- return /* @__PURE__ */ o(
1178
+ const _n = { attachment: "Has an attachment", unread: "Unread" };
1179
+ function Jn({ from: n, subject: l, preview: t, time: o, unread: i, hasAttachment: s, selected: r, onOpen: a, labels: h }) {
1180
+ const _ = ce(_n, h);
1181
+ return /* @__PURE__ */ u(
1165
1182
  "button",
1166
1183
  {
1167
1184
  type: "button",
1168
- className: E("cms-mail-row", d && "is-unread", r && "is-selected"),
1185
+ className: A("cms-mail-row", i && "is-unread", r && "is-selected"),
1169
1186
  "aria-current": r ? "true" : void 0,
1170
- onClick: s,
1187
+ onClick: a,
1171
1188
  children: [
1172
1189
  /* @__PURE__ */ e(ve, { name: n, size: 40 }),
1173
- /* @__PURE__ */ o("span", { className: "cms-mail-row__body", children: [
1174
- /* @__PURE__ */ o("span", { className: "cms-mail-row__line", children: [
1190
+ /* @__PURE__ */ u("span", { className: "cms-mail-row__body", children: [
1191
+ /* @__PURE__ */ u("span", { className: "cms-mail-row__line", children: [
1175
1192
  /* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
1176
- a ? /* @__PURE__ */ e(T, { name: "paperclip", size: 16, label: b.attachment }) : null,
1177
- /* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: u })
1193
+ s ? /* @__PURE__ */ e(T, { name: "paperclip", size: 16, label: _.attachment }) : null,
1194
+ /* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: o })
1178
1195
  ] }),
1179
- /* @__PURE__ */ o("span", { className: "cms-mail-row__line", children: [
1196
+ /* @__PURE__ */ u("span", { className: "cms-mail-row__line", children: [
1180
1197
  /* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
1181
- d ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": b.unread }) : null
1198
+ i ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": _.unread }) : null
1182
1199
  ] }),
1183
1200
  /* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: t })
1184
1201
  ] })
@@ -1186,49 +1203,49 @@ function Wn({ from: n, subject: l, preview: t, time: u, unread: d, hasAttachment
1186
1203
  }
1187
1204
  );
1188
1205
  }
1189
- function jn({ direction: n, children: l, time: t, read: u, readLabel: d = "Read" }) {
1190
- return /* @__PURE__ */ o("div", { className: E("cms-bubble", `cms-bubble--${n}`), children: [
1206
+ function Qn({ direction: n, children: l, time: t, read: o, readLabel: i = "Read" }) {
1207
+ return /* @__PURE__ */ u("div", { className: A("cms-bubble", `cms-bubble--${n}`), children: [
1191
1208
  /* @__PURE__ */ e("div", { className: "cms-bubble__text", children: l }),
1192
- /* @__PURE__ */ o("div", { className: "cms-bubble__meta", children: [
1209
+ /* @__PURE__ */ u("div", { className: "cms-bubble__meta", children: [
1193
1210
  t,
1194
- n === "out" && u ? /* @__PURE__ */ o(C, { children: [
1211
+ n === "out" && o ? /* @__PURE__ */ u(M, { children: [
1195
1212
  " · ",
1196
- d
1213
+ i
1197
1214
  ] }) : null
1198
1215
  ] })
1199
1216
  ] });
1200
1217
  }
1201
- function qn({ label: n, value: l, onChange: t, onSend: u, onAttach: d, placeholder: a, variant: r = "chat", sendLabel: s = "Send", attachLabel: m = "Attach a file", leading: b, canSend: c }) {
1202
- const h = q(), i = c ?? l.trim() !== "", f = (g) => {
1203
- g.preventDefault(), i && u();
1204
- }, p = d ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": m, onClick: d, children: /* @__PURE__ */ e(T, { name: "paperclip" }) }) : null;
1205
- return /* @__PURE__ */ o("form", { className: E("cms-composer", `cms-composer--${r}`), onSubmit: f, children: [
1206
- /* @__PURE__ */ e("label", { htmlFor: h, className: r === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
1218
+ function el({ label: n, value: l, onChange: t, onSend: o, onAttach: i, placeholder: s, variant: r = "chat", sendLabel: a = "Send", attachLabel: h = "Attach a file", leading: _, canSend: d }) {
1219
+ const m = G(), c = d ?? l.trim() !== "", f = (g) => {
1220
+ g.preventDefault(), c && o();
1221
+ }, p = i ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": h, onClick: i, children: /* @__PURE__ */ e(T, { name: "paperclip" }) }) : null;
1222
+ return /* @__PURE__ */ u("form", { className: A("cms-composer", `cms-composer--${r}`), onSubmit: f, children: [
1223
+ /* @__PURE__ */ e("label", { htmlFor: m, className: r === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
1207
1224
  r === "chat" ? p : null,
1208
1225
  /* @__PURE__ */ e(
1209
1226
  "textarea",
1210
1227
  {
1211
- id: h,
1228
+ id: m,
1212
1229
  className: "cms-composer__input",
1213
1230
  rows: r === "reply" ? 3 : 1,
1214
- placeholder: a,
1231
+ placeholder: s,
1215
1232
  value: l,
1216
1233
  onChange: (g) => t(g.target.value),
1217
1234
  onKeyDown: (g) => {
1218
- g.nativeEvent.isComposing || g.keyCode === 229 || r === "chat" && g.key === "Enter" && !g.shiftKey && (g.preventDefault(), i && u());
1235
+ g.nativeEvent.isComposing || g.keyCode === 229 || r === "chat" && g.key === "Enter" && !g.shiftKey && (g.preventDefault(), c && o());
1219
1236
  }
1220
1237
  }
1221
1238
  ),
1222
- r === "reply" && b !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: b }) : null,
1239
+ r === "reply" && _ !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: _ }) : null,
1223
1240
  r === "reply" ? p : null,
1224
- r === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": s, disabled: !i, children: /* @__PURE__ */ e(T, { name: "send" }) }) : /* @__PURE__ */ o("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !i, children: [
1225
- s,
1241
+ r === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": a, disabled: !c, children: /* @__PURE__ */ e(T, { name: "send" }) }) : /* @__PURE__ */ u("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !c, children: [
1242
+ a,
1226
1243
  " ",
1227
1244
  /* @__PURE__ */ e(T, { name: "send", size: 18 })
1228
1245
  ] })
1229
1246
  ] });
1230
1247
  }
1231
- const Ae = {
1248
+ const Ee = {
1232
1249
  incomingAudio: "Incoming audio call",
1233
1250
  incomingVideo: "Incoming video call",
1234
1251
  incomingFrom: (n, l) => `${n} from ${l}`,
@@ -1249,25 +1266,25 @@ const Ae = {
1249
1266
  onCallWith: (n) => `On a call with ${n}`,
1250
1267
  returnToCall: "Return to call"
1251
1268
  };
1252
- function Yn({ name: n, media: l, onAccept: t, onDecline: u, labels: d }) {
1253
- const a = ce(Ae, d), r = l === "video" ? a.incomingVideo : a.incomingAudio;
1254
- return /* @__PURE__ */ o("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": a.incomingFrom(r, n), children: [
1269
+ function nl({ name: n, media: l, onAccept: t, onDecline: o, labels: i }) {
1270
+ const s = ce(Ee, i), r = l === "video" ? s.incomingVideo : s.incomingAudio;
1271
+ return /* @__PURE__ */ u("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": s.incomingFrom(r, n), children: [
1255
1272
  /* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(ve, { name: n, size: 112 }) }),
1256
1273
  /* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: n }),
1257
1274
  /* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: r }),
1258
- /* @__PURE__ */ o("div", { className: "cms-call-incoming__actions", children: [
1259
- /* @__PURE__ */ e(ae, { icon: "phone-off", label: a.decline, tone: "hang-up", onClick: u }),
1260
- /* @__PURE__ */ e(ae, { icon: "phone", label: a.accept, tone: "accept", onClick: t })
1275
+ /* @__PURE__ */ u("div", { className: "cms-call-incoming__actions", children: [
1276
+ /* @__PURE__ */ e(ae, { icon: "phone-off", label: s.decline, tone: "hang-up", onClick: o }),
1277
+ /* @__PURE__ */ e(ae, { icon: "phone", label: s.accept, tone: "accept", onClick: t })
1261
1278
  ] })
1262
1279
  ] });
1263
1280
  }
1264
- function ae({ icon: n, label: l, onClick: t, tone: u = "plain", pressed: d }) {
1265
- return /* @__PURE__ */ o(
1281
+ function ae({ icon: n, label: l, onClick: t, tone: o = "plain", pressed: i }) {
1282
+ return /* @__PURE__ */ u(
1266
1283
  "button",
1267
1284
  {
1268
1285
  type: "button",
1269
- className: E("cms-call-button", `cms-call-button--${u}`, d && "is-pressed"),
1270
- "aria-pressed": d,
1286
+ className: A("cms-call-button", `cms-call-button--${o}`, i && "is-pressed"),
1287
+ "aria-pressed": i,
1271
1288
  onClick: t,
1272
1289
  children: [
1273
1290
  /* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(T, { name: n, size: 24 }) }),
@@ -1276,61 +1293,61 @@ function ae({ icon: n, label: l, onClick: t, tone: u = "plain", pressed: d }) {
1276
1293
  }
1277
1294
  );
1278
1295
  }
1279
- function Xn({ name: n, duration: l, connection: t, you: u, muted: d, speaker: a, onToggleMute: r, onToggleSpeaker: s, onAddPerson: m, onChat: b, onHangUp: c, labels: h }) {
1280
- const i = ce(Ae, h);
1281
- return /* @__PURE__ */ o("section", { className: "cms-call-panel", "aria-label": i.callWith(n), children: [
1282
- /* @__PURE__ */ o("div", { className: "cms-call-panel__head", children: [
1296
+ function ll({ name: n, duration: l, connection: t, you: o, muted: i, speaker: s, onToggleMute: r, onToggleSpeaker: a, onAddPerson: h, onChat: _, onHangUp: d, labels: m }) {
1297
+ const c = ce(Ee, m);
1298
+ return /* @__PURE__ */ u("section", { className: "cms-call-panel", "aria-label": c.callWith(n), children: [
1299
+ /* @__PURE__ */ u("div", { className: "cms-call-panel__head", children: [
1283
1300
  /* @__PURE__ */ e(ve, { name: n, size: 64 }),
1284
- /* @__PURE__ */ o("div", { className: "cms-call-panel__who", children: [
1301
+ /* @__PURE__ */ u("div", { className: "cms-call-panel__who", children: [
1285
1302
  /* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
1286
- /* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": i.callTime(l), children: l })
1303
+ /* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": c.callTime(l), children: l })
1287
1304
  ] }),
1288
- /* @__PURE__ */ e("span", { className: E("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? i.goodConnection : i.poorConnection })
1305
+ /* @__PURE__ */ e("span", { className: A("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? c.goodConnection : c.poorConnection })
1289
1306
  ] }),
1290
- /* @__PURE__ */ o("div", { className: "cms-call-panel__you", children: [
1291
- /* @__PURE__ */ e(ve, { name: u.name, size: 36 }),
1292
- /* @__PURE__ */ e("span", { children: i.you }),
1293
- u.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": i.speaking }) : null
1307
+ /* @__PURE__ */ u("div", { className: "cms-call-panel__you", children: [
1308
+ /* @__PURE__ */ e(ve, { name: o.name, size: 36 }),
1309
+ /* @__PURE__ */ e("span", { children: c.you }),
1310
+ o.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": c.speaking }) : null
1294
1311
  ] }),
1295
- /* @__PURE__ */ o("div", { className: "cms-call-panel__controls", children: [
1296
- /* @__PURE__ */ e(ae, { icon: "mic", label: d ? i.unmute : i.mute, pressed: d, onClick: r }),
1297
- /* @__PURE__ */ e(ae, { icon: "speaker", label: i.speaker, pressed: a, onClick: s }),
1298
- m ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: i.addPerson, onClick: m }) : null,
1299
- b ? /* @__PURE__ */ e(ae, { icon: "chat", label: i.chat, onClick: b }) : null,
1300
- /* @__PURE__ */ e(ae, { icon: "phone-off", label: i.hangUp, tone: "hang-up", onClick: c })
1312
+ /* @__PURE__ */ u("div", { className: "cms-call-panel__controls", children: [
1313
+ /* @__PURE__ */ e(ae, { icon: "mic", label: i ? c.unmute : c.mute, pressed: i, onClick: r }),
1314
+ /* @__PURE__ */ e(ae, { icon: "speaker", label: c.speaker, pressed: s, onClick: a }),
1315
+ h ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: c.addPerson, onClick: h }) : null,
1316
+ _ ? /* @__PURE__ */ e(ae, { icon: "chat", label: c.chat, onClick: _ }) : null,
1317
+ /* @__PURE__ */ e(ae, { icon: "phone-off", label: c.hangUp, tone: "hang-up", onClick: d })
1301
1318
  ] })
1302
1319
  ] });
1303
1320
  }
1304
- function Gn({ name: n, duration: l, muted: t, onToggleMute: u, onReturn: d, onHangUp: a, labels: r }) {
1305
- const s = ce(Ae, r);
1306
- return /* @__PURE__ */ o("section", { className: "cms-call-bar", "aria-label": s.callWith(n), children: [
1321
+ function tl({ name: n, duration: l, muted: t, onToggleMute: o, onReturn: i, onHangUp: s, labels: r }) {
1322
+ const a = ce(Ee, r);
1323
+ return /* @__PURE__ */ u("section", { className: "cms-call-bar", "aria-label": a.callWith(n), children: [
1307
1324
  /* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
1308
- /* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: s.onCallWith(n) }),
1325
+ /* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: a.onCallWith(n) }),
1309
1326
  /* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: l }),
1310
- /* @__PURE__ */ o("span", { className: "cms-call-bar__actions", children: [
1311
- /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ? s.unmute : s.mute, "aria-pressed": t, onClick: u, children: /* @__PURE__ */ e(T, { name: "mic" }) }),
1312
- /* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: d, children: s.returnToCall }),
1313
- /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": s.hangUp, onClick: a, children: /* @__PURE__ */ e(T, { name: "phone-off" }) })
1327
+ /* @__PURE__ */ u("span", { className: "cms-call-bar__actions", children: [
1328
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ? a.unmute : a.mute, "aria-pressed": t, onClick: o, children: /* @__PURE__ */ e(T, { name: "mic" }) }),
1329
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: i, children: a.returnToCall }),
1330
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": a.hangUp, onClick: s, children: /* @__PURE__ */ e(T, { name: "phone-off" }) })
1314
1331
  ] })
1315
1332
  ] });
1316
1333
  }
1317
- function Jn({ mark: n, product: l, headline: t, lead: u, features: d = [], children: a }) {
1318
- return /* @__PURE__ */ o("div", { className: "cms-signin", children: [
1319
- /* @__PURE__ */ o("aside", { className: "cms-signin__brand", children: [
1320
- /* @__PURE__ */ o("p", { className: "cms-signin__logo", children: [
1334
+ function al({ mark: n, product: l, headline: t, lead: o, features: i = [], children: s }) {
1335
+ return /* @__PURE__ */ u("div", { className: "cms-signin", children: [
1336
+ /* @__PURE__ */ u("aside", { className: "cms-signin__brand", children: [
1337
+ /* @__PURE__ */ u("p", { className: "cms-signin__logo", children: [
1321
1338
  /* @__PURE__ */ e("span", { className: "cms-signin__mark", "aria-hidden": "true", children: n }),
1322
1339
  l
1323
1340
  ] }),
1324
- /* @__PURE__ */ o("div", { className: "cms-signin__pitch", children: [
1341
+ /* @__PURE__ */ u("div", { className: "cms-signin__pitch", children: [
1325
1342
  /* @__PURE__ */ e("p", { className: "cms-signin__headline", children: t }),
1326
- /* @__PURE__ */ e("p", { className: "cms-signin__lead", children: u }),
1327
- d.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: d.map((r) => /* @__PURE__ */ o("li", { children: [
1343
+ /* @__PURE__ */ e("p", { className: "cms-signin__lead", children: o }),
1344
+ i.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: i.map((r) => /* @__PURE__ */ u("li", { children: [
1328
1345
  /* @__PURE__ */ e(T, { name: r.icon, size: 18 }),
1329
1346
  r.label
1330
1347
  ] }, r.label)) }) : null
1331
1348
  ] })
1332
1349
  ] }),
1333
- /* @__PURE__ */ e("main", { className: "cms-signin__form", children: a })
1350
+ /* @__PURE__ */ e("main", { className: "cms-signin__form", children: s })
1334
1351
  ] });
1335
1352
  }
1336
1353
  const bn = {
@@ -1345,131 +1362,138 @@ const bn = {
1345
1362
  newHere: "New here?",
1346
1363
  create: "Create an account"
1347
1364
  };
1348
- function Qn({ server: n, onSubmit: l, forgotHref: t, createHref: u, error: d, busy: a, labels: r }) {
1349
- const s = ce(bn, r), m = q(), [b, c] = A(""), [h, i] = A(""), [f, p] = A(!1);
1350
- return /* @__PURE__ */ o("form", { className: "cms-signin-form", onSubmit: (N) => {
1351
- N.preventDefault(), l(b, h);
1352
- }, "aria-describedby": d ? `${m}-error` : void 0, children: [
1353
- /* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: s.title }),
1354
- /* @__PURE__ */ o("p", { className: "cms-signin-form__server", children: [
1365
+ function sl({ server: n, onSubmit: l, forgotHref: t, createHref: o, error: i, busy: s, labels: r }) {
1366
+ const a = ce(bn, r), h = G(), [_, d] = E(""), [m, c] = E(""), [f, p] = E(!1);
1367
+ return /* @__PURE__ */ u("form", { className: "cms-signin-form", onSubmit: (N) => {
1368
+ N.preventDefault(), l(_, m);
1369
+ }, "aria-describedby": i ? `${h}-error` : void 0, children: [
1370
+ /* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: a.title }),
1371
+ /* @__PURE__ */ u("p", { className: "cms-signin-form__server", children: [
1355
1372
  /* @__PURE__ */ e(T, { name: "server", size: 18 }),
1356
1373
  n
1357
1374
  ] }),
1358
- /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${m}-identifier`, children: s.identifier }),
1375
+ /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${h}-identifier`, children: a.identifier }),
1359
1376
  /* @__PURE__ */ e(
1360
1377
  "input",
1361
1378
  {
1362
- id: `${m}-identifier`,
1379
+ id: `${h}-identifier`,
1363
1380
  className: "cms-signin-form__input",
1364
1381
  type: "text",
1365
1382
  autoComplete: "username",
1366
- placeholder: s.identifierPlaceholder,
1367
- value: b,
1368
- onChange: (N) => c(N.target.value),
1383
+ placeholder: a.identifierPlaceholder,
1384
+ value: _,
1385
+ onChange: (N) => d(N.target.value),
1369
1386
  required: !0
1370
1387
  }
1371
1388
  ),
1372
- /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${m}-password`, children: s.password }),
1373
- /* @__PURE__ */ o("span", { className: "cms-signin-form__password", children: [
1389
+ /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${h}-password`, children: a.password }),
1390
+ /* @__PURE__ */ u("span", { className: "cms-signin-form__password", children: [
1374
1391
  /* @__PURE__ */ e(
1375
1392
  "input",
1376
1393
  {
1377
- id: `${m}-password`,
1394
+ id: `${h}-password`,
1378
1395
  className: "cms-signin-form__input",
1379
1396
  type: f ? "text" : "password",
1380
1397
  autoComplete: "current-password",
1381
- value: h,
1382
- onChange: (N) => i(N.target.value),
1398
+ value: m,
1399
+ onChange: (N) => c(N.target.value),
1383
1400
  required: !0
1384
1401
  }
1385
1402
  ),
1386
- /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": f, onClick: () => p((N) => !N), children: f ? s.hide : s.show })
1403
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": f, onClick: () => p((N) => !N), children: f ? a.hide : a.show })
1387
1404
  ] }),
1388
- t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children: s.forgot }) : null,
1389
- d ? /* @__PURE__ */ e("p", { id: `${m}-error`, className: "cms-signin-form__error", role: "alert", children: d }) : null,
1390
- /* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: a, "aria-busy": a || void 0, children: s.submit }),
1391
- u ? /* @__PURE__ */ o(C, { children: [
1392
- /* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: s.newHere }) }),
1393
- /* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: u, children: s.create })
1405
+ t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children: a.forgot }) : null,
1406
+ i ? /* @__PURE__ */ e("p", { id: `${h}-error`, className: "cms-signin-form__error", role: "alert", children: i }) : null,
1407
+ /* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: s, "aria-busy": s || void 0, children: a.submit }),
1408
+ o ? /* @__PURE__ */ u(M, { children: [
1409
+ /* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: a.newHere }) }),
1410
+ /* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: o, children: a.create })
1394
1411
  ] }) : null
1395
1412
  ] });
1396
1413
  }
1397
1414
  const we = 64;
1398
- function _n(n, l) {
1399
- const [t, u] = A(0), d = K(l);
1400
- return d.current = l, J(() => {
1401
- const a = n.current;
1402
- if (a === null) return;
1403
- let r = null, s = 0;
1404
- const m = (h) => {
1405
- r = a.scrollTop <= 0 && h.touches.length === 1 ? h.touches[0].clientY : null, s = 0;
1406
- }, b = (h) => {
1407
- if (r === null || d.current === null) return;
1408
- const i = h.touches[0].clientY - r;
1409
- if (i <= 0) {
1410
- r = null, u(0);
1415
+ function vn(n, l) {
1416
+ for (let t = n instanceof Element ? n : null; t !== null; t = t.parentElement) {
1417
+ if (t instanceof HTMLElement && t.scrollTop > 0) return !1;
1418
+ if (t === l) return !0;
1419
+ }
1420
+ return l.scrollTop <= 0;
1421
+ }
1422
+ function gn(n, l) {
1423
+ const [t, o] = E(0), i = R(l);
1424
+ return i.current = l, Y(() => {
1425
+ const s = n.current;
1426
+ if (s === null) return;
1427
+ let r = null, a = 0;
1428
+ const h = (m) => {
1429
+ r = vn(m.target, s) && m.touches.length === 1 ? m.touches[0].clientY : null, a = 0;
1430
+ }, _ = (m) => {
1431
+ if (r === null || i.current === null) return;
1432
+ const c = m.touches[0].clientY - r;
1433
+ if (c <= 0) {
1434
+ r = null, o(0);
1411
1435
  return;
1412
1436
  }
1413
- h.cancelable && h.preventDefault(), s = Math.min(i * 0.6, we * 1.5), u(s);
1414
- }, c = () => {
1415
- var h;
1416
- r !== null && s >= we && ((h = d.current) == null || h.call(d)), r = null, s = 0, u(0);
1437
+ m.cancelable && m.preventDefault(), a = Math.min(c * 0.6, we * 1.5), o(a);
1438
+ }, d = () => {
1439
+ var m;
1440
+ r !== null && a >= we && ((m = i.current) == null || m.call(i)), r = null, a = 0, o(0);
1417
1441
  };
1418
- return a.addEventListener("touchstart", m, { passive: !0 }), a.addEventListener("touchmove", b, { passive: !1 }), a.addEventListener("touchend", c), a.addEventListener("touchcancel", c), () => {
1419
- a.removeEventListener("touchstart", m), a.removeEventListener("touchmove", b), a.removeEventListener("touchend", c), a.removeEventListener("touchcancel", c);
1442
+ return s.addEventListener("touchstart", h, { passive: !0 }), s.addEventListener("touchmove", _, { passive: !1 }), s.addEventListener("touchend", d), s.addEventListener("touchcancel", d), () => {
1443
+ s.removeEventListener("touchstart", h), s.removeEventListener("touchmove", _), s.removeEventListener("touchend", d), s.removeEventListener("touchcancel", d);
1420
1444
  };
1421
1445
  }, [n]), t;
1422
1446
  }
1423
- const Be = Ue(null);
1424
- function vn() {
1425
- return Oe(Be);
1447
+ const Fe = Ue(null);
1448
+ function Nn() {
1449
+ return Ke(Fe);
1426
1450
  }
1427
- function el({ label: n, rows: l, error: t, onRetry: u, loadingText: d = "Loading", emptyTitle: a = "Nothing here yet", emptyHint: r, selected: s, onOpen: m, onRowMenu: b }) {
1428
- const c = K([]), h = vn();
1429
- if (t != null) return /* @__PURE__ */ e(Ye, { message: t, onRetry: u });
1430
- if (l === null) return /* @__PURE__ */ e(je, { what: d, layout: "block" });
1431
- if (l.length === 0) return /* @__PURE__ */ e(qe, { title: a, hint: r });
1432
- const i = (f, p, g) => {
1451
+ function rl({ label: n, rows: l, error: t, onRetry: o, loadingText: i = "Loading", emptyTitle: s = "Nothing here yet", emptyHint: r, selected: a, onOpen: h, onRowMenu: _ }) {
1452
+ const d = R([]), m = Nn();
1453
+ if (t != null) return /* @__PURE__ */ e(Ge, { message: t, onRetry: o });
1454
+ if (l === null) return /* @__PURE__ */ e(qe, { what: i, layout: "block" });
1455
+ if (l.length === 0) return /* @__PURE__ */ e(Ye, { title: s, hint: r });
1456
+ const c = (f, p, g) => {
1433
1457
  var N;
1434
1458
  if (f.key === "ArrowDown" || f.key === "ArrowUp")
1435
- f.preventDefault(), (N = c.current[Math.min(l.length - 1, Math.max(0, p + (f.key === "ArrowDown" ? 1 : -1)))]) == null || N.focus();
1459
+ f.preventDefault(), (N = d.current[Math.min(l.length - 1, Math.max(0, p + (f.key === "ArrowDown" ? 1 : -1)))]) == null || N.focus();
1436
1460
  else if (f.key === "Enter")
1437
- m == null || m(g);
1438
- else if ((f.key === "ContextMenu" || f.shiftKey && f.key === "F10") && b) {
1461
+ h == null || h(g);
1462
+ else if ((f.key === "ContextMenu" || f.shiftKey && f.key === "F10") && _) {
1439
1463
  f.preventDefault();
1440
- const y = f.currentTarget.getBoundingClientRect();
1441
- b(g, { x: y.left + 16, y: y.bottom });
1464
+ const w = f.currentTarget.getBoundingClientRect();
1465
+ _(g, { x: w.left + 16, y: w.bottom });
1442
1466
  }
1443
1467
  };
1444
- return /* @__PURE__ */ o(C, { children: [
1445
- h !== null && (h.distance > 0 || h.refreshing) ? /* @__PURE__ */ o("div", { className: "cms-list__pull", role: "status", style: { height: h.refreshing ? void 0 : h.distance }, "data-ready": h.distance >= we ? "" : void 0, children: [
1446
- h.refreshing ? /* @__PURE__ */ e(R, { name: "spinner" }) : null,
1447
- h.text != null ? /* @__PURE__ */ e("span", { className: "cms-list__pull-text", children: h.text }) : null
1468
+ return /* @__PURE__ */ u(M, { children: [
1469
+ m !== null && (m.distance > 0 || m.refreshing) ? /* @__PURE__ */ u("div", { className: "cms-list__pull", role: "status", style: { height: m.refreshing ? void 0 : m.distance }, "data-ready": m.distance >= we ? "" : void 0, children: [
1470
+ m.refreshing ? /* @__PURE__ */ e(z, { name: "spinner" }) : null,
1471
+ m.text != null ? /* @__PURE__ */ e("span", { className: "cms-list__pull-text", children: m.text }) : null
1448
1472
  ] }) : null,
1449
1473
  /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((f, p) => {
1450
- const g = f.id === s;
1451
- return /* @__PURE__ */ o(
1474
+ const g = f.id === a;
1475
+ return /* @__PURE__ */ u(
1452
1476
  "li",
1453
1477
  {
1454
1478
  ref: (N) => {
1455
- c.current[p] = N;
1479
+ d.current[p] = N;
1456
1480
  },
1457
1481
  role: "option",
1458
1482
  "aria-selected": g,
1459
- tabIndex: g || s == null && p === 0 ? 0 : -1,
1460
- className: E("cms-list__row", g && "is-selected"),
1461
- onClick: () => m == null ? void 0 : m(f.id),
1462
- onKeyDown: (N) => i(N, p, f.id),
1463
- onContextMenu: b ? (N) => {
1464
- N.preventDefault(), b(f.id, { x: N.clientX, y: N.clientY });
1483
+ tabIndex: g || a == null && p === 0 ? 0 : -1,
1484
+ className: A("cms-list__row", g && "is-selected"),
1485
+ onClick: () => h == null ? void 0 : h(f.id),
1486
+ onKeyDown: (N) => c(N, p, f.id),
1487
+ onContextMenu: _ ? (N) => {
1488
+ N.preventDefault(), _(f.id, { x: N.clientX, y: N.clientY });
1465
1489
  } : void 0,
1466
1490
  children: [
1467
1491
  f.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: f.lead }) : null,
1468
- /* @__PURE__ */ o("span", { className: "cms-list__text", children: [
1469
- /* @__PURE__ */ e("span", { className: E("cms-list__primary", f.unread === !0 && "is-unread"), children: f.primary }),
1492
+ /* @__PURE__ */ u("span", { className: "cms-list__text", children: [
1493
+ /* @__PURE__ */ e("span", { className: A("cms-list__primary", f.unread === !0 && "is-unread"), children: f.primary }),
1470
1494
  f.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: f.secondary }) : null
1471
1495
  ] }),
1472
- f.meta != null || f.count !== void 0 ? /* @__PURE__ */ o("span", { className: "cms-list__end", children: [
1496
+ f.meta != null || f.count !== void 0 ? /* @__PURE__ */ u("span", { className: "cms-list__end", children: [
1473
1497
  f.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: f.meta }) : null,
1474
1498
  f.count !== void 0 && f.count > 0 ? /* @__PURE__ */ e("span", { className: "cms-badge cms-list__count", children: f.count }) : null
1475
1499
  ] }) : null
@@ -1480,73 +1504,73 @@ function el({ label: n, rows: l, error: t, onRetry: u, loadingText: d = "Loading
1480
1504
  }) })
1481
1505
  ] });
1482
1506
  }
1483
- function Fe({ at: n, items: l, onClose: t, label: u = "Actions", focus: d = "first" }) {
1484
- const a = K(null), r = K(null), s = q(), [m, b] = A(n), c = l.filter((i) => i.offer.offered);
1507
+ function He({ at: n, items: l, onClose: t, label: o = "Actions", focus: i = "first" }) {
1508
+ const s = R(null), r = R(null), a = G(), [h, _] = E(n), d = l.filter((c) => c.offer.offered);
1485
1509
  if (xe(() => {
1486
1510
  if (!n) return;
1487
- const i = a.current, f = (i == null ? void 0 : i.offsetWidth) ?? 0, p = (i == null ? void 0 : i.offsetHeight) ?? 0;
1488
- b({ x: Math.max(0, Math.min(n.x, window.innerWidth - f)), y: Math.max(0, Math.min(n.y, window.innerHeight - p)) });
1489
- }, [n]), J(() => {
1511
+ const c = s.current, f = (c == null ? void 0 : c.offsetWidth) ?? 0, p = (c == null ? void 0 : c.offsetHeight) ?? 0;
1512
+ _({ x: Math.max(0, Math.min(n.x, window.innerWidth - f)), y: Math.max(0, Math.min(n.y, window.innerHeight - p)) });
1513
+ }, [n]), Y(() => {
1490
1514
  var p, g;
1491
1515
  if (!n) return;
1492
1516
  r.current = document.activeElement;
1493
- const i = Array.from(((p = a.current) == null ? void 0 : p.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
1494
- (g = d === "last" ? i[i.length - 1] : i[0]) == null || g.focus();
1517
+ const c = Array.from(((p = s.current) == null ? void 0 : p.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
1518
+ (g = i === "last" ? c[c.length - 1] : c[0]) == null || g.focus();
1495
1519
  const f = (N) => {
1496
- var y;
1497
- (y = a.current) != null && y.contains(N.target) || t();
1520
+ var w;
1521
+ (w = s.current) != null && w.contains(N.target) || t();
1498
1522
  };
1499
1523
  return document.addEventListener("mousedown", f), () => {
1500
- var N, y;
1501
- document.removeEventListener("mousedown", f), (y = (N = r.current) == null ? void 0 : N.focus) == null || y.call(N);
1524
+ var N, w;
1525
+ document.removeEventListener("mousedown", f), (w = (N = r.current) == null ? void 0 : N.focus) == null || w.call(N);
1502
1526
  };
1503
- }, [n, t, d]), !n || c.length === 0) return null;
1504
- const h = (i) => {
1527
+ }, [n, t, i]), !n || d.length === 0) return null;
1528
+ const m = (c) => {
1505
1529
  var g, N;
1506
- const f = Array.from(((g = a.current) == null ? void 0 : g.querySelectorAll('[role="menuitem"]')) ?? []), p = f.indexOf(document.activeElement);
1507
- if (i.key === "Escape" || i.key === "Tab")
1508
- i.preventDefault(), t();
1509
- else if (i.key === "ArrowDown" || i.key === "ArrowUp") {
1510
- i.preventDefault();
1511
- const y = i.key === "ArrowDown" ? 1 : -1;
1512
- (N = f[(p + y + f.length) % f.length]) == null || N.focus();
1530
+ const f = Array.from(((g = s.current) == null ? void 0 : g.querySelectorAll('[role="menuitem"]')) ?? []), p = f.indexOf(document.activeElement);
1531
+ if (c.key === "Escape" || c.key === "Tab")
1532
+ c.preventDefault(), t();
1533
+ else if (c.key === "ArrowDown" || c.key === "ArrowUp") {
1534
+ c.preventDefault();
1535
+ const w = c.key === "ArrowDown" ? 1 : -1;
1536
+ (N = f[(p + w + f.length) % f.length]) == null || N.focus();
1513
1537
  }
1514
1538
  };
1515
1539
  return Me(
1516
1540
  /* @__PURE__ */ e(
1517
1541
  "div",
1518
1542
  {
1519
- ref: a,
1543
+ ref: s,
1520
1544
  className: "cms-menu",
1521
1545
  role: "menu",
1522
- "aria-label": u,
1523
- style: { left: (m ?? n).x, top: (m ?? n).y },
1524
- onKeyDown: h,
1525
- onContextMenu: (i) => i.preventDefault(),
1526
- children: c.map((i) => {
1527
- const f = i.offer.refusal !== void 0;
1528
- return /* @__PURE__ */ o(
1546
+ "aria-label": o,
1547
+ style: { left: (h ?? n).x, top: (h ?? n).y },
1548
+ onKeyDown: m,
1549
+ onContextMenu: (c) => c.preventDefault(),
1550
+ children: d.map((c) => {
1551
+ const f = c.offer.refusal !== void 0;
1552
+ return /* @__PURE__ */ u(
1529
1553
  "div",
1530
1554
  {
1531
1555
  role: "menuitem",
1532
1556
  tabIndex: -1,
1533
1557
  "aria-disabled": f || void 0,
1534
- "aria-describedby": f ? `${s}-${i.id}` : void 0,
1535
- title: f ? i.offer.refusal : void 0,
1536
- className: E("cms-menu__item", i.danger && "is-danger", i.offer.locked && "is-locked", f && "is-refused"),
1558
+ "aria-describedby": f ? `${a}-${c.id}` : void 0,
1559
+ title: f ? c.offer.refusal : void 0,
1560
+ className: A("cms-menu__item", c.danger && "is-danger", c.offer.locked && "is-locked", f && "is-refused"),
1537
1561
  onClick: () => {
1538
- f || (t(), i.onSelect());
1562
+ f || (t(), c.onSelect());
1539
1563
  },
1540
1564
  onKeyDown: (p) => {
1541
- (p.key === "Enter" || p.key === " ") && !f && (p.preventDefault(), t(), i.onSelect());
1565
+ (p.key === "Enter" || p.key === " ") && !f && (p.preventDefault(), t(), c.onSelect());
1542
1566
  },
1543
1567
  children: [
1544
- i.offer.locked ? /* @__PURE__ */ e(R, { name: "lock" }) : null,
1545
- /* @__PURE__ */ e("span", { className: "cms-menu__label", children: i.label }),
1546
- f ? /* @__PURE__ */ e("span", { id: `${s}-${i.id}`, className: "cms-menu__refusal", children: i.offer.refusal }) : null
1568
+ c.offer.locked ? /* @__PURE__ */ e(z, { name: "lock" }) : null,
1569
+ /* @__PURE__ */ e("span", { className: "cms-menu__label", children: c.label }),
1570
+ f ? /* @__PURE__ */ e("span", { id: `${a}-${c.id}`, className: "cms-menu__refusal", children: c.offer.refusal }) : null
1547
1571
  ]
1548
1572
  },
1549
- i.id
1573
+ c.id
1550
1574
  );
1551
1575
  })
1552
1576
  }
@@ -1554,78 +1578,78 @@ function Fe({ at: n, items: l, onClose: t, label: u = "Actions", focus: d = "fir
1554
1578
  document.body
1555
1579
  );
1556
1580
  }
1557
- const Le = { bare: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Set() }, $e = (n, l) => n.size === l.size && [...n].every((t) => l.has(t));
1558
- function gn(n) {
1581
+ const De = { bare: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Set() }, $e = (n, l) => n.size === l.size && [...n].every((t) => l.has(t));
1582
+ function yn(n) {
1559
1583
  const l = /* @__PURE__ */ new Map();
1560
1584
  for (const t of n) l.set(t.group, [...l.get(t.group) ?? [], t]);
1561
1585
  return [...l.values()];
1562
1586
  }
1563
- function Nn(n) {
1587
+ function wn(n) {
1564
1588
  const l = /* @__PURE__ */ new Map();
1565
1589
  for (const t of n) t.overflow !== void 0 && t.overflow !== 0 && l.set(t.overflow, [...l.get(t.overflow) ?? [], t.id]);
1566
- return [...l.entries()].sort(([t], [u]) => t - u).map(([, t]) => t);
1590
+ return [...l.entries()].sort(([t], [o]) => t - o).map(([, t]) => t);
1567
1591
  }
1568
- function nl({ label: n, actions: l, onAction: t, status: u, moreLabel: d, leading: a }) {
1569
- const r = K(null), s = K(null), [m, b] = A(Le), [c, h] = A(null), [i, f] = A("first"), [p, g] = A(null), [N, y] = A(null), x = gn(l), S = Nn(l), M = x.flat(), z = M.filter((v) => v.overflow === 0), H = M.filter((v) => v.overflow !== 0), le = JSON.stringify([l.map((v) => [v.id, v.label, v.icon, v.group, v.overflow ?? null]), u ?? "", a !== void 0]), Q = _e(() => {
1570
- const v = r.current, D = s.current;
1571
- if (v === null || D === null) return;
1572
- const Z = getComputedStyle(v), W = parseFloat(Z.columnGap || "0") || 0, $ = v.clientWidth - (parseFloat(Z.paddingLeft) || 0) - (parseFloat(Z.paddingRight) || 0), j = (P) => {
1592
+ function cl({ label: n, actions: l, onAction: t, status: o, moreLabel: i, leading: s }) {
1593
+ const r = R(null), a = R(null), [h, _] = E(De), [d, m] = E(null), [c, f] = E("first"), [p, g] = E(null), [N, w] = E(null), x = yn(l), S = wn(l), C = x.flat(), F = C.filter((v) => v.overflow === 0), H = C.filter((v) => v.overflow !== 0), ee = JSON.stringify([l.map((v) => [v.id, v.label, v.icon, v.group, v.overflow ?? null]), o ?? "", s !== void 0]), j = be(() => {
1594
+ const v = r.current, L = a.current;
1595
+ if (v === null || L === null) return;
1596
+ const Z = getComputedStyle(v), W = parseFloat(Z.columnGap || "0") || 0, $ = v.clientWidth - (parseFloat(Z.paddingLeft) || 0) - (parseFloat(Z.paddingRight) || 0), q = (I) => {
1573
1597
  var U;
1574
- return ((U = D.querySelector(P)) == null ? void 0 : U.getBoundingClientRect().width) ?? 0;
1575
- }, de = j('[data-measure="leading"]'), ue = j('[data-measure="separator"]'), me = j('[data-measure="more"]'), he = (P, U) => j(`[data-measure="${U ? "full" : "icon"}"][data-measure-action="${CSS.escape(P)}"]`), _ = (P, U) => {
1576
- const G = /* @__PURE__ */ new Set([...z.map((te) => te.id), ...U]), se = x.map((te) => te.filter((pe) => !G.has(pe.id))).filter((te) => te.length > 0), fe = se.flat(), Ke = fe.length + (se.length - 1) + (G.size > 0 ? 1 : 0) + (de > 0 ? 1 : 0);
1577
- return de + fe.reduce((te, pe) => te + he(pe.id, !P.has(pe.id)), 0) + ue * Math.max(0, se.length - 1) + (G.size > 0 ? me : 0) + W * Math.max(0, Ke - 1);
1578
- }, k = H.filter((P) => !S.some((U) => U.includes(P.id))).map((P) => P.id), I = [...S, ...[...k].reverse().map((P) => [P])];
1579
- let O = null;
1580
- if (_(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= $) O = Le;
1598
+ return ((U = L.querySelector(I)) == null ? void 0 : U.getBoundingClientRect().width) ?? 0;
1599
+ }, de = q('[data-measure="leading"]'), ue = q('[data-measure="separator"]'), me = q('[data-measure="more"]'), he = (I, U) => q(`[data-measure="${U ? "full" : "icon"}"][data-measure-action="${CSS.escape(I)}"]`), b = (I, U) => {
1600
+ const Q = /* @__PURE__ */ new Set([...F.map((te) => te.id), ...U]), se = x.map((te) => te.filter((pe) => !Q.has(pe.id))).filter((te) => te.length > 0), fe = se.flat(), Re = fe.length + (se.length - 1) + (Q.size > 0 ? 1 : 0) + (de > 0 ? 1 : 0);
1601
+ return de + fe.reduce((te, pe) => te + he(pe.id, !I.has(pe.id)), 0) + ue * Math.max(0, se.length - 1) + (Q.size > 0 ? me : 0) + W * Math.max(0, Re - 1);
1602
+ }, k = H.filter((I) => !S.some((U) => U.includes(I.id))).map((I) => I.id), B = [...S, ...[...k].reverse().map((I) => [I])];
1603
+ let K = null;
1604
+ if (b(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= $) K = De;
1581
1605
  else {
1582
- const P = /* @__PURE__ */ new Set();
1583
- for (const U of I) {
1584
- for (const G of U) P.add(G);
1585
- if (_(P, /* @__PURE__ */ new Set()) <= $) {
1586
- O = { bare: P, hidden: /* @__PURE__ */ new Set() };
1606
+ const I = /* @__PURE__ */ new Set();
1607
+ for (const U of B) {
1608
+ for (const Q of U) I.add(Q);
1609
+ if (b(I, /* @__PURE__ */ new Set()) <= $) {
1610
+ K = { bare: I, hidden: /* @__PURE__ */ new Set() };
1587
1611
  break;
1588
1612
  }
1589
1613
  }
1590
1614
  }
1591
- if (O === null) {
1592
- const P = new Set(H.map((G) => G.id)), U = /* @__PURE__ */ new Set();
1593
- for (const G of S) {
1594
- for (const se of G) H.some((fe) => fe.id === se) && U.add(se);
1595
- if (U.size >= 2 && _(P, U) <= $) break;
1615
+ if (K === null) {
1616
+ const I = new Set(H.map((Q) => Q.id)), U = /* @__PURE__ */ new Set();
1617
+ for (const Q of S) {
1618
+ for (const se of Q) H.some((fe) => fe.id === se) && U.add(se);
1619
+ if (U.size >= 2 && b(I, U) <= $) break;
1596
1620
  }
1597
- if (_(P, U) > $) {
1598
- for (const G of [...k].reverse())
1599
- if (U.add(G), _(P, U) <= $) break;
1621
+ if (b(I, U) > $) {
1622
+ for (const Q of [...k].reverse())
1623
+ if (U.add(Q), b(I, U) <= $) break;
1600
1624
  }
1601
- O = { bare: P, hidden: U };
1625
+ K = { bare: I, hidden: U };
1602
1626
  }
1603
- const ge = O;
1604
- b((P) => $e(P.bare, ge.bare) && $e(P.hidden, ge.hidden) ? P : ge);
1605
- }, [le]);
1606
- xe(Q, [Q]), J(() => {
1627
+ const ge = K;
1628
+ _((I) => $e(I.bare, ge.bare) && $e(I.hidden, ge.hidden) ? I : ge);
1629
+ }, [ee]);
1630
+ xe(j, [j]), Y(() => {
1607
1631
  const v = r.current;
1608
1632
  if (v === null || typeof ResizeObserver > "u") return;
1609
- const D = new ResizeObserver(() => Q());
1610
- return D.observe(v), () => D.disconnect();
1611
- }, [Q]);
1612
- const w = /* @__PURE__ */ new Set([...z.map((v) => v.id), ...m.hidden]), V = x.map((v) => v.filter((D) => !w.has(D.id))).filter((v) => v.length > 0).flat(), L = [
1613
- ...z,
1614
- ...S.flat().map((v) => M.find((D) => D.id === v)).filter((v) => v !== void 0 && m.hidden.has(v.id)),
1633
+ const L = new ResizeObserver(() => j());
1634
+ return L.observe(v), () => L.disconnect();
1635
+ }, [j]);
1636
+ const y = /* @__PURE__ */ new Set([...F.map((v) => v.id), ...h.hidden]), V = x.map((v) => v.filter((L) => !y.has(L.id))).filter((v) => v.length > 0).flat(), D = [
1637
+ ...F,
1638
+ ...S.flat().map((v) => C.find((L) => L.id === v)).filter((v) => v !== void 0 && h.hidden.has(v.id)),
1615
1639
  // The pinned that a row too narrow for them sent behind ..., in the row's order.
1616
- ...H.filter((v) => m.hidden.has(v.id) && !S.some((D) => D.includes(v.id)))
1617
- ], Y = new Set(H.filter((v) => !S.some((D) => D.includes(v.id))).map((v) => v.id)), F = [...V.map((v) => v.id), ...L.length > 0 ? ["more"] : []], X = p !== null && F.includes(p) ? p : F[0] ?? null, ie = (v) => {
1618
- var $, j;
1619
- const D = F.indexOf(X ?? "");
1640
+ ...H.filter((v) => h.hidden.has(v.id) && !S.some((L) => L.includes(v.id)))
1641
+ ], X = new Set(H.filter((v) => !S.some((L) => L.includes(v.id))).map((v) => v.id)), O = [...V.map((v) => v.id), ...D.length > 0 ? ["more"] : []], J = p !== null && O.includes(p) ? p : O[0] ?? null, ie = (v) => {
1642
+ var $, q;
1643
+ const L = O.indexOf(J ?? "");
1620
1644
  let Z = null;
1621
- if (v.key === "ArrowRight" ? Z = Math.min(F.length - 1, D + 1) : v.key === "ArrowLeft" ? Z = Math.max(0, D - 1) : v.key === "Home" ? Z = 0 : v.key === "End" ? Z = F.length - 1 : v.key === "Escape" && y(X), Z === null) return;
1645
+ if (v.key === "ArrowRight" ? Z = Math.min(O.length - 1, L + 1) : v.key === "ArrowLeft" ? Z = Math.max(0, L - 1) : v.key === "Home" ? Z = 0 : v.key === "End" ? Z = O.length - 1 : v.key === "Escape" && w(J), Z === null) return;
1622
1646
  v.preventDefault();
1623
- const W = F[Z] ?? null;
1624
- g(W), (j = ($ = r.current) == null ? void 0 : $.querySelector(`[data-stop="${CSS.escape(W ?? "")}"]`)) == null || j.focus();
1625
- }, oe = L.map((v) => ({
1647
+ const W = O[Z] ?? null;
1648
+ g(W), (q = ($ = r.current) == null ? void 0 : $.querySelector(`[data-stop="${CSS.escape(W ?? "")}"]`)) == null || q.focus();
1649
+ }, oe = D.map((v) => ({
1626
1650
  id: v.id,
1627
- label: /* @__PURE__ */ o(C, { children: [
1628
- /* @__PURE__ */ e(be, { name: v.icon }),
1651
+ label: /* @__PURE__ */ u(M, { children: [
1652
+ /* @__PURE__ */ e(_e, { name: v.icon }),
1629
1653
  v.label
1630
1654
  ] }),
1631
1655
  offer: v.disabled ? { offered: !0, locked: !1, refusal: v.reason ?? "" } : { offered: !0, locked: !1 },
@@ -1634,168 +1658,168 @@ function nl({ label: n, actions: l, onAction: t, status: u, moreLabel: d, leadin
1634
1658
  !v.disabled && !v.busy && t(v.id);
1635
1659
  }
1636
1660
  }));
1637
- return /* @__PURE__ */ o(
1661
+ return /* @__PURE__ */ u(
1638
1662
  "div",
1639
1663
  {
1640
1664
  ref: r,
1641
1665
  role: "toolbar",
1642
1666
  "aria-label": n,
1643
- className: E(
1667
+ className: A(
1644
1668
  "cms-pane-toolbar",
1645
- H.length > 0 && m.bare.size >= H.length && "cms-pane-toolbar--labels-hidden",
1646
- m.bare.size > 0 && m.bare.size < H.length && "cms-pane-toolbar--labels-partly-hidden"
1669
+ H.length > 0 && h.bare.size >= H.length && "cms-pane-toolbar--labels-hidden",
1670
+ h.bare.size > 0 && h.bare.size < H.length && "cms-pane-toolbar--labels-partly-hidden"
1647
1671
  ),
1648
1672
  onKeyDown: ie,
1649
1673
  children: [
1650
- a !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: a }) : null,
1651
- x.map((v, D) => {
1652
- const Z = v.filter(($) => !w.has($.id)), W = x.slice(0, D).some(($) => $.some((j) => !w.has(j.id)));
1653
- return /* @__PURE__ */ o("div", { className: "cms-pane-toolbar__group-wrap", children: [
1674
+ s !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: s }) : null,
1675
+ x.map((v, L) => {
1676
+ const Z = v.filter(($) => !y.has($.id)), W = x.slice(0, L).some(($) => $.some((q) => !y.has(q.id)));
1677
+ return /* @__PURE__ */ u("div", { className: "cms-pane-toolbar__group-wrap", children: [
1654
1678
  Z.length > 0 && W ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
1655
1679
  /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: Z.length === 0, children: v.map(($) => /* @__PURE__ */ e(
1656
- yn,
1680
+ kn,
1657
1681
  {
1658
1682
  action: $,
1659
- labels: !m.bare.has($.id),
1660
- overflowed: w.has($.id),
1661
- pinned: Y.has($.id),
1662
- tabbable: X === $.id,
1683
+ labels: !h.bare.has($.id),
1684
+ overflowed: y.has($.id),
1685
+ pinned: X.has($.id),
1686
+ tabbable: J === $.id,
1663
1687
  tipOff: N === $.id,
1664
1688
  onChoose: () => t($.id),
1665
1689
  onFocus: () => {
1666
- g($.id), y(null);
1690
+ g($.id), w(null);
1667
1691
  }
1668
1692
  },
1669
1693
  $.id
1670
1694
  )) })
1671
- ] }, D);
1695
+ ] }, L);
1672
1696
  }),
1673
- L.length > 0 ? /* @__PURE__ */ e(
1697
+ D.length > 0 ? /* @__PURE__ */ e(
1674
1698
  "button",
1675
1699
  {
1676
1700
  type: "button",
1677
1701
  className: "cms-icon-button cms-pane-toolbar__more",
1678
1702
  "data-stop": "more",
1679
- "aria-label": d,
1680
- title: d,
1703
+ "aria-label": i,
1704
+ title: i,
1681
1705
  "aria-haspopup": "menu",
1682
- "aria-expanded": c !== null,
1683
- tabIndex: X === "more" ? 0 : -1,
1706
+ "aria-expanded": d !== null,
1707
+ tabIndex: J === "more" ? 0 : -1,
1684
1708
  onFocus: () => g("more"),
1685
1709
  onClick: (v) => {
1686
- const D = v.currentTarget.getBoundingClientRect();
1687
- f("first"), h(c === null ? { x: D.left, y: D.bottom } : null);
1710
+ const L = v.currentTarget.getBoundingClientRect();
1711
+ f("first"), m(d === null ? { x: L.left, y: L.bottom } : null);
1688
1712
  },
1689
1713
  onKeyDown: (v) => {
1690
1714
  if (v.key === "ArrowDown" || v.key === "ArrowUp") {
1691
1715
  v.preventDefault(), v.stopPropagation();
1692
- const D = v.currentTarget.getBoundingClientRect();
1693
- f(v.key === "ArrowUp" ? "last" : "first"), h({ x: D.left, y: D.bottom });
1716
+ const L = v.currentTarget.getBoundingClientRect();
1717
+ f(v.key === "ArrowUp" ? "last" : "first"), m({ x: L.left, y: L.bottom });
1694
1718
  }
1695
1719
  },
1696
1720
  children: /* @__PURE__ */ e(T, { name: "more" })
1697
1721
  }
1698
1722
  ) : null,
1699
- u !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: u, children: u }) : null,
1700
- /* @__PURE__ */ e(Fe, { at: c, items: oe, onClose: () => h(null), label: d, focus: i }),
1701
- /* @__PURE__ */ o("div", { ref: s, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
1702
- a !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: a }) : null,
1723
+ o !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: o, children: o }) : null,
1724
+ /* @__PURE__ */ e(He, { at: d, items: oe, onClose: () => m(null), label: i, focus: c }),
1725
+ /* @__PURE__ */ u("div", { ref: a, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
1726
+ s !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: s }) : null,
1703
1727
  /* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
1704
1728
  /* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(T, { name: "more" }) }),
1705
- M.map((v) => /* @__PURE__ */ o("span", { children: [
1706
- /* @__PURE__ */ o("span", { "data-measure": "full", "data-measure-action": v.id, className: "cms-pane-toolbar__action", children: [
1707
- /* @__PURE__ */ e(be, { name: v.icon }),
1729
+ C.map((v) => /* @__PURE__ */ u("span", { children: [
1730
+ /* @__PURE__ */ u("span", { "data-measure": "full", "data-measure-action": v.id, className: "cms-pane-toolbar__action", children: [
1731
+ /* @__PURE__ */ e(_e, { name: v.icon }),
1708
1732
  /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: v.label })
1709
1733
  ] }),
1710
- /* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": v.id, className: E("cms-pane-toolbar__action", re(v.icon) !== null && "cms-pane-toolbar__action--bare"), children: re(v.icon) !== null ? /* @__PURE__ */ e(be, { name: v.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: v.label }) })
1734
+ /* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": v.id, className: A("cms-pane-toolbar__action", re(v.icon) !== null && "cms-pane-toolbar__action--bare"), children: re(v.icon) !== null ? /* @__PURE__ */ e(_e, { name: v.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: v.label }) })
1711
1735
  ] }, v.id))
1712
1736
  ] })
1713
1737
  ]
1714
1738
  }
1715
1739
  );
1716
1740
  }
1717
- function yn({ action: n, labels: l, overflowed: t, pinned: u, tabbable: d, tipOff: a, onChoose: r, onFocus: s }) {
1718
- const [m, b] = A(!1);
1719
- J(() => {
1741
+ function kn({ action: n, labels: l, overflowed: t, pinned: o, tabbable: i, tipOff: s, onChoose: r, onFocus: a }) {
1742
+ const [h, _] = E(!1);
1743
+ Y(() => {
1720
1744
  if (!n.busy) {
1721
- b(!1);
1745
+ _(!1);
1722
1746
  return;
1723
1747
  }
1724
- const y = setTimeout(() => b(!0), ye);
1725
- return () => clearTimeout(y);
1748
+ const w = setTimeout(() => _(!0), ye);
1749
+ return () => clearTimeout(w);
1726
1750
  }, [n.busy]);
1727
- const c = re(n.icon) === null, h = l || c, i = n.disabled && n.reason ? n.reason : null, f = i ?? (h ? null : n.label), p = q(), [g, N] = A(!1);
1728
- return /* @__PURE__ */ o(
1751
+ const d = re(n.icon) === null, m = l || d, c = n.disabled && n.reason ? n.reason : null, f = c ?? (m ? null : n.label), p = G(), [g, N] = E(!1);
1752
+ return /* @__PURE__ */ u(
1729
1753
  "button",
1730
1754
  {
1731
1755
  type: "button",
1732
- className: E("cms-pane-toolbar__action", !h && "cms-pane-toolbar__action--bare", c && "cms-pane-toolbar__action--text", n.danger && "is-danger"),
1756
+ className: A("cms-pane-toolbar__action", !m && "cms-pane-toolbar__action--bare", d && "cms-pane-toolbar__action--text", n.danger && "is-danger"),
1733
1757
  "data-action": n.id,
1734
1758
  "data-stop": n.id,
1735
1759
  ...t ? { "data-overflowed": "" } : {},
1736
- ...u ? { "data-pinned": "" } : {},
1760
+ ...o ? { "data-pinned": "" } : {},
1737
1761
  hidden: t,
1738
1762
  "aria-label": n.label,
1739
1763
  "aria-disabled": n.disabled || void 0,
1740
1764
  "aria-busy": n.busy || void 0,
1741
- ...i === null ? {} : { "aria-describedby": p },
1742
- ...g && i !== null ? { "data-reason-shown": "" } : {},
1743
- tabIndex: d ? 0 : -1,
1744
- onFocus: s,
1765
+ ...c === null ? {} : { "aria-describedby": p },
1766
+ ...g && c !== null ? { "data-reason-shown": "" } : {},
1767
+ tabIndex: i ? 0 : -1,
1768
+ onFocus: a,
1745
1769
  onBlur: () => N(!1),
1746
- onKeyDown: (y) => {
1747
- y.key === "Escape" && N(!1);
1770
+ onKeyDown: (w) => {
1771
+ w.key === "Escape" && N(!1);
1748
1772
  },
1749
1773
  onClick: () => {
1750
- i !== null ? N(!0) : !n.disabled && !n.busy && r();
1774
+ c !== null ? N(!0) : !n.disabled && !n.busy && r();
1751
1775
  },
1752
1776
  children: [
1753
- m ? /* @__PURE__ */ e(R, { name: "spinner" }) : /* @__PURE__ */ e(be, { name: n.icon }),
1754
- h ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
1755
- i !== null || f !== null && !a ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: p, children: f }) : null
1777
+ h ? /* @__PURE__ */ e(z, { name: "spinner" }) : /* @__PURE__ */ e(_e, { name: n.icon }),
1778
+ m ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
1779
+ c !== null || f !== null && !s ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: p, children: f }) : null
1756
1780
  ]
1757
1781
  }
1758
1782
  );
1759
1783
  }
1760
- function be({ name: n }) {
1784
+ function _e({ name: n }) {
1761
1785
  const l = re(n);
1762
1786
  return l === null ? null : /* @__PURE__ */ e(T, { name: l, size: 18 });
1763
1787
  }
1764
- function ll({ title: n, body: l = null, time: t = null, unread: u, unreadLabel: d, expandLabel: a, collapseLabel: r, action: s = null, onRead: m, leading: b }) {
1765
- const [c, h] = A(!1), i = q(), f = () => {
1766
- u && m();
1767
- }, p = (s == null ? void 0 : s.presentation) === "row" && s.onAction !== void 0, g = (s == null ? void 0 : s.presentation) === "button" && s.onAction !== void 0 ? s : null, N = () => {
1768
- var y;
1769
- f(), p && ((y = s.onAction) == null || y.call(s));
1788
+ function il({ title: n, body: l = null, time: t = null, unread: o, unreadLabel: i, expandLabel: s, collapseLabel: r, action: a = null, onRead: h, leading: _ }) {
1789
+ const [d, m] = E(!1), c = G(), f = () => {
1790
+ o && h();
1791
+ }, p = (a == null ? void 0 : a.presentation) === "row" && a.onAction !== void 0, g = (a == null ? void 0 : a.presentation) === "button" && a.onAction !== void 0 ? a : null, N = () => {
1792
+ var w;
1793
+ f(), p && ((w = a.onAction) == null || w.call(a));
1770
1794
  };
1771
- return /* @__PURE__ */ o("article", { className: E("cms-notification", u && "is-unread", c && "is-expanded", p && "is-row-action"), "data-state": u ? "unread" : "read", children: [
1772
- /* @__PURE__ */ o(
1795
+ return /* @__PURE__ */ u("article", { className: A("cms-notification", o && "is-unread", d && "is-expanded", p && "is-row-action"), "data-state": o ? "unread" : "read", children: [
1796
+ /* @__PURE__ */ u(
1773
1797
  "div",
1774
1798
  {
1775
1799
  className: "cms-notification__row",
1776
1800
  role: "button",
1777
1801
  tabIndex: 0,
1778
- "aria-describedby": l === null ? void 0 : i,
1802
+ "aria-describedby": l === null ? void 0 : c,
1779
1803
  onClick: N,
1780
- onKeyDown: (y) => {
1781
- y.target !== y.currentTarget || y.key !== "Enter" && y.key !== " " || (y.preventDefault(), N());
1804
+ onKeyDown: (w) => {
1805
+ w.target !== w.currentTarget || w.key !== "Enter" && w.key !== " " || (w.preventDefault(), N());
1782
1806
  },
1783
1807
  children: [
1784
- b != null ? /* @__PURE__ */ e("span", { className: "cms-notification__leading", children: b }) : null,
1785
- /* @__PURE__ */ o("span", { className: "cms-notification__text", children: [
1786
- /* @__PURE__ */ o("span", { className: "cms-notification__head", children: [
1787
- /* @__PURE__ */ o("span", { className: "cms-notification__title", children: [
1788
- u ? /* @__PURE__ */ o("span", { className: "cms-visually-hidden", children: [
1789
- d,
1808
+ _ != null ? /* @__PURE__ */ e("span", { className: "cms-notification__leading", children: _ }) : null,
1809
+ /* @__PURE__ */ u("span", { className: "cms-notification__text", children: [
1810
+ /* @__PURE__ */ u("span", { className: "cms-notification__head", children: [
1811
+ /* @__PURE__ */ u("span", { className: "cms-notification__title", children: [
1812
+ o ? /* @__PURE__ */ u("span", { className: "cms-visually-hidden", children: [
1813
+ i,
1790
1814
  " "
1791
1815
  ] }) : null,
1792
1816
  n
1793
1817
  ] }),
1794
1818
  t !== null ? /* @__PURE__ */ e("span", { className: "cms-notification__time", children: t }) : null
1795
1819
  ] }),
1796
- l !== null && l !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id: i, children: l }) : null
1820
+ l !== null && l !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id: c, children: l }) : null
1797
1821
  ] }),
1798
- u ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
1822
+ o ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
1799
1823
  ]
1800
1824
  }
1801
1825
  ),
@@ -1804,12 +1828,12 @@ function ll({ title: n, body: l = null, time: t = null, unread: u, unreadLabel:
1804
1828
  {
1805
1829
  type: "button",
1806
1830
  className: "cms-notification__chevron",
1807
- "aria-expanded": c,
1808
- "aria-controls": i,
1809
- "aria-label": c ? r : a,
1810
- title: c ? r : a,
1831
+ "aria-expanded": d,
1832
+ "aria-controls": c,
1833
+ "aria-label": d ? r : s,
1834
+ title: d ? r : s,
1811
1835
  onClick: () => {
1812
- c || f(), h((y) => !y);
1836
+ d || f(), m((w) => !w);
1813
1837
  },
1814
1838
  children: /* @__PURE__ */ e(T, { name: "chevron-down", size: 18 })
1815
1839
  }
@@ -1820,19 +1844,19 @@ function ll({ title: n, body: l = null, time: t = null, unread: u, unreadLabel:
1820
1844
  type: "button",
1821
1845
  className: "cms-button cms-notification__action",
1822
1846
  onClick: () => {
1823
- var y;
1824
- f(), (y = g.onAction) == null || y.call(g);
1847
+ var w;
1848
+ f(), (w = g.onAction) == null || w.call(g);
1825
1849
  },
1826
1850
  children: g.label
1827
1851
  }
1828
1852
  ) : null
1829
1853
  ] });
1830
1854
  }
1831
- function wn(n) {
1855
+ function xn(n) {
1832
1856
  return n === "allowed" || n === "elevate" || n === "denied";
1833
1857
  }
1834
- function tl(n, l) {
1835
- if (!wn(n))
1858
+ function ol(n, l) {
1859
+ if (!xn(n))
1836
1860
  return l.showRefused ? { offered: !0, locked: !1, refusal: "not available: the server gave an answer this app does not know", unknown: !0 } : { offered: !1, locked: !1, unknown: !0 };
1837
1861
  switch (n) {
1838
1862
  case "allowed":
@@ -1843,173 +1867,217 @@ function tl(n, l) {
1843
1867
  return l.showRefused ? { offered: !0, locked: !1, refusal: l.refusal ?? "not allowed" } : { offered: !1, locked: !1 };
1844
1868
  }
1845
1869
  }
1846
- function kn(n, l) {
1870
+ function Mn(n, l) {
1847
1871
  if (!n) return;
1848
1872
  if (typeof n.get == "function") return n.get(l) ?? void 0;
1849
- const t = n, u = Object.keys(t).find((d) => d.toLowerCase() === l.toLowerCase());
1850
- return u === void 0 ? void 0 : t[u];
1873
+ const t = n, o = Object.keys(t).find((i) => i.toLowerCase() === l.toLowerCase());
1874
+ return o === void 0 ? void 0 : t[o];
1851
1875
  }
1852
- function xn(n) {
1876
+ function Cn(n) {
1853
1877
  if (n && typeof n == "object") {
1854
1878
  const l = n;
1855
1879
  if (typeof l.detail == "string" && l.detail !== "") return l.detail;
1856
1880
  if (typeof l.title == "string" && l.title !== "") return l.title;
1857
1881
  }
1858
1882
  }
1859
- function al(n, l, t, u) {
1883
+ function dl(n, l, t, o) {
1860
1884
  if (n !== 403) return { kind: "none" };
1861
- const d = xn(t);
1862
- return kn(l, "X-Elevation-Required") !== void 0 ? u.elevates ? { kind: "elevation-required", message: d ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: d ?? "The server refused this." };
1885
+ const i = Cn(t);
1886
+ return Mn(l, "X-Elevation-Required") !== void 0 ? o.elevates ? { kind: "elevation-required", message: i ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: i ?? "The server refused this." };
1863
1887
  }
1864
1888
  const ke = "coolms-kit:reread";
1865
- function sl() {
1889
+ function ul() {
1866
1890
  window.dispatchEvent(new Event(ke));
1867
1891
  }
1868
- function rl(n) {
1869
- const [l, t] = A(void 0), [u, d] = A(void 0), [a, r] = A(!0), s = K(n);
1870
- s.current = n;
1871
- const m = K(0), b = _e(() => {
1872
- const c = ++m.current;
1873
- r(!0), s.current().then(
1874
- (h) => {
1875
- c === m.current && (t(h), d(void 0), r(!1));
1892
+ function ml(n) {
1893
+ const [l, t] = E(void 0), [o, i] = E(void 0), [s, r] = E(!0), a = R(n);
1894
+ a.current = n;
1895
+ const h = R(0), _ = be(() => {
1896
+ const d = ++h.current;
1897
+ r(!0), a.current().then(
1898
+ (m) => {
1899
+ d === h.current && (t(m), i(void 0), r(!1));
1876
1900
  },
1877
- (h) => {
1878
- c === m.current && (d(h), r(!1));
1901
+ (m) => {
1902
+ d === h.current && (i(m), r(!1));
1879
1903
  }
1880
1904
  );
1881
1905
  }, []);
1882
- return J(() => {
1883
- b();
1884
- const c = () => b();
1885
- return window.addEventListener("focus", c), window.addEventListener(ke, c), () => {
1886
- window.removeEventListener("focus", c), window.removeEventListener(ke, c);
1906
+ return Y(() => {
1907
+ _();
1908
+ const d = () => _();
1909
+ return window.addEventListener("focus", d), window.addEventListener(ke, d), () => {
1910
+ window.removeEventListener("focus", d), window.removeEventListener(ke, d);
1887
1911
  };
1888
- }, [b]), { value: l, error: u, loading: a, reread: b };
1912
+ }, [_]), { value: l, error: o, loading: s, reread: _ };
1889
1913
  }
1890
- function cl(n) {
1914
+ function hl(n) {
1891
1915
  return n === 412 ? { conflict: !0, message: "Someone changed this since you opened it. Nothing was saved; read it again to see the change." } : { conflict: !1 };
1892
1916
  }
1893
- const Mn = "/errors/client-update-required";
1894
- function Cn(n, l) {
1895
- const t = n.split(".").map((d) => Number.parseInt(d, 10) || 0), u = l.split(".").map((d) => Number.parseInt(d, 10) || 0);
1896
- for (let d = 0; d < Math.max(t.length, u.length); d++) {
1897
- const a = t[d] ?? 0, r = u[d] ?? 0;
1898
- if (a !== r) return a < r;
1917
+ const Sn = "/errors/client-update-required";
1918
+ function En(n, l) {
1919
+ const t = n.split(".").map((i) => Number.parseInt(i, 10) || 0), o = l.split(".").map((i) => Number.parseInt(i, 10) || 0);
1920
+ for (let i = 0; i < Math.max(t.length, o.length); i++) {
1921
+ const s = t[i] ?? 0, r = o[i] ?? 0;
1922
+ if (s !== r) return s < r;
1899
1923
  }
1900
1924
  return !1;
1901
1925
  }
1902
- function il(n) {
1903
- return n.problemType !== void 0 && n.problemType.endsWith(Mn) ? !0 : n.minimumVersion !== void 0 && Cn(n.version, n.minimumVersion);
1904
- }
1905
- function ol({ title: n, back: l, navigation: t, search: u, searching: d, globals: a, filters: r, primary: s, onRefresh: m, pullText: b, children: c }) {
1906
- const h = K(null), [i, f] = A(!1), [p, g] = A(null), y = _n(h, m === void 0 ? null : () => {
1907
- i || (f(!0), m().finally(() => f(!1)));
1908
- }), x = m === void 0 ? null : { distance: y, refreshing: i, text: b ?? null };
1909
- return /* @__PURE__ */ o("div", { className: E("cms-screen", s !== void 0 && "cms-screen--with-primary"), children: [
1910
- d !== void 0 ? /* @__PURE__ */ o("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
1911
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": d.closeLabel, title: d.closeLabel, onClick: d.onClose, children: /* @__PURE__ */ e(T, { name: "chevron-left" }) }),
1912
- /* @__PURE__ */ e("div", { className: "cms-screen__search", children: d.field })
1913
- ] }) : /* @__PURE__ */ o("header", { className: "cms-screen__bar", children: [
1914
- /* @__PURE__ */ e("div", { className: "cms-screen__leading", children: l !== void 0 ? l.href !== void 0 ? /* @__PURE__ */ o("a", { className: "cms-screen__back", href: l.href, onClick: l.onBack, children: [
1915
- /* @__PURE__ */ e(T, { name: "chevron-left" }),
1916
- /* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: l.label })
1917
- ] }) : /* @__PURE__ */ o("button", { type: "button", className: "cms-screen__back", onClick: l.onBack, children: [
1918
- /* @__PURE__ */ e(T, { name: "chevron-left" }),
1919
- /* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: l.label })
1920
- ] }) : t }),
1921
- /* @__PURE__ */ e("h1", { className: "cms-screen__title", title: n, children: n }),
1922
- /* @__PURE__ */ o("div", { className: "cms-screen__trailing", children: [
1923
- u !== void 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": u.label, title: u.label, onClick: u.onOpen, children: /* @__PURE__ */ e(T, { name: "search" }) }) : null,
1924
- a
1925
- ] })
1926
- ] }),
1927
- r !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-screen__filters", children: /* @__PURE__ */ e(mn, { label: r.label, options: r.options, value: r.selected, onChange: r.onSelect }) }) : null,
1928
- /* @__PURE__ */ e("div", { ref: h, className: "cms-screen__content", "data-pulling": y > 0 ? "" : void 0, "data-refreshing": i ? "" : void 0, children: /* @__PURE__ */ e(Be.Provider, { value: x, children: c }) }),
1929
- s !== void 0 ? /* @__PURE__ */ e(
1930
- "button",
1931
- {
1932
- type: "button",
1933
- className: "cms-button cms-button--primary cms-screen__primary",
1934
- "aria-label": s.label,
1935
- title: s.label,
1936
- ..."menu" in s ? { "aria-haspopup": "menu", "aria-expanded": p !== null } : {},
1937
- onClick: (S) => {
1938
- if ("menu" in s) {
1939
- const M = S.currentTarget.getBoundingClientRect();
1940
- g(p === null ? { x: M.left, y: M.top } : null);
1941
- } else
1942
- s.onPress();
1943
- },
1944
- children: /* @__PURE__ */ e(T, { name: s.icon, size: 24 })
1926
+ function fl(n) {
1927
+ return n.problemType !== void 0 && n.problemType.endsWith(Sn) ? !0 : n.minimumVersion !== void 0 && En(n.version, n.minimumVersion);
1928
+ }
1929
+ const Ie = 4, An = 48, Ln = 800, Tn = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "]);
1930
+ function Dn(n, l) {
1931
+ const [t, o] = E(!1);
1932
+ return Y(() => {
1933
+ const i = n.current;
1934
+ if (i === null || !l) {
1935
+ o(!1);
1936
+ return;
1937
+ }
1938
+ const s = /* @__PURE__ */ new WeakMap();
1939
+ let r = Number.NEGATIVE_INFINITY;
1940
+ const a = () => {
1941
+ r = performance.now();
1942
+ }, h = (m) => {
1943
+ const c = m.target;
1944
+ !(c instanceof HTMLElement && (c.isContentEditable || c.closest("input, textarea, select") !== null)) && Tn.has(m.key) && a();
1945
+ }, _ = (m) => {
1946
+ const c = m.target;
1947
+ if (!(c instanceof HTMLElement)) return;
1948
+ const f = c.scrollTop, p = s.get(c) ?? 0;
1949
+ if (s.set(c, f), f <= 0) {
1950
+ o(!1);
1951
+ return;
1945
1952
  }
1946
- ) : null,
1947
- s !== void 0 && "menu" in s ? /* @__PURE__ */ e(Fe, { at: p, items: s.menu, onClose: () => g(null), label: s.label }) : null
1948
- ] });
1953
+ performance.now() - r > Ln || (f < p - Ie ? o(!1) : f > p + Ie && f > An && o(!0));
1954
+ }, d = [["wheel", a], ["touchmove", a], ["pointerdown", a], ["keydown", h]];
1955
+ for (const [m, c] of d) i.addEventListener(m, c, { capture: !0, passive: !0 });
1956
+ return i.addEventListener("scroll", _, { capture: !0, passive: !0 }), () => {
1957
+ for (const [m, c] of d) i.removeEventListener(m, c, { capture: !0 });
1958
+ i.removeEventListener("scroll", _, { capture: !0 });
1959
+ };
1960
+ }, [n, l]), [t, o];
1961
+ }
1962
+ function pl({ title: n, back: l, navigation: t, search: o, searching: i, globals: s, filters: r, primary: a, onRefresh: h, pullText: _, barHidden: d, children: m }) {
1963
+ const c = R(null), f = R(null), [p, g] = E(!1), [N, w] = E(null), S = gn(f, h === void 0 ? null : () => {
1964
+ p || (g(!0), h().finally(() => g(!1)));
1965
+ }), C = h === void 0 ? null : { distance: S, refreshing: p, text: _ ?? null }, F = i !== void 0 || S > 0 || p, [H, ee] = Dn(c, d === void 0 && !F), j = !F && (d ?? H);
1966
+ return /* @__PURE__ */ u(
1967
+ "div",
1968
+ {
1969
+ ref: c,
1970
+ className: A("cms-screen", a !== void 0 && "cms-screen--with-primary"),
1971
+ "data-bar-hidden": j ? "" : void 0,
1972
+ onFocus: (y) => {
1973
+ j && y.target instanceof Element && y.target.closest(".cms-screen__bar, .cms-screen__filters") !== null && ee(!1);
1974
+ },
1975
+ children: [
1976
+ i !== void 0 ? /* @__PURE__ */ u("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
1977
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": i.closeLabel, title: i.closeLabel, onClick: i.onClose, children: /* @__PURE__ */ e(T, { name: "chevron-left" }) }),
1978
+ /* @__PURE__ */ e("div", { className: "cms-screen__search", children: i.field })
1979
+ ] }) : /* @__PURE__ */ u("header", { className: "cms-screen__bar", children: [
1980
+ /* @__PURE__ */ e("div", { className: "cms-screen__leading", children: l !== void 0 ? l.href !== void 0 ? /* @__PURE__ */ u("a", { className: "cms-screen__back", href: l.href, onClick: l.onBack, children: [
1981
+ /* @__PURE__ */ e(T, { name: "chevron-left" }),
1982
+ /* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: l.label })
1983
+ ] }) : /* @__PURE__ */ u("button", { type: "button", className: "cms-screen__back", onClick: l.onBack, children: [
1984
+ /* @__PURE__ */ e(T, { name: "chevron-left" }),
1985
+ /* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: l.label })
1986
+ ] }) : t }),
1987
+ /* @__PURE__ */ e("h1", { className: "cms-screen__title", title: n, children: n }),
1988
+ /* @__PURE__ */ u("div", { className: "cms-screen__trailing", children: [
1989
+ o !== void 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": o.label, title: o.label, onClick: o.onOpen, children: /* @__PURE__ */ e(T, { name: "search" }) }) : null,
1990
+ s
1991
+ ] })
1992
+ ] }),
1993
+ r !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-screen__filters", children: /* @__PURE__ */ e(hn, { label: r.label, options: r.options, value: r.selected, onChange: r.onSelect }) }) : null,
1994
+ /* @__PURE__ */ e("div", { ref: f, className: "cms-screen__content", "data-pulling": S > 0 ? "" : void 0, "data-refreshing": p ? "" : void 0, children: /* @__PURE__ */ e(Fe.Provider, { value: C, children: m }) }),
1995
+ a !== void 0 ? /* @__PURE__ */ e(
1996
+ "button",
1997
+ {
1998
+ type: "button",
1999
+ className: "cms-button cms-button--primary cms-screen__primary",
2000
+ "aria-label": a.label,
2001
+ title: a.label,
2002
+ ..."menu" in a ? { "aria-haspopup": "menu", "aria-expanded": N !== null } : {},
2003
+ onClick: (y) => {
2004
+ if ("menu" in a) {
2005
+ const P = y.currentTarget.getBoundingClientRect();
2006
+ w(N === null ? { x: P.left, y: P.top } : null);
2007
+ } else
2008
+ a.onPress();
2009
+ },
2010
+ children: /* @__PURE__ */ e(T, { name: a.icon, size: 24 })
2011
+ }
2012
+ ) : null,
2013
+ a !== void 0 && "menu" in a ? /* @__PURE__ */ e(He, { at: N, items: a.menu, onClose: () => w(null), label: a.label }) : null
2014
+ ]
2015
+ }
2016
+ );
1949
2017
  }
1950
2018
  export {
1951
- zn as AppShell,
2019
+ Yn as AppShell,
1952
2020
  ve as Avatar,
1953
- Ee as BOOTSTRAP_ICONS,
1954
- un as Badge,
1955
- ne as Button,
1956
- Ae as CALL_LABELS,
1957
- Mn as CLIENT_UPDATE_REQUIRED,
1958
- Gn as CallBar,
1959
- Xn as CallPanel,
1960
- jn as ChatBubble,
1961
- qn as Composer,
1962
- Pn as ConfirmDialog,
1963
- Fe as ContextMenu,
1964
- qe as EmptyState,
1965
- Ye as ErrorBanner,
1966
- On as FilePicker,
1967
- sn as FilePickerDenied,
1968
- Hn as FileViewer,
1969
- mn as FilterChips,
1970
- Fn as ICON_NAMES,
2021
+ Ae as BOOTSTRAP_ICONS,
2022
+ mn as Badge,
2023
+ le as Button,
2024
+ Ee as CALL_LABELS,
2025
+ Sn as CLIENT_UPDATE_REQUIRED,
2026
+ tl as CallBar,
2027
+ ll as CallPanel,
2028
+ Qn as ChatBubble,
2029
+ el as Composer,
2030
+ On as ConfirmDialog,
2031
+ He as ContextMenu,
2032
+ Ye as EmptyState,
2033
+ Ge as ErrorBanner,
2034
+ Wn as FilePicker,
2035
+ rn as FilePickerDenied,
2036
+ Vn as FileViewer,
2037
+ hn as FilterChips,
2038
+ zn as ICON_NAMES,
1971
2039
  T as Icon,
1972
- Yn as IncomingCall,
1973
- el as List,
1974
- je as Loading,
1975
- pn as MAIL_ROW_LABELS,
1976
- We as MODAL_CLOSE_MS,
1977
- Wn as MailRow,
2040
+ nl as IncomingCall,
2041
+ rl as List,
2042
+ qe as Loading,
2043
+ _n as MAIL_ROW_LABELS,
2044
+ je as MODAL_CLOSE_MS,
2045
+ Jn as MailRow,
1978
2046
  Pe as Modal,
1979
- Kn as NamedIcon,
1980
- ll as Notification,
2047
+ Zn as NamedIcon,
2048
+ il as Notification,
1981
2049
  we as PULL_AT,
1982
- Un as PageHeader,
1983
- nl as PaneToolbar,
2050
+ jn as PageHeader,
2051
+ cl as PaneToolbar,
1984
2052
  bn as SIGN_IN_LABELS,
1985
2053
  ye as STATE_DELAY_MS,
1986
- ol as ScreenShell,
1987
- Zn as SearchField,
1988
- Ln as Select,
1989
- Qn as SignInForm,
1990
- Jn as SignInLayout,
1991
- Vn as SplitPanes,
1992
- ee as State,
1993
- Rn as TabStrip,
1994
- Tn as TextArea,
1995
- Dn as TextField,
1996
- In as Toast,
1997
- Bn as ToastRegion,
1998
- $n as Toggle,
1999
- hn as fitPanes,
2054
+ pl as ScreenShell,
2055
+ Gn as SearchField,
2056
+ Hn as Select,
2057
+ sl as SignInForm,
2058
+ al as SignInLayout,
2059
+ Xn as SplitPanes,
2060
+ ne as State,
2061
+ qn as TabStrip,
2062
+ Fn as TextArea,
2063
+ Bn as TextField,
2064
+ Kn as Toast,
2065
+ Un as ToastRegion,
2066
+ Rn as Toggle,
2067
+ fn as fitPanes,
2000
2068
  re as iconForName,
2001
- on as initialsOf,
2002
- wn as isCapability,
2003
- il as needsClientUpdate,
2004
- tl as offerFor,
2005
- cl as readConflict,
2006
- al as readRefusal,
2007
- xn as refusalText,
2008
- sl as rereadAll,
2009
- dn as tintOf,
2010
- _n as usePull,
2011
- vn as usePullState,
2012
- rl as useReread,
2013
- Cn as versionBelow,
2014
- Ze as writtenOut
2069
+ dn as initialsOf,
2070
+ xn as isCapability,
2071
+ fl as needsClientUpdate,
2072
+ ol as offerFor,
2073
+ hl as readConflict,
2074
+ dl as readRefusal,
2075
+ Cn as refusalText,
2076
+ ul as rereadAll,
2077
+ un as tintOf,
2078
+ gn as usePull,
2079
+ Nn as usePullState,
2080
+ ml as useReread,
2081
+ En as versionBelow,
2082
+ Ve as writtenOut
2015
2083
  };