@coolms/ui-react 0.1.0-alpha.40 → 0.1.0-alpha.43

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,250 +1,78 @@
1
- import { jsx as e, jsxs as c, Fragment as $ } from "react/jsx-runtime";
2
- import { useId as fe, useState as D, useRef as P, useEffect as ee, useCallback as Ie, useMemo as Ln, useContext as Dn, createContext as In, useLayoutEffect as $e, Fragment as $n } from "react";
3
- import { createPortal as ln } from "react-dom";
4
- function qe(n, t) {
5
- const l = { ...n };
6
- for (const r of Object.keys(t ?? {})) {
7
- const s = t == null ? void 0 : t[r];
8
- s !== void 0 && (l[r] = s);
1
+ import { jsx as n, jsxs as f, Fragment as ge } from "react/jsx-runtime";
2
+ import { createElement as $n, useId as he, useState as D, useRef as O, useEffect as Q, useCallback as Ie, useMemo as Bn, useContext as Fn, createContext as Rn, useLayoutEffect as $e, Fragment as Hn } from "react";
3
+ import { createPortal as an } from "react-dom";
4
+ function qe(e, t) {
5
+ const l = { ...e };
6
+ for (const s of Object.keys(t ?? {})) {
7
+ const a = t == null ? void 0 : t[s];
8
+ a !== void 0 && (l[s] = a);
9
9
  }
10
10
  return l;
11
11
  }
12
- function H(...n) {
13
- return n.filter(Boolean).join(" ");
12
+ function F(...e) {
13
+ return e.filter(Boolean).join(" ");
14
14
  }
15
- function re({ name: n }) {
15
+ function se({ name: e }) {
16
16
  const t = { width: 16, height: 16, viewBox: "0 0 16 16", "aria-hidden": !0, focusable: !1 };
17
- switch (n) {
17
+ switch (e) {
18
18
  case "lock":
19
- return /* @__PURE__ */ e("svg", { ...t, 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__ */ n("svg", { ...t, className: "cms-glyph", children: /* @__PURE__ */ n("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", { ...t, 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__ */ n("svg", { ...t, className: "cms-glyph cms-spinner", children: /* @__PURE__ */ n("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", { ...t, 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__ */ n("svg", { ...t, className: "cms-glyph", children: /* @__PURE__ */ n("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", { ...t, 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__ */ n("svg", { ...t, className: "cms-glyph", children: /* @__PURE__ */ n("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", { ...t, 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__ */ n("svg", { ...t, className: "cms-glyph", children: /* @__PURE__ */ n("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", { ...t, 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__ */ n("svg", { ...t, className: "cms-glyph", children: /* @__PURE__ */ n("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", { ...t, 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__ */ n("svg", { ...t, className: "cms-glyph", children: /* @__PURE__ */ n("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
34
  function De({
35
- variant: n = "secondary",
35
+ variant: e = "secondary",
36
36
  busy: t = !1,
37
37
  busyLabel: l,
38
- locked: r = !1,
39
- lockedReason: s,
40
- icon: a,
38
+ locked: s = !1,
39
+ lockedReason: a,
40
+ icon: i,
41
41
  disabled: h,
42
42
  className: d,
43
- children: m,
43
+ children: u,
44
44
  type: b = "button",
45
- title: i,
46
- ...g
45
+ title: c,
46
+ ...v
47
47
  }) {
48
- const f = !!h || t;
49
- return /* @__PURE__ */ c(
48
+ const m = !!h || t;
49
+ return /* @__PURE__ */ f(
50
50
  "button",
51
51
  {
52
- ...g,
52
+ ...v,
53
53
  type: b,
54
- className: H("cms-button", `cms-button--${n}`, t && "is-busy", r && "is-locked", d),
55
- disabled: f,
54
+ className: F("cms-button", `cms-button--${e}`, t && "is-busy", s && "is-locked", d),
55
+ disabled: m,
56
56
  "aria-busy": t || void 0,
57
- title: r ? s ?? i : i,
57
+ title: s ? a ?? c : c,
58
58
  children: [
59
- t ? /* @__PURE__ */ e(re, { name: "spinner" }) : r ? /* @__PURE__ */ e(re, { name: "lock" }) : a,
60
- /* @__PURE__ */ e("span", { className: "cms-button__label", children: t && l !== void 0 ? l : m }),
61
- r && s ? /* @__PURE__ */ c("span", { className: "cms-visually-hidden", children: [
59
+ t ? /* @__PURE__ */ n(se, { name: "spinner" }) : s ? /* @__PURE__ */ n(se, { name: "lock" }) : i,
60
+ /* @__PURE__ */ n("span", { className: "cms-button__label", children: t && l !== void 0 ? l : u }),
61
+ s && a ? /* @__PURE__ */ f("span", { className: "cms-visually-hidden", children: [
62
62
  ", ",
63
- s
63
+ a
64
64
  ] }) : null
65
65
  ]
66
66
  }
67
67
  );
68
68
  }
69
- const kn = {
70
- mail: /* @__PURE__ */ c($, { children: [
71
- /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
72
- /* @__PURE__ */ e("path", { d: "m3 7 9 6 9-6" })
73
- ] }),
74
- // A gear: a ring with eight short teeth, the hole in its middle.
75
- settings: /* @__PURE__ */ c($, { children: [
76
- /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" }),
77
- /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "7" }),
78
- /* @__PURE__ */ e("path", { d: "M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9 7 7M17 17l2.1 2.1M4.9 19.1 7 17M17 7l2.1-2.1" })
79
- ] }),
80
- // The envelope with its flap open above it: a message read, or the message itself again.
81
- "mail-open": /* @__PURE__ */ c($, { children: [
82
- /* @__PURE__ */ e("path", { d: "M3 10v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9" }),
83
- /* @__PURE__ */ e("path", { d: "m3 10 9-6 9 6" }),
84
- /* @__PURE__ */ e("path", { d: "m3 10 9 6 9-6" })
85
- ] }),
86
- // A clipboard: copy what is shown.
87
- copy: /* @__PURE__ */ c($, { children: [
88
- /* @__PURE__ */ e("rect", { x: "6", y: "4", width: "12", height: "17", rx: "2" }),
89
- /* @__PURE__ */ e("path", { d: "M9 4V3h6v1" }),
90
- /* @__PURE__ */ e("path", { d: "M9 10h6M9 14h6M9 18h3" })
91
- ] }),
92
- chat: /* @__PURE__ */ e("path", { d: "M4 12a8 8 0 1 1 4 6.9L4 20l1.1-4A8 8 0 0 1 4 12Z" }),
93
- 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" }),
94
- calendar: /* @__PURE__ */ c($, { children: [
95
- /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "16", rx: "2" }),
96
- /* @__PURE__ */ e("path", { d: "M3 10h18M8 3v4M16 3v4" })
97
- ] }),
98
- file: /* @__PURE__ */ c($, { children: [
99
- /* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
100
- /* @__PURE__ */ e("path", { d: "M14 3v6h6M8 13h8M8 17h6" })
101
- ] }),
102
- // The file, with code's angle brackets in place of its lines: a message's source.
103
- "file-code": /* @__PURE__ */ c($, { children: [
104
- /* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
105
- /* @__PURE__ */ e("path", { d: "M14 3v6h6" }),
106
- /* @__PURE__ */ e("path", { d: "m10 12-2 2.5 2 2.5M14 12l2 2.5-2 2.5" })
107
- ] }),
108
- image: /* @__PURE__ */ c($, { children: [
109
- /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
110
- /* @__PURE__ */ e("circle", { cx: "9", cy: "10", r: "2" }),
111
- /* @__PURE__ */ e("path", { d: "m21 17-5-5-9 8" })
112
- ] }),
113
- search: /* @__PURE__ */ c($, { children: [
114
- /* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "7" }),
115
- /* @__PURE__ */ e("path", { d: "m20 20-4-4" })
116
- ] }),
117
- bell: /* @__PURE__ */ c($, { children: [
118
- /* @__PURE__ */ e("path", { d: "M6 9a6 6 0 1 1 12 0c0 6 2 8 2 8H4s2-2 2-8Z" }),
119
- /* @__PURE__ */ e("path", { d: "M10 20a2 2 0 0 0 4 0" })
120
- ] }),
121
- pencil: /* @__PURE__ */ c($, { children: [
122
- /* @__PURE__ */ e("path", { d: "M4 20h4L19 9l-4-4L4 16Z" }),
123
- /* @__PURE__ */ e("path", { d: "m13 7 4 4" })
124
- ] }),
125
- download: /* @__PURE__ */ c($, { children: [
126
- /* @__PURE__ */ e("path", { d: "M12 4v11" }),
127
- /* @__PURE__ */ e("path", { d: "m7 11 5 5 5-5" }),
128
- /* @__PURE__ */ e("path", { d: "M4 20h16" })
129
- ] }),
130
- // Download's arrow turned up, from the line: a file sent up.
131
- upload: /* @__PURE__ */ c($, { children: [
132
- /* @__PURE__ */ e("path", { d: "M12 20V9" }),
133
- /* @__PURE__ */ e("path", { d: "m7 13 5-5 5 5" }),
134
- /* @__PURE__ */ e("path", { d: "M4 4h16" })
135
- ] }),
136
- print: /* @__PURE__ */ c($, { children: [
137
- /* @__PURE__ */ e("path", { d: "M7 8V4h10v4" }),
138
- /* @__PURE__ */ e("rect", { x: "3", y: "8", width: "18", height: "8", rx: "2" }),
139
- /* @__PURE__ */ e("path", { d: "M7 14h10v6H7Z" })
140
- ] }),
141
- "open-separately": /* @__PURE__ */ c($, { children: [
142
- /* @__PURE__ */ e("path", { d: "M14 4h6v6" }),
143
- /* @__PURE__ */ e("path", { d: "m20 4-9 9" }),
144
- /* @__PURE__ */ e("path", { d: "M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5" })
145
- ] }),
146
- 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" }),
147
- send: /* @__PURE__ */ c($, { children: [
148
- /* @__PURE__ */ e("path", { d: "M21 3 10 14" }),
149
- /* @__PURE__ */ e("path", { d: "M21 3 14 21l-4-7-7-4Z" })
150
- ] }),
151
- inbox: /* @__PURE__ */ c($, { children: [
152
- /* @__PURE__ */ e("path", { d: "M3 13h5l1 3h6l1-3h5" }),
153
- /* @__PURE__ */ e("path", { d: "M5 5h14l2 8v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" })
154
- ] }),
155
- archive: /* @__PURE__ */ c($, { children: [
156
- /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "5", rx: "1" }),
157
- /* @__PURE__ */ e("path", { d: "M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4" })
158
- ] }),
159
- trash: /* @__PURE__ */ c($, { children: [
160
- /* @__PURE__ */ e("path", { d: "M4 7h16M10 11v6M14 11v6" }),
161
- /* @__PURE__ */ e("path", { d: "M6 7l1 13a2 2 0 0 0 2 1h6a2 2 0 0 0 2-1l1-13M9 7V4h6v3" })
162
- ] }),
163
- 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" }),
164
- mic: /* @__PURE__ */ c($, { children: [
165
- /* @__PURE__ */ e("rect", { x: "9", y: "3", width: "6", height: "11", rx: "3" }),
166
- /* @__PURE__ */ e("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v3" })
167
- ] }),
168
- speaker: /* @__PURE__ */ c($, { children: [
169
- /* @__PURE__ */ e("path", { d: "M4 9h4l5-4v14l-5-4H4Z" }),
170
- /* @__PURE__ */ e("path", { d: "M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12" })
171
- ] }),
172
- "user-plus": /* @__PURE__ */ c($, { children: [
173
- /* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
174
- /* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M19 8v6M16 11h6" })
175
- ] }),
176
- // A person, nothing more: one whose account is gone.
177
- user: /* @__PURE__ */ c($, { children: [
178
- /* @__PURE__ */ e("circle", { cx: "12", cy: "8", r: "4" }),
179
- /* @__PURE__ */ e("path", { d: "M4 21a8 8 0 0 1 16 0" })
180
- ] }),
181
- // A person with a tick: someone allowed.
182
- "user-check": /* @__PURE__ */ c($, { children: [
183
- /* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
184
- /* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M16 11l2 2 4-4" })
185
- ] }),
186
- // A person with a cross: someone no longer allowed.
187
- "user-x": /* @__PURE__ */ c($, { children: [
188
- /* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
189
- /* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M17 8l4 4M21 8l-4 4" })
190
- ] }),
191
- // Two people: the members of a group.
192
- users: /* @__PURE__ */ c($, { children: [
193
- /* @__PURE__ */ e("circle", { cx: "9", cy: "8", r: "3.5" }),
194
- /* @__PURE__ */ e("path", { d: "M2.5 20a6.5 6.5 0 0 1 13 0M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14a6.5 6.5 0 0 1 3.5 6" })
195
- ] }),
196
- "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" }),
197
- video: /* @__PURE__ */ c($, { children: [
198
- /* @__PURE__ */ e("rect", { x: "3", y: "6", width: "13", height: "12", rx: "2" }),
199
- /* @__PURE__ */ e("path", { d: "m16 10 5-3v10l-5-3" })
200
- ] }),
201
- info: /* @__PURE__ */ c($, { children: [
202
- /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
203
- /* @__PURE__ */ e("path", { d: "M12 11v6M12 7.5v.5" })
204
- ] }),
205
- "chevron-down": /* @__PURE__ */ e("path", { d: "m6 9 6 6 6-6" }),
206
- "chevron-left": /* @__PURE__ */ e("path", { d: "m15 18-6-6 6-6" }),
207
- plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
208
- 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" }),
209
- // The folder with a plus inside: a new folder.
210
- "folder-plus": /* @__PURE__ */ c($, { children: [
211
- /* @__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" }),
212
- /* @__PURE__ */ e("path", { d: "M12 10.5v6M9 13.5h6" })
213
- ] }),
214
- // The folder with a cross inside: a folder removed.
215
- "folder-x": /* @__PURE__ */ c($, { children: [
216
- /* @__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" }),
217
- /* @__PURE__ */ e("path", { d: "m9.5 11 5 5M14.5 11l-5 5" })
218
- ] }),
219
- check: /* @__PURE__ */ e("path", { d: "m5 12 5 5 9-10" }),
220
- server: /* @__PURE__ */ c($, { children: [
221
- /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "7", rx: "2" }),
222
- /* @__PURE__ */ e("rect", { x: "3", y: "13", width: "18", height: "7", rx: "2" }),
223
- /* @__PURE__ */ e("path", { d: "M7 7.5h.5M7 16.5h.5" })
224
- ] }),
225
- reply: /* @__PURE__ */ e("path", { d: "M10 8 4 13l6 5M4 13h11a5 5 0 0 1 5 5" }),
226
- // Reply's mirror: the arrow leaves to the right.
227
- forward: /* @__PURE__ */ e("path", { d: "m14 8 6 5-6 5M20 13H9a5 5 0 0 0-5 5" }),
228
- refresh: /* @__PURE__ */ e("path", { d: "M20 11a8 8 0 1 0-2.3 5.7M20 5v6h-6" }),
229
- more: /* @__PURE__ */ e("path", { d: "M5 12h.5M12 12h.5M19 12h.5" }),
230
- // A number sign: a channel, by its name.
231
- hash: /* @__PURE__ */ e("path", { d: "M10 4 8 20M16 4l-2 16M5 9h15M4 15h15" }),
232
- // A funnel: a list's filter.
233
- funnel: /* @__PURE__ */ e("path", { d: "M4 5h16l-6 8v6l-4-2v-4Z" }),
234
- // An eye: what is hidden is shown. Struck through: it is hidden again.
235
- eye: /* @__PURE__ */ c($, { children: [
236
- /* @__PURE__ */ e("path", { d: "M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z" }),
237
- /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
238
- ] }),
239
- "eye-off": /* @__PURE__ */ c($, { children: [
240
- /* @__PURE__ */ e("path", { d: "M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z" }),
241
- /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" }),
242
- /* @__PURE__ */ e("path", { d: "m4 4 16 16" })
243
- ] }),
244
- important: /* @__PURE__ */ e("path", { d: "M4 6h11l5 6-5 6H4l4-6-4-6Z" })
245
- };
246
- function B({ name: n, size: t = 20, label: l }) {
247
- return /* @__PURE__ */ e(
69
+ const On = { width: 1.75, linecap: "round", linejoin: "round" }, Pn = { mail: { parts: [{ tag: "rect", x: "3", y: "5", width: "18", height: "14", rx: "2" }, { tag: "path", d: "m3 7 9 6 9-6" }] }, settings: { note: "A gear: a ring with eight short teeth, the hole in its middle.", parts: [{ tag: "circle", cx: "12", cy: "12", r: "3" }, { tag: "circle", cx: "12", cy: "12", r: "7" }, { tag: "path", d: "M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9 7 7M17 17l2.1 2.1M4.9 19.1 7 17M17 7l2.1-2.1" }] }, "mail-open": { note: "The envelope with its flap open above it: a message read, or the message itself again.", parts: [{ tag: "path", d: "M3 10v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9" }, { tag: "path", d: "m3 10 9-6 9 6" }, { tag: "path", d: "m3 10 9 6 9-6" }] }, copy: { note: "A clipboard: copy what is shown.", parts: [{ tag: "rect", x: "6", y: "4", width: "12", height: "17", rx: "2" }, { tag: "path", d: "M9 4V3h6v1" }, { tag: "path", d: "M9 10h6M9 14h6M9 18h3" }] }, chat: { parts: [{ tag: "path", d: "M4 12a8 8 0 1 1 4 6.9L4 20l1.1-4A8 8 0 0 1 4 12Z" }] }, phone: { parts: [{ tag: "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" }] }, calendar: { parts: [{ tag: "rect", x: "3", y: "5", width: "18", height: "16", rx: "2" }, { tag: "path", d: "M3 10h18M8 3v4M16 3v4" }] }, file: { parts: [{ tag: "path", d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }, { tag: "path", d: "M14 3v6h6M8 13h8M8 17h6" }] }, "file-code": { note: "The file, with code's angle brackets in place of its lines: a message's source.", parts: [{ tag: "path", d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }, { tag: "path", d: "M14 3v6h6" }, { tag: "path", d: "m10 12-2 2.5 2 2.5M14 12l2 2.5-2 2.5" }] }, image: { parts: [{ tag: "rect", x: "3", y: "4", width: "18", height: "16", rx: "2" }, { tag: "circle", cx: "9", cy: "10", r: "2" }, { tag: "path", d: "m21 17-5-5-9 8" }] }, search: { parts: [{ tag: "circle", cx: "11", cy: "11", r: "7" }, { tag: "path", d: "m20 20-4-4" }] }, bell: { parts: [{ tag: "path", d: "M6 9a6 6 0 1 1 12 0c0 6 2 8 2 8H4s2-2 2-8Z" }, { tag: "path", d: "M10 20a2 2 0 0 0 4 0" }] }, pencil: { parts: [{ tag: "path", d: "M4 20h4L19 9l-4-4L4 16Z" }, { tag: "path", d: "m13 7 4 4" }] }, download: { parts: [{ tag: "path", d: "M12 4v11" }, { tag: "path", d: "m7 11 5 5 5-5" }, { tag: "path", d: "M4 20h16" }] }, upload: { note: "Download's arrow turned up, from the line: a file sent up.", parts: [{ tag: "path", d: "M12 20V9" }, { tag: "path", d: "m7 13 5-5 5 5" }, { tag: "path", d: "M4 4h16" }] }, print: { parts: [{ tag: "path", d: "M7 8V4h10v4" }, { tag: "rect", x: "3", y: "8", width: "18", height: "8", rx: "2" }, { tag: "path", d: "M7 14h10v6H7Z" }] }, "open-separately": { parts: [{ tag: "path", d: "M14 4h6v6" }, { tag: "path", d: "m20 4-9 9" }, { tag: "path", d: "M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5" }] }, star: { parts: [{ tag: "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" }] }, send: { parts: [{ tag: "path", d: "M21 3 10 14" }, { tag: "path", d: "M21 3 14 21l-4-7-7-4Z" }] }, inbox: { parts: [{ tag: "path", d: "M3 13h5l1 3h6l1-3h5" }, { tag: "path", d: "M5 5h14l2 8v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" }] }, archive: { parts: [{ tag: "rect", x: "3", y: "4", width: "18", height: "5", rx: "1" }, { tag: "path", d: "M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4" }] }, trash: { parts: [{ tag: "path", d: "M4 7h16M10 11v6M14 11v6" }, { tag: "path", d: "M6 7l1 13a2 2 0 0 0 2 1h6a2 2 0 0 0 2-1l1-13M9 7V4h6v3" }] }, paperclip: { parts: [{ tag: "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" }] }, mic: { parts: [{ tag: "rect", x: "9", y: "3", width: "6", height: "11", rx: "3" }, { tag: "path", d: "M5 11a7 7 0 0 0 14 0M12 18v3" }] }, speaker: { parts: [{ tag: "path", d: "M4 9h4l5-4v14l-5-4H4Z" }, { tag: "path", d: "M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12" }] }, "user-plus": { parts: [{ tag: "circle", cx: "10", cy: "8", r: "4" }, { tag: "path", d: "M3 21a7 7 0 0 1 14 0M19 8v6M16 11h6" }] }, user: { note: "A person, nothing more: one whose account is gone.", parts: [{ tag: "circle", cx: "12", cy: "8", r: "4" }, { tag: "path", d: "M4 21a8 8 0 0 1 16 0" }] }, "user-check": { note: "A person with a tick: someone allowed.", parts: [{ tag: "circle", cx: "10", cy: "8", r: "4" }, { tag: "path", d: "M3 21a7 7 0 0 1 14 0M16 11l2 2 4-4" }] }, "user-x": { note: "A person with a cross: someone no longer allowed.", parts: [{ tag: "circle", cx: "10", cy: "8", r: "4" }, { tag: "path", d: "M3 21a7 7 0 0 1 14 0M17 8l4 4M21 8l-4 4" }] }, users: { note: "Two people: the members of a group.", parts: [{ tag: "circle", cx: "9", cy: "8", r: "3.5" }, { tag: "path", d: "M2.5 20a6.5 6.5 0 0 1 13 0M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14a6.5 6.5 0 0 1 3.5 6" }] }, "phone-off": { parts: [{ tag: "path", d: "M3 14c5-5 13-5 18 0l-2 3-4-1v-3a10 10 0 0 0-6 0v3l-4 1Z" }] }, video: { parts: [{ tag: "rect", x: "3", y: "6", width: "13", height: "12", rx: "2" }, { tag: "path", d: "m16 10 5-3v10l-5-3" }] }, info: { parts: [{ tag: "circle", cx: "12", cy: "12", r: "9" }, { tag: "path", d: "M12 11v6M12 7.5v.5" }] }, "chevron-down": { parts: [{ tag: "path", d: "m6 9 6 6 6-6" }] }, "chevron-left": { parts: [{ tag: "path", d: "m15 18-6-6 6-6" }] }, plus: { parts: [{ tag: "path", d: "M12 5v14M5 12h14" }] }, folder: { parts: [{ tag: "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" }] }, "folder-plus": { note: "The folder with a plus inside: a new folder.", parts: [{ tag: "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" }, { tag: "path", d: "M12 10.5v6M9 13.5h6" }] }, "folder-x": { note: "The folder with a cross inside: a folder removed.", parts: [{ tag: "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" }, { tag: "path", d: "m9.5 11 5 5M14.5 11l-5 5" }] }, check: { parts: [{ tag: "path", d: "m5 12 5 5 9-10" }] }, server: { parts: [{ tag: "rect", x: "3", y: "4", width: "18", height: "7", rx: "2" }, { tag: "rect", x: "3", y: "13", width: "18", height: "7", rx: "2" }, { tag: "path", d: "M7 7.5h.5M7 16.5h.5" }] }, reply: { parts: [{ tag: "path", d: "M10 8 4 13l6 5M4 13h11a5 5 0 0 1 5 5" }] }, forward: { note: "Reply's mirror: the arrow leaves to the right.", parts: [{ tag: "path", d: "m14 8 6 5-6 5M20 13H9a5 5 0 0 0-5 5" }] }, refresh: { parts: [{ tag: "path", d: "M20 11a8 8 0 1 0-2.3 5.7M20 5v6h-6" }] }, more: { parts: [{ tag: "path", d: "M5 12h.5M12 12h.5M19 12h.5" }], strokeWidth: 3 }, hash: { note: "A number sign: a channel, by its name.", parts: [{ tag: "path", d: "M10 4 8 20M16 4l-2 16M5 9h15M4 15h15" }] }, funnel: { note: "A funnel: a list's filter.", parts: [{ tag: "path", d: "M4 5h16l-6 8v6l-4-2v-4Z" }] }, eye: { note: "An eye: what is hidden is shown. Struck through: it is hidden again.", parts: [{ tag: "path", d: "M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z" }, { tag: "circle", cx: "12", cy: "12", r: "3" }] }, "eye-off": { parts: [{ tag: "path", d: "M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z" }, { tag: "circle", cx: "12", cy: "12", r: "3" }, { tag: "path", d: "m4 4 16 16" }] }, important: { parts: [{ tag: "path", d: "M4 6h11l5 6-5 6H4l4-6-4-6Z" }] } }, zn = { reply: "reply", "reply-all": "reply", forward: "forward", envelope: "mail", "envelope-open": "mail-open", star: "star", "star-fill": "star", "folder-symlink": "folder", folder: "folder", trash: "trash", archive: "archive", "arrow-clockwise": "refresh", download: "download", printer: "print", "file-earmark-code": "file-code", clipboard: "copy", "three-dots": "more", pencil: "pencil", trash3: "trash", "folder-plus": "folder-plus", "folder-x": "folder-x", image: "image", "person-check": "user-check", "person-x": "user-x", "arrow-left": "chevron-left", "pencil-square": "pencil", "plus-lg": "plus", gear: "settings", upload: "upload", "cloud-upload": "upload", people: "users", "file-earmark-word": "file", "file-earmark-spreadsheet": "file", "file-earmark-text": "file", folder2: "folder", "folder2-open": "folder", "chat-dots": "chat", images: "image", paperclip: "paperclip", hash: "hash", funnel: "funnel", eye: "eye", "eye-slash": "eye-off", inbox: "inbox", bell: "bell" }, rn = {
70
+ stroke: On,
71
+ icons: Pn,
72
+ bootstrap: zn
73
+ }, Qe = rn.icons, Xe = rn.stroke;
74
+ function $({ name: e, size: t = 20, label: l }) {
75
+ return /* @__PURE__ */ n(
248
76
  "svg",
249
77
  {
250
78
  className: "cms-icon",
@@ -253,467 +81,428 @@ function B({ name: n, size: t = 20, label: l }) {
253
81
  viewBox: "0 0 24 24",
254
82
  fill: "none",
255
83
  stroke: "currentColor",
256
- strokeWidth: n === "more" ? 3 : 1.75,
257
- strokeLinecap: "round",
258
- strokeLinejoin: "round",
84
+ strokeWidth: Qe[e].strokeWidth ?? Xe.width,
85
+ strokeLinecap: Xe.linecap,
86
+ strokeLinejoin: Xe.linejoin,
259
87
  focusable: !1,
260
88
  ...l ? { role: "img", "aria-label": l } : { "aria-hidden": !0 },
261
- children: kn[n]
89
+ children: Qe[e].parts.map(({ tag: s, ...a }, i) => $n(s, { key: i, ...a }))
262
90
  }
263
91
  );
264
92
  }
265
- const zt = Object.keys(kn), pn = {
266
- reply: "reply",
267
- "reply-all": "reply",
268
- forward: "forward",
269
- envelope: "mail",
270
- "envelope-open": "mail-open",
271
- star: "star",
272
- "star-fill": "star",
273
- "folder-symlink": "folder",
274
- folder: "folder",
275
- trash: "trash",
276
- archive: "archive",
277
- "arrow-clockwise": "refresh",
278
- download: "download",
279
- printer: "print",
280
- "file-earmark-code": "file-code",
281
- clipboard: "copy",
282
- "three-dots": "more",
283
- pencil: "pencil",
284
- trash3: "trash",
285
- "folder-plus": "folder-plus",
286
- "folder-x": "folder-x",
287
- image: "image",
288
- "person-check": "user-check",
289
- "person-x": "user-x",
290
- "arrow-left": "chevron-left",
291
- "pencil-square": "pencil",
292
- "plus-lg": "plus",
293
- gear: "settings",
294
- upload: "upload",
295
- "cloud-upload": "upload",
296
- people: "users",
297
- "file-earmark-word": "file",
298
- "file-earmark-spreadsheet": "file",
299
- "file-earmark-text": "file",
300
- folder2: "folder",
301
- "folder2-open": "folder",
302
- "chat-dots": "chat",
303
- images: "image",
304
- paperclip: "paperclip",
305
- hash: "hash",
306
- funnel: "funnel",
307
- eye: "eye",
308
- "eye-slash": "eye-off"
309
- };
310
- function Ue(n) {
311
- return Object.prototype.hasOwnProperty.call(pn, n) ? pn[n] : null;
93
+ const qt = Object.keys(Qe), vn = rn.bootstrap;
94
+ function Be(e) {
95
+ return Object.prototype.hasOwnProperty.call(vn, e) ? vn[e] : null;
312
96
  }
313
- function Bn() {
97
+ function Un() {
314
98
  try {
315
99
  return process.env.NODE_ENV !== "production";
316
100
  } catch {
317
101
  return !1;
318
102
  }
319
103
  }
320
- const bn = /* @__PURE__ */ new Set();
321
- function Fn({ name: n, size: t = 18 }) {
322
- if (n === "") return null;
323
- const l = Ue(n);
324
- return l !== null ? /* @__PURE__ */ e(B, { name: l, size: t }) : (!bn.has(n) && Bn() && (bn.add(n), console.warn(`@coolms/ui-react: no icon for the server's icon name "${n}"; its space is kept empty`)), /* @__PURE__ */ e("span", { className: "cms-icon cms-icon--blank", style: { width: t, height: t }, "aria-hidden": "true", "data-icon-name": n }));
325
- }
326
- function sn({ id: n, label: t, help: l, error: r, pinned: s, children: a }) {
327
- return /* @__PURE__ */ c("div", { className: H("cms-field", r != null && "is-invalid"), children: [
328
- /* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: n, children: t }),
329
- a,
330
- s != null ? /* @__PURE__ */ c("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
331
- /* @__PURE__ */ e(re, { name: "lock" }),
104
+ const gn = /* @__PURE__ */ new Set();
105
+ function Cn({ name: e, size: t = 18 }) {
106
+ if (e === "") return null;
107
+ const l = Be(e);
108
+ return l !== null ? /* @__PURE__ */ n($, { name: l, size: t }) : (!gn.has(e) && Un() && (gn.add(e), console.warn(`@coolms/ui-react: no icon for the server's icon name "${e}"; its space is kept empty`)), /* @__PURE__ */ n("span", { className: "cms-icon cms-icon--blank", style: { width: t, height: t }, "aria-hidden": "true", "data-icon-name": e }));
109
+ }
110
+ function cn({ id: e, label: t, help: l, error: s, pinned: a, children: i }) {
111
+ return /* @__PURE__ */ f("div", { className: F("cms-field", s != null && "is-invalid"), children: [
112
+ /* @__PURE__ */ n("label", { className: "cms-field__label", htmlFor: e, children: t }),
113
+ i,
114
+ a != null ? /* @__PURE__ */ f("p", { className: "cms-field__pinned", id: `${e}-pinned`, children: [
115
+ /* @__PURE__ */ n(se, { name: "lock" }),
332
116
  " ",
333
- s
117
+ a
334
118
  ] }) : null,
335
- r != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: r }) : null,
336
- l != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${n}-help`, children: l }) : null
119
+ s != null ? /* @__PURE__ */ n("p", { className: "cms-field__error", id: `${e}-error`, role: "alert", children: s }) : null,
120
+ l != null ? /* @__PURE__ */ n("p", { className: "cms-field__help", id: `${e}-help`, children: l }) : null
337
121
  ] });
338
122
  }
339
- function rn(n, t) {
340
- const l = [t.error != null && `${n}-error`, t.pinned != null && `${n}-pinned`, t.help != null && `${n}-help`].filter(Boolean).join(" ");
123
+ function on(e, t) {
124
+ const l = [t.error != null && `${e}-error`, t.pinned != null && `${e}-pinned`, t.help != null && `${e}-help`].filter(Boolean).join(" ");
341
125
  return l === "" ? void 0 : l;
342
126
  }
343
- const Hn = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Rn = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
344
- function On(n, t, l) {
345
- const r = (a, h, d, m = 0, b = 0, i = 0) => {
346
- const g = new Date(Date.UTC(a, h - 1, d, m, b, i));
347
- return g.setUTCFullYear(a), g.getUTCFullYear() === a && g.getUTCMonth() === h - 1 && g.getUTCDate() === d && g.getUTCHours() === m && g.getUTCMinutes() === b && g.getUTCSeconds() === i ? g : null;
348
- }, s = (a) => ({ hour: Number(a[1]), minute: Number(a[2]), second: Number(a[3] ?? 0) });
127
+ const Kn = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Wn = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
128
+ function Zn(e, t, l) {
129
+ const s = (i, h, d, u = 0, b = 0, c = 0) => {
130
+ const v = new Date(Date.UTC(i, h - 1, d, u, b, c));
131
+ return v.setUTCFullYear(i), v.getUTCFullYear() === i && v.getUTCMonth() === h - 1 && v.getUTCDate() === d && v.getUTCHours() === u && v.getUTCMinutes() === b && v.getUTCSeconds() === c ? v : null;
132
+ }, a = (i) => ({ hour: Number(i[1]), minute: Number(i[2]), second: Number(i[3] ?? 0) });
349
133
  try {
350
- if (n === "time") {
351
- const h = t.match(Rn);
134
+ if (e === "time") {
135
+ const h = t.match(Wn);
352
136
  if (h === null) return t;
353
- const d = s(h), m = r(2e3, 1, 1, d.hour, d.minute, d.second);
354
- return m === null ? t : new Intl.DateTimeFormat(l, { timeStyle: h[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(m);
137
+ const d = a(h), u = s(2e3, 1, 1, d.hour, d.minute, d.second);
138
+ return u === null ? t : new Intl.DateTimeFormat(l, { timeStyle: h[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(u);
355
139
  }
356
- const a = t.match(Hn);
357
- if (a === null) return t;
358
- if (n === "date" && a[4] === void 0) {
359
- const h = r(Number(a[1]), Number(a[2]), Number(a[3]));
140
+ const i = t.match(Kn);
141
+ if (i === null) return t;
142
+ if (e === "date" && i[4] === void 0) {
143
+ const h = s(Number(i[1]), Number(i[2]), Number(i[3]));
360
144
  return h === null ? t : new Intl.DateTimeFormat(l, { dateStyle: "medium", timeZone: "UTC" }).format(h);
361
145
  }
362
- if (n === "datetime-local" && a[4] !== void 0) {
363
- const h = r(Number(a[1]), Number(a[2]), Number(a[3]), Number(a[4]), Number(a[5]), Number(a[6] ?? 0));
364
- return h === null ? t : new Intl.DateTimeFormat(l, { dateStyle: "medium", timeStyle: a[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(h);
146
+ if (e === "datetime-local" && i[4] !== void 0) {
147
+ const h = s(Number(i[1]), Number(i[2]), Number(i[3]), Number(i[4]), Number(i[5]), Number(i[6] ?? 0));
148
+ return h === null ? t : new Intl.DateTimeFormat(l, { dateStyle: "medium", timeStyle: i[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(h);
365
149
  }
366
150
  } catch {
367
151
  return t;
368
152
  }
369
153
  return t;
370
154
  }
371
- const Pn = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
372
- function Ut({ label: n, help: t, error: l, disabled: r, readOnly: s, pinned: a, value: h, onChange: d, placeholder: m, type: b = "text", name: i, locale: g, min: f, max: v, step: u, minLength: y, maxLength: S, required: T, autoComplete: M, reveal: E }) {
373
- const _ = fe(), [N, I] = D(!1), K = s === !0 || a != null, z = K && Pn.has(b), k = b === "number" && (u === "any" || typeof u == "number" && !Number.isInteger(u)), F = b === "password" && E !== void 0 && !K, U = /* @__PURE__ */ e(
155
+ const Vn = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
156
+ function Gt({ label: e, help: t, error: l, disabled: s, readOnly: a, pinned: i, value: h, onChange: d, placeholder: u, type: b = "text", name: c, locale: v, min: m, max: N, step: r, minLength: g, maxLength: T, required: C, autoComplete: S, reveal: x }) {
157
+ const _ = he(), [y, I] = D(!1), U = a === !0 || i != null, P = U && Vn.has(b), k = b === "number" && (r === "any" || typeof r == "number" && !Number.isInteger(r)), B = b === "password" && x !== void 0 && !U, z = /* @__PURE__ */ n(
374
158
  "input",
375
159
  {
376
160
  id: _,
377
- name: i,
378
- type: z || F && N ? "text" : b,
379
- autoComplete: M,
161
+ name: c,
162
+ type: P || B && y ? "text" : b,
163
+ autoComplete: S,
380
164
  className: "cms-input",
381
- value: z ? On(b, h, g) : h,
382
- ...z ? { "data-value": h } : {},
383
- lang: g,
384
- placeholder: m,
385
- disabled: r,
386
- readOnly: K,
387
- required: T,
388
- "aria-required": T || void 0,
389
- min: z ? void 0 : f,
390
- max: z ? void 0 : v,
391
- step: z ? void 0 : u,
392
- minLength: y,
393
- maxLength: S,
165
+ value: P ? Zn(b, h, v) : h,
166
+ ...P ? { "data-value": h } : {},
167
+ lang: v,
168
+ placeholder: u,
169
+ disabled: s,
170
+ readOnly: U,
171
+ required: C,
172
+ "aria-required": C || void 0,
173
+ min: P ? void 0 : m,
174
+ max: P ? void 0 : N,
175
+ step: P ? void 0 : r,
176
+ minLength: g,
177
+ maxLength: T,
394
178
  inputMode: b === "number" ? k ? "decimal" : "numeric" : void 0,
395
179
  "aria-invalid": l != null || void 0,
396
- "aria-describedby": rn(_, { help: t, error: l, pinned: a }),
397
- onChange: (Y) => d == null ? void 0 : d(Y.target.value)
180
+ "aria-describedby": on(_, { help: t, error: l, pinned: i }),
181
+ onChange: (j) => d == null ? void 0 : d(j.target.value)
398
182
  }
399
183
  );
400
- return /* @__PURE__ */ e(sn, { id: _, label: n, help: t, error: l, pinned: a, children: F ? /* @__PURE__ */ c("span", { className: "cms-input-reveal", children: [
401
- U,
402
- /* @__PURE__ */ e(
184
+ return /* @__PURE__ */ n(cn, { id: _, label: e, help: t, error: l, pinned: i, children: B ? /* @__PURE__ */ f("span", { className: "cms-input-reveal", children: [
185
+ z,
186
+ /* @__PURE__ */ n(
403
187
  "button",
404
188
  {
405
189
  type: "button",
406
190
  className: "cms-input-reveal__button",
407
191
  "aria-controls": _,
408
- "aria-label": N ? E.hide : E.show,
409
- title: N ? E.hide : E.show,
410
- disabled: r,
411
- onClick: () => I((Y) => !Y),
412
- children: /* @__PURE__ */ e(B, { name: N ? "eye-off" : "eye", size: 18 })
192
+ "aria-label": y ? x.hide : x.show,
193
+ title: y ? x.hide : x.show,
194
+ disabled: s,
195
+ onClick: () => I((j) => !j),
196
+ children: /* @__PURE__ */ n($, { name: y ? "eye-off" : "eye", size: 18 })
413
197
  }
414
198
  )
415
- ] }) : U });
199
+ ] }) : z });
416
200
  }
417
- function Kt({ label: n, help: t, error: l, disabled: r, readOnly: s, pinned: a, value: h, onChange: d, placeholder: m, rows: b = 4, name: i, locale: g, minLength: f, maxLength: v, required: u }) {
418
- const y = fe();
419
- return /* @__PURE__ */ e(sn, { id: y, label: n, help: t, error: l, pinned: a, children: /* @__PURE__ */ e(
201
+ function jt({ label: e, help: t, error: l, disabled: s, readOnly: a, pinned: i, value: h, onChange: d, placeholder: u, rows: b = 4, name: c, locale: v, minLength: m, maxLength: N, required: r }) {
202
+ const g = he();
203
+ return /* @__PURE__ */ n(cn, { id: g, label: e, help: t, error: l, pinned: i, children: /* @__PURE__ */ n(
420
204
  "textarea",
421
205
  {
422
- id: y,
423
- name: i,
206
+ id: g,
207
+ name: c,
424
208
  className: "cms-input cms-textarea",
425
209
  rows: b,
426
210
  value: h,
427
- lang: g,
428
- placeholder: m,
429
- disabled: r,
430
- readOnly: s === !0 || a != null,
431
- required: u,
432
- "aria-required": u || void 0,
433
- minLength: f,
434
- maxLength: v,
211
+ lang: v,
212
+ placeholder: u,
213
+ disabled: s,
214
+ readOnly: a === !0 || i != null,
215
+ required: r,
216
+ "aria-required": r || void 0,
217
+ minLength: m,
218
+ maxLength: N,
435
219
  "aria-invalid": l != null || void 0,
436
- "aria-describedby": rn(y, { help: t, error: l, pinned: a }),
437
- onChange: (S) => d == null ? void 0 : d(S.target.value)
220
+ "aria-describedby": on(g, { help: t, error: l, pinned: i }),
221
+ onChange: (T) => d == null ? void 0 : d(T.target.value)
438
222
  }
439
223
  ) });
440
224
  }
441
- function Wt({ label: n, help: t, error: l, disabled: r, readOnly: s, value: a, options: h, onChange: d, emptyText: m = "Nothing to choose from yet.", name: b }) {
442
- const i = fe(), g = h.length === 0;
443
- return /* @__PURE__ */ e(sn, { id: i, label: n, help: g ? m : t, error: l, children: /* @__PURE__ */ e(
225
+ function Yt({ label: e, help: t, error: l, disabled: s, readOnly: a, value: i, options: h, onChange: d, emptyText: u = "Nothing to choose from yet.", name: b }) {
226
+ const c = he(), v = h.length === 0;
227
+ return /* @__PURE__ */ n(cn, { id: c, label: e, help: v ? u : t, error: l, children: /* @__PURE__ */ n(
444
228
  "select",
445
229
  {
446
- id: i,
230
+ id: c,
447
231
  name: b,
448
232
  className: "cms-input cms-select",
449
- value: a,
450
- disabled: r || g,
451
- "aria-readonly": s || void 0,
233
+ value: i,
234
+ disabled: s || v,
235
+ "aria-readonly": a || void 0,
452
236
  "aria-invalid": l != null || void 0,
453
- "aria-describedby": rn(i, { help: g ? m : t, error: l }),
454
- onChange: (f) => {
455
- s || d == null || d(f.target.value);
237
+ "aria-describedby": on(c, { help: v ? u : t, error: l }),
238
+ onChange: (m) => {
239
+ a || d == null || d(m.target.value);
456
240
  },
457
- children: h.map((f) => /* @__PURE__ */ e("option", { value: f.value, disabled: s && f.value !== a, children: f.label }, f.value))
241
+ children: h.map((m) => /* @__PURE__ */ n("option", { value: m.value, disabled: a && m.value !== i, children: m.label }, m.value))
458
242
  }
459
243
  ) });
460
244
  }
461
- function Zt({ label: n, checked: t, onChange: l, disabled: r, readOnly: s, help: a }) {
462
- const h = fe();
463
- return /* @__PURE__ */ c("div", { className: "cms-toggle-row", children: [
464
- /* @__PURE__ */ e(
245
+ function Xt({ label: e, checked: t, onChange: l, disabled: s, readOnly: a, help: i }) {
246
+ const h = he();
247
+ return /* @__PURE__ */ f("div", { className: "cms-toggle-row", children: [
248
+ /* @__PURE__ */ n(
465
249
  "button",
466
250
  {
467
251
  id: h,
468
252
  type: "button",
469
253
  role: "switch",
470
- className: H("cms-toggle", t && "is-on"),
254
+ className: F("cms-toggle", t && "is-on"),
471
255
  "aria-checked": t,
472
- "aria-readonly": s || void 0,
473
- "aria-describedby": a != null ? `${h}-help` : void 0,
474
- disabled: r,
256
+ "aria-readonly": a || void 0,
257
+ "aria-describedby": i != null ? `${h}-help` : void 0,
258
+ disabled: s,
475
259
  onClick: () => {
476
- s || l == null || l(!t);
260
+ a || l == null || l(!t);
477
261
  },
478
- children: /* @__PURE__ */ e("span", { className: "cms-toggle__thumb" })
262
+ children: /* @__PURE__ */ n("span", { className: "cms-toggle__thumb" })
479
263
  }
480
264
  ),
481
- /* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor: h, children: n }),
482
- a != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${h}-help`, children: a }) : null
265
+ /* @__PURE__ */ n("label", { className: "cms-toggle__label", htmlFor: h, children: e }),
266
+ i != null ? /* @__PURE__ */ n("p", { className: "cms-field__help", id: `${h}-help`, children: i }) : null
483
267
  ] });
484
268
  }
485
- const zn = 150;
486
- function xn({ open: n, title: t, onClose: l, dirty: r = !1, onDirtyClose: s, children: a, footer: h, closeLabel: d = "Close", initialFocus: m, className: b }) {
487
- const [i, g] = D(n), [f, v] = D(!1), u = P(null), y = P(null), S = fe();
488
- if (ee(() => {
489
- if (n) {
490
- y.current = document.activeElement, g(!0), v(!1);
269
+ const qn = 150;
270
+ function Sn({ open: e, title: t, onClose: l, dirty: s = !1, onDirtyClose: a, children: i, footer: h, closeLabel: d = "Close", initialFocus: u, className: b }) {
271
+ const [c, v] = D(e), [m, N] = D(!1), r = O(null), g = O(null), T = he();
272
+ if (Q(() => {
273
+ if (e) {
274
+ g.current = document.activeElement, v(!0), N(!1);
491
275
  return;
492
276
  }
493
- if (!i) return;
494
- v(!0);
495
- const M = window.setTimeout(() => {
496
- var E, _;
497
- g(!1), v(!1), (_ = (E = y.current) == null ? void 0 : E.focus) == null || _.call(E);
498
- }, zn);
499
- return () => window.clearTimeout(M);
500
- }, [n, i]), ee(() => {
501
- var M, E;
502
- if (n && i) {
277
+ if (!c) return;
278
+ N(!0);
279
+ const S = window.setTimeout(() => {
280
+ var x, _;
281
+ v(!1), N(!1), (_ = (x = g.current) == null ? void 0 : x.focus) == null || _.call(x);
282
+ }, qn);
283
+ return () => window.clearTimeout(S);
284
+ }, [e, c]), Q(() => {
285
+ var S, x;
286
+ if (e && c) {
503
287
  const _ = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
504
- (E = (m == null ? void 0 : m.current) ?? ((M = u.current) == null ? void 0 : M.querySelector(`.cms-modal__body :is(${_}), .cms-modal__foot :is(${_})`)) ?? u.current) == null || E.focus();
288
+ (x = (u == null ? void 0 : u.current) ?? ((S = r.current) == null ? void 0 : S.querySelector(`.cms-modal__body :is(${_}), .cms-modal__foot :is(${_})`)) ?? r.current) == null || x.focus();
505
289
  }
506
- }, [n, i, m]), !i) return null;
507
- const T = () => {
508
- r ? s == null || s() : l();
290
+ }, [e, c, u]), !c) return null;
291
+ const C = () => {
292
+ s ? a == null || a() : l();
509
293
  };
510
- return ln(
511
- /* @__PURE__ */ e("div", { className: H("cms-modal-scrim", f && "is-closing"), onMouseDown: (M) => {
512
- M.target === M.currentTarget && T();
513
- }, children: /* @__PURE__ */ c(
294
+ return an(
295
+ /* @__PURE__ */ n("div", { className: F("cms-modal-scrim", m && "is-closing"), onMouseDown: (S) => {
296
+ S.target === S.currentTarget && C();
297
+ }, children: /* @__PURE__ */ f(
514
298
  "div",
515
299
  {
516
- ref: u,
517
- className: H("cms-modal", b, f && "is-closing", r && "is-dirty"),
300
+ ref: r,
301
+ className: F("cms-modal", b, m && "is-closing", s && "is-dirty"),
518
302
  role: "dialog",
519
303
  "aria-modal": "true",
520
- "aria-labelledby": S,
304
+ "aria-labelledby": T,
521
305
  tabIndex: -1,
522
- onKeyDown: (M) => {
523
- var E;
524
- if (M.key === "Escape")
525
- M.stopPropagation(), T();
526
- else if (M.key === "Tab") {
527
- const _ = (E = u.current) == null ? void 0 : E.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
306
+ onKeyDown: (S) => {
307
+ var x;
308
+ if (S.key === "Escape")
309
+ S.stopPropagation(), C();
310
+ else if (S.key === "Tab") {
311
+ const _ = (x = r.current) == null ? void 0 : x.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
528
312
  if (!_ || _.length === 0) return;
529
- const N = _[0], I = _[_.length - 1];
530
- M.shiftKey && document.activeElement === N ? (M.preventDefault(), I.focus()) : !M.shiftKey && document.activeElement === I && (M.preventDefault(), N.focus());
313
+ const y = _[0], I = _[_.length - 1];
314
+ S.shiftKey && document.activeElement === y ? (S.preventDefault(), I.focus()) : !S.shiftKey && document.activeElement === I && (S.preventDefault(), y.focus());
531
315
  }
532
316
  },
533
317
  children: [
534
- /* @__PURE__ */ c("header", { className: "cms-modal__head", children: [
535
- /* @__PURE__ */ e("h2", { className: "cms-modal__title", id: S, children: t }),
536
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": d, onClick: T, children: /* @__PURE__ */ e(re, { name: "close" }) })
318
+ /* @__PURE__ */ f("header", { className: "cms-modal__head", children: [
319
+ /* @__PURE__ */ n("h2", { className: "cms-modal__title", id: T, children: t }),
320
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": d, onClick: C, children: /* @__PURE__ */ n(se, { name: "close" }) })
537
321
  ] }),
538
- /* @__PURE__ */ e("div", { className: "cms-modal__body", children: a }),
539
- h != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: h }) : null
322
+ /* @__PURE__ */ n("div", { className: "cms-modal__body", children: i }),
323
+ h != null ? /* @__PURE__ */ n("footer", { className: "cms-modal__foot", children: h }) : null
540
324
  ]
541
325
  }
542
326
  ) }),
543
327
  document.body
544
328
  );
545
329
  }
546
- function Vt({ open: n, title: t, message: l, kind: r = "default", confirmLabel: s, cancelLabel: a, closeLabel: h, onConfirm: d, onCancel: m }) {
547
- const b = r === "discard-changes";
548
- return /* @__PURE__ */ e(
549
- xn,
330
+ function Jt({ open: e, title: t, message: l, kind: s = "default", confirmLabel: a, cancelLabel: i, closeLabel: h, onConfirm: d, onCancel: u }) {
331
+ const b = s === "discard-changes";
332
+ return /* @__PURE__ */ n(
333
+ Sn,
550
334
  {
551
- open: n,
335
+ open: e,
552
336
  title: t,
553
- onClose: m,
337
+ onClose: u,
554
338
  ...h === void 0 ? {} : { closeLabel: h },
555
- footer: /* @__PURE__ */ c($, { children: [
556
- /* @__PURE__ */ e(De, { onClick: m, children: a ?? (b ? "Keep editing" : "Cancel") }),
557
- /* @__PURE__ */ e(De, { variant: r === "default" ? "primary" : "danger", onClick: d, children: s ?? (b ? "Discard changes" : "Confirm") })
339
+ footer: /* @__PURE__ */ f(ge, { children: [
340
+ /* @__PURE__ */ n(De, { onClick: u, children: i ?? (b ? "Keep editing" : "Cancel") }),
341
+ /* @__PURE__ */ n(De, { variant: s === "default" ? "primary" : "danger", onClick: d, children: a ?? (b ? "Discard changes" : "Confirm") })
558
342
  ] }),
559
- children: r !== "default" ? /* @__PURE__ */ c("p", { className: "cms-confirm__warning", children: [
560
- /* @__PURE__ */ e(re, { name: "warning" }),
343
+ children: s !== "default" ? /* @__PURE__ */ f("p", { className: "cms-confirm__warning", children: [
344
+ /* @__PURE__ */ n(se, { name: "warning" }),
561
345
  " ",
562
346
  l
563
- ] }) : /* @__PURE__ */ e("p", { children: l })
347
+ ] }) : /* @__PURE__ */ n("p", { children: l })
564
348
  }
565
349
  );
566
350
  }
567
- function qt({ kind: n, message: t, action: l, onDismiss: r, dismissLabel: s = "Dismiss" }) {
568
- return /* @__PURE__ */ c("div", { className: H("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
569
- /* @__PURE__ */ e(re, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
570
- /* @__PURE__ */ e("span", { className: "cms-toast__message", children: t }),
571
- l ? /* @__PURE__ */ e(De, { className: "cms-toast__action", onClick: l.onAction, children: l.label }) : null,
572
- r ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": s, onClick: r, children: /* @__PURE__ */ e(re, { name: "close" }) }) : null
351
+ function Qt({ kind: e, message: t, action: l, onDismiss: s, dismissLabel: a = "Dismiss" }) {
352
+ return /* @__PURE__ */ f("div", { className: F("cms-toast", `cms-toast--${e}`), role: e === "error" ? "alert" : "status", children: [
353
+ /* @__PURE__ */ n(se, { name: e === "success" ? "check" : e === "error" ? "warning" : "info" }),
354
+ /* @__PURE__ */ n("span", { className: "cms-toast__message", children: t }),
355
+ l ? /* @__PURE__ */ n(De, { className: "cms-toast__action", onClick: l.onAction, children: l.label }) : null,
356
+ s ? /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": a, onClick: s, children: /* @__PURE__ */ n(se, { name: "close" }) }) : null
573
357
  ] });
574
358
  }
575
- function Gt({ children: n }) {
576
- return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: n });
359
+ function el({ children: e }) {
360
+ return /* @__PURE__ */ n("div", { className: "cms-toast-region", children: e });
577
361
  }
578
- function Un({ what: n, layout: t = "inline" }) {
579
- return /* @__PURE__ */ c("div", { className: H("cms-loading", `cms-loading--${t}`), role: "status", "aria-live": "polite", children: [
580
- /* @__PURE__ */ e(re, { name: "spinner" }),
581
- /* @__PURE__ */ e("span", { children: n })
362
+ function Gn({ what: e, layout: t = "inline" }) {
363
+ return /* @__PURE__ */ f("div", { className: F("cms-loading", `cms-loading--${t}`), role: "status", "aria-live": "polite", children: [
364
+ /* @__PURE__ */ n(se, { name: "spinner" }),
365
+ /* @__PURE__ */ n("span", { children: e })
582
366
  ] });
583
367
  }
584
- function Kn({ title: n, hint: t, action: l }) {
585
- return /* @__PURE__ */ c("div", { className: "cms-empty", children: [
586
- /* @__PURE__ */ e("p", { className: "cms-empty__title", children: n }),
587
- t != null ? /* @__PURE__ */ e("p", { className: "cms-empty__hint", children: t }) : null,
588
- l != null ? /* @__PURE__ */ e("div", { className: "cms-empty__action", children: l }) : null
368
+ function jn({ title: e, hint: t, action: l, icon: s }) {
369
+ return /* @__PURE__ */ f("div", { className: "cms-state cms-state--empty cms-state--page", role: "status", "aria-live": "polite", "data-kind": "empty", children: [
370
+ s !== void 0 && Be(s) !== null ? /* @__PURE__ */ n("span", { className: "cms-state__icon", "aria-hidden": "true", children: /* @__PURE__ */ n(Cn, { name: s, size: 32 }) }) : null,
371
+ /* @__PURE__ */ f("span", { className: "cms-state__text", children: [
372
+ /* @__PURE__ */ n("span", { className: "cms-state__title", children: e }),
373
+ t != null ? /* @__PURE__ */ n("span", { className: "cms-state__description", children: t }) : null
374
+ ] }),
375
+ l != null ? /* @__PURE__ */ n("div", { className: "cms-state__action", children: l }) : null
589
376
  ] });
590
377
  }
591
- function Wn({ message: n, onRetry: t, retryLabel: l = "Try again" }) {
592
- return /* @__PURE__ */ c("div", { className: "cms-error-banner", role: "alert", children: [
593
- /* @__PURE__ */ e(re, { name: "warning" }),
594
- /* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: n }),
595
- t ? /* @__PURE__ */ e(De, { onClick: t, children: l }) : null
378
+ function Yn({ message: e, onRetry: t, retryLabel: l = "Try again" }) {
379
+ return /* @__PURE__ */ f("div", { className: "cms-error-banner", role: "alert", children: [
380
+ /* @__PURE__ */ n(se, { name: "warning" }),
381
+ /* @__PURE__ */ n("span", { className: "cms-error-banner__message", children: e }),
382
+ t ? /* @__PURE__ */ n(De, { onClick: t, children: l }) : null
596
383
  ] });
597
384
  }
598
- const Je = 300;
599
- function Zn() {
600
- if (typeof window > "u" || typeof getComputedStyle != "function") return Je;
601
- const n = getComputedStyle(document.documentElement).getPropertyValue("--cms-state-delay").trim(), t = n.endsWith("ms") ? Number.parseFloat(n) : n.endsWith("s") ? Number.parseFloat(n) * 1e3 : Number.NaN;
602
- return Number.isFinite(t) && t >= 0 ? t : Je;
385
+ const en = 300;
386
+ function Xn() {
387
+ if (typeof window > "u" || typeof getComputedStyle != "function") return en;
388
+ const e = getComputedStyle(document.documentElement).getPropertyValue("--cms-state-delay").trim(), t = e.endsWith("ms") ? Number.parseFloat(e) : e.endsWith("s") ? Number.parseFloat(e) * 1e3 : Number.NaN;
389
+ return Number.isFinite(t) && t >= 0 ? t : en;
603
390
  }
604
- function Vn() {
605
- return /* @__PURE__ */ c("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
606
- /* @__PURE__ */ e("circle", { className: "cms-state__track", cx: "12", cy: "12", r: "10", fill: "none" }),
607
- /* @__PURE__ */ e("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
391
+ function Jn() {
392
+ return /* @__PURE__ */ f("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
393
+ /* @__PURE__ */ n("circle", { className: "cms-state__track", cx: "12", cy: "12", r: "10", fill: "none" }),
394
+ /* @__PURE__ */ n("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
608
395
  ] });
609
396
  }
610
- function Le({ kind: n, title: t, description: l, action: r, placement: s = "block", icon: a }) {
611
- const [h, d] = D(n !== "loading");
612
- return ee(() => {
613
- if (n !== "loading") {
397
+ function Le({ kind: e, title: t, description: l, action: s, placement: a = "page", icon: i }) {
398
+ const [h, d] = D(e !== "loading");
399
+ Q(() => {
400
+ if (e !== "loading") {
614
401
  d(!0);
615
402
  return;
616
403
  }
617
404
  d(!1);
618
- const m = window.setTimeout(() => d(!0), Zn());
619
- return () => window.clearTimeout(m);
620
- }, [n]), /* @__PURE__ */ c(
405
+ const b = window.setTimeout(() => d(!0), Xn());
406
+ return () => window.clearTimeout(b);
407
+ }, [e]);
408
+ const u = a === "block";
409
+ return /* @__PURE__ */ f(
621
410
  "div",
622
411
  {
623
- className: H("cms-state", `cms-state--${n}`, `cms-state--${s}`, !h && "is-waiting"),
412
+ className: F("cms-state", `cms-state--${e}`, `cms-state--${a}`, !h && "is-waiting"),
624
413
  role: "status",
625
414
  "aria-live": "polite",
626
- "data-kind": n,
415
+ "data-kind": e,
627
416
  children: [
628
- n === "loading" ? /* @__PURE__ */ e(Vn, {}) : null,
629
- n === "error" || n === "denied" ? /* @__PURE__ */ e(re, { name: n === "error" ? "warning" : "lock" }) : null,
630
- n === "empty" && a !== void 0 && Ue(a) !== null ? /* @__PURE__ */ e("span", { className: "cms-state__icon", "aria-hidden": "true", children: /* @__PURE__ */ e(Fn, { name: a, size: s === "page" ? 32 : 24 }) }) : null,
631
- /* @__PURE__ */ c("span", { className: "cms-state__text", children: [
632
- /* @__PURE__ */ e("span", { className: "cms-state__title", children: t }),
633
- l !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-state__description", children: l }) : null
417
+ e === "loading" ? /* @__PURE__ */ n(Jn, {}) : null,
418
+ (e === "error" || e === "denied") && !u ? /* @__PURE__ */ n(se, { name: e === "error" ? "warning" : "lock" }) : null,
419
+ e === "empty" && !u && i !== void 0 && Be(i) !== null ? /* @__PURE__ */ n("span", { className: "cms-state__icon", "aria-hidden": "true", children: /* @__PURE__ */ n(Cn, { name: i, size: a === "page" ? 32 : 24 }) }) : null,
420
+ /* @__PURE__ */ f("span", { className: "cms-state__text", children: [
421
+ /* @__PURE__ */ n("span", { className: "cms-state__title", children: t }),
422
+ l !== void 0 && !u ? /* @__PURE__ */ n("span", { className: "cms-state__description", children: l }) : null
634
423
  ] }),
635
- r !== void 0 && n !== "denied" ? /* @__PURE__ */ e(De, { className: "cms-state__action", onClick: r.onAction, children: r.label }) : null
424
+ s !== void 0 && e !== "denied" ? /* @__PURE__ */ n(De, { className: "cms-state__action", variant: u ? "quiet" : "secondary", onClick: s.onAction, children: s.label }) : null
636
425
  ]
637
426
  }
638
427
  );
639
428
  }
640
- const qn = 'input, select, textarea, button:not([disabled]), iframe, [href], [tabindex]:not([tabindex="-1"])', Gn = 60;
641
- function jn(n) {
642
- return n instanceof Element && n.closest('input, select, textarea, [contenteditable="true"], [data-viewer-keys]') !== null;
429
+ const Qn = 'input, select, textarea, button:not([disabled]), iframe, [href], [tabindex]:not([tabindex="-1"])', et = 60;
430
+ function nt(e) {
431
+ return e instanceof Element && e.closest('input, select, textarea, [contenteditable="true"], [data-viewer-keys]') !== null;
643
432
  }
644
- function Yn(n) {
645
- return n instanceof Element && n.closest("[data-viewer-gestures]") !== null;
433
+ function tt(e) {
434
+ return e instanceof Element && e.closest("[data-viewer-gestures]") !== null;
646
435
  }
647
- function Xn(n) {
648
- return n.getClientRects().length > 0;
436
+ function lt(e) {
437
+ return e.getClientRects().length > 0;
649
438
  }
650
- function jt(n) {
651
- const { name: t, badge: l, closeLabel: r, onClose: s, actions: a = [], moreLabel: h = "More", edit: d, editing: m, state: b, siblings: i, bar: g, thumbnails: f, strip: v, onZoom: u, children: y } = n, S = P(null), T = P(null), M = fe(), [E, _] = D(!1), N = P(null);
652
- ee(() => {
653
- var U;
654
- const k = document.activeElement, F = document.body.style.overflow;
655
- return document.body.style.overflow = "hidden", (U = T.current) == null || U.focus(), () => {
656
- var Y;
657
- document.body.style.overflow = F, (Y = k == null ? void 0 : k.focus) == null || Y.call(k);
439
+ function nl(e) {
440
+ const { name: t, badge: l, closeLabel: s, onClose: a, actions: i = [], moreLabel: h = "More", edit: d, editing: u, state: b, siblings: c, bar: v, thumbnails: m, strip: N, onZoom: r, children: g } = e, T = O(null), C = O(null), S = he(), [x, _] = D(!1), y = O(null);
441
+ Q(() => {
442
+ var z;
443
+ const k = document.activeElement, B = document.body.style.overflow;
444
+ return document.body.style.overflow = "hidden", (z = C.current) == null || z.focus(), () => {
445
+ var j;
446
+ document.body.style.overflow = B, (j = k == null ? void 0 : k.focus) == null || j.call(k);
658
447
  };
659
448
  }, []);
660
449
  const I = () => {
661
- m != null && m.dirty ? m.onDirtyClose() : s();
662
- }, K = (k) => {
663
- const F = k.touches.length === 1 ? k.touches[0] : void 0;
664
- N.current = F === void 0 || m !== void 0 || Yn(k.target) ? null : { x: F.clientX, y: F.clientY };
665
- }, z = (k) => {
666
- var W, j;
667
- const F = N.current, U = k.changedTouches[0];
668
- if (N.current = null, F === null || U === void 0) return;
669
- const Y = U.clientX - F.x;
670
- Math.abs(Y) < Gn || Math.abs(Y) < Math.abs(U.clientY - F.y) || (Y > 0 ? (W = i == null ? void 0 : i.onPrevious) == null || W.call(i) : (j = i == null ? void 0 : i.onNext) == null || j.call(i));
450
+ u != null && u.dirty ? u.onDirtyClose() : a();
451
+ }, U = (k) => {
452
+ const B = k.touches.length === 1 ? k.touches[0] : void 0;
453
+ y.current = B === void 0 || u !== void 0 || tt(k.target) ? null : { x: B.clientX, y: B.clientY };
454
+ }, P = (k) => {
455
+ var K, G;
456
+ const B = y.current, z = k.changedTouches[0];
457
+ if (y.current = null, B === null || z === void 0) return;
458
+ const j = z.clientX - B.x;
459
+ Math.abs(j) < et || Math.abs(j) < Math.abs(z.clientY - B.y) || (j > 0 ? (K = c == null ? void 0 : c.onPrevious) == null || K.call(c) : (G = c == null ? void 0 : c.onNext) == null || G.call(c));
671
460
  };
672
- return ln(
673
- /* @__PURE__ */ c(
461
+ return an(
462
+ /* @__PURE__ */ f(
674
463
  "div",
675
464
  {
676
- ref: S,
677
- className: H("cms-viewer", m !== void 0 && "is-editing"),
465
+ ref: T,
466
+ className: F("cms-viewer", u !== void 0 && "is-editing"),
678
467
  role: "dialog",
679
468
  "aria-modal": "true",
680
- "aria-labelledby": M,
469
+ "aria-labelledby": S,
681
470
  tabIndex: -1,
682
471
  onKeyDown: (k) => {
683
- var F, U, Y;
472
+ var B, z, j;
684
473
  if (k.key === "Escape") {
685
- if (m !== void 0) return;
686
- k.stopPropagation(), E ? _(!1) : s();
474
+ if (u !== void 0) return;
475
+ k.stopPropagation(), x ? _(!1) : a();
687
476
  } else if (k.key === "Tab") {
688
- const W = Array.from(((F = S.current) == null ? void 0 : F.querySelectorAll(qn)) ?? []).filter(Xn);
689
- if (W.length === 0) return;
690
- const j = W[0], X = W[W.length - 1];
691
- k.shiftKey && document.activeElement === j ? (k.preventDefault(), X.focus()) : !k.shiftKey && document.activeElement === X && (k.preventDefault(), j.focus());
692
- } else m === void 0 && !jn(k.target) && !k.ctrlKey && !k.metaKey && !k.altKey && (k.key === "ArrowLeft" ? (U = i == null ? void 0 : i.onPrevious) == null || U.call(i) : k.key === "ArrowRight" ? (Y = i == null ? void 0 : i.onNext) == null || Y.call(i) : k.key === "+" || k.key === "=" ? u == null || u("in") : k.key === "-" ? u == null || u("out") : k.key === "0" && (u == null || u("reset")));
477
+ const K = Array.from(((B = T.current) == null ? void 0 : B.querySelectorAll(Qn)) ?? []).filter(lt);
478
+ if (K.length === 0) return;
479
+ const G = K[0], Y = K[K.length - 1];
480
+ k.shiftKey && document.activeElement === G ? (k.preventDefault(), Y.focus()) : !k.shiftKey && document.activeElement === Y && (k.preventDefault(), G.focus());
481
+ } else u === void 0 && !nt(k.target) && !k.ctrlKey && !k.metaKey && !k.altKey && (k.key === "ArrowLeft" ? (z = c == null ? void 0 : c.onPrevious) == null || z.call(c) : k.key === "ArrowRight" ? (j = c == null ? void 0 : c.onNext) == null || j.call(c) : k.key === "+" || k.key === "=" ? r == null || r("in") : k.key === "-" ? r == null || r("out") : k.key === "0" && (r == null || r("reset")));
693
482
  },
694
483
  children: [
695
- i !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${t}, ${i.position}` }) : null,
696
- /* @__PURE__ */ c("header", { className: "cms-viewer__top", children: [
697
- /* @__PURE__ */ e("button", { ref: T, type: "button", className: "cms-viewer__icon", "aria-label": r, onClick: I, children: /* @__PURE__ */ e(re, { name: "close" }) }),
698
- /* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: l }),
699
- /* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: M, title: t, children: t }),
700
- i !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: i.position }) : null,
701
- /* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
702
- m !== void 0 ? /* @__PURE__ */ c($, { children: [
703
- /* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: m.status }),
704
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: m.onDone, children: m.doneLabel })
705
- ] }) : /* @__PURE__ */ c($, { children: [
706
- /* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: a.map((k) => /* @__PURE__ */ c("button", { type: "button", className: "cms-viewer__button", onClick: k.onSelect, children: [
484
+ c !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-visually-hidden", role: "status", children: `${t}, ${c.position}` }) : null,
485
+ /* @__PURE__ */ f("header", { className: "cms-viewer__top", children: [
486
+ /* @__PURE__ */ n("button", { ref: C, type: "button", className: "cms-viewer__icon", "aria-label": s, onClick: I, children: /* @__PURE__ */ n(se, { name: "close" }) }),
487
+ /* @__PURE__ */ n("span", { className: "cms-viewer__badge", children: l }),
488
+ /* @__PURE__ */ n("h2", { className: "cms-viewer__name", id: S, title: t, children: t }),
489
+ c !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-viewer__position", children: c.position }) : null,
490
+ /* @__PURE__ */ n("span", { className: "cms-viewer__space" }),
491
+ u !== void 0 ? /* @__PURE__ */ f(ge, { children: [
492
+ /* @__PURE__ */ n("span", { className: "cms-viewer__status", role: "status", children: u.status }),
493
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.onDone, children: u.doneLabel })
494
+ ] }) : /* @__PURE__ */ f(ge, { children: [
495
+ /* @__PURE__ */ n("span", { className: "cms-viewer__actions", children: i.map((k) => /* @__PURE__ */ f("button", { type: "button", className: "cms-viewer__button", onClick: k.onSelect, children: [
707
496
  k.icon,
708
497
  k.label
709
498
  ] }, k.label)) }),
710
- d !== void 0 ? /* @__PURE__ */ c("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": d.label, onClick: d.onEdit, children: [
499
+ d !== void 0 ? /* @__PURE__ */ f("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": d.label, onClick: d.onEdit, children: [
711
500
  d.icon,
712
- /* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: d.label })
501
+ /* @__PURE__ */ n("span", { className: "cms-viewer__wide", children: d.label })
713
502
  ] }) : null,
714
- a.length > 0 ? /* @__PURE__ */ c("span", { className: "cms-viewer__more", children: [
715
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": h, "aria-expanded": E, onClick: () => _((k) => !k), children: /* @__PURE__ */ e(B, { name: "more" }) }),
716
- E ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: a.map((k) => /* @__PURE__ */ c(
503
+ i.length > 0 ? /* @__PURE__ */ f("span", { className: "cms-viewer__more", children: [
504
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__icon", "aria-label": h, "aria-expanded": x, onClick: () => _((k) => !k), children: /* @__PURE__ */ n($, { name: "more" }) }),
505
+ x ? /* @__PURE__ */ n("span", { className: "cms-viewer__menu", children: i.map((k) => /* @__PURE__ */ f(
717
506
  "button",
718
507
  {
719
508
  type: "button",
@@ -731,229 +520,229 @@ function jt(n) {
731
520
  ] }) : null
732
521
  ] })
733
522
  ] }),
734
- /* @__PURE__ */ c("div", { className: "cms-viewer__body", children: [
735
- f != null && m === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: f }) : null,
736
- /* @__PURE__ */ c("div", { className: "cms-viewer__content", onTouchStart: K, onTouchEnd: z, children: [
737
- (m == null ? void 0 : m.conflict) !== void 0 ? /* @__PURE__ */ c("div", { className: "cms-viewer__conflict", role: "alert", children: [
738
- /* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children: m.conflict.message }),
739
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick: m.conflict.onOverwrite, children: m.conflict.overwriteLabel }),
740
- /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: m.conflict.onKeepBoth, children: m.conflict.keepBothLabel })
523
+ /* @__PURE__ */ f("div", { className: "cms-viewer__body", children: [
524
+ m != null && u === void 0 ? /* @__PURE__ */ n("nav", { className: "cms-viewer__thumbnails", children: m }) : null,
525
+ /* @__PURE__ */ f("div", { className: "cms-viewer__content", onTouchStart: U, onTouchEnd: P, children: [
526
+ (u == null ? void 0 : u.conflict) !== void 0 ? /* @__PURE__ */ f("div", { className: "cms-viewer__conflict", role: "alert", children: [
527
+ /* @__PURE__ */ n("p", { className: "cms-viewer__conflict-text", children: u.conflict.message }),
528
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button", onClick: u.conflict.onOverwrite, children: u.conflict.overwriteLabel }),
529
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.conflict.onKeepBoth, children: u.conflict.keepBothLabel })
741
530
  ] }) : null,
742
- b === void 0 ? y : /* @__PURE__ */ e(Jn, { state: b }),
743
- m === void 0 && (i != null && i.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": i.previousLabel, title: i.previousLabel, onClick: i.onPrevious, children: /* @__PURE__ */ e(re, { name: "back" }) }) : null,
744
- m === void 0 && (i != null && i.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": i.nextLabel, title: i.nextLabel, onClick: i.onNext, children: /* @__PURE__ */ e(re, { name: "back" }) }) : null,
745
- m === void 0 && i !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(i.total, 7) }, (k, F) => /* @__PURE__ */ e("i", { className: F === Math.min(i.index, 6) ? "is-current" : void 0 }, F)) }) : null
531
+ b === void 0 ? g : /* @__PURE__ */ n(st, { state: b }),
532
+ u === void 0 && (c != null && c.onPrevious) ? /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": c.previousLabel, title: c.previousLabel, onClick: c.onPrevious, children: /* @__PURE__ */ n(se, { name: "back" }) }) : null,
533
+ u === void 0 && (c != null && c.onNext) ? /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": c.nextLabel, title: c.nextLabel, onClick: c.onNext, children: /* @__PURE__ */ n(se, { name: "back" }) }) : null,
534
+ u === void 0 && c !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(c.total, 7) }, (k, B) => /* @__PURE__ */ n("i", { className: B === Math.min(c.index, 6) ? "is-current" : void 0 }, B)) }) : null
746
535
  ] })
747
536
  ] }),
748
- m === void 0 && v != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: v }) : null,
749
- g != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: g }) : null
537
+ u === void 0 && N != null ? /* @__PURE__ */ n("div", { className: "cms-viewer__strip", children: N }) : null,
538
+ v != null ? /* @__PURE__ */ n("footer", { className: "cms-viewer__bar", children: v }) : null
750
539
  ]
751
540
  }
752
541
  ),
753
542
  document.body
754
543
  );
755
544
  }
756
- function Jn({ state: n }) {
757
- switch (n.kind) {
545
+ function st({ state: e }) {
546
+ switch (e.kind) {
758
547
  case "loading":
759
- return /* @__PURE__ */ e(Le, { kind: "loading", title: n.title, placement: "page" });
548
+ return /* @__PURE__ */ n(Le, { kind: "loading", title: e.title, placement: "page" });
760
549
  case "error":
761
- return /* @__PURE__ */ e(
550
+ return /* @__PURE__ */ n(
762
551
  Le,
763
552
  {
764
553
  kind: "error",
765
- title: n.title,
766
- ...n.description === void 0 ? {} : { description: n.description },
767
- ...n.retry === void 0 ? {} : { action: { label: n.retry.label, onAction: n.retry.onRetry } },
554
+ title: e.title,
555
+ ...e.description === void 0 ? {} : { description: e.description },
556
+ ...e.retry === void 0 ? {} : { action: { label: e.retry.label, onAction: e.retry.onRetry } },
768
557
  placement: "page"
769
558
  }
770
559
  );
771
560
  case "no-preview":
772
- return /* @__PURE__ */ e(
561
+ return /* @__PURE__ */ n(
773
562
  Le,
774
563
  {
775
564
  kind: "empty",
776
- title: n.title,
777
- ...n.description === void 0 ? {} : { description: n.description },
778
- action: { label: n.download.label, onAction: n.download.onDownload },
565
+ title: e.title,
566
+ ...e.description === void 0 ? {} : { description: e.description },
567
+ action: { label: e.download.label, onAction: e.download.onDownload },
779
568
  placement: "page"
780
569
  }
781
570
  );
782
571
  }
783
572
  }
784
- class Qn extends Error {
573
+ class at extends Error {
785
574
  constructor(t = "denied") {
786
575
  super(t), this.name = "FilePickerDenied";
787
576
  }
788
577
  }
789
- class et extends Error {
578
+ class rt extends Error {
790
579
  constructor(t = "restart") {
791
580
  super(t), this.name = "FilePickerRestart";
792
581
  }
793
582
  }
794
- const Xe = (n, t) => `${n}
795
- ${t}`, nt = (n, t) => n === "" ? t : `${n}/${t}`, tt = 48;
796
- function Yt(n) {
797
- var te, we;
798
- const { open: t, spaces: l, list: r, disabledReason: s, budget: a, formatSize: h, labels: d, onConfirm: m, onCancel: b } = n, [i, g] = D(((te = l[0]) == null ? void 0 : te.id) ?? ""), [f, v] = D(""), [u, y] = D({ status: "loading" }), [S, T] = D(0), [M, E] = D(/* @__PURE__ */ new Map()), [_, N] = D(0), [I, K] = D(!1), z = P(null), k = P(!1);
799
- ee(() => {
583
+ const Je = (e, t) => `${e}
584
+ ${t}`, it = (e, t) => e === "" ? t : `${e}/${t}`, ct = 48;
585
+ function tl(e) {
586
+ var ne, ye;
587
+ const { open: t, spaces: l, list: s, disabledReason: a, budget: i, formatSize: h, labels: d, onConfirm: u, onCancel: b } = e, [c, v] = D(((ne = l[0]) == null ? void 0 : ne.id) ?? ""), [m, N] = D(""), [r, g] = D({ status: "loading" }), [T, C] = D(0), [S, x] = D(/* @__PURE__ */ new Map()), [_, y] = D(0), [I, U] = D(!1), P = O(null), k = O(!1);
588
+ Q(() => {
800
589
  k.current = !1;
801
- }, [t, i, f]);
802
- const F = fe();
803
- ee(() => {
590
+ }, [t, c, m]);
591
+ const B = he();
592
+ Q(() => {
804
593
  var w;
805
- t && (g(((w = l[0]) == null ? void 0 : w.id) ?? ""), v(""), E(/* @__PURE__ */ new Map()), K(!1));
806
- }, [t]), ee(() => {
807
- if (!t || i === "") return;
594
+ t && (v(((w = l[0]) == null ? void 0 : w.id) ?? ""), N(""), x(/* @__PURE__ */ new Map()), U(!1));
595
+ }, [t]), Q(() => {
596
+ if (!t || c === "") return;
808
597
  let w = !0;
809
- return y({ status: "loading" }), N(0), r(i, f).then(
810
- (C) => w && y({ status: "ready", entries: C.entries, next: C.next ?? null, paging: !1 }),
811
- (C) => w && y({ status: C instanceof Qn ? "denied" : "error" })
598
+ return g({ status: "loading" }), y(0), s(c, m).then(
599
+ (E) => w && g({ status: "ready", entries: E.entries, next: E.next ?? null, paging: !1 }),
600
+ (E) => w && g({ status: E instanceof at ? "denied" : "error" })
812
601
  ), () => {
813
602
  w = !1;
814
603
  };
815
- }, [t, i, f, r, S]);
816
- const U = Ie(() => {
817
- if (u.status !== "ready" || u.next === null || u.paging) return;
818
- const w = u.next, C = u.entries;
819
- y({ ...u, paging: !0 }), r(i, f, w).then(
820
- (Z) => {
821
- k.current = !1, y({ status: "ready", entries: [...C, ...Z.entries], next: Z.next ?? null, paging: !1 });
604
+ }, [t, c, m, s, T]);
605
+ const z = Ie(() => {
606
+ if (r.status !== "ready" || r.next === null || r.paging) return;
607
+ const w = r.next, E = r.entries;
608
+ g({ ...r, paging: !0 }), s(c, m, w).then(
609
+ (W) => {
610
+ k.current = !1, g({ status: "ready", entries: [...E, ...W.entries], next: W.next ?? null, paging: !1 });
822
611
  },
823
- (Z) => {
824
- if (!(Z instanceof et)) {
825
- y({ status: "ready", entries: C, next: w, paging: !1 });
612
+ (W) => {
613
+ if (!(W instanceof rt)) {
614
+ g({ status: "ready", entries: E, next: w, paging: !1 });
826
615
  return;
827
616
  }
828
617
  if (k.current) {
829
- y({ status: "error" });
618
+ g({ status: "error" });
830
619
  return;
831
620
  }
832
- k.current = !0, T((G) => G + 1);
621
+ k.current = !0, C((q) => q + 1);
833
622
  }
834
623
  );
835
- }, [u, r, i, f]), Y = Ie((w) => {
836
- var C;
837
- return ((C = a == null ? void 0 : a.cost) == null ? void 0 : C.call(a, w)) ?? w.size ?? 0;
838
- }, [a]), W = Ln(() => [...M.values()], [M]), j = W.reduce((w, C) => w + (C.size ?? 0), 0), X = a === void 0 ? null : a.limitBytes - a.usedBytes - W.reduce((w, C) => w + Y(C), 0), ne = X !== null && X < 0, ce = (w) => {
624
+ }, [r, s, c, m]), j = Ie((w) => {
625
+ var E;
626
+ return ((E = i == null ? void 0 : i.cost) == null ? void 0 : E.call(i, w)) ?? w.size ?? 0;
627
+ }, [i]), K = Bn(() => [...S.values()], [S]), G = K.reduce((w, E) => w + (E.size ?? 0), 0), Y = i === void 0 ? null : i.limitBytes - i.usedBytes - K.reduce((w, E) => w + j(E), 0), ee = Y !== null && Y < 0, ie = (w) => {
839
628
  if (w.kind !== "file") return null;
840
- const C = s == null ? void 0 : s(w);
841
- return C || (X !== null && !M.has(Xe(i, w.id)) && Y(w) > X ? d.overBudget : null);
842
- }, _e = (w) => {
843
- const C = Xe(i, w.id);
844
- !M.has(C) && ce(w) !== null || E((Z) => {
845
- const G = new Map(Z);
846
- return G.has(C) ? G.delete(C) : G.set(C, { ...w, space: i, path: f }), G;
629
+ const E = a == null ? void 0 : a(w);
630
+ return E || (Y !== null && !S.has(Je(c, w.id)) && j(w) > Y ? d.overBudget : null);
631
+ }, be = (w) => {
632
+ const E = Je(c, w.id);
633
+ !S.has(E) && ie(w) !== null || x((W) => {
634
+ const q = new Map(W);
635
+ return q.has(E) ? q.delete(E) : q.set(E, { ...w, space: c, path: m }), q;
847
636
  });
848
- }, oe = (w) => v(nt(f, w.name)), ue = () => v(f.includes("/") ? f.slice(0, f.lastIndexOf("/")) : ""), Ce = (w) => E((C) => {
849
- const Z = new Map(C);
850
- return Z.delete(w), Z;
851
- }), pe = u.status === "ready" ? u.entries : [], le = (w) => {
852
- const C = pe[_];
637
+ }, ce = (w) => N(it(m, w.name)), de = () => N(m.includes("/") ? m.slice(0, m.lastIndexOf("/")) : ""), Ce = (w) => x((E) => {
638
+ const W = new Map(E);
639
+ return W.delete(w), W;
640
+ }), fe = r.status === "ready" ? r.entries : [], te = (w) => {
641
+ const E = fe[_];
853
642
  if (w.key === "ArrowDown" || w.key === "ArrowUp" || w.key === "Home" || w.key === "End") {
854
643
  w.preventDefault();
855
- const Z = pe.length - 1, G = w.key === "Home" ? 0 : w.key === "End" ? Z : Math.min(Z, Math.max(0, _ + (w.key === "ArrowDown" ? 1 : -1)));
856
- N(G), G >= Z - 1 && U();
857
- } else w.key === "Enter" && (C == null ? void 0 : C.kind) === "folder" ? (w.preventDefault(), oe(C)) : w.key === " " && (C == null ? void 0 : C.kind) === "file" ? (w.preventDefault(), _e(C)) : w.key === "Backspace" && f !== "" && (w.preventDefault(), ue());
858
- }, be = f === "" ? [] : f.split("/"), ve = ((we = l.find((w) => w.id === i)) == null ? void 0 : we.name) ?? "", ye = (w) => `${F}-entry-${String(w)}`;
859
- return /* @__PURE__ */ c(
860
- xn,
644
+ const W = fe.length - 1, q = w.key === "Home" ? 0 : w.key === "End" ? W : Math.min(W, Math.max(0, _ + (w.key === "ArrowDown" ? 1 : -1)));
645
+ y(q), q >= W - 1 && z();
646
+ } else w.key === "Enter" && (E == null ? void 0 : E.kind) === "folder" ? (w.preventDefault(), ce(E)) : w.key === " " && (E == null ? void 0 : E.kind) === "file" ? (w.preventDefault(), be(E)) : w.key === "Backspace" && m !== "" && (w.preventDefault(), de());
647
+ }, pe = m === "" ? [] : m.split("/"), _e = ((ye = l.find((w) => w.id === c)) == null ? void 0 : ye.name) ?? "", we = (w) => `${B}-entry-${String(w)}`;
648
+ return /* @__PURE__ */ f(
649
+ Sn,
861
650
  {
862
651
  open: t,
863
652
  title: d.title,
864
653
  onClose: b,
865
654
  closeLabel: d.close,
866
- initialFocus: z,
655
+ initialFocus: P,
867
656
  className: "cms-file-picker",
868
- footer: /* @__PURE__ */ c("div", { className: "cms-file-picker__foot", children: [
869
- /* @__PURE__ */ c("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
870
- W.length > 0 ? /* @__PURE__ */ e("span", { children: d.total(W.length, h(j)) }) : null,
871
- a !== void 0 && X !== null ? /* @__PURE__ */ e("span", { className: H(ne && "is-over"), children: ne ? d.overBudget : d.left(h(Math.max(0, X)), h(a.limitBytes)) }) : null
657
+ footer: /* @__PURE__ */ f("div", { className: "cms-file-picker__foot", children: [
658
+ /* @__PURE__ */ f("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
659
+ K.length > 0 ? /* @__PURE__ */ n("span", { children: d.total(K.length, h(G)) }) : null,
660
+ i !== void 0 && Y !== null ? /* @__PURE__ */ n("span", { className: F(ee && "is-over"), children: ee ? d.overBudget : d.left(h(Math.max(0, Y)), h(i.limitBytes)) }) : null
872
661
  ] }),
873
- /* @__PURE__ */ c("div", { className: "cms-file-picker__actions", children: [
874
- /* @__PURE__ */ e(De, { variant: "secondary", onClick: b, children: d.cancel }),
875
- /* @__PURE__ */ e(De, { variant: "primary", disabled: W.length === 0 || ne, onClick: () => m(W), children: d.confirm(W.length) })
662
+ /* @__PURE__ */ f("div", { className: "cms-file-picker__actions", children: [
663
+ /* @__PURE__ */ n(De, { variant: "secondary", onClick: b, children: d.cancel }),
664
+ /* @__PURE__ */ n(De, { variant: "primary", disabled: K.length === 0 || ee, onClick: () => u(K), children: d.confirm(K.length) })
876
665
  ] })
877
666
  ] }),
878
667
  children: [
879
- /* @__PURE__ */ c("div", { className: "cms-file-picker__top", children: [
880
- l.length > 1 ? /* @__PURE__ */ c("label", { className: "cms-file-picker__space", children: [
881
- /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: d.space }),
882
- /* @__PURE__ */ e("select", { className: "cms-input cms-select", value: i, onChange: (w) => {
883
- g(w.target.value), v("");
884
- }, children: l.map((w) => /* @__PURE__ */ e("option", { value: w.id, children: w.name }, w.id)) })
668
+ /* @__PURE__ */ f("div", { className: "cms-file-picker__top", children: [
669
+ l.length > 1 ? /* @__PURE__ */ f("label", { className: "cms-file-picker__space", children: [
670
+ /* @__PURE__ */ n("span", { className: "cms-visually-hidden", children: d.space }),
671
+ /* @__PURE__ */ n("select", { className: "cms-input cms-select", value: c, onChange: (w) => {
672
+ v(w.target.value), N("");
673
+ }, children: l.map((w) => /* @__PURE__ */ n("option", { value: w.id, children: w.name }, w.id)) })
885
674
  ] }) : null,
886
- /* @__PURE__ */ c("nav", { className: "cms-file-picker__path", "aria-label": d.path, children: [
887
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": d.up, disabled: f === "", onClick: ue, children: /* @__PURE__ */ e(B, { name: "chevron-left" }) }),
888
- /* @__PURE__ */ c("ol", { children: [
889
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": f === "" ? "location" : void 0, onClick: () => v(""), children: ve }) }),
890
- be.map((w, C) => {
891
- const Z = be.slice(0, C + 1).join("/");
892
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": Z === f ? "location" : void 0, onClick: () => v(Z), children: w }) }, Z);
675
+ /* @__PURE__ */ f("nav", { className: "cms-file-picker__path", "aria-label": d.path, children: [
676
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": d.up, disabled: m === "", onClick: de, children: /* @__PURE__ */ n($, { name: "chevron-left" }) }),
677
+ /* @__PURE__ */ f("ol", { children: [
678
+ /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": m === "" ? "location" : void 0, onClick: () => N(""), children: _e }) }),
679
+ pe.map((w, E) => {
680
+ const W = pe.slice(0, E + 1).join("/");
681
+ return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": W === m ? "location" : void 0, onClick: () => N(W), children: w }) }, W);
893
682
  })
894
683
  ] })
895
684
  ] }),
896
- W.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": I, onClick: () => K((w) => !w), children: d.selected(W.length) }) : null
685
+ K.length > 0 ? /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": I, onClick: () => U((w) => !w), children: d.selected(K.length) }) : null
897
686
  ] }),
898
- I && W.length > 0 ? /* @__PURE__ */ c("div", { className: "cms-file-picker__chosen", children: [
899
- /* @__PURE__ */ e("ul", { children: [...M.entries()].map(([w, C]) => /* @__PURE__ */ c("li", { children: [
900
- /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: C.name }),
901
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": d.remove(C.name), onClick: () => Ce(w), children: /* @__PURE__ */ e(re, { name: "close" }) })
687
+ I && K.length > 0 ? /* @__PURE__ */ f("div", { className: "cms-file-picker__chosen", children: [
688
+ /* @__PURE__ */ n("ul", { children: [...S.entries()].map(([w, E]) => /* @__PURE__ */ f("li", { children: [
689
+ /* @__PURE__ */ n("span", { className: "cms-file-picker__name", children: E.name }),
690
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": d.remove(E.name), onClick: () => Ce(w), children: /* @__PURE__ */ n(se, { name: "close" }) })
902
691
  ] }, w)) }),
903
- /* @__PURE__ */ e(De, { variant: "secondary", onClick: () => {
904
- E(/* @__PURE__ */ new Map()), K(!1);
692
+ /* @__PURE__ */ n(De, { variant: "secondary", onClick: () => {
693
+ x(/* @__PURE__ */ new Map()), U(!1);
905
694
  }, children: d.clear })
906
695
  ] }) : null,
907
- /* @__PURE__ */ c("div", { className: "cms-file-picker__list", onScroll: (w) => {
908
- const C = w.currentTarget;
909
- C.scrollTop + C.clientHeight >= C.scrollHeight - tt && U();
696
+ /* @__PURE__ */ f("div", { className: "cms-file-picker__list", onScroll: (w) => {
697
+ const E = w.currentTarget;
698
+ E.scrollTop + E.clientHeight >= E.scrollHeight - ct && z();
910
699
  }, children: [
911
- u.status === "loading" ? /* @__PURE__ */ e(Le, { kind: "loading", title: d.loading, placement: "block" }) : null,
912
- u.status === "error" ? /* @__PURE__ */ e(Le, { kind: "error", title: d.error, placement: "block", action: { label: d.retry, onAction: () => {
913
- k.current = !1, T((w) => w + 1);
700
+ r.status === "loading" ? /* @__PURE__ */ n(Le, { kind: "loading", title: d.loading, placement: "page" }) : null,
701
+ r.status === "error" ? /* @__PURE__ */ n(Le, { kind: "error", title: d.error, placement: "page", action: { label: d.retry, onAction: () => {
702
+ k.current = !1, C((w) => w + 1);
914
703
  } } }) : null,
915
- u.status === "denied" ? /* @__PURE__ */ e(Le, { kind: "denied", title: d.denied, placement: "block" }) : null,
916
- u.status === "ready" && pe.length === 0 ? /* @__PURE__ */ e(Le, { kind: "empty", title: d.empty, placement: "block" }) : null,
917
- /* @__PURE__ */ c(
704
+ r.status === "denied" ? /* @__PURE__ */ n(Le, { kind: "denied", title: d.denied, placement: "page" }) : null,
705
+ r.status === "ready" && fe.length === 0 ? /* @__PURE__ */ n(Le, { kind: "empty", title: d.empty, placement: "page" }) : null,
706
+ /* @__PURE__ */ f(
918
707
  "div",
919
708
  {
920
- ref: z,
709
+ ref: P,
921
710
  role: "listbox",
922
711
  "aria-multiselectable": "true",
923
712
  "aria-label": d.files,
924
- "aria-activedescendant": pe.length > 0 ? ye(_) : void 0,
713
+ "aria-activedescendant": fe.length > 0 ? we(_) : void 0,
925
714
  tabIndex: 0,
926
715
  className: "cms-file-picker__entries",
927
- hidden: u.status !== "ready" || pe.length === 0,
928
- onKeyDown: le,
716
+ hidden: r.status !== "ready" || fe.length === 0,
717
+ onKeyDown: te,
929
718
  children: [
930
- pe.map((w, C) => {
931
- const Z = w.kind === "file" && M.has(Xe(i, w.id)), G = ce(w);
932
- return /* @__PURE__ */ c(
719
+ fe.map((w, E) => {
720
+ const W = w.kind === "file" && S.has(Je(c, w.id)), q = ie(w);
721
+ return /* @__PURE__ */ f(
933
722
  "div",
934
723
  {
935
- id: ye(C),
724
+ id: we(E),
936
725
  role: "option",
937
- "aria-selected": w.kind === "file" ? Z : void 0,
938
- "aria-disabled": G !== null || void 0,
939
- className: H("cms-file-picker__entry", C === _ && "is-active", Z && "is-ticked", G !== null && "is-disabled"),
726
+ "aria-selected": w.kind === "file" ? W : void 0,
727
+ "aria-disabled": q !== null || void 0,
728
+ className: F("cms-file-picker__entry", E === _ && "is-active", W && "is-ticked", q !== null && "is-disabled"),
940
729
  onClick: () => {
941
- N(C), w.kind === "folder" ? oe(w) : _e(w);
730
+ y(E), w.kind === "folder" ? ce(w) : be(w);
942
731
  },
943
732
  children: [
944
- /* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: Z ? /* @__PURE__ */ e(B, { name: "check" }) : null }),
945
- /* @__PURE__ */ e(B, { name: w.kind === "folder" ? "folder" : "file" }),
946
- /* @__PURE__ */ c("span", { className: "cms-file-picker__text", children: [
947
- /* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: w.name }),
948
- G !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: G }) : null
733
+ /* @__PURE__ */ n("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: W ? /* @__PURE__ */ n($, { name: "check" }) : null }),
734
+ /* @__PURE__ */ n($, { name: w.kind === "folder" ? "folder" : "file" }),
735
+ /* @__PURE__ */ f("span", { className: "cms-file-picker__text", children: [
736
+ /* @__PURE__ */ n("span", { className: "cms-file-picker__name", children: w.name }),
737
+ q !== null ? /* @__PURE__ */ n("span", { className: "cms-file-picker__reason", children: q }) : null
949
738
  ] }),
950
- w.kind === "file" && w.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: h(w.size) }) : null
739
+ w.kind === "file" && w.size != null ? /* @__PURE__ */ n("span", { className: "cms-file-picker__size", children: h(w.size) }) : null
951
740
  ]
952
741
  },
953
742
  w.id
954
743
  );
955
744
  }),
956
- u.status === "ready" && u.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(Le, { kind: "loading", title: d.loading, placement: "inline" }) }) : null
745
+ r.status === "ready" && r.paging ? /* @__PURE__ */ n("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ n(Le, { kind: "loading", title: d.loading, placement: "inline" }) }) : null
957
746
  ]
958
747
  }
959
748
  )
@@ -962,227 +751,227 @@ function Yt(n) {
962
751
  }
963
752
  );
964
753
  }
965
- const Qe = 64;
966
- function lt(n, t) {
967
- for (let l = n instanceof Element ? n : null; l !== null; l = l.parentElement) {
754
+ const nn = 64;
755
+ function ot(e, t) {
756
+ for (let l = e instanceof Element ? e : null; l !== null; l = l.parentElement) {
968
757
  if (l instanceof HTMLElement && l.scrollTop > 0) return !1;
969
758
  if (l === t) return !0;
970
759
  }
971
760
  return t.scrollTop <= 0;
972
761
  }
973
- function st(n, t) {
974
- const [l, r] = D(0), s = P(t);
975
- return s.current = t, ee(() => {
976
- const a = n.current;
977
- if (a === null) return;
762
+ function dt(e, t) {
763
+ const [l, s] = D(0), a = O(t);
764
+ return a.current = t, Q(() => {
765
+ const i = e.current;
766
+ if (i === null) return;
978
767
  let h = null, d = 0;
979
- const m = (g) => {
980
- h = lt(g.target, a) && g.touches.length === 1 ? g.touches[0].clientY : null, d = 0;
981
- }, b = (g) => {
982
- if (h === null || s.current === null) return;
983
- const f = g.touches[0].clientY - h;
984
- if (f <= 0) {
985
- h = null, r(0);
768
+ const u = (v) => {
769
+ h = ot(v.target, i) && v.touches.length === 1 ? v.touches[0].clientY : null, d = 0;
770
+ }, b = (v) => {
771
+ if (h === null || a.current === null) return;
772
+ const m = v.touches[0].clientY - h;
773
+ if (m <= 0) {
774
+ h = null, s(0);
986
775
  return;
987
776
  }
988
- g.cancelable && g.preventDefault(), d = Math.min(f * 0.6, Qe * 1.5), r(d);
989
- }, i = () => {
990
- var g;
991
- h !== null && d >= Qe && ((g = s.current) == null || g.call(s)), h = null, d = 0, r(0);
777
+ v.cancelable && v.preventDefault(), d = Math.min(m * 0.6, nn * 1.5), s(d);
778
+ }, c = () => {
779
+ var v;
780
+ h !== null && d >= nn && ((v = a.current) == null || v.call(a)), h = null, d = 0, s(0);
992
781
  };
993
- return a.addEventListener("touchstart", m, { passive: !0 }), a.addEventListener("touchmove", b, { passive: !1 }), a.addEventListener("touchend", i), a.addEventListener("touchcancel", i), () => {
994
- a.removeEventListener("touchstart", m), a.removeEventListener("touchmove", b), a.removeEventListener("touchend", i), a.removeEventListener("touchcancel", i);
782
+ return i.addEventListener("touchstart", u, { passive: !0 }), i.addEventListener("touchmove", b, { passive: !1 }), i.addEventListener("touchend", c), i.addEventListener("touchcancel", c), () => {
783
+ i.removeEventListener("touchstart", u), i.removeEventListener("touchmove", b), i.removeEventListener("touchend", c), i.removeEventListener("touchcancel", c);
995
784
  };
996
- }, [n]), l;
997
- }
998
- const Mn = In(null);
999
- function rt() {
1000
- return Dn(Mn);
1001
- }
1002
- function Xt({ label: n, rows: t, error: l, onRetry: r, loadingText: s = "Loading", emptyTitle: a = "Nothing here yet", emptyHint: h, selected: d, onOpen: m, onRowMenu: b }) {
1003
- const i = P([]), g = rt();
1004
- if (l != null) return /* @__PURE__ */ e(Wn, { message: l, onRetry: r });
1005
- if (t === null) return /* @__PURE__ */ e(Un, { what: s, layout: "block" });
1006
- if (t.length === 0) return /* @__PURE__ */ e(Kn, { title: a, hint: h });
1007
- const f = (v, u, y) => {
1008
- var S;
1009
- if (v.key === "ArrowDown" || v.key === "ArrowUp")
1010
- v.preventDefault(), (S = i.current[Math.min(t.length - 1, Math.max(0, u + (v.key === "ArrowDown" ? 1 : -1)))]) == null || S.focus();
1011
- else if (v.key === "Enter")
1012
- m == null || m(y);
1013
- else if ((v.key === "ContextMenu" || v.shiftKey && v.key === "F10") && b) {
1014
- v.preventDefault();
1015
- const T = v.currentTarget.getBoundingClientRect();
1016
- b(y, { x: T.left + 16, y: T.bottom });
785
+ }, [e]), l;
786
+ }
787
+ const En = Rn(null);
788
+ function ut() {
789
+ return Fn(En);
790
+ }
791
+ function ll({ label: e, rows: t, error: l, onRetry: s, loadingText: a = "Loading", emptyTitle: i = "Nothing here yet", emptyHint: h, emptyIcon: d, selected: u, onOpen: b, onRowMenu: c }) {
792
+ const v = O([]), m = ut();
793
+ if (l != null) return /* @__PURE__ */ n(Yn, { message: l, onRetry: s });
794
+ if (t === null) return /* @__PURE__ */ n(Gn, { what: a, layout: "block" });
795
+ if (t.length === 0) return /* @__PURE__ */ n(jn, { title: i, hint: h, ...d === void 0 ? {} : { icon: d } });
796
+ const N = (r, g, T) => {
797
+ var C;
798
+ if (r.key === "ArrowDown" || r.key === "ArrowUp")
799
+ r.preventDefault(), (C = v.current[Math.min(t.length - 1, Math.max(0, g + (r.key === "ArrowDown" ? 1 : -1)))]) == null || C.focus();
800
+ else if (r.key === "Enter")
801
+ b == null || b(T);
802
+ else if ((r.key === "ContextMenu" || r.shiftKey && r.key === "F10") && c) {
803
+ r.preventDefault();
804
+ const S = r.currentTarget.getBoundingClientRect();
805
+ c(T, { x: S.left + 16, y: S.bottom });
1017
806
  }
1018
807
  };
1019
- return /* @__PURE__ */ c($, { children: [
1020
- g !== null && (g.distance > 0 || g.refreshing) ? /* @__PURE__ */ c("div", { className: "cms-list__pull", role: "status", style: { height: g.refreshing ? void 0 : g.distance }, "data-ready": g.distance >= Qe ? "" : void 0, children: [
1021
- g.refreshing ? /* @__PURE__ */ e(re, { name: "spinner" }) : null,
1022
- g.text != null ? /* @__PURE__ */ e("span", { className: "cms-list__pull-text", children: g.text }) : null
808
+ return /* @__PURE__ */ f(ge, { children: [
809
+ m !== null && (m.distance > 0 || m.refreshing) ? /* @__PURE__ */ f("div", { className: "cms-list__pull", role: "status", style: { height: m.refreshing ? void 0 : m.distance }, "data-ready": m.distance >= nn ? "" : void 0, children: [
810
+ m.refreshing ? /* @__PURE__ */ n(se, { name: "spinner" }) : null,
811
+ m.text != null ? /* @__PURE__ */ n("span", { className: "cms-list__pull-text", children: m.text }) : null
1023
812
  ] }) : null,
1024
- /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: t.map((v, u) => {
1025
- const y = v.id === d;
1026
- return /* @__PURE__ */ c(
813
+ /* @__PURE__ */ n("ul", { className: "cms-list", role: "listbox", "aria-label": e, children: t.map((r, g) => {
814
+ const T = r.id === u;
815
+ return /* @__PURE__ */ f(
1027
816
  "li",
1028
817
  {
1029
- ref: (S) => {
1030
- i.current[u] = S;
818
+ ref: (C) => {
819
+ v.current[g] = C;
1031
820
  },
1032
821
  role: "option",
1033
- "aria-selected": y,
1034
- tabIndex: y || d == null && u === 0 ? 0 : -1,
1035
- className: H("cms-list__row", y && "is-selected"),
1036
- onClick: () => m == null ? void 0 : m(v.id),
1037
- onKeyDown: (S) => f(S, u, v.id),
1038
- onContextMenu: b ? (S) => {
1039
- S.preventDefault(), b(v.id, { x: S.clientX, y: S.clientY });
822
+ "aria-selected": T,
823
+ tabIndex: T || u == null && g === 0 ? 0 : -1,
824
+ className: F("cms-list__row", T && "is-selected"),
825
+ onClick: () => b == null ? void 0 : b(r.id),
826
+ onKeyDown: (C) => N(C, g, r.id),
827
+ onContextMenu: c ? (C) => {
828
+ C.preventDefault(), c(r.id, { x: C.clientX, y: C.clientY });
1040
829
  } : void 0,
1041
830
  children: [
1042
- v.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: v.lead }) : null,
1043
- /* @__PURE__ */ c("span", { className: "cms-list__text", children: [
1044
- /* @__PURE__ */ e("span", { className: H("cms-list__primary", v.unread === !0 && "is-unread"), children: v.primary }),
1045
- v.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: v.secondary }) : null
831
+ r.lead != null ? /* @__PURE__ */ n("span", { className: "cms-list__lead", children: r.lead }) : null,
832
+ /* @__PURE__ */ f("span", { className: "cms-list__text", children: [
833
+ /* @__PURE__ */ n("span", { className: F("cms-list__primary", r.unread === !0 && "is-unread"), children: r.primary }),
834
+ r.secondary != null ? /* @__PURE__ */ n("span", { className: "cms-list__secondary", children: r.secondary }) : null
1046
835
  ] }),
1047
- v.meta != null || v.count !== void 0 ? /* @__PURE__ */ c("span", { className: "cms-list__end", children: [
1048
- v.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: v.meta }) : null,
1049
- v.count !== void 0 && v.count > 0 ? /* @__PURE__ */ e("span", { className: "cms-badge cms-list__count", children: v.count }) : null
836
+ r.meta != null || r.count !== void 0 ? /* @__PURE__ */ f("span", { className: "cms-list__end", children: [
837
+ r.meta != null ? /* @__PURE__ */ n("span", { className: "cms-list__meta", children: r.meta }) : null,
838
+ r.count !== void 0 && r.count > 0 ? /* @__PURE__ */ n("span", { className: "cms-badge cms-list__count", children: r.count }) : null
1050
839
  ] }) : null
1051
840
  ]
1052
841
  },
1053
- v.id
842
+ r.id
1054
843
  );
1055
844
  }) })
1056
845
  ] });
1057
846
  }
1058
- function Ke({ at: n, items: t, onClose: l, label: r = "Actions", focus: s = "current" }) {
1059
- const a = P(null), h = P(null), d = fe(), [m, b] = D(n), i = t.filter((u) => u.offer.offered);
847
+ function Ke({ at: e, items: t, onClose: l, label: s = "Actions", focus: a = "current" }) {
848
+ const i = O(null), h = O(null), d = he(), [u, b] = D(e), c = t.filter((r) => r.offer.offered);
1060
849
  if ($e(() => {
1061
- if (!n) return;
1062
- const u = a.current, y = (u == null ? void 0 : u.offsetWidth) ?? 0, S = (u == null ? void 0 : u.offsetHeight) ?? 0;
1063
- b({ x: Math.max(0, Math.min(n.x, window.innerWidth - y)), y: Math.max(0, Math.min(n.y, window.innerHeight - S)) });
1064
- }, [n]), ee(() => {
1065
- var T, M;
1066
- if (!n) return;
850
+ if (!e) return;
851
+ const r = i.current, g = (r == null ? void 0 : r.offsetWidth) ?? 0, T = (r == null ? void 0 : r.offsetHeight) ?? 0;
852
+ b({ x: Math.max(0, Math.min(e.x, window.innerWidth - g)), y: Math.max(0, Math.min(e.y, window.innerHeight - T)) });
853
+ }, [e]), Q(() => {
854
+ var C, S;
855
+ if (!e) return;
1067
856
  h.current = document.activeElement;
1068
- const u = Array.from(((T = a.current) == null ? void 0 : T.querySelectorAll('[role^="menuitem"]:not([aria-disabled="true"])')) ?? []), y = s === "current" ? u.find((E) => E.getAttribute("aria-checked") === "true") : void 0;
1069
- (M = s === "last" ? u[u.length - 1] : y ?? u[0]) == null || M.focus();
1070
- const S = (E) => {
857
+ const r = Array.from(((C = i.current) == null ? void 0 : C.querySelectorAll('[role^="menuitem"]:not([aria-disabled="true"])')) ?? []), g = a === "current" ? r.find((x) => x.getAttribute("aria-checked") === "true") : void 0;
858
+ (S = a === "last" ? r[r.length - 1] : g ?? r[0]) == null || S.focus();
859
+ const T = (x) => {
1071
860
  var _;
1072
- (_ = a.current) != null && _.contains(E.target) || l();
861
+ (_ = i.current) != null && _.contains(x.target) || l();
1073
862
  };
1074
- return document.addEventListener("mousedown", S), () => {
1075
- var E, _;
1076
- document.removeEventListener("mousedown", S), (_ = (E = h.current) == null ? void 0 : E.focus) == null || _.call(E);
863
+ return document.addEventListener("mousedown", T), () => {
864
+ var x, _;
865
+ document.removeEventListener("mousedown", T), (_ = (x = h.current) == null ? void 0 : x.focus) == null || _.call(x);
1077
866
  };
1078
- }, [n, l, s]), !n || i.length === 0) return null;
1079
- const g = (u) => {
1080
- var T, M;
1081
- const y = Array.from(((T = a.current) == null ? void 0 : T.querySelectorAll('[role^="menuitem"]')) ?? []), S = y.indexOf(document.activeElement);
1082
- if (u.key === "Escape" || u.key === "Tab")
1083
- u.preventDefault(), l();
1084
- else if (u.key === "ArrowDown" || u.key === "ArrowUp") {
1085
- u.preventDefault();
1086
- const E = u.key === "ArrowDown" ? 1 : -1;
1087
- (M = y[(S + E + y.length) % y.length]) == null || M.focus();
867
+ }, [e, l, a]), !e || c.length === 0) return null;
868
+ const v = (r) => {
869
+ var C, S;
870
+ const g = Array.from(((C = i.current) == null ? void 0 : C.querySelectorAll('[role^="menuitem"]')) ?? []), T = g.indexOf(document.activeElement);
871
+ if (r.key === "Escape" || r.key === "Tab")
872
+ r.preventDefault(), l();
873
+ else if (r.key === "ArrowDown" || r.key === "ArrowUp") {
874
+ r.preventDefault();
875
+ const x = r.key === "ArrowDown" ? 1 : -1;
876
+ (S = g[(T + x + g.length) % g.length]) == null || S.focus();
1088
877
  }
1089
- }, f = (u) => {
1090
- const y = u.offer.refusal !== void 0;
1091
- return /* @__PURE__ */ c(
878
+ }, m = (r) => {
879
+ const g = r.offer.refusal !== void 0;
880
+ return /* @__PURE__ */ f(
1092
881
  "div",
1093
882
  {
1094
- role: u.checked === void 0 ? "menuitem" : "menuitemradio",
1095
- "aria-checked": u.checked,
883
+ role: r.checked === void 0 ? "menuitem" : "menuitemradio",
884
+ "aria-checked": r.checked,
1096
885
  tabIndex: -1,
1097
- "aria-disabled": y || void 0,
1098
- "aria-describedby": y ? `${d}-${u.id}` : void 0,
1099
- title: y ? u.offer.refusal : void 0,
1100
- className: H("cms-menu__item", u.danger && "is-danger", u.offer.locked && "is-locked", y && "is-refused"),
886
+ "aria-disabled": g || void 0,
887
+ "aria-describedby": g ? `${d}-${r.id}` : void 0,
888
+ title: g ? r.offer.refusal : void 0,
889
+ className: F("cms-menu__item", r.danger && "is-danger", r.offer.locked && "is-locked", g && "is-refused"),
1101
890
  onClick: () => {
1102
- y || (l(), u.onSelect());
891
+ g || (l(), r.onSelect());
1103
892
  },
1104
- onKeyDown: (S) => {
1105
- (S.key === "Enter" || S.key === " ") && !y && (S.preventDefault(), l(), u.onSelect());
893
+ onKeyDown: (T) => {
894
+ (T.key === "Enter" || T.key === " ") && !g && (T.preventDefault(), l(), r.onSelect());
1106
895
  },
1107
896
  children: [
1108
- u.checked !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-menu__check", children: u.checked ? /* @__PURE__ */ e(re, { name: "check" }) : null }) : null,
1109
- u.offer.locked ? /* @__PURE__ */ e(re, { name: "lock" }) : null,
1110
- /* @__PURE__ */ e("span", { className: "cms-menu__label", children: u.label }),
1111
- y ? /* @__PURE__ */ e("span", { id: `${d}-${u.id}`, className: "cms-menu__refusal", children: u.offer.refusal }) : null
897
+ r.checked !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-menu__check", children: r.checked ? /* @__PURE__ */ n(se, { name: "check" }) : null }) : null,
898
+ r.offer.locked ? /* @__PURE__ */ n(se, { name: "lock" }) : null,
899
+ /* @__PURE__ */ n("span", { className: "cms-menu__label", children: r.label }),
900
+ g ? /* @__PURE__ */ n("span", { id: `${d}-${r.id}`, className: "cms-menu__refusal", children: r.offer.refusal }) : null
1112
901
  ]
1113
902
  },
1114
- u.id
903
+ r.id
1115
904
  );
1116
- }, v = [];
1117
- for (const u of i) {
1118
- const y = v[v.length - 1];
1119
- y !== void 0 && y.group === u.group ? y.items.push(u) : v.push({ group: u.group, items: [u] });
905
+ }, N = [];
906
+ for (const r of c) {
907
+ const g = N[N.length - 1];
908
+ g !== void 0 && g.group === r.group ? g.items.push(r) : N.push({ group: r.group, items: [r] });
1120
909
  }
1121
- return ln(
1122
- /* @__PURE__ */ e(
910
+ return an(
911
+ /* @__PURE__ */ n(
1123
912
  "div",
1124
913
  {
1125
- ref: a,
914
+ ref: i,
1126
915
  className: "cms-menu",
1127
916
  role: "menu",
1128
- "aria-label": r,
1129
- style: { left: (m ?? n).x, top: (m ?? n).y },
1130
- onKeyDown: g,
1131
- onContextMenu: (u) => u.preventDefault(),
1132
- children: v.map((u, y) => /* @__PURE__ */ c($n, { children: [
1133
- y > 0 ? /* @__PURE__ */ e("div", { className: "cms-menu__separator", role: "separator" }) : null,
1134
- u.group === void 0 ? u.items.map(f) : /* @__PURE__ */ c("div", { role: "group", "aria-label": u.group, children: [
1135
- /* @__PURE__ */ e("div", { className: "cms-menu__group", "aria-hidden": "true", children: u.group }),
1136
- u.items.map(f)
917
+ "aria-label": s,
918
+ style: { left: (u ?? e).x, top: (u ?? e).y },
919
+ onKeyDown: v,
920
+ onContextMenu: (r) => r.preventDefault(),
921
+ children: N.map((r, g) => /* @__PURE__ */ f(Hn, { children: [
922
+ g > 0 ? /* @__PURE__ */ n("div", { className: "cms-menu__separator", role: "separator" }) : null,
923
+ r.group === void 0 ? r.items.map(m) : /* @__PURE__ */ f("div", { role: "group", "aria-label": r.group, children: [
924
+ /* @__PURE__ */ n("div", { className: "cms-menu__group", "aria-hidden": "true", children: r.group }),
925
+ r.items.map(m)
1137
926
  ] })
1138
- ] }, y))
927
+ ] }, g))
1139
928
  }
1140
929
  ),
1141
930
  document.body
1142
931
  );
1143
932
  }
1144
- function an() {
1145
- const [n, t] = D(/* @__PURE__ */ new Set()), [l, r] = D(null), s = P(null), a = P(null), h = (m) => t((b) => b.has(m) ? b : /* @__PURE__ */ new Set([...b, m])), d = (m) => t((b) => {
1146
- if (!b.has(m)) return b;
1147
- const i = new Set(b);
1148
- return i.delete(m), i;
933
+ function dn() {
934
+ const [e, t] = D(/* @__PURE__ */ new Set()), [l, s] = D(null), a = O(null), i = O(null), h = (u) => t((b) => b.has(u) ? b : /* @__PURE__ */ new Set([...b, u])), d = (u) => t((b) => {
935
+ if (!b.has(u)) return b;
936
+ const c = new Set(b);
937
+ return c.delete(u), c;
1149
938
  });
1150
- return ee(() => {
939
+ return Q(() => {
1151
940
  if (l === null) return;
1152
- const m = (b) => {
941
+ const u = (b) => {
1153
942
  b.key === "Escape" && h(l);
1154
943
  };
1155
- return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
944
+ return window.addEventListener("keydown", u), () => window.removeEventListener("keydown", u);
1156
945
  }, [l]), {
1157
- dismissed: (m) => n.has(m),
946
+ dismissed: (u) => e.has(u),
1158
947
  dismiss: h,
1159
948
  show: d,
1160
- pointerIn: (m) => {
1161
- a.current = m, r(m);
949
+ pointerIn: (u) => {
950
+ i.current = u, s(u);
1162
951
  },
1163
- pointerOut: (m) => {
1164
- a.current === m && (a.current = null), r((b) => b === m ? null : b), s.current !== m && d(m);
952
+ pointerOut: (u) => {
953
+ i.current === u && (i.current = null), s((b) => b === u ? null : b), a.current !== u && d(u);
1165
954
  },
1166
- focusIn: (m) => {
1167
- s.current = m;
955
+ focusIn: (u) => {
956
+ a.current = u;
1168
957
  },
1169
- focusOut: (m) => {
1170
- s.current === m && (s.current = null), a.current !== m && d(m);
958
+ focusOut: (u) => {
959
+ a.current === u && (a.current = null), i.current !== u && d(u);
1171
960
  }
1172
961
  };
1173
962
  }
1174
- function at(n, t, l) {
1175
- return Math.min(Math.max(n - l / 2, 0), Math.max(0, t - l));
963
+ function mt(e, t, l) {
964
+ return Math.min(Math.max(e - l / 2, 0), Math.max(0, t - l));
1176
965
  }
1177
- const _n = /* @__PURE__ */ new Set(), vn = { descriptionHidden: !1, elsewhereHidden: !1, titleCut: !1, titleFloor: 0, bare: _n, primaryBare: !1, hidden: _n, primaryHidden: !1, chipsCut: !1 }, gn = (n, t) => n.size === t.size && [...n].every((l) => t.has(l)), it = (n, t) => n.descriptionHidden === t.descriptionHidden && n.elsewhereHidden === t.elsewhereHidden && n.titleCut === t.titleCut && n.titleFloor === t.titleFloor && gn(n.bare, t.bare) && n.primaryBare === t.primaryBare && gn(n.hidden, t.hidden) && n.primaryHidden === t.primaryHidden && n.chipsCut === t.chipsCut, ct = 64, Ae = "primary";
1178
- function Jt({ title: n, icon: t, description: l, meta: r = [], primary: s, secondary: a, more: h = [], moreLabel: d, context: m, fullWidth: b = !1 }) {
1179
- var J, Ne, de;
1180
- const [i, g] = D(null), [f, v] = D(vn), [u, y] = D(null), [S, T] = D(null), M = an(), E = P(null), _ = P(null), N = P(null), I = fe(), K = fe(), z = [
1181
- ...(a ?? []).map((o) => ({
966
+ const wn = /* @__PURE__ */ new Set(), yn = { descriptionHidden: !1, elsewhereHidden: !1, titleCut: !1, titleFloor: 0, bare: wn, primaryBare: !1, hidden: wn, primaryHidden: !1, chipsCut: !1 }, Nn = (e, t) => e.size === t.size && [...e].every((l) => t.has(l)), ht = (e, t) => e.descriptionHidden === t.descriptionHidden && e.elsewhereHidden === t.elsewhereHidden && e.titleCut === t.titleCut && e.titleFloor === t.titleFloor && Nn(e.bare, t.bare) && e.primaryBare === t.primaryBare && Nn(e.hidden, t.hidden) && e.primaryHidden === t.primaryHidden && e.chipsCut === t.chipsCut, ft = 64, Ae = "primary";
967
+ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secondary: i, more: h = [], moreLabel: d, context: u, fullWidth: b = !1 }) {
968
+ var X, Ne, oe;
969
+ const [c, v] = D(null), [m, N] = D(yn), [r, g] = D(null), [T, C] = D(null), S = dn(), x = O(null), _ = O(null), y = O(null), I = he(), U = he(), P = [
970
+ ...(i ?? []).map((o) => ({
1182
971
  id: o.id,
1183
972
  label: o.label,
1184
973
  name: o.label,
1185
- icon: o.icon === void 0 ? null : Ue(o.icon),
974
+ icon: o.icon === void 0 ? null : Be(o.icon),
1186
975
  overflow: o.overflow,
1187
976
  danger: o.danger === !0,
1188
977
  offer: o.offer ?? { offered: !0, locked: !1 },
@@ -1198,382 +987,382 @@ function Jt({ title: n, icon: t, description: l, meta: r = [], primary: s, secon
1198
987
  offer: o.offer,
1199
988
  run: o.onSelect
1200
989
  }))
1201
- ].filter((o) => o.offer.offered), k = z.filter((o) => o.overflow === 0), F = z.filter((o) => o.overflow !== 0), U = k.length === 1 ? k[0] ?? null : null, Y = ot(F), W = F.filter((o) => o.overflow === void 0).map((o) => o.id).reverse(), j = [...Y, ...W.map((o) => [o])], X = [...U !== null ? [[U.id]] : [], ...j], ne = s !== void 0 && ((J = s.offer) == null ? void 0 : J.offered) !== !1, ce = (Ne = s == null ? void 0 : s.offer) == null ? void 0 : Ne.refusal, _e = s !== void 0 && (((de = s.offer) == null ? void 0 : de.offered) === !1 || ce !== void 0), oe = s !== void 0 && "menu" in s ? s.menu.filter((o) => o.offer.offered) : [], ue = s !== void 0 && "menu" in s && oe.length > 0 ? s : null, Ce = r.filter((o) => o.elsewhere === !0), pe = JSON.stringify([
1202
- n,
990
+ ].filter((o) => o.offer.offered), k = P.filter((o) => o.overflow === 0), B = P.filter((o) => o.overflow !== 0), z = k.length === 1 ? k[0] ?? null : null, j = pt(B), K = B.filter((o) => o.overflow === void 0).map((o) => o.id).reverse(), G = [...j, ...K.map((o) => [o])], Y = [...z !== null ? [[z.id]] : [], ...G], ee = a !== void 0 && ((X = a.offer) == null ? void 0 : X.offered) !== !1, ie = (Ne = a == null ? void 0 : a.offer) == null ? void 0 : Ne.refusal, be = a !== void 0 && (((oe = a.offer) == null ? void 0 : oe.offered) === !1 || ie !== void 0), ce = a !== void 0 && "menu" in a ? a.menu.filter((o) => o.offer.offered) : [], de = a !== void 0 && "menu" in a && ce.length > 0 ? a : null, Ce = s.filter((o) => o.elsewhere === !0), fe = JSON.stringify([
991
+ e,
1203
992
  t ?? null,
1204
993
  l ?? null,
1205
- r.map((o) => [o.id, o.text, o.elsewhere === !0]),
1206
- ne ? [s.label, s.icon, ue !== null] : null,
1207
- z.map((o) => [o.id, o.name, o.icon, o.overflow ?? null])
1208
- ]), le = Ie(() => {
1209
- const o = E.current, A = _.current;
994
+ s.map((o) => [o.id, o.text, o.elsewhere === !0]),
995
+ ee ? [a.label, a.icon, de !== null] : null,
996
+ P.map((o) => [o.id, o.name, o.icon, o.overflow ?? null])
997
+ ]), te = Ie(() => {
998
+ const o = x.current, A = _.current;
1210
999
  if (o === null || A === null) return;
1211
- const x = getComputedStyle(o), O = parseFloat(x.columnGap || "0") || 0, se = o.clientWidth - (parseFloat(x.paddingLeft) || 0) - (parseFloat(x.paddingRight) || 0), Q = (ie) => {
1000
+ const M = getComputedStyle(o), H = parseFloat(M.columnGap || "0") || 0, le = o.clientWidth - (parseFloat(M.paddingLeft) || 0) - (parseFloat(M.paddingRight) || 0), J = (re) => {
1212
1001
  var Me;
1213
- return ((Me = A.querySelector(ie)) == null ? void 0 : Me.getBoundingClientRect().width) ?? 0;
1214
- }, ke = Q('[data-measure="title"]'), Fe = Math.min(ke, ct), He = (ie) => {
1215
- const Me = be(ie), xe = [];
1216
- t !== void 0 && xe.push(Q('[data-measure="lead"]')), xe.push(ie.titleCut ? Fe : ke), l !== void 0 && !ie.descriptionHidden && xe.push(Q('[data-measure="description"]'));
1217
- for (const ge of r) ge.elsewhere === !0 && ie.elsewhereHidden || xe.push(Q(`[data-measure="meta"][data-measure-id="${CSS.escape(ge.id)}"]`));
1218
- for (const ge of z) {
1219
- if (Me.has(ge.id)) continue;
1220
- const Ze = ie.bare.has(ge.id) && ge.icon !== null;
1221
- xe.push(Q(`[data-measure="${Ze ? "icon" : "full"}"][data-measure-id="${CSS.escape(ge.id)}"]`));
1002
+ return ((Me = A.querySelector(re)) == null ? void 0 : Me.getBoundingClientRect().width) ?? 0;
1003
+ }, ke = J('[data-measure="title"]'), Re = Math.min(ke, ft), He = (re) => {
1004
+ const Me = pe(re), xe = [];
1005
+ t !== void 0 && xe.push(J('[data-measure="lead"]')), xe.push(re.titleCut ? Re : ke), l !== void 0 && !re.descriptionHidden && xe.push(J('[data-measure="description"]'));
1006
+ for (const ve of s) ve.elsewhere === !0 && re.elsewhereHidden || xe.push(J(`[data-measure="meta"][data-measure-id="${CSS.escape(ve.id)}"]`));
1007
+ for (const ve of P) {
1008
+ if (Me.has(ve.id)) continue;
1009
+ const Ze = re.bare.has(ve.id) && ve.icon !== null;
1010
+ xe.push(J(`[data-measure="${Ze ? "icon" : "full"}"][data-measure-id="${CSS.escape(ve.id)}"]`));
1222
1011
  }
1223
- return ne && !ie.primaryHidden && xe.push(Q(`[data-measure="${ie.primaryBare ? "primary-icon" : "primary"}"]`)), Me.size > 0 && xe.push(Q('[data-measure="more"]')), xe.reduce((ge, Ze) => ge + Ze, 0) + O * Math.max(0, xe.length - 1);
1012
+ return ee && !re.primaryHidden && xe.push(J(`[data-measure="${re.primaryBare ? "primary-icon" : "primary"}"]`)), Me.size > 0 && xe.push(J('[data-measure="more"]')), xe.reduce((ve, Ze) => ve + Ze, 0) + H * Math.max(0, xe.length - 1);
1224
1013
  };
1225
- let q = { ...vn, titleFloor: Fe };
1226
- const Re = (ie) => (q = ie, He(ie) <= se), mn = (() => {
1227
- if (Re(q) || l !== void 0 && Re({ ...q, descriptionHidden: !0 }) || (q = { ...q, descriptionHidden: !0 }, Ce.length > 0 && Re({ ...q, elsewhereHidden: !0 }))) return q;
1228
- q = { ...q, elsewhereHidden: !0 };
1229
- const ie = /* @__PURE__ */ new Set();
1230
- for (const Ve of X) {
1231
- for (const Ge of Ve) ie.add(Ge);
1232
- if (Re({ ...q, bare: new Set(ie) })) return q;
1014
+ let V = { ...yn, titleFloor: Re };
1015
+ const Oe = (re) => (V = re, He(re) <= le), pn = (() => {
1016
+ if (Oe(V) || l !== void 0 && Oe({ ...V, descriptionHidden: !0 }) || (V = { ...V, descriptionHidden: !0 }, Ce.length > 0 && Oe({ ...V, elsewhereHidden: !0 }))) return V;
1017
+ V = { ...V, elsewhereHidden: !0 };
1018
+ const re = /* @__PURE__ */ new Set();
1019
+ for (const Ve of Y) {
1020
+ for (const Ge of Ve) re.add(Ge);
1021
+ if (Oe({ ...V, bare: new Set(re) })) return V;
1233
1022
  }
1234
- if (ne && Re({ ...q, primaryBare: !0 })) return q;
1235
- q = { ...q, primaryBare: ne };
1236
- const Me = /* @__PURE__ */ new Set(), xe = [...j, ...ne ? [[Ae]] : []], ge = () => Me.size + k.length >= 2, Ze = (Ve) => ({ ...q, hidden: new Set([...Ve].filter((Ge) => Ge !== Ae)), primaryHidden: Ve.has(Ae) }), hn = q;
1023
+ if (ee && Oe({ ...V, primaryBare: !0 })) return V;
1024
+ V = { ...V, primaryBare: ee };
1025
+ const Me = /* @__PURE__ */ new Set(), xe = [...G, ...ee ? [[Ae]] : []], ve = () => Me.size + k.length >= 2, Ze = (Ve) => ({ ...V, hidden: new Set([...Ve].filter((Ge) => Ge !== Ae)), primaryHidden: Ve.has(Ae) }), bn = V;
1237
1026
  for (const Ve of xe) {
1238
1027
  for (const Ge of Ve) Me.add(Ge);
1239
- if (ge() && Re(Ze(Me))) return q;
1240
- q = hn;
1028
+ if (ve() && Oe(Ze(Me))) return V;
1029
+ V = bn;
1241
1030
  }
1242
- const fn = ge() ? Ze(Me) : hn;
1243
- return Re({ ...fn, titleCut: !0 }) ? q : { ...fn, titleCut: !0, chipsCut: !0 };
1031
+ const _n = ve() ? Ze(Me) : bn;
1032
+ return Oe({ ..._n, titleCut: !0 }) ? V : { ..._n, titleCut: !0, chipsCut: !0 };
1244
1033
  })();
1245
- v((ie) => it(ie, mn) ? ie : mn);
1246
- }, [pe]);
1247
- $e(le, [le]), ee(() => {
1248
- const o = E.current;
1034
+ N((re) => ht(re, pn) ? re : pn);
1035
+ }, [fe]);
1036
+ $e(te, [te]), Q(() => {
1037
+ const o = x.current;
1249
1038
  if (o === null || typeof ResizeObserver > "u") return;
1250
- const A = new ResizeObserver(() => le());
1039
+ const A = new ResizeObserver(() => te());
1251
1040
  return A.observe(o), () => A.disconnect();
1252
- }, [le]), ee(() => {
1041
+ }, [te]), Q(() => {
1253
1042
  const o = typeof document > "u" ? void 0 : document.fonts;
1254
1043
  if (o === void 0) return;
1255
1044
  let A = !0;
1256
- const x = () => {
1257
- A && le();
1045
+ const M = () => {
1046
+ A && te();
1258
1047
  };
1259
- return o.ready.then(x), o.addEventListener("loadingdone", x), () => {
1260
- A = !1, o.removeEventListener("loadingdone", x);
1048
+ return o.ready.then(M), o.addEventListener("loadingdone", M), () => {
1049
+ A = !1, o.removeEventListener("loadingdone", M);
1261
1050
  };
1262
- }, [le]);
1263
- function be(o) {
1051
+ }, [te]);
1052
+ function pe(o) {
1264
1053
  const A = o.hidden.size + (o.primaryHidden ? 1 : 0);
1265
- return /* @__PURE__ */ new Set([...k.filter((x) => x !== U || A > 0).map((x) => x.id), ...o.hidden, ...o.primaryHidden ? [Ae] : []]);
1054
+ return /* @__PURE__ */ new Set([...k.filter((M) => M !== z || A > 0).map((M) => M.id), ...o.hidden, ...o.primaryHidden ? [Ae] : []]);
1266
1055
  }
1267
- const ve = be(f), ye = z.filter((o) => !ve.has(o.id) && o !== U), te = U !== null && !ve.has(U.id) ? U : null, we = ne && !f.primaryHidden, w = (o) => z.find((A) => A.id === o), C = j.flat().filter((o) => f.hidden.has(o)).map(w).filter((o) => o !== void 0), Z = (o) => ({ id: o.id, label: o.label, offer: o.offer, ...o.danger ? { danger: !0 } : {}, onSelect: o.run }), G = [
1268
- ...ne && f.primaryHidden ? [{ id: Ae, label: s.label, offer: s.offer ?? { offered: !0, locked: !1 }, onSelect: () => {
1269
- _e || s.onPress();
1270
- } }, ...oe] : [],
1271
- ...C.map(Z),
1272
- ...ve.size > 0 ? k.map(Z) : []
1273
- ], p = G.length > 0, L = [
1274
- ...ye.map((o) => o.id),
1275
- ...te !== null ? [te.id] : [],
1276
- ...we ? [Ae, ...ue !== null ? ["primary-menu"] : []] : [],
1056
+ const _e = pe(m), we = P.filter((o) => !_e.has(o.id) && o !== z), ne = z !== null && !_e.has(z.id) ? z : null, ye = ee && !m.primaryHidden, w = (o) => P.find((A) => A.id === o), E = G.flat().filter((o) => m.hidden.has(o)).map(w).filter((o) => o !== void 0), W = (o) => ({ id: o.id, label: o.label, offer: o.offer, ...o.danger ? { danger: !0 } : {}, onSelect: o.run }), q = [
1057
+ ...ee && m.primaryHidden ? [{ id: Ae, label: a.label, offer: a.offer ?? { offered: !0, locked: !1 }, onSelect: () => {
1058
+ be || a.onPress();
1059
+ } }, ...ce] : [],
1060
+ ...E.map(W),
1061
+ ..._e.size > 0 ? k.map(W) : []
1062
+ ], p = q.length > 0, L = [
1063
+ ...we.map((o) => o.id),
1064
+ ...ne !== null ? [ne.id] : [],
1065
+ ...ye ? [Ae, ...de !== null ? ["primary-menu"] : []] : [],
1277
1066
  ...p ? ["more"] : []
1278
- ], V = u !== null && L.includes(u) ? u : L[0] ?? null;
1279
- ee(() => {
1067
+ ], Z = r !== null && L.includes(r) ? r : L[0] ?? null;
1068
+ Q(() => {
1280
1069
  var o, A;
1281
- u === null || L.includes(u) || !p || ((o = E.current) != null && o.contains(document.activeElement) || document.activeElement === document.body) && (y("more"), (A = N.current) == null || A.focus());
1282
- }, [f]);
1283
- const me = (o) => `${K}-${o}`, ae = (o) => {
1284
- var se;
1285
- const A = L.indexOf(V ?? "");
1286
- let x = null;
1287
- if (o.key === "ArrowRight" ? x = Math.min(L.length - 1, A + 1) : o.key === "ArrowLeft" ? x = Math.max(0, A - 1) : o.key === "Home" ? x = 0 : o.key === "End" && (x = L.length - 1), x === null) return;
1070
+ r === null || L.includes(r) || !p || ((o = x.current) != null && o.contains(document.activeElement) || document.activeElement === document.body) && (g("more"), (A = y.current) == null || A.focus());
1071
+ }, [m]);
1072
+ const ue = (o) => `${U}-${o}`, ae = (o) => {
1073
+ var le;
1074
+ const A = L.indexOf(Z ?? "");
1075
+ let M = null;
1076
+ if (o.key === "ArrowRight" ? M = Math.min(L.length - 1, A + 1) : o.key === "ArrowLeft" ? M = Math.max(0, A - 1) : o.key === "Home" ? M = 0 : o.key === "End" && (M = L.length - 1), M === null) return;
1288
1077
  o.preventDefault();
1289
- const O = L[x] ?? null;
1290
- y(O), O !== null && ((se = document.getElementById(me(O))) == null || se.focus());
1291
- }, he = (o, A) => {
1292
- const x = A.getBoundingClientRect();
1293
- g((i == null ? void 0 : i.which) === o ? null : { which: o, x: x.left, y: x.bottom + 4 });
1294
- }, Se = (o) => ({ id: me(o), tabIndex: V === o ? 0 : -1, onFocus: () => y(o) }), We = (o, A, x) => A ? {
1295
- ...S === o ? { "data-reason-shown": "" } : {},
1296
- ...M.dismissed(o) ? { "data-tip-dismissed": "" } : {},
1297
- onFocus: (O) => {
1298
- y(o), M.focusIn(o), Te(O.currentTarget, x);
1078
+ const H = L[M] ?? null;
1079
+ g(H), H !== null && ((le = document.getElementById(ue(H))) == null || le.focus());
1080
+ }, me = (o, A) => {
1081
+ const M = A.getBoundingClientRect();
1082
+ v((c == null ? void 0 : c.which) === o ? null : { which: o, x: M.left, y: M.bottom + 4 });
1083
+ }, Se = (o) => ({ id: ue(o), tabIndex: Z === o ? 0 : -1, onFocus: () => g(o) }), We = (o, A, M) => A ? {
1084
+ ...T === o ? { "data-reason-shown": "" } : {},
1085
+ ...S.dismissed(o) ? { "data-tip-dismissed": "" } : {},
1086
+ onFocus: (H) => {
1087
+ g(o), S.focusIn(o), Te(H.currentTarget, M);
1299
1088
  },
1300
1089
  onBlur: () => {
1301
- T((O) => O === o ? null : O), M.focusOut(o);
1090
+ C((H) => H === o ? null : H), S.focusOut(o);
1302
1091
  },
1303
- onMouseEnter: (O) => {
1304
- M.pointerIn(o), Te(O.currentTarget, x);
1092
+ onMouseEnter: (H) => {
1093
+ S.pointerIn(o), Te(H.currentTarget, M);
1305
1094
  },
1306
- onMouseLeave: () => M.pointerOut(o),
1307
- onKeyDown: (O) => {
1308
- O.key === "Escape" && (T((se) => se === o ? null : se), M.dismiss(o));
1095
+ onMouseLeave: () => S.pointerOut(o),
1096
+ onKeyDown: (H) => {
1097
+ H.key === "Escape" && (C((le) => le === o ? null : le), S.dismiss(o));
1309
1098
  }
1310
- } : {}, Be = (o, A, x) => {
1311
- T(o), M.show(o), Te(A, x);
1099
+ } : {}, Fe = (o, A, M) => {
1100
+ C(o), S.show(o), Te(A, M);
1312
1101
  }, Te = (o, A) => {
1313
- const x = document.getElementById(A), O = E.current;
1314
- if (x === null || O === null) return;
1315
- const se = x.style.display;
1316
- x.style.display = "block";
1317
- const Q = x.offsetWidth;
1318
- x.style.display = se;
1319
- const ke = O.getBoundingClientRect(), Fe = o.getBoundingClientRect();
1320
- x.style.left = `${String(at(Fe.left + Fe.width / 2 - ke.left, ke.width, Q))}px`, x.style.right = "auto";
1321
- }, Ee = (o, A, x) => /* @__PURE__ */ c("span", { id: o, className: "cms-section-header__tip", role: "tooltip", children: [
1322
- x !== null ? /* @__PURE__ */ c("span", { "aria-hidden": "true", children: [
1323
- x,
1102
+ const M = document.getElementById(A), H = x.current;
1103
+ if (M === null || H === null) return;
1104
+ const le = M.style.display;
1105
+ M.style.display = "block";
1106
+ const J = M.offsetWidth;
1107
+ M.style.display = le;
1108
+ const ke = H.getBoundingClientRect(), Re = o.getBoundingClientRect();
1109
+ M.style.left = `${String(mt(Re.left + Re.width / 2 - ke.left, ke.width, J))}px`, M.style.right = "auto";
1110
+ }, Ee = (o, A, M) => /* @__PURE__ */ f("span", { id: o, className: "cms-section-header__tip", role: "tooltip", children: [
1111
+ M !== null ? /* @__PURE__ */ f("span", { "aria-hidden": "true", children: [
1112
+ M,
1324
1113
  ": "
1325
1114
  ] }) : null,
1326
1115
  A
1327
1116
  ] }), R = (o) => {
1328
- const A = f.bare.has(o.id) && o.icon !== null, x = o.offer.refusal, O = `${K}-reason-${o.id}`;
1329
- return /* @__PURE__ */ c(
1117
+ const A = m.bare.has(o.id) && o.icon !== null, M = o.offer.refusal, H = `${U}-reason-${o.id}`;
1118
+ return /* @__PURE__ */ f(
1330
1119
  "button",
1331
1120
  {
1332
1121
  type: "button",
1333
- className: H("cms-button", "cms-button--quiet", "cms-section-header__secondary", A && "cms-section-header__secondary--bare", o.danger && "is-danger"),
1122
+ className: F("cms-button", "cms-button--quiet", "cms-section-header__secondary", A && "cms-section-header__secondary--bare", o.danger && "is-danger"),
1334
1123
  "data-action": o.id,
1335
- "aria-label": A || x !== void 0 ? o.name : void 0,
1336
- "aria-disabled": x !== void 0 ? "true" : void 0,
1337
- "aria-describedby": x !== void 0 ? O : void 0,
1338
- title: x === void 0 && A ? o.name : void 0,
1124
+ "aria-label": A || M !== void 0 ? o.name : void 0,
1125
+ "aria-disabled": M !== void 0 ? "true" : void 0,
1126
+ "aria-describedby": M !== void 0 ? H : void 0,
1127
+ title: M === void 0 && A ? o.name : void 0,
1339
1128
  ...Se(o.id),
1340
- ...We(o.id, x !== void 0, O),
1341
- onClick: (se) => {
1342
- x === void 0 ? o.run() : Be(o.id, se.currentTarget, O);
1129
+ ...We(o.id, M !== void 0, H),
1130
+ onClick: (le) => {
1131
+ M === void 0 ? o.run() : Fe(o.id, le.currentTarget, H);
1343
1132
  },
1344
1133
  children: [
1345
- o.icon !== null ? /* @__PURE__ */ e(B, { name: o.icon, size: 18 }) : null,
1346
- A ? null : /* @__PURE__ */ e("span", { className: "cms-section-header__label", children: o.label }),
1347
- x !== void 0 ? Ee(O, x, A ? o.name : null) : null
1134
+ o.icon !== null ? /* @__PURE__ */ n($, { name: o.icon, size: 18 }) : null,
1135
+ A ? null : /* @__PURE__ */ n("span", { className: "cms-section-header__label", children: o.label }),
1136
+ M !== void 0 ? Ee(H, M, A ? o.name : null) : null
1348
1137
  ]
1349
1138
  },
1350
1139
  o.id
1351
1140
  );
1352
1141
  };
1353
- return /* @__PURE__ */ c("header", { className: H("cms-section-header", b && "cms-section-header--full"), children: [
1354
- /* @__PURE__ */ c("div", { ref: E, className: H("cms-section-header__row", f.chipsCut && "cms-section-header__row--chips-cut"), "data-row": "1", children: [
1355
- t !== void 0 ? /* @__PURE__ */ e(B, { name: t }) : null,
1356
- /* @__PURE__ */ e(
1142
+ return /* @__PURE__ */ f("header", { className: F("cms-section-header", b && "cms-section-header--full"), children: [
1143
+ /* @__PURE__ */ f("div", { ref: x, className: F("cms-section-header__row", m.chipsCut && "cms-section-header__row--chips-cut"), "data-row": "1", children: [
1144
+ t !== void 0 ? /* @__PURE__ */ n($, { name: t }) : null,
1145
+ /* @__PURE__ */ n(
1357
1146
  "h1",
1358
1147
  {
1359
1148
  className: "cms-section-header__title",
1360
- title: n,
1361
- style: { minWidth: f.titleCut ? `${f.titleFloor}px` : "max-content" },
1362
- children: n
1149
+ title: e,
1150
+ style: { minWidth: m.titleCut ? `${m.titleFloor}px` : "max-content" },
1151
+ children: e
1363
1152
  }
1364
1153
  ),
1365
- l !== void 0 ? /* @__PURE__ */ e("span", { className: H("cms-section-header__description", f.descriptionHidden && "cms-visually-hidden"), children: l }) : null,
1366
- r.map((o, A) => /* @__PURE__ */ e(
1154
+ l !== void 0 ? /* @__PURE__ */ n("span", { className: F("cms-section-header__description", m.descriptionHidden && "cms-visually-hidden"), children: l }) : null,
1155
+ s.map((o, A) => /* @__PURE__ */ n(
1367
1156
  "span",
1368
1157
  {
1369
1158
  className: "cms-section-header__meta",
1370
1159
  "data-meta": o.id,
1371
- hidden: o.elsewhere === !0 && f.elsewhereHidden,
1372
- style: f.chipsCut && o.elsewhere !== !0 ? { flexShrink: A + 1 } : void 0,
1373
- ...f.chipsCut && o.elsewhere !== !0 ? { title: o.text, "aria-label": o.text } : {},
1160
+ hidden: o.elsewhere === !0 && m.elsewhereHidden,
1161
+ style: m.chipsCut && o.elsewhere !== !0 ? { flexShrink: A + 1 } : void 0,
1162
+ ...m.chipsCut && o.elsewhere !== !0 ? { title: o.text, "aria-label": o.text } : {},
1374
1163
  children: o.content
1375
1164
  },
1376
1165
  o.id
1377
1166
  )),
1378
- /* @__PURE__ */ c("div", { className: "cms-section-header__actions", role: "toolbar", "aria-label": n, onKeyDown: ae, children: [
1379
- ye.map(R),
1380
- te !== null ? R(te) : null,
1381
- we ? /* @__PURE__ */ c("span", { className: H("cms-section-header__primary", ue !== null && "cms-section-header__primary--split"), children: [
1382
- /* @__PURE__ */ c(
1167
+ /* @__PURE__ */ f("div", { className: "cms-section-header__actions", role: "toolbar", "aria-label": e, onKeyDown: ae, children: [
1168
+ we.map(R),
1169
+ ne !== null ? R(ne) : null,
1170
+ ye ? /* @__PURE__ */ f("span", { className: F("cms-section-header__primary", de !== null && "cms-section-header__primary--split"), children: [
1171
+ /* @__PURE__ */ f(
1383
1172
  "button",
1384
1173
  {
1385
1174
  type: "button",
1386
- className: H("cms-button", "cms-button--primary", f.primaryBare && "cms-section-header__primary--bare"),
1175
+ className: F("cms-button", "cms-button--primary", m.primaryBare && "cms-section-header__primary--bare"),
1387
1176
  "data-action": "primary",
1388
- "aria-label": f.primaryBare ? s.label : void 0,
1389
- "aria-disabled": _e ? "true" : void 0,
1390
- "aria-describedby": ce !== void 0 ? I : void 0,
1391
- title: f.primaryBare && ce === void 0 ? s.label : void 0,
1177
+ "aria-label": m.primaryBare ? a.label : void 0,
1178
+ "aria-disabled": be ? "true" : void 0,
1179
+ "aria-describedby": ie !== void 0 ? I : void 0,
1180
+ title: m.primaryBare && ie === void 0 ? a.label : void 0,
1392
1181
  ...Se(Ae),
1393
- ...We(Ae, ce !== void 0, I),
1182
+ ...We(Ae, ie !== void 0, I),
1394
1183
  onClick: (o) => {
1395
- _e ? ce !== void 0 && Be(Ae, o.currentTarget, I) : s.onPress();
1184
+ be ? ie !== void 0 && Fe(Ae, o.currentTarget, I) : a.onPress();
1396
1185
  },
1397
1186
  children: [
1398
- /* @__PURE__ */ e(B, { name: s.icon }),
1399
- f.primaryBare ? null : /* @__PURE__ */ c($, { children: [
1187
+ /* @__PURE__ */ n($, { name: a.icon }),
1188
+ m.primaryBare ? null : /* @__PURE__ */ f(ge, { children: [
1400
1189
  " ",
1401
- /* @__PURE__ */ e("span", { children: s.label })
1190
+ /* @__PURE__ */ n("span", { children: a.label })
1402
1191
  ] })
1403
1192
  ]
1404
1193
  }
1405
1194
  ),
1406
- ue !== null ? /* @__PURE__ */ e(
1195
+ de !== null ? /* @__PURE__ */ n(
1407
1196
  "button",
1408
1197
  {
1409
1198
  type: "button",
1410
1199
  className: "cms-button cms-button--primary cms-section-header__split",
1411
1200
  "data-action": "primary-menu",
1412
1201
  "aria-haspopup": "menu",
1413
- "aria-expanded": (i == null ? void 0 : i.which) === "primary",
1414
- "aria-label": ue.menuLabel,
1202
+ "aria-expanded": (c == null ? void 0 : c.which) === "primary",
1203
+ "aria-label": de.menuLabel,
1415
1204
  ...Se("primary-menu"),
1416
- onClick: (o) => he("primary", o.currentTarget),
1417
- children: /* @__PURE__ */ e(B, { name: "chevron-down" })
1205
+ onClick: (o) => me("primary", o.currentTarget),
1206
+ children: /* @__PURE__ */ n($, { name: "chevron-down" })
1418
1207
  }
1419
1208
  ) : null,
1420
- ce !== void 0 ? Ee(I, ce, f.primaryBare ? s.label : null) : null
1209
+ ie !== void 0 ? Ee(I, ie, m.primaryBare ? a.label : null) : null
1421
1210
  ] }) : null,
1422
- p ? /* @__PURE__ */ e(
1211
+ p ? /* @__PURE__ */ n(
1423
1212
  "button",
1424
1213
  {
1425
- ref: N,
1214
+ ref: y,
1426
1215
  type: "button",
1427
1216
  className: "cms-section-header__more",
1428
1217
  "data-action": "more",
1429
1218
  "aria-haspopup": "menu",
1430
- "aria-expanded": (i == null ? void 0 : i.which) === "more",
1219
+ "aria-expanded": (c == null ? void 0 : c.which) === "more",
1431
1220
  "aria-label": d,
1432
1221
  title: d,
1433
1222
  ...Se("more"),
1434
- onClick: (o) => he("more", o.currentTarget),
1435
- children: /* @__PURE__ */ e(B, { name: "more" })
1223
+ onClick: (o) => me("more", o.currentTarget),
1224
+ children: /* @__PURE__ */ n($, { name: "more" })
1436
1225
  }
1437
1226
  ) : null
1438
1227
  ] }),
1439
- /* @__PURE__ */ c("div", { ref: _, className: "cms-section-header__measure", "aria-hidden": "true", children: [
1440
- t !== void 0 ? /* @__PURE__ */ e("span", { "data-measure": "lead", children: /* @__PURE__ */ e(B, { name: t }) }) : null,
1441
- /* @__PURE__ */ e("span", { "data-measure": "title", className: "cms-section-header__title", children: n }),
1442
- l !== void 0 ? /* @__PURE__ */ e("span", { "data-measure": "description", className: "cms-section-header__description", children: l }) : null,
1443
- r.map((o) => /* @__PURE__ */ e("span", { "data-measure": "meta", "data-measure-id": o.id, className: "cms-section-header__meta", children: o.content }, o.id)),
1444
- z.map((o) => /* @__PURE__ */ c("span", { children: [
1445
- /* @__PURE__ */ c("span", { "data-measure": "full", "data-measure-id": o.id, className: "cms-button cms-button--quiet cms-section-header__secondary", children: [
1446
- o.icon !== null ? /* @__PURE__ */ e(B, { name: o.icon, size: 18 }) : null,
1447
- /* @__PURE__ */ e("span", { className: "cms-section-header__label", children: o.label })
1228
+ /* @__PURE__ */ f("div", { ref: _, className: "cms-section-header__measure", "aria-hidden": "true", children: [
1229
+ t !== void 0 ? /* @__PURE__ */ n("span", { "data-measure": "lead", children: /* @__PURE__ */ n($, { name: t }) }) : null,
1230
+ /* @__PURE__ */ n("span", { "data-measure": "title", className: "cms-section-header__title", children: e }),
1231
+ l !== void 0 ? /* @__PURE__ */ n("span", { "data-measure": "description", className: "cms-section-header__description", children: l }) : null,
1232
+ s.map((o) => /* @__PURE__ */ n("span", { "data-measure": "meta", "data-measure-id": o.id, className: "cms-section-header__meta", children: o.content }, o.id)),
1233
+ P.map((o) => /* @__PURE__ */ f("span", { children: [
1234
+ /* @__PURE__ */ f("span", { "data-measure": "full", "data-measure-id": o.id, className: "cms-button cms-button--quiet cms-section-header__secondary", children: [
1235
+ o.icon !== null ? /* @__PURE__ */ n($, { name: o.icon, size: 18 }) : null,
1236
+ /* @__PURE__ */ n("span", { className: "cms-section-header__label", children: o.label })
1448
1237
  ] }),
1449
- /* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-id": o.id, className: "cms-button cms-button--quiet cms-section-header__secondary cms-section-header__secondary--bare", children: o.icon !== null ? /* @__PURE__ */ e(B, { name: o.icon, size: 18 }) : null })
1238
+ /* @__PURE__ */ n("span", { "data-measure": "icon", "data-measure-id": o.id, className: "cms-button cms-button--quiet cms-section-header__secondary cms-section-header__secondary--bare", children: o.icon !== null ? /* @__PURE__ */ n($, { name: o.icon, size: 18 }) : null })
1450
1239
  ] }, o.id)),
1451
- ne ? /* @__PURE__ */ c($, { children: [
1452
- /* @__PURE__ */ c("span", { "data-measure": "primary", className: "cms-section-header__primary", children: [
1453
- /* @__PURE__ */ c("span", { className: "cms-button cms-button--primary", children: [
1454
- /* @__PURE__ */ e(B, { name: s.icon }),
1240
+ ee ? /* @__PURE__ */ f(ge, { children: [
1241
+ /* @__PURE__ */ f("span", { "data-measure": "primary", className: "cms-section-header__primary", children: [
1242
+ /* @__PURE__ */ f("span", { className: "cms-button cms-button--primary", children: [
1243
+ /* @__PURE__ */ n($, { name: a.icon }),
1455
1244
  " ",
1456
- /* @__PURE__ */ e("span", { children: s.label })
1245
+ /* @__PURE__ */ n("span", { children: a.label })
1457
1246
  ] }),
1458
- ue !== null ? /* @__PURE__ */ e("span", { className: "cms-button cms-button--primary cms-section-header__split", children: /* @__PURE__ */ e(B, { name: "chevron-down" }) }) : null
1247
+ de !== null ? /* @__PURE__ */ n("span", { className: "cms-button cms-button--primary cms-section-header__split", children: /* @__PURE__ */ n($, { name: "chevron-down" }) }) : null
1459
1248
  ] }),
1460
- /* @__PURE__ */ c("span", { "data-measure": "primary-icon", className: "cms-section-header__primary", children: [
1461
- /* @__PURE__ */ e("span", { className: "cms-button cms-button--primary cms-section-header__primary--bare", children: /* @__PURE__ */ e(B, { name: s.icon }) }),
1462
- ue !== null ? /* @__PURE__ */ e("span", { className: "cms-button cms-button--primary cms-section-header__split", children: /* @__PURE__ */ e(B, { name: "chevron-down" }) }) : null
1249
+ /* @__PURE__ */ f("span", { "data-measure": "primary-icon", className: "cms-section-header__primary", children: [
1250
+ /* @__PURE__ */ n("span", { className: "cms-button cms-button--primary cms-section-header__primary--bare", children: /* @__PURE__ */ n($, { name: a.icon }) }),
1251
+ de !== null ? /* @__PURE__ */ n("span", { className: "cms-button cms-button--primary cms-section-header__split", children: /* @__PURE__ */ n($, { name: "chevron-down" }) }) : null
1463
1252
  ] })
1464
1253
  ] }) : null,
1465
- /* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-section-header__more", children: /* @__PURE__ */ e(B, { name: "more" }) })
1254
+ /* @__PURE__ */ n("span", { "data-measure": "more", className: "cms-section-header__more", children: /* @__PURE__ */ n($, { name: "more" }) })
1466
1255
  ] })
1467
1256
  ] }),
1468
- m != null ? /* @__PURE__ */ e("div", { className: "cms-section-header__context", "data-row": "2", children: m }) : null,
1469
- ue !== null ? /* @__PURE__ */ e(Ke, { at: (i == null ? void 0 : i.which) === "primary" ? i : null, items: oe, onClose: () => g(null), label: ue.menuLabel }) : null,
1470
- /* @__PURE__ */ e(Ke, { at: (i == null ? void 0 : i.which) === "more" ? i : null, items: G, onClose: () => g(null), label: d })
1257
+ u != null ? /* @__PURE__ */ n("div", { className: "cms-section-header__context", "data-row": "2", children: u }) : null,
1258
+ de !== null ? /* @__PURE__ */ n(Ke, { at: (c == null ? void 0 : c.which) === "primary" ? c : null, items: ce, onClose: () => v(null), label: de.menuLabel }) : null,
1259
+ /* @__PURE__ */ n(Ke, { at: (c == null ? void 0 : c.which) === "more" ? c : null, items: q, onClose: () => v(null), label: d })
1471
1260
  ] });
1472
1261
  }
1473
- function ot(n) {
1262
+ function pt(e) {
1474
1263
  const t = /* @__PURE__ */ new Map();
1475
- for (const l of n) l.overflow !== void 0 && l.overflow !== 0 && t.set(l.overflow, [...t.get(l.overflow) ?? [], l.id]);
1476
- return [...t.entries()].sort(([l], [r]) => l - r).map(([, l]) => l);
1264
+ for (const l of e) l.overflow !== void 0 && l.overflow !== 0 && t.set(l.overflow, [...t.get(l.overflow) ?? [], l.id]);
1265
+ return [...t.entries()].sort(([l], [s]) => l - s).map(([, l]) => l);
1477
1266
  }
1478
- function Qt({ head: n, children: t, className: l, scrollRef: r, onScroll: s, bodyProps: a }) {
1479
- return /* @__PURE__ */ c("div", { className: H("cms-column", l), children: [
1480
- n == null ? null : /* @__PURE__ */ e("div", { className: "cms-column__head", children: n }),
1481
- /* @__PURE__ */ e("div", { ...a, className: H("cms-column__body", a == null ? void 0 : a.className), ref: r, onScroll: s, children: t })
1267
+ function al({ head: e, children: t, className: l, scrollRef: s, onScroll: a, bodyProps: i }) {
1268
+ return /* @__PURE__ */ f("div", { className: F("cms-column", l), children: [
1269
+ e == null ? null : /* @__PURE__ */ n("div", { className: "cms-column__head", children: e }),
1270
+ /* @__PURE__ */ n("div", { ...i, className: F("cms-column__body", i == null ? void 0 : i.className), ref: s, onScroll: a, children: t })
1482
1271
  ] });
1483
1272
  }
1484
- function el({ title: n, scope: t, actions: l, backLink: r }) {
1485
- return /* @__PURE__ */ c("header", { className: "cms-page-header", children: [
1486
- r ? /* @__PURE__ */ c(
1273
+ function rl({ title: e, scope: t, actions: l, backLink: s }) {
1274
+ return /* @__PURE__ */ f("header", { className: "cms-page-header", children: [
1275
+ s ? /* @__PURE__ */ f(
1487
1276
  "a",
1488
1277
  {
1489
1278
  className: "cms-page-header__back",
1490
- href: r.href ?? "#",
1491
- onClick: (s) => {
1492
- r.onBack && (s.preventDefault(), r.onBack());
1279
+ href: s.href ?? "#",
1280
+ onClick: (a) => {
1281
+ s.onBack && (a.preventDefault(), s.onBack());
1493
1282
  },
1494
1283
  children: [
1495
- /* @__PURE__ */ e(re, { name: "back" }),
1284
+ /* @__PURE__ */ n(se, { name: "back" }),
1496
1285
  " ",
1497
- r.label
1286
+ s.label
1498
1287
  ]
1499
1288
  }
1500
1289
  ) : null,
1501
- /* @__PURE__ */ c("div", { className: "cms-page-header__row", children: [
1502
- /* @__PURE__ */ c("div", { className: "cms-page-header__titles", children: [
1503
- /* @__PURE__ */ e("h1", { className: "cms-page-header__title", children: n }),
1504
- t != null ? /* @__PURE__ */ e("p", { className: "cms-page-header__scope", children: t }) : null
1290
+ /* @__PURE__ */ f("div", { className: "cms-page-header__row", children: [
1291
+ /* @__PURE__ */ f("div", { className: "cms-page-header__titles", children: [
1292
+ /* @__PURE__ */ n("h1", { className: "cms-page-header__title", children: e }),
1293
+ t != null ? /* @__PURE__ */ n("p", { className: "cms-page-header__scope", children: t }) : null
1505
1294
  ] }),
1506
- l != null ? /* @__PURE__ */ e("div", { className: "cms-page-header__actions", children: l }) : null
1295
+ l != null ? /* @__PURE__ */ n("div", { className: "cms-page-header__actions", children: l }) : null
1507
1296
  ] })
1508
1297
  ] });
1509
1298
  }
1510
- function nl({ tabs: n, active: t, onSelect: l, label: r }) {
1511
- const s = P([]), a = (h, d) => {
1512
- var g;
1513
- const m = n.length - 1, b = h.key === "ArrowRight" ? d === m ? 0 : d + 1 : h.key === "ArrowLeft" ? d === 0 ? m : d - 1 : h.key === "Home" ? 0 : h.key === "End" ? m : null;
1299
+ function il({ tabs: e, active: t, onSelect: l, label: s }) {
1300
+ const a = O([]), i = (h, d) => {
1301
+ var v;
1302
+ const u = e.length - 1, b = h.key === "ArrowRight" ? d === u ? 0 : d + 1 : h.key === "ArrowLeft" ? d === 0 ? u : d - 1 : h.key === "Home" ? 0 : h.key === "End" ? u : null;
1514
1303
  if (b === null) return;
1515
1304
  h.preventDefault();
1516
- const i = n[b];
1517
- i && (l(i.id), (g = s.current[b]) == null || g.focus());
1305
+ const c = e[b];
1306
+ c && (l(c.id), (v = a.current[b]) == null || v.focus());
1518
1307
  };
1519
- return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": r, children: n.map((h, d) => {
1520
- const m = h.id === t;
1521
- return /* @__PURE__ */ c(
1308
+ return /* @__PURE__ */ n("div", { className: "cms-tabs", role: "tablist", "aria-label": s, children: e.map((h, d) => {
1309
+ const u = h.id === t;
1310
+ return /* @__PURE__ */ f(
1522
1311
  "button",
1523
1312
  {
1524
1313
  ref: (b) => {
1525
- s.current[d] = b;
1314
+ a.current[d] = b;
1526
1315
  },
1527
1316
  type: "button",
1528
1317
  role: "tab",
1529
- className: H("cms-tab", m && "is-active"),
1530
- "aria-selected": m,
1531
- tabIndex: m ? 0 : -1,
1318
+ className: F("cms-tab", u && "is-active"),
1319
+ "aria-selected": u,
1320
+ tabIndex: u ? 0 : -1,
1532
1321
  onClick: () => l(h.id),
1533
- onKeyDown: (b) => a(b, d),
1322
+ onKeyDown: (b) => i(b, d),
1534
1323
  children: [
1535
1324
  h.label,
1536
- h.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: h.count }) : null
1325
+ h.count !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-tab__count", children: h.count }) : null
1537
1326
  ]
1538
1327
  },
1539
1328
  h.id
1540
1329
  );
1541
1330
  }) });
1542
1331
  }
1543
- function dt(n) {
1544
- const t = n.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), l = (s) => {
1545
- var a;
1546
- return (a = s == null ? void 0 : s.match(/[\p{L}\p{N}]/u)) == null ? void 0 : a[0];
1332
+ function bt(e) {
1333
+ const t = e.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), l = (a) => {
1334
+ var i;
1335
+ return (i = a == null ? void 0 : a.match(/[\p{L}\p{N}]/u)) == null ? void 0 : i[0];
1547
1336
  };
1548
1337
  return (t.length > 1 ? [l(t[0]), l(t[t.length - 1])] : [l(t[0])]).filter(Boolean).join("").toUpperCase();
1549
1338
  }
1550
- function ut(n) {
1339
+ function _t(e) {
1551
1340
  let t = 0;
1552
- for (const l of n.trim().toLowerCase())
1341
+ for (const l of e.trim().toLowerCase())
1553
1342
  t = t * 31 + (l.codePointAt(0) ?? 0) >>> 0;
1554
1343
  return t % 6 + 1;
1555
1344
  }
1556
- function Ye({ name: n, pictureUrl: t, presence: l, connection: r, deleted: s = !1, placeholder: a = !1, size: h = 32, tintSeed: d, unnamedLabel: m }) {
1557
- const b = s || a, i = dt(n) || "?", g = n.trim() === "" ? (m == null ? void 0 : m.trim()) || "?" : n, f = r !== void 0 ? `is-${r.state === "offline" ? "disconnected" : r.state}` : l === void 0 ? null : `is-${l === "busy" ? "away" : l}`, v = r !== void 0 ? `${g}, ${r.label}` : l ? `${g}, ${l}` : g;
1558
- return /* @__PURE__ */ c(
1345
+ function Ye({ name: e, pictureUrl: t, presence: l, connection: s, deleted: a = !1, placeholder: i = !1, size: h = 32, tintSeed: d, unnamedLabel: u }) {
1346
+ const b = a || i, c = bt(e) || "?", v = e.trim() === "" ? (u == null ? void 0 : u.trim()) || "?" : e, m = s !== void 0 ? `is-${s.state === "offline" ? "disconnected" : s.state}` : l === void 0 ? null : `is-${l === "busy" ? "away" : l}`, N = s !== void 0 ? `${v}, ${s.label}` : l ? `${v}, ${l}` : v;
1347
+ return /* @__PURE__ */ f(
1559
1348
  "span",
1560
1349
  {
1561
- className: H("cms-avatar", b ? "cms-avatar--deleted" : `cms-avatar--tint-${ut(d ?? n)}`),
1350
+ className: F("cms-avatar", b ? "cms-avatar--deleted" : `cms-avatar--tint-${_t(d ?? e)}`),
1562
1351
  style: { width: h, height: h, fontSize: Math.round(h * 0.4) },
1563
1352
  role: "img",
1564
- "aria-label": v,
1565
- ...r === void 0 ? {} : { title: r.label },
1353
+ "aria-label": N,
1354
+ ...s === void 0 ? {} : { title: s.label },
1566
1355
  children: [
1567
- b ? /* @__PURE__ */ e(B, { name: "user", size: Math.round(h * 0.6) }) : t ? /* @__PURE__ */ e("img", { src: t, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: i }),
1568
- f === null ? null : /* @__PURE__ */ e("span", { className: H("cms-avatar__presence", f), "aria-hidden": "true" })
1356
+ b ? /* @__PURE__ */ n($, { name: "user", size: Math.round(h * 0.6) }) : t ? /* @__PURE__ */ n("img", { src: t, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ n("span", { "aria-hidden": "true", children: c }),
1357
+ m === null ? null : /* @__PURE__ */ n("span", { className: F("cms-avatar__presence", m), "aria-hidden": "true" })
1569
1358
  ]
1570
1359
  }
1571
1360
  );
1572
1361
  }
1573
- const mt = 64, cn = "cms-splitter:";
1574
- function en(n) {
1362
+ const vt = 64, un = "cms-splitter:";
1363
+ function tn(e) {
1575
1364
  try {
1576
- const t = window.localStorage.getItem(cn + n);
1365
+ const t = window.localStorage.getItem(un + e);
1577
1366
  if (t === null) return null;
1578
1367
  const l = Number(t);
1579
1368
  return Number.isFinite(l) ? l : null;
@@ -1581,202 +1370,202 @@ function en(n) {
1581
1370
  return null;
1582
1371
  }
1583
1372
  }
1584
- function ht(n, t) {
1585
- if (n !== void 0)
1373
+ function gt(e, t) {
1374
+ if (e !== void 0)
1586
1375
  try {
1587
- window.localStorage.setItem(cn + n, String(t));
1376
+ window.localStorage.setItem(un + e, String(t));
1588
1377
  } catch {
1589
1378
  }
1590
1379
  }
1591
- function ft(n) {
1592
- if (n !== void 0)
1380
+ function wt(e) {
1381
+ if (e !== void 0)
1593
1382
  try {
1594
- window.localStorage.removeItem(cn + n);
1383
+ window.localStorage.removeItem(un + e);
1595
1384
  } catch {
1596
1385
  }
1597
1386
  }
1598
- function pt({ storageKey: n, value: t, default: l, min: r, max: s, step: a = 16, label: h, onChange: d, className: m, style: b }) {
1599
- const i = Math.max(r, s), g = (_) => Math.round(Math.min(Math.max(_, r), i)), [f, v] = D(() => {
1600
- const _ = n === void 0 ? null : en(n);
1601
- return g(_ ?? l);
1602
- }), u = g(t ?? f), y = P(null), [S, T] = D(!1);
1387
+ function yt({ storageKey: e, value: t, default: l, min: s, max: a, step: i = 16, label: h, onChange: d, className: u, style: b }) {
1388
+ const c = Math.max(s, a), v = (_) => Math.round(Math.min(Math.max(_, s), c)), [m, N] = D(() => {
1389
+ const _ = e === void 0 ? null : tn(e);
1390
+ return v(_ ?? l);
1391
+ }), r = v(t ?? m), g = O(null), [T, C] = D(!1);
1603
1392
  $e(() => {
1604
- if (n === void 0) return;
1605
- const _ = en(n);
1393
+ if (e === void 0) return;
1394
+ const _ = tn(e);
1606
1395
  if (_ === null) return;
1607
- const N = g(_);
1608
- (t === void 0 || N !== g(t)) && (v(N), d(N, !0));
1396
+ const y = v(_);
1397
+ (t === void 0 || y !== v(t)) && (N(y), d(y, !0));
1609
1398
  }, []), $e(() => {
1610
- t !== void 0 && g(t) !== t && d(g(t), !0);
1611
- }, [t, r, i]);
1612
- const M = (_, N) => {
1613
- const I = g(_);
1614
- v(I), N && ht(n, I), d(I, N);
1615
- }, E = () => {
1616
- const _ = y.current;
1617
- y.current = null, T(!1), _ !== null && _.last !== _.from && M(_.last, !0);
1399
+ t !== void 0 && v(t) !== t && d(v(t), !0);
1400
+ }, [t, s, c]);
1401
+ const S = (_, y) => {
1402
+ const I = v(_);
1403
+ N(I), y && gt(e, I), d(I, y);
1404
+ }, x = () => {
1405
+ const _ = g.current;
1406
+ g.current = null, C(!1), _ !== null && _.last !== _.from && S(_.last, !0);
1618
1407
  };
1619
- return /* @__PURE__ */ e(
1408
+ return /* @__PURE__ */ n(
1620
1409
  "div",
1621
1410
  {
1622
1411
  role: "separator",
1623
1412
  tabIndex: 0,
1624
1413
  "aria-orientation": "vertical",
1625
1414
  "aria-label": h,
1626
- "aria-valuenow": u,
1627
- "aria-valuemin": r,
1628
- "aria-valuemax": i,
1629
- className: H("cms-splitter", S && "is-dragging", u <= r && "is-at-min", u >= i && "is-at-max", m),
1415
+ "aria-valuenow": r,
1416
+ "aria-valuemin": s,
1417
+ "aria-valuemax": c,
1418
+ className: F("cms-splitter", T && "is-dragging", r <= s && "is-at-min", r >= c && "is-at-max", u),
1630
1419
  style: b,
1631
1420
  onPointerDown: (_) => {
1632
- var I, K;
1421
+ var I, U;
1633
1422
  if (_.button > 0) return;
1634
- _.preventDefault(), (K = (I = _.currentTarget).setPointerCapture) == null || K.call(I, _.pointerId);
1635
- const N = getComputedStyle(_.currentTarget).direction === "rtl" ? -1 : 1;
1636
- y.current = { x: _.clientX, from: u, last: u, sign: N }, T(!0);
1423
+ _.preventDefault(), (U = (I = _.currentTarget).setPointerCapture) == null || U.call(I, _.pointerId);
1424
+ const y = getComputedStyle(_.currentTarget).direction === "rtl" ? -1 : 1;
1425
+ g.current = { x: _.clientX, from: r, last: r, sign: y }, C(!0);
1637
1426
  },
1638
1427
  onPointerMove: (_) => {
1639
- const N = y.current;
1640
- N === null || !Number.isFinite(_.clientX) || (N.last = g(N.from + N.sign * (_.clientX - N.x)), M(N.last, !1));
1428
+ const y = g.current;
1429
+ y === null || !Number.isFinite(_.clientX) || (y.last = v(y.from + y.sign * (_.clientX - y.x)), S(y.last, !1));
1641
1430
  },
1642
- onPointerUp: E,
1643
- onPointerCancel: E,
1431
+ onPointerUp: x,
1432
+ onPointerCancel: x,
1644
1433
  onDoubleClick: () => {
1645
- ft(n);
1646
- const _ = g(l);
1647
- v(_), d(_, !0);
1434
+ wt(e);
1435
+ const _ = v(l);
1436
+ N(_), d(_, !0);
1648
1437
  },
1649
1438
  onKeyDown: (_) => {
1650
- const N = _.shiftKey ? mt : a, I = getComputedStyle(_.currentTarget).direction === "rtl" ? -1 : 1, K = _.key === "ArrowLeft" ? u - I * N : _.key === "ArrowRight" ? u + I * N : _.key === "Home" ? r : _.key === "End" ? i : null;
1651
- K !== null && (_.preventDefault(), M(K, !0));
1439
+ const y = _.shiftKey ? vt : i, I = getComputedStyle(_.currentTarget).direction === "rtl" ? -1 : 1, U = _.key === "ArrowLeft" ? r - I * y : _.key === "ArrowRight" ? r + I * y : _.key === "Home" ? s : _.key === "End" ? c : null;
1440
+ U !== null && (_.preventDefault(), S(U, !0));
1652
1441
  }
1653
1442
  }
1654
1443
  );
1655
1444
  }
1656
- function bt({ count: n, label: t, max: l = 99 }) {
1657
- return n <= 0 ? null : /* @__PURE__ */ c("span", { className: "cms-badge", children: [
1658
- /* @__PURE__ */ e("span", { "aria-hidden": "true", children: n > l ? `${l}+` : n }),
1659
- /* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: t })
1445
+ function Nt({ count: e, label: t, max: l = 99 }) {
1446
+ return e <= 0 ? null : /* @__PURE__ */ f("span", { className: "cms-badge", children: [
1447
+ /* @__PURE__ */ n("span", { "aria-hidden": "true", children: e > l ? `${l}+` : e }),
1448
+ /* @__PURE__ */ n("span", { className: "cms-visually-hidden", children: t })
1660
1449
  ] });
1661
1450
  }
1662
- function tl({ product: n, mark: t, rail: l, active: r, onNavigate: s, server: a, search: h, account: d, children: m, railLabel: b = "Sections" }) {
1663
- return /* @__PURE__ */ c("div", { className: "cms-shell", children: [
1664
- /* @__PURE__ */ c("nav", { className: "cms-shell__rail", "aria-label": b, children: [
1665
- /* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: t }),
1666
- /* @__PURE__ */ e("ul", { className: "cms-shell__items", children: l.map((i) => {
1667
- const g = i.id === r;
1668
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(
1451
+ function cl({ product: e, mark: t, rail: l, active: s, onNavigate: a, server: i, search: h, account: d, children: u, railLabel: b = "Sections" }) {
1452
+ return /* @__PURE__ */ f("div", { className: "cms-shell", children: [
1453
+ /* @__PURE__ */ f("nav", { className: "cms-shell__rail", "aria-label": b, children: [
1454
+ /* @__PURE__ */ n("span", { className: "cms-shell__mark", "aria-hidden": "true", children: t }),
1455
+ /* @__PURE__ */ n("ul", { className: "cms-shell__items", children: l.map((c) => {
1456
+ const v = c.id === s;
1457
+ return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ f(
1669
1458
  "a",
1670
1459
  {
1671
- href: i.href,
1672
- className: H("cms-shell__item", g && "is-active"),
1673
- "aria-current": g ? "page" : void 0,
1674
- title: i.label,
1675
- onClick: (f) => {
1676
- s && (f.preventDefault(), s(i.id));
1460
+ href: c.href,
1461
+ className: F("cms-shell__item", v && "is-active"),
1462
+ "aria-current": v ? "page" : void 0,
1463
+ title: c.label,
1464
+ onClick: (m) => {
1465
+ a && (m.preventDefault(), a(c.id));
1677
1466
  },
1678
1467
  children: [
1679
- /* @__PURE__ */ c("span", { className: "cms-shell__icon", children: [
1680
- /* @__PURE__ */ e(B, { name: i.icon, size: 22 }),
1681
- i.badge ? /* @__PURE__ */ e(bt, { count: i.badge.count, label: i.badge.label }) : null
1468
+ /* @__PURE__ */ f("span", { className: "cms-shell__icon", children: [
1469
+ /* @__PURE__ */ n($, { name: c.icon, size: 22 }),
1470
+ c.badge ? /* @__PURE__ */ n(Nt, { count: c.badge.count, label: c.badge.label }) : null
1682
1471
  ] }),
1683
- /* @__PURE__ */ e("span", { className: "cms-shell__label", children: i.label })
1472
+ /* @__PURE__ */ n("span", { className: "cms-shell__label", children: c.label })
1684
1473
  ]
1685
1474
  }
1686
- ) }, i.id);
1475
+ ) }, c.id);
1687
1476
  }) })
1688
1477
  ] }),
1689
- /* @__PURE__ */ c("header", { className: "cms-shell__top", children: [
1690
- /* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
1691
- a != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: a }) : null,
1692
- h != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: h }) : null,
1693
- d != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: d }) : null
1478
+ /* @__PURE__ */ f("header", { className: "cms-shell__top", children: [
1479
+ /* @__PURE__ */ n("span", { className: "cms-shell__product", children: e }),
1480
+ i != null ? /* @__PURE__ */ n("div", { className: "cms-shell__server", children: i }) : null,
1481
+ h != null ? /* @__PURE__ */ n("div", { className: "cms-shell__search", children: h }) : null,
1482
+ d != null ? /* @__PURE__ */ n("div", { className: "cms-shell__account", children: d }) : null
1694
1483
  ] }),
1695
- /* @__PURE__ */ e("main", { className: "cms-shell__main", children: m })
1484
+ /* @__PURE__ */ n("main", { className: "cms-shell__main", children: u })
1696
1485
  ] });
1697
1486
  }
1698
- function ll({ label: n, placeholder: t, value: l, onChange: r, onSearch: s }) {
1699
- return /* @__PURE__ */ c(
1487
+ function ol({ label: e, placeholder: t, value: l, onChange: s, onSearch: a }) {
1488
+ return /* @__PURE__ */ f(
1700
1489
  "form",
1701
1490
  {
1702
1491
  role: "search",
1703
1492
  className: "cms-search",
1704
- onSubmit: (a) => {
1705
- a.preventDefault(), s == null || s(l);
1493
+ onSubmit: (i) => {
1494
+ i.preventDefault(), a == null || a(l);
1706
1495
  },
1707
1496
  children: [
1708
- /* @__PURE__ */ e(B, { name: "search", size: 18 }),
1709
- /* @__PURE__ */ e(
1497
+ /* @__PURE__ */ n($, { name: "search", size: 18 }),
1498
+ /* @__PURE__ */ n(
1710
1499
  "input",
1711
1500
  {
1712
1501
  className: "cms-search__input",
1713
1502
  type: "search",
1714
- "aria-label": n,
1503
+ "aria-label": e,
1715
1504
  placeholder: t,
1716
1505
  value: l,
1717
- onChange: (a) => r(a.target.value)
1506
+ onChange: (i) => s(i.target.value)
1718
1507
  }
1719
1508
  )
1720
1509
  ]
1721
1510
  }
1722
1511
  );
1723
1512
  }
1724
- function _t(n, t, l) {
1725
- const r = n.map((a) => Math.min(Math.max(a.width, a.min), a.max));
1726
- let s = r.reduce((a, h) => a + h, 0) + l - t;
1727
- for (let a = r.length - 1; a >= 0 && s > 0; a -= 1) {
1728
- const h = Math.min(s, r[a] - n[a].min);
1729
- r[a] = r[a] - h, s -= h;
1513
+ function kt(e, t, l) {
1514
+ const s = e.map((i) => Math.min(Math.max(i.width, i.min), i.max));
1515
+ let a = s.reduce((i, h) => i + h, 0) + l - t;
1516
+ for (let i = s.length - 1; i >= 0 && a > 0; i -= 1) {
1517
+ const h = Math.min(a, s[i] - e[i].min);
1518
+ s[i] = s[i] - h, a -= h;
1730
1519
  }
1731
- return r;
1520
+ return s;
1732
1521
  }
1733
- function sl({ panes: n, active: t, back: l, sizes: r, lastMin: s = 360, onResize: a, storageKey: h }) {
1734
- const d = Math.min(Math.max(t ?? n.length - 1, 0), n.length - 1), m = P(null), [b, i] = D(0), g = (r ?? []).slice(0, n.length - 1), [f, v] = D(() => h === void 0 ? [] : g.map((_, N) => en(`${h}:${String(N)}`) ?? void 0)), [u, y] = D(!1), S = g.map((_, N) => _ !== void 0 && f[N] !== void 0 ? { ..._, width: f[N] } : _), T = S.length === n.length - 1 && S.every((_) => _ !== void 0);
1522
+ function dl({ panes: e, active: t, back: l, sizes: s, lastMin: a = 360, onResize: i, storageKey: h }) {
1523
+ const d = Math.min(Math.max(t ?? e.length - 1, 0), e.length - 1), u = O(null), [b, c] = D(0), v = (s ?? []).slice(0, e.length - 1), [m, N] = D(() => h === void 0 ? [] : v.map((_, y) => tn(`${h}:${String(y)}`) ?? void 0)), [r, g] = D(!1), T = v.map((_, y) => _ !== void 0 && m[y] !== void 0 ? { ..._, width: m[y] } : _), C = T.length === e.length - 1 && T.every((_) => _ !== void 0);
1735
1524
  $e(() => {
1736
- const _ = m.current;
1737
- if (_ === null || !T) return;
1738
- const N = () => i(_.clientWidth);
1739
- if (N(), typeof ResizeObserver > "u") return;
1740
- const I = new ResizeObserver(N);
1525
+ const _ = u.current;
1526
+ if (_ === null || !C) return;
1527
+ const y = () => c(_.clientWidth);
1528
+ if (y(), typeof ResizeObserver > "u") return;
1529
+ const I = new ResizeObserver(y);
1741
1530
  return I.observe(_), () => I.disconnect();
1742
- }, [T]);
1743
- const M = T ? _t(S, b > 0 ? b : Number.POSITIVE_INFINITY, s) : [], E = T ? Object.fromEntries(M.flatMap((_, N) => [
1744
- [`--split-pane-${String(N)}`, `${String(_)}px`],
1745
- [`--split-pane-end-${String(N)}`, `${String(M.slice(0, N + 1).reduce((I, K) => I + K, 0))}px`]
1531
+ }, [C]);
1532
+ const S = C ? kt(T, b > 0 ? b : Number.POSITIVE_INFINITY, a) : [], x = C ? Object.fromEntries(S.flatMap((_, y) => [
1533
+ [`--split-pane-${String(y)}`, `${String(_)}px`],
1534
+ [`--split-pane-end-${String(y)}`, `${String(S.slice(0, y + 1).reduce((I, U) => I + U, 0))}px`]
1746
1535
  ])) : void 0;
1747
- return /* @__PURE__ */ c(
1536
+ return /* @__PURE__ */ f(
1748
1537
  "div",
1749
1538
  {
1750
- ref: m,
1751
- className: H("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", T && "cms-panes--sized", u && "is-resizing"),
1539
+ ref: u,
1540
+ className: F("cms-panes", e.length === 3 ? "cms-panes--three" : "cms-panes--two", C && "cms-panes--sized", r && "is-resizing"),
1752
1541
  "data-active": d,
1753
- style: E,
1542
+ style: x,
1754
1543
  children: [
1755
- n.map((_, N) => /* @__PURE__ */ c("section", { className: "cms-panes__pane", "aria-label": _.label, "data-offset": d - N, children: [
1756
- N === d && l ? /* @__PURE__ */ c("a", { className: "cms-panes__back", href: l.href, children: [
1757
- /* @__PURE__ */ e(B, { name: "chevron-left", size: 18 }),
1544
+ e.map((_, y) => /* @__PURE__ */ f("section", { className: "cms-panes__pane", "aria-label": _.label, "data-offset": d - y, children: [
1545
+ y === d && l ? /* @__PURE__ */ f("a", { className: "cms-panes__back", href: l.href, children: [
1546
+ /* @__PURE__ */ n($, { name: "chevron-left", size: 18 }),
1758
1547
  l.label
1759
1548
  ] }) : null,
1760
1549
  _.content
1761
1550
  ] }, _.label)),
1762
- T ? S.map((_, N) => {
1763
- const I = M.reduce((z, k, F) => F === N ? z : z + k, 0), K = Math.max(_.min, Math.min(_.max, b > 0 ? b - I - s : _.max));
1764
- return /* @__PURE__ */ e(
1765
- pt,
1551
+ C ? T.map((_, y) => {
1552
+ const I = S.reduce((P, k, B) => B === y ? P : P + k, 0), U = Math.max(_.min, Math.min(_.max, b > 0 ? b - I - a : _.max));
1553
+ return /* @__PURE__ */ n(
1554
+ yt,
1766
1555
  {
1767
- ...h === void 0 ? {} : { storageKey: `${h}:${String(N)}` },
1768
- value: M[N],
1556
+ ...h === void 0 ? {} : { storageKey: `${h}:${String(y)}` },
1557
+ value: S[y],
1769
1558
  default: _.reset,
1770
1559
  min: _.min,
1771
- max: K,
1560
+ max: U,
1772
1561
  label: _.label,
1773
1562
  className: "cms-panes__splitter",
1774
- style: { "--split-at": `var(--split-pane-end-${String(N)})` },
1775
- onChange: (z, k) => {
1776
- h !== void 0 && v((F) => {
1777
- const U = [...F];
1778
- return U[N] = z, U;
1779
- }), y(!k), a == null || a(N, z, k);
1563
+ style: { "--split-at": `var(--split-pane-end-${String(y)})` },
1564
+ onChange: (P, k) => {
1565
+ h !== void 0 && N((B) => {
1566
+ const z = [...B];
1567
+ return z[y] = P, z;
1568
+ }), g(!k), i == null || i(y, P, k);
1780
1569
  }
1781
1570
  },
1782
1571
  _.label
@@ -1786,13 +1575,13 @@ function sl({ panes: n, active: t, back: l, sizes: r, lastMin: s = 360, onResize
1786
1575
  }
1787
1576
  );
1788
1577
  }
1789
- const vt = { attachment: "Has an attachment", unread: "Unread" };
1790
- function rl({ from: n, fromPlaceholder: t = !1, subject: l, preview: r, time: s, unread: a, hasAttachment: h, selected: d, onOpen: m, check: b, selecting: i, labels: g }) {
1791
- const f = qe(vt, g), v = /* @__PURE__ */ e(Ye, { name: n, size: 40, placeholder: t });
1792
- return /* @__PURE__ */ c("div", { className: H("cms-mail-row", a && "is-unread", d && "is-selected", i && "is-selecting", (b == null ? void 0 : b.checked) && "is-checked"), children: [
1793
- b !== void 0 ? /* @__PURE__ */ c("span", { className: "cms-mail-row__lead", children: [
1794
- v,
1795
- /* @__PURE__ */ e(
1578
+ const xt = { attachment: "Has an attachment", unread: "Unread" };
1579
+ function ul({ from: e, fromPlaceholder: t = !1, subject: l, preview: s, time: a, unread: i, hasAttachment: h, selected: d, onOpen: u, check: b, selecting: c, labels: v }) {
1580
+ const m = qe(xt, v), N = /* @__PURE__ */ n(Ye, { name: e, size: 40, placeholder: t });
1581
+ return /* @__PURE__ */ f("div", { className: F("cms-mail-row", i && "is-unread", d && "is-selected", c && "is-selecting", (b == null ? void 0 : b.checked) && "is-checked"), children: [
1582
+ b !== void 0 ? /* @__PURE__ */ f("span", { className: "cms-mail-row__lead", children: [
1583
+ N,
1584
+ /* @__PURE__ */ n(
1796
1585
  "input",
1797
1586
  {
1798
1587
  type: "checkbox",
@@ -1804,92 +1593,92 @@ function rl({ from: n, fromPlaceholder: t = !1, subject: l, preview: r, time: s,
1804
1593
  "aria-label": b.label,
1805
1594
  onChange: () => {
1806
1595
  },
1807
- onClick: (u) => {
1808
- if (u.stopPropagation(), b.pending) {
1809
- u.preventDefault();
1596
+ onClick: (r) => {
1597
+ if (r.stopPropagation(), b.pending) {
1598
+ r.preventDefault();
1810
1599
  return;
1811
1600
  }
1812
- b.onCheck({ shift: u.shiftKey, toggle: u.ctrlKey || u.metaKey });
1601
+ b.onCheck({ shift: r.shiftKey, toggle: r.ctrlKey || r.metaKey });
1813
1602
  }
1814
1603
  }
1815
1604
  )
1816
1605
  ] }) : null,
1817
- /* @__PURE__ */ c(
1606
+ /* @__PURE__ */ f(
1818
1607
  "button",
1819
1608
  {
1820
1609
  type: "button",
1821
1610
  className: "cms-mail-row__open",
1822
1611
  "aria-current": d ? "true" : void 0,
1823
- onClick: m,
1612
+ onClick: u,
1824
1613
  children: [
1825
- b === void 0 ? v : null,
1826
- /* @__PURE__ */ c("span", { className: "cms-mail-row__body", children: [
1827
- /* @__PURE__ */ c("span", { className: "cms-mail-row__line", children: [
1828
- /* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
1829
- h ? /* @__PURE__ */ e(B, { name: "paperclip", size: 16, label: f.attachment }) : null,
1830
- /* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: s })
1614
+ b === void 0 ? N : null,
1615
+ /* @__PURE__ */ f("span", { className: "cms-mail-row__body", children: [
1616
+ /* @__PURE__ */ f("span", { className: "cms-mail-row__line", children: [
1617
+ /* @__PURE__ */ n("span", { className: "cms-mail-row__from", children: e }),
1618
+ h ? /* @__PURE__ */ n($, { name: "paperclip", size: 16, label: m.attachment }) : null,
1619
+ /* @__PURE__ */ n("span", { className: "cms-mail-row__time", children: a })
1831
1620
  ] }),
1832
- /* @__PURE__ */ c("span", { className: "cms-mail-row__line", children: [
1833
- /* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
1834
- a ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": f.unread }) : null
1621
+ /* @__PURE__ */ f("span", { className: "cms-mail-row__line", children: [
1622
+ /* @__PURE__ */ n("span", { className: "cms-mail-row__subject", children: l }),
1623
+ i ? /* @__PURE__ */ n("span", { className: "cms-mail-row__dot", role: "img", "aria-label": m.unread }) : null
1835
1624
  ] }),
1836
- /* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: r })
1625
+ /* @__PURE__ */ n("span", { className: "cms-mail-row__preview", children: s })
1837
1626
  ] })
1838
1627
  ]
1839
1628
  }
1840
1629
  )
1841
1630
  ] });
1842
1631
  }
1843
- function al({ direction: n, children: t, time: l, read: r, readLabel: s = "Read" }) {
1844
- return /* @__PURE__ */ c("div", { className: H("cms-bubble", `cms-bubble--${n}`), children: [
1845
- /* @__PURE__ */ e("div", { className: "cms-bubble__text", children: t }),
1846
- /* @__PURE__ */ c("div", { className: "cms-bubble__meta", children: [
1632
+ function ml({ direction: e, children: t, time: l, read: s, readLabel: a = "Read" }) {
1633
+ return /* @__PURE__ */ f("div", { className: F("cms-bubble", `cms-bubble--${e}`), children: [
1634
+ /* @__PURE__ */ n("div", { className: "cms-bubble__text", children: t }),
1635
+ /* @__PURE__ */ f("div", { className: "cms-bubble__meta", children: [
1847
1636
  l,
1848
- n === "out" && r ? /* @__PURE__ */ c($, { children: [
1637
+ e === "out" && s ? /* @__PURE__ */ f(ge, { children: [
1849
1638
  " · ",
1850
- s
1639
+ a
1851
1640
  ] }) : null
1852
1641
  ] })
1853
1642
  ] });
1854
1643
  }
1855
- function il({ label: n, value: t, onChange: l, onSend: r, onAttach: s, placeholder: a, variant: h = "chat", sendLabel: d = "Send", attachLabel: m = "Attach a file", leading: b, canSend: i }) {
1856
- const g = fe(), f = i ?? t.trim() !== "", v = (y) => {
1857
- y.preventDefault(), f && r();
1858
- }, u = s ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": m, onClick: s, children: /* @__PURE__ */ e(B, { name: "paperclip" }) }) : null;
1859
- return /* @__PURE__ */ c("form", { className: H("cms-composer", `cms-composer--${h}`), onSubmit: v, children: [
1860
- /* @__PURE__ */ e("label", { htmlFor: g, className: h === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
1861
- h === "chat" ? u : null,
1862
- /* @__PURE__ */ e(
1644
+ function hl({ label: e, value: t, onChange: l, onSend: s, onAttach: a, placeholder: i, variant: h = "chat", sendLabel: d = "Send", attachLabel: u = "Attach a file", leading: b, canSend: c }) {
1645
+ const v = he(), m = c ?? t.trim() !== "", N = (g) => {
1646
+ g.preventDefault(), m && s();
1647
+ }, r = a ? /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": u, onClick: a, children: /* @__PURE__ */ n($, { name: "paperclip" }) }) : null;
1648
+ return /* @__PURE__ */ f("form", { className: F("cms-composer", `cms-composer--${h}`), onSubmit: N, children: [
1649
+ /* @__PURE__ */ n("label", { htmlFor: v, className: h === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: e }),
1650
+ h === "chat" ? r : null,
1651
+ /* @__PURE__ */ n(
1863
1652
  "textarea",
1864
1653
  {
1865
- id: g,
1654
+ id: v,
1866
1655
  className: "cms-composer__input",
1867
1656
  rows: h === "reply" ? 3 : 1,
1868
- placeholder: a,
1657
+ placeholder: i,
1869
1658
  value: t,
1870
- onChange: (y) => l(y.target.value),
1871
- onKeyDown: (y) => {
1872
- y.nativeEvent.isComposing || y.keyCode === 229 || h === "chat" && y.key === "Enter" && !y.shiftKey && (y.preventDefault(), f && r());
1659
+ onChange: (g) => l(g.target.value),
1660
+ onKeyDown: (g) => {
1661
+ g.nativeEvent.isComposing || g.keyCode === 229 || h === "chat" && g.key === "Enter" && !g.shiftKey && (g.preventDefault(), m && s());
1873
1662
  }
1874
1663
  }
1875
1664
  ),
1876
- h === "reply" && b !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: b }) : null,
1877
- h === "reply" ? u : null,
1878
- h === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": d, disabled: !f, children: /* @__PURE__ */ e(B, { name: "send" }) }) : /* @__PURE__ */ c("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !f, children: [
1665
+ h === "reply" && b !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-composer__leading", children: b }) : null,
1666
+ h === "reply" ? r : null,
1667
+ h === "chat" ? /* @__PURE__ */ n("button", { type: "submit", className: "cms-composer__send-round", "aria-label": d, disabled: !m, children: /* @__PURE__ */ n($, { name: "send" }) }) : /* @__PURE__ */ f("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !m, children: [
1879
1668
  d,
1880
1669
  " ",
1881
- /* @__PURE__ */ e(B, { name: "send", size: 18 })
1670
+ /* @__PURE__ */ n($, { name: "send", size: 18 })
1882
1671
  ] })
1883
1672
  ] });
1884
1673
  }
1885
- const on = {
1674
+ const mn = {
1886
1675
  incomingAudio: "Incoming audio call",
1887
1676
  incomingVideo: "Incoming video call",
1888
- incomingFrom: (n, t) => `${n} from ${t}`,
1677
+ incomingFrom: (e, t) => `${e} from ${t}`,
1889
1678
  accept: "Accept",
1890
1679
  decline: "Decline",
1891
- callWith: (n) => `Call with ${n}`,
1892
- callTime: (n) => `Call time ${n}`,
1680
+ callWith: (e) => `Call with ${e}`,
1681
+ callTime: (e) => `Call time ${e}`,
1893
1682
  goodConnection: "Good connection",
1894
1683
  poorConnection: "Poor connection",
1895
1684
  you: "You",
@@ -1900,94 +1689,94 @@ const on = {
1900
1689
  addPerson: "Add person",
1901
1690
  chat: "Chat",
1902
1691
  hangUp: "Hang up",
1903
- onCallWith: (n) => `On a call with ${n}`,
1692
+ onCallWith: (e) => `On a call with ${e}`,
1904
1693
  returnToCall: "Return to call"
1905
1694
  };
1906
- function cl({ name: n, namePlaceholder: t = !1, media: l, onAccept: r, onDecline: s, labels: a }) {
1907
- const h = qe(on, a), d = l === "video" ? h.incomingVideo : h.incomingAudio;
1908
- return /* @__PURE__ */ c("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": h.incomingFrom(d, n), children: [
1909
- /* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(Ye, { name: n, size: 112, placeholder: t }) }),
1910
- /* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: n }),
1911
- /* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: d }),
1912
- /* @__PURE__ */ c("div", { className: "cms-call-incoming__actions", children: [
1913
- /* @__PURE__ */ e(ze, { icon: "phone-off", label: h.decline, tone: "hang-up", onClick: s }),
1914
- /* @__PURE__ */ e(ze, { icon: "phone", label: h.accept, tone: "accept", onClick: r })
1695
+ function fl({ name: e, namePlaceholder: t = !1, media: l, onAccept: s, onDecline: a, labels: i }) {
1696
+ const h = qe(mn, i), d = l === "video" ? h.incomingVideo : h.incomingAudio;
1697
+ return /* @__PURE__ */ f("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": h.incomingFrom(d, e), children: [
1698
+ /* @__PURE__ */ n("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ n(Ye, { name: e, size: 112, placeholder: t }) }),
1699
+ /* @__PURE__ */ n("p", { className: "cms-call-incoming__name", children: e }),
1700
+ /* @__PURE__ */ n("p", { className: "cms-call-incoming__what", children: d }),
1701
+ /* @__PURE__ */ f("div", { className: "cms-call-incoming__actions", children: [
1702
+ /* @__PURE__ */ n(Ue, { icon: "phone-off", label: h.decline, tone: "hang-up", onClick: a }),
1703
+ /* @__PURE__ */ n(Ue, { icon: "phone", label: h.accept, tone: "accept", onClick: s })
1915
1704
  ] })
1916
1705
  ] });
1917
1706
  }
1918
- function ze({ icon: n, label: t, onClick: l, tone: r = "plain", pressed: s }) {
1919
- return /* @__PURE__ */ c(
1707
+ function Ue({ icon: e, label: t, onClick: l, tone: s = "plain", pressed: a }) {
1708
+ return /* @__PURE__ */ f(
1920
1709
  "button",
1921
1710
  {
1922
1711
  type: "button",
1923
- className: H("cms-call-button", `cms-call-button--${r}`, s && "is-pressed"),
1924
- "aria-pressed": s,
1712
+ className: F("cms-call-button", `cms-call-button--${s}`, a && "is-pressed"),
1713
+ "aria-pressed": a,
1925
1714
  onClick: l,
1926
1715
  children: [
1927
- /* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(B, { name: n, size: 24 }) }),
1928
- /* @__PURE__ */ e("span", { className: "cms-call-button__label", children: t })
1716
+ /* @__PURE__ */ n("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ n($, { name: e, size: 24 }) }),
1717
+ /* @__PURE__ */ n("span", { className: "cms-call-button__label", children: t })
1929
1718
  ]
1930
1719
  }
1931
1720
  );
1932
1721
  }
1933
- function ol({ name: n, duration: t, connection: l, you: r, muted: s, speaker: a, onToggleMute: h, onToggleSpeaker: d, onAddPerson: m, onChat: b, onHangUp: i, labels: g }) {
1934
- const f = qe(on, g);
1935
- return /* @__PURE__ */ c("section", { className: "cms-call-panel", "aria-label": f.callWith(n), children: [
1936
- /* @__PURE__ */ c("div", { className: "cms-call-panel__head", children: [
1937
- /* @__PURE__ */ e(Ye, { name: n, size: 64 }),
1938
- /* @__PURE__ */ c("div", { className: "cms-call-panel__who", children: [
1939
- /* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
1940
- /* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": f.callTime(t), children: t })
1722
+ function pl({ name: e, duration: t, connection: l, you: s, muted: a, speaker: i, onToggleMute: h, onToggleSpeaker: d, onAddPerson: u, onChat: b, onHangUp: c, labels: v }) {
1723
+ const m = qe(mn, v);
1724
+ return /* @__PURE__ */ f("section", { className: "cms-call-panel", "aria-label": m.callWith(e), children: [
1725
+ /* @__PURE__ */ f("div", { className: "cms-call-panel__head", children: [
1726
+ /* @__PURE__ */ n(Ye, { name: e, size: 64 }),
1727
+ /* @__PURE__ */ f("div", { className: "cms-call-panel__who", children: [
1728
+ /* @__PURE__ */ n("p", { className: "cms-call-panel__name", children: e }),
1729
+ /* @__PURE__ */ n("p", { className: "cms-call-panel__time", "aria-label": m.callTime(t), children: t })
1941
1730
  ] }),
1942
- /* @__PURE__ */ e("span", { className: H("cms-pill", l === "good" ? "cms-pill--success" : "cms-pill--warning"), children: l === "good" ? f.goodConnection : f.poorConnection })
1731
+ /* @__PURE__ */ n("span", { className: F("cms-pill", l === "good" ? "cms-pill--success" : "cms-pill--warning"), children: l === "good" ? m.goodConnection : m.poorConnection })
1943
1732
  ] }),
1944
- /* @__PURE__ */ c("div", { className: "cms-call-panel__you", children: [
1945
- /* @__PURE__ */ e(Ye, { name: r.name, size: 36 }),
1946
- /* @__PURE__ */ e("span", { children: f.you }),
1947
- r.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": f.speaking }) : null
1733
+ /* @__PURE__ */ f("div", { className: "cms-call-panel__you", children: [
1734
+ /* @__PURE__ */ n(Ye, { name: s.name, size: 36 }),
1735
+ /* @__PURE__ */ n("span", { children: m.you }),
1736
+ s.speaking ? /* @__PURE__ */ n("span", { className: "cms-call-panel__level", role: "img", "aria-label": m.speaking }) : null
1948
1737
  ] }),
1949
- /* @__PURE__ */ c("div", { className: "cms-call-panel__controls", children: [
1950
- /* @__PURE__ */ e(ze, { icon: "mic", label: s ? f.unmute : f.mute, pressed: s, onClick: h }),
1951
- /* @__PURE__ */ e(ze, { icon: "speaker", label: f.speaker, pressed: a, onClick: d }),
1952
- m ? /* @__PURE__ */ e(ze, { icon: "user-plus", label: f.addPerson, onClick: m }) : null,
1953
- b ? /* @__PURE__ */ e(ze, { icon: "chat", label: f.chat, onClick: b }) : null,
1954
- /* @__PURE__ */ e(ze, { icon: "phone-off", label: f.hangUp, tone: "hang-up", onClick: i })
1738
+ /* @__PURE__ */ f("div", { className: "cms-call-panel__controls", children: [
1739
+ /* @__PURE__ */ n(Ue, { icon: "mic", label: a ? m.unmute : m.mute, pressed: a, onClick: h }),
1740
+ /* @__PURE__ */ n(Ue, { icon: "speaker", label: m.speaker, pressed: i, onClick: d }),
1741
+ u ? /* @__PURE__ */ n(Ue, { icon: "user-plus", label: m.addPerson, onClick: u }) : null,
1742
+ b ? /* @__PURE__ */ n(Ue, { icon: "chat", label: m.chat, onClick: b }) : null,
1743
+ /* @__PURE__ */ n(Ue, { icon: "phone-off", label: m.hangUp, tone: "hang-up", onClick: c })
1955
1744
  ] })
1956
1745
  ] });
1957
1746
  }
1958
- function dl({ name: n, duration: t, muted: l, onToggleMute: r, onReturn: s, onHangUp: a, labels: h }) {
1959
- const d = qe(on, h);
1960
- return /* @__PURE__ */ c("section", { className: "cms-call-bar", "aria-label": d.callWith(n), children: [
1961
- /* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
1962
- /* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: d.onCallWith(n) }),
1963
- /* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: t }),
1964
- /* @__PURE__ */ c("span", { className: "cms-call-bar__actions", children: [
1965
- /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": l ? d.unmute : d.mute, "aria-pressed": l, onClick: r, children: /* @__PURE__ */ e(B, { name: "mic" }) }),
1966
- /* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: s, children: d.returnToCall }),
1967
- /* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": d.hangUp, onClick: a, children: /* @__PURE__ */ e(B, { name: "phone-off" }) })
1747
+ function bl({ name: e, duration: t, muted: l, onToggleMute: s, onReturn: a, onHangUp: i, labels: h }) {
1748
+ const d = qe(mn, h);
1749
+ return /* @__PURE__ */ f("section", { className: "cms-call-bar", "aria-label": d.callWith(e), children: [
1750
+ /* @__PURE__ */ n("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
1751
+ /* @__PURE__ */ n("span", { className: "cms-call-bar__name", children: d.onCallWith(e) }),
1752
+ /* @__PURE__ */ n("span", { className: "cms-call-bar__time", children: t }),
1753
+ /* @__PURE__ */ f("span", { className: "cms-call-bar__actions", children: [
1754
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-call-bar__icon", "aria-label": l ? d.unmute : d.mute, "aria-pressed": l, onClick: s, children: /* @__PURE__ */ n($, { name: "mic" }) }),
1755
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-button cms-button--primary", onClick: a, children: d.returnToCall }),
1756
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": d.hangUp, onClick: i, children: /* @__PURE__ */ n($, { name: "phone-off" }) })
1968
1757
  ] })
1969
1758
  ] });
1970
1759
  }
1971
- function ul({ mark: n, product: t, headline: l, lead: r, features: s = [], children: a }) {
1972
- return /* @__PURE__ */ c("div", { className: "cms-signin", children: [
1973
- /* @__PURE__ */ c("aside", { className: "cms-signin__brand", children: [
1974
- /* @__PURE__ */ c("p", { className: "cms-signin__logo", children: [
1975
- /* @__PURE__ */ e("span", { className: "cms-signin__mark", "aria-hidden": "true", children: n }),
1760
+ function _l({ mark: e, product: t, headline: l, lead: s, features: a = [], children: i }) {
1761
+ return /* @__PURE__ */ f("div", { className: "cms-signin", children: [
1762
+ /* @__PURE__ */ f("aside", { className: "cms-signin__brand", children: [
1763
+ /* @__PURE__ */ f("p", { className: "cms-signin__logo", children: [
1764
+ /* @__PURE__ */ n("span", { className: "cms-signin__mark", "aria-hidden": "true", children: e }),
1976
1765
  t
1977
1766
  ] }),
1978
- /* @__PURE__ */ c("div", { className: "cms-signin__pitch", children: [
1979
- /* @__PURE__ */ e("p", { className: "cms-signin__headline", children: l }),
1980
- /* @__PURE__ */ e("p", { className: "cms-signin__lead", children: r }),
1981
- s.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: s.map((h) => /* @__PURE__ */ c("li", { children: [
1982
- /* @__PURE__ */ e(B, { name: h.icon, size: 18 }),
1767
+ /* @__PURE__ */ f("div", { className: "cms-signin__pitch", children: [
1768
+ /* @__PURE__ */ n("p", { className: "cms-signin__headline", children: l }),
1769
+ /* @__PURE__ */ n("p", { className: "cms-signin__lead", children: s }),
1770
+ a.length ? /* @__PURE__ */ n("ul", { className: "cms-signin__features", children: a.map((h) => /* @__PURE__ */ f("li", { children: [
1771
+ /* @__PURE__ */ n($, { name: h.icon, size: 18 }),
1983
1772
  h.label
1984
1773
  ] }, h.label)) }) : null
1985
1774
  ] })
1986
1775
  ] }),
1987
- /* @__PURE__ */ e("main", { className: "cms-signin__form", children: a })
1776
+ /* @__PURE__ */ n("main", { className: "cms-signin__form", children: i })
1988
1777
  ] });
1989
1778
  }
1990
- const gt = {
1779
+ const Mt = {
1991
1780
  title: "Sign in",
1992
1781
  identifier: "Email or username",
1993
1782
  identifierPlaceholder: "name@example.com",
@@ -1999,243 +1788,243 @@ const gt = {
1999
1788
  newHere: "New here?",
2000
1789
  create: "Create an account"
2001
1790
  };
2002
- function ml({ server: n, onSubmit: t, forgotHref: l, createHref: r, error: s, busy: a, labels: h }) {
2003
- const d = qe(gt, h), m = fe(), [b, i] = D(""), [g, f] = D(""), [v, u] = D(!1);
2004
- return /* @__PURE__ */ c("form", { className: "cms-signin-form", onSubmit: (S) => {
2005
- S.preventDefault(), t(b, g);
2006
- }, "aria-describedby": s ? `${m}-error` : void 0, children: [
2007
- /* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: d.title }),
2008
- /* @__PURE__ */ c("p", { className: "cms-signin-form__server", children: [
2009
- /* @__PURE__ */ e(B, { name: "server", size: 18 }),
2010
- n
1791
+ function vl({ server: e, onSubmit: t, forgotHref: l, createHref: s, error: a, busy: i, labels: h }) {
1792
+ const d = qe(Mt, h), u = he(), [b, c] = D(""), [v, m] = D(""), [N, r] = D(!1);
1793
+ return /* @__PURE__ */ f("form", { className: "cms-signin-form", onSubmit: (T) => {
1794
+ T.preventDefault(), t(b, v);
1795
+ }, "aria-describedby": a ? `${u}-error` : void 0, children: [
1796
+ /* @__PURE__ */ n("h1", { className: "cms-signin-form__title", children: d.title }),
1797
+ /* @__PURE__ */ f("p", { className: "cms-signin-form__server", children: [
1798
+ /* @__PURE__ */ n($, { name: "server", size: 18 }),
1799
+ e
2011
1800
  ] }),
2012
- /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${m}-identifier`, children: d.identifier }),
2013
- /* @__PURE__ */ e(
1801
+ /* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${u}-identifier`, children: d.identifier }),
1802
+ /* @__PURE__ */ n(
2014
1803
  "input",
2015
1804
  {
2016
- id: `${m}-identifier`,
1805
+ id: `${u}-identifier`,
2017
1806
  className: "cms-signin-form__input",
2018
1807
  type: "text",
2019
1808
  autoComplete: "username",
2020
1809
  placeholder: d.identifierPlaceholder,
2021
1810
  value: b,
2022
- onChange: (S) => i(S.target.value),
1811
+ onChange: (T) => c(T.target.value),
2023
1812
  required: !0
2024
1813
  }
2025
1814
  ),
2026
- /* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${m}-password`, children: d.password }),
2027
- /* @__PURE__ */ c("span", { className: "cms-signin-form__password", children: [
2028
- /* @__PURE__ */ e(
1815
+ /* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${u}-password`, children: d.password }),
1816
+ /* @__PURE__ */ f("span", { className: "cms-signin-form__password", children: [
1817
+ /* @__PURE__ */ n(
2029
1818
  "input",
2030
1819
  {
2031
- id: `${m}-password`,
1820
+ id: `${u}-password`,
2032
1821
  className: "cms-signin-form__input",
2033
- type: v ? "text" : "password",
1822
+ type: N ? "text" : "password",
2034
1823
  autoComplete: "current-password",
2035
- value: g,
2036
- onChange: (S) => f(S.target.value),
1824
+ value: v,
1825
+ onChange: (T) => m(T.target.value),
2037
1826
  required: !0
2038
1827
  }
2039
1828
  ),
2040
- /* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": v, onClick: () => u((S) => !S), children: v ? d.hide : d.show })
1829
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": N, onClick: () => r((T) => !T), children: N ? d.hide : d.show })
2041
1830
  ] }),
2042
- l ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: l, children: d.forgot }) : null,
2043
- s ? /* @__PURE__ */ e("p", { id: `${m}-error`, className: "cms-signin-form__error", role: "alert", children: s }) : null,
2044
- /* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: a, "aria-busy": a || void 0, children: d.submit }),
2045
- r ? /* @__PURE__ */ c($, { children: [
2046
- /* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: d.newHere }) }),
2047
- /* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: r, children: d.create })
1831
+ l ? /* @__PURE__ */ n("a", { className: "cms-signin-form__forgot", href: l, children: d.forgot }) : null,
1832
+ a ? /* @__PURE__ */ n("p", { id: `${u}-error`, className: "cms-signin-form__error", role: "alert", children: a }) : null,
1833
+ /* @__PURE__ */ n("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: i, "aria-busy": i || void 0, children: d.submit }),
1834
+ s ? /* @__PURE__ */ f(ge, { children: [
1835
+ /* @__PURE__ */ n("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ n("span", { children: d.newHere }) }),
1836
+ /* @__PURE__ */ n("a", { className: "cms-button cms-signin-form__create", href: s, children: d.create })
2048
1837
  ] }) : null
2049
1838
  ] });
2050
1839
  }
2051
- const yt = { name: (n, t) => `${n}: ${t}` };
2052
- function Cn(n) {
2053
- const t = dn(n);
2054
- return t === un(n.options, n.defaultValue) ? null : t ?? null;
1840
+ const Ct = { name: (e, t) => `${e}: ${t}` };
1841
+ function An(e) {
1842
+ const t = hn(e);
1843
+ return t === fn(e.options, e.defaultValue) ? null : t ?? null;
2055
1844
  }
2056
- function dn({ options: n, value: t, defaultValue: l }) {
2057
- return n.find((r) => r.id === t) ?? un(n, l);
1845
+ function hn({ options: e, value: t, defaultValue: l }) {
1846
+ return e.find((s) => s.id === t) ?? fn(e, l);
2058
1847
  }
2059
- function Sn(n) {
1848
+ function Tn(e) {
2060
1849
  var t;
2061
- return qe(yt, n.labels).name(n.label, ((t = dn(n)) == null ? void 0 : t.label) ?? "");
1850
+ return qe(Ct, e.labels).name(e.label, ((t = hn(e)) == null ? void 0 : t.label) ?? "");
2062
1851
  }
2063
- function En(n, t) {
2064
- const l = dn(n);
2065
- return n.options.map((r) => ({
2066
- id: r.id,
2067
- label: r.label,
1852
+ function Ln(e, t) {
1853
+ const l = hn(e);
1854
+ return e.options.map((s) => ({
1855
+ id: s.id,
1856
+ label: s.label,
2068
1857
  offer: { offered: !0, locked: !1 },
2069
- checked: r === l,
1858
+ checked: s === l,
2070
1859
  ...t === void 0 ? {} : { group: t },
2071
1860
  onSelect: () => {
2072
- r !== l && n.onChange(r.id);
1861
+ s !== l && e.onChange(s.id);
2073
1862
  }
2074
1863
  }));
2075
1864
  }
2076
- function un(n, t) {
2077
- return n.find((l) => l.id === t) ?? n[0];
2078
- }
2079
- function An(n) {
2080
- var a;
2081
- const t = P(null), l = (n == null ? void 0 : n.value) ?? null, s = n === void 0 || n.options.some((h) => h.id === n.value) ? null : ((a = un(n.options, n.defaultValue)) == null ? void 0 : a.id) ?? null;
2082
- ee(() => {
2083
- s === null ? t.current = null : t.current !== l && (t.current = l, n == null || n.onChange(s));
2084
- }, [s, l]);
2085
- }
2086
- function Tn({ iconOnly: n = !1, onOpenChange: t, ...l }) {
2087
- return l.options.length < 2 ? null : /* @__PURE__ */ e(wt, { ...l, iconOnly: n, onOpenChange: t });
2088
- }
2089
- function wt({ iconOnly: n, onOpenChange: t, ...l }) {
2090
- const [r, s] = D(null), a = Ie(() => s(null), []), h = P(!1), d = r !== null;
2091
- ee(() => (t == null || t(d), () => t == null ? void 0 : t(!1)), [d, t]);
2092
- const m = Cn(l), b = m !== null && !n, i = Sn(l), g = (f, v) => {
2093
- const u = f.getBoundingClientRect();
2094
- s({ x: u.left, y: u.bottom + 4, focus: v });
1865
+ function fn(e, t) {
1866
+ return e.find((l) => l.id === t) ?? e[0];
1867
+ }
1868
+ function Dn(e) {
1869
+ var i;
1870
+ const t = O(null), l = (e == null ? void 0 : e.value) ?? null, a = e === void 0 || e.options.some((h) => h.id === e.value) ? null : ((i = fn(e.options, e.defaultValue)) == null ? void 0 : i.id) ?? null;
1871
+ Q(() => {
1872
+ a === null ? t.current = null : t.current !== l && (t.current = l, e == null || e.onChange(a));
1873
+ }, [a, l]);
1874
+ }
1875
+ function In({ iconOnly: e = !1, onOpenChange: t, ...l }) {
1876
+ return l.options.length < 2 ? null : /* @__PURE__ */ n(St, { ...l, iconOnly: e, onOpenChange: t });
1877
+ }
1878
+ function St({ iconOnly: e, onOpenChange: t, ...l }) {
1879
+ const [s, a] = D(null), i = Ie(() => a(null), []), h = O(!1), d = s !== null;
1880
+ Q(() => (t == null || t(d), () => t == null ? void 0 : t(!1)), [d, t]);
1881
+ const u = An(l), b = u !== null && !e, c = Tn(l), v = (m, N) => {
1882
+ const r = m.getBoundingClientRect();
1883
+ a({ x: r.left, y: r.bottom + 4, focus: N });
2095
1884
  };
2096
- return /* @__PURE__ */ c($, { children: [
2097
- /* @__PURE__ */ e(
1885
+ return /* @__PURE__ */ f(ge, { children: [
1886
+ /* @__PURE__ */ n(
2098
1887
  "button",
2099
1888
  {
2100
1889
  type: "button",
2101
- className: H("cms-filter-menu", m !== null && "cms-filter-menu--active", b && "cms-filter-menu--named"),
1890
+ className: F("cms-filter-menu", u !== null && "cms-filter-menu--active", b && "cms-filter-menu--named"),
2102
1891
  "aria-haspopup": "menu",
2103
1892
  "aria-expanded": d,
2104
- "aria-label": i,
2105
- title: i,
1893
+ "aria-label": c,
1894
+ title: c,
2106
1895
  onMouseDown: () => {
2107
1896
  h.current = d;
2108
1897
  },
2109
- onClick: (f) => {
2110
- d || h.current ? a() : g(f.currentTarget, "current"), h.current = !1;
1898
+ onClick: (m) => {
1899
+ d || h.current ? i() : v(m.currentTarget, "current"), h.current = !1;
2111
1900
  },
2112
- onKeyDown: (f) => {
2113
- h.current = !1, (f.key === "ArrowDown" || f.key === "ArrowUp") && (f.preventDefault(), g(f.currentTarget, f.key === "ArrowUp" ? "last" : "current"));
1901
+ onKeyDown: (m) => {
1902
+ h.current = !1, (m.key === "ArrowDown" || m.key === "ArrowUp") && (m.preventDefault(), v(m.currentTarget, m.key === "ArrowUp" ? "last" : "current"));
2114
1903
  },
2115
- children: b ? /* @__PURE__ */ c($, { children: [
2116
- /* @__PURE__ */ e("span", { className: "cms-filter-menu__choice", children: m.label }),
2117
- /* @__PURE__ */ e(B, { name: "chevron-down", size: 16 })
2118
- ] }) : /* @__PURE__ */ e(B, { name: "funnel" })
1904
+ children: b ? /* @__PURE__ */ f(ge, { children: [
1905
+ /* @__PURE__ */ n("span", { className: "cms-filter-menu__choice", children: u.label }),
1906
+ /* @__PURE__ */ n($, { name: "chevron-down", size: 16 })
1907
+ ] }) : /* @__PURE__ */ n($, { name: "funnel" })
2119
1908
  }
2120
1909
  ),
2121
- /* @__PURE__ */ e(
1910
+ /* @__PURE__ */ n(
2122
1911
  Ke,
2123
1912
  {
2124
- at: r,
2125
- items: En(l),
2126
- onClose: a,
1913
+ at: s,
1914
+ items: Ln(l),
1915
+ onClose: i,
2127
1916
  label: l.label,
2128
- focus: r == null ? void 0 : r.focus
1917
+ focus: s == null ? void 0 : s.focus
2129
1918
  }
2130
1919
  )
2131
1920
  ] });
2132
1921
  }
2133
- function Nt(n) {
2134
- return An(n), /* @__PURE__ */ e(Tn, { ...n });
1922
+ function Et(e) {
1923
+ return Dn(e), /* @__PURE__ */ n(In, { ...e });
2135
1924
  }
2136
- function hl({ leading: n, name: t, filter: l }) {
2137
- return /* @__PURE__ */ c("div", { className: "cms-list-head", children: [
2138
- n != null ? /* @__PURE__ */ e("span", { className: "cms-list-head__leading", children: n }) : null,
2139
- /* @__PURE__ */ e("h2", { className: "cms-list-head__name", title: t, children: t }),
2140
- l !== void 0 ? /* @__PURE__ */ e(Nt, { ...l }) : null
1925
+ function gl({ leading: e, name: t, filter: l }) {
1926
+ return /* @__PURE__ */ f("div", { className: "cms-list-head", children: [
1927
+ e != null ? /* @__PURE__ */ n("span", { className: "cms-list-head__leading", children: e }) : null,
1928
+ /* @__PURE__ */ n("h2", { className: "cms-list-head__name", title: t, children: t }),
1929
+ l !== void 0 ? /* @__PURE__ */ n(Et, { ...l }) : null
2141
1930
  ] });
2142
1931
  }
2143
- const yn = { bare: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Set() }, wn = (n, t) => n.size === t.size && [...n].every((l) => t.has(l));
2144
- function kt(n) {
1932
+ const kn = { bare: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Set() }, xn = (e, t) => e.size === t.size && [...e].every((l) => t.has(l));
1933
+ function At(e) {
2145
1934
  const t = /* @__PURE__ */ new Map();
2146
- for (const l of n) t.set(l.group, [...t.get(l.group) ?? [], l]);
1935
+ for (const l of e) t.set(l.group, [...t.get(l.group) ?? [], l]);
2147
1936
  return [...t.values()];
2148
1937
  }
2149
- function xt(n) {
1938
+ function Tt(e) {
2150
1939
  const t = /* @__PURE__ */ new Map();
2151
- for (const l of n) l.overflow !== void 0 && l.overflow !== 0 && t.set(l.overflow, [...t.get(l.overflow) ?? [], l.id]);
2152
- return [...t.entries()].sort(([l], [r]) => l - r).map(([, l]) => l);
1940
+ for (const l of e) l.overflow !== void 0 && l.overflow !== 0 && t.set(l.overflow, [...t.get(l.overflow) ?? [], l.id]);
1941
+ return [...t.entries()].sort(([l], [s]) => l - s).map(([, l]) => l);
2153
1942
  }
2154
- function fl({ label: n, actions: t, onAction: l, status: r, moreLabel: s, leading: a }) {
2155
- var G;
2156
- const h = t.filter((p) => p.entries === void 0 || p.entries.length > 0), d = P(null), m = P(null), b = P(null), [i, g] = D(yn), [f, v] = D(null), [u, y] = D("first"), [S, T] = D(null), [M, E] = D(null), _ = kt(h), N = _.flat(), I = ((G = N.find((p) => p.primary === !0 && p.overflow !== 0)) == null ? void 0 : G.id) ?? null, K = xt(h.filter((p) => p.id !== I)), z = N.filter((p) => p.overflow === 0), k = N.filter((p) => p.overflow !== 0), F = z.length === 1 ? z[0] ?? null : null, U = JSON.stringify([h.map((p) => [p.id, p.label, p.icon, p.group, p.overflow ?? null, p.primary === !0, p.entries !== void 0]), r ?? "", a !== void 0]), Y = (p) => /* @__PURE__ */ new Set([...z.filter((L) => L !== F || p.size > 0).map((L) => L.id), ...p]), W = Ie(() => {
2157
- const p = d.current, L = m.current;
1943
+ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leading: i }) {
1944
+ var q;
1945
+ const h = t.filter((p) => p.entries === void 0 || p.entries.length > 0), d = O(null), u = O(null), b = O(null), [c, v] = D(kn), [m, N] = D(null), [r, g] = D("first"), [T, C] = D(null), [S, x] = D(null), _ = At(h), y = _.flat(), I = ((q = y.find((p) => p.primary === !0 && p.overflow !== 0)) == null ? void 0 : q.id) ?? null, U = Tt(h.filter((p) => p.id !== I)), P = y.filter((p) => p.overflow === 0), k = y.filter((p) => p.overflow !== 0), B = P.length === 1 ? P[0] ?? null : null, z = JSON.stringify([h.map((p) => [p.id, p.label, p.icon, p.group, p.overflow ?? null, p.primary === !0, p.entries !== void 0]), s ?? "", i !== void 0]), j = (p) => /* @__PURE__ */ new Set([...P.filter((L) => L !== B || p.size > 0).map((L) => L.id), ...p]), K = Ie(() => {
1946
+ const p = d.current, L = u.current;
2158
1947
  if (p === null || L === null) return;
2159
- const V = getComputedStyle(p), me = parseFloat(V.columnGap || "0") || 0, ae = p.clientWidth - (parseFloat(V.paddingLeft) || 0) - (parseFloat(V.paddingRight) || 0), he = (A) => {
2160
- var x;
2161
- return ((x = L.querySelector(A)) == null ? void 0 : x.getBoundingClientRect().width) ?? 0;
2162
- }, Se = he('[data-measure="leading"]'), We = he('[data-measure="separator"]'), Be = he('[data-measure="more"]'), Te = (A, x) => he(`[data-measure="${x ? "full" : "icon"}"][data-measure-action="${CSS.escape(A)}"]`), Ee = (A, x) => {
2163
- const O = Y(x), se = F !== null && !O.has(F.id) ? F : null, Q = _.map((He) => He.filter((q) => !O.has(q.id) && q !== se)).filter((He) => He.length > 0), ke = [...Q.flat(), ...se !== null ? [se] : []], Fe = ke.length + (Q.length - 1) + (O.size > 0 ? 1 : 0) + (Se > 0 ? 1 : 0);
2164
- return Se + ke.reduce((He, q) => He + Te(q.id, !A.has(q.id)), 0) + We * Math.max(0, Q.length - 1) + (O.size > 0 ? Be : 0) + me * Math.max(0, Fe - 1);
2165
- }, R = k.filter((A) => A.id !== I && !K.some((x) => x.includes(A.id))).map((A) => A.id), J = [...K, ...[...R].reverse().map((A) => [A]), ...I !== null ? [[I]] : []], Ne = [...F !== null ? [[F.id]] : [], ...J];
2166
- let de = null;
2167
- if (Ee(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= ae) de = yn;
1948
+ const Z = getComputedStyle(p), ue = parseFloat(Z.columnGap || "0") || 0, ae = p.clientWidth - (parseFloat(Z.paddingLeft) || 0) - (parseFloat(Z.paddingRight) || 0), me = (A) => {
1949
+ var M;
1950
+ return ((M = L.querySelector(A)) == null ? void 0 : M.getBoundingClientRect().width) ?? 0;
1951
+ }, Se = me('[data-measure="leading"]'), We = me('[data-measure="separator"]'), Fe = me('[data-measure="more"]'), Te = (A, M) => me(`[data-measure="${M ? "full" : "icon"}"][data-measure-action="${CSS.escape(A)}"]`), Ee = (A, M) => {
1952
+ const H = j(M), le = B !== null && !H.has(B.id) ? B : null, J = _.map((He) => He.filter((V) => !H.has(V.id) && V !== le)).filter((He) => He.length > 0), ke = [...J.flat(), ...le !== null ? [le] : []], Re = ke.length + (J.length - 1) + (H.size > 0 ? 1 : 0) + (Se > 0 ? 1 : 0);
1953
+ return Se + ke.reduce((He, V) => He + Te(V.id, !A.has(V.id)), 0) + We * Math.max(0, J.length - 1) + (H.size > 0 ? Fe : 0) + ue * Math.max(0, Re - 1);
1954
+ }, R = k.filter((A) => A.id !== I && !U.some((M) => M.includes(A.id))).map((A) => A.id), X = [...U, ...[...R].reverse().map((A) => [A]), ...I !== null ? [[I]] : []], Ne = [...B !== null ? [[B.id]] : [], ...X];
1955
+ let oe = null;
1956
+ if (Ee(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= ae) oe = kn;
2168
1957
  else {
2169
1958
  const A = /* @__PURE__ */ new Set();
2170
- for (const x of Ne) {
2171
- for (const O of x) A.add(O);
1959
+ for (const M of Ne) {
1960
+ for (const H of M) A.add(H);
2172
1961
  if (Ee(A, /* @__PURE__ */ new Set()) <= ae) {
2173
- de = { bare: A, hidden: /* @__PURE__ */ new Set() };
1962
+ oe = { bare: A, hidden: /* @__PURE__ */ new Set() };
2174
1963
  break;
2175
1964
  }
2176
1965
  }
2177
1966
  }
2178
- if (de === null) {
2179
- const A = new Set(Ne.flat()), x = /* @__PURE__ */ new Set(), O = () => x.size + z.length >= 2;
2180
- for (const se of J) {
2181
- for (const Q of se) x.add(Q);
2182
- if (O() && Ee(A, x) <= ae) break;
1967
+ if (oe === null) {
1968
+ const A = new Set(Ne.flat()), M = /* @__PURE__ */ new Set(), H = () => M.size + P.length >= 2;
1969
+ for (const le of X) {
1970
+ for (const J of le) M.add(J);
1971
+ if (H() && Ee(A, M) <= ae) break;
2183
1972
  }
2184
- O() || x.clear(), de = { bare: A, hidden: x };
1973
+ H() || M.clear(), oe = { bare: A, hidden: M };
2185
1974
  }
2186
- const o = de;
2187
- g((A) => wn(A.bare, o.bare) && wn(A.hidden, o.hidden) ? A : o);
2188
- }, [U]);
2189
- $e(W, [W]), ee(() => {
1975
+ const o = oe;
1976
+ v((A) => xn(A.bare, o.bare) && xn(A.hidden, o.hidden) ? A : o);
1977
+ }, [z]);
1978
+ $e(K, [K]), Q(() => {
2190
1979
  const p = d.current;
2191
1980
  if (p === null || typeof ResizeObserver > "u") return;
2192
- const L = new ResizeObserver(() => W());
1981
+ const L = new ResizeObserver(() => K());
2193
1982
  return L.observe(p), () => L.disconnect();
2194
- }, [W]), ee(() => {
1983
+ }, [K]), Q(() => {
2195
1984
  const p = typeof document > "u" ? void 0 : document.fonts;
2196
1985
  if (p === void 0) return;
2197
1986
  let L = !0;
2198
- const V = () => {
2199
- L && W();
1987
+ const Z = () => {
1988
+ L && K();
2200
1989
  };
2201
- return p.ready.then(V), p.addEventListener("loadingdone", V), () => {
2202
- L = !1, p.removeEventListener("loadingdone", V);
1990
+ return p.ready.then(Z), p.addEventListener("loadingdone", Z), () => {
1991
+ L = !1, p.removeEventListener("loadingdone", Z);
2203
1992
  };
2204
- }, [W]);
2205
- const j = Y(i.hidden), X = F !== null && !j.has(F.id) ? F : null, ne = (p) => j.has(p.id) || p === X, _e = [..._.map((p) => p.filter((L) => !ne(L))).filter((p) => p.length > 0).flat(), ...X !== null ? [X] : []], oe = (p) => N.find((L) => L.id === p), ue = [...K.flat(), ...k.filter((p) => p.id !== I && !K.some((L) => L.includes(p.id))).map((p) => p.id).reverse()], Ce = [
2206
- ...I !== null && i.hidden.has(I) ? [oe(I)] : [],
2207
- ...ue.filter((p) => i.hidden.has(p)).map(oe),
2208
- ...j.size > 0 ? z : []
2209
- ].filter((p) => p !== void 0 && j.has(p.id)), pe = new Set(k.filter((p) => !K.some((L) => L.includes(p.id))).map((p) => p.id)), le = [..._e.map((p) => p.id), ...Ce.length > 0 ? ["more"] : []], be = S !== null && le.includes(S) ? S : le[0] ?? null, ve = (p) => {
2210
- var ae, he;
2211
- const L = le.indexOf(be ?? "");
2212
- let V = null;
2213
- if (p.key === "ArrowRight" ? V = Math.min(le.length - 1, L + 1) : p.key === "ArrowLeft" ? V = Math.max(0, L - 1) : p.key === "Home" ? V = 0 : p.key === "End" ? V = le.length - 1 : p.key === "Escape" && E(be), V === null) return;
1993
+ }, [K]);
1994
+ const G = j(c.hidden), Y = B !== null && !G.has(B.id) ? B : null, ee = (p) => G.has(p.id) || p === Y, be = [..._.map((p) => p.filter((L) => !ee(L))).filter((p) => p.length > 0).flat(), ...Y !== null ? [Y] : []], ce = (p) => y.find((L) => L.id === p), de = [...U.flat(), ...k.filter((p) => p.id !== I && !U.some((L) => L.includes(p.id))).map((p) => p.id).reverse()], Ce = [
1995
+ ...I !== null && c.hidden.has(I) ? [ce(I)] : [],
1996
+ ...de.filter((p) => c.hidden.has(p)).map(ce),
1997
+ ...G.size > 0 ? P : []
1998
+ ].filter((p) => p !== void 0 && G.has(p.id)), fe = new Set(k.filter((p) => !U.some((L) => L.includes(p.id))).map((p) => p.id)), te = [...be.map((p) => p.id), ...Ce.length > 0 ? ["more"] : []], pe = T !== null && te.includes(T) ? T : te[0] ?? null, _e = (p) => {
1999
+ var ae, me;
2000
+ const L = te.indexOf(pe ?? "");
2001
+ let Z = null;
2002
+ if (p.key === "ArrowRight" ? Z = Math.min(te.length - 1, L + 1) : p.key === "ArrowLeft" ? Z = Math.max(0, L - 1) : p.key === "Home" ? Z = 0 : p.key === "End" ? Z = te.length - 1 : p.key === "Escape" && x(pe), Z === null) return;
2214
2003
  p.preventDefault();
2215
- const me = le[V] ?? null;
2216
- T(me), (he = (ae = d.current) == null ? void 0 : ae.querySelector(`[data-stop="${CSS.escape(me ?? "")}"]`)) == null || he.focus();
2217
- }, ye = Ce.map((p) => ({
2004
+ const ue = te[Z] ?? null;
2005
+ C(ue), (me = (ae = d.current) == null ? void 0 : ae.querySelector(`[data-stop="${CSS.escape(ue ?? "")}"]`)) == null || me.focus();
2006
+ }, we = Ce.map((p) => ({
2218
2007
  id: p.id,
2219
- label: /* @__PURE__ */ c($, { children: [
2220
- /* @__PURE__ */ e(je, { name: p.icon }),
2008
+ label: /* @__PURE__ */ f(ge, { children: [
2009
+ /* @__PURE__ */ n(je, { name: p.icon }),
2221
2010
  p.label
2222
2011
  ] }),
2223
2012
  offer: p.disabled ? { offered: !0, locked: !1, refusal: p.reason ?? "" } : { offered: !0, locked: !1 },
2224
2013
  ...p.danger ? { danger: !0 } : {},
2225
2014
  onSelect: () => {
2226
- var V;
2015
+ var Z;
2227
2016
  if (p.disabled || p.busy) return;
2228
2017
  if (p.entries === void 0) {
2229
2018
  l(p.id);
2230
2019
  return;
2231
2020
  }
2232
- const L = (V = b.current) == null ? void 0 : V.getBoundingClientRect();
2233
- y("first"), v({ which: p.id, x: (L == null ? void 0 : L.left) ?? 0, y: (L == null ? void 0 : L.bottom) ?? 0 });
2021
+ const L = (Z = b.current) == null ? void 0 : Z.getBoundingClientRect();
2022
+ g("first"), N({ which: p.id, x: (L == null ? void 0 : L.left) ?? 0, y: (L == null ? void 0 : L.bottom) ?? 0 });
2234
2023
  }
2235
- })), te = f === null || f.which === "more" ? void 0 : N.find((p) => p.id === f.which), we = ((te == null ? void 0 : te.entries) ?? []).map((p) => ({
2024
+ })), ne = m === null || m.which === "more" ? void 0 : y.find((p) => p.id === m.which), ye = ((ne == null ? void 0 : ne.entries) ?? []).map((p) => ({
2236
2025
  id: p.id,
2237
- label: /* @__PURE__ */ c($, { children: [
2238
- p.icon !== void 0 ? /* @__PURE__ */ e(je, { name: p.icon }) : null,
2026
+ label: /* @__PURE__ */ f(ge, { children: [
2027
+ p.icon !== void 0 ? /* @__PURE__ */ n(je, { name: p.icon }) : null,
2239
2028
  p.label
2240
2029
  ] }),
2241
2030
  offer: p.disabled ? { offered: !0, locked: !1, refusal: p.reason ?? "" } : { offered: !0, locked: !1 },
@@ -2243,88 +2032,89 @@ function fl({ label: n, actions: t, onAction: l, status: r, moreLabel: s, leadin
2243
2032
  onSelect: () => {
2244
2033
  p.disabled || l(p.id);
2245
2034
  }
2246
- })), w = (p, L, V) => {
2247
- const me = L.getBoundingClientRect();
2248
- y(V), v({ which: p, x: me.left, y: me.bottom });
2249
- }, C = k.length + (F !== null ? 1 : 0), Z = (p) => /* @__PURE__ */ e(
2250
- Mt,
2035
+ })), w = (p, L, Z) => {
2036
+ const ue = L.getBoundingClientRect();
2037
+ g(Z), N({ which: p, x: ue.left, y: ue.bottom });
2038
+ }, E = k.length + (B !== null ? 1 : 0), W = (p) => /* @__PURE__ */ n(
2039
+ Lt,
2251
2040
  {
2252
2041
  action: p,
2253
- labels: !i.bare.has(p.id),
2254
- overflowed: j.has(p.id),
2255
- pinned: pe.has(p.id),
2256
- tabbable: be === p.id,
2257
- tipOff: M === p.id,
2258
- menuOpen: (f == null ? void 0 : f.which) === p.id,
2259
- onChoose: (L, V) => {
2260
- p.entries === void 0 ? l(p.id) : (f == null ? void 0 : f.which) === p.id && V === null ? v(null) : w(p.id, L, V ?? "first");
2042
+ primary: p.id === I,
2043
+ labels: !c.bare.has(p.id),
2044
+ overflowed: G.has(p.id),
2045
+ pinned: fe.has(p.id),
2046
+ tabbable: pe === p.id,
2047
+ tipOff: S === p.id,
2048
+ menuOpen: (m == null ? void 0 : m.which) === p.id,
2049
+ onChoose: (L, Z) => {
2050
+ p.entries === void 0 ? l(p.id) : (m == null ? void 0 : m.which) === p.id && Z === null ? N(null) : w(p.id, L, Z ?? "first");
2261
2051
  },
2262
2052
  onFocus: () => {
2263
- T(p.id), E(null);
2053
+ C(p.id), x(null);
2264
2054
  }
2265
2055
  },
2266
2056
  p.id
2267
2057
  );
2268
- return /* @__PURE__ */ c(
2058
+ return /* @__PURE__ */ f(
2269
2059
  "div",
2270
2060
  {
2271
2061
  ref: d,
2272
2062
  role: "toolbar",
2273
- "aria-label": n,
2274
- className: H(
2063
+ "aria-label": e,
2064
+ className: F(
2275
2065
  "cms-pane-toolbar",
2276
- C > 0 && i.bare.size >= C && "cms-pane-toolbar--labels-hidden",
2277
- i.bare.size > 0 && i.bare.size < C && "cms-pane-toolbar--labels-partly-hidden"
2066
+ E > 0 && c.bare.size >= E && "cms-pane-toolbar--labels-hidden",
2067
+ c.bare.size > 0 && c.bare.size < E && "cms-pane-toolbar--labels-partly-hidden"
2278
2068
  ),
2279
- onKeyDown: ve,
2069
+ onKeyDown: _e,
2280
2070
  children: [
2281
- a !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: a }) : null,
2071
+ i !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-pane-toolbar__leading", children: i }) : null,
2282
2072
  _.map((p, L) => {
2283
- const V = p.filter((ae) => !ne(ae)), me = _.slice(0, L).some((ae) => ae.some((he) => !ne(he)));
2284
- return /* @__PURE__ */ c("div", { className: "cms-pane-toolbar__group-wrap", children: [
2285
- V.length > 0 && me ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
2286
- /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: V.length === 0, children: p.filter((ae) => ae !== X).map((ae) => Z(ae)) })
2073
+ const Z = p.filter((ae) => !ee(ae)), ue = _.slice(0, L).some((ae) => ae.some((me) => !ee(me)));
2074
+ return /* @__PURE__ */ f("div", { className: "cms-pane-toolbar__group-wrap", children: [
2075
+ Z.length > 0 && ue ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
2076
+ /* @__PURE__ */ n("div", { className: "cms-pane-toolbar__group", hidden: Z.length === 0, children: p.filter((ae) => ae !== Y).map((ae) => W(ae)) })
2287
2077
  ] }, L);
2288
2078
  }),
2289
- X !== null ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group cms-pane-toolbar__lone", children: Z(X) }) : null,
2290
- Ce.length > 0 ? /* @__PURE__ */ e(
2079
+ Y !== null ? /* @__PURE__ */ n("div", { className: "cms-pane-toolbar__group cms-pane-toolbar__lone", children: W(Y) }) : null,
2080
+ Ce.length > 0 ? /* @__PURE__ */ n(
2291
2081
  "button",
2292
2082
  {
2293
2083
  ref: b,
2294
2084
  type: "button",
2295
2085
  className: "cms-icon-button cms-pane-toolbar__more",
2296
2086
  "data-stop": "more",
2297
- "aria-label": s,
2298
- title: s,
2087
+ "aria-label": a,
2088
+ title: a,
2299
2089
  "aria-haspopup": "menu",
2300
- "aria-expanded": (f == null ? void 0 : f.which) === "more",
2301
- tabIndex: be === "more" ? 0 : -1,
2302
- onFocus: () => T("more"),
2090
+ "aria-expanded": (m == null ? void 0 : m.which) === "more",
2091
+ tabIndex: pe === "more" ? 0 : -1,
2092
+ onFocus: () => C("more"),
2303
2093
  onClick: (p) => {
2304
- (f == null ? void 0 : f.which) === "more" ? v(null) : w("more", p.currentTarget, "first");
2094
+ (m == null ? void 0 : m.which) === "more" ? N(null) : w("more", p.currentTarget, "first");
2305
2095
  },
2306
2096
  onKeyDown: (p) => {
2307
2097
  (p.key === "ArrowDown" || p.key === "ArrowUp") && (p.preventDefault(), p.stopPropagation(), w("more", p.currentTarget, p.key === "ArrowUp" ? "last" : "first"));
2308
2098
  },
2309
- children: /* @__PURE__ */ e(B, { name: "more" })
2099
+ children: /* @__PURE__ */ n($, { name: "more" })
2310
2100
  }
2311
2101
  ) : null,
2312
- r !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: r, children: r }) : null,
2313
- /* @__PURE__ */ e(Ke, { at: (f == null ? void 0 : f.which) === "more" ? f : null, items: ye, onClose: () => v(null), label: s, focus: u }),
2314
- /* @__PURE__ */ e(Ke, { at: te !== void 0 ? f : null, items: we, onClose: () => v(null), label: (te == null ? void 0 : te.label) ?? "", focus: u }),
2315
- /* @__PURE__ */ c("div", { ref: m, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
2316
- a !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: a }) : null,
2317
- /* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
2318
- /* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(B, { name: "more" }) }),
2319
- N.map((p) => /* @__PURE__ */ c("span", { children: [
2320
- /* @__PURE__ */ c("span", { "data-measure": "full", "data-measure-action": p.id, className: H("cms-pane-toolbar__action", p.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
2321
- /* @__PURE__ */ e(je, { name: p.icon }),
2322
- /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: p.label }),
2323
- p.entries !== void 0 ? /* @__PURE__ */ e(nn, {}) : null
2102
+ s !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__status", title: s, children: s }) : null,
2103
+ /* @__PURE__ */ n(Ke, { at: (m == null ? void 0 : m.which) === "more" ? m : null, items: we, onClose: () => N(null), label: a, focus: r }),
2104
+ /* @__PURE__ */ n(Ke, { at: ne !== void 0 ? m : null, items: ye, onClose: () => N(null), label: (ne == null ? void 0 : ne.label) ?? "", focus: r }),
2105
+ /* @__PURE__ */ f("div", { ref: u, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
2106
+ i !== void 0 ? /* @__PURE__ */ n("div", { "data-measure": "leading", children: i }) : null,
2107
+ /* @__PURE__ */ n("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
2108
+ /* @__PURE__ */ n("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ n($, { name: "more" }) }),
2109
+ y.map((p) => /* @__PURE__ */ f("span", { children: [
2110
+ /* @__PURE__ */ f("span", { "data-measure": "full", "data-measure-action": p.id, className: F("cms-pane-toolbar__action", p.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
2111
+ /* @__PURE__ */ n(je, { name: p.icon }),
2112
+ /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__label", children: p.label }),
2113
+ p.entries !== void 0 ? /* @__PURE__ */ n(ln, {}) : null
2324
2114
  ] }),
2325
- /* @__PURE__ */ c("span", { "data-measure": "icon", "data-measure-action": p.id, className: H("cms-pane-toolbar__action", Ue(p.icon) !== null && "cms-pane-toolbar__action--bare", p.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
2326
- Ue(p.icon) !== null ? /* @__PURE__ */ e(je, { name: p.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: p.label }),
2327
- p.entries !== void 0 ? /* @__PURE__ */ e(nn, {}) : null
2115
+ /* @__PURE__ */ f("span", { "data-measure": "icon", "data-measure-action": p.id, className: F("cms-pane-toolbar__action", Be(p.icon) !== null && "cms-pane-toolbar__action--bare", p.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
2116
+ Be(p.icon) !== null ? /* @__PURE__ */ n(je, { name: p.icon }) : /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__label", children: p.label }),
2117
+ p.entries !== void 0 ? /* @__PURE__ */ n(ln, {}) : null
2328
2118
  ] })
2329
2119
  ] }, p.id))
2330
2120
  ] })
@@ -2332,140 +2122,140 @@ function fl({ label: n, actions: t, onAction: l, status: r, moreLabel: s, leadin
2332
2122
  }
2333
2123
  );
2334
2124
  }
2335
- const Oe = "tip";
2336
- function Mt({ action: n, labels: t, overflowed: l, pinned: r, tabbable: s, tipOff: a, menuOpen: h, onChoose: d, onFocus: m }) {
2337
- const [b, i] = D(!1);
2338
- ee(() => {
2339
- if (!n.busy) {
2340
- i(!1);
2125
+ const Pe = "tip";
2126
+ function Lt({ action: e, primary: t, labels: l, overflowed: s, pinned: a, tabbable: i, tipOff: h, menuOpen: d, onChoose: u, onFocus: b }) {
2127
+ const [c, v] = D(!1);
2128
+ Q(() => {
2129
+ if (!e.busy) {
2130
+ v(!1);
2341
2131
  return;
2342
2132
  }
2343
- const _ = setTimeout(() => i(!0), Je);
2344
- return () => clearTimeout(_);
2345
- }, [n.busy]);
2346
- const g = Ue(n.icon) === null, f = t || g, v = n.disabled && n.reason ? n.reason : null, u = v ?? (f ? null : n.label), y = fe(), [S, T] = D(!1), M = an(), E = n.entries !== void 0;
2347
- return /* @__PURE__ */ c(
2133
+ const y = setTimeout(() => v(!0), en);
2134
+ return () => clearTimeout(y);
2135
+ }, [e.busy]);
2136
+ const m = Be(e.icon) === null, N = l || m, r = e.disabled && e.reason ? e.reason : null, g = r ?? (N ? null : e.label), T = he(), [C, S] = D(!1), x = dn(), _ = e.entries !== void 0;
2137
+ return /* @__PURE__ */ f(
2348
2138
  "button",
2349
2139
  {
2350
2140
  type: "button",
2351
- className: H("cms-pane-toolbar__action", !f && "cms-pane-toolbar__action--bare", g && "cms-pane-toolbar__action--text", E && "cms-pane-toolbar__action--menu", n.danger && "is-danger"),
2352
- "data-action": n.id,
2353
- "data-stop": n.id,
2354
- ...l ? { "data-overflowed": "" } : {},
2355
- ...r ? { "data-pinned": "" } : {},
2356
- hidden: l,
2357
- "aria-label": n.label,
2358
- "aria-disabled": n.disabled || void 0,
2359
- "aria-busy": n.busy || void 0,
2360
- ...E ? { "aria-haspopup": "menu", "aria-expanded": h } : {},
2361
- ...v === null ? {} : { "aria-describedby": y },
2362
- ...S && v !== null ? { "data-reason-shown": "" } : {},
2363
- ...M.dismissed(Oe) ? { "data-tip-dismissed": "" } : {},
2364
- tabIndex: s ? 0 : -1,
2141
+ className: F("cms-pane-toolbar__action", t && "cms-pane-toolbar__action--primary", !N && "cms-pane-toolbar__action--bare", m && "cms-pane-toolbar__action--text", _ && "cms-pane-toolbar__action--menu", e.danger && "is-danger"),
2142
+ "data-action": e.id,
2143
+ "data-stop": e.id,
2144
+ ...s ? { "data-overflowed": "" } : {},
2145
+ ...a ? { "data-pinned": "" } : {},
2146
+ hidden: s,
2147
+ "aria-label": e.label,
2148
+ "aria-disabled": e.disabled || void 0,
2149
+ "aria-busy": e.busy || void 0,
2150
+ ..._ ? { "aria-haspopup": "menu", "aria-expanded": d } : {},
2151
+ ...r === null ? {} : { "aria-describedby": T },
2152
+ ...C && r !== null ? { "data-reason-shown": "" } : {},
2153
+ ...x.dismissed(Pe) ? { "data-tip-dismissed": "" } : {},
2154
+ tabIndex: i ? 0 : -1,
2365
2155
  onFocus: () => {
2366
- m(), M.focusIn(Oe);
2156
+ b(), x.focusIn(Pe);
2367
2157
  },
2368
2158
  onBlur: () => {
2369
- T(!1), M.focusOut(Oe);
2159
+ S(!1), x.focusOut(Pe);
2370
2160
  },
2371
- onMouseEnter: () => M.pointerIn(Oe),
2372
- onMouseLeave: () => M.pointerOut(Oe),
2373
- onKeyDown: (_) => {
2374
- _.key === "Escape" && (T(!1), M.dismiss(Oe)), E && (_.key === "ArrowDown" || _.key === "ArrowUp") && (_.preventDefault(), v !== null ? T(!0) : !n.disabled && !n.busy && d(_.currentTarget, _.key === "ArrowUp" ? "last" : "first"));
2161
+ onMouseEnter: () => x.pointerIn(Pe),
2162
+ onMouseLeave: () => x.pointerOut(Pe),
2163
+ onKeyDown: (y) => {
2164
+ y.key === "Escape" && (S(!1), x.dismiss(Pe)), _ && (y.key === "ArrowDown" || y.key === "ArrowUp") && (y.preventDefault(), r !== null ? S(!0) : !e.disabled && !e.busy && u(y.currentTarget, y.key === "ArrowUp" ? "last" : "first"));
2375
2165
  },
2376
- onClick: (_) => {
2377
- v !== null ? (T(!0), M.show(Oe)) : !n.disabled && !n.busy && d(_.currentTarget, null);
2166
+ onClick: (y) => {
2167
+ r !== null ? (S(!0), x.show(Pe)) : !e.disabled && !e.busy && u(y.currentTarget, null);
2378
2168
  },
2379
2169
  children: [
2380
- b ? /* @__PURE__ */ e(re, { name: "spinner" }) : /* @__PURE__ */ e(je, { name: n.icon }),
2381
- f ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
2382
- E ? /* @__PURE__ */ e(nn, {}) : null,
2383
- v !== null || u !== null && !a ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: y, children: u }) : null
2170
+ c ? /* @__PURE__ */ n(se, { name: "spinner" }) : /* @__PURE__ */ n(je, { name: e.icon }),
2171
+ N ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: e.label }) : null,
2172
+ _ ? /* @__PURE__ */ n(ln, {}) : null,
2173
+ r !== null || g !== null && !h ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: T, children: g }) : null
2384
2174
  ]
2385
2175
  }
2386
2176
  );
2387
2177
  }
2388
- function nn() {
2389
- return /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__chevron", "aria-hidden": "true", children: /* @__PURE__ */ e(B, { name: "chevron-down", size: 14 }) });
2178
+ function ln() {
2179
+ return /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__chevron", "aria-hidden": "true", children: /* @__PURE__ */ n($, { name: "chevron-down", size: 14 }) });
2390
2180
  }
2391
- function je({ name: n }) {
2392
- const t = Ue(n);
2393
- return t === null ? null : /* @__PURE__ */ e(B, { name: t, size: 18 });
2181
+ function je({ name: e }) {
2182
+ const t = Be(e);
2183
+ return t === null ? null : /* @__PURE__ */ n($, { name: t, size: 18 });
2394
2184
  }
2395
- function pl({ title: n, body: t = null, time: l = null, unread: r, unreadLabel: s, expandLabel: a, collapseLabel: h, action: d = null, onRead: m, leading: b }) {
2396
- const [i, g] = D(!1), f = fe(), v = () => {
2397
- r && m();
2398
- }, u = (d == null ? void 0 : d.presentation) === "row" && d.onAction !== void 0, y = (d == null ? void 0 : d.presentation) === "button" && d.onAction !== void 0 ? d : null, S = () => {
2399
- var T;
2400
- v(), u && ((T = d.onAction) == null || T.call(d));
2185
+ function yl({ title: e, body: t = null, time: l = null, unread: s, unreadLabel: a, expandLabel: i, collapseLabel: h, action: d = null, onRead: u, leading: b }) {
2186
+ const [c, v] = D(!1), m = he(), N = () => {
2187
+ s && u();
2188
+ }, r = (d == null ? void 0 : d.presentation) === "row" && d.onAction !== void 0, g = (d == null ? void 0 : d.presentation) === "button" && d.onAction !== void 0 ? d : null, T = () => {
2189
+ var C;
2190
+ N(), r && ((C = d.onAction) == null || C.call(d));
2401
2191
  };
2402
- return /* @__PURE__ */ c("article", { className: H("cms-notification", r && "is-unread", i && "is-expanded", u && "is-row-action"), "data-state": r ? "unread" : "read", children: [
2403
- /* @__PURE__ */ c(
2192
+ return /* @__PURE__ */ f("article", { className: F("cms-notification", s && "is-unread", c && "is-expanded", r && "is-row-action"), "data-state": s ? "unread" : "read", children: [
2193
+ /* @__PURE__ */ f(
2404
2194
  "div",
2405
2195
  {
2406
2196
  className: "cms-notification__row",
2407
2197
  role: "button",
2408
2198
  tabIndex: 0,
2409
- "aria-describedby": t === null ? void 0 : f,
2410
- onClick: S,
2411
- onKeyDown: (T) => {
2412
- T.target !== T.currentTarget || T.key !== "Enter" && T.key !== " " || (T.preventDefault(), S());
2199
+ "aria-describedby": t === null ? void 0 : m,
2200
+ onClick: T,
2201
+ onKeyDown: (C) => {
2202
+ C.target !== C.currentTarget || C.key !== "Enter" && C.key !== " " || (C.preventDefault(), T());
2413
2203
  },
2414
2204
  children: [
2415
- b != null ? /* @__PURE__ */ e("span", { className: "cms-notification__leading", children: b }) : null,
2416
- /* @__PURE__ */ c("span", { className: "cms-notification__text", children: [
2417
- /* @__PURE__ */ c("span", { className: "cms-notification__head", children: [
2418
- /* @__PURE__ */ c("span", { className: "cms-notification__title", children: [
2419
- r ? /* @__PURE__ */ c("span", { className: "cms-visually-hidden", children: [
2420
- s,
2205
+ b != null ? /* @__PURE__ */ n("span", { className: "cms-notification__leading", children: b }) : null,
2206
+ /* @__PURE__ */ f("span", { className: "cms-notification__text", children: [
2207
+ /* @__PURE__ */ f("span", { className: "cms-notification__head", children: [
2208
+ /* @__PURE__ */ f("span", { className: "cms-notification__title", children: [
2209
+ s ? /* @__PURE__ */ f("span", { className: "cms-visually-hidden", children: [
2210
+ a,
2421
2211
  " "
2422
2212
  ] }) : null,
2423
- n
2213
+ e
2424
2214
  ] }),
2425
- l !== null ? /* @__PURE__ */ e("span", { className: "cms-notification__time", children: l }) : null
2215
+ l !== null ? /* @__PURE__ */ n("span", { className: "cms-notification__time", children: l }) : null
2426
2216
  ] }),
2427
- t !== null && t !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id: f, children: t }) : null
2217
+ t !== null && t !== "" ? /* @__PURE__ */ n("span", { className: "cms-notification__body", id: m, children: t }) : null
2428
2218
  ] }),
2429
- r ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
2219
+ s ? /* @__PURE__ */ n("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
2430
2220
  ]
2431
2221
  }
2432
2222
  ),
2433
- t !== null && t !== "" ? /* @__PURE__ */ e(
2223
+ t !== null && t !== "" ? /* @__PURE__ */ n(
2434
2224
  "button",
2435
2225
  {
2436
2226
  type: "button",
2437
2227
  className: "cms-notification__chevron",
2438
- "aria-expanded": i,
2439
- "aria-controls": f,
2440
- "aria-label": i ? h : a,
2441
- title: i ? h : a,
2228
+ "aria-expanded": c,
2229
+ "aria-controls": m,
2230
+ "aria-label": c ? h : i,
2231
+ title: c ? h : i,
2442
2232
  onClick: () => {
2443
- i || v(), g((T) => !T);
2233
+ c || N(), v((C) => !C);
2444
2234
  },
2445
- children: /* @__PURE__ */ e(B, { name: "chevron-down", size: 18 })
2235
+ children: /* @__PURE__ */ n($, { name: "chevron-down", size: 18 })
2446
2236
  }
2447
2237
  ) : null,
2448
- y !== null ? /* @__PURE__ */ e(
2238
+ g !== null ? /* @__PURE__ */ n(
2449
2239
  "button",
2450
2240
  {
2451
2241
  type: "button",
2452
2242
  className: "cms-button cms-notification__action",
2453
2243
  onClick: () => {
2454
- var T;
2455
- v(), (T = y.onAction) == null || T.call(y);
2244
+ var C;
2245
+ N(), (C = g.onAction) == null || C.call(g);
2456
2246
  },
2457
- children: y.label
2247
+ children: g.label
2458
2248
  }
2459
2249
  ) : null
2460
2250
  ] });
2461
2251
  }
2462
- function Ct(n) {
2463
- return n === "allowed" || n === "elevate" || n === "denied";
2252
+ function Dt(e) {
2253
+ return e === "allowed" || e === "elevate" || e === "denied";
2464
2254
  }
2465
- function bl(n, t) {
2466
- if (!Ct(n))
2255
+ function Nl(e, t) {
2256
+ if (!Dt(e))
2467
2257
  return t.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 };
2468
- switch (n) {
2258
+ switch (e) {
2469
2259
  case "allowed":
2470
2260
  return { offered: !0, locked: !1 };
2471
2261
  case "elevate":
@@ -2474,343 +2264,343 @@ function bl(n, t) {
2474
2264
  return t.showRefused ? { offered: !0, locked: !1, refusal: t.refusal ?? "not allowed" } : { offered: !1, locked: !1 };
2475
2265
  }
2476
2266
  }
2477
- function St(n, t) {
2478
- if (!n) return;
2479
- if (typeof n.get == "function") return n.get(t) ?? void 0;
2480
- const l = n, r = Object.keys(l).find((s) => s.toLowerCase() === t.toLowerCase());
2481
- return r === void 0 ? void 0 : l[r];
2267
+ function It(e, t) {
2268
+ if (!e) return;
2269
+ if (typeof e.get == "function") return e.get(t) ?? void 0;
2270
+ const l = e, s = Object.keys(l).find((a) => a.toLowerCase() === t.toLowerCase());
2271
+ return s === void 0 ? void 0 : l[s];
2482
2272
  }
2483
- function Et(n) {
2484
- if (n && typeof n == "object") {
2485
- const t = n;
2273
+ function $t(e) {
2274
+ if (e && typeof e == "object") {
2275
+ const t = e;
2486
2276
  if (typeof t.detail == "string" && t.detail !== "") return t.detail;
2487
2277
  if (typeof t.title == "string" && t.title !== "") return t.title;
2488
2278
  }
2489
2279
  }
2490
- function _l(n, t, l, r) {
2491
- if (n !== 403) return { kind: "none" };
2492
- const s = Et(l);
2493
- return St(t, "X-Elevation-Required") !== void 0 ? r.elevates ? { kind: "elevation-required", message: s ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: s ?? "The server refused this." };
2280
+ function kl(e, t, l, s) {
2281
+ if (e !== 403) return { kind: "none" };
2282
+ const a = $t(l);
2283
+ return It(t, "X-Elevation-Required") !== void 0 ? s.elevates ? { kind: "elevation-required", message: a ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: a ?? "The server refused this." };
2494
2284
  }
2495
- const tn = "coolms-kit:reread";
2496
- function vl() {
2497
- window.dispatchEvent(new Event(tn));
2285
+ const sn = "coolms-kit:reread";
2286
+ function xl() {
2287
+ window.dispatchEvent(new Event(sn));
2498
2288
  }
2499
- function gl(n) {
2500
- const [t, l] = D(void 0), [r, s] = D(void 0), [a, h] = D(!0), d = P(n);
2501
- d.current = n;
2502
- const m = P(0), b = Ie(() => {
2503
- const i = ++m.current;
2289
+ function Ml(e) {
2290
+ const [t, l] = D(void 0), [s, a] = D(void 0), [i, h] = D(!0), d = O(e);
2291
+ d.current = e;
2292
+ const u = O(0), b = Ie(() => {
2293
+ const c = ++u.current;
2504
2294
  h(!0), d.current().then(
2505
- (g) => {
2506
- i === m.current && (l(g), s(void 0), h(!1));
2295
+ (v) => {
2296
+ c === u.current && (l(v), a(void 0), h(!1));
2507
2297
  },
2508
- (g) => {
2509
- i === m.current && (s(g), h(!1));
2298
+ (v) => {
2299
+ c === u.current && (a(v), h(!1));
2510
2300
  }
2511
2301
  );
2512
2302
  }, []);
2513
- return ee(() => {
2303
+ return Q(() => {
2514
2304
  b();
2515
- const i = () => b();
2516
- return window.addEventListener("focus", i), window.addEventListener(tn, i), () => {
2517
- window.removeEventListener("focus", i), window.removeEventListener(tn, i);
2305
+ const c = () => b();
2306
+ return window.addEventListener("focus", c), window.addEventListener(sn, c), () => {
2307
+ window.removeEventListener("focus", c), window.removeEventListener(sn, c);
2518
2308
  };
2519
- }, [b]), { value: t, error: r, loading: a, reread: b };
2309
+ }, [b]), { value: t, error: s, loading: i, reread: b };
2520
2310
  }
2521
- function yl(n) {
2522
- 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 };
2311
+ function Cl(e) {
2312
+ return e === 412 ? { conflict: !0, message: "Someone changed this since you opened it. Nothing was saved; read it again to see the change." } : { conflict: !1 };
2523
2313
  }
2524
- const At = "/errors/client-update-required";
2525
- function Tt(n, t) {
2526
- const l = n.split(".").map((s) => Number.parseInt(s, 10) || 0), r = t.split(".").map((s) => Number.parseInt(s, 10) || 0);
2527
- for (let s = 0; s < Math.max(l.length, r.length); s++) {
2528
- const a = l[s] ?? 0, h = r[s] ?? 0;
2529
- if (a !== h) return a < h;
2314
+ const Bt = "/errors/client-update-required";
2315
+ function Ft(e, t) {
2316
+ const l = e.split(".").map((a) => Number.parseInt(a, 10) || 0), s = t.split(".").map((a) => Number.parseInt(a, 10) || 0);
2317
+ for (let a = 0; a < Math.max(l.length, s.length); a++) {
2318
+ const i = l[a] ?? 0, h = s[a] ?? 0;
2319
+ if (i !== h) return i < h;
2530
2320
  }
2531
2321
  return !1;
2532
2322
  }
2533
- function wl(n) {
2534
- return n.problemType !== void 0 && n.problemType.endsWith(At) ? !0 : n.minimumVersion !== void 0 && Tt(n.version, n.minimumVersion);
2535
- }
2536
- const Pe = "primary", Nn = 4, Lt = 48;
2537
- function Dt(n, t, l) {
2538
- const r = n.querySelector(":scope > .cms-screen__bar");
2539
- return l <= t.scrollHeight - t.clientHeight - ((r == null ? void 0 : r.offsetHeight) ?? 0);
2540
- }
2541
- const It = 800, $t = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "]);
2542
- function Bt(n, t) {
2543
- const [l, r] = D(!1);
2544
- return ee(() => {
2545
- const s = n.current;
2546
- if (s === null || !t) {
2547
- r(!1);
2323
+ function Sl(e) {
2324
+ return e.problemType !== void 0 && e.problemType.endsWith(Bt) ? !0 : e.minimumVersion !== void 0 && Ft(e.version, e.minimumVersion);
2325
+ }
2326
+ const ze = "primary", Mn = 4, Rt = 48;
2327
+ function Ht(e, t, l) {
2328
+ const s = e.querySelector(":scope > .cms-screen__bar");
2329
+ return l <= t.scrollHeight - t.clientHeight - ((s == null ? void 0 : s.offsetHeight) ?? 0);
2330
+ }
2331
+ const Ot = 800, Pt = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "]);
2332
+ function zt(e, t) {
2333
+ const [l, s] = D(!1);
2334
+ return Q(() => {
2335
+ const a = e.current;
2336
+ if (a === null || !t) {
2337
+ s(!1);
2548
2338
  return;
2549
2339
  }
2550
- const a = /* @__PURE__ */ new WeakMap();
2340
+ const i = /* @__PURE__ */ new WeakMap();
2551
2341
  let h = Number.NEGATIVE_INFINITY, d = null;
2552
- const m = (f) => {
2553
- h = performance.now(), d = f.target;
2554
- }, b = (f) => {
2555
- const v = f.target;
2556
- !(v instanceof HTMLElement && (v.isContentEditable || v.closest("input, textarea, select") !== null)) && $t.has(f.key) && m(f);
2557
- }, i = (f) => {
2558
- const v = f.target;
2559
- if (!(v instanceof HTMLElement)) return;
2560
- const u = v.scrollTop, y = a.get(v) ?? 0;
2561
- if (a.set(v, u), u <= 0) {
2562
- r(!1);
2342
+ const u = (m) => {
2343
+ h = performance.now(), d = m.target;
2344
+ }, b = (m) => {
2345
+ const N = m.target;
2346
+ !(N instanceof HTMLElement && (N.isContentEditable || N.closest("input, textarea, select") !== null)) && Pt.has(m.key) && u(m);
2347
+ }, c = (m) => {
2348
+ const N = m.target;
2349
+ if (!(N instanceof HTMLElement)) return;
2350
+ const r = N.scrollTop, g = i.get(N) ?? 0;
2351
+ if (i.set(N, r), r <= 0) {
2352
+ s(!1);
2563
2353
  return;
2564
2354
  }
2565
- performance.now() - h > It || !(d === s || d === document.body || d instanceof Node && v.contains(d)) || (u < y - Nn ? r(!1) : u > y + Nn && u > Lt && Dt(s, v, u) && r(!0));
2566
- }, g = [["wheel", m], ["touchmove", m], ["pointerdown", m], ["keydown", b]];
2567
- for (const [f, v] of g) s.addEventListener(f, v, { capture: !0, passive: !0 });
2568
- return s.addEventListener("scroll", i, { capture: !0, passive: !0 }), () => {
2569
- for (const [f, v] of g) s.removeEventListener(f, v, { capture: !0 });
2570
- s.removeEventListener("scroll", i, { capture: !0 });
2355
+ performance.now() - h > Ot || !(d === a || d === document.body || d instanceof Node && N.contains(d)) || (r < g - Mn ? s(!1) : r > g + Mn && r > Rt && Ht(a, N, r) && s(!0));
2356
+ }, v = [["wheel", u], ["touchmove", u], ["pointerdown", u], ["keydown", b]];
2357
+ for (const [m, N] of v) a.addEventListener(m, N, { capture: !0, passive: !0 });
2358
+ return a.addEventListener("scroll", c, { capture: !0, passive: !0 }), () => {
2359
+ for (const [m, N] of v) a.removeEventListener(m, N, { capture: !0 });
2360
+ a.removeEventListener("scroll", c, { capture: !0 });
2571
2361
  };
2572
- }, [n, t]), [l, r];
2362
+ }, [e, t]), [l, s];
2573
2363
  }
2574
- const Ft = 64;
2575
- function Ht({ bar: n, leading: t, gap: l, icon: r, iconGap: s, search: a, more: h, globals: d, name: m, choice: b }) {
2576
- const i = [...a ? [r] : [], r, r, ...d], g = i.reduce((v, u) => v + u, 0) + s * (i.length - 1);
2577
- return n - (t > 0 ? t + l : 0) - l - g + 0.01 < Math.min(Ft, m) + b;
2364
+ const Ut = 64;
2365
+ function Kt({ bar: e, leading: t, gap: l, icon: s, iconGap: a, search: i, more: h, globals: d, name: u, choice: b }) {
2366
+ const c = [...i ? [s] : [], s, s, ...d], v = c.reduce((N, r) => N + r, 0) + a * (c.length - 1);
2367
+ return e - (t > 0 ? t + l : 0) - l - v + 0.01 < Math.min(Ut, u) + b;
2578
2368
  }
2579
- function Nl({ title: n, back: t, navigation: l, search: r, searching: s, more: a = [], moreLabel: h = "More actions", globals: d, filter: m, primary: b, onRefresh: i, pullText: g, barHidden: f, children: v }) {
2369
+ function El({ title: e, back: t, navigation: l, search: s, searching: a, more: i = [], moreLabel: h = "More actions", globals: d, filter: u, primary: b, onRefresh: c, pullText: v, barHidden: m, children: N }) {
2580
2370
  var Te, Ee;
2581
- const u = b === void 0 || ("menu" in b ? !b.menu.some((R) => R.offer.offered) : ((Te = b.offer) == null ? void 0 : Te.offered) === !1) ? void 0 : b, y = u !== void 0 && !("menu" in u) ? ((Ee = u.offer) == null ? void 0 : Ee.refusal) ?? null : null, S = fe(), [T, M] = D(!1), E = an(), _ = P(null), N = P(null), [I, K] = D(!1), [z, k] = D(null), [F, U] = D(null), Y = Ie(() => U(null), []), W = P(!1), j = P(null), X = P(null), ne = P(null), ce = a.some((R) => R.offer.offered), _e = F !== null && ce && s === void 0;
2582
- An(m);
2583
- const oe = m === void 0 ? null : Cn(m), [ue, Ce] = D(!1), pe = P(!1), le = P(!1), be = P(null), ve = m === void 0 ? void 0 : {
2584
- ...m,
2371
+ const r = b === void 0 || ("menu" in b ? !b.menu.some((R) => R.offer.offered) : ((Te = b.offer) == null ? void 0 : Te.offered) === !1) ? void 0 : b, g = r !== void 0 && !("menu" in r) ? ((Ee = r.offer) == null ? void 0 : Ee.refusal) ?? null : null, T = he(), [C, S] = D(!1), x = dn(), _ = O(null), y = O(null), [I, U] = D(!1), [P, k] = D(null), [B, z] = D(null), j = Ie(() => z(null), []), K = O(!1), G = O(null), Y = O(null), ee = O(null), ie = i.some((R) => R.offer.offered), be = B !== null && ie && a === void 0;
2372
+ Dn(u);
2373
+ const ce = u === void 0 ? null : An(u), [de, Ce] = D(!1), fe = O(!1), te = O(!1), pe = O(null), _e = u === void 0 ? void 0 : {
2374
+ ...u,
2585
2375
  onChange: (R) => {
2586
- pe.current = !0, m.onChange(R);
2376
+ fe.current = !0, u.onChange(R);
2587
2377
  }
2588
- }, ye = oe === null ? "" : ` · ${oe.label}`, te = m !== void 0 && m.options.length >= 2, [we, w] = D(!1), C = te && ce && we, Z = JSON.stringify([te, ce, C, r !== void 0, s !== void 0, t !== void 0, n, ye]), G = Ie(() => {
2589
- const R = j.current, J = X.current, Ne = ne.current;
2590
- if (R === null || J === null || Ne === null || !te) return null;
2591
- const de = (Q) => parseFloat(Q) || 0, o = getComputedStyle(R), A = R.getBoundingClientRect().width;
2378
+ }, we = ce === null ? "" : ` · ${ce.label}`, ne = u !== void 0 && u.options.length >= 2, [ye, w] = D(!1), E = ne && ie && ye, W = JSON.stringify([ne, ie, E, s !== void 0, a !== void 0, t !== void 0, e, we]), q = Ie(() => {
2379
+ const R = G.current, X = Y.current, Ne = ee.current;
2380
+ if (R === null || X === null || Ne === null || !ne) return null;
2381
+ const oe = (J) => parseFloat(J) || 0, o = getComputedStyle(R), A = R.getBoundingClientRect().width;
2592
2382
  if (A === 0) return null;
2593
- const x = (Q) => {
2383
+ const M = (J) => {
2594
2384
  var ke;
2595
- return ((ke = R.querySelector(`.cms-screen__ruler > [data-ruler="${Q}"]`)) == null ? void 0 : ke.getBoundingClientRect().width) ?? 0;
2596
- }, O = R.querySelector(".cms-screen__leading"), se = (r !== void 0 ? 1 : 0) + (C ? 0 : 1) + 1;
2597
- return Ht({
2598
- bar: A - de(o.paddingLeft) - de(o.paddingRight),
2599
- leading: O === null || O.childNodes.length === 0 ? 0 : de(getComputedStyle(O).minWidth),
2600
- gap: de(o.columnGap),
2385
+ return ((ke = R.querySelector(`.cms-screen__ruler > [data-ruler="${J}"]`)) == null ? void 0 : ke.getBoundingClientRect().width) ?? 0;
2386
+ }, H = R.querySelector(".cms-screen__leading"), le = (s !== void 0 ? 1 : 0) + (E ? 0 : 1) + 1;
2387
+ return Kt({
2388
+ bar: A - oe(o.paddingLeft) - oe(o.paddingRight),
2389
+ leading: H === null || H.childNodes.length === 0 ? 0 : oe(getComputedStyle(H).minWidth),
2390
+ gap: oe(o.columnGap),
2601
2391
  icon: Ne.getBoundingClientRect().width,
2602
- iconGap: de(getComputedStyle(J).columnGap),
2603
- search: r !== void 0,
2392
+ iconGap: oe(getComputedStyle(X).columnGap),
2393
+ search: s !== void 0,
2604
2394
  more: !0,
2605
- globals: Array.from(J.children).slice(se).map((Q) => Q.getBoundingClientRect().width),
2606
- name: x("name"),
2607
- choice: x("choice")
2395
+ globals: Array.from(X.children).slice(le).map((J) => J.getBoundingClientRect().width),
2396
+ name: M("name"),
2397
+ choice: M("choice")
2608
2398
  });
2609
- }, [Z]);
2399
+ }, [W]);
2610
2400
  $e(() => {
2611
- const R = G() ?? we;
2612
- R !== we && pe.current && (le.current = !0), pe.current = !1, w(R);
2613
- }, [G]), ee(() => {
2614
- if (j.current === null || typeof ResizeObserver > "u") return;
2401
+ const R = q() ?? ye;
2402
+ R !== ye && fe.current && (te.current = !0), fe.current = !1, w(R);
2403
+ }, [q]), Q(() => {
2404
+ if (G.current === null || typeof ResizeObserver > "u") return;
2615
2405
  const R = new ResizeObserver(() => {
2616
- const J = G();
2617
- J !== null && w(J);
2406
+ const X = q();
2407
+ X !== null && w(X);
2618
2408
  });
2619
- for (const J of [j.current, X.current, ...j.current.querySelectorAll(".cms-screen__ruler > span")]) J !== null && R.observe(J);
2409
+ for (const X of [G.current, Y.current, ...G.current.querySelectorAll(".cms-screen__ruler > span")]) X !== null && R.observe(X);
2620
2410
  return () => R.disconnect();
2621
- }, [G]);
2622
- const p = P(C);
2411
+ }, [q]);
2412
+ const p = O(E);
2623
2413
  $e(() => {
2624
- var Ne, de, o;
2625
- if (p.current === C) return;
2626
- p.current = C, U(null);
2414
+ var Ne, oe, o;
2415
+ if (p.current === E) return;
2416
+ p.current = E, z(null);
2627
2417
  const R = document.activeElement;
2628
- (R === document.body && be.current !== null && !be.current.isConnected || le.current && (R === document.body || ((Ne = j.current) == null ? void 0 : Ne.contains(R)) === !0)) && ((o = C ? ne.current : (de = X.current) == null ? void 0 : de.querySelector(".cms-filter-menu")) == null || o.focus()), le.current = !1;
2629
- }, [C]);
2630
- const L = C && oe !== null && m !== void 0 ? `${h}, ${Sn(m)}` : h, me = st(N, i === void 0 ? null : () => {
2631
- I || (K(!0), i().finally(() => K(!1)));
2632
- }), ae = i === void 0 ? null : { distance: me, refreshing: I, text: g ?? null }, he = s !== void 0 || me > 0 || I || _e || ue, [Se, We] = Bt(_, f === void 0 && !he), Be = !he && (f ?? Se);
2633
- return /* @__PURE__ */ c(
2418
+ (R === document.body && pe.current !== null && !pe.current.isConnected || te.current && (R === document.body || ((Ne = G.current) == null ? void 0 : Ne.contains(R)) === !0)) && ((o = E ? ee.current : (oe = Y.current) == null ? void 0 : oe.querySelector(".cms-filter-menu")) == null || o.focus()), te.current = !1;
2419
+ }, [E]);
2420
+ const L = E && ce !== null && u !== void 0 ? `${h}, ${Tn(u)}` : h, ue = dt(y, c === void 0 ? null : () => {
2421
+ I || (U(!0), c().finally(() => U(!1)));
2422
+ }), ae = c === void 0 ? null : { distance: ue, refreshing: I, text: v ?? null }, me = a !== void 0 || ue > 0 || I || be || de, [Se, We] = zt(_, m === void 0 && !me), Fe = !me && (m ?? Se);
2423
+ return /* @__PURE__ */ f(
2634
2424
  "div",
2635
2425
  {
2636
2426
  ref: _,
2637
- className: H("cms-screen", u !== void 0 && "cms-screen--with-primary"),
2638
- "data-bar-hidden": Be ? "" : void 0,
2427
+ className: F("cms-screen", r !== void 0 && "cms-screen--with-primary"),
2428
+ "data-bar-hidden": Fe ? "" : void 0,
2639
2429
  onFocus: (R) => {
2640
- be.current = R.target, Be && R.target instanceof Element && R.target.closest(".cms-screen__bar") !== null && We(!1);
2430
+ pe.current = R.target, Fe && R.target instanceof Element && R.target.closest(".cms-screen__bar") !== null && We(!1);
2641
2431
  },
2642
2432
  children: [
2643
- s !== void 0 ? /* @__PURE__ */ c("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
2644
- /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": s.closeLabel, title: s.closeLabel, onClick: s.onClose, children: /* @__PURE__ */ e(B, { name: "chevron-left" }) }),
2645
- /* @__PURE__ */ e("div", { className: "cms-screen__search", children: s.field })
2646
- ] }) : /* @__PURE__ */ c("header", { ref: j, className: "cms-screen__bar", children: [
2647
- /* @__PURE__ */ e("div", { className: "cms-screen__leading", children: t !== void 0 ? t.href !== void 0 ? /* @__PURE__ */ c("a", { className: "cms-screen__back", href: t.href, onClick: t.onBack, children: [
2648
- /* @__PURE__ */ e(B, { name: "chevron-left" }),
2649
- /* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: t.label })
2650
- ] }) : /* @__PURE__ */ c("button", { type: "button", className: "cms-screen__back", onClick: t.onBack, children: [
2651
- /* @__PURE__ */ e(B, { name: "chevron-left" }),
2652
- /* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: t.label })
2433
+ a !== void 0 ? /* @__PURE__ */ f("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
2434
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": a.closeLabel, title: a.closeLabel, onClick: a.onClose, children: /* @__PURE__ */ n($, { name: "chevron-left" }) }),
2435
+ /* @__PURE__ */ n("div", { className: "cms-screen__search", children: a.field })
2436
+ ] }) : /* @__PURE__ */ f("header", { ref: G, className: "cms-screen__bar", children: [
2437
+ /* @__PURE__ */ n("div", { className: "cms-screen__leading", children: t !== void 0 ? t.href !== void 0 ? /* @__PURE__ */ f("a", { className: "cms-screen__back", href: t.href, onClick: t.onBack, children: [
2438
+ /* @__PURE__ */ n($, { name: "chevron-left" }),
2439
+ /* @__PURE__ */ n("span", { className: "cms-screen__back-name", children: t.label })
2440
+ ] }) : /* @__PURE__ */ f("button", { type: "button", className: "cms-screen__back", onClick: t.onBack, children: [
2441
+ /* @__PURE__ */ n($, { name: "chevron-left" }),
2442
+ /* @__PURE__ */ n("span", { className: "cms-screen__back-name", children: t.label })
2653
2443
  ] }) : l }),
2654
- oe === null ? /* @__PURE__ */ e("h1", { className: "cms-screen__title", title: n, children: n }) : /* @__PURE__ */ c("h1", { className: "cms-screen__title cms-screen__title--filtered", title: n + ye, children: [
2655
- /* @__PURE__ */ c("span", { className: "cms-screen__title-place", children: [
2656
- /* @__PURE__ */ e("span", { className: "cms-screen__title-name", children: n }),
2657
- /* @__PURE__ */ e("span", { className: "cms-screen__title-dot", children: " · " })
2444
+ ce === null ? /* @__PURE__ */ n("h1", { className: "cms-screen__title", title: e, children: e }) : /* @__PURE__ */ f("h1", { className: "cms-screen__title cms-screen__title--filtered", title: e + we, children: [
2445
+ /* @__PURE__ */ f("span", { className: "cms-screen__title-place", children: [
2446
+ /* @__PURE__ */ n("span", { className: "cms-screen__title-name", children: e }),
2447
+ /* @__PURE__ */ n("span", { className: "cms-screen__title-dot", children: " · " })
2658
2448
  ] }),
2659
- /* @__PURE__ */ e("span", { className: "cms-screen__title-choice", children: oe.label })
2449
+ /* @__PURE__ */ n("span", { className: "cms-screen__title-choice", children: ce.label })
2660
2450
  ] }),
2661
- te && ce ? /* @__PURE__ */ c("span", { className: "cms-screen__ruler", "aria-hidden": "true", children: [
2662
- /* @__PURE__ */ e("span", { "data-ruler": "name", children: n }),
2663
- oe !== null ? /* @__PURE__ */ e("span", { "data-ruler": "choice", children: ye }) : null
2451
+ ne && ie ? /* @__PURE__ */ f("span", { className: "cms-screen__ruler", "aria-hidden": "true", children: [
2452
+ /* @__PURE__ */ n("span", { "data-ruler": "name", children: e }),
2453
+ ce !== null ? /* @__PURE__ */ n("span", { "data-ruler": "choice", children: we }) : null
2664
2454
  ] }) : null,
2665
- /* @__PURE__ */ c("div", { ref: X, className: "cms-screen__trailing", children: [
2666
- r !== void 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": r.label, title: r.label, onClick: r.onOpen, children: /* @__PURE__ */ e(B, { name: "search" }) }) : null,
2667
- ve !== void 0 && !C ? /* @__PURE__ */ e(Tn, { ...ve, iconOnly: !0, onOpenChange: Ce }) : null,
2668
- ce ? /* @__PURE__ */ e(
2455
+ /* @__PURE__ */ f("div", { ref: Y, className: "cms-screen__trailing", children: [
2456
+ s !== void 0 ? /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": s.label, title: s.label, onClick: s.onOpen, children: /* @__PURE__ */ n($, { name: "search" }) }) : null,
2457
+ _e !== void 0 && !E ? /* @__PURE__ */ n(In, { ..._e, iconOnly: !0, onOpenChange: Ce }) : null,
2458
+ ie ? /* @__PURE__ */ n(
2669
2459
  "button",
2670
2460
  {
2671
- ref: ne,
2461
+ ref: ee,
2672
2462
  type: "button",
2673
- className: H("cms-icon-button cms-screen__icon", C && oe !== null && "cms-screen__icon--active"),
2463
+ className: F("cms-icon-button cms-screen__icon", E && ce !== null && "cms-screen__icon--active"),
2674
2464
  "data-action": "more",
2675
2465
  "aria-haspopup": "menu",
2676
- "aria-expanded": _e,
2466
+ "aria-expanded": be,
2677
2467
  "aria-label": L,
2678
2468
  title: L,
2679
2469
  onMouseDown: () => {
2680
- W.current = _e;
2470
+ K.current = be;
2681
2471
  },
2682
2472
  onClick: (R) => {
2683
- const J = R.currentTarget.getBoundingClientRect();
2684
- U(W.current ? null : { x: J.left, y: J.bottom + 4 }), W.current = !1;
2473
+ const X = R.currentTarget.getBoundingClientRect();
2474
+ z(K.current ? null : { x: X.left, y: X.bottom + 4 }), K.current = !1;
2685
2475
  },
2686
- children: /* @__PURE__ */ e(B, { name: "more" })
2476
+ children: /* @__PURE__ */ n($, { name: "more" })
2687
2477
  }
2688
2478
  ) : null,
2689
2479
  d
2690
2480
  ] })
2691
2481
  ] }),
2692
- /* @__PURE__ */ e("div", { ref: N, className: "cms-screen__content", "data-pulling": me > 0 ? "" : void 0, "data-refreshing": I ? "" : void 0, children: /* @__PURE__ */ e(Mn.Provider, { value: ae, children: v }) }),
2693
- u !== void 0 ? /* @__PURE__ */ c(
2482
+ /* @__PURE__ */ n("div", { ref: y, className: "cms-screen__content", "data-pulling": ue > 0 ? "" : void 0, "data-refreshing": I ? "" : void 0, children: /* @__PURE__ */ n(En.Provider, { value: ae, children: N }) }),
2483
+ r !== void 0 ? /* @__PURE__ */ f(
2694
2484
  "button",
2695
2485
  {
2696
2486
  type: "button",
2697
2487
  className: "cms-button cms-button--primary cms-screen__primary",
2698
- "aria-label": u.label,
2699
- ...y === null ? { title: u.label } : {
2488
+ "aria-label": r.label,
2489
+ ...g === null ? { title: r.label } : {
2700
2490
  "aria-disabled": !0,
2701
- "aria-describedby": S,
2702
- ...T ? { "data-reason-shown": "" } : {},
2703
- ...E.dismissed(Pe) ? { "data-tip-dismissed": "" } : {}
2491
+ "aria-describedby": T,
2492
+ ...C ? { "data-reason-shown": "" } : {},
2493
+ ...x.dismissed(ze) ? { "data-tip-dismissed": "" } : {}
2704
2494
  },
2705
- ..."menu" in u ? { "aria-haspopup": "menu", "aria-expanded": z !== null } : {},
2706
- onFocus: () => E.focusIn(Pe),
2495
+ ..."menu" in r ? { "aria-haspopup": "menu", "aria-expanded": P !== null } : {},
2496
+ onFocus: () => x.focusIn(ze),
2707
2497
  onBlur: () => {
2708
- M(!1), E.focusOut(Pe);
2498
+ S(!1), x.focusOut(ze);
2709
2499
  },
2710
- onMouseEnter: () => E.pointerIn(Pe),
2711
- onMouseLeave: () => E.pointerOut(Pe),
2500
+ onMouseEnter: () => x.pointerIn(ze),
2501
+ onMouseLeave: () => x.pointerOut(ze),
2712
2502
  onKeyDown: (R) => {
2713
- R.key === "Escape" && y !== null && (M(!1), E.dismiss(Pe));
2503
+ R.key === "Escape" && g !== null && (S(!1), x.dismiss(ze));
2714
2504
  },
2715
2505
  onClick: (R) => {
2716
- if (y !== null)
2717
- M(!0), E.show(Pe);
2718
- else if ("menu" in u) {
2719
- const J = R.currentTarget.getBoundingClientRect();
2720
- k(z === null ? { x: J.left, y: J.top } : null);
2506
+ if (g !== null)
2507
+ S(!0), x.show(ze);
2508
+ else if ("menu" in r) {
2509
+ const X = R.currentTarget.getBoundingClientRect();
2510
+ k(P === null ? { x: X.left, y: X.top } : null);
2721
2511
  } else
2722
- u.onPress();
2512
+ r.onPress();
2723
2513
  },
2724
2514
  children: [
2725
- /* @__PURE__ */ e(B, { name: u.icon, size: 24 }),
2726
- y !== null ? /* @__PURE__ */ e("span", { className: "cms-screen__tip", role: "tooltip", id: S, children: y }) : null
2515
+ /* @__PURE__ */ n($, { name: r.icon, size: 24 }),
2516
+ g !== null ? /* @__PURE__ */ n("span", { className: "cms-screen__tip", role: "tooltip", id: T, children: g }) : null
2727
2517
  ]
2728
2518
  }
2729
2519
  ) : null,
2730
- /* @__PURE__ */ e(
2520
+ /* @__PURE__ */ n(
2731
2521
  Ke,
2732
2522
  {
2733
- at: _e ? F : null,
2734
- items: C && ve !== void 0 ? [...a, ...En(ve, ve.label)] : a,
2735
- onClose: Y,
2523
+ at: be ? B : null,
2524
+ items: E && _e !== void 0 ? [...i, ...Ln(_e, _e.label)] : i,
2525
+ onClose: j,
2736
2526
  label: h,
2737
2527
  focus: "first"
2738
2528
  }
2739
2529
  ),
2740
- u !== void 0 && "menu" in u ? /* @__PURE__ */ e(Ke, { at: z, items: u.menu, onClose: () => k(null), label: u.label }) : null
2530
+ r !== void 0 && "menu" in r ? /* @__PURE__ */ n(Ke, { at: P, items: r.menu, onClose: () => k(null), label: r.label }) : null
2741
2531
  ]
2742
2532
  }
2743
2533
  );
2744
2534
  }
2745
2535
  export {
2746
- tl as AppShell,
2536
+ cl as AppShell,
2747
2537
  Ye as Avatar,
2748
- pn as BOOTSTRAP_ICONS,
2749
- bt as Badge,
2538
+ vn as BOOTSTRAP_ICONS,
2539
+ Nt as Badge,
2750
2540
  De as Button,
2751
- on as CALL_LABELS,
2752
- At as CLIENT_UPDATE_REQUIRED,
2753
- dl as CallBar,
2754
- ol as CallPanel,
2755
- al as ChatBubble,
2756
- Qt as Column,
2757
- il as Composer,
2758
- Vt as ConfirmDialog,
2541
+ mn as CALL_LABELS,
2542
+ Bt as CLIENT_UPDATE_REQUIRED,
2543
+ bl as CallBar,
2544
+ pl as CallPanel,
2545
+ ml as ChatBubble,
2546
+ al as Column,
2547
+ hl as Composer,
2548
+ Jt as ConfirmDialog,
2759
2549
  Ke as ContextMenu,
2760
- Kn as EmptyState,
2761
- Wn as ErrorBanner,
2762
- yt as FILTER_MENU_LABELS,
2763
- Yt as FilePicker,
2764
- Qn as FilePickerDenied,
2765
- et as FilePickerRestart,
2766
- jt as FileViewer,
2767
- Nt as FilterMenu,
2768
- zt as ICON_NAMES,
2769
- B as Icon,
2770
- cl as IncomingCall,
2771
- Xt as List,
2772
- hl as ListHead,
2773
- Un as Loading,
2774
- vt as MAIL_ROW_LABELS,
2775
- zn as MODAL_CLOSE_MS,
2776
- rl as MailRow,
2777
- xn as Modal,
2778
- Fn as NamedIcon,
2779
- pl as Notification,
2780
- Qe as PULL_AT,
2781
- el as PageHeader,
2782
- fl as PaneToolbar,
2783
- gt as SIGN_IN_LABELS,
2784
- Je as STATE_DELAY_MS,
2785
- Nl as ScreenShell,
2786
- ll as SearchField,
2787
- Jt as SectionHeader,
2788
- Wt as Select,
2789
- ml as SignInForm,
2790
- ul as SignInLayout,
2791
- sl as SplitPanes,
2792
- pt as Splitter,
2550
+ jn as EmptyState,
2551
+ Yn as ErrorBanner,
2552
+ Ct as FILTER_MENU_LABELS,
2553
+ tl as FilePicker,
2554
+ at as FilePickerDenied,
2555
+ rt as FilePickerRestart,
2556
+ nl as FileViewer,
2557
+ Et as FilterMenu,
2558
+ qt as ICON_NAMES,
2559
+ $ as Icon,
2560
+ fl as IncomingCall,
2561
+ ll as List,
2562
+ gl as ListHead,
2563
+ Gn as Loading,
2564
+ xt as MAIL_ROW_LABELS,
2565
+ qn as MODAL_CLOSE_MS,
2566
+ ul as MailRow,
2567
+ Sn as Modal,
2568
+ Cn as NamedIcon,
2569
+ yl as Notification,
2570
+ nn as PULL_AT,
2571
+ rl as PageHeader,
2572
+ wl as PaneToolbar,
2573
+ Mt as SIGN_IN_LABELS,
2574
+ en as STATE_DELAY_MS,
2575
+ El as ScreenShell,
2576
+ ol as SearchField,
2577
+ sl as SectionHeader,
2578
+ Yt as Select,
2579
+ vl as SignInForm,
2580
+ _l as SignInLayout,
2581
+ dl as SplitPanes,
2582
+ yt as Splitter,
2793
2583
  Le as State,
2794
- nl as TabStrip,
2795
- Kt as TextArea,
2796
- Ut as TextField,
2797
- qt as Toast,
2798
- Gt as ToastRegion,
2799
- Zt as Toggle,
2800
- _t as fitPanes,
2801
- Ue as iconForName,
2802
- dt as initialsOf,
2803
- Ct as isCapability,
2804
- wl as needsClientUpdate,
2805
- bl as offerFor,
2806
- yl as readConflict,
2807
- _l as readRefusal,
2808
- Et as refusalText,
2809
- vl as rereadAll,
2810
- ut as tintOf,
2811
- st as usePull,
2812
- rt as usePullState,
2813
- gl as useReread,
2814
- Tt as versionBelow,
2815
- On as writtenOut
2584
+ il as TabStrip,
2585
+ jt as TextArea,
2586
+ Gt as TextField,
2587
+ Qt as Toast,
2588
+ el as ToastRegion,
2589
+ Xt as Toggle,
2590
+ kt as fitPanes,
2591
+ Be as iconForName,
2592
+ bt as initialsOf,
2593
+ Dt as isCapability,
2594
+ Sl as needsClientUpdate,
2595
+ Nl as offerFor,
2596
+ Cl as readConflict,
2597
+ kl as readRefusal,
2598
+ $t as refusalText,
2599
+ xl as rereadAll,
2600
+ _t as tintOf,
2601
+ dt as usePull,
2602
+ ut as usePullState,
2603
+ Ml as useReread,
2604
+ Ft as versionBelow,
2605
+ Zn as writtenOut
2816
2606
  };