@coolms/ui-react 0.1.0-alpha.16 → 0.1.0-alpha.18

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,15 +1,15 @@
1
- import { jsx as e, jsxs as d, Fragment as S } from "react/jsx-runtime";
2
- import { useId as q, useState as A, useRef as U, useEffect as Y, useCallback as be, useMemo as Pe, useLayoutEffect as ke } from "react";
1
+ import { jsx as e, jsxs as o, Fragment as S } from "react/jsx-runtime";
2
+ import { useId as q, useState as D, useRef as R, useEffect as J, useCallback as be, useMemo as Pe, useLayoutEffect as ke } from "react";
3
3
  import { createPortal as xe } from "react-dom";
4
4
  function re(n, l) {
5
5
  const t = { ...n };
6
- for (const o of Object.keys(l ?? {})) {
7
- const m = l == null ? void 0 : l[o];
8
- m !== void 0 && (t[o] = m);
6
+ for (const d of Object.keys(l ?? {})) {
7
+ const m = l == null ? void 0 : l[d];
8
+ m !== void 0 && (t[d] = m);
9
9
  }
10
10
  return t;
11
11
  }
12
- function D(...n) {
12
+ function T(...n) {
13
13
  return n.filter(Boolean).join(" ");
14
14
  }
15
15
  function z({ name: n }) {
@@ -35,30 +35,30 @@ function ne({
35
35
  variant: n = "secondary",
36
36
  busy: l = !1,
37
37
  busyLabel: t,
38
- locked: o = !1,
38
+ locked: d = !1,
39
39
  lockedReason: m,
40
40
  icon: s,
41
41
  disabled: r,
42
42
  className: i,
43
43
  children: u,
44
- type: p = "button",
44
+ type: b = "button",
45
45
  title: c,
46
46
  ...h
47
47
  }) {
48
48
  const a = !!r || l;
49
- return /* @__PURE__ */ d(
49
+ return /* @__PURE__ */ o(
50
50
  "button",
51
51
  {
52
52
  ...h,
53
- type: p,
54
- className: D("cms-button", `cms-button--${n}`, l && "is-busy", o && "is-locked", i),
53
+ type: b,
54
+ className: T("cms-button", `cms-button--${n}`, l && "is-busy", d && "is-locked", i),
55
55
  disabled: a,
56
56
  "aria-busy": l || void 0,
57
- title: o ? m ?? c : c,
57
+ title: d ? m ?? c : c,
58
58
  children: [
59
- l ? /* @__PURE__ */ e(z, { name: "spinner" }) : o ? /* @__PURE__ */ e(z, { name: "lock" }) : s,
59
+ l ? /* @__PURE__ */ e(z, { name: "spinner" }) : d ? /* @__PURE__ */ e(z, { name: "lock" }) : s,
60
60
  /* @__PURE__ */ e("span", { className: "cms-button__label", children: l && t !== void 0 ? t : u }),
61
- o && m ? /* @__PURE__ */ d("span", { className: "cms-visually-hidden", children: [
61
+ d && m ? /* @__PURE__ */ o("span", { className: "cms-visually-hidden", children: [
62
62
  ", ",
63
63
  m
64
64
  ] }) : null
@@ -66,16 +66,16 @@ function ne({
66
66
  }
67
67
  );
68
68
  }
69
- function Ce({ id: n, label: l, help: t, error: o, pinned: m, children: s }) {
70
- return /* @__PURE__ */ d("div", { className: D("cms-field", o != null && "is-invalid"), children: [
69
+ function Ce({ id: n, label: l, help: t, error: d, pinned: m, children: s }) {
70
+ return /* @__PURE__ */ o("div", { className: T("cms-field", d != null && "is-invalid"), children: [
71
71
  /* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: n, children: l }),
72
72
  s,
73
- m != null ? /* @__PURE__ */ d("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
73
+ m != null ? /* @__PURE__ */ o("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
74
74
  /* @__PURE__ */ e(z, { name: "lock" }),
75
75
  " ",
76
76
  m
77
77
  ] }) : null,
78
- o != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: o }) : null,
78
+ d != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: d }) : null,
79
79
  t != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${n}-help`, children: t }) : null
80
80
  ] });
81
81
  }
@@ -85,25 +85,25 @@ function Me(n, l) {
85
85
  }
86
86
  const Fe = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Be = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
87
87
  function Ke(n, l, t) {
88
- const o = (s, r, i, u = 0, p = 0, c = 0) => {
89
- const h = new Date(Date.UTC(s, r - 1, i, u, p, c));
90
- return h.setUTCFullYear(s), h.getUTCFullYear() === s && h.getUTCMonth() === r - 1 && h.getUTCDate() === i && h.getUTCHours() === u && h.getUTCMinutes() === p && h.getUTCSeconds() === c ? h : null;
88
+ const d = (s, r, i, u = 0, b = 0, c = 0) => {
89
+ const h = new Date(Date.UTC(s, r - 1, i, u, b, c));
90
+ return h.setUTCFullYear(s), h.getUTCFullYear() === s && h.getUTCMonth() === r - 1 && h.getUTCDate() === i && h.getUTCHours() === u && h.getUTCMinutes() === b && h.getUTCSeconds() === c ? h : null;
91
91
  }, m = (s) => ({ hour: Number(s[1]), minute: Number(s[2]), second: Number(s[3] ?? 0) });
92
92
  try {
93
93
  if (n === "time") {
94
94
  const r = l.match(Be);
95
95
  if (r === null) return l;
96
- const i = m(r), u = o(2e3, 1, 1, i.hour, i.minute, i.second);
96
+ const i = m(r), u = d(2e3, 1, 1, i.hour, i.minute, i.second);
97
97
  return u === null ? l : new Intl.DateTimeFormat(t, { timeStyle: r[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(u);
98
98
  }
99
99
  const s = l.match(Fe);
100
100
  if (s === null) return l;
101
101
  if (n === "date" && s[4] === void 0) {
102
- const r = o(Number(s[1]), Number(s[2]), Number(s[3]));
102
+ const r = d(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
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));
106
+ const r = d(Number(s[1]), Number(s[2]), Number(s[3]), Number(s[4]), Number(s[5]), Number(s[6] ?? 0));
107
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 {
@@ -112,36 +112,36 @@ function Ke(n, l, t) {
112
112
  return l;
113
113
  }
114
114
  const He = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
115
- function yn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s, value: r, onChange: i, placeholder: u, type: p = "text", name: c, locale: h, min: a, max: g, step: f, minLength: v, maxLength: N, required: k }) {
116
- const x = q(), M = m === !0 || s != null, C = M && He.has(p), H = p === "number" && (f === "any" || typeof f == "number" && !Number.isInteger(f));
115
+ function yn({ label: n, help: l, error: t, disabled: d, readOnly: m, pinned: s, value: r, onChange: i, placeholder: u, type: b = "text", name: c, locale: h, min: a, max: g, step: p, minLength: v, maxLength: N, required: k }) {
116
+ const x = q(), M = m === !0 || s != null, C = M && He.has(b), U = b === "number" && (p === "any" || typeof p == "number" && !Number.isInteger(p));
117
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
121
  name: c,
122
- type: C ? "text" : p,
122
+ type: C ? "text" : b,
123
123
  className: "cms-input",
124
- value: C ? Ke(p, r, h) : r,
124
+ value: C ? Ke(b, r, h) : r,
125
125
  ...C ? { "data-value": r } : {},
126
126
  lang: h,
127
127
  placeholder: u,
128
- disabled: o,
128
+ disabled: d,
129
129
  readOnly: M,
130
130
  required: k,
131
131
  "aria-required": k || void 0,
132
132
  min: C ? void 0 : a,
133
133
  max: C ? void 0 : g,
134
- step: C ? void 0 : f,
134
+ step: C ? void 0 : p,
135
135
  minLength: v,
136
136
  maxLength: N,
137
- inputMode: p === "number" ? H ? "decimal" : "numeric" : void 0,
137
+ inputMode: b === "number" ? U ? "decimal" : "numeric" : void 0,
138
138
  "aria-invalid": t != null || void 0,
139
139
  "aria-describedby": Me(x, { help: l, error: t, pinned: s }),
140
- onChange: (O) => i == null ? void 0 : i(O.target.value)
140
+ onChange: (K) => i == null ? void 0 : i(K.target.value)
141
141
  }
142
142
  ) });
143
143
  }
144
- function wn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s, value: r, onChange: i, placeholder: u, rows: p = 4, name: c, locale: h, minLength: a, maxLength: g, required: f }) {
144
+ function wn({ label: n, help: l, error: t, disabled: d, readOnly: m, pinned: s, value: r, onChange: i, placeholder: u, rows: b = 4, name: c, locale: h, minLength: a, maxLength: g, required: p }) {
145
145
  const v = q();
146
146
  return /* @__PURE__ */ e(Ce, { id: v, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
147
147
  "textarea",
@@ -149,14 +149,14 @@ function wn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s,
149
149
  id: v,
150
150
  name: c,
151
151
  className: "cms-input cms-textarea",
152
- rows: p,
152
+ rows: b,
153
153
  value: r,
154
154
  lang: h,
155
155
  placeholder: u,
156
- disabled: o,
156
+ disabled: d,
157
157
  readOnly: m === !0 || s != null,
158
- required: f,
159
- "aria-required": f || void 0,
158
+ required: p,
159
+ "aria-required": p || void 0,
160
160
  minLength: a,
161
161
  maxLength: g,
162
162
  "aria-invalid": t != null || void 0,
@@ -165,16 +165,16 @@ function wn({ label: n, help: l, error: t, disabled: o, readOnly: m, pinned: s,
165
165
  }
166
166
  ) });
167
167
  }
168
- function kn({ label: n, help: l, error: t, disabled: o, readOnly: m, value: s, options: r, onChange: i, emptyText: u = "Nothing to choose from yet.", name: p }) {
168
+ function kn({ label: n, help: l, error: t, disabled: d, readOnly: m, value: s, options: r, onChange: i, emptyText: u = "Nothing to choose from yet.", name: b }) {
169
169
  const c = q(), h = r.length === 0;
170
170
  return /* @__PURE__ */ e(Ce, { id: c, label: n, help: h ? u : l, error: t, children: /* @__PURE__ */ e(
171
171
  "select",
172
172
  {
173
173
  id: c,
174
- name: p,
174
+ name: b,
175
175
  className: "cms-input cms-select",
176
176
  value: s,
177
- disabled: o || h,
177
+ disabled: d || h,
178
178
  "aria-readonly": m || void 0,
179
179
  "aria-invalid": t != null || void 0,
180
180
  "aria-describedby": Me(c, { help: h ? u : l, error: t }),
@@ -185,20 +185,20 @@ function kn({ label: n, help: l, error: t, disabled: o, readOnly: m, value: s, o
185
185
  }
186
186
  ) });
187
187
  }
188
- function xn({ label: n, checked: l, onChange: t, disabled: o, readOnly: m, help: s }) {
188
+ function xn({ label: n, checked: l, onChange: t, disabled: d, readOnly: m, help: s }) {
189
189
  const r = q();
190
- return /* @__PURE__ */ d("div", { className: "cms-toggle-row", children: [
190
+ return /* @__PURE__ */ o("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: D("cms-toggle", l && "is-on"),
197
+ className: T("cms-toggle", l && "is-on"),
198
198
  "aria-checked": l,
199
199
  "aria-readonly": m || void 0,
200
200
  "aria-describedby": s != null ? `${r}-help` : void 0,
201
- disabled: o,
201
+ disabled: d,
202
202
  onClick: () => {
203
203
  m || t == null || t(!l);
204
204
  },
@@ -210,9 +210,9 @@ function xn({ label: n, checked: l, onChange: t, disabled: o, readOnly: m, help:
210
210
  ] });
211
211
  }
212
212
  const Oe = 150;
213
- function Le({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: m, children: s, footer: r, closeLabel: i = "Close", initialFocus: u, className: p }) {
214
- const [c, h] = A(n), [a, g] = A(!1), f = U(null), v = U(null), N = q();
215
- if (Y(() => {
213
+ function Le({ open: n, title: l, onClose: t, dirty: d = !1, onDirtyClose: m, children: s, footer: r, closeLabel: i = "Close", initialFocus: u, className: b }) {
214
+ const [c, h] = D(n), [a, g] = D(!1), p = R(null), v = R(null), N = q();
215
+ if (J(() => {
216
216
  if (n) {
217
217
  v.current = document.activeElement, h(!0), g(!1);
218
218
  return;
@@ -224,24 +224,24 @@ function Le({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: m, chi
224
224
  h(!1), g(!1), (C = (M = v.current) == null ? void 0 : M.focus) == null || C.call(M);
225
225
  }, Oe);
226
226
  return () => window.clearTimeout(x);
227
- }, [n, c]), Y(() => {
227
+ }, [n, c]), J(() => {
228
228
  var x, M;
229
229
  if (n && c) {
230
230
  const C = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
231
- (M = (u == null ? void 0 : u.current) ?? ((x = f.current) == null ? void 0 : x.querySelector(`.cms-modal__body :is(${C}), .cms-modal__foot :is(${C})`)) ?? f.current) == null || M.focus();
231
+ (M = (u == null ? void 0 : u.current) ?? ((x = p.current) == null ? void 0 : x.querySelector(`.cms-modal__body :is(${C}), .cms-modal__foot :is(${C})`)) ?? p.current) == null || M.focus();
232
232
  }
233
233
  }, [n, c, u]), !c) return null;
234
234
  const k = () => {
235
- o ? m == null || m() : t();
235
+ d ? m == null || m() : t();
236
236
  };
237
237
  return xe(
238
- /* @__PURE__ */ e("div", { className: D("cms-modal-scrim", a && "is-closing"), onMouseDown: (x) => {
238
+ /* @__PURE__ */ e("div", { className: T("cms-modal-scrim", a && "is-closing"), onMouseDown: (x) => {
239
239
  x.target === x.currentTarget && k();
240
- }, children: /* @__PURE__ */ d(
240
+ }, children: /* @__PURE__ */ o(
241
241
  "div",
242
242
  {
243
- ref: f,
244
- className: D("cms-modal", p, a && "is-closing", o && "is-dirty"),
243
+ ref: p,
244
+ className: T("cms-modal", b, a && "is-closing", d && "is-dirty"),
245
245
  role: "dialog",
246
246
  "aria-modal": "true",
247
247
  "aria-labelledby": N,
@@ -251,14 +251,14 @@ function Le({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: m, chi
251
251
  if (x.key === "Escape")
252
252
  x.stopPropagation(), k();
253
253
  else if (x.key === "Tab") {
254
- const C = (M = f.current) == null ? void 0 : M.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
254
+ const C = (M = p.current) == null ? void 0 : M.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
255
255
  if (!C || C.length === 0) return;
256
- const H = C[0], O = C[C.length - 1];
257
- x.shiftKey && document.activeElement === H ? (x.preventDefault(), O.focus()) : !x.shiftKey && document.activeElement === O && (x.preventDefault(), H.focus());
256
+ const U = C[0], K = C[C.length - 1];
257
+ x.shiftKey && document.activeElement === U ? (x.preventDefault(), K.focus()) : !x.shiftKey && document.activeElement === K && (x.preventDefault(), U.focus());
258
258
  }
259
259
  },
260
260
  children: [
261
- /* @__PURE__ */ d("header", { className: "cms-modal__head", children: [
261
+ /* @__PURE__ */ o("header", { className: "cms-modal__head", children: [
262
262
  /* @__PURE__ */ e("h2", { className: "cms-modal__title", id: N, children: l }),
263
263
  /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i, onClick: k, children: /* @__PURE__ */ e(z, { name: "close" }) })
264
264
  ] }),
@@ -270,8 +270,8 @@ function Le({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: m, chi
270
270
  document.body
271
271
  );
272
272
  }
273
- function Cn({ open: n, title: l, message: t, kind: o = "default", confirmLabel: m, cancelLabel: s, closeLabel: r, onConfirm: i, onCancel: u }) {
274
- const p = o === "discard-changes";
273
+ function Cn({ open: n, title: l, message: t, kind: d = "default", confirmLabel: m, cancelLabel: s, closeLabel: r, onConfirm: i, onCancel: u }) {
274
+ const b = d === "discard-changes";
275
275
  return /* @__PURE__ */ e(
276
276
  Le,
277
277
  {
@@ -279,11 +279,11 @@ function Cn({ open: n, title: l, message: t, kind: o = "default", confirmLabel:
279
279
  title: l,
280
280
  onClose: u,
281
281
  ...r === void 0 ? {} : { closeLabel: r },
282
- footer: /* @__PURE__ */ d(S, { children: [
283
- /* @__PURE__ */ e(ne, { onClick: u, children: s ?? (p ? "Keep editing" : "Cancel") }),
284
- /* @__PURE__ */ e(ne, { variant: o === "default" ? "primary" : "danger", onClick: i, children: m ?? (p ? "Discard changes" : "Confirm") })
282
+ footer: /* @__PURE__ */ o(S, { children: [
283
+ /* @__PURE__ */ e(ne, { onClick: u, children: s ?? (b ? "Keep editing" : "Cancel") }),
284
+ /* @__PURE__ */ e(ne, { variant: d === "default" ? "primary" : "danger", onClick: i, children: m ?? (b ? "Discard changes" : "Confirm") })
285
285
  ] }),
286
- children: o !== "default" ? /* @__PURE__ */ d("p", { className: "cms-confirm__warning", children: [
286
+ children: d !== "default" ? /* @__PURE__ */ o("p", { className: "cms-confirm__warning", children: [
287
287
  /* @__PURE__ */ e(z, { name: "warning" }),
288
288
  " ",
289
289
  t
@@ -291,32 +291,32 @@ function Cn({ open: n, title: l, message: t, kind: o = "default", confirmLabel:
291
291
  }
292
292
  );
293
293
  }
294
- function Mn({ kind: n, message: l, action: t, onDismiss: o, dismissLabel: m = "Dismiss" }) {
295
- return /* @__PURE__ */ d("div", { className: D("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
294
+ function Mn({ kind: n, message: l, action: t, onDismiss: d, dismissLabel: m = "Dismiss" }) {
295
+ return /* @__PURE__ */ o("div", { className: T("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
296
296
  /* @__PURE__ */ e(z, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
297
297
  /* @__PURE__ */ e("span", { className: "cms-toast__message", children: l }),
298
298
  t ? /* @__PURE__ */ e(ne, { className: "cms-toast__action", onClick: t.onAction, children: t.label }) : null,
299
- o ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": m, onClick: o, children: /* @__PURE__ */ e(z, { name: "close" }) }) : null
299
+ d ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": m, onClick: d, children: /* @__PURE__ */ e(z, { name: "close" }) }) : null
300
300
  ] });
301
301
  }
302
302
  function Sn({ children: n }) {
303
303
  return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: n });
304
304
  }
305
305
  function Ue({ what: n, layout: l = "inline" }) {
306
- return /* @__PURE__ */ d("div", { className: D("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
306
+ return /* @__PURE__ */ o("div", { className: T("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
307
307
  /* @__PURE__ */ e(z, { name: "spinner" }),
308
308
  /* @__PURE__ */ e("span", { children: n })
309
309
  ] });
310
310
  }
311
- function ze({ title: n, hint: l, action: t }) {
312
- return /* @__PURE__ */ d("div", { className: "cms-empty", children: [
311
+ function Re({ title: n, hint: l, action: t }) {
312
+ return /* @__PURE__ */ o("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 Re({ message: n, onRetry: l, retryLabel: t = "Try again" }) {
319
- return /* @__PURE__ */ d("div", { className: "cms-error-banner", role: "alert", children: [
318
+ function ze({ message: n, onRetry: l, retryLabel: t = "Try again" }) {
319
+ return /* @__PURE__ */ o("div", { className: "cms-error-banner", role: "alert", children: [
320
320
  /* @__PURE__ */ e(z, { name: "warning" }),
321
321
  /* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: n }),
322
322
  l ? /* @__PURE__ */ e(ne, { onClick: l, children: t }) : null
@@ -329,14 +329,14 @@ function Ze() {
329
329
  return Number.isFinite(l) && l >= 0 ? l : ye;
330
330
  }
331
331
  function Ve() {
332
- return /* @__PURE__ */ d("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
332
+ return /* @__PURE__ */ o("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: o, placement: m = "block" }) {
338
- const [s, r] = A(n !== "loading");
339
- return Y(() => {
337
+ function ee({ kind: n, title: l, description: t, action: d, placement: m = "block" }) {
338
+ const [s, r] = D(n !== "loading");
339
+ return J(() => {
340
340
  if (n !== "loading") {
341
341
  r(!0);
342
342
  return;
@@ -344,114 +344,126 @@ function ee({ kind: n, title: l, description: t, action: o, placement: m = "bloc
344
344
  r(!1);
345
345
  const i = window.setTimeout(() => r(!0), Ze());
346
346
  return () => window.clearTimeout(i);
347
- }, [n]), /* @__PURE__ */ d(
347
+ }, [n]), /* @__PURE__ */ o(
348
348
  "div",
349
349
  {
350
- className: D("cms-state", `cms-state--${n}`, `cms-state--${m}`, !s && "is-waiting"),
350
+ className: T("cms-state", `cms-state--${n}`, `cms-state--${m}`, !s && "is-waiting"),
351
351
  role: "status",
352
352
  "aria-live": "polite",
353
353
  "data-kind": n,
354
354
  children: [
355
355
  n === "loading" ? /* @__PURE__ */ e(Ve, {}) : null,
356
356
  n === "error" || n === "denied" ? /* @__PURE__ */ e(z, { name: n === "error" ? "warning" : "lock" }) : null,
357
- /* @__PURE__ */ d("span", { className: "cms-state__text", children: [
357
+ /* @__PURE__ */ o("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
- o !== void 0 && n !== "denied" ? /* @__PURE__ */ e(ne, { className: "cms-state__action", onClick: o.onAction, children: o.label }) : null
361
+ d !== void 0 && n !== "denied" ? /* @__PURE__ */ e(ne, { className: "cms-state__action", onClick: d.onAction, children: d.label }) : null
362
362
  ]
363
363
  }
364
364
  );
365
365
  }
366
366
  const $e = {
367
- mail: /* @__PURE__ */ d(S, { children: [
367
+ mail: /* @__PURE__ */ o(S, { 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
+ // The envelope with its flap open above it: a message read, or the message itself again.
372
+ "mail-open": /* @__PURE__ */ o(S, { children: [
373
+ /* @__PURE__ */ e("path", { d: "M3 10v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9" }),
374
+ /* @__PURE__ */ e("path", { d: "m3 10 9-6 9 6" }),
375
+ /* @__PURE__ */ e("path", { d: "m3 10 9 6 9-6" })
376
+ ] }),
377
+ // A clipboard: copy what is shown.
378
+ copy: /* @__PURE__ */ o(S, { children: [
379
+ /* @__PURE__ */ e("rect", { x: "6", y: "4", width: "12", height: "17", rx: "2" }),
380
+ /* @__PURE__ */ e("path", { d: "M9 4V3h6v1" }),
381
+ /* @__PURE__ */ e("path", { d: "M9 10h6M9 14h6M9 18h3" })
382
+ ] }),
371
383
  chat: /* @__PURE__ */ e("path", { d: "M4 12a8 8 0 1 1 4 6.9L4 20l1.1-4A8 8 0 0 1 4 12Z" }),
372
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" }),
373
- calendar: /* @__PURE__ */ d(S, { children: [
385
+ calendar: /* @__PURE__ */ o(S, { children: [
374
386
  /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "16", rx: "2" }),
375
387
  /* @__PURE__ */ e("path", { d: "M3 10h18M8 3v4M16 3v4" })
376
388
  ] }),
377
- file: /* @__PURE__ */ d(S, { children: [
389
+ file: /* @__PURE__ */ o(S, { children: [
378
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" }),
379
391
  /* @__PURE__ */ e("path", { d: "M14 3v6h6M8 13h8M8 17h6" })
380
392
  ] }),
381
393
  // The file, with code's angle brackets in place of its lines: a message's source.
382
- "file-code": /* @__PURE__ */ d(S, { children: [
394
+ "file-code": /* @__PURE__ */ o(S, { children: [
383
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" }),
384
396
  /* @__PURE__ */ e("path", { d: "M14 3v6h6" }),
385
397
  /* @__PURE__ */ e("path", { d: "m10 12-2 2.5 2 2.5M14 12l2 2.5-2 2.5" })
386
398
  ] }),
387
- image: /* @__PURE__ */ d(S, { children: [
399
+ image: /* @__PURE__ */ o(S, { children: [
388
400
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
389
401
  /* @__PURE__ */ e("circle", { cx: "9", cy: "10", r: "2" }),
390
402
  /* @__PURE__ */ e("path", { d: "m21 17-5-5-9 8" })
391
403
  ] }),
392
- search: /* @__PURE__ */ d(S, { children: [
404
+ search: /* @__PURE__ */ o(S, { children: [
393
405
  /* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "7" }),
394
406
  /* @__PURE__ */ e("path", { d: "m20 20-4-4" })
395
407
  ] }),
396
- bell: /* @__PURE__ */ d(S, { children: [
408
+ bell: /* @__PURE__ */ o(S, { children: [
397
409
  /* @__PURE__ */ e("path", { d: "M6 9a6 6 0 1 1 12 0c0 6 2 8 2 8H4s2-2 2-8Z" }),
398
410
  /* @__PURE__ */ e("path", { d: "M10 20a2 2 0 0 0 4 0" })
399
411
  ] }),
400
- pencil: /* @__PURE__ */ d(S, { children: [
412
+ pencil: /* @__PURE__ */ o(S, { children: [
401
413
  /* @__PURE__ */ e("path", { d: "M4 20h4L19 9l-4-4L4 16Z" }),
402
414
  /* @__PURE__ */ e("path", { d: "m13 7 4 4" })
403
415
  ] }),
404
- download: /* @__PURE__ */ d(S, { children: [
416
+ download: /* @__PURE__ */ o(S, { children: [
405
417
  /* @__PURE__ */ e("path", { d: "M12 4v11" }),
406
418
  /* @__PURE__ */ e("path", { d: "m7 11 5 5 5-5" }),
407
419
  /* @__PURE__ */ e("path", { d: "M4 20h16" })
408
420
  ] }),
409
- print: /* @__PURE__ */ d(S, { children: [
421
+ print: /* @__PURE__ */ o(S, { children: [
410
422
  /* @__PURE__ */ e("path", { d: "M7 8V4h10v4" }),
411
423
  /* @__PURE__ */ e("rect", { x: "3", y: "8", width: "18", height: "8", rx: "2" }),
412
424
  /* @__PURE__ */ e("path", { d: "M7 14h10v6H7Z" })
413
425
  ] }),
414
- "open-separately": /* @__PURE__ */ d(S, { children: [
426
+ "open-separately": /* @__PURE__ */ o(S, { children: [
415
427
  /* @__PURE__ */ e("path", { d: "M14 4h6v6" }),
416
428
  /* @__PURE__ */ e("path", { d: "m20 4-9 9" }),
417
429
  /* @__PURE__ */ e("path", { d: "M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5" })
418
430
  ] }),
419
431
  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" }),
420
- send: /* @__PURE__ */ d(S, { children: [
432
+ send: /* @__PURE__ */ o(S, { children: [
421
433
  /* @__PURE__ */ e("path", { d: "M21 3 10 14" }),
422
434
  /* @__PURE__ */ e("path", { d: "M21 3 14 21l-4-7-7-4Z" })
423
435
  ] }),
424
- inbox: /* @__PURE__ */ d(S, { children: [
436
+ inbox: /* @__PURE__ */ o(S, { children: [
425
437
  /* @__PURE__ */ e("path", { d: "M3 13h5l1 3h6l1-3h5" }),
426
438
  /* @__PURE__ */ e("path", { d: "M5 5h14l2 8v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" })
427
439
  ] }),
428
- archive: /* @__PURE__ */ d(S, { children: [
440
+ archive: /* @__PURE__ */ o(S, { children: [
429
441
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "5", rx: "1" }),
430
442
  /* @__PURE__ */ e("path", { d: "M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4" })
431
443
  ] }),
432
- trash: /* @__PURE__ */ d(S, { children: [
444
+ trash: /* @__PURE__ */ o(S, { children: [
433
445
  /* @__PURE__ */ e("path", { d: "M4 7h16M10 11v6M14 11v6" }),
434
446
  /* @__PURE__ */ e("path", { d: "M6 7l1 13a2 2 0 0 0 2 1h6a2 2 0 0 0 2-1l1-13M9 7V4h6v3" })
435
447
  ] }),
436
448
  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" }),
437
- mic: /* @__PURE__ */ d(S, { children: [
449
+ mic: /* @__PURE__ */ o(S, { children: [
438
450
  /* @__PURE__ */ e("rect", { x: "9", y: "3", width: "6", height: "11", rx: "3" }),
439
451
  /* @__PURE__ */ e("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v3" })
440
452
  ] }),
441
- speaker: /* @__PURE__ */ d(S, { children: [
453
+ speaker: /* @__PURE__ */ o(S, { children: [
442
454
  /* @__PURE__ */ e("path", { d: "M4 9h4l5-4v14l-5-4H4Z" }),
443
455
  /* @__PURE__ */ e("path", { d: "M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12" })
444
456
  ] }),
445
- "user-plus": /* @__PURE__ */ d(S, { children: [
457
+ "user-plus": /* @__PURE__ */ o(S, { children: [
446
458
  /* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
447
459
  /* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M19 8v6M16 11h6" })
448
460
  ] }),
449
461
  "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" }),
450
- video: /* @__PURE__ */ d(S, { children: [
462
+ video: /* @__PURE__ */ o(S, { children: [
451
463
  /* @__PURE__ */ e("rect", { x: "3", y: "6", width: "13", height: "12", rx: "2" }),
452
464
  /* @__PURE__ */ e("path", { d: "m16 10 5-3v10l-5-3" })
453
465
  ] }),
454
- info: /* @__PURE__ */ d(S, { children: [
466
+ info: /* @__PURE__ */ o(S, { children: [
455
467
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
456
468
  /* @__PURE__ */ e("path", { d: "M12 11v6M12 7.5v.5" })
457
469
  ] }),
@@ -460,7 +472,7 @@ const $e = {
460
472
  plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
461
473
  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" }),
462
474
  check: /* @__PURE__ */ e("path", { d: "m5 12 5 5 9-10" }),
463
- server: /* @__PURE__ */ d(S, { children: [
475
+ server: /* @__PURE__ */ o(S, { children: [
464
476
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "7", rx: "2" }),
465
477
  /* @__PURE__ */ e("rect", { x: "3", y: "13", width: "18", height: "7", rx: "2" }),
466
478
  /* @__PURE__ */ e("path", { d: "M7 7.5h.5M7 16.5h.5" })
@@ -496,7 +508,7 @@ const An = Object.keys($e), Ae = {
496
508
  "reply-all": "reply",
497
509
  forward: "forward",
498
510
  envelope: "mail",
499
- "envelope-open": "mail",
511
+ "envelope-open": "mail-open",
500
512
  star: "star",
501
513
  "star-fill": "star",
502
514
  "folder-symlink": "folder",
@@ -507,6 +519,7 @@ const An = Object.keys($e), Ae = {
507
519
  download: "download",
508
520
  printer: "print",
509
521
  "file-earmark-code": "file-code",
522
+ clipboard: "copy",
510
523
  "three-dots": "more"
511
524
  };
512
525
  function _e(n) {
@@ -523,8 +536,8 @@ function Ge(n) {
523
536
  return n.getClientRects().length > 0;
524
537
  }
525
538
  function Dn(n) {
526
- const { name: l, badge: t, closeLabel: o, onClose: m, actions: s = [], moreLabel: r = "More", edit: i, editing: u, state: p, siblings: c, bar: h, thumbnails: a, strip: g, onZoom: f, children: v } = n, N = U(null), k = U(null), x = q(), [M, C] = A(!1), H = U(null);
527
- Y(() => {
539
+ const { name: l, badge: t, closeLabel: d, onClose: m, actions: s = [], moreLabel: r = "More", edit: i, editing: u, state: b, siblings: c, bar: h, thumbnails: a, strip: g, onZoom: p, children: v } = n, N = R(null), k = R(null), x = q(), [M, C] = D(!1), U = R(null);
540
+ J(() => {
528
541
  var V;
529
542
  const y = document.activeElement, F = document.body.style.overflow;
530
543
  return document.body.style.overflow = "hidden", (V = k.current) == null || V.focus(), () => {
@@ -532,24 +545,24 @@ function Dn(n) {
532
545
  document.body.style.overflow = F, (E = y == null ? void 0 : y.focus) == null || E.call(y);
533
546
  };
534
547
  }, []);
535
- const O = () => {
548
+ const K = () => {
536
549
  u != null && u.dirty ? u.onDirtyClose() : m();
537
550
  }, le = (y) => {
538
551
  const F = y.touches.length === 1 ? y.touches[0] : void 0;
539
- H.current = F === void 0 || u !== void 0 || Xe(y.target) ? null : { x: F.clientX, y: F.clientY };
540
- }, J = (y) => {
552
+ U.current = F === void 0 || u !== void 0 || Xe(y.target) ? null : { x: F.clientX, y: F.clientY };
553
+ }, Q = (y) => {
541
554
  var X, B;
542
- const F = H.current, V = y.changedTouches[0];
543
- if (H.current = null, F === null || V === void 0) return;
555
+ const F = U.current, V = y.changedTouches[0];
556
+ if (U.current = null, F === null || V === void 0) return;
544
557
  const E = V.clientX - F.x;
545
558
  Math.abs(E) < je || Math.abs(E) < Math.abs(V.clientY - F.y) || (E > 0 ? (X = c == null ? void 0 : c.onPrevious) == null || X.call(c) : (B = c == null ? void 0 : c.onNext) == null || B.call(c));
546
559
  };
547
560
  return xe(
548
- /* @__PURE__ */ d(
561
+ /* @__PURE__ */ o(
549
562
  "div",
550
563
  {
551
564
  ref: N,
552
- className: D("cms-viewer", u !== void 0 && "is-editing"),
565
+ className: T("cms-viewer", u !== void 0 && "is-editing"),
553
566
  role: "dialog",
554
567
  "aria-modal": "true",
555
568
  "aria-labelledby": x,
@@ -564,31 +577,31 @@ function Dn(n) {
564
577
  if (X.length === 0) return;
565
578
  const B = X[0], G = X[X.length - 1];
566
579
  y.shiftKey && document.activeElement === B ? (y.preventDefault(), G.focus()) : !y.shiftKey && document.activeElement === G && (y.preventDefault(), B.focus());
567
- } else u === void 0 && !qe(y.target) && !y.ctrlKey && !y.metaKey && !y.altKey && (y.key === "ArrowLeft" ? (V = c == null ? void 0 : c.onPrevious) == null || V.call(c) : y.key === "ArrowRight" ? (E = c == null ? void 0 : c.onNext) == null || E.call(c) : y.key === "+" || y.key === "=" ? f == null || f("in") : y.key === "-" ? f == null || f("out") : y.key === "0" && (f == null || f("reset")));
580
+ } else u === void 0 && !qe(y.target) && !y.ctrlKey && !y.metaKey && !y.altKey && (y.key === "ArrowLeft" ? (V = c == null ? void 0 : c.onPrevious) == null || V.call(c) : y.key === "ArrowRight" ? (E = c == null ? void 0 : c.onNext) == null || E.call(c) : y.key === "+" || y.key === "=" ? p == null || p("in") : y.key === "-" ? p == null || p("out") : y.key === "0" && (p == null || p("reset")));
568
581
  },
569
582
  children: [
570
583
  c !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${c.position}` }) : null,
571
- /* @__PURE__ */ d("header", { className: "cms-viewer__top", children: [
572
- /* @__PURE__ */ e("button", { ref: k, type: "button", className: "cms-viewer__icon", "aria-label": o, onClick: O, children: /* @__PURE__ */ e(z, { name: "close" }) }),
584
+ /* @__PURE__ */ o("header", { className: "cms-viewer__top", children: [
585
+ /* @__PURE__ */ e("button", { ref: k, type: "button", className: "cms-viewer__icon", "aria-label": d, onClick: K, children: /* @__PURE__ */ e(z, { name: "close" }) }),
573
586
  /* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: t }),
574
587
  /* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: x, title: l, children: l }),
575
588
  c !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: c.position }) : null,
576
589
  /* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
577
- u !== void 0 ? /* @__PURE__ */ d(S, { children: [
590
+ u !== void 0 ? /* @__PURE__ */ o(S, { children: [
578
591
  /* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: u.status }),
579
592
  /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.onDone, children: u.doneLabel })
580
- ] }) : /* @__PURE__ */ d(S, { children: [
581
- /* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: s.map((y) => /* @__PURE__ */ d("button", { type: "button", className: "cms-viewer__button", onClick: y.onSelect, children: [
593
+ ] }) : /* @__PURE__ */ o(S, { children: [
594
+ /* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: s.map((y) => /* @__PURE__ */ o("button", { type: "button", className: "cms-viewer__button", onClick: y.onSelect, children: [
582
595
  y.icon,
583
596
  y.label
584
597
  ] }, y.label)) }),
585
- i !== void 0 ? /* @__PURE__ */ d("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": i.label, onClick: i.onEdit, children: [
598
+ i !== void 0 ? /* @__PURE__ */ o("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": i.label, onClick: i.onEdit, children: [
586
599
  i.icon,
587
600
  /* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: i.label })
588
601
  ] }) : null,
589
- s.length > 0 ? /* @__PURE__ */ d("span", { className: "cms-viewer__more", children: [
602
+ s.length > 0 ? /* @__PURE__ */ o("span", { className: "cms-viewer__more", children: [
590
603
  /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": r, "aria-expanded": M, onClick: () => C((y) => !y), children: /* @__PURE__ */ e(P, { name: "more" }) }),
591
- M ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: s.map((y) => /* @__PURE__ */ d(
604
+ M ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: s.map((y) => /* @__PURE__ */ o(
592
605
  "button",
593
606
  {
594
607
  type: "button",
@@ -606,15 +619,15 @@ function Dn(n) {
606
619
  ] }) : null
607
620
  ] })
608
621
  ] }),
609
- /* @__PURE__ */ d("div", { className: "cms-viewer__body", children: [
622
+ /* @__PURE__ */ o("div", { className: "cms-viewer__body", children: [
610
623
  a != null && u === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: a }) : null,
611
- /* @__PURE__ */ d("div", { className: "cms-viewer__content", onTouchStart: le, onTouchEnd: J, children: [
612
- (u == null ? void 0 : u.conflict) !== void 0 ? /* @__PURE__ */ d("div", { className: "cms-viewer__conflict", role: "alert", children: [
624
+ /* @__PURE__ */ o("div", { className: "cms-viewer__content", onTouchStart: le, onTouchEnd: Q, children: [
625
+ (u == null ? void 0 : u.conflict) !== void 0 ? /* @__PURE__ */ o("div", { className: "cms-viewer__conflict", role: "alert", children: [
613
626
  /* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children: u.conflict.message }),
614
627
  /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick: u.conflict.onOverwrite, children: u.conflict.overwriteLabel }),
615
628
  /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.conflict.onKeepBoth, children: u.conflict.keepBothLabel })
616
629
  ] }) : null,
617
- p === void 0 ? v : /* @__PURE__ */ e(Ye, { state: p }),
630
+ b === void 0 ? v : /* @__PURE__ */ e(Ye, { state: b }),
618
631
  u === 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(z, { name: "back" }) }) : null,
619
632
  u === 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(z, { name: "back" }) }) : null,
620
633
  u === void 0 && c !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(c.total, 7) }, (y, F) => /* @__PURE__ */ e("i", { className: F === Math.min(c.index, 6) ? "is-current" : void 0 }, F)) }) : null
@@ -665,147 +678,147 @@ const Ne = (n, l) => `${n}
665
678
  ${l}`, Qe = (n, l) => n === "" ? l : `${n}/${l}`, en = 48;
666
679
  function Tn(n) {
667
680
  var me, ue;
668
- const { open: l, spaces: t, list: o, disabledReason: m, budget: s, formatSize: r, labels: i, onConfirm: u, onCancel: p } = n, [c, h] = A(((me = t[0]) == null ? void 0 : me.id) ?? ""), [a, g] = A(""), [f, v] = A({ status: "loading" }), [N, k] = A(0), [x, M] = A(/* @__PURE__ */ new Map()), [C, H] = A(0), [O, le] = A(!1), J = U(null), y = q();
669
- Y(() => {
670
- var b;
671
- l && (h(((b = t[0]) == null ? void 0 : b.id) ?? ""), g(""), M(/* @__PURE__ */ new Map()), le(!1));
672
- }, [l]), Y(() => {
681
+ const { open: l, spaces: t, list: d, disabledReason: m, budget: s, formatSize: r, labels: i, onConfirm: u, onCancel: b } = n, [c, h] = D(((me = t[0]) == null ? void 0 : me.id) ?? ""), [a, g] = D(""), [p, v] = D({ status: "loading" }), [N, k] = D(0), [x, M] = D(/* @__PURE__ */ new Map()), [C, U] = D(0), [K, le] = D(!1), Q = R(null), y = q();
682
+ J(() => {
683
+ var f;
684
+ l && (h(((f = t[0]) == null ? void 0 : f.id) ?? ""), g(""), M(/* @__PURE__ */ new Map()), le(!1));
685
+ }, [l]), J(() => {
673
686
  if (!l || c === "") return;
674
- let b = !0;
675
- return v({ status: "loading" }), H(0), o(c, a).then(
676
- (w) => b && v({ status: "ready", entries: w.entries, next: w.next ?? null, paging: !1 }),
677
- (w) => b && v({ status: w instanceof Je ? "denied" : "error" })
687
+ let f = !0;
688
+ return v({ status: "loading" }), U(0), d(c, a).then(
689
+ (w) => f && v({ status: "ready", entries: w.entries, next: w.next ?? null, paging: !1 }),
690
+ (w) => f && v({ status: w instanceof Je ? "denied" : "error" })
678
691
  ), () => {
679
- b = !1;
692
+ f = !1;
680
693
  };
681
- }, [l, c, a, o, N]);
694
+ }, [l, c, a, d, N]);
682
695
  const F = be(() => {
683
- if (f.status !== "ready" || f.next === null || f.paging) return;
684
- const b = f.next, w = f.entries;
685
- v({ ...f, paging: !0 }), o(c, a, b).then(
696
+ if (p.status !== "ready" || p.next === null || p.paging) return;
697
+ const f = p.next, w = p.entries;
698
+ v({ ...p, paging: !0 }), d(c, a, f).then(
686
699
  (I) => v({ status: "ready", entries: [...w, ...I.entries], next: I.next ?? null, paging: !1 }),
687
- () => v({ status: "ready", entries: w, next: b, paging: !1 })
700
+ () => v({ status: "ready", entries: w, next: f, paging: !1 })
688
701
  );
689
- }, [f, o, c, a]), V = be((b) => {
702
+ }, [p, d, c, a]), V = be((f) => {
690
703
  var w;
691
- return ((w = s == null ? void 0 : s.cost) == null ? void 0 : w.call(s, b)) ?? b.size ?? 0;
692
- }, [s]), E = Pe(() => [...x.values()], [x]), X = E.reduce((b, w) => b + (w.size ?? 0), 0), B = s === void 0 ? null : s.limitBytes - s.usedBytes - E.reduce((b, w) => b + V(w), 0), G = B !== null && B < 0, ie = (b) => {
693
- if (b.kind !== "file") return null;
694
- const w = m == null ? void 0 : m(b);
695
- return w || (B !== null && !x.has(Ne(c, b.id)) && V(b) > B ? i.overBudget : null);
696
- }, ce = (b) => {
697
- const w = Ne(c, b.id);
698
- !x.has(w) && ie(b) !== null || M((I) => {
699
- const K = new Map(I);
700
- return K.has(w) ? K.delete(w) : K.set(w, { ...b, space: c, path: a }), K;
704
+ return ((w = s == null ? void 0 : s.cost) == null ? void 0 : w.call(s, f)) ?? f.size ?? 0;
705
+ }, [s]), E = Pe(() => [...x.values()], [x]), X = E.reduce((f, w) => f + (w.size ?? 0), 0), B = s === void 0 ? null : s.limitBytes - s.usedBytes - E.reduce((f, w) => f + V(w), 0), G = B !== null && B < 0, ie = (f) => {
706
+ if (f.kind !== "file") return null;
707
+ const w = m == null ? void 0 : m(f);
708
+ return w || (B !== null && !x.has(Ne(c, f.id)) && V(f) > B ? i.overBudget : null);
709
+ }, ce = (f) => {
710
+ const w = Ne(c, f.id);
711
+ !x.has(w) && ie(f) !== null || M((I) => {
712
+ const H = new Map(I);
713
+ return H.has(w) ? H.delete(w) : H.set(w, { ...f, space: c, path: a }), H;
701
714
  });
702
- }, _ = (b) => g(Qe(a, b.name)), T = () => g(a.includes("/") ? a.slice(0, a.lastIndexOf("/")) : ""), Z = (b) => M((w) => {
715
+ }, _ = (f) => g(Qe(a, f.name)), A = () => g(a.includes("/") ? a.slice(0, a.lastIndexOf("/")) : ""), Z = (f) => M((w) => {
703
716
  const I = new Map(w);
704
- return I.delete(b), I;
705
- }), W = f.status === "ready" ? f.entries : [], L = (b) => {
717
+ return I.delete(f), I;
718
+ }), W = p.status === "ready" ? p.entries : [], L = (f) => {
706
719
  const w = W[C];
707
- if (b.key === "ArrowDown" || b.key === "ArrowUp" || b.key === "Home" || b.key === "End") {
708
- b.preventDefault();
709
- const I = W.length - 1, K = b.key === "Home" ? 0 : b.key === "End" ? I : Math.min(I, Math.max(0, C + (b.key === "ArrowDown" ? 1 : -1)));
710
- H(K), K >= I - 1 && F();
711
- } else b.key === "Enter" && (w == null ? void 0 : w.kind) === "folder" ? (b.preventDefault(), _(w)) : b.key === " " && (w == null ? void 0 : w.kind) === "file" ? (b.preventDefault(), ce(w)) : b.key === "Backspace" && a !== "" && (b.preventDefault(), T());
712
- }, j = a === "" ? [] : a.split("/"), oe = ((ue = t.find((b) => b.id === c)) == null ? void 0 : ue.name) ?? "", de = (b) => `${y}-entry-${String(b)}`;
713
- return /* @__PURE__ */ d(
720
+ if (f.key === "ArrowDown" || f.key === "ArrowUp" || f.key === "Home" || f.key === "End") {
721
+ f.preventDefault();
722
+ const I = W.length - 1, H = f.key === "Home" ? 0 : f.key === "End" ? I : Math.min(I, Math.max(0, C + (f.key === "ArrowDown" ? 1 : -1)));
723
+ U(H), H >= I - 1 && F();
724
+ } else f.key === "Enter" && (w == null ? void 0 : w.kind) === "folder" ? (f.preventDefault(), _(w)) : f.key === " " && (w == null ? void 0 : w.kind) === "file" ? (f.preventDefault(), ce(w)) : f.key === "Backspace" && a !== "" && (f.preventDefault(), A());
725
+ }, j = a === "" ? [] : a.split("/"), oe = ((ue = t.find((f) => f.id === c)) == null ? void 0 : ue.name) ?? "", de = (f) => `${y}-entry-${String(f)}`;
726
+ return /* @__PURE__ */ o(
714
727
  Le,
715
728
  {
716
729
  open: l,
717
730
  title: i.title,
718
- onClose: p,
731
+ onClose: b,
719
732
  closeLabel: i.close,
720
- initialFocus: J,
733
+ initialFocus: Q,
721
734
  className: "cms-file-picker",
722
- footer: /* @__PURE__ */ d("div", { className: "cms-file-picker__foot", children: [
723
- /* @__PURE__ */ d("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
735
+ footer: /* @__PURE__ */ o("div", { className: "cms-file-picker__foot", children: [
736
+ /* @__PURE__ */ o("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
724
737
  E.length > 0 ? /* @__PURE__ */ e("span", { children: i.total(E.length, r(X)) }) : null,
725
- s !== void 0 && B !== null ? /* @__PURE__ */ e("span", { className: D(G && "is-over"), children: G ? i.overBudget : i.left(r(Math.max(0, B)), r(s.limitBytes)) }) : null
738
+ s !== void 0 && B !== null ? /* @__PURE__ */ e("span", { className: T(G && "is-over"), children: G ? i.overBudget : i.left(r(Math.max(0, B)), r(s.limitBytes)) }) : null
726
739
  ] }),
727
- /* @__PURE__ */ d("div", { className: "cms-file-picker__actions", children: [
728
- /* @__PURE__ */ e(ne, { variant: "secondary", onClick: p, children: i.cancel }),
740
+ /* @__PURE__ */ o("div", { className: "cms-file-picker__actions", children: [
741
+ /* @__PURE__ */ e(ne, { variant: "secondary", onClick: b, children: i.cancel }),
729
742
  /* @__PURE__ */ e(ne, { variant: "primary", disabled: E.length === 0 || G, onClick: () => u(E), children: i.confirm(E.length) })
730
743
  ] })
731
744
  ] }),
732
745
  children: [
733
- /* @__PURE__ */ d("div", { className: "cms-file-picker__top", children: [
734
- t.length > 1 ? /* @__PURE__ */ d("label", { className: "cms-file-picker__space", children: [
746
+ /* @__PURE__ */ o("div", { className: "cms-file-picker__top", children: [
747
+ t.length > 1 ? /* @__PURE__ */ o("label", { className: "cms-file-picker__space", children: [
735
748
  /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: i.space }),
736
- /* @__PURE__ */ e("select", { className: "cms-input cms-select", value: c, onChange: (b) => {
737
- h(b.target.value), g("");
738
- }, children: t.map((b) => /* @__PURE__ */ e("option", { value: b.id, children: b.name }, b.id)) })
749
+ /* @__PURE__ */ e("select", { className: "cms-input cms-select", value: c, onChange: (f) => {
750
+ h(f.target.value), g("");
751
+ }, children: t.map((f) => /* @__PURE__ */ e("option", { value: f.id, children: f.name }, f.id)) })
739
752
  ] }) : null,
740
- /* @__PURE__ */ d("nav", { className: "cms-file-picker__path", "aria-label": i.path, children: [
741
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i.up, disabled: a === "", onClick: T, children: /* @__PURE__ */ e(P, { name: "chevron-left" }) }),
742
- /* @__PURE__ */ d("ol", { children: [
753
+ /* @__PURE__ */ o("nav", { className: "cms-file-picker__path", "aria-label": i.path, children: [
754
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i.up, disabled: a === "", onClick: A, children: /* @__PURE__ */ e(P, { name: "chevron-left" }) }),
755
+ /* @__PURE__ */ o("ol", { children: [
743
756
  /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": a === "" ? "location" : void 0, onClick: () => g(""), children: oe }) }),
744
- j.map((b, w) => {
757
+ j.map((f, w) => {
745
758
  const I = j.slice(0, w + 1).join("/");
746
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": I === a ? "location" : void 0, onClick: () => g(I), children: b }) }, I);
759
+ return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": I === a ? "location" : void 0, onClick: () => g(I), children: f }) }, I);
747
760
  })
748
761
  ] })
749
762
  ] }),
750
- E.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": O, onClick: () => le((b) => !b), children: i.selected(E.length) }) : null
763
+ E.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": K, onClick: () => le((f) => !f), children: i.selected(E.length) }) : null
751
764
  ] }),
752
- O && E.length > 0 ? /* @__PURE__ */ d("div", { className: "cms-file-picker__chosen", children: [
753
- /* @__PURE__ */ e("ul", { children: [...x.entries()].map(([b, w]) => /* @__PURE__ */ d("li", { children: [
765
+ K && E.length > 0 ? /* @__PURE__ */ o("div", { className: "cms-file-picker__chosen", children: [
766
+ /* @__PURE__ */ e("ul", { children: [...x.entries()].map(([f, w]) => /* @__PURE__ */ o("li", { children: [
754
767
  /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: w.name }),
755
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i.remove(w.name), onClick: () => Z(b), children: /* @__PURE__ */ e(z, { name: "close" }) })
756
- ] }, b)) }),
768
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i.remove(w.name), onClick: () => Z(f), children: /* @__PURE__ */ e(z, { name: "close" }) })
769
+ ] }, f)) }),
757
770
  /* @__PURE__ */ e(ne, { variant: "secondary", onClick: () => {
758
771
  M(/* @__PURE__ */ new Map()), le(!1);
759
772
  }, children: i.clear })
760
773
  ] }) : null,
761
- /* @__PURE__ */ d("div", { className: "cms-file-picker__list", onScroll: (b) => {
762
- const w = b.currentTarget;
774
+ /* @__PURE__ */ o("div", { className: "cms-file-picker__list", onScroll: (f) => {
775
+ const w = f.currentTarget;
763
776
  w.scrollTop + w.clientHeight >= w.scrollHeight - en && F();
764
777
  }, children: [
765
- f.status === "loading" ? /* @__PURE__ */ e(ee, { kind: "loading", title: i.loading, placement: "block" }) : null,
766
- f.status === "error" ? /* @__PURE__ */ e(ee, { kind: "error", title: i.error, placement: "block", action: { label: i.retry, onAction: () => k((b) => b + 1) } }) : null,
767
- f.status === "denied" ? /* @__PURE__ */ e(ee, { kind: "denied", title: i.denied, placement: "block" }) : null,
768
- f.status === "ready" && W.length === 0 ? /* @__PURE__ */ e(ee, { kind: "empty", title: i.empty, placement: "block" }) : null,
769
- /* @__PURE__ */ d(
778
+ p.status === "loading" ? /* @__PURE__ */ e(ee, { kind: "loading", title: i.loading, placement: "block" }) : null,
779
+ p.status === "error" ? /* @__PURE__ */ e(ee, { kind: "error", title: i.error, placement: "block", action: { label: i.retry, onAction: () => k((f) => f + 1) } }) : null,
780
+ p.status === "denied" ? /* @__PURE__ */ e(ee, { kind: "denied", title: i.denied, placement: "block" }) : null,
781
+ p.status === "ready" && W.length === 0 ? /* @__PURE__ */ e(ee, { kind: "empty", title: i.empty, placement: "block" }) : null,
782
+ /* @__PURE__ */ o(
770
783
  "div",
771
784
  {
772
- ref: J,
785
+ ref: Q,
773
786
  role: "listbox",
774
787
  "aria-multiselectable": "true",
775
788
  "aria-label": i.files,
776
789
  "aria-activedescendant": W.length > 0 ? de(C) : void 0,
777
790
  tabIndex: 0,
778
791
  className: "cms-file-picker__entries",
779
- hidden: f.status !== "ready" || W.length === 0,
792
+ hidden: p.status !== "ready" || W.length === 0,
780
793
  onKeyDown: L,
781
794
  children: [
782
- W.map((b, w) => {
783
- const I = b.kind === "file" && x.has(Ne(c, b.id)), K = ie(b);
784
- return /* @__PURE__ */ d(
795
+ W.map((f, w) => {
796
+ const I = f.kind === "file" && x.has(Ne(c, f.id)), H = ie(f);
797
+ return /* @__PURE__ */ o(
785
798
  "div",
786
799
  {
787
800
  id: de(w),
788
801
  role: "option",
789
- "aria-selected": b.kind === "file" ? I : void 0,
790
- "aria-disabled": K !== null || void 0,
791
- className: D("cms-file-picker__entry", w === C && "is-active", I && "is-ticked", K !== null && "is-disabled"),
802
+ "aria-selected": f.kind === "file" ? I : void 0,
803
+ "aria-disabled": H !== null || void 0,
804
+ className: T("cms-file-picker__entry", w === C && "is-active", I && "is-ticked", H !== null && "is-disabled"),
792
805
  onClick: () => {
793
- H(w), b.kind === "folder" ? _(b) : ce(b);
806
+ U(w), f.kind === "folder" ? _(f) : ce(f);
794
807
  },
795
808
  children: [
796
809
  /* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: I ? /* @__PURE__ */ e(P, { name: "check" }) : null }),
797
- /* @__PURE__ */ e(P, { name: b.kind === "folder" ? "folder" : "file" }),
798
- /* @__PURE__ */ d("span", { className: "cms-file-picker__text", children: [
799
- /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: b.name }),
800
- K !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: K }) : null
810
+ /* @__PURE__ */ e(P, { name: f.kind === "folder" ? "folder" : "file" }),
811
+ /* @__PURE__ */ o("span", { className: "cms-file-picker__text", children: [
812
+ /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: f.name }),
813
+ H !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: H }) : null
801
814
  ] }),
802
- b.kind === "file" && b.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: r(b.size) }) : null
815
+ f.kind === "file" && f.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: r(f.size) }) : null
803
816
  ]
804
817
  },
805
- b.id
818
+ f.id
806
819
  );
807
820
  }),
808
- f.status === "ready" && f.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(ee, { kind: "loading", title: i.loading, placement: "inline" }) }) : null
821
+ p.status === "ready" && p.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(ee, { kind: "loading", title: i.loading, placement: "inline" }) }) : null
809
822
  ]
810
823
  }
811
824
  )
@@ -814,25 +827,25 @@ function Tn(n) {
814
827
  }
815
828
  );
816
829
  }
817
- function En({ title: n, scope: l, actions: t, backLink: o }) {
818
- return /* @__PURE__ */ d("header", { className: "cms-page-header", children: [
819
- o ? /* @__PURE__ */ d(
830
+ function En({ title: n, scope: l, actions: t, backLink: d }) {
831
+ return /* @__PURE__ */ o("header", { className: "cms-page-header", children: [
832
+ d ? /* @__PURE__ */ o(
820
833
  "a",
821
834
  {
822
835
  className: "cms-page-header__back",
823
- href: o.href ?? "#",
836
+ href: d.href ?? "#",
824
837
  onClick: (m) => {
825
- o.onBack && (m.preventDefault(), o.onBack());
838
+ d.onBack && (m.preventDefault(), d.onBack());
826
839
  },
827
840
  children: [
828
841
  /* @__PURE__ */ e(z, { name: "back" }),
829
842
  " ",
830
- o.label
843
+ d.label
831
844
  ]
832
845
  }
833
846
  ) : null,
834
- /* @__PURE__ */ d("div", { className: "cms-page-header__row", children: [
835
- /* @__PURE__ */ d("div", { className: "cms-page-header__titles", children: [
847
+ /* @__PURE__ */ o("div", { className: "cms-page-header__row", children: [
848
+ /* @__PURE__ */ o("div", { className: "cms-page-header__titles", children: [
836
849
  /* @__PURE__ */ e("h1", { className: "cms-page-header__title", children: n }),
837
850
  l != null ? /* @__PURE__ */ e("p", { className: "cms-page-header__scope", children: l }) : null
838
851
  ] }),
@@ -840,30 +853,30 @@ function En({ title: n, scope: l, actions: t, backLink: o }) {
840
853
  ] })
841
854
  ] });
842
855
  }
843
- function Ln({ tabs: n, active: l, onSelect: t, label: o }) {
844
- const m = U([]), s = (r, i) => {
856
+ function Ln({ tabs: n, active: l, onSelect: t, label: d }) {
857
+ const m = R([]), s = (r, i) => {
845
858
  var h;
846
- const u = n.length - 1, p = r.key === "ArrowRight" ? i === u ? 0 : i + 1 : r.key === "ArrowLeft" ? i === 0 ? u : i - 1 : r.key === "Home" ? 0 : r.key === "End" ? u : null;
847
- if (p === null) return;
859
+ const u = n.length - 1, b = r.key === "ArrowRight" ? i === u ? 0 : i + 1 : r.key === "ArrowLeft" ? i === 0 ? u : i - 1 : r.key === "Home" ? 0 : r.key === "End" ? u : null;
860
+ if (b === null) return;
848
861
  r.preventDefault();
849
- const c = n[p];
850
- c && (t(c.id), (h = m.current[p]) == null || h.focus());
862
+ const c = n[b];
863
+ c && (t(c.id), (h = m.current[b]) == null || h.focus());
851
864
  };
852
- return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": o, children: n.map((r, i) => {
865
+ return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": d, children: n.map((r, i) => {
853
866
  const u = r.id === l;
854
- return /* @__PURE__ */ d(
867
+ return /* @__PURE__ */ o(
855
868
  "button",
856
869
  {
857
- ref: (p) => {
858
- m.current[i] = p;
870
+ ref: (b) => {
871
+ m.current[i] = b;
859
872
  },
860
873
  type: "button",
861
874
  role: "tab",
862
- className: D("cms-tab", u && "is-active"),
875
+ className: T("cms-tab", u && "is-active"),
863
876
  "aria-selected": u,
864
877
  tabIndex: u ? 0 : -1,
865
878
  onClick: () => t(r.id),
866
- onKeyDown: (p) => s(p, i),
879
+ onKeyDown: (b) => s(b, i),
867
880
  children: [
868
881
  r.label,
869
882
  r.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: r.count }) : null
@@ -874,9 +887,11 @@ function Ln({ tabs: n, active: l, onSelect: t, label: o }) {
874
887
  }) });
875
888
  }
876
889
  function nn(n) {
877
- var o;
878
- const l = n.trim().split(/\s+/).filter(Boolean);
879
- return (l.length > 1 ? [l[0][0], l[l.length - 1][0]] : [(o = l[0]) == null ? void 0 : o[0]]).filter(Boolean).join("").toUpperCase();
890
+ const l = n.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), t = (m) => {
891
+ var s;
892
+ return (s = m == null ? void 0 : m.match(/[\p{L}\p{N}]/u)) == null ? void 0 : s[0];
893
+ };
894
+ return (l.length > 1 ? [t(l[0]), t(l[l.length - 1])] : [t(l[0])]).filter(Boolean).join("").toUpperCase();
880
895
  }
881
896
  function ln(n) {
882
897
  let l = 0;
@@ -884,45 +899,45 @@ function ln(n) {
884
899
  l = l * 31 + (t.codePointAt(0) ?? 0) >>> 0;
885
900
  return l % 6 + 1;
886
901
  }
887
- function ve({ name: n, pictureUrl: l, presence: t, size: o = 32 }) {
888
- return /* @__PURE__ */ d(
902
+ function ve({ name: n, pictureUrl: l, presence: t, size: d = 32 }) {
903
+ return /* @__PURE__ */ o(
889
904
  "span",
890
905
  {
891
906
  className: `cms-avatar cms-avatar--tint-${ln(n)}`,
892
- style: { width: o, height: o, fontSize: Math.round(o * 0.4) },
907
+ style: { width: d, height: d, fontSize: Math.round(d * 0.4) },
893
908
  role: "img",
894
909
  "aria-label": t ? `${n}, ${t}` : n,
895
910
  children: [
896
911
  l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: nn(n) }),
897
- t ? /* @__PURE__ */ e("span", { className: D("cms-avatar__presence", `is-${t}`), "aria-hidden": "true" }) : null
912
+ t ? /* @__PURE__ */ e("span", { className: T("cms-avatar__presence", `is-${t}`), "aria-hidden": "true" }) : null
898
913
  ]
899
914
  }
900
915
  );
901
916
  }
902
917
  function tn({ count: n, label: l, max: t = 99 }) {
903
- return n <= 0 ? null : /* @__PURE__ */ d("span", { className: "cms-badge", children: [
918
+ return n <= 0 ? null : /* @__PURE__ */ o("span", { className: "cms-badge", children: [
904
919
  /* @__PURE__ */ e("span", { "aria-hidden": "true", children: n > t ? `${t}+` : n }),
905
920
  /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: l })
906
921
  ] });
907
922
  }
908
- function $n({ product: n, mark: l, rail: t, active: o, onNavigate: m, server: s, search: r, account: i, children: u, railLabel: p = "Sections" }) {
909
- return /* @__PURE__ */ d("div", { className: "cms-shell", children: [
910
- /* @__PURE__ */ d("nav", { className: "cms-shell__rail", "aria-label": p, children: [
923
+ function $n({ product: n, mark: l, rail: t, active: d, onNavigate: m, server: s, search: r, account: i, children: u, railLabel: b = "Sections" }) {
924
+ return /* @__PURE__ */ o("div", { className: "cms-shell", children: [
925
+ /* @__PURE__ */ o("nav", { className: "cms-shell__rail", "aria-label": b, children: [
911
926
  /* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: l }),
912
927
  /* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((c) => {
913
- const h = c.id === o;
914
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
928
+ const h = c.id === d;
929
+ return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
915
930
  "a",
916
931
  {
917
932
  href: c.href,
918
- className: D("cms-shell__item", h && "is-active"),
933
+ className: T("cms-shell__item", h && "is-active"),
919
934
  "aria-current": h ? "page" : void 0,
920
935
  title: c.label,
921
936
  onClick: (a) => {
922
937
  m && (a.preventDefault(), m(c.id));
923
938
  },
924
939
  children: [
925
- /* @__PURE__ */ d("span", { className: "cms-shell__icon", children: [
940
+ /* @__PURE__ */ o("span", { className: "cms-shell__icon", children: [
926
941
  /* @__PURE__ */ e(P, { name: c.icon, size: 22 }),
927
942
  c.badge ? /* @__PURE__ */ e(tn, { count: c.badge.count, label: c.badge.label }) : null
928
943
  ] }),
@@ -932,7 +947,7 @@ function $n({ product: n, mark: l, rail: t, active: o, onNavigate: m, server: s,
932
947
  ) }, c.id);
933
948
  }) })
934
949
  ] }),
935
- /* @__PURE__ */ d("header", { className: "cms-shell__top", children: [
950
+ /* @__PURE__ */ o("header", { className: "cms-shell__top", children: [
936
951
  /* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
937
952
  s != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: s }) : null,
938
953
  r != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: r }) : null,
@@ -941,8 +956,8 @@ function $n({ product: n, mark: l, rail: t, active: o, onNavigate: m, server: s,
941
956
  /* @__PURE__ */ e("main", { className: "cms-shell__main", children: u })
942
957
  ] });
943
958
  }
944
- function In({ label: n, placeholder: l, value: t, onChange: o, onSearch: m }) {
945
- return /* @__PURE__ */ d(
959
+ function In({ label: n, placeholder: l, value: t, onChange: d, onSearch: m }) {
960
+ return /* @__PURE__ */ o(
946
961
  "form",
947
962
  {
948
963
  role: "search",
@@ -960,37 +975,37 @@ function In({ label: n, placeholder: l, value: t, onChange: o, onSearch: m }) {
960
975
  "aria-label": n,
961
976
  placeholder: l,
962
977
  value: t,
963
- onChange: (s) => o(s.target.value)
978
+ onChange: (s) => d(s.target.value)
964
979
  }
965
980
  )
966
981
  ]
967
982
  }
968
983
  );
969
984
  }
970
- function Pn({ options: n, value: l, onChange: t, label: o }) {
971
- const m = U([]), s = (r, i) => {
985
+ function Pn({ options: n, value: l, onChange: t, label: d }) {
986
+ const m = R([]), s = (r, i) => {
972
987
  var h;
973
- const u = n.length - 1, p = r.key === "ArrowRight" || r.key === "ArrowDown" ? i === u ? 0 : i + 1 : r.key === "ArrowLeft" || r.key === "ArrowUp" ? i === 0 ? u : i - 1 : null;
974
- if (p === null) return;
988
+ const u = n.length - 1, b = r.key === "ArrowRight" || r.key === "ArrowDown" ? i === u ? 0 : i + 1 : r.key === "ArrowLeft" || r.key === "ArrowUp" ? i === 0 ? u : i - 1 : null;
989
+ if (b === null) return;
975
990
  r.preventDefault();
976
- const c = n[p];
977
- c && (t(c.id), (h = m.current[p]) == null || h.focus());
991
+ const c = n[b];
992
+ c && (t(c.id), (h = m.current[b]) == null || h.focus());
978
993
  };
979
- return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": o, children: n.map((r, i) => {
994
+ return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": d, children: n.map((r, i) => {
980
995
  const u = r.id === l;
981
- return /* @__PURE__ */ d(
996
+ return /* @__PURE__ */ o(
982
997
  "button",
983
998
  {
984
- ref: (p) => {
985
- m.current[i] = p;
999
+ ref: (b) => {
1000
+ m.current[i] = b;
986
1001
  },
987
1002
  type: "button",
988
1003
  role: "radio",
989
1004
  "aria-checked": u,
990
1005
  tabIndex: u ? 0 : -1,
991
- className: D("cms-chip", u && "is-on"),
1006
+ className: T("cms-chip", u && "is-on"),
992
1007
  onClick: () => t(r.id),
993
- onKeyDown: (p) => s(p, i),
1008
+ onKeyDown: (b) => s(b, i),
994
1009
  children: [
995
1010
  u ? /* @__PURE__ */ e(P, { name: "check", size: 16 }) : null,
996
1011
  r.label
@@ -1002,16 +1017,16 @@ function Pn({ options: n, value: l, onChange: t, label: o }) {
1002
1017
  }
1003
1018
  const De = 16;
1004
1019
  function an(n, l, t) {
1005
- const o = n.map((s) => Math.min(Math.max(s.width, s.min), s.max));
1006
- let m = o.reduce((s, r) => s + r, 0) + t - l;
1007
- for (let s = o.length - 1; s >= 0 && m > 0; s -= 1) {
1008
- const r = Math.min(m, o[s] - n[s].min);
1009
- o[s] = o[s] - r, m -= r;
1020
+ const d = n.map((s) => Math.min(Math.max(s.width, s.min), s.max));
1021
+ let m = d.reduce((s, r) => s + r, 0) + t - l;
1022
+ for (let s = d.length - 1; s >= 0 && m > 0; s -= 1) {
1023
+ const r = Math.min(m, d[s] - n[s].min);
1024
+ d[s] = d[s] - r, m -= r;
1010
1025
  }
1011
- return o;
1026
+ return d;
1012
1027
  }
1013
- function sn({ index: n, size: l, shown: t, others: o, room: m, lastMin: s, onResize: r }) {
1014
- const i = Math.max(l.min, Math.min(l.max, m > 0 ? m - o - s : l.max)), u = (h) => Math.round(Math.min(Math.max(h, l.min), i)), p = U(null), c = (h, a) => r == null ? void 0 : r(n, u(h), a);
1028
+ function sn({ index: n, size: l, shown: t, others: d, room: m, lastMin: s, onResize: r }) {
1029
+ const i = Math.max(l.min, Math.min(l.max, m > 0 ? m - d - s : l.max)), u = (h) => Math.round(Math.min(Math.max(h, l.min), i)), b = R(null), c = (h, a) => r == null ? void 0 : r(n, u(h), a);
1015
1030
  return /* @__PURE__ */ e(
1016
1031
  "div",
1017
1032
  {
@@ -1025,22 +1040,22 @@ function sn({ index: n, size: l, shown: t, others: o, room: m, lastMin: s, onRes
1025
1040
  className: "cms-panes__splitter",
1026
1041
  style: { "--split-at": `var(--split-pane-end-${String(n)})` },
1027
1042
  onPointerDown: (h) => {
1028
- var a, g, f;
1029
- h.button > 0 || (h.preventDefault(), (g = (a = h.currentTarget).setPointerCapture) == null || g.call(a, h.pointerId), p.current = { x: h.clientX, from: t, last: t }, (f = h.currentTarget.closest(".cms-panes")) == null || f.classList.add("is-resizing"));
1043
+ var a, g, p;
1044
+ h.button > 0 || (h.preventDefault(), (g = (a = h.currentTarget).setPointerCapture) == null || g.call(a, h.pointerId), b.current = { x: h.clientX, from: t, last: t }, (p = h.currentTarget.closest(".cms-panes")) == null || p.classList.add("is-resizing"));
1030
1045
  },
1031
1046
  onPointerMove: (h) => {
1032
- const a = p.current;
1047
+ const a = b.current;
1033
1048
  a === null || !Number.isFinite(h.clientX) || (a.last = u(a.from + h.clientX - a.x), c(a.last, !1));
1034
1049
  },
1035
1050
  onPointerUp: (h) => {
1036
1051
  var g;
1037
- const a = p.current;
1038
- a !== null && (p.current = null, (g = h.currentTarget.closest(".cms-panes")) == null || g.classList.remove("is-resizing"), c(a.last, !0));
1052
+ const a = b.current;
1053
+ a !== null && (b.current = null, (g = h.currentTarget.closest(".cms-panes")) == null || g.classList.remove("is-resizing"), c(a.last, !0));
1039
1054
  },
1040
1055
  onPointerCancel: (h) => {
1041
1056
  var g;
1042
- const a = p.current;
1043
- p.current = null, (g = h.currentTarget.closest(".cms-panes")) == null || g.classList.remove("is-resizing"), a !== null && c(a.last, !0);
1057
+ const a = b.current;
1058
+ b.current = null, (g = h.currentTarget.closest(".cms-panes")) == null || g.classList.remove("is-resizing"), a !== null && c(a.last, !0);
1044
1059
  },
1045
1060
  onDoubleClick: () => c(l.reset, !0),
1046
1061
  onKeyDown: (h) => {
@@ -1050,73 +1065,73 @@ function sn({ index: n, size: l, shown: t, others: o, room: m, lastMin: s, onRes
1050
1065
  }
1051
1066
  );
1052
1067
  }
1053
- function Fn({ panes: n, active: l, back: t, sizes: o, lastMin: m = 360, onResize: s }) {
1054
- const r = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), i = U(null), [u, p] = A(0), c = (o ?? []).slice(0, n.length - 1), h = c.length === n.length - 1 && c.every((f) => f !== void 0);
1068
+ function Fn({ panes: n, active: l, back: t, sizes: d, lastMin: m = 360, onResize: s }) {
1069
+ const r = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), i = R(null), [u, b] = D(0), c = (d ?? []).slice(0, n.length - 1), h = c.length === n.length - 1 && c.every((p) => p !== void 0);
1055
1070
  ke(() => {
1056
- const f = i.current;
1057
- if (f === null || !h) return;
1058
- const v = () => p(f.clientWidth);
1071
+ const p = i.current;
1072
+ if (p === null || !h) return;
1073
+ const v = () => b(p.clientWidth);
1059
1074
  if (v(), typeof ResizeObserver > "u") return;
1060
1075
  const N = new ResizeObserver(v);
1061
- return N.observe(f), () => N.disconnect();
1076
+ return N.observe(p), () => N.disconnect();
1062
1077
  }, [h]);
1063
- const a = h ? an(c, u > 0 ? u : Number.POSITIVE_INFINITY, m) : [], g = h ? Object.fromEntries(a.flatMap((f, v) => [
1064
- [`--split-pane-${String(v)}`, `${String(f)}px`],
1078
+ const a = h ? an(c, u > 0 ? u : Number.POSITIVE_INFINITY, m) : [], g = h ? Object.fromEntries(a.flatMap((p, v) => [
1079
+ [`--split-pane-${String(v)}`, `${String(p)}px`],
1065
1080
  [`--split-pane-end-${String(v)}`, `${String(a.slice(0, v + 1).reduce((N, k) => N + k, 0))}px`]
1066
1081
  ])) : void 0;
1067
- return /* @__PURE__ */ d(
1082
+ return /* @__PURE__ */ o(
1068
1083
  "div",
1069
1084
  {
1070
1085
  ref: i,
1071
- className: D("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", h && "cms-panes--sized"),
1086
+ className: T("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", h && "cms-panes--sized"),
1072
1087
  "data-active": r,
1073
1088
  style: g,
1074
1089
  children: [
1075
- n.map((f, v) => /* @__PURE__ */ d("section", { className: "cms-panes__pane", "aria-label": f.label, "data-offset": r - v, children: [
1076
- v === r && t ? /* @__PURE__ */ d("a", { className: "cms-panes__back", href: t.href, children: [
1090
+ n.map((p, v) => /* @__PURE__ */ o("section", { className: "cms-panes__pane", "aria-label": p.label, "data-offset": r - v, children: [
1091
+ v === r && t ? /* @__PURE__ */ o("a", { className: "cms-panes__back", href: t.href, children: [
1077
1092
  /* @__PURE__ */ e(P, { name: "chevron-left", size: 18 }),
1078
1093
  t.label
1079
1094
  ] }) : null,
1080
- f.content
1081
- ] }, f.label)),
1082
- h ? c.map((f, v) => /* @__PURE__ */ e(
1095
+ p.content
1096
+ ] }, p.label)),
1097
+ h ? c.map((p, v) => /* @__PURE__ */ e(
1083
1098
  sn,
1084
1099
  {
1085
1100
  index: v,
1086
- size: f,
1101
+ size: p,
1087
1102
  shown: a[v],
1088
1103
  others: a.reduce((N, k, x) => x === v ? N : N + k, 0),
1089
1104
  room: u,
1090
1105
  lastMin: m,
1091
1106
  onResize: s
1092
1107
  },
1093
- f.label
1108
+ p.label
1094
1109
  )) : null
1095
1110
  ]
1096
1111
  }
1097
1112
  );
1098
1113
  }
1099
1114
  const rn = { attachment: "Has an attachment", unread: "Unread" };
1100
- function Bn({ from: n, subject: l, preview: t, time: o, unread: m, hasAttachment: s, selected: r, onOpen: i, labels: u }) {
1101
- const p = re(rn, u);
1102
- return /* @__PURE__ */ d(
1115
+ function Bn({ from: n, subject: l, preview: t, time: d, unread: m, hasAttachment: s, selected: r, onOpen: i, labels: u }) {
1116
+ const b = re(rn, u);
1117
+ return /* @__PURE__ */ o(
1103
1118
  "button",
1104
1119
  {
1105
1120
  type: "button",
1106
- className: D("cms-mail-row", m && "is-unread", r && "is-selected"),
1121
+ className: T("cms-mail-row", m && "is-unread", r && "is-selected"),
1107
1122
  "aria-current": r ? "true" : void 0,
1108
1123
  onClick: i,
1109
1124
  children: [
1110
1125
  /* @__PURE__ */ e(ve, { name: n, size: 40 }),
1111
- /* @__PURE__ */ d("span", { className: "cms-mail-row__body", children: [
1112
- /* @__PURE__ */ d("span", { className: "cms-mail-row__line", children: [
1126
+ /* @__PURE__ */ o("span", { className: "cms-mail-row__body", children: [
1127
+ /* @__PURE__ */ o("span", { className: "cms-mail-row__line", children: [
1113
1128
  /* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
1114
- s ? /* @__PURE__ */ e(P, { name: "paperclip", size: 16, label: p.attachment }) : null,
1115
- /* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: o })
1129
+ s ? /* @__PURE__ */ e(P, { name: "paperclip", size: 16, label: b.attachment }) : null,
1130
+ /* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: d })
1116
1131
  ] }),
1117
- /* @__PURE__ */ d("span", { className: "cms-mail-row__line", children: [
1132
+ /* @__PURE__ */ o("span", { className: "cms-mail-row__line", children: [
1118
1133
  /* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
1119
- m ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": p.unread }) : null
1134
+ m ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": b.unread }) : null
1120
1135
  ] }),
1121
1136
  /* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: t })
1122
1137
  ] })
@@ -1124,25 +1139,25 @@ function Bn({ from: n, subject: l, preview: t, time: o, unread: m, hasAttachment
1124
1139
  }
1125
1140
  );
1126
1141
  }
1127
- function Kn({ direction: n, children: l, time: t, read: o, readLabel: m = "Read" }) {
1128
- return /* @__PURE__ */ d("div", { className: D("cms-bubble", `cms-bubble--${n}`), children: [
1142
+ function Kn({ direction: n, children: l, time: t, read: d, readLabel: m = "Read" }) {
1143
+ return /* @__PURE__ */ o("div", { className: T("cms-bubble", `cms-bubble--${n}`), children: [
1129
1144
  /* @__PURE__ */ e("div", { className: "cms-bubble__text", children: l }),
1130
- /* @__PURE__ */ d("div", { className: "cms-bubble__meta", children: [
1145
+ /* @__PURE__ */ o("div", { className: "cms-bubble__meta", children: [
1131
1146
  t,
1132
- n === "out" && o ? /* @__PURE__ */ d(S, { children: [
1147
+ n === "out" && d ? /* @__PURE__ */ o(S, { children: [
1133
1148
  " · ",
1134
1149
  m
1135
1150
  ] }) : null
1136
1151
  ] })
1137
1152
  ] });
1138
1153
  }
1139
- function Hn({ label: n, value: l, onChange: t, onSend: o, onAttach: m, placeholder: s, variant: r = "chat", sendLabel: i = "Send", attachLabel: u = "Attach a file", leading: p, canSend: c }) {
1154
+ function Hn({ label: n, value: l, onChange: t, onSend: d, onAttach: m, placeholder: s, variant: r = "chat", sendLabel: i = "Send", attachLabel: u = "Attach a file", leading: b, canSend: c }) {
1140
1155
  const h = q(), a = c ?? l.trim() !== "", g = (v) => {
1141
- v.preventDefault(), a && o();
1142
- }, f = m ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": u, onClick: m, children: /* @__PURE__ */ e(P, { name: "paperclip" }) }) : null;
1143
- return /* @__PURE__ */ d("form", { className: D("cms-composer", `cms-composer--${r}`), onSubmit: g, children: [
1156
+ v.preventDefault(), a && d();
1157
+ }, p = m ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": u, onClick: m, children: /* @__PURE__ */ e(P, { name: "paperclip" }) }) : null;
1158
+ return /* @__PURE__ */ o("form", { className: T("cms-composer", `cms-composer--${r}`), onSubmit: g, children: [
1144
1159
  /* @__PURE__ */ e("label", { htmlFor: h, className: r === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
1145
- r === "chat" ? f : null,
1160
+ r === "chat" ? p : null,
1146
1161
  /* @__PURE__ */ e(
1147
1162
  "textarea",
1148
1163
  {
@@ -1153,13 +1168,13 @@ function Hn({ label: n, value: l, onChange: t, onSend: o, onAttach: m, placehold
1153
1168
  value: l,
1154
1169
  onChange: (v) => t(v.target.value),
1155
1170
  onKeyDown: (v) => {
1156
- v.nativeEvent.isComposing || v.keyCode === 229 || r === "chat" && v.key === "Enter" && !v.shiftKey && (v.preventDefault(), a && o());
1171
+ v.nativeEvent.isComposing || v.keyCode === 229 || r === "chat" && v.key === "Enter" && !v.shiftKey && (v.preventDefault(), a && d());
1157
1172
  }
1158
1173
  }
1159
1174
  ),
1160
- r === "reply" && p !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: p }) : null,
1161
- r === "reply" ? f : null,
1162
- r === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": i, disabled: !a, children: /* @__PURE__ */ e(P, { name: "send" }) }) : /* @__PURE__ */ d("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !a, children: [
1175
+ r === "reply" && b !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: b }) : null,
1176
+ r === "reply" ? p : null,
1177
+ r === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": i, disabled: !a, children: /* @__PURE__ */ e(P, { name: "send" }) }) : /* @__PURE__ */ o("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !a, children: [
1163
1178
  i,
1164
1179
  " ",
1165
1180
  /* @__PURE__ */ e(P, { name: "send", size: 18 })
@@ -1187,24 +1202,24 @@ const Se = {
1187
1202
  onCallWith: (n) => `On a call with ${n}`,
1188
1203
  returnToCall: "Return to call"
1189
1204
  };
1190
- function On({ name: n, media: l, onAccept: t, onDecline: o, labels: m }) {
1205
+ function On({ name: n, media: l, onAccept: t, onDecline: d, labels: m }) {
1191
1206
  const s = re(Se, m), r = l === "video" ? s.incomingVideo : s.incomingAudio;
1192
- return /* @__PURE__ */ d("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": s.incomingFrom(r, n), children: [
1207
+ return /* @__PURE__ */ o("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": s.incomingFrom(r, n), children: [
1193
1208
  /* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(ve, { name: n, size: 112 }) }),
1194
1209
  /* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: n }),
1195
1210
  /* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: r }),
1196
- /* @__PURE__ */ d("div", { className: "cms-call-incoming__actions", children: [
1197
- /* @__PURE__ */ e(ae, { icon: "phone-off", label: s.decline, tone: "hang-up", onClick: o }),
1211
+ /* @__PURE__ */ o("div", { className: "cms-call-incoming__actions", children: [
1212
+ /* @__PURE__ */ e(ae, { icon: "phone-off", label: s.decline, tone: "hang-up", onClick: d }),
1198
1213
  /* @__PURE__ */ e(ae, { icon: "phone", label: s.accept, tone: "accept", onClick: t })
1199
1214
  ] })
1200
1215
  ] });
1201
1216
  }
1202
- function ae({ icon: n, label: l, onClick: t, tone: o = "plain", pressed: m }) {
1203
- return /* @__PURE__ */ d(
1217
+ function ae({ icon: n, label: l, onClick: t, tone: d = "plain", pressed: m }) {
1218
+ return /* @__PURE__ */ o(
1204
1219
  "button",
1205
1220
  {
1206
1221
  type: "button",
1207
- className: D("cms-call-button", `cms-call-button--${o}`, m && "is-pressed"),
1222
+ className: T("cms-call-button", `cms-call-button--${d}`, m && "is-pressed"),
1208
1223
  "aria-pressed": m,
1209
1224
  onClick: t,
1210
1225
  children: [
@@ -1214,55 +1229,55 @@ function ae({ icon: n, label: l, onClick: t, tone: o = "plain", pressed: m }) {
1214
1229
  }
1215
1230
  );
1216
1231
  }
1217
- function Un({ name: n, duration: l, connection: t, you: o, muted: m, speaker: s, onToggleMute: r, onToggleSpeaker: i, onAddPerson: u, onChat: p, onHangUp: c, labels: h }) {
1232
+ function Un({ name: n, duration: l, connection: t, you: d, muted: m, speaker: s, onToggleMute: r, onToggleSpeaker: i, onAddPerson: u, onChat: b, onHangUp: c, labels: h }) {
1218
1233
  const a = re(Se, h);
1219
- return /* @__PURE__ */ d("section", { className: "cms-call-panel", "aria-label": a.callWith(n), children: [
1220
- /* @__PURE__ */ d("div", { className: "cms-call-panel__head", children: [
1234
+ return /* @__PURE__ */ o("section", { className: "cms-call-panel", "aria-label": a.callWith(n), children: [
1235
+ /* @__PURE__ */ o("div", { className: "cms-call-panel__head", children: [
1221
1236
  /* @__PURE__ */ e(ve, { name: n, size: 64 }),
1222
- /* @__PURE__ */ d("div", { className: "cms-call-panel__who", children: [
1237
+ /* @__PURE__ */ o("div", { className: "cms-call-panel__who", children: [
1223
1238
  /* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
1224
1239
  /* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": a.callTime(l), children: l })
1225
1240
  ] }),
1226
- /* @__PURE__ */ e("span", { className: D("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? a.goodConnection : a.poorConnection })
1241
+ /* @__PURE__ */ e("span", { className: T("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? a.goodConnection : a.poorConnection })
1227
1242
  ] }),
1228
- /* @__PURE__ */ d("div", { className: "cms-call-panel__you", children: [
1229
- /* @__PURE__ */ e(ve, { name: o.name, size: 36 }),
1243
+ /* @__PURE__ */ o("div", { className: "cms-call-panel__you", children: [
1244
+ /* @__PURE__ */ e(ve, { name: d.name, size: 36 }),
1230
1245
  /* @__PURE__ */ e("span", { children: a.you }),
1231
- o.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": a.speaking }) : null
1246
+ d.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": a.speaking }) : null
1232
1247
  ] }),
1233
- /* @__PURE__ */ d("div", { className: "cms-call-panel__controls", children: [
1248
+ /* @__PURE__ */ o("div", { className: "cms-call-panel__controls", children: [
1234
1249
  /* @__PURE__ */ e(ae, { icon: "mic", label: m ? a.unmute : a.mute, pressed: m, onClick: r }),
1235
1250
  /* @__PURE__ */ e(ae, { icon: "speaker", label: a.speaker, pressed: s, onClick: i }),
1236
1251
  u ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: a.addPerson, onClick: u }) : null,
1237
- p ? /* @__PURE__ */ e(ae, { icon: "chat", label: a.chat, onClick: p }) : null,
1252
+ b ? /* @__PURE__ */ e(ae, { icon: "chat", label: a.chat, onClick: b }) : null,
1238
1253
  /* @__PURE__ */ e(ae, { icon: "phone-off", label: a.hangUp, tone: "hang-up", onClick: c })
1239
1254
  ] })
1240
1255
  ] });
1241
1256
  }
1242
- function zn({ name: n, duration: l, muted: t, onToggleMute: o, onReturn: m, onHangUp: s, labels: r }) {
1257
+ function Rn({ name: n, duration: l, muted: t, onToggleMute: d, onReturn: m, onHangUp: s, labels: r }) {
1243
1258
  const i = re(Se, r);
1244
- return /* @__PURE__ */ d("section", { className: "cms-call-bar", "aria-label": i.callWith(n), children: [
1259
+ return /* @__PURE__ */ o("section", { className: "cms-call-bar", "aria-label": i.callWith(n), children: [
1245
1260
  /* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
1246
1261
  /* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: i.onCallWith(n) }),
1247
1262
  /* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: l }),
1248
- /* @__PURE__ */ d("span", { className: "cms-call-bar__actions", children: [
1249
- /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ? i.unmute : i.mute, "aria-pressed": t, onClick: o, children: /* @__PURE__ */ e(P, { name: "mic" }) }),
1263
+ /* @__PURE__ */ o("span", { className: "cms-call-bar__actions", children: [
1264
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ? i.unmute : i.mute, "aria-pressed": t, onClick: d, children: /* @__PURE__ */ e(P, { name: "mic" }) }),
1250
1265
  /* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: m, children: i.returnToCall }),
1251
1266
  /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": i.hangUp, onClick: s, children: /* @__PURE__ */ e(P, { name: "phone-off" }) })
1252
1267
  ] })
1253
1268
  ] });
1254
1269
  }
1255
- function Rn({ mark: n, product: l, headline: t, lead: o, features: m = [], children: s }) {
1256
- return /* @__PURE__ */ d("div", { className: "cms-signin", children: [
1257
- /* @__PURE__ */ d("aside", { className: "cms-signin__brand", children: [
1258
- /* @__PURE__ */ d("p", { className: "cms-signin__logo", children: [
1270
+ function zn({ mark: n, product: l, headline: t, lead: d, features: m = [], children: s }) {
1271
+ return /* @__PURE__ */ o("div", { className: "cms-signin", children: [
1272
+ /* @__PURE__ */ o("aside", { className: "cms-signin__brand", children: [
1273
+ /* @__PURE__ */ o("p", { className: "cms-signin__logo", children: [
1259
1274
  /* @__PURE__ */ e("span", { className: "cms-signin__mark", "aria-hidden": "true", children: n }),
1260
1275
  l
1261
1276
  ] }),
1262
- /* @__PURE__ */ d("div", { className: "cms-signin__pitch", children: [
1277
+ /* @__PURE__ */ o("div", { className: "cms-signin__pitch", children: [
1263
1278
  /* @__PURE__ */ e("p", { className: "cms-signin__headline", children: t }),
1264
- /* @__PURE__ */ e("p", { className: "cms-signin__lead", children: o }),
1265
- m.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: m.map((r) => /* @__PURE__ */ d("li", { children: [
1279
+ /* @__PURE__ */ e("p", { className: "cms-signin__lead", children: d }),
1280
+ m.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: m.map((r) => /* @__PURE__ */ o("li", { children: [
1266
1281
  /* @__PURE__ */ e(P, { name: r.icon, size: 18 }),
1267
1282
  r.label
1268
1283
  ] }, r.label)) }) : null
@@ -1283,13 +1298,13 @@ const cn = {
1283
1298
  newHere: "New here?",
1284
1299
  create: "Create an account"
1285
1300
  };
1286
- function Zn({ server: n, onSubmit: l, forgotHref: t, createHref: o, error: m, busy: s, labels: r }) {
1287
- const i = re(cn, r), u = q(), [p, c] = A(""), [h, a] = A(""), [g, f] = A(!1);
1288
- return /* @__PURE__ */ d("form", { className: "cms-signin-form", onSubmit: (N) => {
1289
- N.preventDefault(), l(p, h);
1301
+ function Zn({ server: n, onSubmit: l, forgotHref: t, createHref: d, error: m, busy: s, labels: r }) {
1302
+ const i = re(cn, r), u = q(), [b, c] = D(""), [h, a] = D(""), [g, p] = D(!1);
1303
+ return /* @__PURE__ */ o("form", { className: "cms-signin-form", onSubmit: (N) => {
1304
+ N.preventDefault(), l(b, h);
1290
1305
  }, "aria-describedby": m ? `${u}-error` : void 0, children: [
1291
1306
  /* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: i.title }),
1292
- /* @__PURE__ */ d("p", { className: "cms-signin-form__server", children: [
1307
+ /* @__PURE__ */ o("p", { className: "cms-signin-form__server", children: [
1293
1308
  /* @__PURE__ */ e(P, { name: "server", size: 18 }),
1294
1309
  n
1295
1310
  ] }),
@@ -1302,13 +1317,13 @@ function Zn({ server: n, onSubmit: l, forgotHref: t, createHref: o, error: m, bu
1302
1317
  type: "text",
1303
1318
  autoComplete: "username",
1304
1319
  placeholder: i.identifierPlaceholder,
1305
- value: p,
1320
+ value: b,
1306
1321
  onChange: (N) => c(N.target.value),
1307
1322
  required: !0
1308
1323
  }
1309
1324
  ),
1310
1325
  /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-password`, children: i.password }),
1311
- /* @__PURE__ */ d("span", { className: "cms-signin-form__password", children: [
1326
+ /* @__PURE__ */ o("span", { className: "cms-signin-form__password", children: [
1312
1327
  /* @__PURE__ */ e(
1313
1328
  "input",
1314
1329
  {
@@ -1321,54 +1336,54 @@ function Zn({ server: n, onSubmit: l, forgotHref: t, createHref: o, error: m, bu
1321
1336
  required: !0
1322
1337
  }
1323
1338
  ),
1324
- /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": g, onClick: () => f((N) => !N), children: g ? i.hide : i.show })
1339
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": g, onClick: () => p((N) => !N), children: g ? i.hide : i.show })
1325
1340
  ] }),
1326
1341
  t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children: i.forgot }) : null,
1327
1342
  m ? /* @__PURE__ */ e("p", { id: `${u}-error`, className: "cms-signin-form__error", role: "alert", children: m }) : null,
1328
1343
  /* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: s, "aria-busy": s || void 0, children: i.submit }),
1329
- o ? /* @__PURE__ */ d(S, { children: [
1344
+ d ? /* @__PURE__ */ o(S, { children: [
1330
1345
  /* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: i.newHere }) }),
1331
- /* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: o, children: i.create })
1346
+ /* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: d, children: i.create })
1332
1347
  ] }) : null
1333
1348
  ] });
1334
1349
  }
1335
- function Vn({ label: n, rows: l, error: t, onRetry: o, loadingText: m = "Loading", emptyTitle: s = "Nothing here yet", emptyHint: r, selected: i, onOpen: u, onRowMenu: p }) {
1336
- const c = U([]);
1337
- if (t != null) return /* @__PURE__ */ e(Re, { message: t, onRetry: o });
1350
+ function Vn({ label: n, rows: l, error: t, onRetry: d, loadingText: m = "Loading", emptyTitle: s = "Nothing here yet", emptyHint: r, selected: i, onOpen: u, onRowMenu: b }) {
1351
+ const c = R([]);
1352
+ if (t != null) return /* @__PURE__ */ e(ze, { message: t, onRetry: d });
1338
1353
  if (l === null) return /* @__PURE__ */ e(Ue, { what: m, layout: "block" });
1339
- if (l.length === 0) return /* @__PURE__ */ e(ze, { title: s, hint: r });
1340
- const h = (a, g, f) => {
1354
+ if (l.length === 0) return /* @__PURE__ */ e(Re, { title: s, hint: r });
1355
+ const h = (a, g, p) => {
1341
1356
  var v;
1342
1357
  if (a.key === "ArrowDown" || a.key === "ArrowUp")
1343
1358
  a.preventDefault(), (v = c.current[Math.min(l.length - 1, Math.max(0, g + (a.key === "ArrowDown" ? 1 : -1)))]) == null || v.focus();
1344
1359
  else if (a.key === "Enter")
1345
- u == null || u(f);
1346
- else if ((a.key === "ContextMenu" || a.shiftKey && a.key === "F10") && p) {
1360
+ u == null || u(p);
1361
+ else if ((a.key === "ContextMenu" || a.shiftKey && a.key === "F10") && b) {
1347
1362
  a.preventDefault();
1348
1363
  const N = a.currentTarget.getBoundingClientRect();
1349
- p(f, { x: N.left + 16, y: N.bottom });
1364
+ b(p, { x: N.left + 16, y: N.bottom });
1350
1365
  }
1351
1366
  };
1352
1367
  return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((a, g) => {
1353
- const f = a.id === i;
1354
- return /* @__PURE__ */ d(
1368
+ const p = a.id === i;
1369
+ return /* @__PURE__ */ o(
1355
1370
  "li",
1356
1371
  {
1357
1372
  ref: (v) => {
1358
1373
  c.current[g] = v;
1359
1374
  },
1360
1375
  role: "option",
1361
- "aria-selected": f,
1362
- tabIndex: f || i == null && g === 0 ? 0 : -1,
1363
- className: D("cms-list__row", f && "is-selected"),
1376
+ "aria-selected": p,
1377
+ tabIndex: p || i == null && g === 0 ? 0 : -1,
1378
+ className: T("cms-list__row", p && "is-selected"),
1364
1379
  onClick: () => u == null ? void 0 : u(a.id),
1365
1380
  onKeyDown: (v) => h(v, g, a.id),
1366
- onContextMenu: p ? (v) => {
1367
- v.preventDefault(), p(a.id, { x: v.clientX, y: v.clientY });
1381
+ onContextMenu: b ? (v) => {
1382
+ v.preventDefault(), b(a.id, { x: v.clientX, y: v.clientY });
1368
1383
  } : void 0,
1369
1384
  children: [
1370
1385
  a.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: a.lead }) : null,
1371
- /* @__PURE__ */ d("span", { className: "cms-list__text", children: [
1386
+ /* @__PURE__ */ o("span", { className: "cms-list__text", children: [
1372
1387
  /* @__PURE__ */ e("span", { className: "cms-list__primary", children: a.primary }),
1373
1388
  a.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: a.secondary }) : null
1374
1389
  ] }),
@@ -1379,17 +1394,17 @@ function Vn({ label: n, rows: l, error: t, onRetry: o, loadingText: m = "Loading
1379
1394
  );
1380
1395
  }) });
1381
1396
  }
1382
- function on({ at: n, items: l, onClose: t, label: o = "Actions", focus: m = "first" }) {
1383
- const s = U(null), r = U(null), i = q(), [u, p] = A(n), c = l.filter((a) => a.offer.offered);
1397
+ function on({ at: n, items: l, onClose: t, label: d = "Actions", focus: m = "first" }) {
1398
+ const s = R(null), r = R(null), i = q(), [u, b] = D(n), c = l.filter((a) => a.offer.offered);
1384
1399
  if (ke(() => {
1385
1400
  if (!n) return;
1386
- const a = s.current, g = (a == null ? void 0 : a.offsetWidth) ?? 0, f = (a == null ? void 0 : a.offsetHeight) ?? 0;
1387
- p({ x: Math.max(0, Math.min(n.x, window.innerWidth - g)), y: Math.max(0, Math.min(n.y, window.innerHeight - f)) });
1388
- }, [n]), Y(() => {
1389
- var f, v;
1401
+ const a = s.current, g = (a == null ? void 0 : a.offsetWidth) ?? 0, p = (a == null ? void 0 : a.offsetHeight) ?? 0;
1402
+ b({ x: Math.max(0, Math.min(n.x, window.innerWidth - g)), y: Math.max(0, Math.min(n.y, window.innerHeight - p)) });
1403
+ }, [n]), J(() => {
1404
+ var p, v;
1390
1405
  if (!n) return;
1391
1406
  r.current = document.activeElement;
1392
- const a = Array.from(((f = s.current) == null ? void 0 : f.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
1407
+ const a = Array.from(((p = s.current) == null ? void 0 : p.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
1393
1408
  (v = m === "last" ? a[a.length - 1] : a[0]) == null || v.focus();
1394
1409
  const g = (N) => {
1395
1410
  var k;
@@ -1402,13 +1417,13 @@ function on({ at: n, items: l, onClose: t, label: o = "Actions", focus: m = "fir
1402
1417
  }, [n, t, m]), !n || c.length === 0) return null;
1403
1418
  const h = (a) => {
1404
1419
  var v, N;
1405
- const g = Array.from(((v = s.current) == null ? void 0 : v.querySelectorAll('[role="menuitem"]')) ?? []), f = g.indexOf(document.activeElement);
1420
+ const g = Array.from(((v = s.current) == null ? void 0 : v.querySelectorAll('[role="menuitem"]')) ?? []), p = g.indexOf(document.activeElement);
1406
1421
  if (a.key === "Escape" || a.key === "Tab")
1407
1422
  a.preventDefault(), t();
1408
1423
  else if (a.key === "ArrowDown" || a.key === "ArrowUp") {
1409
1424
  a.preventDefault();
1410
1425
  const k = a.key === "ArrowDown" ? 1 : -1;
1411
- (N = g[(f + k + g.length) % g.length]) == null || N.focus();
1426
+ (N = g[(p + k + g.length) % g.length]) == null || N.focus();
1412
1427
  }
1413
1428
  };
1414
1429
  return xe(
@@ -1418,13 +1433,13 @@ function on({ at: n, items: l, onClose: t, label: o = "Actions", focus: m = "fir
1418
1433
  ref: s,
1419
1434
  className: "cms-menu",
1420
1435
  role: "menu",
1421
- "aria-label": o,
1436
+ "aria-label": d,
1422
1437
  style: { left: (u ?? n).x, top: (u ?? n).y },
1423
1438
  onKeyDown: h,
1424
1439
  onContextMenu: (a) => a.preventDefault(),
1425
1440
  children: c.map((a) => {
1426
1441
  const g = a.offer.refusal !== void 0;
1427
- return /* @__PURE__ */ d(
1442
+ return /* @__PURE__ */ o(
1428
1443
  "div",
1429
1444
  {
1430
1445
  role: "menuitem",
@@ -1432,12 +1447,12 @@ function on({ at: n, items: l, onClose: t, label: o = "Actions", focus: m = "fir
1432
1447
  "aria-disabled": g || void 0,
1433
1448
  "aria-describedby": g ? `${i}-${a.id}` : void 0,
1434
1449
  title: g ? a.offer.refusal : void 0,
1435
- className: D("cms-menu__item", a.danger && "is-danger", a.offer.locked && "is-locked", g && "is-refused"),
1450
+ className: T("cms-menu__item", a.danger && "is-danger", a.offer.locked && "is-locked", g && "is-refused"),
1436
1451
  onClick: () => {
1437
1452
  g || (t(), a.onSelect());
1438
1453
  },
1439
- onKeyDown: (f) => {
1440
- (f.key === "Enter" || f.key === " ") && !g && (f.preventDefault(), t(), a.onSelect());
1454
+ onKeyDown: (p) => {
1455
+ (p.key === "Enter" || p.key === " ") && !g && (p.preventDefault(), t(), a.onSelect());
1441
1456
  },
1442
1457
  children: [
1443
1458
  a.offer.locked ? /* @__PURE__ */ e(z, { name: "lock" }) : null,
@@ -1462,63 +1477,69 @@ function dn(n) {
1462
1477
  function mn(n) {
1463
1478
  const l = /* @__PURE__ */ new Map();
1464
1479
  for (const t of n) t.overflow !== void 0 && t.overflow !== 0 && l.set(t.overflow, [...l.get(t.overflow) ?? [], t.id]);
1465
- return [...l.entries()].sort(([t], [o]) => t - o).map(([, t]) => t);
1480
+ return [...l.entries()].sort(([t], [d]) => t - d).map(([, t]) => t);
1466
1481
  }
1467
- function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leading: s }) {
1468
- const r = U(null), i = U(null), [u, p] = A(Te), [c, h] = A(null), [a, g] = A("first"), [f, v] = A(null), [N, k] = A(null), x = dn(l), M = mn(l), C = x.flat(), H = C.filter((_) => _.overflow === 0), O = C.filter((_) => _.overflow !== 0), le = JSON.stringify([l.map((_) => [_.id, _.label, _.icon, _.group, _.overflow ?? null]), o ?? "", s !== void 0]), J = be(() => {
1469
- const _ = r.current, T = i.current;
1470
- if (_ === null || T === null) return;
1482
+ function Wn({ label: n, actions: l, onAction: t, status: d, moreLabel: m, leading: s }) {
1483
+ const r = R(null), i = R(null), [u, b] = D(Te), [c, h] = D(null), [a, g] = D("first"), [p, v] = D(null), [N, k] = D(null), x = dn(l), M = mn(l), C = x.flat(), U = C.filter((_) => _.overflow === 0), K = C.filter((_) => _.overflow !== 0), le = JSON.stringify([l.map((_) => [_.id, _.label, _.icon, _.group, _.overflow ?? null]), d ?? "", s !== void 0]), Q = be(() => {
1484
+ const _ = r.current, A = i.current;
1485
+ if (_ === null || A === null) return;
1471
1486
  const Z = getComputedStyle(_), W = parseFloat(Z.columnGap || "0") || 0, L = _.clientWidth - (parseFloat(Z.paddingLeft) || 0) - (parseFloat(Z.paddingRight) || 0), j = ($) => {
1472
- var R;
1473
- return ((R = T.querySelector($)) == null ? void 0 : R.getBoundingClientRect().width) ?? 0;
1474
- }, oe = j('[data-measure="leading"]'), de = j('[data-measure="separator"]'), me = j('[data-measure="more"]'), ue = ($, R) => j(`[data-measure="${R ? "full" : "icon"}"][data-measure-action="${CSS.escape($)}"]`), b = ($, R) => {
1475
- const Q = /* @__PURE__ */ new Set([...H.map((te) => te.id), ...R]), se = x.map((te) => te.filter((fe) => !Q.has(fe.id))).filter((te) => te.length > 0), he = se.flat(), Ie = he.length + (se.length - 1) + (Q.size > 0 ? 1 : 0) + (oe > 0 ? 1 : 0);
1476
- return oe + he.reduce((te, fe) => te + ue(fe.id, !$.has(fe.id)), 0) + de * Math.max(0, se.length - 1) + (Q.size > 0 ? me : 0) + W * Math.max(0, Ie - 1);
1477
- }, w = O.filter(($) => !M.some((R) => R.includes($.id))).map(($) => $.id), I = [...M, ...[...w].reverse().map(($) => [$])];
1478
- let K = null;
1479
- if (b(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= L) K = Te;
1487
+ var O;
1488
+ return ((O = A.querySelector($)) == null ? void 0 : O.getBoundingClientRect().width) ?? 0;
1489
+ }, oe = j('[data-measure="leading"]'), de = j('[data-measure="separator"]'), me = j('[data-measure="more"]'), ue = ($, O) => j(`[data-measure="${O ? "full" : "icon"}"][data-measure-action="${CSS.escape($)}"]`), f = ($, O) => {
1490
+ const Y = /* @__PURE__ */ new Set([...U.map((te) => te.id), ...O]), se = x.map((te) => te.filter((pe) => !Y.has(pe.id))).filter((te) => te.length > 0), he = se.flat(), Ie = he.length + (se.length - 1) + (Y.size > 0 ? 1 : 0) + (oe > 0 ? 1 : 0);
1491
+ return oe + he.reduce((te, pe) => te + ue(pe.id, !$.has(pe.id)), 0) + de * Math.max(0, se.length - 1) + (Y.size > 0 ? me : 0) + W * Math.max(0, Ie - 1);
1492
+ }, w = K.filter(($) => !M.some((O) => O.includes($.id))).map(($) => $.id), I = [...M, ...[...w].reverse().map(($) => [$])];
1493
+ let H = null;
1494
+ if (f(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= L) H = Te;
1480
1495
  else {
1481
1496
  const $ = /* @__PURE__ */ new Set();
1482
- for (const R of I) {
1483
- for (const Q of R) $.add(Q);
1484
- if (b($, /* @__PURE__ */ new Set()) <= L) {
1485
- K = { bare: $, hidden: /* @__PURE__ */ new Set() };
1497
+ for (const O of I) {
1498
+ for (const Y of O) $.add(Y);
1499
+ if (f($, /* @__PURE__ */ new Set()) <= L) {
1500
+ H = { bare: $, hidden: /* @__PURE__ */ new Set() };
1486
1501
  break;
1487
1502
  }
1488
1503
  }
1489
1504
  }
1490
- if (K === null) {
1491
- const $ = new Set(O.map((Q) => Q.id)), R = /* @__PURE__ */ new Set();
1492
- for (const Q of M) {
1493
- for (const se of Q) O.some((he) => he.id === se) && R.add(se);
1494
- if (R.size >= 2 && b($, R) <= L) break;
1505
+ if (H === null) {
1506
+ const $ = new Set(K.map((Y) => Y.id)), O = /* @__PURE__ */ new Set();
1507
+ for (const Y of M) {
1508
+ for (const se of Y) K.some((he) => he.id === se) && O.add(se);
1509
+ if (O.size >= 2 && f($, O) <= L) break;
1510
+ }
1511
+ if (f($, O) > L) {
1512
+ for (const Y of [...w].reverse())
1513
+ if (O.add(Y), f($, O) <= L) break;
1495
1514
  }
1496
- K = { bare: $, hidden: R.size >= 2 ? R : /* @__PURE__ */ new Set() };
1515
+ H = { bare: $, hidden: O };
1497
1516
  }
1498
- const ge = K;
1499
- p(($) => Ee($.bare, ge.bare) && Ee($.hidden, ge.hidden) ? $ : ge);
1517
+ const ge = H;
1518
+ b(($) => Ee($.bare, ge.bare) && Ee($.hidden, ge.hidden) ? $ : ge);
1500
1519
  }, [le]);
1501
- ke(J, [J]), Y(() => {
1520
+ ke(Q, [Q]), J(() => {
1502
1521
  const _ = r.current;
1503
1522
  if (_ === null || typeof ResizeObserver > "u") return;
1504
- const T = new ResizeObserver(() => J());
1505
- return T.observe(_), () => T.disconnect();
1506
- }, [J]);
1507
- const y = /* @__PURE__ */ new Set([...H.map((_) => _.id), ...u.hidden]), V = x.map((_) => _.filter((T) => !y.has(T.id))).filter((_) => _.length > 0).flat(), E = [
1508
- ...H,
1509
- ...M.flat().map((_) => C.find((T) => T.id === _)).filter((_) => _ !== void 0 && u.hidden.has(_.id))
1510
- ], X = new Set(O.filter((_) => !M.some((T) => T.includes(_.id))).map((_) => _.id)), B = [...V.map((_) => _.id), ...E.length > 0 ? ["more"] : []], G = f !== null && B.includes(f) ? f : B[0] ?? null, ie = (_) => {
1523
+ const A = new ResizeObserver(() => Q());
1524
+ return A.observe(_), () => A.disconnect();
1525
+ }, [Q]);
1526
+ const y = /* @__PURE__ */ new Set([...U.map((_) => _.id), ...u.hidden]), V = x.map((_) => _.filter((A) => !y.has(A.id))).filter((_) => _.length > 0).flat(), E = [
1527
+ ...U,
1528
+ ...M.flat().map((_) => C.find((A) => A.id === _)).filter((_) => _ !== void 0 && u.hidden.has(_.id)),
1529
+ // The pinned that a row too narrow for them sent behind ..., in the row's order.
1530
+ ...K.filter((_) => u.hidden.has(_.id) && !M.some((A) => A.includes(_.id)))
1531
+ ], X = new Set(K.filter((_) => !M.some((A) => A.includes(_.id))).map((_) => _.id)), B = [...V.map((_) => _.id), ...E.length > 0 ? ["more"] : []], G = p !== null && B.includes(p) ? p : B[0] ?? null, ie = (_) => {
1511
1532
  var L, j;
1512
- const T = B.indexOf(G ?? "");
1533
+ const A = B.indexOf(G ?? "");
1513
1534
  let Z = null;
1514
- if (_.key === "ArrowRight" ? Z = Math.min(B.length - 1, T + 1) : _.key === "ArrowLeft" ? Z = Math.max(0, T - 1) : _.key === "Home" ? Z = 0 : _.key === "End" ? Z = B.length - 1 : _.key === "Escape" && k(G), Z === null) return;
1535
+ if (_.key === "ArrowRight" ? Z = Math.min(B.length - 1, A + 1) : _.key === "ArrowLeft" ? Z = Math.max(0, A - 1) : _.key === "Home" ? Z = 0 : _.key === "End" ? Z = B.length - 1 : _.key === "Escape" && k(G), Z === null) return;
1515
1536
  _.preventDefault();
1516
1537
  const W = B[Z] ?? null;
1517
1538
  v(W), (j = (L = r.current) == null ? void 0 : L.querySelector(`[data-stop="${CSS.escape(W ?? "")}"]`)) == null || j.focus();
1518
1539
  }, ce = E.map((_) => ({
1519
1540
  id: _.id,
1520
- label: /* @__PURE__ */ d(S, { children: [
1521
- /* @__PURE__ */ e(pe, { name: _.icon }),
1541
+ label: /* @__PURE__ */ o(S, { children: [
1542
+ /* @__PURE__ */ e(fe, { name: _.icon }),
1522
1543
  _.label
1523
1544
  ] }),
1524
1545
  offer: _.disabled ? { offered: !0, locked: !1, refusal: _.reason ?? "" } : { offered: !0, locked: !1 },
@@ -1527,23 +1548,23 @@ function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leadin
1527
1548
  !_.disabled && !_.busy && t(_.id);
1528
1549
  }
1529
1550
  }));
1530
- return /* @__PURE__ */ d(
1551
+ return /* @__PURE__ */ o(
1531
1552
  "div",
1532
1553
  {
1533
1554
  ref: r,
1534
1555
  role: "toolbar",
1535
1556
  "aria-label": n,
1536
- className: D(
1557
+ className: T(
1537
1558
  "cms-pane-toolbar",
1538
- O.length > 0 && u.bare.size >= O.length && "cms-pane-toolbar--labels-hidden",
1539
- u.bare.size > 0 && u.bare.size < O.length && "cms-pane-toolbar--labels-partly-hidden"
1559
+ K.length > 0 && u.bare.size >= K.length && "cms-pane-toolbar--labels-hidden",
1560
+ u.bare.size > 0 && u.bare.size < K.length && "cms-pane-toolbar--labels-partly-hidden"
1540
1561
  ),
1541
1562
  onKeyDown: ie,
1542
1563
  children: [
1543
1564
  s !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: s }) : null,
1544
- x.map((_, T) => {
1545
- const Z = _.filter((L) => !y.has(L.id)), W = x.slice(0, T).some((L) => L.some((j) => !y.has(j.id)));
1546
- return /* @__PURE__ */ d("div", { className: "cms-pane-toolbar__group-wrap", children: [
1565
+ x.map((_, A) => {
1566
+ const Z = _.filter((L) => !y.has(L.id)), W = x.slice(0, A).some((L) => L.some((j) => !y.has(j.id)));
1567
+ return /* @__PURE__ */ o("div", { className: "cms-pane-toolbar__group-wrap", children: [
1547
1568
  Z.length > 0 && W ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
1548
1569
  /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: Z.length === 0, children: _.map((L) => /* @__PURE__ */ e(
1549
1570
  un,
@@ -1561,7 +1582,7 @@ function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leadin
1561
1582
  },
1562
1583
  L.id
1563
1584
  )) })
1564
- ] }, T);
1585
+ ] }, A);
1565
1586
  }),
1566
1587
  E.length > 0 ? /* @__PURE__ */ e(
1567
1588
  "button",
@@ -1576,62 +1597,62 @@ function Wn({ label: n, actions: l, onAction: t, status: o, moreLabel: m, leadin
1576
1597
  tabIndex: G === "more" ? 0 : -1,
1577
1598
  onFocus: () => v("more"),
1578
1599
  onClick: (_) => {
1579
- const T = _.currentTarget.getBoundingClientRect();
1580
- g("first"), h(c === null ? { x: T.left, y: T.bottom } : null);
1600
+ const A = _.currentTarget.getBoundingClientRect();
1601
+ g("first"), h(c === null ? { x: A.left, y: A.bottom } : null);
1581
1602
  },
1582
1603
  onKeyDown: (_) => {
1583
1604
  if (_.key === "ArrowDown" || _.key === "ArrowUp") {
1584
1605
  _.preventDefault(), _.stopPropagation();
1585
- const T = _.currentTarget.getBoundingClientRect();
1586
- g(_.key === "ArrowUp" ? "last" : "first"), h({ x: T.left, y: T.bottom });
1606
+ const A = _.currentTarget.getBoundingClientRect();
1607
+ g(_.key === "ArrowUp" ? "last" : "first"), h({ x: A.left, y: A.bottom });
1587
1608
  }
1588
1609
  },
1589
1610
  children: /* @__PURE__ */ e(P, { name: "more" })
1590
1611
  }
1591
1612
  ) : null,
1592
- o !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: o, children: o }) : null,
1613
+ d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: d, children: d }) : null,
1593
1614
  /* @__PURE__ */ e(on, { at: c, items: ce, onClose: () => h(null), label: m, focus: a }),
1594
- /* @__PURE__ */ d("div", { ref: i, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
1615
+ /* @__PURE__ */ o("div", { ref: i, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
1595
1616
  s !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: s }) : null,
1596
1617
  /* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
1597
1618
  /* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(P, { name: "more" }) }),
1598
- C.map((_) => /* @__PURE__ */ d("span", { children: [
1599
- /* @__PURE__ */ d("span", { "data-measure": "full", "data-measure-action": _.id, className: "cms-pane-toolbar__action", children: [
1600
- /* @__PURE__ */ e(pe, { name: _.icon }),
1619
+ C.map((_) => /* @__PURE__ */ o("span", { children: [
1620
+ /* @__PURE__ */ o("span", { "data-measure": "full", "data-measure-action": _.id, className: "cms-pane-toolbar__action", children: [
1621
+ /* @__PURE__ */ e(fe, { name: _.icon }),
1601
1622
  /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: _.label })
1602
1623
  ] }),
1603
- /* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": _.id, className: D("cms-pane-toolbar__action", _e(_.icon) !== null && "cms-pane-toolbar__action--bare"), children: _e(_.icon) !== null ? /* @__PURE__ */ e(pe, { name: _.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: _.label }) })
1624
+ /* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": _.id, className: T("cms-pane-toolbar__action", _e(_.icon) !== null && "cms-pane-toolbar__action--bare"), children: _e(_.icon) !== null ? /* @__PURE__ */ e(fe, { name: _.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: _.label }) })
1604
1625
  ] }, _.id))
1605
1626
  ] })
1606
1627
  ]
1607
1628
  }
1608
1629
  );
1609
1630
  }
1610
- function un({ action: n, labels: l, overflowed: t, pinned: o, tabbable: m, tipOff: s, onChoose: r, onFocus: i }) {
1611
- const [u, p] = A(!1);
1612
- Y(() => {
1631
+ function un({ action: n, labels: l, overflowed: t, pinned: d, tabbable: m, tipOff: s, onChoose: r, onFocus: i }) {
1632
+ const [u, b] = D(!1);
1633
+ J(() => {
1613
1634
  if (!n.busy) {
1614
- p(!1);
1635
+ b(!1);
1615
1636
  return;
1616
1637
  }
1617
- const k = setTimeout(() => p(!0), ye);
1638
+ const k = setTimeout(() => b(!0), ye);
1618
1639
  return () => clearTimeout(k);
1619
1640
  }, [n.busy]);
1620
- const c = _e(n.icon) === null, h = l || c, a = n.disabled && n.reason ? n.reason : null, g = a ?? (h ? null : n.label), f = q(), [v, N] = A(!1);
1621
- return /* @__PURE__ */ d(
1641
+ const c = _e(n.icon) === null, h = l || c, a = n.disabled && n.reason ? n.reason : null, g = a ?? (h ? null : n.label), p = q(), [v, N] = D(!1);
1642
+ return /* @__PURE__ */ o(
1622
1643
  "button",
1623
1644
  {
1624
1645
  type: "button",
1625
- className: D("cms-pane-toolbar__action", !h && "cms-pane-toolbar__action--bare", c && "cms-pane-toolbar__action--text", n.danger && "is-danger"),
1646
+ className: T("cms-pane-toolbar__action", !h && "cms-pane-toolbar__action--bare", c && "cms-pane-toolbar__action--text", n.danger && "is-danger"),
1626
1647
  "data-action": n.id,
1627
1648
  "data-stop": n.id,
1628
1649
  ...t ? { "data-overflowed": "" } : {},
1629
- ...o ? { "data-pinned": "" } : {},
1650
+ ...d ? { "data-pinned": "" } : {},
1630
1651
  hidden: t,
1631
1652
  "aria-label": n.label,
1632
1653
  "aria-disabled": n.disabled || void 0,
1633
1654
  "aria-busy": n.busy || void 0,
1634
- ...a === null ? {} : { "aria-describedby": f },
1655
+ ...a === null ? {} : { "aria-describedby": p },
1635
1656
  ...v && a !== null ? { "data-reason-shown": "" } : {},
1636
1657
  tabIndex: m ? 0 : -1,
1637
1658
  onFocus: i,
@@ -1643,26 +1664,26 @@ function un({ action: n, labels: l, overflowed: t, pinned: o, tabbable: m, tipOf
1643
1664
  a !== null ? N(!0) : !n.disabled && !n.busy && r();
1644
1665
  },
1645
1666
  children: [
1646
- u ? /* @__PURE__ */ e(z, { name: "spinner" }) : /* @__PURE__ */ e(pe, { name: n.icon }),
1667
+ u ? /* @__PURE__ */ e(z, { name: "spinner" }) : /* @__PURE__ */ e(fe, { name: n.icon }),
1647
1668
  h ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
1648
- a !== null || g !== null && !s ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: f, children: g }) : null
1669
+ a !== null || g !== null && !s ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: p, children: g }) : null
1649
1670
  ]
1650
1671
  }
1651
1672
  );
1652
1673
  }
1653
- function pe({ name: n }) {
1674
+ function fe({ name: n }) {
1654
1675
  const l = _e(n);
1655
1676
  return l === null ? null : /* @__PURE__ */ e(P, { name: l, size: 18 });
1656
1677
  }
1657
- function jn({ title: n, body: l = null, time: t = null, unread: o, unreadLabel: m, expandLabel: s, collapseLabel: r, action: i = null, onRead: u, leading: p }) {
1658
- const [c, h] = A(!1), a = q(), g = () => {
1659
- o && u();
1660
- }, f = (i == null ? void 0 : i.presentation) === "row" && i.onAction !== void 0, v = (i == null ? void 0 : i.presentation) === "button" && i.onAction !== void 0 ? i : null, N = () => {
1678
+ function jn({ title: n, body: l = null, time: t = null, unread: d, unreadLabel: m, expandLabel: s, collapseLabel: r, action: i = null, onRead: u, leading: b }) {
1679
+ const [c, h] = D(!1), a = q(), g = () => {
1680
+ d && u();
1681
+ }, p = (i == null ? void 0 : i.presentation) === "row" && i.onAction !== void 0, v = (i == null ? void 0 : i.presentation) === "button" && i.onAction !== void 0 ? i : null, N = () => {
1661
1682
  var k;
1662
- g(), f && ((k = i.onAction) == null || k.call(i));
1683
+ g(), p && ((k = i.onAction) == null || k.call(i));
1663
1684
  };
1664
- return /* @__PURE__ */ d("article", { className: D("cms-notification", o && "is-unread", c && "is-expanded", f && "is-row-action"), "data-state": o ? "unread" : "read", children: [
1665
- /* @__PURE__ */ d(
1685
+ return /* @__PURE__ */ o("article", { className: T("cms-notification", d && "is-unread", c && "is-expanded", p && "is-row-action"), "data-state": d ? "unread" : "read", children: [
1686
+ /* @__PURE__ */ o(
1666
1687
  "div",
1667
1688
  {
1668
1689
  className: "cms-notification__row",
@@ -1674,11 +1695,11 @@ function jn({ title: n, body: l = null, time: t = null, unread: o, unreadLabel:
1674
1695
  k.target !== k.currentTarget || k.key !== "Enter" && k.key !== " " || (k.preventDefault(), N());
1675
1696
  },
1676
1697
  children: [
1677
- p != null ? /* @__PURE__ */ e("span", { className: "cms-notification__leading", children: p }) : null,
1678
- /* @__PURE__ */ d("span", { className: "cms-notification__text", children: [
1679
- /* @__PURE__ */ d("span", { className: "cms-notification__head", children: [
1680
- /* @__PURE__ */ d("span", { className: "cms-notification__title", children: [
1681
- o ? /* @__PURE__ */ d("span", { className: "cms-visually-hidden", children: [
1698
+ b != null ? /* @__PURE__ */ e("span", { className: "cms-notification__leading", children: b }) : null,
1699
+ /* @__PURE__ */ o("span", { className: "cms-notification__text", children: [
1700
+ /* @__PURE__ */ o("span", { className: "cms-notification__head", children: [
1701
+ /* @__PURE__ */ o("span", { className: "cms-notification__title", children: [
1702
+ d ? /* @__PURE__ */ o("span", { className: "cms-visually-hidden", children: [
1682
1703
  m,
1683
1704
  " "
1684
1705
  ] }) : null,
@@ -1688,7 +1709,7 @@ function jn({ title: n, body: l = null, time: t = null, unread: o, unreadLabel:
1688
1709
  ] }),
1689
1710
  l !== null && l !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id: a, children: l }) : null
1690
1711
  ] }),
1691
- o ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
1712
+ d ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
1692
1713
  ]
1693
1714
  }
1694
1715
  ),
@@ -1736,32 +1757,32 @@ function qn(n, l) {
1736
1757
  return l.showRefused ? { offered: !0, locked: !1, refusal: l.refusal ?? "not allowed" } : { offered: !1, locked: !1 };
1737
1758
  }
1738
1759
  }
1739
- function fn(n, l) {
1760
+ function pn(n, l) {
1740
1761
  if (!n) return;
1741
1762
  if (typeof n.get == "function") return n.get(l) ?? void 0;
1742
- const t = n, o = Object.keys(t).find((m) => m.toLowerCase() === l.toLowerCase());
1743
- return o === void 0 ? void 0 : t[o];
1763
+ const t = n, d = Object.keys(t).find((m) => m.toLowerCase() === l.toLowerCase());
1764
+ return d === void 0 ? void 0 : t[d];
1744
1765
  }
1745
- function pn(n) {
1766
+ function fn(n) {
1746
1767
  if (n && typeof n == "object") {
1747
1768
  const l = n;
1748
1769
  if (typeof l.detail == "string" && l.detail !== "") return l.detail;
1749
1770
  if (typeof l.title == "string" && l.title !== "") return l.title;
1750
1771
  }
1751
1772
  }
1752
- function Xn(n, l, t, o) {
1773
+ function Xn(n, l, t, d) {
1753
1774
  if (n !== 403) return { kind: "none" };
1754
- const m = pn(t);
1755
- return fn(l, "X-Elevation-Required") !== void 0 ? o.elevates ? { kind: "elevation-required", message: m ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: m ?? "The server refused this." };
1775
+ const m = fn(t);
1776
+ return pn(l, "X-Elevation-Required") !== void 0 ? d.elevates ? { kind: "elevation-required", message: m ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: m ?? "The server refused this." };
1756
1777
  }
1757
1778
  const we = "coolms-kit:reread";
1758
1779
  function Gn() {
1759
1780
  window.dispatchEvent(new Event(we));
1760
1781
  }
1761
1782
  function Yn(n) {
1762
- const [l, t] = A(void 0), [o, m] = A(void 0), [s, r] = A(!0), i = U(n);
1783
+ const [l, t] = D(void 0), [d, m] = D(void 0), [s, r] = D(!0), i = R(n);
1763
1784
  i.current = n;
1764
- const u = U(0), p = be(() => {
1785
+ const u = R(0), b = be(() => {
1765
1786
  const c = ++u.current;
1766
1787
  r(!0), i.current().then(
1767
1788
  (h) => {
@@ -1772,22 +1793,22 @@ function Yn(n) {
1772
1793
  }
1773
1794
  );
1774
1795
  }, []);
1775
- return Y(() => {
1776
- p();
1777
- const c = () => p();
1796
+ return J(() => {
1797
+ b();
1798
+ const c = () => b();
1778
1799
  return window.addEventListener("focus", c), window.addEventListener(we, c), () => {
1779
1800
  window.removeEventListener("focus", c), window.removeEventListener(we, c);
1780
1801
  };
1781
- }, [p]), { value: l, error: o, loading: s, reread: p };
1802
+ }, [b]), { value: l, error: d, loading: s, reread: b };
1782
1803
  }
1783
1804
  function Jn(n) {
1784
1805
  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 };
1785
1806
  }
1786
1807
  const bn = "/errors/client-update-required";
1787
1808
  function _n(n, l) {
1788
- const t = n.split(".").map((m) => Number.parseInt(m, 10) || 0), o = l.split(".").map((m) => Number.parseInt(m, 10) || 0);
1789
- for (let m = 0; m < Math.max(t.length, o.length); m++) {
1790
- const s = t[m] ?? 0, r = o[m] ?? 0;
1809
+ const t = n.split(".").map((m) => Number.parseInt(m, 10) || 0), d = l.split(".").map((m) => Number.parseInt(m, 10) || 0);
1810
+ for (let m = 0; m < Math.max(t.length, d.length); m++) {
1811
+ const s = t[m] ?? 0, r = d[m] ?? 0;
1791
1812
  if (s !== r) return s < r;
1792
1813
  }
1793
1814
  return !1;
@@ -1803,14 +1824,14 @@ export {
1803
1824
  ne as Button,
1804
1825
  Se as CALL_LABELS,
1805
1826
  bn as CLIENT_UPDATE_REQUIRED,
1806
- zn as CallBar,
1827
+ Rn as CallBar,
1807
1828
  Un as CallPanel,
1808
1829
  Kn as ChatBubble,
1809
1830
  Hn as Composer,
1810
1831
  Cn as ConfirmDialog,
1811
1832
  on as ContextMenu,
1812
- ze as EmptyState,
1813
- Re as ErrorBanner,
1833
+ Re as EmptyState,
1834
+ ze as ErrorBanner,
1814
1835
  Tn as FilePicker,
1815
1836
  Je as FilePickerDenied,
1816
1837
  Dn as FileViewer,
@@ -1832,7 +1853,7 @@ export {
1832
1853
  In as SearchField,
1833
1854
  kn as Select,
1834
1855
  Zn as SignInForm,
1835
- Rn as SignInLayout,
1856
+ zn as SignInLayout,
1836
1857
  Fn as SplitPanes,
1837
1858
  ee as State,
1838
1859
  Ln as TabStrip,
@@ -1849,7 +1870,7 @@ export {
1849
1870
  qn as offerFor,
1850
1871
  Jn as readConflict,
1851
1872
  Xn as readRefusal,
1852
- pn as refusalText,
1873
+ fn as refusalText,
1853
1874
  Gn as rereadAll,
1854
1875
  ln as tintOf,
1855
1876
  Yn as useReread,