@coolms/ui-react 0.1.0-alpha.10 → 0.1.0-alpha.11

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,129 +1,129 @@
1
- import { jsx as e, jsxs as s, Fragment as C } from "react/jsx-runtime";
2
- import { useId as Q, useState as D, useRef as z, useEffect as W, useCallback as ie, useMemo as Me, useLayoutEffect as ye } from "react";
3
- import { createPortal as be } from "react-dom";
4
- function te(l, n) {
5
- const a = { ...l };
6
- for (const t of Object.keys(n ?? {})) {
7
- const c = n == null ? void 0 : n[t];
8
- c !== void 0 && (a[t] = c);
1
+ import { jsx as e, jsxs as s, Fragment as x } from "react/jsx-runtime";
2
+ import { useId as ee, useState as D, useRef as O, useEffect as G, useCallback as _e, useMemo as Ie, useLayoutEffect as Ae } from "react";
3
+ import { createPortal as ke } from "react-dom";
4
+ function re(n, l) {
5
+ const a = { ...n };
6
+ for (const t of Object.keys(l ?? {})) {
7
+ const r = l == null ? void 0 : l[t];
8
+ r !== void 0 && (a[t] = r);
9
9
  }
10
10
  return a;
11
11
  }
12
- function M(...l) {
13
- return l.filter(Boolean).join(" ");
12
+ function C(...n) {
13
+ return n.filter(Boolean).join(" ");
14
14
  }
15
- function F({ name: l }) {
16
- const n = { width: 16, height: 16, viewBox: "0 0 16 16", "aria-hidden": !0, focusable: !1 };
17
- switch (l) {
15
+ function F({ name: n }) {
16
+ const l = { width: 16, height: 16, viewBox: "0 0 16 16", "aria-hidden": !0, focusable: !1 };
17
+ switch (n) {
18
18
  case "lock":
19
- return /* @__PURE__ */ e("svg", { ...n, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M5 7V5a3 3 0 1 1 6 0v2h.5A1.5 1.5 0 0 1 13 8.5v5A1.5 1.5 0 0 1 11.5 15h-7A1.5 1.5 0 0 1 3 13.5v-5A1.5 1.5 0 0 1 4.5 7H5Zm1.5 0h3V5a1.5 1.5 0 0 0-3 0v2Z" }) });
19
+ return /* @__PURE__ */ e("svg", { ...l, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M5 7V5a3 3 0 1 1 6 0v2h.5A1.5 1.5 0 0 1 13 8.5v5A1.5 1.5 0 0 1 11.5 15h-7A1.5 1.5 0 0 1 3 13.5v-5A1.5 1.5 0 0 1 4.5 7H5Zm1.5 0h3V5a1.5 1.5 0 0 0-3 0v2Z" }) });
20
20
  case "spinner":
21
- return /* @__PURE__ */ e("svg", { ...n, className: "cms-glyph cms-spinner", children: /* @__PURE__ */ e("circle", { cx: "8", cy: "8", r: "6", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeDasharray: "28", strokeDashoffset: "10" }) });
21
+ return /* @__PURE__ */ e("svg", { ...l, className: "cms-glyph cms-spinner", children: /* @__PURE__ */ e("circle", { cx: "8", cy: "8", r: "6", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeDasharray: "28", strokeDashoffset: "10" }) });
22
22
  case "back":
23
- return /* @__PURE__ */ e("svg", { ...n, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M10.7 2.3a1 1 0 0 1 0 1.4L6.4 8l4.3 4.3a1 1 0 0 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 0Z" }) });
23
+ return /* @__PURE__ */ e("svg", { ...l, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M10.7 2.3a1 1 0 0 1 0 1.4L6.4 8l4.3 4.3a1 1 0 0 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 0Z" }) });
24
24
  case "close":
25
- return /* @__PURE__ */ e("svg", { ...n, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M3.3 3.3a1 1 0 0 1 1.4 0L8 6.6l3.3-3.3a1 1 0 1 1 1.4 1.4L9.4 8l3.3 3.3a1 1 0 0 1-1.4 1.4L8 9.4l-3.3 3.3a1 1 0 0 1-1.4-1.4L6.6 8 3.3 4.7a1 1 0 0 1 0-1.4Z" }) });
25
+ return /* @__PURE__ */ e("svg", { ...l, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M3.3 3.3a1 1 0 0 1 1.4 0L8 6.6l3.3-3.3a1 1 0 1 1 1.4 1.4L9.4 8l3.3 3.3a1 1 0 0 1-1.4 1.4L8 9.4l-3.3 3.3a1 1 0 0 1-1.4-1.4L6.6 8 3.3 4.7a1 1 0 0 1 0-1.4Z" }) });
26
26
  case "warning":
27
- return /* @__PURE__ */ e("svg", { ...n, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M8.9 1.5a1 1 0 0 0-1.8 0l-6 11A1 1 0 0 0 2 14h12a1 1 0 0 0 .9-1.5l-6-11ZM8 5a1 1 0 0 1 1 1v3a1 1 0 0 1-2 0V6a1 1 0 0 1 1-1Zm0 7.5A1 1 0 1 1 8 10.5a1 1 0 0 1 0 2Z" }) });
27
+ return /* @__PURE__ */ e("svg", { ...l, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M8.9 1.5a1 1 0 0 0-1.8 0l-6 11A1 1 0 0 0 2 14h12a1 1 0 0 0 .9-1.5l-6-11ZM8 5a1 1 0 0 1 1 1v3a1 1 0 0 1-2 0V6a1 1 0 0 1 1-1Zm0 7.5A1 1 0 1 1 8 10.5a1 1 0 0 1 0 2Z" }) });
28
28
  case "check":
29
- return /* @__PURE__ */ e("svg", { ...n, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M13.7 4.3a1 1 0 0 1 0 1.4l-6 6a1 1 0 0 1-1.4 0l-3-3a1 1 0 1 1 1.4-1.4L7 9.6l5.3-5.3a1 1 0 0 1 1.4 0Z" }) });
29
+ return /* @__PURE__ */ e("svg", { ...l, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M13.7 4.3a1 1 0 0 1 0 1.4l-6 6a1 1 0 0 1-1.4 0l-3-3a1 1 0 1 1 1.4-1.4L7 9.6l5.3-5.3a1 1 0 0 1 1.4 0Z" }) });
30
30
  case "info":
31
- return /* @__PURE__ */ e("svg", { ...n, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 5.5a1 1 0 0 0-1 1V11a1 1 0 1 0 2 0V7.5a1 1 0 0 0-1-1ZM8 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" }) });
31
+ return /* @__PURE__ */ e("svg", { ...l, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 5.5a1 1 0 0 0-1 1V11a1 1 0 1 0 2 0V7.5a1 1 0 0 0-1-1ZM8 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" }) });
32
32
  }
33
33
  }
34
- function J({
35
- variant: l = "secondary",
36
- busy: n = !1,
34
+ function Q({
35
+ variant: n = "secondary",
36
+ busy: l = !1,
37
37
  busyLabel: a,
38
38
  locked: t = !1,
39
- lockedReason: c,
39
+ lockedReason: r,
40
40
  icon: m,
41
41
  disabled: o,
42
- className: r,
43
- children: h,
42
+ className: c,
43
+ children: u,
44
44
  type: d = "button",
45
- title: f,
46
- ...p
45
+ title: _,
46
+ ...h
47
47
  }) {
48
- const i = !!o || n;
48
+ const i = !!o || l;
49
49
  return /* @__PURE__ */ s(
50
50
  "button",
51
51
  {
52
- ...p,
52
+ ...h,
53
53
  type: d,
54
- className: M("cms-button", `cms-button--${l}`, n && "is-busy", t && "is-locked", r),
54
+ className: C("cms-button", `cms-button--${n}`, l && "is-busy", t && "is-locked", c),
55
55
  disabled: i,
56
- "aria-busy": n || void 0,
57
- title: t ? c ?? f : f,
56
+ "aria-busy": l || void 0,
57
+ title: t ? r ?? _ : _,
58
58
  children: [
59
- n ? /* @__PURE__ */ e(F, { name: "spinner" }) : t ? /* @__PURE__ */ e(F, { name: "lock" }) : m,
60
- /* @__PURE__ */ e("span", { className: "cms-button__label", children: n && a !== void 0 ? a : h }),
61
- t && c ? /* @__PURE__ */ s("span", { className: "cms-visually-hidden", children: [
59
+ l ? /* @__PURE__ */ e(F, { name: "spinner" }) : t ? /* @__PURE__ */ e(F, { name: "lock" }) : m,
60
+ /* @__PURE__ */ e("span", { className: "cms-button__label", children: l && a !== void 0 ? a : u }),
61
+ t && r ? /* @__PURE__ */ s("span", { className: "cms-visually-hidden", children: [
62
62
  ", ",
63
- c
63
+ r
64
64
  ] }) : null
65
65
  ]
66
66
  }
67
67
  );
68
68
  }
69
- function we({ id: l, label: n, help: a, error: t, pinned: c, children: m }) {
70
- return /* @__PURE__ */ s("div", { className: M("cms-field", t != null && "is-invalid"), children: [
71
- /* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: l, children: n }),
69
+ function De({ id: n, label: l, help: a, error: t, pinned: r, children: m }) {
70
+ return /* @__PURE__ */ s("div", { className: C("cms-field", t != null && "is-invalid"), children: [
71
+ /* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: n, children: l }),
72
72
  m,
73
- c != null ? /* @__PURE__ */ s("p", { className: "cms-field__pinned", id: `${l}-pinned`, children: [
73
+ r != null ? /* @__PURE__ */ s("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
74
74
  /* @__PURE__ */ e(F, { name: "lock" }),
75
75
  " ",
76
- c
76
+ r
77
77
  ] }) : null,
78
- t != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${l}-error`, role: "alert", children: t }) : null,
79
- a != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${l}-help`, children: a }) : null
78
+ t != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: t }) : null,
79
+ a != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${n}-help`, children: a }) : null
80
80
  ] });
81
81
  }
82
- function ke(l, n) {
83
- const a = [n.error != null && `${l}-error`, n.pinned != null && `${l}-pinned`, n.help != null && `${l}-help`].filter(Boolean).join(" ");
82
+ function Ee(n, l) {
83
+ const a = [l.error != null && `${n}-error`, l.pinned != null && `${n}-pinned`, l.help != null && `${n}-help`].filter(Boolean).join(" ");
84
84
  return a === "" ? void 0 : a;
85
85
  }
86
- function sl({ label: l, help: n, error: a, disabled: t, readOnly: c, pinned: m, value: o, onChange: r, placeholder: h, type: d = "text", name: f }) {
87
- const p = Q();
88
- return /* @__PURE__ */ e(we, { id: p, label: l, help: n, error: a, pinned: m, children: /* @__PURE__ */ e(
86
+ function hn({ label: n, help: l, error: a, disabled: t, readOnly: r, pinned: m, value: o, onChange: c, placeholder: u, type: d = "text", name: _ }) {
87
+ const h = ee();
88
+ return /* @__PURE__ */ e(De, { id: h, label: n, help: l, error: a, pinned: m, children: /* @__PURE__ */ e(
89
89
  "input",
90
90
  {
91
- id: p,
92
- name: f,
91
+ id: h,
92
+ name: _,
93
93
  type: d,
94
94
  className: "cms-input",
95
95
  value: o,
96
- placeholder: h,
96
+ placeholder: u,
97
97
  disabled: t,
98
- readOnly: c || m != null,
98
+ readOnly: r || m != null,
99
99
  "aria-invalid": a != null || void 0,
100
- "aria-describedby": ke(p, { help: n, error: a, pinned: m }),
101
- onChange: (i) => r == null ? void 0 : r(i.target.value)
100
+ "aria-describedby": Ee(h, { help: l, error: a, pinned: m }),
101
+ onChange: (i) => c == null ? void 0 : c(i.target.value)
102
102
  }
103
103
  ) });
104
104
  }
105
- function tl({ label: l, help: n, error: a, disabled: t, readOnly: c, value: m, options: o, onChange: r, emptyText: h = "Nothing to choose from yet.", name: d }) {
106
- const f = Q(), p = o.length === 0;
107
- return /* @__PURE__ */ e(we, { id: f, label: l, help: p ? h : n, error: a, children: /* @__PURE__ */ e(
105
+ function pn({ label: n, help: l, error: a, disabled: t, readOnly: r, value: m, options: o, onChange: c, emptyText: u = "Nothing to choose from yet.", name: d }) {
106
+ const _ = ee(), h = o.length === 0;
107
+ return /* @__PURE__ */ e(De, { id: _, label: n, help: h ? u : l, error: a, children: /* @__PURE__ */ e(
108
108
  "select",
109
109
  {
110
- id: f,
110
+ id: _,
111
111
  name: d,
112
112
  className: "cms-input cms-select",
113
113
  value: m,
114
- disabled: t || p,
115
- "aria-readonly": c || void 0,
114
+ disabled: t || h,
115
+ "aria-readonly": r || void 0,
116
116
  "aria-invalid": a != null || void 0,
117
- "aria-describedby": ke(f, { help: p ? h : n, error: a }),
117
+ "aria-describedby": Ee(_, { help: h ? u : l, error: a }),
118
118
  onChange: (i) => {
119
- c || r == null || r(i.target.value);
119
+ r || c == null || c(i.target.value);
120
120
  },
121
- children: o.map((i) => /* @__PURE__ */ e("option", { value: i.value, disabled: c && i.value !== m, children: i.label }, i.value))
121
+ children: o.map((i) => /* @__PURE__ */ e("option", { value: i.value, disabled: r && i.value !== m, children: i.label }, i.value))
122
122
  }
123
123
  ) });
124
124
  }
125
- function cl({ label: l, checked: n, onChange: a, disabled: t, readOnly: c, help: m }) {
126
- const o = Q();
125
+ function fn({ label: n, checked: l, onChange: a, disabled: t, readOnly: r, help: m }) {
126
+ const o = ee();
127
127
  return /* @__PURE__ */ s("div", { className: "cms-toggle-row", children: [
128
128
  /* @__PURE__ */ e(
129
129
  "button",
@@ -131,73 +131,73 @@ function cl({ label: l, checked: n, onChange: a, disabled: t, readOnly: c, help:
131
131
  id: o,
132
132
  type: "button",
133
133
  role: "switch",
134
- className: M("cms-toggle", n && "is-on"),
135
- "aria-checked": n,
136
- "aria-readonly": c || void 0,
134
+ className: C("cms-toggle", l && "is-on"),
135
+ "aria-checked": l,
136
+ "aria-readonly": r || void 0,
137
137
  "aria-describedby": m != null ? `${o}-help` : void 0,
138
138
  disabled: t,
139
139
  onClick: () => {
140
- c || a == null || a(!n);
140
+ r || a == null || a(!l);
141
141
  },
142
142
  children: /* @__PURE__ */ e("span", { className: "cms-toggle__thumb" })
143
143
  }
144
144
  ),
145
- /* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor: o, children: l }),
145
+ /* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor: o, children: n }),
146
146
  m != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${o}-help`, children: m }) : null
147
147
  ] });
148
148
  }
149
- const Ae = 150;
150
- function xe({ open: l, title: n, onClose: a, dirty: t = !1, onDirtyClose: c, children: m, footer: o, closeLabel: r = "Close", initialFocus: h, className: d }) {
151
- const [f, p] = D(l), [i, v] = D(!1), y = z(null), g = z(null), k = Q();
152
- if (W(() => {
153
- if (l) {
154
- g.current = document.activeElement, p(!0), v(!1);
149
+ const Pe = 150;
150
+ function Le({ open: n, title: l, onClose: a, dirty: t = !1, onDirtyClose: r, children: m, footer: o, closeLabel: c = "Close", initialFocus: u, className: d }) {
151
+ const [_, h] = D(n), [i, v] = D(!1), y = O(null), g = O(null), k = ee();
152
+ if (G(() => {
153
+ if (n) {
154
+ g.current = document.activeElement, h(!0), v(!1);
155
155
  return;
156
156
  }
157
- if (!f) return;
157
+ if (!_) return;
158
158
  v(!0);
159
159
  const w = window.setTimeout(() => {
160
- var E, A;
161
- p(!1), v(!1), (A = (E = g.current) == null ? void 0 : E.focus) == null || A.call(E);
162
- }, Ae);
160
+ var S, A;
161
+ h(!1), v(!1), (A = (S = g.current) == null ? void 0 : S.focus) == null || A.call(S);
162
+ }, Pe);
163
163
  return () => window.clearTimeout(w);
164
- }, [l, f]), W(() => {
165
- var w, E;
166
- if (l && f) {
164
+ }, [n, _]), G(() => {
165
+ var w, S;
166
+ if (n && _) {
167
167
  const A = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
168
- (E = (h == null ? void 0 : h.current) ?? ((w = y.current) == null ? void 0 : w.querySelector(`.cms-modal__body :is(${A}), .cms-modal__foot :is(${A})`)) ?? y.current) == null || E.focus();
168
+ (S = (u == null ? void 0 : u.current) ?? ((w = y.current) == null ? void 0 : w.querySelector(`.cms-modal__body :is(${A}), .cms-modal__foot :is(${A})`)) ?? y.current) == null || S.focus();
169
169
  }
170
- }, [l, f, h]), !f) return null;
171
- const O = () => {
172
- t ? c == null || c() : a();
170
+ }, [n, _, u]), !_) return null;
171
+ const q = () => {
172
+ t ? r == null || r() : a();
173
173
  };
174
- return be(
175
- /* @__PURE__ */ e("div", { className: M("cms-modal-scrim", i && "is-closing"), onMouseDown: (w) => {
176
- w.target === w.currentTarget && O();
174
+ return ke(
175
+ /* @__PURE__ */ e("div", { className: C("cms-modal-scrim", i && "is-closing"), onMouseDown: (w) => {
176
+ w.target === w.currentTarget && q();
177
177
  }, children: /* @__PURE__ */ s(
178
178
  "div",
179
179
  {
180
180
  ref: y,
181
- className: M("cms-modal", d, i && "is-closing", t && "is-dirty"),
181
+ className: C("cms-modal", d, i && "is-closing", t && "is-dirty"),
182
182
  role: "dialog",
183
183
  "aria-modal": "true",
184
184
  "aria-labelledby": k,
185
185
  tabIndex: -1,
186
186
  onKeyDown: (w) => {
187
- var E;
187
+ var S;
188
188
  if (w.key === "Escape")
189
- w.stopPropagation(), O();
189
+ w.stopPropagation(), q();
190
190
  else if (w.key === "Tab") {
191
- const A = (E = y.current) == null ? void 0 : E.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
191
+ const A = (S = y.current) == null ? void 0 : S.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
192
192
  if (!A || A.length === 0) return;
193
- const V = A[0], Z = A[A.length - 1];
194
- w.shiftKey && document.activeElement === V ? (w.preventDefault(), Z.focus()) : !w.shiftKey && document.activeElement === Z && (w.preventDefault(), V.focus());
193
+ const V = A[0], H = A[A.length - 1];
194
+ w.shiftKey && document.activeElement === V ? (w.preventDefault(), H.focus()) : !w.shiftKey && document.activeElement === H && (w.preventDefault(), V.focus());
195
195
  }
196
196
  },
197
197
  children: [
198
198
  /* @__PURE__ */ s("header", { className: "cms-modal__head", children: [
199
- /* @__PURE__ */ e("h2", { className: "cms-modal__title", id: k, children: n }),
200
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": r, onClick: O, children: /* @__PURE__ */ e(F, { name: "close" }) })
199
+ /* @__PURE__ */ e("h2", { className: "cms-modal__title", id: k, children: l }),
200
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": c, onClick: q, children: /* @__PURE__ */ e(F, { name: "close" }) })
201
201
  ] }),
202
202
  /* @__PURE__ */ e("div", { className: "cms-modal__body", children: m }),
203
203
  o != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: o }) : null
@@ -207,18 +207,18 @@ function xe({ open: l, title: n, onClose: a, dirty: t = !1, onDirtyClose: c, chi
207
207
  document.body
208
208
  );
209
209
  }
210
- function rl({ open: l, title: n, message: a, kind: t = "default", confirmLabel: c, cancelLabel: m, closeLabel: o, onConfirm: r, onCancel: h }) {
210
+ function _n({ open: n, title: l, message: a, kind: t = "default", confirmLabel: r, cancelLabel: m, closeLabel: o, onConfirm: c, onCancel: u }) {
211
211
  const d = t === "discard-changes";
212
212
  return /* @__PURE__ */ e(
213
- xe,
213
+ Le,
214
214
  {
215
- open: l,
216
- title: n,
217
- onClose: h,
215
+ open: n,
216
+ title: l,
217
+ onClose: u,
218
218
  ...o === void 0 ? {} : { closeLabel: o },
219
- footer: /* @__PURE__ */ s(C, { children: [
220
- /* @__PURE__ */ e(J, { onClick: h, children: m ?? (d ? "Keep editing" : "Cancel") }),
221
- /* @__PURE__ */ e(J, { variant: t === "default" ? "primary" : "danger", onClick: r, children: c ?? (d ? "Discard changes" : "Confirm") })
219
+ footer: /* @__PURE__ */ s(x, { children: [
220
+ /* @__PURE__ */ e(Q, { onClick: u, children: m ?? (d ? "Keep editing" : "Cancel") }),
221
+ /* @__PURE__ */ e(Q, { variant: t === "default" ? "primary" : "danger", onClick: c, children: r ?? (d ? "Discard changes" : "Confirm") })
222
222
  ] }),
223
223
  children: t !== "default" ? /* @__PURE__ */ s("p", { className: "cms-confirm__warning", children: [
224
224
  /* @__PURE__ */ e(F, { name: "warning" }),
@@ -228,161 +228,167 @@ function rl({ open: l, title: n, message: a, kind: t = "default", confirmLabel:
228
228
  }
229
229
  );
230
230
  }
231
- function il({ kind: l, message: n, action: a, onDismiss: t, dismissLabel: c = "Dismiss" }) {
232
- return /* @__PURE__ */ s("div", { className: M("cms-toast", `cms-toast--${l}`), role: l === "error" ? "alert" : "status", children: [
233
- /* @__PURE__ */ e(F, { name: l === "success" ? "check" : l === "error" ? "warning" : "info" }),
234
- /* @__PURE__ */ e("span", { className: "cms-toast__message", children: n }),
235
- a ? /* @__PURE__ */ e(J, { className: "cms-toast__action", onClick: a.onAction, children: a.label }) : null,
236
- t ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": c, onClick: t, children: /* @__PURE__ */ e(F, { name: "close" }) }) : null
231
+ function bn({ kind: n, message: l, action: a, onDismiss: t, dismissLabel: r = "Dismiss" }) {
232
+ return /* @__PURE__ */ s("div", { className: C("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
233
+ /* @__PURE__ */ e(F, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
234
+ /* @__PURE__ */ e("span", { className: "cms-toast__message", children: l }),
235
+ a ? /* @__PURE__ */ e(Q, { className: "cms-toast__action", onClick: a.onAction, children: a.label }) : null,
236
+ t ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": r, onClick: t, children: /* @__PURE__ */ e(F, { name: "close" }) }) : null
237
237
  ] });
238
238
  }
239
- function ol({ children: l }) {
240
- return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: l });
239
+ function vn({ children: n }) {
240
+ return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: n });
241
241
  }
242
- function Se({ what: l, layout: n = "inline" }) {
243
- return /* @__PURE__ */ s("div", { className: M("cms-loading", `cms-loading--${n}`), role: "status", "aria-live": "polite", children: [
242
+ function Be({ what: n, layout: l = "inline" }) {
243
+ return /* @__PURE__ */ s("div", { className: C("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
244
244
  /* @__PURE__ */ e(F, { name: "spinner" }),
245
- /* @__PURE__ */ e("span", { children: l })
245
+ /* @__PURE__ */ e("span", { children: n })
246
246
  ] });
247
247
  }
248
- function De({ title: l, hint: n, action: a }) {
248
+ function Fe({ title: n, hint: l, action: a }) {
249
249
  return /* @__PURE__ */ s("div", { className: "cms-empty", children: [
250
- /* @__PURE__ */ e("p", { className: "cms-empty__title", children: l }),
251
- n != null ? /* @__PURE__ */ e("p", { className: "cms-empty__hint", children: n }) : null,
250
+ /* @__PURE__ */ e("p", { className: "cms-empty__title", children: n }),
251
+ l != null ? /* @__PURE__ */ e("p", { className: "cms-empty__hint", children: l }) : null,
252
252
  a != null ? /* @__PURE__ */ e("div", { className: "cms-empty__action", children: a }) : null
253
253
  ] });
254
254
  }
255
- function Ee({ message: l, onRetry: n, retryLabel: a = "Try again" }) {
255
+ function ze({ message: n, onRetry: l, retryLabel: a = "Try again" }) {
256
256
  return /* @__PURE__ */ s("div", { className: "cms-error-banner", role: "alert", children: [
257
257
  /* @__PURE__ */ e(F, { name: "warning" }),
258
- /* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: l }),
259
- n ? /* @__PURE__ */ e(J, { onClick: n, children: a }) : null
258
+ /* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: n }),
259
+ l ? /* @__PURE__ */ e(Q, { onClick: l, children: a }) : null
260
260
  ] });
261
261
  }
262
- const fe = 300;
263
- function Le() {
264
- if (typeof window > "u" || typeof getComputedStyle != "function") return fe;
265
- const l = getComputedStyle(document.documentElement).getPropertyValue("--cms-state-delay").trim(), n = l.endsWith("ms") ? Number.parseFloat(l) : l.endsWith("s") ? Number.parseFloat(l) * 1e3 : Number.NaN;
266
- return Number.isFinite(n) && n >= 0 ? n : fe;
262
+ const ye = 300;
263
+ function Ke() {
264
+ if (typeof window > "u" || typeof getComputedStyle != "function") return ye;
265
+ const n = getComputedStyle(document.documentElement).getPropertyValue("--cms-state-delay").trim(), l = n.endsWith("ms") ? Number.parseFloat(n) : n.endsWith("s") ? Number.parseFloat(n) * 1e3 : Number.NaN;
266
+ return Number.isFinite(l) && l >= 0 ? l : ye;
267
267
  }
268
- function $e() {
268
+ function He() {
269
269
  return /* @__PURE__ */ s("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
270
270
  /* @__PURE__ */ e("circle", { className: "cms-state__track", cx: "12", cy: "12", r: "10", fill: "none" }),
271
271
  /* @__PURE__ */ e("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
272
272
  ] });
273
273
  }
274
- function se({ kind: l, title: n, description: a, action: t, placement: c = "block" }) {
275
- const [m, o] = D(l !== "loading");
276
- return W(() => {
277
- if (l !== "loading") {
274
+ function te({ kind: n, title: l, description: a, action: t, placement: r = "block" }) {
275
+ const [m, o] = D(n !== "loading");
276
+ return G(() => {
277
+ if (n !== "loading") {
278
278
  o(!0);
279
279
  return;
280
280
  }
281
281
  o(!1);
282
- const r = window.setTimeout(() => o(!0), Le());
283
- return () => window.clearTimeout(r);
284
- }, [l]), /* @__PURE__ */ s(
282
+ const c = window.setTimeout(() => o(!0), Ke());
283
+ return () => window.clearTimeout(c);
284
+ }, [n]), /* @__PURE__ */ s(
285
285
  "div",
286
286
  {
287
- className: M("cms-state", `cms-state--${l}`, `cms-state--${c}`, !m && "is-waiting"),
287
+ className: C("cms-state", `cms-state--${n}`, `cms-state--${r}`, !m && "is-waiting"),
288
288
  role: "status",
289
289
  "aria-live": "polite",
290
- "data-kind": l,
290
+ "data-kind": n,
291
291
  children: [
292
- l === "loading" ? /* @__PURE__ */ e($e, {}) : null,
293
- l === "error" || l === "denied" ? /* @__PURE__ */ e(F, { name: l === "error" ? "warning" : "lock" }) : null,
292
+ n === "loading" ? /* @__PURE__ */ e(He, {}) : null,
293
+ n === "error" || n === "denied" ? /* @__PURE__ */ e(F, { name: n === "error" ? "warning" : "lock" }) : null,
294
294
  /* @__PURE__ */ s("span", { className: "cms-state__text", children: [
295
- /* @__PURE__ */ e("span", { className: "cms-state__title", children: n }),
295
+ /* @__PURE__ */ e("span", { className: "cms-state__title", children: l }),
296
296
  a !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-state__description", children: a }) : null
297
297
  ] }),
298
- t !== void 0 && l !== "denied" ? /* @__PURE__ */ e(J, { className: "cms-state__action", onClick: t.onAction, children: t.label }) : null
298
+ t !== void 0 && n !== "denied" ? /* @__PURE__ */ e(Q, { className: "cms-state__action", onClick: t.onAction, children: t.label }) : null
299
299
  ]
300
300
  }
301
301
  );
302
302
  }
303
- const Ce = {
304
- mail: /* @__PURE__ */ s(C, { children: [
303
+ const $e = {
304
+ mail: /* @__PURE__ */ s(x, { children: [
305
305
  /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
306
306
  /* @__PURE__ */ e("path", { d: "m3 7 9 6 9-6" })
307
307
  ] }),
308
308
  chat: /* @__PURE__ */ e("path", { d: "M4 12a8 8 0 1 1 4 6.9L4 20l1.1-4A8 8 0 0 1 4 12Z" }),
309
309
  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" }),
310
- calendar: /* @__PURE__ */ s(C, { children: [
310
+ calendar: /* @__PURE__ */ s(x, { children: [
311
311
  /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "16", rx: "2" }),
312
312
  /* @__PURE__ */ e("path", { d: "M3 10h18M8 3v4M16 3v4" })
313
313
  ] }),
314
- file: /* @__PURE__ */ s(C, { children: [
314
+ file: /* @__PURE__ */ s(x, { children: [
315
315
  /* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
316
316
  /* @__PURE__ */ e("path", { d: "M14 3v6h6M8 13h8M8 17h6" })
317
317
  ] }),
318
- image: /* @__PURE__ */ s(C, { children: [
318
+ // The file, with code's angle brackets in place of its lines: a message's source.
319
+ "file-code": /* @__PURE__ */ s(x, { children: [
320
+ /* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
321
+ /* @__PURE__ */ e("path", { d: "M14 3v6h6" }),
322
+ /* @__PURE__ */ e("path", { d: "m10 12-2 2.5 2 2.5M14 12l2 2.5-2 2.5" })
323
+ ] }),
324
+ image: /* @__PURE__ */ s(x, { children: [
319
325
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
320
326
  /* @__PURE__ */ e("circle", { cx: "9", cy: "10", r: "2" }),
321
327
  /* @__PURE__ */ e("path", { d: "m21 17-5-5-9 8" })
322
328
  ] }),
323
- search: /* @__PURE__ */ s(C, { children: [
329
+ search: /* @__PURE__ */ s(x, { children: [
324
330
  /* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "7" }),
325
331
  /* @__PURE__ */ e("path", { d: "m20 20-4-4" })
326
332
  ] }),
327
- bell: /* @__PURE__ */ s(C, { children: [
333
+ bell: /* @__PURE__ */ s(x, { children: [
328
334
  /* @__PURE__ */ e("path", { d: "M6 9a6 6 0 1 1 12 0c0 6 2 8 2 8H4s2-2 2-8Z" }),
329
335
  /* @__PURE__ */ e("path", { d: "M10 20a2 2 0 0 0 4 0" })
330
336
  ] }),
331
- pencil: /* @__PURE__ */ s(C, { children: [
337
+ pencil: /* @__PURE__ */ s(x, { children: [
332
338
  /* @__PURE__ */ e("path", { d: "M4 20h4L19 9l-4-4L4 16Z" }),
333
339
  /* @__PURE__ */ e("path", { d: "m13 7 4 4" })
334
340
  ] }),
335
- download: /* @__PURE__ */ s(C, { children: [
341
+ download: /* @__PURE__ */ s(x, { children: [
336
342
  /* @__PURE__ */ e("path", { d: "M12 4v11" }),
337
343
  /* @__PURE__ */ e("path", { d: "m7 11 5 5 5-5" }),
338
344
  /* @__PURE__ */ e("path", { d: "M4 20h16" })
339
345
  ] }),
340
- print: /* @__PURE__ */ s(C, { children: [
346
+ print: /* @__PURE__ */ s(x, { children: [
341
347
  /* @__PURE__ */ e("path", { d: "M7 8V4h10v4" }),
342
348
  /* @__PURE__ */ e("rect", { x: "3", y: "8", width: "18", height: "8", rx: "2" }),
343
349
  /* @__PURE__ */ e("path", { d: "M7 14h10v6H7Z" })
344
350
  ] }),
345
- "open-separately": /* @__PURE__ */ s(C, { children: [
351
+ "open-separately": /* @__PURE__ */ s(x, { children: [
346
352
  /* @__PURE__ */ e("path", { d: "M14 4h6v6" }),
347
353
  /* @__PURE__ */ e("path", { d: "m20 4-9 9" }),
348
354
  /* @__PURE__ */ e("path", { d: "M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5" })
349
355
  ] }),
350
356
  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" }),
351
- send: /* @__PURE__ */ s(C, { children: [
357
+ send: /* @__PURE__ */ s(x, { children: [
352
358
  /* @__PURE__ */ e("path", { d: "M21 3 10 14" }),
353
359
  /* @__PURE__ */ e("path", { d: "M21 3 14 21l-4-7-7-4Z" })
354
360
  ] }),
355
- inbox: /* @__PURE__ */ s(C, { children: [
361
+ inbox: /* @__PURE__ */ s(x, { children: [
356
362
  /* @__PURE__ */ e("path", { d: "M3 13h5l1 3h6l1-3h5" }),
357
363
  /* @__PURE__ */ e("path", { d: "M5 5h14l2 8v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" })
358
364
  ] }),
359
- archive: /* @__PURE__ */ s(C, { children: [
365
+ archive: /* @__PURE__ */ s(x, { children: [
360
366
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "5", rx: "1" }),
361
367
  /* @__PURE__ */ e("path", { d: "M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4" })
362
368
  ] }),
363
- trash: /* @__PURE__ */ s(C, { children: [
369
+ trash: /* @__PURE__ */ s(x, { children: [
364
370
  /* @__PURE__ */ e("path", { d: "M4 7h16M10 11v6M14 11v6" }),
365
371
  /* @__PURE__ */ e("path", { d: "M6 7l1 13a2 2 0 0 0 2 1h6a2 2 0 0 0 2-1l1-13M9 7V4h6v3" })
366
372
  ] }),
367
373
  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" }),
368
- mic: /* @__PURE__ */ s(C, { children: [
374
+ mic: /* @__PURE__ */ s(x, { children: [
369
375
  /* @__PURE__ */ e("rect", { x: "9", y: "3", width: "6", height: "11", rx: "3" }),
370
376
  /* @__PURE__ */ e("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v3" })
371
377
  ] }),
372
- speaker: /* @__PURE__ */ s(C, { children: [
378
+ speaker: /* @__PURE__ */ s(x, { children: [
373
379
  /* @__PURE__ */ e("path", { d: "M4 9h4l5-4v14l-5-4H4Z" }),
374
380
  /* @__PURE__ */ e("path", { d: "M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12" })
375
381
  ] }),
376
- "user-plus": /* @__PURE__ */ s(C, { children: [
382
+ "user-plus": /* @__PURE__ */ s(x, { children: [
377
383
  /* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
378
384
  /* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M19 8v6M16 11h6" })
379
385
  ] }),
380
386
  "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" }),
381
- video: /* @__PURE__ */ s(C, { children: [
387
+ video: /* @__PURE__ */ s(x, { children: [
382
388
  /* @__PURE__ */ e("rect", { x: "3", y: "6", width: "13", height: "12", rx: "2" }),
383
389
  /* @__PURE__ */ e("path", { d: "m16 10 5-3v10l-5-3" })
384
390
  ] }),
385
- info: /* @__PURE__ */ s(C, { children: [
391
+ info: /* @__PURE__ */ s(x, { children: [
386
392
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
387
393
  /* @__PURE__ */ e("path", { d: "M12 11v6M12 7.5v.5" })
388
394
  ] }),
@@ -391,7 +397,7 @@ const Ce = {
391
397
  plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
392
398
  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" }),
393
399
  check: /* @__PURE__ */ e("path", { d: "m5 12 5 5 9-10" }),
394
- server: /* @__PURE__ */ s(C, { children: [
400
+ server: /* @__PURE__ */ s(x, { children: [
395
401
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "7", rx: "2" }),
396
402
  /* @__PURE__ */ e("rect", { x: "3", y: "13", width: "18", height: "7", rx: "2" }),
397
403
  /* @__PURE__ */ e("path", { d: "M7 7.5h.5M7 16.5h.5" })
@@ -403,26 +409,26 @@ const Ce = {
403
409
  more: /* @__PURE__ */ e("path", { d: "M5 12h.5M12 12h.5M19 12h.5" }),
404
410
  important: /* @__PURE__ */ e("path", { d: "M4 6h11l5 6-5 6H4l4-6-4-6Z" })
405
411
  };
406
- function P({ name: l, size: n = 20, label: a }) {
412
+ function P({ name: n, size: l = 20, label: a }) {
407
413
  return /* @__PURE__ */ e(
408
414
  "svg",
409
415
  {
410
416
  className: "cms-icon",
411
- width: n,
412
- height: n,
417
+ width: l,
418
+ height: l,
413
419
  viewBox: "0 0 24 24",
414
420
  fill: "none",
415
421
  stroke: "currentColor",
416
- strokeWidth: l === "more" ? 3 : 1.75,
422
+ strokeWidth: n === "more" ? 3 : 1.75,
417
423
  strokeLinecap: "round",
418
424
  strokeLinejoin: "round",
419
425
  focusable: !1,
420
426
  ...a ? { role: "img", "aria-label": a } : { "aria-hidden": !0 },
421
- children: Ce[l]
427
+ children: $e[n]
422
428
  }
423
429
  );
424
430
  }
425
- const dl = Object.keys(Ce), ge = {
431
+ const gn = Object.keys($e), Me = {
426
432
  reply: "reply",
427
433
  "reply-all": "reply",
428
434
  forward: "forward",
@@ -437,272 +443,273 @@ const dl = Object.keys(Ce), ge = {
437
443
  "arrow-clockwise": "refresh",
438
444
  download: "download",
439
445
  printer: "print",
446
+ "file-earmark-code": "file-code",
440
447
  "three-dots": "more"
441
448
  };
442
- function oe(l) {
443
- return Object.prototype.hasOwnProperty.call(ge, l) ? ge[l] : null;
449
+ function be(n) {
450
+ return Object.prototype.hasOwnProperty.call(Me, n) ? Me[n] : null;
444
451
  }
445
- const Te = 'input, select, textarea, button:not([disabled]), iframe, [href], [tabindex]:not([tabindex="-1"])', Pe = 60;
446
- function Be(l) {
447
- return l instanceof Element && l.closest('input, select, textarea, [contenteditable="true"], [data-viewer-keys]') !== null;
452
+ const Re = 'input, select, textarea, button:not([disabled]), iframe, [href], [tabindex]:not([tabindex="-1"])', Oe = 60;
453
+ function Ze(n) {
454
+ return n instanceof Element && n.closest('input, select, textarea, [contenteditable="true"], [data-viewer-keys]') !== null;
448
455
  }
449
- function Ie(l) {
450
- return l instanceof Element && l.closest("[data-viewer-gestures]") !== null;
456
+ function Ve(n) {
457
+ return n instanceof Element && n.closest("[data-viewer-gestures]") !== null;
451
458
  }
452
- function Fe(l) {
453
- return l.getClientRects().length > 0;
459
+ function Ue(n) {
460
+ return n.getClientRects().length > 0;
454
461
  }
455
- function ml(l) {
456
- const { name: n, badge: a, closeLabel: t, onClose: c, actions: m = [], moreLabel: o = "More", edit: r, editing: h, siblings: d, bar: f, thumbnails: p, strip: i, onZoom: v, children: y } = l, g = z(null), k = z(null), O = Q(), [w, E] = D(!1), A = z(null);
457
- W(() => {
458
- var H;
459
- const N = document.activeElement, T = document.body.style.overflow;
460
- return document.body.style.overflow = "hidden", (H = k.current) == null || H.focus(), () => {
461
- var B;
462
- document.body.style.overflow = T, (B = N == null ? void 0 : N.focus) == null || B.call(N);
462
+ function Nn(n) {
463
+ const { name: l, badge: a, closeLabel: t, onClose: r, actions: m = [], moreLabel: o = "More", edit: c, editing: u, siblings: d, bar: _, thumbnails: h, strip: i, onZoom: v, children: y } = n, g = O(null), k = O(null), q = ee(), [w, S] = D(!1), A = O(null);
464
+ G(() => {
465
+ var U;
466
+ const b = document.activeElement, E = document.body.style.overflow;
467
+ return document.body.style.overflow = "hidden", (U = k.current) == null || U.focus(), () => {
468
+ var Z;
469
+ document.body.style.overflow = E, (Z = b == null ? void 0 : b.focus) == null || Z.call(b);
463
470
  };
464
471
  }, []);
465
472
  const V = () => {
466
- h != null && h.dirty ? h.onDirtyClose() : c();
467
- }, Z = (N) => {
468
- const T = N.touches.length === 1 ? N.touches[0] : void 0;
469
- A.current = T === void 0 || h !== void 0 || Ie(N.target) ? null : { x: T.clientX, y: T.clientY };
470
- }, le = (N) => {
471
- var L, q;
472
- const T = A.current, H = N.changedTouches[0];
473
- if (A.current = null, T === null || H === void 0) return;
474
- const B = H.clientX - T.x;
475
- Math.abs(B) < Pe || Math.abs(B) < Math.abs(H.clientY - T.y) || (B > 0 ? (L = d == null ? void 0 : d.onPrevious) == null || L.call(d) : (q = d == null ? void 0 : d.onNext) == null || q.call(d));
473
+ u != null && u.dirty ? u.onDirtyClose() : r();
474
+ }, H = (b) => {
475
+ const E = b.touches.length === 1 ? b.touches[0] : void 0;
476
+ A.current = E === void 0 || u !== void 0 || Ve(b.target) ? null : { x: E.clientX, y: E.clientY };
477
+ }, ne = (b) => {
478
+ var L, X;
479
+ const E = A.current, U = b.changedTouches[0];
480
+ if (A.current = null, E === null || U === void 0) return;
481
+ const Z = U.clientX - E.x;
482
+ Math.abs(Z) < Oe || Math.abs(Z) < Math.abs(U.clientY - E.y) || (Z > 0 ? (L = d == null ? void 0 : d.onPrevious) == null || L.call(d) : (X = d == null ? void 0 : d.onNext) == null || X.call(d));
476
483
  };
477
- return be(
484
+ return ke(
478
485
  /* @__PURE__ */ s(
479
486
  "div",
480
487
  {
481
488
  ref: g,
482
- className: M("cms-viewer", h !== void 0 && "is-editing"),
489
+ className: C("cms-viewer", u !== void 0 && "is-editing"),
483
490
  role: "dialog",
484
491
  "aria-modal": "true",
485
- "aria-labelledby": O,
492
+ "aria-labelledby": q,
486
493
  tabIndex: -1,
487
- onKeyDown: (N) => {
488
- var T, H, B;
489
- if (N.key === "Escape") {
490
- if (h !== void 0) return;
491
- N.stopPropagation(), w ? E(!1) : c();
492
- } else if (N.key === "Tab") {
493
- const L = Array.from(((T = g.current) == null ? void 0 : T.querySelectorAll(Te)) ?? []).filter(Fe);
494
+ onKeyDown: (b) => {
495
+ var E, U, Z;
496
+ if (b.key === "Escape") {
497
+ if (u !== void 0) return;
498
+ b.stopPropagation(), w ? S(!1) : r();
499
+ } else if (b.key === "Tab") {
500
+ const L = Array.from(((E = g.current) == null ? void 0 : E.querySelectorAll(Re)) ?? []).filter(Ue);
494
501
  if (L.length === 0) return;
495
- const q = L[0], U = L[L.length - 1];
496
- N.shiftKey && document.activeElement === q ? (N.preventDefault(), U.focus()) : !N.shiftKey && document.activeElement === U && (N.preventDefault(), q.focus());
497
- } else h === void 0 && !Be(N.target) && !N.ctrlKey && !N.metaKey && !N.altKey && (N.key === "ArrowLeft" ? (H = d == null ? void 0 : d.onPrevious) == null || H.call(d) : N.key === "ArrowRight" ? (B = d == null ? void 0 : d.onNext) == null || B.call(d) : N.key === "+" || N.key === "=" ? v == null || v("in") : N.key === "-" ? v == null || v("out") : N.key === "0" && (v == null || v("reset")));
502
+ const X = L[0], z = L[L.length - 1];
503
+ b.shiftKey && document.activeElement === X ? (b.preventDefault(), z.focus()) : !b.shiftKey && document.activeElement === z && (b.preventDefault(), X.focus());
504
+ } else u === void 0 && !Ze(b.target) && !b.ctrlKey && !b.metaKey && !b.altKey && (b.key === "ArrowLeft" ? (U = d == null ? void 0 : d.onPrevious) == null || U.call(d) : b.key === "ArrowRight" ? (Z = d == null ? void 0 : d.onNext) == null || Z.call(d) : b.key === "+" || b.key === "=" ? v == null || v("in") : b.key === "-" ? v == null || v("out") : b.key === "0" && (v == null || v("reset")));
498
505
  },
499
506
  children: [
500
- d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${n}, ${d.position}` }) : null,
507
+ d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${d.position}` }) : null,
501
508
  /* @__PURE__ */ s("header", { className: "cms-viewer__top", children: [
502
509
  /* @__PURE__ */ e("button", { ref: k, type: "button", className: "cms-viewer__icon", "aria-label": t, onClick: V, children: /* @__PURE__ */ e(F, { name: "close" }) }),
503
510
  /* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: a }),
504
- /* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: O, title: n, children: n }),
511
+ /* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: q, title: l, children: l }),
505
512
  d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: d.position }) : null,
506
513
  /* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
507
- h !== void 0 ? /* @__PURE__ */ s(C, { children: [
508
- /* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: h.status }),
509
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: h.onDone, children: h.doneLabel })
510
- ] }) : /* @__PURE__ */ s(C, { children: [
511
- /* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: m.map((N) => /* @__PURE__ */ s("button", { type: "button", className: "cms-viewer__button", onClick: N.onSelect, children: [
512
- N.icon,
513
- N.label
514
- ] }, N.label)) }),
515
- r !== void 0 ? /* @__PURE__ */ s("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": r.label, onClick: r.onEdit, children: [
516
- r.icon,
517
- /* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: r.label })
514
+ u !== void 0 ? /* @__PURE__ */ s(x, { children: [
515
+ /* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: u.status }),
516
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.onDone, children: u.doneLabel })
517
+ ] }) : /* @__PURE__ */ s(x, { children: [
518
+ /* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: m.map((b) => /* @__PURE__ */ s("button", { type: "button", className: "cms-viewer__button", onClick: b.onSelect, children: [
519
+ b.icon,
520
+ b.label
521
+ ] }, b.label)) }),
522
+ c !== void 0 ? /* @__PURE__ */ s("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": c.label, onClick: c.onEdit, children: [
523
+ c.icon,
524
+ /* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: c.label })
518
525
  ] }) : null,
519
526
  m.length > 0 ? /* @__PURE__ */ s("span", { className: "cms-viewer__more", children: [
520
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": o, "aria-expanded": w, onClick: () => E((N) => !N), children: /* @__PURE__ */ e(P, { name: "more" }) }),
521
- w ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: m.map((N) => /* @__PURE__ */ s(
527
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": o, "aria-expanded": w, onClick: () => S((b) => !b), children: /* @__PURE__ */ e(P, { name: "more" }) }),
528
+ w ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: m.map((b) => /* @__PURE__ */ s(
522
529
  "button",
523
530
  {
524
531
  type: "button",
525
532
  className: "cms-viewer__button",
526
533
  onClick: () => {
527
- E(!1), N.onSelect();
534
+ S(!1), b.onSelect();
528
535
  },
529
536
  children: [
530
- N.icon,
531
- N.label
537
+ b.icon,
538
+ b.label
532
539
  ]
533
540
  },
534
- N.label
541
+ b.label
535
542
  )) }) : null
536
543
  ] }) : null
537
544
  ] })
538
545
  ] }),
539
546
  /* @__PURE__ */ s("div", { className: "cms-viewer__body", children: [
540
- p != null && h === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: p }) : null,
541
- /* @__PURE__ */ s("div", { className: "cms-viewer__content", onTouchStart: Z, onTouchEnd: le, children: [
547
+ h != null && u === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: h }) : null,
548
+ /* @__PURE__ */ s("div", { className: "cms-viewer__content", onTouchStart: H, onTouchEnd: ne, children: [
542
549
  y,
543
- h === void 0 && (d != null && d.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": d.previousLabel, onClick: d.onPrevious, children: /* @__PURE__ */ e(F, { name: "back" }) }) : null,
544
- h === void 0 && (d != null && d.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": d.nextLabel, onClick: d.onNext, children: /* @__PURE__ */ e(F, { name: "back" }) }) : null,
545
- h === void 0 && d !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(d.total, 7) }, (N, T) => /* @__PURE__ */ e("i", { className: T === Math.min(d.index, 6) ? "is-current" : void 0 }, T)) }) : null
550
+ u === void 0 && (d != null && d.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": d.previousLabel, onClick: d.onPrevious, children: /* @__PURE__ */ e(F, { name: "back" }) }) : null,
551
+ u === void 0 && (d != null && d.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": d.nextLabel, onClick: d.onNext, children: /* @__PURE__ */ e(F, { name: "back" }) }) : null,
552
+ u === void 0 && d !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(d.total, 7) }, (b, E) => /* @__PURE__ */ e("i", { className: E === Math.min(d.index, 6) ? "is-current" : void 0 }, E)) }) : null
546
553
  ] })
547
554
  ] }),
548
- h === void 0 && i != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: i }) : null,
549
- f != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: f }) : null
555
+ u === void 0 && i != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: i }) : null,
556
+ _ != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: _ }) : null
550
557
  ]
551
558
  }
552
559
  ),
553
560
  document.body
554
561
  );
555
562
  }
556
- class Ke extends Error {
557
- constructor(n = "denied") {
558
- super(n), this.name = "FilePickerDenied";
563
+ class We extends Error {
564
+ constructor(l = "denied") {
565
+ super(l), this.name = "FilePickerDenied";
559
566
  }
560
567
  }
561
- const pe = (l, n) => `${l}
562
- ${n}`, ze = (l, n) => l === "" ? n : `${l}/${n}`, He = 48;
563
- function ul(l) {
564
- var Y, I;
565
- const { open: n, spaces: a, list: t, disabledReason: c, budget: m, formatSize: o, labels: r, onConfirm: h, onCancel: d } = l, [f, p] = D(((Y = a[0]) == null ? void 0 : Y.id) ?? ""), [i, v] = D(""), [y, g] = D({ status: "loading" }), [k, O] = D(0), [w, E] = D(/* @__PURE__ */ new Map()), [A, V] = D(0), [Z, le] = D(!1), N = z(null), T = Q();
566
- W(() => {
567
- var u;
568
- n && (p(((u = a[0]) == null ? void 0 : u.id) ?? ""), v(""), E(/* @__PURE__ */ new Map()), le(!1));
569
- }, [n]), W(() => {
570
- if (!n || f === "") return;
571
- let u = !0;
572
- return g({ status: "loading" }), V(0), t(f, i).then(
573
- (b) => u && g({ status: "ready", entries: b.entries, next: b.next ?? null, paging: !1 }),
574
- (b) => u && g({ status: b instanceof Ke ? "denied" : "error" })
568
+ const Ne = (n, l) => `${n}
569
+ ${l}`, je = (n, l) => n === "" ? l : `${n}/${l}`, qe = 48;
570
+ function yn(n) {
571
+ var me, ue;
572
+ const { open: l, spaces: a, list: t, disabledReason: r, budget: m, formatSize: o, labels: c, onConfirm: u, onCancel: d } = n, [_, h] = D(((me = a[0]) == null ? void 0 : me.id) ?? ""), [i, v] = D(""), [y, g] = D({ status: "loading" }), [k, q] = D(0), [w, S] = D(/* @__PURE__ */ new Map()), [A, V] = D(0), [H, ne] = D(!1), b = O(null), E = ee();
573
+ G(() => {
574
+ var p;
575
+ l && (h(((p = a[0]) == null ? void 0 : p.id) ?? ""), v(""), S(/* @__PURE__ */ new Map()), ne(!1));
576
+ }, [l]), G(() => {
577
+ if (!l || _ === "") return;
578
+ let p = !0;
579
+ return g({ status: "loading" }), V(0), t(_, i).then(
580
+ (N) => p && g({ status: "ready", entries: N.entries, next: N.next ?? null, paging: !1 }),
581
+ (N) => p && g({ status: N instanceof We ? "denied" : "error" })
575
582
  ), () => {
576
- u = !1;
583
+ p = !1;
577
584
  };
578
- }, [n, f, i, t, k]);
579
- const H = ie(() => {
585
+ }, [l, _, i, t, k]);
586
+ const U = _e(() => {
580
587
  if (y.status !== "ready" || y.next === null || y.paging) return;
581
- const u = y.next, b = y.entries;
582
- g({ ...y, paging: !0 }), t(f, i, u).then(
583
- (S) => g({ status: "ready", entries: [...b, ...S.entries], next: S.next ?? null, paging: !1 }),
584
- () => g({ status: "ready", entries: b, next: u, paging: !1 })
588
+ const p = y.next, N = y.entries;
589
+ g({ ...y, paging: !0 }), t(_, i, p).then(
590
+ (I) => g({ status: "ready", entries: [...N, ...I.entries], next: I.next ?? null, paging: !1 }),
591
+ () => g({ status: "ready", entries: N, next: p, paging: !1 })
585
592
  );
586
- }, [y, t, f, i]), B = ie((u) => {
587
- var b;
588
- return ((b = m == null ? void 0 : m.cost) == null ? void 0 : b.call(m, u)) ?? u.size ?? 0;
589
- }, [m]), L = Me(() => [...w.values()], [w]), q = L.reduce((u, b) => u + (b.size ?? 0), 0), U = m === void 0 ? null : m.limitBytes - m.usedBytes - L.reduce((u, b) => u + B(b), 0), _ = U !== null && U < 0, x = (u) => {
590
- if (u.kind !== "file") return null;
591
- const b = c == null ? void 0 : c(u);
592
- return b || (U !== null && !w.has(pe(f, u.id)) && B(u) > U ? r.overBudget : null);
593
- }, K = (u) => {
594
- const b = pe(f, u.id);
595
- !w.has(b) && x(u) !== null || E((S) => {
596
- const R = new Map(S);
597
- return R.has(b) ? R.delete(b) : R.set(b, { ...u, space: f, path: i }), R;
593
+ }, [y, t, _, i]), Z = _e((p) => {
594
+ var N;
595
+ return ((N = m == null ? void 0 : m.cost) == null ? void 0 : N.call(m, p)) ?? p.size ?? 0;
596
+ }, [m]), L = Ie(() => [...w.values()], [w]), X = L.reduce((p, N) => p + (N.size ?? 0), 0), z = m === void 0 ? null : m.limitBytes - m.usedBytes - L.reduce((p, N) => p + Z(N), 0), J = z !== null && z < 0, ce = (p) => {
597
+ if (p.kind !== "file") return null;
598
+ const N = r == null ? void 0 : r(p);
599
+ return N || (z !== null && !w.has(Ne(_, p.id)) && Z(p) > z ? c.overBudget : null);
600
+ }, ie = (p) => {
601
+ const N = Ne(_, p.id);
602
+ !w.has(N) && ce(p) !== null || S((I) => {
603
+ const B = new Map(I);
604
+ return B.has(N) ? B.delete(N) : B.set(N, { ...p, space: _, path: i }), B;
598
605
  });
599
- }, G = (u) => v(ze(i, u.name)), $ = () => v(i.includes("/") ? i.slice(0, i.lastIndexOf("/")) : ""), j = (u) => E((b) => {
600
- const S = new Map(b);
601
- return S.delete(u), S;
602
- }), X = y.status === "ready" ? y.entries : [], me = (u) => {
603
- const b = X[A];
604
- if (u.key === "ArrowDown" || u.key === "ArrowUp" || u.key === "Home" || u.key === "End") {
605
- u.preventDefault();
606
- const S = X.length - 1, R = u.key === "Home" ? 0 : u.key === "End" ? S : Math.min(S, Math.max(0, A + (u.key === "ArrowDown" ? 1 : -1)));
607
- V(R), R >= S - 1 && H();
608
- } else u.key === "Enter" && (b == null ? void 0 : b.kind) === "folder" ? (u.preventDefault(), G(b)) : u.key === " " && (b == null ? void 0 : b.kind) === "file" ? (u.preventDefault(), K(b)) : u.key === "Backspace" && i !== "" && (u.preventDefault(), $());
609
- }, ce = i === "" ? [] : i.split("/"), ue = ((I = a.find((u) => u.id === f)) == null ? void 0 : I.name) ?? "", ne = (u) => `${T}-entry-${String(u)}`;
606
+ }, f = (p) => v(je(i, p.name)), M = () => v(i.includes("/") ? i.slice(0, i.lastIndexOf("/")) : ""), R = (p) => S((N) => {
607
+ const I = new Map(N);
608
+ return I.delete(p), I;
609
+ }), W = y.status === "ready" ? y.entries : [], $ = (p) => {
610
+ const N = W[A];
611
+ if (p.key === "ArrowDown" || p.key === "ArrowUp" || p.key === "Home" || p.key === "End") {
612
+ p.preventDefault();
613
+ const I = W.length - 1, B = p.key === "Home" ? 0 : p.key === "End" ? I : Math.min(I, Math.max(0, A + (p.key === "ArrowDown" ? 1 : -1)));
614
+ V(B), B >= I - 1 && U();
615
+ } else p.key === "Enter" && (N == null ? void 0 : N.kind) === "folder" ? (p.preventDefault(), f(N)) : p.key === " " && (N == null ? void 0 : N.kind) === "file" ? (p.preventDefault(), ie(N)) : p.key === "Backspace" && i !== "" && (p.preventDefault(), M());
616
+ }, j = i === "" ? [] : i.split("/"), oe = ((ue = a.find((p) => p.id === _)) == null ? void 0 : ue.name) ?? "", de = (p) => `${E}-entry-${String(p)}`;
610
617
  return /* @__PURE__ */ s(
611
- xe,
618
+ Le,
612
619
  {
613
- open: n,
614
- title: r.title,
620
+ open: l,
621
+ title: c.title,
615
622
  onClose: d,
616
- closeLabel: r.close,
617
- initialFocus: N,
623
+ closeLabel: c.close,
624
+ initialFocus: b,
618
625
  className: "cms-file-picker",
619
626
  footer: /* @__PURE__ */ s("div", { className: "cms-file-picker__foot", children: [
620
627
  /* @__PURE__ */ s("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
621
- L.length > 0 ? /* @__PURE__ */ e("span", { children: r.total(L.length, o(q)) }) : null,
622
- m !== void 0 && U !== null ? /* @__PURE__ */ e("span", { className: M(_ && "is-over"), children: _ ? r.overBudget : r.left(o(Math.max(0, U)), o(m.limitBytes)) }) : null
628
+ L.length > 0 ? /* @__PURE__ */ e("span", { children: c.total(L.length, o(X)) }) : null,
629
+ m !== void 0 && z !== null ? /* @__PURE__ */ e("span", { className: C(J && "is-over"), children: J ? c.overBudget : c.left(o(Math.max(0, z)), o(m.limitBytes)) }) : null
623
630
  ] }),
624
631
  /* @__PURE__ */ s("div", { className: "cms-file-picker__actions", children: [
625
- /* @__PURE__ */ e(J, { variant: "secondary", onClick: d, children: r.cancel }),
626
- /* @__PURE__ */ e(J, { variant: "primary", disabled: L.length === 0 || _, onClick: () => h(L), children: r.confirm(L.length) })
632
+ /* @__PURE__ */ e(Q, { variant: "secondary", onClick: d, children: c.cancel }),
633
+ /* @__PURE__ */ e(Q, { variant: "primary", disabled: L.length === 0 || J, onClick: () => u(L), children: c.confirm(L.length) })
627
634
  ] })
628
635
  ] }),
629
636
  children: [
630
637
  /* @__PURE__ */ s("div", { className: "cms-file-picker__top", children: [
631
638
  a.length > 1 ? /* @__PURE__ */ s("label", { className: "cms-file-picker__space", children: [
632
- /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: r.space }),
633
- /* @__PURE__ */ e("select", { className: "cms-input cms-select", value: f, onChange: (u) => {
634
- p(u.target.value), v("");
635
- }, children: a.map((u) => /* @__PURE__ */ e("option", { value: u.id, children: u.name }, u.id)) })
639
+ /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: c.space }),
640
+ /* @__PURE__ */ e("select", { className: "cms-input cms-select", value: _, onChange: (p) => {
641
+ h(p.target.value), v("");
642
+ }, children: a.map((p) => /* @__PURE__ */ e("option", { value: p.id, children: p.name }, p.id)) })
636
643
  ] }) : null,
637
- /* @__PURE__ */ s("nav", { className: "cms-file-picker__path", "aria-label": r.path, children: [
638
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": r.up, disabled: i === "", onClick: $, children: /* @__PURE__ */ e(P, { name: "chevron-left" }) }),
644
+ /* @__PURE__ */ s("nav", { className: "cms-file-picker__path", "aria-label": c.path, children: [
645
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": c.up, disabled: i === "", onClick: M, children: /* @__PURE__ */ e(P, { name: "chevron-left" }) }),
639
646
  /* @__PURE__ */ s("ol", { children: [
640
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": i === "" ? "location" : void 0, onClick: () => v(""), children: ue }) }),
641
- ce.map((u, b) => {
642
- const S = ce.slice(0, b + 1).join("/");
643
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": S === i ? "location" : void 0, onClick: () => v(S), children: u }) }, S);
647
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": i === "" ? "location" : void 0, onClick: () => v(""), children: oe }) }),
648
+ j.map((p, N) => {
649
+ const I = j.slice(0, N + 1).join("/");
650
+ return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": I === i ? "location" : void 0, onClick: () => v(I), children: p }) }, I);
644
651
  })
645
652
  ] })
646
653
  ] }),
647
- L.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": Z, onClick: () => le((u) => !u), children: r.selected(L.length) }) : null
654
+ L.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": H, onClick: () => ne((p) => !p), children: c.selected(L.length) }) : null
648
655
  ] }),
649
- Z && L.length > 0 ? /* @__PURE__ */ s("div", { className: "cms-file-picker__chosen", children: [
650
- /* @__PURE__ */ e("ul", { children: [...w.entries()].map(([u, b]) => /* @__PURE__ */ s("li", { children: [
651
- /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: b.name }),
652
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": r.remove(b.name), onClick: () => j(u), children: /* @__PURE__ */ e(F, { name: "close" }) })
653
- ] }, u)) }),
654
- /* @__PURE__ */ e(J, { variant: "secondary", onClick: () => {
655
- E(/* @__PURE__ */ new Map()), le(!1);
656
- }, children: r.clear })
656
+ H && L.length > 0 ? /* @__PURE__ */ s("div", { className: "cms-file-picker__chosen", children: [
657
+ /* @__PURE__ */ e("ul", { children: [...w.entries()].map(([p, N]) => /* @__PURE__ */ s("li", { children: [
658
+ /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: N.name }),
659
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": c.remove(N.name), onClick: () => R(p), children: /* @__PURE__ */ e(F, { name: "close" }) })
660
+ ] }, p)) }),
661
+ /* @__PURE__ */ e(Q, { variant: "secondary", onClick: () => {
662
+ S(/* @__PURE__ */ new Map()), ne(!1);
663
+ }, children: c.clear })
657
664
  ] }) : null,
658
- /* @__PURE__ */ s("div", { className: "cms-file-picker__list", onScroll: (u) => {
659
- const b = u.currentTarget;
660
- b.scrollTop + b.clientHeight >= b.scrollHeight - He && H();
665
+ /* @__PURE__ */ s("div", { className: "cms-file-picker__list", onScroll: (p) => {
666
+ const N = p.currentTarget;
667
+ N.scrollTop + N.clientHeight >= N.scrollHeight - qe && U();
661
668
  }, children: [
662
- y.status === "loading" ? /* @__PURE__ */ e(se, { kind: "loading", title: r.loading, placement: "block" }) : null,
663
- y.status === "error" ? /* @__PURE__ */ e(se, { kind: "error", title: r.error, placement: "block", action: { label: r.retry, onAction: () => O((u) => u + 1) } }) : null,
664
- y.status === "denied" ? /* @__PURE__ */ e(se, { kind: "denied", title: r.denied, placement: "block" }) : null,
665
- y.status === "ready" && X.length === 0 ? /* @__PURE__ */ e(se, { kind: "empty", title: r.empty, placement: "block" }) : null,
669
+ y.status === "loading" ? /* @__PURE__ */ e(te, { kind: "loading", title: c.loading, placement: "block" }) : null,
670
+ y.status === "error" ? /* @__PURE__ */ e(te, { kind: "error", title: c.error, placement: "block", action: { label: c.retry, onAction: () => q((p) => p + 1) } }) : null,
671
+ y.status === "denied" ? /* @__PURE__ */ e(te, { kind: "denied", title: c.denied, placement: "block" }) : null,
672
+ y.status === "ready" && W.length === 0 ? /* @__PURE__ */ e(te, { kind: "empty", title: c.empty, placement: "block" }) : null,
666
673
  /* @__PURE__ */ s(
667
674
  "div",
668
675
  {
669
- ref: N,
676
+ ref: b,
670
677
  role: "listbox",
671
678
  "aria-multiselectable": "true",
672
- "aria-label": r.files,
673
- "aria-activedescendant": X.length > 0 ? ne(A) : void 0,
679
+ "aria-label": c.files,
680
+ "aria-activedescendant": W.length > 0 ? de(A) : void 0,
674
681
  tabIndex: 0,
675
682
  className: "cms-file-picker__entries",
676
- hidden: y.status !== "ready" || X.length === 0,
677
- onKeyDown: me,
683
+ hidden: y.status !== "ready" || W.length === 0,
684
+ onKeyDown: $,
678
685
  children: [
679
- X.map((u, b) => {
680
- const S = u.kind === "file" && w.has(pe(f, u.id)), R = x(u);
686
+ W.map((p, N) => {
687
+ const I = p.kind === "file" && w.has(Ne(_, p.id)), B = ce(p);
681
688
  return /* @__PURE__ */ s(
682
689
  "div",
683
690
  {
684
- id: ne(b),
691
+ id: de(N),
685
692
  role: "option",
686
- "aria-selected": u.kind === "file" ? S : void 0,
687
- "aria-disabled": R !== null || void 0,
688
- className: M("cms-file-picker__entry", b === A && "is-active", S && "is-ticked", R !== null && "is-disabled"),
693
+ "aria-selected": p.kind === "file" ? I : void 0,
694
+ "aria-disabled": B !== null || void 0,
695
+ className: C("cms-file-picker__entry", N === A && "is-active", I && "is-ticked", B !== null && "is-disabled"),
689
696
  onClick: () => {
690
- V(b), u.kind === "folder" ? G(u) : K(u);
697
+ V(N), p.kind === "folder" ? f(p) : ie(p);
691
698
  },
692
699
  children: [
693
- /* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: S ? /* @__PURE__ */ e(P, { name: "check" }) : null }),
694
- /* @__PURE__ */ e(P, { name: u.kind === "folder" ? "folder" : "file" }),
700
+ /* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: I ? /* @__PURE__ */ e(P, { name: "check" }) : null }),
701
+ /* @__PURE__ */ e(P, { name: p.kind === "folder" ? "folder" : "file" }),
695
702
  /* @__PURE__ */ s("span", { className: "cms-file-picker__text", children: [
696
- /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: u.name }),
697
- R !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: R }) : null
703
+ /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: p.name }),
704
+ B !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: B }) : null
698
705
  ] }),
699
- u.kind === "file" && u.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: o(u.size) }) : null
706
+ p.kind === "file" && p.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: o(p.size) }) : null
700
707
  ]
701
708
  },
702
- u.id
709
+ p.id
703
710
  );
704
711
  }),
705
- y.status === "ready" && y.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(se, { kind: "loading", title: r.loading, placement: "inline" }) }) : null
712
+ y.status === "ready" && y.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(te, { kind: "loading", title: c.loading, placement: "inline" }) }) : null
706
713
  ]
707
714
  }
708
715
  )
@@ -711,15 +718,15 @@ function ul(l) {
711
718
  }
712
719
  );
713
720
  }
714
- function hl({ title: l, scope: n, actions: a, backLink: t }) {
721
+ function wn({ title: n, scope: l, actions: a, backLink: t }) {
715
722
  return /* @__PURE__ */ s("header", { className: "cms-page-header", children: [
716
723
  t ? /* @__PURE__ */ s(
717
724
  "a",
718
725
  {
719
726
  className: "cms-page-header__back",
720
727
  href: t.href ?? "#",
721
- onClick: (c) => {
722
- t.onBack && (c.preventDefault(), t.onBack());
728
+ onClick: (r) => {
729
+ t.onBack && (r.preventDefault(), t.onBack());
723
730
  },
724
731
  children: [
725
732
  /* @__PURE__ */ e(F, { name: "back" }),
@@ -730,37 +737,37 @@ function hl({ title: l, scope: n, actions: a, backLink: t }) {
730
737
  ) : null,
731
738
  /* @__PURE__ */ s("div", { className: "cms-page-header__row", children: [
732
739
  /* @__PURE__ */ s("div", { className: "cms-page-header__titles", children: [
733
- /* @__PURE__ */ e("h1", { className: "cms-page-header__title", children: l }),
734
- n != null ? /* @__PURE__ */ e("p", { className: "cms-page-header__scope", children: n }) : null
740
+ /* @__PURE__ */ e("h1", { className: "cms-page-header__title", children: n }),
741
+ l != null ? /* @__PURE__ */ e("p", { className: "cms-page-header__scope", children: l }) : null
735
742
  ] }),
736
743
  a != null ? /* @__PURE__ */ e("div", { className: "cms-page-header__actions", children: a }) : null
737
744
  ] })
738
745
  ] });
739
746
  }
740
- function pl({ tabs: l, active: n, onSelect: a, label: t }) {
741
- const c = z([]), m = (o, r) => {
742
- var p;
743
- const h = l.length - 1, d = o.key === "ArrowRight" ? r === h ? 0 : r + 1 : o.key === "ArrowLeft" ? r === 0 ? h : r - 1 : o.key === "Home" ? 0 : o.key === "End" ? h : null;
747
+ function kn({ tabs: n, active: l, onSelect: a, label: t }) {
748
+ const r = O([]), m = (o, c) => {
749
+ var h;
750
+ const u = n.length - 1, d = o.key === "ArrowRight" ? c === u ? 0 : c + 1 : o.key === "ArrowLeft" ? c === 0 ? u : c - 1 : o.key === "Home" ? 0 : o.key === "End" ? u : null;
744
751
  if (d === null) return;
745
752
  o.preventDefault();
746
- const f = l[d];
747
- f && (a(f.id), (p = c.current[d]) == null || p.focus());
753
+ const _ = n[d];
754
+ _ && (a(_.id), (h = r.current[d]) == null || h.focus());
748
755
  };
749
- return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": t, children: l.map((o, r) => {
750
- const h = o.id === n;
756
+ return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": t, children: n.map((o, c) => {
757
+ const u = o.id === l;
751
758
  return /* @__PURE__ */ s(
752
759
  "button",
753
760
  {
754
761
  ref: (d) => {
755
- c.current[r] = d;
762
+ r.current[c] = d;
756
763
  },
757
764
  type: "button",
758
765
  role: "tab",
759
- className: M("cms-tab", h && "is-active"),
760
- "aria-selected": h,
761
- tabIndex: h ? 0 : -1,
766
+ className: C("cms-tab", u && "is-active"),
767
+ "aria-selected": u,
768
+ tabIndex: u ? 0 : -1,
762
769
  onClick: () => a(o.id),
763
- onKeyDown: (d) => m(d, r),
770
+ onKeyDown: (d) => m(d, c),
764
771
  children: [
765
772
  o.label,
766
773
  o.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: o.count }) : null
@@ -770,82 +777,82 @@ function pl({ tabs: l, active: n, onSelect: a, label: t }) {
770
777
  );
771
778
  }) });
772
779
  }
773
- function Re(l) {
780
+ function Ge(n) {
774
781
  var t;
775
- const n = l.trim().split(/\s+/).filter(Boolean);
776
- return (n.length > 1 ? [n[0][0], n[n.length - 1][0]] : [(t = n[0]) == null ? void 0 : t[0]]).filter(Boolean).join("").toUpperCase();
782
+ const l = n.trim().split(/\s+/).filter(Boolean);
783
+ return (l.length > 1 ? [l[0][0], l[l.length - 1][0]] : [(t = l[0]) == null ? void 0 : t[0]]).filter(Boolean).join("").toUpperCase();
777
784
  }
778
- function Ze(l) {
779
- let n = 0;
780
- for (const a of l.trim().toLowerCase())
781
- n = n * 31 + (a.codePointAt(0) ?? 0) >>> 0;
782
- return n % 6 + 1;
785
+ function Xe(n) {
786
+ let l = 0;
787
+ for (const a of n.trim().toLowerCase())
788
+ l = l * 31 + (a.codePointAt(0) ?? 0) >>> 0;
789
+ return l % 6 + 1;
783
790
  }
784
- function de({ name: l, pictureUrl: n, presence: a, size: t = 32 }) {
791
+ function ve({ name: n, pictureUrl: l, presence: a, size: t = 32 }) {
785
792
  return /* @__PURE__ */ s(
786
793
  "span",
787
794
  {
788
- className: `cms-avatar cms-avatar--tint-${Ze(l)}`,
795
+ className: `cms-avatar cms-avatar--tint-${Xe(n)}`,
789
796
  style: { width: t, height: t, fontSize: Math.round(t * 0.4) },
790
797
  role: "img",
791
- "aria-label": a ? `${l}, ${a}` : l,
798
+ "aria-label": a ? `${n}, ${a}` : n,
792
799
  children: [
793
- n ? /* @__PURE__ */ e("img", { src: n, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: Re(l) }),
794
- a ? /* @__PURE__ */ e("span", { className: M("cms-avatar__presence", `is-${a}`), "aria-hidden": "true" }) : null
800
+ l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: Ge(n) }),
801
+ a ? /* @__PURE__ */ e("span", { className: C("cms-avatar__presence", `is-${a}`), "aria-hidden": "true" }) : null
795
802
  ]
796
803
  }
797
804
  );
798
805
  }
799
- function Oe({ count: l, label: n, max: a = 99 }) {
800
- return l <= 0 ? null : /* @__PURE__ */ s("span", { className: "cms-badge", children: [
801
- /* @__PURE__ */ e("span", { "aria-hidden": "true", children: l > a ? `${a}+` : l }),
802
- /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: n })
806
+ function Ye({ count: n, label: l, max: a = 99 }) {
807
+ return n <= 0 ? null : /* @__PURE__ */ s("span", { className: "cms-badge", children: [
808
+ /* @__PURE__ */ e("span", { "aria-hidden": "true", children: n > a ? `${a}+` : n }),
809
+ /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: l })
803
810
  ] });
804
811
  }
805
- function fl({ product: l, mark: n, rail: a, active: t, onNavigate: c, server: m, search: o, account: r, children: h, railLabel: d = "Sections" }) {
812
+ function xn({ product: n, mark: l, rail: a, active: t, onNavigate: r, server: m, search: o, account: c, children: u, railLabel: d = "Sections" }) {
806
813
  return /* @__PURE__ */ s("div", { className: "cms-shell", children: [
807
814
  /* @__PURE__ */ s("nav", { className: "cms-shell__rail", "aria-label": d, children: [
808
- /* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: n }),
809
- /* @__PURE__ */ e("ul", { className: "cms-shell__items", children: a.map((f) => {
810
- const p = f.id === t;
815
+ /* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: l }),
816
+ /* @__PURE__ */ e("ul", { className: "cms-shell__items", children: a.map((_) => {
817
+ const h = _.id === t;
811
818
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
812
819
  "a",
813
820
  {
814
- href: f.href,
815
- className: M("cms-shell__item", p && "is-active"),
816
- "aria-current": p ? "page" : void 0,
817
- title: f.label,
821
+ href: _.href,
822
+ className: C("cms-shell__item", h && "is-active"),
823
+ "aria-current": h ? "page" : void 0,
824
+ title: _.label,
818
825
  onClick: (i) => {
819
- c && (i.preventDefault(), c(f.id));
826
+ r && (i.preventDefault(), r(_.id));
820
827
  },
821
828
  children: [
822
829
  /* @__PURE__ */ s("span", { className: "cms-shell__icon", children: [
823
- /* @__PURE__ */ e(P, { name: f.icon, size: 22 }),
824
- f.badge ? /* @__PURE__ */ e(Oe, { count: f.badge.count, label: f.badge.label }) : null
830
+ /* @__PURE__ */ e(P, { name: _.icon, size: 22 }),
831
+ _.badge ? /* @__PURE__ */ e(Ye, { count: _.badge.count, label: _.badge.label }) : null
825
832
  ] }),
826
- /* @__PURE__ */ e("span", { className: "cms-shell__label", children: f.label })
833
+ /* @__PURE__ */ e("span", { className: "cms-shell__label", children: _.label })
827
834
  ]
828
835
  }
829
- ) }, f.id);
836
+ ) }, _.id);
830
837
  }) })
831
838
  ] }),
832
839
  /* @__PURE__ */ s("header", { className: "cms-shell__top", children: [
833
- /* @__PURE__ */ e("span", { className: "cms-shell__product", children: l }),
840
+ /* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
834
841
  m != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: m }) : null,
835
842
  o != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: o }) : null,
836
- r != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: r }) : null
843
+ c != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: c }) : null
837
844
  ] }),
838
- /* @__PURE__ */ e("main", { className: "cms-shell__main", children: h })
845
+ /* @__PURE__ */ e("main", { className: "cms-shell__main", children: u })
839
846
  ] });
840
847
  }
841
- function _l({ label: l, placeholder: n, value: a, onChange: t, onSearch: c }) {
848
+ function Mn({ label: n, placeholder: l, value: a, onChange: t, onSearch: r }) {
842
849
  return /* @__PURE__ */ s(
843
850
  "form",
844
851
  {
845
852
  role: "search",
846
853
  className: "cms-search",
847
854
  onSubmit: (m) => {
848
- m.preventDefault(), c == null || c(a);
855
+ m.preventDefault(), r == null || r(a);
849
856
  },
850
857
  children: [
851
858
  /* @__PURE__ */ e(P, { name: "search", size: 18 }),
@@ -854,8 +861,8 @@ function _l({ label: l, placeholder: n, value: a, onChange: t, onSearch: c }) {
854
861
  {
855
862
  className: "cms-search__input",
856
863
  type: "search",
857
- "aria-label": l,
858
- placeholder: n,
864
+ "aria-label": n,
865
+ placeholder: l,
859
866
  value: a,
860
867
  onChange: (m) => t(m.target.value)
861
868
  }
@@ -864,32 +871,32 @@ function _l({ label: l, placeholder: n, value: a, onChange: t, onSearch: c }) {
864
871
  }
865
872
  );
866
873
  }
867
- function bl({ options: l, value: n, onChange: a, label: t }) {
868
- const c = z([]), m = (o, r) => {
869
- var p;
870
- const h = l.length - 1, d = o.key === "ArrowRight" || o.key === "ArrowDown" ? r === h ? 0 : r + 1 : o.key === "ArrowLeft" || o.key === "ArrowUp" ? r === 0 ? h : r - 1 : null;
874
+ function Cn({ options: n, value: l, onChange: a, label: t }) {
875
+ const r = O([]), m = (o, c) => {
876
+ var h;
877
+ const u = n.length - 1, d = o.key === "ArrowRight" || o.key === "ArrowDown" ? c === u ? 0 : c + 1 : o.key === "ArrowLeft" || o.key === "ArrowUp" ? c === 0 ? u : c - 1 : null;
871
878
  if (d === null) return;
872
879
  o.preventDefault();
873
- const f = l[d];
874
- f && (a(f.id), (p = c.current[d]) == null || p.focus());
880
+ const _ = n[d];
881
+ _ && (a(_.id), (h = r.current[d]) == null || h.focus());
875
882
  };
876
- return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": t, children: l.map((o, r) => {
877
- const h = o.id === n;
883
+ return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": t, children: n.map((o, c) => {
884
+ const u = o.id === l;
878
885
  return /* @__PURE__ */ s(
879
886
  "button",
880
887
  {
881
888
  ref: (d) => {
882
- c.current[r] = d;
889
+ r.current[c] = d;
883
890
  },
884
891
  type: "button",
885
892
  role: "radio",
886
- "aria-checked": h,
887
- tabIndex: h ? 0 : -1,
888
- className: M("cms-chip", h && "is-on"),
893
+ "aria-checked": u,
894
+ tabIndex: u ? 0 : -1,
895
+ className: C("cms-chip", u && "is-on"),
889
896
  onClick: () => a(o.id),
890
- onKeyDown: (d) => m(d, r),
897
+ onKeyDown: (d) => m(d, c),
891
898
  children: [
892
- h ? /* @__PURE__ */ e(P, { name: "check", size: 16 }) : null,
899
+ u ? /* @__PURE__ */ e(P, { name: "check", size: 16 }) : null,
893
900
  o.label
894
901
  ]
895
902
  },
@@ -897,37 +904,37 @@ function bl({ options: l, value: n, onChange: a, label: t }) {
897
904
  );
898
905
  }) });
899
906
  }
900
- function vl({ panes: l, active: n, back: a }) {
901
- const t = Math.min(Math.max(n ?? l.length - 1, 0), l.length - 1);
902
- return /* @__PURE__ */ e("div", { className: M("cms-panes", l.length === 3 ? "cms-panes--three" : "cms-panes--two"), "data-active": t, children: l.map((c, m) => /* @__PURE__ */ s("section", { className: "cms-panes__pane", "aria-label": c.label, "data-offset": t - m, children: [
907
+ function Sn({ panes: n, active: l, back: a }) {
908
+ const t = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1);
909
+ return /* @__PURE__ */ e("div", { className: C("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two"), "data-active": t, children: n.map((r, m) => /* @__PURE__ */ s("section", { className: "cms-panes__pane", "aria-label": r.label, "data-offset": t - m, children: [
903
910
  m === t && a ? /* @__PURE__ */ s("a", { className: "cms-panes__back", href: a.href, children: [
904
911
  /* @__PURE__ */ e(P, { name: "chevron-left", size: 18 }),
905
912
  a.label
906
913
  ] }) : null,
907
- c.content
908
- ] }, c.label)) });
914
+ r.content
915
+ ] }, r.label)) });
909
916
  }
910
- const Ve = { attachment: "Has an attachment", unread: "Unread" };
911
- function gl({ from: l, subject: n, preview: a, time: t, unread: c, hasAttachment: m, selected: o, onOpen: r, labels: h }) {
912
- const d = te(Ve, h);
917
+ const Je = { attachment: "Has an attachment", unread: "Unread" };
918
+ function An({ from: n, subject: l, preview: a, time: t, unread: r, hasAttachment: m, selected: o, onOpen: c, labels: u }) {
919
+ const d = re(Je, u);
913
920
  return /* @__PURE__ */ s(
914
921
  "button",
915
922
  {
916
923
  type: "button",
917
- className: M("cms-mail-row", c && "is-unread", o && "is-selected"),
924
+ className: C("cms-mail-row", r && "is-unread", o && "is-selected"),
918
925
  "aria-current": o ? "true" : void 0,
919
- onClick: r,
926
+ onClick: c,
920
927
  children: [
921
- /* @__PURE__ */ e(de, { name: l, size: 40 }),
928
+ /* @__PURE__ */ e(ve, { name: n, size: 40 }),
922
929
  /* @__PURE__ */ s("span", { className: "cms-mail-row__body", children: [
923
930
  /* @__PURE__ */ s("span", { className: "cms-mail-row__line", children: [
924
- /* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: l }),
931
+ /* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
925
932
  m ? /* @__PURE__ */ e(P, { name: "paperclip", size: 16, label: d.attachment }) : null,
926
933
  /* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: t })
927
934
  ] }),
928
935
  /* @__PURE__ */ s("span", { className: "cms-mail-row__line", children: [
929
- /* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: n }),
930
- c ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": d.unread }) : null
936
+ /* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
937
+ r ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": d.unread }) : null
931
938
  ] }),
932
939
  /* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: a })
933
940
  ] })
@@ -935,33 +942,33 @@ function gl({ from: l, subject: n, preview: a, time: t, unread: c, hasAttachment
935
942
  }
936
943
  );
937
944
  }
938
- function Nl({ direction: l, children: n, time: a, read: t, readLabel: c = "Read" }) {
939
- return /* @__PURE__ */ s("div", { className: M("cms-bubble", `cms-bubble--${l}`), children: [
940
- /* @__PURE__ */ e("div", { className: "cms-bubble__text", children: n }),
945
+ function Dn({ direction: n, children: l, time: a, read: t, readLabel: r = "Read" }) {
946
+ return /* @__PURE__ */ s("div", { className: C("cms-bubble", `cms-bubble--${n}`), children: [
947
+ /* @__PURE__ */ e("div", { className: "cms-bubble__text", children: l }),
941
948
  /* @__PURE__ */ s("div", { className: "cms-bubble__meta", children: [
942
949
  a,
943
- l === "out" && t ? /* @__PURE__ */ s(C, { children: [
950
+ n === "out" && t ? /* @__PURE__ */ s(x, { children: [
944
951
  " · ",
945
- c
952
+ r
946
953
  ] }) : null
947
954
  ] })
948
955
  ] });
949
956
  }
950
- function yl({ label: l, value: n, onChange: a, onSend: t, onAttach: c, placeholder: m, variant: o = "chat", sendLabel: r = "Send", attachLabel: h = "Attach a file", leading: d, canSend: f }) {
951
- const p = Q(), i = f ?? n.trim() !== "", v = (g) => {
957
+ function En({ label: n, value: l, onChange: a, onSend: t, onAttach: r, placeholder: m, variant: o = "chat", sendLabel: c = "Send", attachLabel: u = "Attach a file", leading: d, canSend: _ }) {
958
+ const h = ee(), i = _ ?? l.trim() !== "", v = (g) => {
952
959
  g.preventDefault(), i && t();
953
- }, y = c ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": h, onClick: c, children: /* @__PURE__ */ e(P, { name: "paperclip" }) }) : null;
954
- return /* @__PURE__ */ s("form", { className: M("cms-composer", `cms-composer--${o}`), onSubmit: v, children: [
955
- /* @__PURE__ */ e("label", { htmlFor: p, className: o === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: l }),
960
+ }, y = r ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": u, onClick: r, children: /* @__PURE__ */ e(P, { name: "paperclip" }) }) : null;
961
+ return /* @__PURE__ */ s("form", { className: C("cms-composer", `cms-composer--${o}`), onSubmit: v, children: [
962
+ /* @__PURE__ */ e("label", { htmlFor: h, className: o === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
956
963
  o === "chat" ? y : null,
957
964
  /* @__PURE__ */ e(
958
965
  "textarea",
959
966
  {
960
- id: p,
967
+ id: h,
961
968
  className: "cms-composer__input",
962
969
  rows: o === "reply" ? 3 : 1,
963
970
  placeholder: m,
964
- value: n,
971
+ value: l,
965
972
  onChange: (g) => a(g.target.value),
966
973
  onKeyDown: (g) => {
967
974
  g.nativeEvent.isComposing || g.keyCode === 229 || o === "chat" && g.key === "Enter" && !g.shiftKey && (g.preventDefault(), i && t());
@@ -970,21 +977,21 @@ function yl({ label: l, value: n, onChange: a, onSend: t, onAttach: c, placehold
970
977
  ),
971
978
  o === "reply" && d !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: d }) : null,
972
979
  o === "reply" ? y : null,
973
- o === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": r, disabled: !i, children: /* @__PURE__ */ e(P, { name: "send" }) }) : /* @__PURE__ */ s("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !i, children: [
974
- r,
980
+ o === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": c, disabled: !i, children: /* @__PURE__ */ e(P, { name: "send" }) }) : /* @__PURE__ */ s("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !i, children: [
981
+ c,
975
982
  " ",
976
983
  /* @__PURE__ */ e(P, { name: "send", size: 18 })
977
984
  ] })
978
985
  ] });
979
986
  }
980
- const ve = {
987
+ const xe = {
981
988
  incomingAudio: "Incoming audio call",
982
989
  incomingVideo: "Incoming video call",
983
- incomingFrom: (l, n) => `${l} from ${n}`,
990
+ incomingFrom: (n, l) => `${n} from ${l}`,
984
991
  accept: "Accept",
985
992
  decline: "Decline",
986
- callWith: (l) => `Call with ${l}`,
987
- callTime: (l) => `Call time ${l}`,
993
+ callWith: (n) => `Call with ${n}`,
994
+ callTime: (n) => `Call time ${n}`,
988
995
  goodConnection: "Good connection",
989
996
  poorConnection: "Poor connection",
990
997
  you: "You",
@@ -995,85 +1002,85 @@ const ve = {
995
1002
  addPerson: "Add person",
996
1003
  chat: "Chat",
997
1004
  hangUp: "Hang up",
998
- onCallWith: (l) => `On a call with ${l}`,
1005
+ onCallWith: (n) => `On a call with ${n}`,
999
1006
  returnToCall: "Return to call"
1000
1007
  };
1001
- function wl({ name: l, media: n, onAccept: a, onDecline: t, labels: c }) {
1002
- const m = te(ve, c), o = n === "video" ? m.incomingVideo : m.incomingAudio;
1003
- return /* @__PURE__ */ s("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": m.incomingFrom(o, l), children: [
1004
- /* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(de, { name: l, size: 112 }) }),
1005
- /* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: l }),
1008
+ function Ln({ name: n, media: l, onAccept: a, onDecline: t, labels: r }) {
1009
+ const m = re(xe, r), o = l === "video" ? m.incomingVideo : m.incomingAudio;
1010
+ return /* @__PURE__ */ s("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": m.incomingFrom(o, n), children: [
1011
+ /* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(ve, { name: n, size: 112 }) }),
1012
+ /* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: n }),
1006
1013
  /* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: o }),
1007
1014
  /* @__PURE__ */ s("div", { className: "cms-call-incoming__actions", children: [
1008
- /* @__PURE__ */ e(ee, { icon: "phone-off", label: m.decline, tone: "hang-up", onClick: t }),
1009
- /* @__PURE__ */ e(ee, { icon: "phone", label: m.accept, tone: "accept", onClick: a })
1015
+ /* @__PURE__ */ e(ae, { icon: "phone-off", label: m.decline, tone: "hang-up", onClick: t }),
1016
+ /* @__PURE__ */ e(ae, { icon: "phone", label: m.accept, tone: "accept", onClick: a })
1010
1017
  ] })
1011
1018
  ] });
1012
1019
  }
1013
- function ee({ icon: l, label: n, onClick: a, tone: t = "plain", pressed: c }) {
1020
+ function ae({ icon: n, label: l, onClick: a, tone: t = "plain", pressed: r }) {
1014
1021
  return /* @__PURE__ */ s(
1015
1022
  "button",
1016
1023
  {
1017
1024
  type: "button",
1018
- className: M("cms-call-button", `cms-call-button--${t}`, c && "is-pressed"),
1019
- "aria-pressed": c,
1025
+ className: C("cms-call-button", `cms-call-button--${t}`, r && "is-pressed"),
1026
+ "aria-pressed": r,
1020
1027
  onClick: a,
1021
1028
  children: [
1022
- /* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(P, { name: l, size: 24 }) }),
1023
- /* @__PURE__ */ e("span", { className: "cms-call-button__label", children: n })
1029
+ /* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(P, { name: n, size: 24 }) }),
1030
+ /* @__PURE__ */ e("span", { className: "cms-call-button__label", children: l })
1024
1031
  ]
1025
1032
  }
1026
1033
  );
1027
1034
  }
1028
- function kl({ name: l, duration: n, connection: a, you: t, muted: c, speaker: m, onToggleMute: o, onToggleSpeaker: r, onAddPerson: h, onChat: d, onHangUp: f, labels: p }) {
1029
- const i = te(ve, p);
1030
- return /* @__PURE__ */ s("section", { className: "cms-call-panel", "aria-label": i.callWith(l), children: [
1035
+ function $n({ name: n, duration: l, connection: a, you: t, muted: r, speaker: m, onToggleMute: o, onToggleSpeaker: c, onAddPerson: u, onChat: d, onHangUp: _, labels: h }) {
1036
+ const i = re(xe, h);
1037
+ return /* @__PURE__ */ s("section", { className: "cms-call-panel", "aria-label": i.callWith(n), children: [
1031
1038
  /* @__PURE__ */ s("div", { className: "cms-call-panel__head", children: [
1032
- /* @__PURE__ */ e(de, { name: l, size: 64 }),
1039
+ /* @__PURE__ */ e(ve, { name: n, size: 64 }),
1033
1040
  /* @__PURE__ */ s("div", { className: "cms-call-panel__who", children: [
1034
- /* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: l }),
1035
- /* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": i.callTime(n), children: n })
1041
+ /* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
1042
+ /* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": i.callTime(l), children: l })
1036
1043
  ] }),
1037
- /* @__PURE__ */ e("span", { className: M("cms-pill", a === "good" ? "cms-pill--success" : "cms-pill--warning"), children: a === "good" ? i.goodConnection : i.poorConnection })
1044
+ /* @__PURE__ */ e("span", { className: C("cms-pill", a === "good" ? "cms-pill--success" : "cms-pill--warning"), children: a === "good" ? i.goodConnection : i.poorConnection })
1038
1045
  ] }),
1039
1046
  /* @__PURE__ */ s("div", { className: "cms-call-panel__you", children: [
1040
- /* @__PURE__ */ e(de, { name: t.name, size: 36 }),
1047
+ /* @__PURE__ */ e(ve, { name: t.name, size: 36 }),
1041
1048
  /* @__PURE__ */ e("span", { children: i.you }),
1042
1049
  t.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": i.speaking }) : null
1043
1050
  ] }),
1044
1051
  /* @__PURE__ */ s("div", { className: "cms-call-panel__controls", children: [
1045
- /* @__PURE__ */ e(ee, { icon: "mic", label: c ? i.unmute : i.mute, pressed: c, onClick: o }),
1046
- /* @__PURE__ */ e(ee, { icon: "speaker", label: i.speaker, pressed: m, onClick: r }),
1047
- h ? /* @__PURE__ */ e(ee, { icon: "user-plus", label: i.addPerson, onClick: h }) : null,
1048
- d ? /* @__PURE__ */ e(ee, { icon: "chat", label: i.chat, onClick: d }) : null,
1049
- /* @__PURE__ */ e(ee, { icon: "phone-off", label: i.hangUp, tone: "hang-up", onClick: f })
1052
+ /* @__PURE__ */ e(ae, { icon: "mic", label: r ? i.unmute : i.mute, pressed: r, onClick: o }),
1053
+ /* @__PURE__ */ e(ae, { icon: "speaker", label: i.speaker, pressed: m, onClick: c }),
1054
+ u ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: i.addPerson, onClick: u }) : null,
1055
+ d ? /* @__PURE__ */ e(ae, { icon: "chat", label: i.chat, onClick: d }) : null,
1056
+ /* @__PURE__ */ e(ae, { icon: "phone-off", label: i.hangUp, tone: "hang-up", onClick: _ })
1050
1057
  ] })
1051
1058
  ] });
1052
1059
  }
1053
- function xl({ name: l, duration: n, muted: a, onToggleMute: t, onReturn: c, onHangUp: m, labels: o }) {
1054
- const r = te(ve, o);
1055
- return /* @__PURE__ */ s("section", { className: "cms-call-bar", "aria-label": r.callWith(l), children: [
1060
+ function Tn({ name: n, duration: l, muted: a, onToggleMute: t, onReturn: r, onHangUp: m, labels: o }) {
1061
+ const c = re(xe, o);
1062
+ return /* @__PURE__ */ s("section", { className: "cms-call-bar", "aria-label": c.callWith(n), children: [
1056
1063
  /* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
1057
- /* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: r.onCallWith(l) }),
1058
- /* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: n }),
1064
+ /* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: c.onCallWith(n) }),
1065
+ /* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: l }),
1059
1066
  /* @__PURE__ */ s("span", { className: "cms-call-bar__actions", children: [
1060
- /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": a ? r.unmute : r.mute, "aria-pressed": a, onClick: t, children: /* @__PURE__ */ e(P, { name: "mic" }) }),
1061
- /* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: c, children: r.returnToCall }),
1062
- /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": r.hangUp, onClick: m, children: /* @__PURE__ */ e(P, { name: "phone-off" }) })
1067
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": a ? c.unmute : c.mute, "aria-pressed": a, onClick: t, children: /* @__PURE__ */ e(P, { name: "mic" }) }),
1068
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: r, children: c.returnToCall }),
1069
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": c.hangUp, onClick: m, children: /* @__PURE__ */ e(P, { name: "phone-off" }) })
1063
1070
  ] })
1064
1071
  ] });
1065
1072
  }
1066
- function Cl({ mark: l, product: n, headline: a, lead: t, features: c = [], children: m }) {
1073
+ function In({ mark: n, product: l, headline: a, lead: t, features: r = [], children: m }) {
1067
1074
  return /* @__PURE__ */ s("div", { className: "cms-signin", children: [
1068
1075
  /* @__PURE__ */ s("aside", { className: "cms-signin__brand", children: [
1069
1076
  /* @__PURE__ */ s("p", { className: "cms-signin__logo", children: [
1070
- /* @__PURE__ */ e("span", { className: "cms-signin__mark", "aria-hidden": "true", children: l }),
1071
- n
1077
+ /* @__PURE__ */ e("span", { className: "cms-signin__mark", "aria-hidden": "true", children: n }),
1078
+ l
1072
1079
  ] }),
1073
1080
  /* @__PURE__ */ s("div", { className: "cms-signin__pitch", children: [
1074
1081
  /* @__PURE__ */ e("p", { className: "cms-signin__headline", children: a }),
1075
1082
  /* @__PURE__ */ e("p", { className: "cms-signin__lead", children: t }),
1076
- c.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: c.map((o) => /* @__PURE__ */ s("li", { children: [
1083
+ r.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: r.map((o) => /* @__PURE__ */ s("li", { children: [
1077
1084
  /* @__PURE__ */ e(P, { name: o.icon, size: 18 }),
1078
1085
  o.label
1079
1086
  ] }, o.label)) }) : null
@@ -1082,7 +1089,7 @@ function Cl({ mark: l, product: n, headline: a, lead: t, features: c = [], child
1082
1089
  /* @__PURE__ */ e("main", { className: "cms-signin__form", children: m })
1083
1090
  ] });
1084
1091
  }
1085
- const Ue = {
1092
+ const Qe = {
1086
1093
  title: "Sign in",
1087
1094
  identifier: "Email or username",
1088
1095
  identifierPlaceholder: "name@example.com",
@@ -1094,86 +1101,86 @@ const Ue = {
1094
1101
  newHere: "New here?",
1095
1102
  create: "Create an account"
1096
1103
  };
1097
- function Ml({ server: l, onSubmit: n, forgotHref: a, createHref: t, error: c, busy: m, labels: o }) {
1098
- const r = te(Ue, o), h = Q(), [d, f] = D(""), [p, i] = D(""), [v, y] = D(!1);
1104
+ function Pn({ server: n, onSubmit: l, forgotHref: a, createHref: t, error: r, busy: m, labels: o }) {
1105
+ const c = re(Qe, o), u = ee(), [d, _] = D(""), [h, i] = D(""), [v, y] = D(!1);
1099
1106
  return /* @__PURE__ */ s("form", { className: "cms-signin-form", onSubmit: (k) => {
1100
- k.preventDefault(), n(d, p);
1101
- }, "aria-describedby": c ? `${h}-error` : void 0, children: [
1102
- /* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: r.title }),
1107
+ k.preventDefault(), l(d, h);
1108
+ }, "aria-describedby": r ? `${u}-error` : void 0, children: [
1109
+ /* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: c.title }),
1103
1110
  /* @__PURE__ */ s("p", { className: "cms-signin-form__server", children: [
1104
1111
  /* @__PURE__ */ e(P, { name: "server", size: 18 }),
1105
- l
1112
+ n
1106
1113
  ] }),
1107
- /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${h}-identifier`, children: r.identifier }),
1114
+ /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-identifier`, children: c.identifier }),
1108
1115
  /* @__PURE__ */ e(
1109
1116
  "input",
1110
1117
  {
1111
- id: `${h}-identifier`,
1118
+ id: `${u}-identifier`,
1112
1119
  className: "cms-signin-form__input",
1113
1120
  type: "text",
1114
1121
  autoComplete: "username",
1115
- placeholder: r.identifierPlaceholder,
1122
+ placeholder: c.identifierPlaceholder,
1116
1123
  value: d,
1117
- onChange: (k) => f(k.target.value),
1124
+ onChange: (k) => _(k.target.value),
1118
1125
  required: !0
1119
1126
  }
1120
1127
  ),
1121
- /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${h}-password`, children: r.password }),
1128
+ /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-password`, children: c.password }),
1122
1129
  /* @__PURE__ */ s("span", { className: "cms-signin-form__password", children: [
1123
1130
  /* @__PURE__ */ e(
1124
1131
  "input",
1125
1132
  {
1126
- id: `${h}-password`,
1133
+ id: `${u}-password`,
1127
1134
  className: "cms-signin-form__input",
1128
1135
  type: v ? "text" : "password",
1129
1136
  autoComplete: "current-password",
1130
- value: p,
1137
+ value: h,
1131
1138
  onChange: (k) => i(k.target.value),
1132
1139
  required: !0
1133
1140
  }
1134
1141
  ),
1135
- /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": v, onClick: () => y((k) => !k), children: v ? r.hide : r.show })
1142
+ /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": v, onClick: () => y((k) => !k), children: v ? c.hide : c.show })
1136
1143
  ] }),
1137
- a ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: a, children: r.forgot }) : null,
1138
- c ? /* @__PURE__ */ e("p", { id: `${h}-error`, className: "cms-signin-form__error", role: "alert", children: c }) : null,
1139
- /* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: m, "aria-busy": m || void 0, children: r.submit }),
1140
- t ? /* @__PURE__ */ s(C, { children: [
1141
- /* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: r.newHere }) }),
1142
- /* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: t, children: r.create })
1144
+ a ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: a, children: c.forgot }) : null,
1145
+ r ? /* @__PURE__ */ e("p", { id: `${u}-error`, className: "cms-signin-form__error", role: "alert", children: r }) : null,
1146
+ /* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: m, "aria-busy": m || void 0, children: c.submit }),
1147
+ t ? /* @__PURE__ */ s(x, { children: [
1148
+ /* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: c.newHere }) }),
1149
+ /* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: t, children: c.create })
1143
1150
  ] }) : null
1144
1151
  ] });
1145
1152
  }
1146
- function Al({ label: l, rows: n, error: a, onRetry: t, loadingText: c = "Loading", emptyTitle: m = "Nothing here yet", emptyHint: o, selected: r, onOpen: h, onRowMenu: d }) {
1147
- const f = z([]);
1148
- if (a != null) return /* @__PURE__ */ e(Ee, { message: a, onRetry: t });
1149
- if (n === null) return /* @__PURE__ */ e(Se, { what: c, layout: "block" });
1150
- if (n.length === 0) return /* @__PURE__ */ e(De, { title: m, hint: o });
1151
- const p = (i, v, y) => {
1153
+ function Bn({ label: n, rows: l, error: a, onRetry: t, loadingText: r = "Loading", emptyTitle: m = "Nothing here yet", emptyHint: o, selected: c, onOpen: u, onRowMenu: d }) {
1154
+ const _ = O([]);
1155
+ if (a != null) return /* @__PURE__ */ e(ze, { message: a, onRetry: t });
1156
+ if (l === null) return /* @__PURE__ */ e(Be, { what: r, layout: "block" });
1157
+ if (l.length === 0) return /* @__PURE__ */ e(Fe, { title: m, hint: o });
1158
+ const h = (i, v, y) => {
1152
1159
  var g;
1153
1160
  if (i.key === "ArrowDown" || i.key === "ArrowUp")
1154
- i.preventDefault(), (g = f.current[Math.min(n.length - 1, Math.max(0, v + (i.key === "ArrowDown" ? 1 : -1)))]) == null || g.focus();
1161
+ i.preventDefault(), (g = _.current[Math.min(l.length - 1, Math.max(0, v + (i.key === "ArrowDown" ? 1 : -1)))]) == null || g.focus();
1155
1162
  else if (i.key === "Enter")
1156
- h == null || h(y);
1163
+ u == null || u(y);
1157
1164
  else if ((i.key === "ContextMenu" || i.shiftKey && i.key === "F10") && d) {
1158
1165
  i.preventDefault();
1159
1166
  const k = i.currentTarget.getBoundingClientRect();
1160
1167
  d(y, { x: k.left + 16, y: k.bottom });
1161
1168
  }
1162
1169
  };
1163
- return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": l, children: n.map((i, v) => {
1164
- const y = i.id === r;
1170
+ return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((i, v) => {
1171
+ const y = i.id === c;
1165
1172
  return /* @__PURE__ */ s(
1166
1173
  "li",
1167
1174
  {
1168
1175
  ref: (g) => {
1169
- f.current[v] = g;
1176
+ _.current[v] = g;
1170
1177
  },
1171
1178
  role: "option",
1172
1179
  "aria-selected": y,
1173
- tabIndex: y || r == null && v === 0 ? 0 : -1,
1174
- className: M("cms-list__row", y && "is-selected"),
1175
- onClick: () => h == null ? void 0 : h(i.id),
1176
- onKeyDown: (g) => p(g, v, i.id),
1180
+ tabIndex: y || c == null && v === 0 ? 0 : -1,
1181
+ className: C("cms-list__row", y && "is-selected"),
1182
+ onClick: () => u == null ? void 0 : u(i.id),
1183
+ onKeyDown: (g) => h(g, v, i.id),
1177
1184
  onContextMenu: d ? (g) => {
1178
1185
  g.preventDefault(), d(i.id, { x: g.clientX, y: g.clientY });
1179
1186
  } : void 0,
@@ -1190,18 +1197,18 @@ function Al({ label: l, rows: n, error: a, onRetry: t, loadingText: c = "Loading
1190
1197
  );
1191
1198
  }) });
1192
1199
  }
1193
- function je({ at: l, items: n, onClose: a, label: t = "Actions", focus: c = "first" }) {
1194
- const m = z(null), o = z(null), [r, h] = D(l), d = n.filter((p) => p.offer.offered);
1195
- if (ye(() => {
1196
- if (!l) return;
1197
- const p = m.current, i = (p == null ? void 0 : p.offsetWidth) ?? 0, v = (p == null ? void 0 : p.offsetHeight) ?? 0;
1198
- h({ x: Math.max(0, Math.min(l.x, window.innerWidth - i)), y: Math.max(0, Math.min(l.y, window.innerHeight - v)) });
1199
- }, [l]), W(() => {
1200
+ function en({ at: n, items: l, onClose: a, label: t = "Actions", focus: r = "first" }) {
1201
+ const m = O(null), o = O(null), [c, u] = D(n), d = l.filter((h) => h.offer.offered);
1202
+ if (Ae(() => {
1203
+ if (!n) return;
1204
+ const h = m.current, i = (h == null ? void 0 : h.offsetWidth) ?? 0, v = (h == null ? void 0 : h.offsetHeight) ?? 0;
1205
+ u({ x: Math.max(0, Math.min(n.x, window.innerWidth - i)), y: Math.max(0, Math.min(n.y, window.innerHeight - v)) });
1206
+ }, [n]), G(() => {
1200
1207
  var v, y;
1201
- if (!l) return;
1208
+ if (!n) return;
1202
1209
  o.current = document.activeElement;
1203
- const p = Array.from(((v = m.current) == null ? void 0 : v.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
1204
- (y = c === "last" ? p[p.length - 1] : p[0]) == null || y.focus();
1210
+ const h = Array.from(((v = m.current) == null ? void 0 : v.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
1211
+ (y = r === "last" ? h[h.length - 1] : h[0]) == null || y.focus();
1205
1212
  const i = (g) => {
1206
1213
  var k;
1207
1214
  (k = m.current) != null && k.contains(g.target) || a();
@@ -1210,19 +1217,19 @@ function je({ at: l, items: n, onClose: a, label: t = "Actions", focus: c = "fir
1210
1217
  var g, k;
1211
1218
  document.removeEventListener("mousedown", i), (k = (g = o.current) == null ? void 0 : g.focus) == null || k.call(g);
1212
1219
  };
1213
- }, [l, a, c]), !l || d.length === 0) return null;
1214
- const f = (p) => {
1220
+ }, [n, a, r]), !n || d.length === 0) return null;
1221
+ const _ = (h) => {
1215
1222
  var y, g;
1216
1223
  const i = Array.from(((y = m.current) == null ? void 0 : y.querySelectorAll('[role="menuitem"]')) ?? []), v = i.indexOf(document.activeElement);
1217
- if (p.key === "Escape" || p.key === "Tab")
1218
- p.preventDefault(), a();
1219
- else if (p.key === "ArrowDown" || p.key === "ArrowUp") {
1220
- p.preventDefault();
1221
- const k = p.key === "ArrowDown" ? 1 : -1;
1224
+ if (h.key === "Escape" || h.key === "Tab")
1225
+ h.preventDefault(), a();
1226
+ else if (h.key === "ArrowDown" || h.key === "ArrowUp") {
1227
+ h.preventDefault();
1228
+ const k = h.key === "ArrowDown" ? 1 : -1;
1222
1229
  (g = i[(v + k + i.length) % i.length]) == null || g.focus();
1223
1230
  }
1224
1231
  };
1225
- return be(
1232
+ return ke(
1226
1233
  /* @__PURE__ */ e(
1227
1234
  "div",
1228
1235
  {
@@ -1230,32 +1237,32 @@ function je({ at: l, items: n, onClose: a, label: t = "Actions", focus: c = "fir
1230
1237
  className: "cms-menu",
1231
1238
  role: "menu",
1232
1239
  "aria-label": t,
1233
- style: { left: (r ?? l).x, top: (r ?? l).y },
1234
- onKeyDown: f,
1235
- onContextMenu: (p) => p.preventDefault(),
1236
- children: d.map((p) => {
1237
- const i = p.offer.refusal !== void 0;
1240
+ style: { left: (c ?? n).x, top: (c ?? n).y },
1241
+ onKeyDown: _,
1242
+ onContextMenu: (h) => h.preventDefault(),
1243
+ children: d.map((h) => {
1244
+ const i = h.offer.refusal !== void 0;
1238
1245
  return /* @__PURE__ */ s(
1239
1246
  "div",
1240
1247
  {
1241
1248
  role: "menuitem",
1242
1249
  tabIndex: -1,
1243
1250
  "aria-disabled": i || void 0,
1244
- title: i ? p.offer.refusal : void 0,
1245
- className: M("cms-menu__item", p.danger && "is-danger", p.offer.locked && "is-locked", i && "is-refused"),
1251
+ title: i ? h.offer.refusal : void 0,
1252
+ className: C("cms-menu__item", h.danger && "is-danger", h.offer.locked && "is-locked", i && "is-refused"),
1246
1253
  onClick: () => {
1247
- i || (a(), p.onSelect());
1254
+ i || (a(), h.onSelect());
1248
1255
  },
1249
1256
  onKeyDown: (v) => {
1250
- (v.key === "Enter" || v.key === " ") && !i && (v.preventDefault(), a(), p.onSelect());
1257
+ (v.key === "Enter" || v.key === " ") && !i && (v.preventDefault(), a(), h.onSelect());
1251
1258
  },
1252
1259
  children: [
1253
- p.offer.locked ? /* @__PURE__ */ e(F, { name: "lock" }) : null,
1254
- /* @__PURE__ */ e("span", { className: "cms-menu__label", children: p.label }),
1255
- i ? /* @__PURE__ */ e("span", { className: "cms-menu__refusal", children: p.offer.refusal }) : null
1260
+ h.offer.locked ? /* @__PURE__ */ e(F, { name: "lock" }) : null,
1261
+ /* @__PURE__ */ e("span", { className: "cms-menu__label", children: h.label }),
1262
+ i ? /* @__PURE__ */ e("span", { className: "cms-menu__refusal", children: h.offer.refusal }) : null
1256
1263
  ]
1257
1264
  },
1258
- p.id
1265
+ h.id
1259
1266
  );
1260
1267
  })
1261
1268
  }
@@ -1263,65 +1270,78 @@ function je({ at: l, items: n, onClose: a, label: t = "Actions", focus: c = "fir
1263
1270
  document.body
1264
1271
  );
1265
1272
  }
1266
- const Ne = { labels: !0, hidden: /* @__PURE__ */ new Set() };
1267
- function We(l) {
1268
- const n = /* @__PURE__ */ new Map();
1269
- for (const a of l) n.set(a.group, [...n.get(a.group) ?? [], a]);
1270
- return [...n.values()];
1273
+ const Ce = { bare: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Set() }, Se = (n, l) => n.size === l.size && [...n].every((a) => l.has(a));
1274
+ function nn(n) {
1275
+ const l = /* @__PURE__ */ new Map();
1276
+ for (const a of n) l.set(a.group, [...l.get(a.group) ?? [], a]);
1277
+ return [...l.values()];
1271
1278
  }
1272
- function qe(l) {
1273
- const n = /* @__PURE__ */ new Map();
1274
- for (const a of l) a.overflow !== void 0 && n.set(a.overflow, [...n.get(a.overflow) ?? [], a.id]);
1275
- return [...n.entries()].sort(([a], [t]) => a - t).map(([, a]) => a);
1279
+ function ln(n) {
1280
+ const l = /* @__PURE__ */ new Map();
1281
+ for (const a of n) a.overflow !== void 0 && a.overflow !== 0 && l.set(a.overflow, [...l.get(a.overflow) ?? [], a.id]);
1282
+ return [...l.entries()].sort(([a], [t]) => a - t).map(([, a]) => a);
1276
1283
  }
1277
- function Sl({ label: l, actions: n, onAction: a, status: t, moreLabel: c, leading: m }) {
1278
- const o = z(null), r = z(null), [h, d] = D(Ne), [f, p] = D(null), [i, v] = D("first"), [y, g] = D(null), [k, O] = D(null), w = We(n), E = qe(n), A = w.flat(), V = JSON.stringify([n.map((_) => [_.id, _.label, _.icon, _.group, _.overflow ?? null]), t ?? "", m !== void 0]), Z = ie(() => {
1279
- const _ = o.current, x = r.current;
1280
- if (_ === null || x === null) return;
1281
- const K = getComputedStyle(_), G = parseFloat(K.columnGap || "0") || 0, $ = _.clientWidth - (parseFloat(K.paddingLeft) || 0) - (parseFloat(K.paddingRight) || 0), j = (I) => {
1282
- var u;
1283
- return ((u = x.querySelector(I)) == null ? void 0 : u.getBoundingClientRect().width) ?? 0;
1284
- }, X = j('[data-measure="leading"]'), me = j('[data-measure="separator"]'), ce = j('[data-measure="more"]'), ue = (I, u) => j(`[data-measure="${u ? "full" : "icon"}"][data-measure-action="${CSS.escape(I)}"]`), ne = (I, u) => {
1285
- const b = w.map((ae) => ae.filter((he) => !u.has(he.id))).filter((ae) => ae.length > 0), S = b.flat(), R = S.length + (b.length - 1) + (u.size > 0 ? 1 : 0) + (X > 0 ? 1 : 0);
1286
- return X + S.reduce((ae, he) => ae + ue(he.id, I), 0) + me * Math.max(0, b.length - 1) + (u.size > 0 ? ce : 0) + G * Math.max(0, R - 1);
1287
- };
1288
- let Y;
1289
- if (ne(!0, /* @__PURE__ */ new Set()) <= $) Y = Ne;
1290
- else if (ne(!1, /* @__PURE__ */ new Set()) <= $) Y = { labels: !1, hidden: /* @__PURE__ */ new Set() };
1284
+ function Fn({ label: n, actions: l, onAction: a, status: t, moreLabel: r, leading: m }) {
1285
+ const o = O(null), c = O(null), [u, d] = D(Ce), [_, h] = D(null), [i, v] = D("first"), [y, g] = D(null), [k, q] = D(null), w = nn(l), S = ln(l), A = w.flat(), V = A.filter((f) => f.overflow === 0), H = A.filter((f) => f.overflow !== 0), ne = JSON.stringify([l.map((f) => [f.id, f.label, f.icon, f.group, f.overflow ?? null]), t ?? "", m !== void 0]), b = _e(() => {
1286
+ const f = o.current, M = c.current;
1287
+ if (f === null || M === null) return;
1288
+ const R = getComputedStyle(f), W = parseFloat(R.columnGap || "0") || 0, $ = f.clientWidth - (parseFloat(R.paddingLeft) || 0) - (parseFloat(R.paddingRight) || 0), j = (T) => {
1289
+ var K;
1290
+ return ((K = M.querySelector(T)) == null ? void 0 : K.getBoundingClientRect().width) ?? 0;
1291
+ }, oe = j('[data-measure="leading"]'), de = j('[data-measure="separator"]'), me = j('[data-measure="more"]'), ue = (T, K) => j(`[data-measure="${K ? "full" : "icon"}"][data-measure-action="${CSS.escape(T)}"]`), p = (T, K) => {
1292
+ const Y = /* @__PURE__ */ new Set([...V.map((le) => le.id), ...K]), se = w.map((le) => le.filter((pe) => !Y.has(pe.id))).filter((le) => le.length > 0), he = se.flat(), Te = he.length + (se.length - 1) + (Y.size > 0 ? 1 : 0) + (oe > 0 ? 1 : 0);
1293
+ return oe + he.reduce((le, pe) => le + ue(pe.id, !T.has(pe.id)), 0) + de * Math.max(0, se.length - 1) + (Y.size > 0 ? me : 0) + W * Math.max(0, Te - 1);
1294
+ }, N = H.filter((T) => !S.some((K) => K.includes(T.id))).map((T) => T.id), I = [...S, ...[...N].reverse().map((T) => [T])];
1295
+ let B = null;
1296
+ if (p(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= $) B = Ce;
1291
1297
  else {
1292
- const I = /* @__PURE__ */ new Set();
1293
- for (const u of E) {
1294
- for (const b of u) A.some((S) => S.id === b) && I.add(b);
1295
- if (I.size >= 2 && ne(!1, I) <= $) break;
1298
+ const T = /* @__PURE__ */ new Set();
1299
+ for (const K of I) {
1300
+ for (const Y of K) T.add(Y);
1301
+ if (p(T, /* @__PURE__ */ new Set()) <= $) {
1302
+ B = { bare: T, hidden: /* @__PURE__ */ new Set() };
1303
+ break;
1304
+ }
1305
+ }
1306
+ }
1307
+ if (B === null) {
1308
+ const T = new Set(H.map((Y) => Y.id)), K = /* @__PURE__ */ new Set();
1309
+ for (const Y of S) {
1310
+ for (const se of Y) H.some((he) => he.id === se) && K.add(se);
1311
+ if (K.size >= 2 && p(T, K) <= $) break;
1296
1312
  }
1297
- Y = { labels: !1, hidden: I.size >= 2 ? I : /* @__PURE__ */ new Set() };
1313
+ B = { bare: T, hidden: K.size >= 2 ? K : /* @__PURE__ */ new Set() };
1298
1314
  }
1299
- d((I) => I.labels === Y.labels && [...I.hidden].join() === [...Y.hidden].join() ? I : Y);
1300
- }, [V]);
1301
- ye(Z, [Z]), W(() => {
1302
- const _ = o.current;
1303
- if (_ === null || typeof ResizeObserver > "u") return;
1304
- const x = new ResizeObserver(() => Z());
1305
- return x.observe(_), () => x.disconnect();
1306
- }, [Z]);
1307
- const N = w.map((_) => _.filter((x) => !h.hidden.has(x.id))).filter((_) => _.length > 0).flat(), T = E.flat().map((_) => A.find((x) => x.id === _)).filter((_) => _ !== void 0 && h.hidden.has(_.id)), H = new Set(A.filter((_) => !E.some((x) => x.includes(_.id))).map((_) => _.id)), B = [...N.map((_) => _.id), ...T.length > 0 ? ["more"] : []], L = y !== null && B.includes(y) ? y : B[0] ?? null, q = (_) => {
1315
+ const ge = B;
1316
+ d((T) => Se(T.bare, ge.bare) && Se(T.hidden, ge.hidden) ? T : ge);
1317
+ }, [ne]);
1318
+ Ae(b, [b]), G(() => {
1319
+ const f = o.current;
1320
+ if (f === null || typeof ResizeObserver > "u") return;
1321
+ const M = new ResizeObserver(() => b());
1322
+ return M.observe(f), () => M.disconnect();
1323
+ }, [b]);
1324
+ const E = /* @__PURE__ */ new Set([...V.map((f) => f.id), ...u.hidden]), Z = w.map((f) => f.filter((M) => !E.has(M.id))).filter((f) => f.length > 0).flat(), L = [
1325
+ ...V,
1326
+ ...S.flat().map((f) => A.find((M) => M.id === f)).filter((f) => f !== void 0 && u.hidden.has(f.id))
1327
+ ], X = new Set(H.filter((f) => !S.some((M) => M.includes(f.id))).map((f) => f.id)), z = [...Z.map((f) => f.id), ...L.length > 0 ? ["more"] : []], J = y !== null && z.includes(y) ? y : z[0] ?? null, ce = (f) => {
1308
1328
  var $, j;
1309
- const x = B.indexOf(L ?? "");
1310
- let K = null;
1311
- if (_.key === "ArrowRight" ? K = Math.min(B.length - 1, x + 1) : _.key === "ArrowLeft" ? K = Math.max(0, x - 1) : _.key === "Home" ? K = 0 : _.key === "End" ? K = B.length - 1 : _.key === "Escape" && O(L), K === null) return;
1312
- _.preventDefault();
1313
- const G = B[K] ?? null;
1314
- g(G), (j = ($ = o.current) == null ? void 0 : $.querySelector(`[data-stop="${CSS.escape(G ?? "")}"]`)) == null || j.focus();
1315
- }, U = T.map((_) => ({
1316
- id: _.id,
1317
- label: /* @__PURE__ */ s(C, { children: [
1318
- /* @__PURE__ */ e(re, { name: _.icon }),
1319
- _.label
1329
+ const M = z.indexOf(J ?? "");
1330
+ let R = null;
1331
+ if (f.key === "ArrowRight" ? R = Math.min(z.length - 1, M + 1) : f.key === "ArrowLeft" ? R = Math.max(0, M - 1) : f.key === "Home" ? R = 0 : f.key === "End" ? R = z.length - 1 : f.key === "Escape" && q(J), R === null) return;
1332
+ f.preventDefault();
1333
+ const W = z[R] ?? null;
1334
+ g(W), (j = ($ = o.current) == null ? void 0 : $.querySelector(`[data-stop="${CSS.escape(W ?? "")}"]`)) == null || j.focus();
1335
+ }, ie = L.map((f) => ({
1336
+ id: f.id,
1337
+ label: /* @__PURE__ */ s(x, { children: [
1338
+ /* @__PURE__ */ e(fe, { name: f.icon }),
1339
+ f.label
1320
1340
  ] }),
1321
- offer: _.disabled ? { offered: !0, locked: !1, refusal: _.reason ?? "" } : { offered: !0, locked: !1 },
1322
- ..._.danger ? { danger: !0 } : {},
1341
+ offer: f.disabled ? { offered: !0, locked: !1, refusal: f.reason ?? "" } : { offered: !0, locked: !1 },
1342
+ ...f.danger ? { danger: !0 } : {},
1323
1343
  onSelect: () => {
1324
- !_.disabled && !_.busy && a(_.id);
1344
+ !f.disabled && !f.busy && a(f.id);
1325
1345
  }
1326
1346
  }));
1327
1347
  return /* @__PURE__ */ s(
@@ -1329,246 +1349,250 @@ function Sl({ label: l, actions: n, onAction: a, status: t, moreLabel: c, leadin
1329
1349
  {
1330
1350
  ref: o,
1331
1351
  role: "toolbar",
1332
- "aria-label": l,
1333
- className: M("cms-pane-toolbar", !h.labels && "cms-pane-toolbar--labels-hidden"),
1334
- onKeyDown: q,
1352
+ "aria-label": n,
1353
+ className: C(
1354
+ "cms-pane-toolbar",
1355
+ H.length > 0 && u.bare.size >= H.length && "cms-pane-toolbar--labels-hidden",
1356
+ u.bare.size > 0 && u.bare.size < H.length && "cms-pane-toolbar--labels-partly-hidden"
1357
+ ),
1358
+ onKeyDown: ce,
1335
1359
  children: [
1336
1360
  m !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: m }) : null,
1337
- w.map((_, x) => {
1338
- const K = _.filter(($) => !h.hidden.has($.id)), G = w.slice(0, x).some(($) => $.some((j) => !h.hidden.has(j.id)));
1361
+ w.map((f, M) => {
1362
+ const R = f.filter(($) => !E.has($.id)), W = w.slice(0, M).some(($) => $.some((j) => !E.has(j.id)));
1339
1363
  return /* @__PURE__ */ s("div", { className: "cms-pane-toolbar__group-wrap", children: [
1340
- K.length > 0 && G ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
1341
- /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: K.length === 0, children: _.map(($) => /* @__PURE__ */ e(
1342
- Ge,
1364
+ R.length > 0 && W ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
1365
+ /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: R.length === 0, children: f.map(($) => /* @__PURE__ */ e(
1366
+ an,
1343
1367
  {
1344
1368
  action: $,
1345
- labels: h.labels,
1346
- overflowed: h.hidden.has($.id),
1347
- pinned: H.has($.id),
1348
- tabbable: L === $.id,
1369
+ labels: !u.bare.has($.id),
1370
+ overflowed: E.has($.id),
1371
+ pinned: X.has($.id),
1372
+ tabbable: J === $.id,
1349
1373
  tipOff: k === $.id,
1350
1374
  onChoose: () => a($.id),
1351
1375
  onFocus: () => {
1352
- g($.id), O(null);
1376
+ g($.id), q(null);
1353
1377
  }
1354
1378
  },
1355
1379
  $.id
1356
1380
  )) })
1357
- ] }, x);
1381
+ ] }, M);
1358
1382
  }),
1359
- T.length > 0 ? /* @__PURE__ */ e(
1383
+ L.length > 0 ? /* @__PURE__ */ e(
1360
1384
  "button",
1361
1385
  {
1362
1386
  type: "button",
1363
1387
  className: "cms-icon-button cms-pane-toolbar__more",
1364
1388
  "data-stop": "more",
1365
- "aria-label": c,
1366
- title: c,
1389
+ "aria-label": r,
1390
+ title: r,
1367
1391
  "aria-haspopup": "menu",
1368
- "aria-expanded": f !== null,
1369
- tabIndex: L === "more" ? 0 : -1,
1392
+ "aria-expanded": _ !== null,
1393
+ tabIndex: J === "more" ? 0 : -1,
1370
1394
  onFocus: () => g("more"),
1371
- onClick: (_) => {
1372
- const x = _.currentTarget.getBoundingClientRect();
1373
- v("first"), p(f === null ? { x: x.left, y: x.bottom } : null);
1395
+ onClick: (f) => {
1396
+ const M = f.currentTarget.getBoundingClientRect();
1397
+ v("first"), h(_ === null ? { x: M.left, y: M.bottom } : null);
1374
1398
  },
1375
- onKeyDown: (_) => {
1376
- if (_.key === "ArrowDown" || _.key === "ArrowUp") {
1377
- _.preventDefault(), _.stopPropagation();
1378
- const x = _.currentTarget.getBoundingClientRect();
1379
- v(_.key === "ArrowUp" ? "last" : "first"), p({ x: x.left, y: x.bottom });
1399
+ onKeyDown: (f) => {
1400
+ if (f.key === "ArrowDown" || f.key === "ArrowUp") {
1401
+ f.preventDefault(), f.stopPropagation();
1402
+ const M = f.currentTarget.getBoundingClientRect();
1403
+ v(f.key === "ArrowUp" ? "last" : "first"), h({ x: M.left, y: M.bottom });
1380
1404
  }
1381
1405
  },
1382
1406
  children: /* @__PURE__ */ e(P, { name: "more" })
1383
1407
  }
1384
1408
  ) : null,
1385
1409
  t !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: t, children: t }) : null,
1386
- /* @__PURE__ */ e(je, { at: f, items: U, onClose: () => p(null), label: c, focus: i }),
1387
- /* @__PURE__ */ s("div", { ref: r, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
1410
+ /* @__PURE__ */ e(en, { at: _, items: ie, onClose: () => h(null), label: r, focus: i }),
1411
+ /* @__PURE__ */ s("div", { ref: c, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
1388
1412
  m !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: m }) : null,
1389
1413
  /* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
1390
1414
  /* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(P, { name: "more" }) }),
1391
- A.map((_) => /* @__PURE__ */ s("span", { children: [
1392
- /* @__PURE__ */ s("span", { "data-measure": "full", "data-measure-action": _.id, className: "cms-pane-toolbar__action", children: [
1393
- /* @__PURE__ */ e(re, { name: _.icon }),
1394
- /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: _.label })
1415
+ A.map((f) => /* @__PURE__ */ s("span", { children: [
1416
+ /* @__PURE__ */ s("span", { "data-measure": "full", "data-measure-action": f.id, className: "cms-pane-toolbar__action", children: [
1417
+ /* @__PURE__ */ e(fe, { name: f.icon }),
1418
+ /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: f.label })
1395
1419
  ] }),
1396
- /* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": _.id, className: M("cms-pane-toolbar__action", oe(_.icon) !== null && "cms-pane-toolbar__action--icon"), children: oe(_.icon) !== null ? /* @__PURE__ */ e(re, { name: _.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: _.label }) })
1397
- ] }, _.id))
1420
+ /* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": f.id, className: C("cms-pane-toolbar__action", be(f.icon) !== null && "cms-pane-toolbar__action--bare"), children: be(f.icon) !== null ? /* @__PURE__ */ e(fe, { name: f.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: f.label }) })
1421
+ ] }, f.id))
1398
1422
  ] })
1399
1423
  ]
1400
1424
  }
1401
1425
  );
1402
1426
  }
1403
- function Ge({ action: l, labels: n, overflowed: a, pinned: t, tabbable: c, tipOff: m, onChoose: o, onFocus: r }) {
1404
- const [h, d] = D(!1);
1405
- W(() => {
1406
- if (!l.busy) {
1427
+ function an({ action: n, labels: l, overflowed: a, pinned: t, tabbable: r, tipOff: m, onChoose: o, onFocus: c }) {
1428
+ const [u, d] = D(!1);
1429
+ G(() => {
1430
+ if (!n.busy) {
1407
1431
  d(!1);
1408
1432
  return;
1409
1433
  }
1410
- const v = setTimeout(() => d(!0), fe);
1434
+ const v = setTimeout(() => d(!0), ye);
1411
1435
  return () => clearTimeout(v);
1412
- }, [l.busy]);
1413
- const f = oe(l.icon) === null, p = n || f, i = l.disabled && l.reason ? l.reason : p ? null : l.label;
1436
+ }, [n.busy]);
1437
+ const _ = be(n.icon) === null, h = l || _, i = n.disabled && n.reason ? n.reason : h ? null : n.label;
1414
1438
  return /* @__PURE__ */ s(
1415
1439
  "button",
1416
1440
  {
1417
1441
  type: "button",
1418
- className: M("cms-pane-toolbar__action", !p && "cms-pane-toolbar__action--icon", l.danger && "is-danger"),
1419
- "data-action": l.id,
1420
- "data-stop": l.id,
1442
+ className: C("cms-pane-toolbar__action", !h && "cms-pane-toolbar__action--bare", _ && "cms-pane-toolbar__action--text", n.danger && "is-danger"),
1443
+ "data-action": n.id,
1444
+ "data-stop": n.id,
1421
1445
  ...a ? { "data-overflowed": "" } : {},
1422
1446
  ...t ? { "data-pinned": "" } : {},
1423
1447
  hidden: a,
1424
- "aria-label": l.label,
1425
- "aria-disabled": l.disabled || void 0,
1426
- "aria-busy": l.busy || void 0,
1427
- tabIndex: c ? 0 : -1,
1428
- onFocus: r,
1448
+ "aria-label": n.label,
1449
+ "aria-disabled": n.disabled || void 0,
1450
+ "aria-busy": n.busy || void 0,
1451
+ tabIndex: r ? 0 : -1,
1452
+ onFocus: c,
1429
1453
  onClick: () => {
1430
- !l.disabled && !l.busy && o();
1454
+ !n.disabled && !n.busy && o();
1431
1455
  },
1432
1456
  children: [
1433
- h ? /* @__PURE__ */ e(F, { name: "spinner" }) : /* @__PURE__ */ e(re, { name: l.icon }),
1434
- p ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: l.label }) : null,
1457
+ u ? /* @__PURE__ */ e(F, { name: "spinner" }) : /* @__PURE__ */ e(fe, { name: n.icon }),
1458
+ h ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
1435
1459
  i !== null && !m ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", children: i }) : null
1436
1460
  ]
1437
1461
  }
1438
1462
  );
1439
1463
  }
1440
- function re({ name: l }) {
1441
- const n = oe(l);
1442
- return n === null ? null : /* @__PURE__ */ e(P, { name: n, size: 18 });
1464
+ function fe({ name: n }) {
1465
+ const l = be(n);
1466
+ return l === null ? null : /* @__PURE__ */ e(P, { name: l, size: 18 });
1443
1467
  }
1444
- function Xe(l) {
1445
- return l === "allowed" || l === "elevate" || l === "denied";
1468
+ function sn(n) {
1469
+ return n === "allowed" || n === "elevate" || n === "denied";
1446
1470
  }
1447
- function Dl(l, n) {
1448
- if (!Xe(l))
1449
- return n.showRefused ? { offered: !0, locked: !1, refusal: "not available: the server gave an answer this app does not know", unknown: !0 } : { offered: !1, locked: !1, unknown: !0 };
1450
- switch (l) {
1471
+ function zn(n, l) {
1472
+ if (!sn(n))
1473
+ return l.showRefused ? { offered: !0, locked: !1, refusal: "not available: the server gave an answer this app does not know", unknown: !0 } : { offered: !1, locked: !1, unknown: !0 };
1474
+ switch (n) {
1451
1475
  case "allowed":
1452
1476
  return { offered: !0, locked: !1 };
1453
1477
  case "elevate":
1454
- return n.elevates ? { offered: !0, locked: !0 } : { offered: !1, locked: !1 };
1478
+ return l.elevates ? { offered: !0, locked: !0 } : { offered: !1, locked: !1 };
1455
1479
  case "denied":
1456
- return n.showRefused ? { offered: !0, locked: !1, refusal: n.refusal ?? "not allowed" } : { offered: !1, locked: !1 };
1480
+ return l.showRefused ? { offered: !0, locked: !1, refusal: l.refusal ?? "not allowed" } : { offered: !1, locked: !1 };
1457
1481
  }
1458
1482
  }
1459
- function Ye(l, n) {
1460
- if (!l) return;
1461
- if (typeof l.get == "function") return l.get(n) ?? void 0;
1462
- const a = l, t = Object.keys(a).find((c) => c.toLowerCase() === n.toLowerCase());
1483
+ function tn(n, l) {
1484
+ if (!n) return;
1485
+ if (typeof n.get == "function") return n.get(l) ?? void 0;
1486
+ const a = n, t = Object.keys(a).find((r) => r.toLowerCase() === l.toLowerCase());
1463
1487
  return t === void 0 ? void 0 : a[t];
1464
1488
  }
1465
- function Je(l) {
1466
- if (l && typeof l == "object") {
1467
- const n = l;
1468
- if (typeof n.detail == "string" && n.detail !== "") return n.detail;
1469
- if (typeof n.title == "string" && n.title !== "") return n.title;
1489
+ function rn(n) {
1490
+ if (n && typeof n == "object") {
1491
+ const l = n;
1492
+ if (typeof l.detail == "string" && l.detail !== "") return l.detail;
1493
+ if (typeof l.title == "string" && l.title !== "") return l.title;
1470
1494
  }
1471
1495
  }
1472
- function El(l, n, a, t) {
1473
- if (l !== 403) return { kind: "none" };
1474
- const c = Je(a);
1475
- return Ye(n, "X-Elevation-Required") !== void 0 ? t.elevates ? { kind: "elevation-required", message: c ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: c ?? "The server refused this." };
1496
+ function Kn(n, l, a, t) {
1497
+ if (n !== 403) return { kind: "none" };
1498
+ const r = rn(a);
1499
+ return tn(l, "X-Elevation-Required") !== void 0 ? t.elevates ? { kind: "elevation-required", message: r ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: r ?? "The server refused this." };
1476
1500
  }
1477
- const _e = "coolms-kit:reread";
1478
- function Ll() {
1479
- window.dispatchEvent(new Event(_e));
1501
+ const we = "coolms-kit:reread";
1502
+ function Hn() {
1503
+ window.dispatchEvent(new Event(we));
1480
1504
  }
1481
- function $l(l) {
1482
- const [n, a] = D(void 0), [t, c] = D(void 0), [m, o] = D(!0), r = z(l);
1483
- r.current = l;
1484
- const h = z(0), d = ie(() => {
1485
- const f = ++h.current;
1486
- o(!0), r.current().then(
1487
- (p) => {
1488
- f === h.current && (a(p), c(void 0), o(!1));
1505
+ function Rn(n) {
1506
+ const [l, a] = D(void 0), [t, r] = D(void 0), [m, o] = D(!0), c = O(n);
1507
+ c.current = n;
1508
+ const u = O(0), d = _e(() => {
1509
+ const _ = ++u.current;
1510
+ o(!0), c.current().then(
1511
+ (h) => {
1512
+ _ === u.current && (a(h), r(void 0), o(!1));
1489
1513
  },
1490
- (p) => {
1491
- f === h.current && (c(p), o(!1));
1514
+ (h) => {
1515
+ _ === u.current && (r(h), o(!1));
1492
1516
  }
1493
1517
  );
1494
1518
  }, []);
1495
- return W(() => {
1519
+ return G(() => {
1496
1520
  d();
1497
- const f = () => d();
1498
- return window.addEventListener("focus", f), window.addEventListener(_e, f), () => {
1499
- window.removeEventListener("focus", f), window.removeEventListener(_e, f);
1521
+ const _ = () => d();
1522
+ return window.addEventListener("focus", _), window.addEventListener(we, _), () => {
1523
+ window.removeEventListener("focus", _), window.removeEventListener(we, _);
1500
1524
  };
1501
- }, [d]), { value: n, error: t, loading: m, reread: d };
1525
+ }, [d]), { value: l, error: t, loading: m, reread: d };
1502
1526
  }
1503
- function Tl(l) {
1504
- return l === 412 ? { conflict: !0, message: "Someone changed this since you opened it. Nothing was saved; read it again to see the change." } : { conflict: !1 };
1527
+ function On(n) {
1528
+ 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 };
1505
1529
  }
1506
- const Qe = "/errors/client-update-required";
1507
- function el(l, n) {
1508
- const a = l.split(".").map((c) => Number.parseInt(c, 10) || 0), t = n.split(".").map((c) => Number.parseInt(c, 10) || 0);
1509
- for (let c = 0; c < Math.max(a.length, t.length); c++) {
1510
- const m = a[c] ?? 0, o = t[c] ?? 0;
1530
+ const cn = "/errors/client-update-required";
1531
+ function on(n, l) {
1532
+ const a = n.split(".").map((r) => Number.parseInt(r, 10) || 0), t = l.split(".").map((r) => Number.parseInt(r, 10) || 0);
1533
+ for (let r = 0; r < Math.max(a.length, t.length); r++) {
1534
+ const m = a[r] ?? 0, o = t[r] ?? 0;
1511
1535
  if (m !== o) return m < o;
1512
1536
  }
1513
1537
  return !1;
1514
1538
  }
1515
- function Pl(l) {
1516
- return l.problemType !== void 0 && l.problemType.endsWith(Qe) ? !0 : l.minimumVersion !== void 0 && el(l.version, l.minimumVersion);
1539
+ function Zn(n) {
1540
+ return n.problemType !== void 0 && n.problemType.endsWith(cn) ? !0 : n.minimumVersion !== void 0 && on(n.version, n.minimumVersion);
1517
1541
  }
1518
1542
  export {
1519
- fl as AppShell,
1520
- de as Avatar,
1521
- ge as BOOTSTRAP_ICONS,
1522
- Oe as Badge,
1523
- J as Button,
1524
- ve as CALL_LABELS,
1525
- Qe as CLIENT_UPDATE_REQUIRED,
1526
- xl as CallBar,
1527
- kl as CallPanel,
1528
- Nl as ChatBubble,
1529
- yl as Composer,
1530
- rl as ConfirmDialog,
1531
- je as ContextMenu,
1532
- De as EmptyState,
1533
- Ee as ErrorBanner,
1534
- ul as FilePicker,
1535
- Ke as FilePickerDenied,
1536
- ml as FileViewer,
1537
- bl as FilterChips,
1538
- dl as ICON_NAMES,
1543
+ xn as AppShell,
1544
+ ve as Avatar,
1545
+ Me as BOOTSTRAP_ICONS,
1546
+ Ye as Badge,
1547
+ Q as Button,
1548
+ xe as CALL_LABELS,
1549
+ cn as CLIENT_UPDATE_REQUIRED,
1550
+ Tn as CallBar,
1551
+ $n as CallPanel,
1552
+ Dn as ChatBubble,
1553
+ En as Composer,
1554
+ _n as ConfirmDialog,
1555
+ en as ContextMenu,
1556
+ Fe as EmptyState,
1557
+ ze as ErrorBanner,
1558
+ yn as FilePicker,
1559
+ We as FilePickerDenied,
1560
+ Nn as FileViewer,
1561
+ Cn as FilterChips,
1562
+ gn as ICON_NAMES,
1539
1563
  P as Icon,
1540
- wl as IncomingCall,
1541
- Al as List,
1542
- Se as Loading,
1543
- Ve as MAIL_ROW_LABELS,
1544
- Ae as MODAL_CLOSE_MS,
1545
- gl as MailRow,
1546
- xe as Modal,
1547
- hl as PageHeader,
1548
- Sl as PaneToolbar,
1549
- Ue as SIGN_IN_LABELS,
1550
- fe as STATE_DELAY_MS,
1551
- _l as SearchField,
1552
- tl as Select,
1553
- Ml as SignInForm,
1554
- Cl as SignInLayout,
1555
- vl as SplitPanes,
1556
- se as State,
1557
- pl as TabStrip,
1558
- sl as TextField,
1559
- il as Toast,
1560
- ol as ToastRegion,
1561
- cl as Toggle,
1562
- oe as iconForName,
1563
- Re as initialsOf,
1564
- Xe as isCapability,
1565
- Pl as needsClientUpdate,
1566
- Dl as offerFor,
1567
- Tl as readConflict,
1568
- El as readRefusal,
1569
- Je as refusalText,
1570
- Ll as rereadAll,
1571
- Ze as tintOf,
1572
- $l as useReread,
1573
- el as versionBelow
1564
+ Ln as IncomingCall,
1565
+ Bn as List,
1566
+ Be as Loading,
1567
+ Je as MAIL_ROW_LABELS,
1568
+ Pe as MODAL_CLOSE_MS,
1569
+ An as MailRow,
1570
+ Le as Modal,
1571
+ wn as PageHeader,
1572
+ Fn as PaneToolbar,
1573
+ Qe as SIGN_IN_LABELS,
1574
+ ye as STATE_DELAY_MS,
1575
+ Mn as SearchField,
1576
+ pn as Select,
1577
+ Pn as SignInForm,
1578
+ In as SignInLayout,
1579
+ Sn as SplitPanes,
1580
+ te as State,
1581
+ kn as TabStrip,
1582
+ hn as TextField,
1583
+ bn as Toast,
1584
+ vn as ToastRegion,
1585
+ fn as Toggle,
1586
+ be as iconForName,
1587
+ Ge as initialsOf,
1588
+ sn as isCapability,
1589
+ Zn as needsClientUpdate,
1590
+ zn as offerFor,
1591
+ On as readConflict,
1592
+ Kn as readRefusal,
1593
+ rn as refusalText,
1594
+ Hn as rereadAll,
1595
+ Xe as tintOf,
1596
+ Rn as useReread,
1597
+ on as versionBelow
1574
1598
  };