@coolms/ui-react 0.1.0-alpha.44 → 0.1.0-alpha.46
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/CHANGELOG.md +17 -0
- package/dist/components/Collections.d.ts +8 -3
- package/dist/index.js +1080 -1075
- package/package.json +1 -1
- package/src/kit.css +15 -5
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { createElement as $n, useId as he, useState as
|
|
1
|
+
import { jsx as n, jsxs as h, Fragment as ge } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as $n, useId as he, useState as I, useRef as z, useEffect as Q, useCallback as Ie, useMemo as Bn, useContext as Fn, createContext as Rn, useLayoutEffect as $e, Fragment as Hn } from "react";
|
|
3
3
|
import { createPortal as an } from "react-dom";
|
|
4
4
|
function qe(e, t) {
|
|
5
5
|
const l = { ...e };
|
|
@@ -9,7 +9,7 @@ function qe(e, t) {
|
|
|
9
9
|
}
|
|
10
10
|
return l;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function H(...e) {
|
|
13
13
|
return e.filter(Boolean).join(" ");
|
|
14
14
|
}
|
|
15
15
|
function se({ name: e }) {
|
|
@@ -37,28 +37,28 @@ function De({
|
|
|
37
37
|
busyLabel: l,
|
|
38
38
|
locked: s = !1,
|
|
39
39
|
lockedReason: a,
|
|
40
|
-
icon:
|
|
41
|
-
disabled:
|
|
42
|
-
className:
|
|
43
|
-
children:
|
|
40
|
+
icon: r,
|
|
41
|
+
disabled: m,
|
|
42
|
+
className: c,
|
|
43
|
+
children: d,
|
|
44
44
|
type: b = "button",
|
|
45
|
-
title:
|
|
46
|
-
...
|
|
45
|
+
title: i,
|
|
46
|
+
...g
|
|
47
47
|
}) {
|
|
48
|
-
const
|
|
49
|
-
return /* @__PURE__ */
|
|
48
|
+
const u = !!m || t;
|
|
49
|
+
return /* @__PURE__ */ h(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
|
-
...
|
|
52
|
+
...g,
|
|
53
53
|
type: b,
|
|
54
|
-
className:
|
|
55
|
-
disabled:
|
|
54
|
+
className: H("cms-button", `cms-button--${e}`, t && "is-busy", s && "is-locked", c),
|
|
55
|
+
disabled: u,
|
|
56
56
|
"aria-busy": t || void 0,
|
|
57
|
-
title: s ? a ??
|
|
57
|
+
title: s ? a ?? i : i,
|
|
58
58
|
children: [
|
|
59
|
-
t ? /* @__PURE__ */ n(se, { name: "spinner" }) : s ? /* @__PURE__ */ n(se, { name: "lock" }) :
|
|
60
|
-
/* @__PURE__ */ n("span", { className: "cms-button__label", children: t && l !== void 0 ? l :
|
|
61
|
-
s && a ? /* @__PURE__ */
|
|
59
|
+
t ? /* @__PURE__ */ n(se, { name: "spinner" }) : s ? /* @__PURE__ */ n(se, { name: "lock" }) : r,
|
|
60
|
+
/* @__PURE__ */ n("span", { className: "cms-button__label", children: t && l !== void 0 ? l : d }),
|
|
61
|
+
s && a ? /* @__PURE__ */ h("span", { className: "cms-visually-hidden", children: [
|
|
62
62
|
", ",
|
|
63
63
|
a
|
|
64
64
|
] }) : null
|
|
@@ -86,7 +86,7 @@ function $({ name: e, size: t = 20, label: l }) {
|
|
|
86
86
|
strokeLinejoin: Xe.linejoin,
|
|
87
87
|
focusable: !1,
|
|
88
88
|
...l ? { role: "img", "aria-label": l } : { "aria-hidden": !0 },
|
|
89
|
-
children: Qe[e].parts.map(({ tag: s, ...a },
|
|
89
|
+
children: Qe[e].parts.map(({ tag: s, ...a }, r) => $n(s, { key: r, ...a }))
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
}
|
|
@@ -107,11 +107,11 @@ function Cn({ name: e, size: t = 18 }) {
|
|
|
107
107
|
const l = Be(e);
|
|
108
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
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return /* @__PURE__ */
|
|
110
|
+
function on({ id: e, label: t, help: l, error: s, pinned: a, children: r }) {
|
|
111
|
+
return /* @__PURE__ */ h("div", { className: H("cms-field", s != null && "is-invalid"), children: [
|
|
112
112
|
/* @__PURE__ */ n("label", { className: "cms-field__label", htmlFor: e, children: t }),
|
|
113
|
-
|
|
114
|
-
a != null ? /* @__PURE__ */
|
|
113
|
+
r,
|
|
114
|
+
a != null ? /* @__PURE__ */ h("p", { className: "cms-field__pinned", id: `${e}-pinned`, children: [
|
|
115
115
|
/* @__PURE__ */ n(se, { name: "lock" }),
|
|
116
116
|
" ",
|
|
117
117
|
a
|
|
@@ -120,32 +120,32 @@ function cn({ id: e, label: t, help: l, error: s, pinned: a, children: i }) {
|
|
|
120
120
|
l != null ? /* @__PURE__ */ n("p", { className: "cms-field__help", id: `${e}-help`, children: l }) : null
|
|
121
121
|
] });
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function cn(e, t) {
|
|
124
124
|
const l = [t.error != null && `${e}-error`, t.pinned != null && `${e}-pinned`, t.help != null && `${e}-help`].filter(Boolean).join(" ");
|
|
125
125
|
return l === "" ? void 0 : l;
|
|
126
126
|
}
|
|
127
127
|
const Kn = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Wn = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
|
|
128
128
|
function Zn(e, t, l) {
|
|
129
|
-
const s = (
|
|
130
|
-
const
|
|
131
|
-
return
|
|
132
|
-
}, a = (
|
|
129
|
+
const s = (r, m, c, d = 0, b = 0, i = 0) => {
|
|
130
|
+
const g = new Date(Date.UTC(r, m - 1, c, d, b, i));
|
|
131
|
+
return g.setUTCFullYear(r), g.getUTCFullYear() === r && g.getUTCMonth() === m - 1 && g.getUTCDate() === c && g.getUTCHours() === d && g.getUTCMinutes() === b && g.getUTCSeconds() === i ? g : null;
|
|
132
|
+
}, a = (r) => ({ hour: Number(r[1]), minute: Number(r[2]), second: Number(r[3] ?? 0) });
|
|
133
133
|
try {
|
|
134
134
|
if (e === "time") {
|
|
135
|
-
const
|
|
136
|
-
if (
|
|
137
|
-
const
|
|
138
|
-
return
|
|
135
|
+
const m = t.match(Wn);
|
|
136
|
+
if (m === null) return t;
|
|
137
|
+
const c = a(m), d = s(2e3, 1, 1, c.hour, c.minute, c.second);
|
|
138
|
+
return d === null ? t : new Intl.DateTimeFormat(l, { timeStyle: m[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(d);
|
|
139
139
|
}
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
142
|
-
if (e === "date" &&
|
|
143
|
-
const
|
|
144
|
-
return
|
|
140
|
+
const r = t.match(Kn);
|
|
141
|
+
if (r === null) return t;
|
|
142
|
+
if (e === "date" && r[4] === void 0) {
|
|
143
|
+
const m = s(Number(r[1]), Number(r[2]), Number(r[3]));
|
|
144
|
+
return m === null ? t : new Intl.DateTimeFormat(l, { dateStyle: "medium", timeZone: "UTC" }).format(m);
|
|
145
145
|
}
|
|
146
|
-
if (e === "datetime-local" &&
|
|
147
|
-
const
|
|
148
|
-
return
|
|
146
|
+
if (e === "datetime-local" && r[4] !== void 0) {
|
|
147
|
+
const m = s(Number(r[1]), Number(r[2]), Number(r[3]), Number(r[4]), Number(r[5]), Number(r[6] ?? 0));
|
|
148
|
+
return m === null ? t : new Intl.DateTimeFormat(l, { dateStyle: "medium", timeStyle: r[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(m);
|
|
149
149
|
}
|
|
150
150
|
} catch {
|
|
151
151
|
return t;
|
|
@@ -153,108 +153,108 @@ function Zn(e, t, l) {
|
|
|
153
153
|
return t;
|
|
154
154
|
}
|
|
155
155
|
const Vn = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
|
|
156
|
-
function Gt({ label: e, help: t, error: l, disabled: s, readOnly: a, pinned:
|
|
157
|
-
const
|
|
156
|
+
function Gt({ label: e, help: t, error: l, disabled: s, readOnly: a, pinned: r, value: m, onChange: c, placeholder: d, type: b = "text", name: i, locale: g, min: u, max: k, step: f, minLength: x, maxLength: L, required: S, autoComplete: _, reveal: N }) {
|
|
157
|
+
const v = he(), [w, T] = I(!1), B = a === !0 || r != null, F = B && Vn.has(b), M = b === "number" && (f === "any" || typeof f == "number" && !Number.isInteger(f)), R = b === "password" && N !== void 0 && !B, U = /* @__PURE__ */ n(
|
|
158
158
|
"input",
|
|
159
159
|
{
|
|
160
|
-
id:
|
|
161
|
-
name:
|
|
162
|
-
type:
|
|
163
|
-
autoComplete:
|
|
160
|
+
id: v,
|
|
161
|
+
name: i,
|
|
162
|
+
type: F || R && w ? "text" : b,
|
|
163
|
+
autoComplete: _,
|
|
164
164
|
className: "cms-input",
|
|
165
|
-
value:
|
|
166
|
-
...
|
|
167
|
-
lang:
|
|
168
|
-
placeholder:
|
|
165
|
+
value: F ? Zn(b, m, g) : m,
|
|
166
|
+
...F ? { "data-value": m } : {},
|
|
167
|
+
lang: g,
|
|
168
|
+
placeholder: d,
|
|
169
169
|
disabled: s,
|
|
170
|
-
readOnly:
|
|
171
|
-
required:
|
|
172
|
-
"aria-required":
|
|
173
|
-
min:
|
|
174
|
-
max:
|
|
175
|
-
step:
|
|
176
|
-
minLength:
|
|
177
|
-
maxLength:
|
|
178
|
-
inputMode: b === "number" ?
|
|
170
|
+
readOnly: B,
|
|
171
|
+
required: S,
|
|
172
|
+
"aria-required": S || void 0,
|
|
173
|
+
min: F ? void 0 : u,
|
|
174
|
+
max: F ? void 0 : k,
|
|
175
|
+
step: F ? void 0 : f,
|
|
176
|
+
minLength: x,
|
|
177
|
+
maxLength: L,
|
|
178
|
+
inputMode: b === "number" ? M ? "decimal" : "numeric" : void 0,
|
|
179
179
|
"aria-invalid": l != null || void 0,
|
|
180
|
-
"aria-describedby":
|
|
181
|
-
onChange: (j) =>
|
|
180
|
+
"aria-describedby": cn(v, { help: t, error: l, pinned: r }),
|
|
181
|
+
onChange: (j) => c == null ? void 0 : c(j.target.value)
|
|
182
182
|
}
|
|
183
183
|
);
|
|
184
|
-
return /* @__PURE__ */ n(
|
|
185
|
-
|
|
184
|
+
return /* @__PURE__ */ n(on, { id: v, label: e, help: t, error: l, pinned: r, children: R ? /* @__PURE__ */ h("span", { className: "cms-input-reveal", children: [
|
|
185
|
+
U,
|
|
186
186
|
/* @__PURE__ */ n(
|
|
187
187
|
"button",
|
|
188
188
|
{
|
|
189
189
|
type: "button",
|
|
190
190
|
className: "cms-input-reveal__button",
|
|
191
|
-
"aria-controls":
|
|
192
|
-
"aria-label":
|
|
193
|
-
title:
|
|
191
|
+
"aria-controls": v,
|
|
192
|
+
"aria-label": w ? N.hide : N.show,
|
|
193
|
+
title: w ? N.hide : N.show,
|
|
194
194
|
disabled: s,
|
|
195
|
-
onClick: () =>
|
|
196
|
-
children: /* @__PURE__ */ n($, { name:
|
|
195
|
+
onClick: () => T((j) => !j),
|
|
196
|
+
children: /* @__PURE__ */ n($, { name: w ? "eye-off" : "eye", size: 18 })
|
|
197
197
|
}
|
|
198
198
|
)
|
|
199
|
-
] }) :
|
|
199
|
+
] }) : U });
|
|
200
200
|
}
|
|
201
|
-
function jt({ label: e, help: t, error: l, disabled: s, readOnly: a, pinned:
|
|
202
|
-
const
|
|
203
|
-
return /* @__PURE__ */ n(
|
|
201
|
+
function jt({ label: e, help: t, error: l, disabled: s, readOnly: a, pinned: r, value: m, onChange: c, placeholder: d, rows: b = 4, name: i, locale: g, minLength: u, maxLength: k, required: f }) {
|
|
202
|
+
const x = he();
|
|
203
|
+
return /* @__PURE__ */ n(on, { id: x, label: e, help: t, error: l, pinned: r, children: /* @__PURE__ */ n(
|
|
204
204
|
"textarea",
|
|
205
205
|
{
|
|
206
|
-
id:
|
|
207
|
-
name:
|
|
206
|
+
id: x,
|
|
207
|
+
name: i,
|
|
208
208
|
className: "cms-input cms-textarea",
|
|
209
209
|
rows: b,
|
|
210
|
-
value:
|
|
211
|
-
lang:
|
|
212
|
-
placeholder:
|
|
210
|
+
value: m,
|
|
211
|
+
lang: g,
|
|
212
|
+
placeholder: d,
|
|
213
213
|
disabled: s,
|
|
214
|
-
readOnly: a === !0 ||
|
|
215
|
-
required:
|
|
216
|
-
"aria-required":
|
|
217
|
-
minLength:
|
|
218
|
-
maxLength:
|
|
214
|
+
readOnly: a === !0 || r != null,
|
|
215
|
+
required: f,
|
|
216
|
+
"aria-required": f || void 0,
|
|
217
|
+
minLength: u,
|
|
218
|
+
maxLength: k,
|
|
219
219
|
"aria-invalid": l != null || void 0,
|
|
220
|
-
"aria-describedby":
|
|
221
|
-
onChange: (
|
|
220
|
+
"aria-describedby": cn(x, { help: t, error: l, pinned: r }),
|
|
221
|
+
onChange: (L) => c == null ? void 0 : c(L.target.value)
|
|
222
222
|
}
|
|
223
223
|
) });
|
|
224
224
|
}
|
|
225
|
-
function Yt({ label: e, help: t, error: l, disabled: s, readOnly: a, value:
|
|
226
|
-
const
|
|
227
|
-
return /* @__PURE__ */ n(
|
|
225
|
+
function Yt({ label: e, help: t, error: l, disabled: s, readOnly: a, value: r, options: m, onChange: c, emptyText: d = "Nothing to choose from yet.", name: b }) {
|
|
226
|
+
const i = he(), g = m.length === 0;
|
|
227
|
+
return /* @__PURE__ */ n(on, { id: i, label: e, help: g ? d : t, error: l, children: /* @__PURE__ */ n(
|
|
228
228
|
"select",
|
|
229
229
|
{
|
|
230
|
-
id:
|
|
230
|
+
id: i,
|
|
231
231
|
name: b,
|
|
232
232
|
className: "cms-input cms-select",
|
|
233
|
-
value:
|
|
234
|
-
disabled: s ||
|
|
233
|
+
value: r,
|
|
234
|
+
disabled: s || g,
|
|
235
235
|
"aria-readonly": a || void 0,
|
|
236
236
|
"aria-invalid": l != null || void 0,
|
|
237
|
-
"aria-describedby":
|
|
238
|
-
onChange: (
|
|
239
|
-
a ||
|
|
237
|
+
"aria-describedby": cn(i, { help: g ? d : t, error: l }),
|
|
238
|
+
onChange: (u) => {
|
|
239
|
+
a || c == null || c(u.target.value);
|
|
240
240
|
},
|
|
241
|
-
children:
|
|
241
|
+
children: m.map((u) => /* @__PURE__ */ n("option", { value: u.value, disabled: a && u.value !== r, children: u.label }, u.value))
|
|
242
242
|
}
|
|
243
243
|
) });
|
|
244
244
|
}
|
|
245
|
-
function Xt({ label: e, checked: t, onChange: l, disabled: s, readOnly: a, help:
|
|
246
|
-
const
|
|
247
|
-
return /* @__PURE__ */
|
|
245
|
+
function Xt({ label: e, checked: t, onChange: l, disabled: s, readOnly: a, help: r }) {
|
|
246
|
+
const m = he();
|
|
247
|
+
return /* @__PURE__ */ h("div", { className: "cms-toggle-row", children: [
|
|
248
248
|
/* @__PURE__ */ n(
|
|
249
249
|
"button",
|
|
250
250
|
{
|
|
251
|
-
id:
|
|
251
|
+
id: m,
|
|
252
252
|
type: "button",
|
|
253
253
|
role: "switch",
|
|
254
|
-
className:
|
|
254
|
+
className: H("cms-toggle", t && "is-on"),
|
|
255
255
|
"aria-checked": t,
|
|
256
256
|
"aria-readonly": a || void 0,
|
|
257
|
-
"aria-describedby":
|
|
257
|
+
"aria-describedby": r != null ? `${m}-help` : void 0,
|
|
258
258
|
disabled: s,
|
|
259
259
|
onClick: () => {
|
|
260
260
|
a || l == null || l(!t);
|
|
@@ -262,85 +262,85 @@ function Xt({ label: e, checked: t, onChange: l, disabled: s, readOnly: a, help:
|
|
|
262
262
|
children: /* @__PURE__ */ n("span", { className: "cms-toggle__thumb" })
|
|
263
263
|
}
|
|
264
264
|
),
|
|
265
|
-
/* @__PURE__ */ n("label", { className: "cms-toggle__label", htmlFor:
|
|
266
|
-
|
|
265
|
+
/* @__PURE__ */ n("label", { className: "cms-toggle__label", htmlFor: m, children: e }),
|
|
266
|
+
r != null ? /* @__PURE__ */ n("p", { className: "cms-field__help", id: `${m}-help`, children: r }) : null
|
|
267
267
|
] });
|
|
268
268
|
}
|
|
269
269
|
const qn = 150;
|
|
270
|
-
function Sn({ open: e, title: t, onClose: l, dirty: s = !1, onDirtyClose: a, children:
|
|
271
|
-
const [
|
|
270
|
+
function Sn({ open: e, title: t, onClose: l, dirty: s = !1, onDirtyClose: a, children: r, footer: m, closeLabel: c = "Close", initialFocus: d, className: b }) {
|
|
271
|
+
const [i, g] = I(e), [u, k] = I(!1), f = z(null), x = z(null), L = he();
|
|
272
272
|
if (Q(() => {
|
|
273
273
|
if (e) {
|
|
274
|
-
|
|
274
|
+
x.current = document.activeElement, g(!0), k(!1);
|
|
275
275
|
return;
|
|
276
276
|
}
|
|
277
|
-
if (!
|
|
278
|
-
|
|
279
|
-
const
|
|
280
|
-
var
|
|
281
|
-
|
|
277
|
+
if (!i) return;
|
|
278
|
+
k(!0);
|
|
279
|
+
const _ = window.setTimeout(() => {
|
|
280
|
+
var N, v;
|
|
281
|
+
g(!1), k(!1), (v = (N = x.current) == null ? void 0 : N.focus) == null || v.call(N);
|
|
282
282
|
}, qn);
|
|
283
|
-
return () => window.clearTimeout(
|
|
284
|
-
}, [e,
|
|
285
|
-
var
|
|
286
|
-
if (e &&
|
|
287
|
-
const
|
|
288
|
-
(
|
|
283
|
+
return () => window.clearTimeout(_);
|
|
284
|
+
}, [e, i]), Q(() => {
|
|
285
|
+
var _, N;
|
|
286
|
+
if (e && i) {
|
|
287
|
+
const v = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
|
|
288
|
+
(N = (d == null ? void 0 : d.current) ?? ((_ = f.current) == null ? void 0 : _.querySelector(`.cms-modal__body :is(${v}), .cms-modal__foot :is(${v})`)) ?? f.current) == null || N.focus();
|
|
289
289
|
}
|
|
290
|
-
}, [e,
|
|
291
|
-
const
|
|
290
|
+
}, [e, i, d]), !i) return null;
|
|
291
|
+
const S = () => {
|
|
292
292
|
s ? a == null || a() : l();
|
|
293
293
|
};
|
|
294
294
|
return an(
|
|
295
|
-
/* @__PURE__ */ n("div", { className:
|
|
296
|
-
|
|
297
|
-
}, children: /* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ n("div", { className: H("cms-modal-scrim", u && "is-closing"), onMouseDown: (_) => {
|
|
296
|
+
_.target === _.currentTarget && S();
|
|
297
|
+
}, children: /* @__PURE__ */ h(
|
|
298
298
|
"div",
|
|
299
299
|
{
|
|
300
|
-
ref:
|
|
301
|
-
className:
|
|
300
|
+
ref: f,
|
|
301
|
+
className: H("cms-modal", b, u && "is-closing", s && "is-dirty"),
|
|
302
302
|
role: "dialog",
|
|
303
303
|
"aria-modal": "true",
|
|
304
|
-
"aria-labelledby":
|
|
304
|
+
"aria-labelledby": L,
|
|
305
305
|
tabIndex: -1,
|
|
306
|
-
onKeyDown: (
|
|
307
|
-
var
|
|
308
|
-
if (
|
|
309
|
-
|
|
310
|
-
else if (
|
|
311
|
-
const
|
|
312
|
-
if (!
|
|
313
|
-
const
|
|
314
|
-
|
|
306
|
+
onKeyDown: (_) => {
|
|
307
|
+
var N;
|
|
308
|
+
if (_.key === "Escape")
|
|
309
|
+
_.stopPropagation(), S();
|
|
310
|
+
else if (_.key === "Tab") {
|
|
311
|
+
const v = (N = f.current) == null ? void 0 : N.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
|
|
312
|
+
if (!v || v.length === 0) return;
|
|
313
|
+
const w = v[0], T = v[v.length - 1];
|
|
314
|
+
_.shiftKey && document.activeElement === w ? (_.preventDefault(), T.focus()) : !_.shiftKey && document.activeElement === T && (_.preventDefault(), w.focus());
|
|
315
315
|
}
|
|
316
316
|
},
|
|
317
317
|
children: [
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */ n("h2", { className: "cms-modal__title", id:
|
|
320
|
-
/* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
318
|
+
/* @__PURE__ */ h("header", { className: "cms-modal__head", children: [
|
|
319
|
+
/* @__PURE__ */ n("h2", { className: "cms-modal__title", id: L, children: t }),
|
|
320
|
+
/* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": c, onClick: S, children: /* @__PURE__ */ n(se, { name: "close" }) })
|
|
321
321
|
] }),
|
|
322
|
-
/* @__PURE__ */ n("div", { className: "cms-modal__body", children:
|
|
323
|
-
|
|
322
|
+
/* @__PURE__ */ n("div", { className: "cms-modal__body", children: r }),
|
|
323
|
+
m != null ? /* @__PURE__ */ n("footer", { className: "cms-modal__foot", children: m }) : null
|
|
324
324
|
]
|
|
325
325
|
}
|
|
326
326
|
) }),
|
|
327
327
|
document.body
|
|
328
328
|
);
|
|
329
329
|
}
|
|
330
|
-
function Jt({ open: e, title: t, message: l, kind: s = "default", confirmLabel: a, cancelLabel:
|
|
330
|
+
function Jt({ open: e, title: t, message: l, kind: s = "default", confirmLabel: a, cancelLabel: r, closeLabel: m, onConfirm: c, onCancel: d }) {
|
|
331
331
|
const b = s === "discard-changes";
|
|
332
332
|
return /* @__PURE__ */ n(
|
|
333
333
|
Sn,
|
|
334
334
|
{
|
|
335
335
|
open: e,
|
|
336
336
|
title: t,
|
|
337
|
-
onClose:
|
|
338
|
-
...
|
|
339
|
-
footer: /* @__PURE__ */
|
|
340
|
-
/* @__PURE__ */ n(De, { onClick:
|
|
341
|
-
/* @__PURE__ */ n(De, { variant: s === "default" ? "primary" : "danger", onClick:
|
|
337
|
+
onClose: d,
|
|
338
|
+
...m === void 0 ? {} : { closeLabel: m },
|
|
339
|
+
footer: /* @__PURE__ */ h(ge, { children: [
|
|
340
|
+
/* @__PURE__ */ n(De, { onClick: d, children: r ?? (b ? "Keep editing" : "Cancel") }),
|
|
341
|
+
/* @__PURE__ */ n(De, { variant: s === "default" ? "primary" : "danger", onClick: c, children: a ?? (b ? "Discard changes" : "Confirm") })
|
|
342
342
|
] }),
|
|
343
|
-
children: s !== "default" ? /* @__PURE__ */
|
|
343
|
+
children: s !== "default" ? /* @__PURE__ */ h("p", { className: "cms-confirm__warning", children: [
|
|
344
344
|
/* @__PURE__ */ n(se, { name: "warning" }),
|
|
345
345
|
" ",
|
|
346
346
|
l
|
|
@@ -349,7 +349,7 @@ function Jt({ open: e, title: t, message: l, kind: s = "default", confirmLabel:
|
|
|
349
349
|
);
|
|
350
350
|
}
|
|
351
351
|
function Qt({ kind: e, message: t, action: l, onDismiss: s, dismissLabel: a = "Dismiss" }) {
|
|
352
|
-
return /* @__PURE__ */
|
|
352
|
+
return /* @__PURE__ */ h("div", { className: H("cms-toast", `cms-toast--${e}`), role: e === "error" ? "alert" : "status", children: [
|
|
353
353
|
/* @__PURE__ */ n(se, { name: e === "success" ? "check" : e === "error" ? "warning" : "info" }),
|
|
354
354
|
/* @__PURE__ */ n("span", { className: "cms-toast__message", children: t }),
|
|
355
355
|
l ? /* @__PURE__ */ n(De, { className: "cms-toast__action", onClick: l.onAction, children: l.label }) : null,
|
|
@@ -360,15 +360,15 @@ function el({ children: e }) {
|
|
|
360
360
|
return /* @__PURE__ */ n("div", { className: "cms-toast-region", children: e });
|
|
361
361
|
}
|
|
362
362
|
function Gn({ what: e, layout: t = "inline" }) {
|
|
363
|
-
return /* @__PURE__ */
|
|
363
|
+
return /* @__PURE__ */ h("div", { className: H("cms-loading", `cms-loading--${t}`), role: "status", "aria-live": "polite", children: [
|
|
364
364
|
/* @__PURE__ */ n(se, { name: "spinner" }),
|
|
365
365
|
/* @__PURE__ */ n("span", { children: e })
|
|
366
366
|
] });
|
|
367
367
|
}
|
|
368
368
|
function jn({ title: e, hint: t, action: l, icon: s }) {
|
|
369
|
-
return /* @__PURE__ */
|
|
369
|
+
return /* @__PURE__ */ h("div", { className: "cms-state cms-state--empty cms-state--page", role: "status", "aria-live": "polite", "data-kind": "empty", children: [
|
|
370
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__ */
|
|
371
|
+
/* @__PURE__ */ h("span", { className: "cms-state__text", children: [
|
|
372
372
|
/* @__PURE__ */ n("span", { className: "cms-state__title", children: e }),
|
|
373
373
|
t != null ? /* @__PURE__ */ n("span", { className: "cms-state__description", children: t }) : null
|
|
374
374
|
] }),
|
|
@@ -376,7 +376,7 @@ function jn({ title: e, hint: t, action: l, icon: s }) {
|
|
|
376
376
|
] });
|
|
377
377
|
}
|
|
378
378
|
function Yn({ message: e, onRetry: t, retryLabel: l = "Try again" }) {
|
|
379
|
-
return /* @__PURE__ */
|
|
379
|
+
return /* @__PURE__ */ h("div", { className: "cms-error-banner", role: "alert", children: [
|
|
380
380
|
/* @__PURE__ */ n(se, { name: "warning" }),
|
|
381
381
|
/* @__PURE__ */ n("span", { className: "cms-error-banner__message", children: e }),
|
|
382
382
|
t ? /* @__PURE__ */ n(De, { onClick: t, children: l }) : null
|
|
@@ -389,39 +389,39 @@ function Xn() {
|
|
|
389
389
|
return Number.isFinite(t) && t >= 0 ? t : en;
|
|
390
390
|
}
|
|
391
391
|
function Jn() {
|
|
392
|
-
return /* @__PURE__ */
|
|
392
|
+
return /* @__PURE__ */ h("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
|
|
393
393
|
/* @__PURE__ */ n("circle", { className: "cms-state__track", cx: "12", cy: "12", r: "10", fill: "none" }),
|
|
394
394
|
/* @__PURE__ */ n("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
|
|
395
395
|
] });
|
|
396
396
|
}
|
|
397
|
-
function Le({ kind: e, title: t, description: l, action: s, placement: a = "page", icon:
|
|
398
|
-
const [
|
|
397
|
+
function Le({ kind: e, title: t, description: l, action: s, placement: a = "page", icon: r }) {
|
|
398
|
+
const [m, c] = I(e !== "loading");
|
|
399
399
|
Q(() => {
|
|
400
400
|
if (e !== "loading") {
|
|
401
|
-
|
|
401
|
+
c(!0);
|
|
402
402
|
return;
|
|
403
403
|
}
|
|
404
|
-
|
|
405
|
-
const b = window.setTimeout(() =>
|
|
404
|
+
c(!1);
|
|
405
|
+
const b = window.setTimeout(() => c(!0), Xn());
|
|
406
406
|
return () => window.clearTimeout(b);
|
|
407
407
|
}, [e]);
|
|
408
|
-
const
|
|
409
|
-
return /* @__PURE__ */
|
|
408
|
+
const d = a === "block";
|
|
409
|
+
return /* @__PURE__ */ h(
|
|
410
410
|
"div",
|
|
411
411
|
{
|
|
412
|
-
className:
|
|
412
|
+
className: H("cms-state", `cms-state--${e}`, `cms-state--${a}`, !m && "is-waiting"),
|
|
413
413
|
role: "status",
|
|
414
414
|
"aria-live": "polite",
|
|
415
415
|
"data-kind": e,
|
|
416
416
|
children: [
|
|
417
417
|
e === "loading" ? /* @__PURE__ */ n(Jn, {}) : null,
|
|
418
|
-
(e === "error" || e === "denied") && !
|
|
419
|
-
e === "empty" && !
|
|
420
|
-
/* @__PURE__ */
|
|
418
|
+
(e === "error" || e === "denied") && !d ? /* @__PURE__ */ n(se, { name: e === "error" ? "warning" : "lock" }) : null,
|
|
419
|
+
e === "empty" && !d && r !== void 0 && Be(r) !== null ? /* @__PURE__ */ n("span", { className: "cms-state__icon", "aria-hidden": "true", children: /* @__PURE__ */ n(Cn, { name: r, size: a === "page" ? 32 : 24 }) }) : null,
|
|
420
|
+
/* @__PURE__ */ h("span", { className: "cms-state__text", children: [
|
|
421
421
|
/* @__PURE__ */ n("span", { className: "cms-state__title", children: t }),
|
|
422
|
-
l !== void 0 && !
|
|
422
|
+
l !== void 0 && !d ? /* @__PURE__ */ n("span", { className: "cms-state__description", children: l }) : null
|
|
423
423
|
] }),
|
|
424
|
-
s !== void 0 && e !== "denied" ? /* @__PURE__ */ n(De, { className: "cms-state__action", variant:
|
|
424
|
+
s !== void 0 && e !== "denied" ? /* @__PURE__ */ n(De, { className: "cms-state__action", variant: d ? "quiet" : "secondary", onClick: s.onAction, children: s.label }) : null
|
|
425
425
|
]
|
|
426
426
|
}
|
|
427
427
|
);
|
|
@@ -437,105 +437,105 @@ function lt(e) {
|
|
|
437
437
|
return e.getClientRects().length > 0;
|
|
438
438
|
}
|
|
439
439
|
function nl(e) {
|
|
440
|
-
const { name: t, badge: l, closeLabel: s, onClose: a, actions:
|
|
440
|
+
const { name: t, badge: l, closeLabel: s, onClose: a, actions: r = [], moreLabel: m = "More", edit: c, editing: d, state: b, siblings: i, bar: g, thumbnails: u, strip: k, onZoom: f, children: x } = e, L = z(null), S = z(null), _ = he(), [N, v] = I(!1), w = z(null);
|
|
441
441
|
Q(() => {
|
|
442
|
-
var
|
|
443
|
-
const
|
|
444
|
-
return document.body.style.overflow = "hidden", (
|
|
442
|
+
var U;
|
|
443
|
+
const M = document.activeElement, R = document.body.style.overflow;
|
|
444
|
+
return document.body.style.overflow = "hidden", (U = S.current) == null || U.focus(), () => {
|
|
445
445
|
var j;
|
|
446
|
-
document.body.style.overflow =
|
|
446
|
+
document.body.style.overflow = R, (j = M == null ? void 0 : M.focus) == null || j.call(M);
|
|
447
447
|
};
|
|
448
448
|
}, []);
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
},
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
},
|
|
449
|
+
const T = () => {
|
|
450
|
+
d != null && d.dirty ? d.onDirtyClose() : a();
|
|
451
|
+
}, B = (M) => {
|
|
452
|
+
const R = M.touches.length === 1 ? M.touches[0] : void 0;
|
|
453
|
+
w.current = R === void 0 || d !== void 0 || tt(M.target) ? null : { x: R.clientX, y: R.clientY };
|
|
454
|
+
}, F = (M) => {
|
|
455
455
|
var K, G;
|
|
456
|
-
const
|
|
457
|
-
if (
|
|
458
|
-
const j =
|
|
459
|
-
Math.abs(j) < et || Math.abs(j) < Math.abs(
|
|
456
|
+
const R = w.current, U = M.changedTouches[0];
|
|
457
|
+
if (w.current = null, R === null || U === void 0) return;
|
|
458
|
+
const j = U.clientX - R.x;
|
|
459
|
+
Math.abs(j) < et || Math.abs(j) < Math.abs(U.clientY - R.y) || (j > 0 ? (K = i == null ? void 0 : i.onPrevious) == null || K.call(i) : (G = i == null ? void 0 : i.onNext) == null || G.call(i));
|
|
460
460
|
};
|
|
461
461
|
return an(
|
|
462
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ h(
|
|
463
463
|
"div",
|
|
464
464
|
{
|
|
465
|
-
ref:
|
|
466
|
-
className:
|
|
465
|
+
ref: L,
|
|
466
|
+
className: H("cms-viewer", d !== void 0 && "is-editing"),
|
|
467
467
|
role: "dialog",
|
|
468
468
|
"aria-modal": "true",
|
|
469
|
-
"aria-labelledby":
|
|
469
|
+
"aria-labelledby": _,
|
|
470
470
|
tabIndex: -1,
|
|
471
|
-
onKeyDown: (
|
|
472
|
-
var
|
|
473
|
-
if (
|
|
474
|
-
if (
|
|
475
|
-
|
|
476
|
-
} else if (
|
|
477
|
-
const K = Array.from(((
|
|
471
|
+
onKeyDown: (M) => {
|
|
472
|
+
var R, U, j;
|
|
473
|
+
if (M.key === "Escape") {
|
|
474
|
+
if (d !== void 0) return;
|
|
475
|
+
M.stopPropagation(), N ? v(!1) : a();
|
|
476
|
+
} else if (M.key === "Tab") {
|
|
477
|
+
const K = Array.from(((R = L.current) == null ? void 0 : R.querySelectorAll(Qn)) ?? []).filter(lt);
|
|
478
478
|
if (K.length === 0) return;
|
|
479
479
|
const G = K[0], Y = K[K.length - 1];
|
|
480
|
-
|
|
481
|
-
} else
|
|
480
|
+
M.shiftKey && document.activeElement === G ? (M.preventDefault(), Y.focus()) : !M.shiftKey && document.activeElement === Y && (M.preventDefault(), G.focus());
|
|
481
|
+
} else d === void 0 && !nt(M.target) && !M.ctrlKey && !M.metaKey && !M.altKey && (M.key === "ArrowLeft" ? (U = i == null ? void 0 : i.onPrevious) == null || U.call(i) : M.key === "ArrowRight" ? (j = i == null ? void 0 : i.onNext) == null || j.call(i) : M.key === "+" || M.key === "=" ? f == null || f("in") : M.key === "-" ? f == null || f("out") : M.key === "0" && (f == null || f("reset")));
|
|
482
482
|
},
|
|
483
483
|
children: [
|
|
484
|
-
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
/* @__PURE__ */ n("button", { ref:
|
|
484
|
+
i !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-visually-hidden", role: "status", children: `${t}, ${i.position}` }) : null,
|
|
485
|
+
/* @__PURE__ */ h("header", { className: "cms-viewer__top", children: [
|
|
486
|
+
/* @__PURE__ */ n("button", { ref: S, type: "button", className: "cms-viewer__icon", "aria-label": s, onClick: T, children: /* @__PURE__ */ n(se, { name: "close" }) }),
|
|
487
487
|
/* @__PURE__ */ n("span", { className: "cms-viewer__badge", children: l }),
|
|
488
|
-
/* @__PURE__ */ n("h2", { className: "cms-viewer__name", id:
|
|
489
|
-
|
|
488
|
+
/* @__PURE__ */ n("h2", { className: "cms-viewer__name", id: _, title: t, children: t }),
|
|
489
|
+
i !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-viewer__position", children: i.position }) : null,
|
|
490
490
|
/* @__PURE__ */ n("span", { className: "cms-viewer__space" }),
|
|
491
|
-
|
|
492
|
-
/* @__PURE__ */ n("span", { className: "cms-viewer__status", role: "status", children:
|
|
493
|
-
/* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick:
|
|
494
|
-
] }) : /* @__PURE__ */
|
|
495
|
-
/* @__PURE__ */ n("span", { className: "cms-viewer__actions", children:
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
] },
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
/* @__PURE__ */ n("span", { className: "cms-viewer__wide", children:
|
|
491
|
+
d !== void 0 ? /* @__PURE__ */ h(ge, { children: [
|
|
492
|
+
/* @__PURE__ */ n("span", { className: "cms-viewer__status", role: "status", children: d.status }),
|
|
493
|
+
/* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: d.onDone, children: d.doneLabel })
|
|
494
|
+
] }) : /* @__PURE__ */ h(ge, { children: [
|
|
495
|
+
/* @__PURE__ */ n("span", { className: "cms-viewer__actions", children: r.map((M) => /* @__PURE__ */ h("button", { type: "button", className: "cms-viewer__button", onClick: M.onSelect, children: [
|
|
496
|
+
M.icon,
|
|
497
|
+
M.label
|
|
498
|
+
] }, M.label)) }),
|
|
499
|
+
c !== void 0 ? /* @__PURE__ */ h("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": c.label, onClick: c.onEdit, children: [
|
|
500
|
+
c.icon,
|
|
501
|
+
/* @__PURE__ */ n("span", { className: "cms-viewer__wide", children: c.label })
|
|
502
502
|
] }) : null,
|
|
503
|
-
|
|
504
|
-
/* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__icon", "aria-label":
|
|
505
|
-
|
|
503
|
+
r.length > 0 ? /* @__PURE__ */ h("span", { className: "cms-viewer__more", children: [
|
|
504
|
+
/* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__icon", "aria-label": m, "aria-expanded": N, onClick: () => v((M) => !M), children: /* @__PURE__ */ n($, { name: "more" }) }),
|
|
505
|
+
N ? /* @__PURE__ */ n("span", { className: "cms-viewer__menu", children: r.map((M) => /* @__PURE__ */ h(
|
|
506
506
|
"button",
|
|
507
507
|
{
|
|
508
508
|
type: "button",
|
|
509
509
|
className: "cms-viewer__button",
|
|
510
510
|
onClick: () => {
|
|
511
|
-
|
|
511
|
+
v(!1), M.onSelect();
|
|
512
512
|
},
|
|
513
513
|
children: [
|
|
514
|
-
|
|
515
|
-
|
|
514
|
+
M.icon,
|
|
515
|
+
M.label
|
|
516
516
|
]
|
|
517
517
|
},
|
|
518
|
-
|
|
518
|
+
M.label
|
|
519
519
|
)) }) : null
|
|
520
520
|
] }) : null
|
|
521
521
|
] })
|
|
522
522
|
] }),
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
-
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
(
|
|
527
|
-
/* @__PURE__ */ n("p", { className: "cms-viewer__conflict-text", children:
|
|
528
|
-
/* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button", onClick:
|
|
529
|
-
/* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick:
|
|
523
|
+
/* @__PURE__ */ h("div", { className: "cms-viewer__body", children: [
|
|
524
|
+
u != null && d === void 0 ? /* @__PURE__ */ n("nav", { className: "cms-viewer__thumbnails", children: u }) : null,
|
|
525
|
+
/* @__PURE__ */ h("div", { className: "cms-viewer__content", onTouchStart: B, onTouchEnd: F, children: [
|
|
526
|
+
(d == null ? void 0 : d.conflict) !== void 0 ? /* @__PURE__ */ h("div", { className: "cms-viewer__conflict", role: "alert", children: [
|
|
527
|
+
/* @__PURE__ */ n("p", { className: "cms-viewer__conflict-text", children: d.conflict.message }),
|
|
528
|
+
/* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button", onClick: d.conflict.onOverwrite, children: d.conflict.overwriteLabel }),
|
|
529
|
+
/* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: d.conflict.onKeepBoth, children: d.conflict.keepBothLabel })
|
|
530
530
|
] }) : null,
|
|
531
|
-
b === void 0 ?
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
531
|
+
b === void 0 ? x : /* @__PURE__ */ n(st, { state: b }),
|
|
532
|
+
d === void 0 && (i != null && i.onPrevious) ? /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": i.previousLabel, title: i.previousLabel, onClick: i.onPrevious, children: /* @__PURE__ */ n(se, { name: "back" }) }) : null,
|
|
533
|
+
d === void 0 && (i != null && i.onNext) ? /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": i.nextLabel, title: i.nextLabel, onClick: i.onNext, children: /* @__PURE__ */ n(se, { name: "back" }) }) : null,
|
|
534
|
+
d === void 0 && i !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(i.total, 7) }, (M, R) => /* @__PURE__ */ n("i", { className: R === Math.min(i.index, 6) ? "is-current" : void 0 }, R)) }) : null
|
|
535
535
|
] })
|
|
536
536
|
] }),
|
|
537
|
-
|
|
538
|
-
|
|
537
|
+
d === void 0 && k != null ? /* @__PURE__ */ n("div", { className: "cms-viewer__strip", children: k }) : null,
|
|
538
|
+
g != null ? /* @__PURE__ */ n("footer", { className: "cms-viewer__bar", children: g }) : null
|
|
539
539
|
]
|
|
540
540
|
}
|
|
541
541
|
),
|
|
@@ -581,168 +581,168 @@ class rt extends Error {
|
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
583
|
const Je = (e, t) => `${e}
|
|
584
|
-
${t}`, it = (e, t) => e === "" ? t : `${e}/${t}`,
|
|
584
|
+
${t}`, it = (e, t) => e === "" ? t : `${e}/${t}`, ot = 48;
|
|
585
585
|
function tl(e) {
|
|
586
586
|
var ne, ye;
|
|
587
|
-
const { open: t, spaces: l, list: s, disabledReason: a, budget:
|
|
587
|
+
const { open: t, spaces: l, list: s, disabledReason: a, budget: r, formatSize: m, labels: c, onConfirm: d, onCancel: b } = e, [i, g] = I(((ne = l[0]) == null ? void 0 : ne.id) ?? ""), [u, k] = I(""), [f, x] = I({ status: "loading" }), [L, S] = I(0), [_, N] = I(/* @__PURE__ */ new Map()), [v, w] = I(0), [T, B] = I(!1), F = z(null), M = z(!1);
|
|
588
588
|
Q(() => {
|
|
589
|
-
|
|
590
|
-
}, [t,
|
|
591
|
-
const
|
|
589
|
+
M.current = !1;
|
|
590
|
+
}, [t, i, u]);
|
|
591
|
+
const R = he();
|
|
592
592
|
Q(() => {
|
|
593
|
-
var
|
|
594
|
-
t && (
|
|
593
|
+
var y;
|
|
594
|
+
t && (g(((y = l[0]) == null ? void 0 : y.id) ?? ""), k(""), N(/* @__PURE__ */ new Map()), B(!1));
|
|
595
595
|
}, [t]), Q(() => {
|
|
596
|
-
if (!t ||
|
|
597
|
-
let
|
|
598
|
-
return
|
|
599
|
-
(E) =>
|
|
600
|
-
(E) =>
|
|
596
|
+
if (!t || i === "") return;
|
|
597
|
+
let y = !0;
|
|
598
|
+
return x({ status: "loading" }), w(0), s(i, u).then(
|
|
599
|
+
(E) => y && x({ status: "ready", entries: E.entries, next: E.next ?? null, paging: !1 }),
|
|
600
|
+
(E) => y && x({ status: E instanceof at ? "denied" : "error" })
|
|
601
601
|
), () => {
|
|
602
|
-
|
|
602
|
+
y = !1;
|
|
603
603
|
};
|
|
604
|
-
}, [t,
|
|
605
|
-
const
|
|
606
|
-
if (
|
|
607
|
-
const
|
|
608
|
-
|
|
604
|
+
}, [t, i, u, s, L]);
|
|
605
|
+
const U = Ie(() => {
|
|
606
|
+
if (f.status !== "ready" || f.next === null || f.paging) return;
|
|
607
|
+
const y = f.next, E = f.entries;
|
|
608
|
+
x({ ...f, paging: !0 }), s(i, u, y).then(
|
|
609
609
|
(W) => {
|
|
610
|
-
|
|
610
|
+
M.current = !1, x({ status: "ready", entries: [...E, ...W.entries], next: W.next ?? null, paging: !1 });
|
|
611
611
|
},
|
|
612
612
|
(W) => {
|
|
613
613
|
if (!(W instanceof rt)) {
|
|
614
|
-
|
|
614
|
+
x({ status: "ready", entries: E, next: y, paging: !1 });
|
|
615
615
|
return;
|
|
616
616
|
}
|
|
617
|
-
if (
|
|
618
|
-
|
|
617
|
+
if (M.current) {
|
|
618
|
+
x({ status: "error" });
|
|
619
619
|
return;
|
|
620
620
|
}
|
|
621
|
-
|
|
621
|
+
M.current = !0, S((q) => q + 1);
|
|
622
622
|
}
|
|
623
623
|
);
|
|
624
|
-
}, [
|
|
624
|
+
}, [f, s, i, u]), j = Ie((y) => {
|
|
625
625
|
var E;
|
|
626
|
-
return ((E =
|
|
627
|
-
}, [
|
|
628
|
-
if (
|
|
629
|
-
const E = a == null ? void 0 : a(
|
|
630
|
-
return E || (Y !== null && !
|
|
631
|
-
}, be = (
|
|
632
|
-
const E = Je(
|
|
633
|
-
!
|
|
626
|
+
return ((E = r == null ? void 0 : r.cost) == null ? void 0 : E.call(r, y)) ?? y.size ?? 0;
|
|
627
|
+
}, [r]), K = Bn(() => [..._.values()], [_]), G = K.reduce((y, E) => y + (E.size ?? 0), 0), Y = r === void 0 ? null : r.limitBytes - r.usedBytes - K.reduce((y, E) => y + j(E), 0), ee = Y !== null && Y < 0, ie = (y) => {
|
|
628
|
+
if (y.kind !== "file") return null;
|
|
629
|
+
const E = a == null ? void 0 : a(y);
|
|
630
|
+
return E || (Y !== null && !_.has(Je(i, y.id)) && j(y) > Y ? c.overBudget : null);
|
|
631
|
+
}, be = (y) => {
|
|
632
|
+
const E = Je(i, y.id);
|
|
633
|
+
!_.has(E) && ie(y) !== null || N((W) => {
|
|
634
634
|
const q = new Map(W);
|
|
635
|
-
return q.has(E) ? q.delete(E) : q.set(E, { ...
|
|
635
|
+
return q.has(E) ? q.delete(E) : q.set(E, { ...y, space: i, path: u }), q;
|
|
636
636
|
});
|
|
637
|
-
},
|
|
637
|
+
}, oe = (y) => k(it(u, y.name)), de = () => k(u.includes("/") ? u.slice(0, u.lastIndexOf("/")) : ""), Ce = (y) => N((E) => {
|
|
638
638
|
const W = new Map(E);
|
|
639
|
-
return W.delete(
|
|
640
|
-
}), fe =
|
|
641
|
-
const E = fe[
|
|
642
|
-
if (
|
|
643
|
-
|
|
644
|
-
const W = fe.length - 1, q =
|
|
645
|
-
|
|
646
|
-
} else
|
|
647
|
-
}, pe =
|
|
648
|
-
return /* @__PURE__ */
|
|
639
|
+
return W.delete(y), W;
|
|
640
|
+
}), fe = f.status === "ready" ? f.entries : [], te = (y) => {
|
|
641
|
+
const E = fe[v];
|
|
642
|
+
if (y.key === "ArrowDown" || y.key === "ArrowUp" || y.key === "Home" || y.key === "End") {
|
|
643
|
+
y.preventDefault();
|
|
644
|
+
const W = fe.length - 1, q = y.key === "Home" ? 0 : y.key === "End" ? W : Math.min(W, Math.max(0, v + (y.key === "ArrowDown" ? 1 : -1)));
|
|
645
|
+
w(q), q >= W - 1 && U();
|
|
646
|
+
} else y.key === "Enter" && (E == null ? void 0 : E.kind) === "folder" ? (y.preventDefault(), oe(E)) : y.key === " " && (E == null ? void 0 : E.kind) === "file" ? (y.preventDefault(), be(E)) : y.key === "Backspace" && u !== "" && (y.preventDefault(), de());
|
|
647
|
+
}, pe = u === "" ? [] : u.split("/"), _e = ((ye = l.find((y) => y.id === i)) == null ? void 0 : ye.name) ?? "", we = (y) => `${R}-entry-${String(y)}`;
|
|
648
|
+
return /* @__PURE__ */ h(
|
|
649
649
|
Sn,
|
|
650
650
|
{
|
|
651
651
|
open: t,
|
|
652
|
-
title:
|
|
652
|
+
title: c.title,
|
|
653
653
|
onClose: b,
|
|
654
|
-
closeLabel:
|
|
655
|
-
initialFocus:
|
|
654
|
+
closeLabel: c.close,
|
|
655
|
+
initialFocus: F,
|
|
656
656
|
className: "cms-file-picker",
|
|
657
|
-
footer: /* @__PURE__ */
|
|
658
|
-
/* @__PURE__ */
|
|
659
|
-
K.length > 0 ? /* @__PURE__ */ n("span", { children:
|
|
660
|
-
|
|
657
|
+
footer: /* @__PURE__ */ h("div", { className: "cms-file-picker__foot", children: [
|
|
658
|
+
/* @__PURE__ */ h("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
|
|
659
|
+
K.length > 0 ? /* @__PURE__ */ n("span", { children: c.total(K.length, m(G)) }) : null,
|
|
660
|
+
r !== void 0 && Y !== null ? /* @__PURE__ */ n("span", { className: H(ee && "is-over"), children: ee ? c.overBudget : c.left(m(Math.max(0, Y)), m(r.limitBytes)) }) : null
|
|
661
661
|
] }),
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */ n(De, { variant: "secondary", onClick: b, children:
|
|
664
|
-
/* @__PURE__ */ n(De, { variant: "primary", disabled: K.length === 0 || ee, onClick: () =>
|
|
662
|
+
/* @__PURE__ */ h("div", { className: "cms-file-picker__actions", children: [
|
|
663
|
+
/* @__PURE__ */ n(De, { variant: "secondary", onClick: b, children: c.cancel }),
|
|
664
|
+
/* @__PURE__ */ n(De, { variant: "primary", disabled: K.length === 0 || ee, onClick: () => d(K), children: c.confirm(K.length) })
|
|
665
665
|
] })
|
|
666
666
|
] }),
|
|
667
667
|
children: [
|
|
668
|
-
/* @__PURE__ */
|
|
669
|
-
l.length > 1 ? /* @__PURE__ */
|
|
670
|
-
/* @__PURE__ */ n("span", { className: "cms-visually-hidden", children:
|
|
671
|
-
/* @__PURE__ */ n("select", { className: "cms-input cms-select", value:
|
|
672
|
-
|
|
673
|
-
}, children: l.map((
|
|
668
|
+
/* @__PURE__ */ h("div", { className: "cms-file-picker__top", children: [
|
|
669
|
+
l.length > 1 ? /* @__PURE__ */ h("label", { className: "cms-file-picker__space", children: [
|
|
670
|
+
/* @__PURE__ */ n("span", { className: "cms-visually-hidden", children: c.space }),
|
|
671
|
+
/* @__PURE__ */ n("select", { className: "cms-input cms-select", value: i, onChange: (y) => {
|
|
672
|
+
g(y.target.value), k("");
|
|
673
|
+
}, children: l.map((y) => /* @__PURE__ */ n("option", { value: y.id, children: y.name }, y.id)) })
|
|
674
674
|
] }) : null,
|
|
675
|
-
/* @__PURE__ */
|
|
676
|
-
/* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
677
|
-
/* @__PURE__ */
|
|
678
|
-
/* @__PURE__ */ n("li", { children: /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__crumb", "aria-current":
|
|
679
|
-
pe.map((
|
|
675
|
+
/* @__PURE__ */ h("nav", { className: "cms-file-picker__path", "aria-label": c.path, children: [
|
|
676
|
+
/* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": c.up, disabled: u === "", onClick: de, children: /* @__PURE__ */ n($, { name: "chevron-left" }) }),
|
|
677
|
+
/* @__PURE__ */ h("ol", { children: [
|
|
678
|
+
/* @__PURE__ */ n("li", { children: /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": u === "" ? "location" : void 0, onClick: () => k(""), children: _e }) }),
|
|
679
|
+
pe.map((y, E) => {
|
|
680
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 ===
|
|
681
|
+
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": W === u ? "location" : void 0, onClick: () => k(W), children: y }) }, W);
|
|
682
682
|
})
|
|
683
683
|
] })
|
|
684
684
|
] }),
|
|
685
|
-
K.length > 0 ? /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded":
|
|
685
|
+
K.length > 0 ? /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": T, onClick: () => B((y) => !y), children: c.selected(K.length) }) : null
|
|
686
686
|
] }),
|
|
687
|
-
|
|
688
|
-
/* @__PURE__ */ n("ul", { children: [...
|
|
687
|
+
T && K.length > 0 ? /* @__PURE__ */ h("div", { className: "cms-file-picker__chosen", children: [
|
|
688
|
+
/* @__PURE__ */ n("ul", { children: [..._.entries()].map(([y, E]) => /* @__PURE__ */ h("li", { children: [
|
|
689
689
|
/* @__PURE__ */ n("span", { className: "cms-file-picker__name", children: E.name }),
|
|
690
|
-
/* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
691
|
-
] },
|
|
690
|
+
/* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": c.remove(E.name), onClick: () => Ce(y), children: /* @__PURE__ */ n(se, { name: "close" }) })
|
|
691
|
+
] }, y)) }),
|
|
692
692
|
/* @__PURE__ */ n(De, { variant: "secondary", onClick: () => {
|
|
693
|
-
|
|
694
|
-
}, children:
|
|
693
|
+
N(/* @__PURE__ */ new Map()), B(!1);
|
|
694
|
+
}, children: c.clear })
|
|
695
695
|
] }) : null,
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
const E =
|
|
698
|
-
E.scrollTop + E.clientHeight >= E.scrollHeight -
|
|
696
|
+
/* @__PURE__ */ h("div", { className: "cms-file-picker__list", onScroll: (y) => {
|
|
697
|
+
const E = y.currentTarget;
|
|
698
|
+
E.scrollTop + E.clientHeight >= E.scrollHeight - ot && U();
|
|
699
699
|
}, children: [
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
700
|
+
f.status === "loading" ? /* @__PURE__ */ n(Le, { kind: "loading", title: c.loading, placement: "page" }) : null,
|
|
701
|
+
f.status === "error" ? /* @__PURE__ */ n(Le, { kind: "error", title: c.error, placement: "page", action: { label: c.retry, onAction: () => {
|
|
702
|
+
M.current = !1, S((y) => y + 1);
|
|
703
703
|
} } }) : null,
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
/* @__PURE__ */
|
|
704
|
+
f.status === "denied" ? /* @__PURE__ */ n(Le, { kind: "denied", title: c.denied, placement: "page" }) : null,
|
|
705
|
+
f.status === "ready" && fe.length === 0 ? /* @__PURE__ */ n(Le, { kind: "empty", title: c.empty, placement: "page" }) : null,
|
|
706
|
+
/* @__PURE__ */ h(
|
|
707
707
|
"div",
|
|
708
708
|
{
|
|
709
|
-
ref:
|
|
709
|
+
ref: F,
|
|
710
710
|
role: "listbox",
|
|
711
711
|
"aria-multiselectable": "true",
|
|
712
|
-
"aria-label":
|
|
713
|
-
"aria-activedescendant": fe.length > 0 ? we(
|
|
712
|
+
"aria-label": c.files,
|
|
713
|
+
"aria-activedescendant": fe.length > 0 ? we(v) : void 0,
|
|
714
714
|
tabIndex: 0,
|
|
715
715
|
className: "cms-file-picker__entries",
|
|
716
|
-
hidden:
|
|
716
|
+
hidden: f.status !== "ready" || fe.length === 0,
|
|
717
717
|
onKeyDown: te,
|
|
718
718
|
children: [
|
|
719
|
-
fe.map((
|
|
720
|
-
const W =
|
|
721
|
-
return /* @__PURE__ */
|
|
719
|
+
fe.map((y, E) => {
|
|
720
|
+
const W = y.kind === "file" && _.has(Je(i, y.id)), q = ie(y);
|
|
721
|
+
return /* @__PURE__ */ h(
|
|
722
722
|
"div",
|
|
723
723
|
{
|
|
724
724
|
id: we(E),
|
|
725
725
|
role: "option",
|
|
726
|
-
"aria-selected":
|
|
726
|
+
"aria-selected": y.kind === "file" ? W : void 0,
|
|
727
727
|
"aria-disabled": q !== null || void 0,
|
|
728
|
-
className:
|
|
728
|
+
className: H("cms-file-picker__entry", E === v && "is-active", W && "is-ticked", q !== null && "is-disabled"),
|
|
729
729
|
onClick: () => {
|
|
730
|
-
|
|
730
|
+
w(E), y.kind === "folder" ? oe(y) : be(y);
|
|
731
731
|
},
|
|
732
732
|
children: [
|
|
733
733
|
/* @__PURE__ */ n("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: W ? /* @__PURE__ */ n($, { name: "check" }) : null }),
|
|
734
|
-
/* @__PURE__ */ n($, { name:
|
|
735
|
-
/* @__PURE__ */
|
|
736
|
-
/* @__PURE__ */ n("span", { className: "cms-file-picker__name", children:
|
|
734
|
+
/* @__PURE__ */ n($, { name: y.kind === "folder" ? "folder" : "file" }),
|
|
735
|
+
/* @__PURE__ */ h("span", { className: "cms-file-picker__text", children: [
|
|
736
|
+
/* @__PURE__ */ n("span", { className: "cms-file-picker__name", children: y.name }),
|
|
737
737
|
q !== null ? /* @__PURE__ */ n("span", { className: "cms-file-picker__reason", children: q }) : null
|
|
738
738
|
] }),
|
|
739
|
-
|
|
739
|
+
y.kind === "file" && y.size != null ? /* @__PURE__ */ n("span", { className: "cms-file-picker__size", children: m(y.size) }) : null
|
|
740
740
|
]
|
|
741
741
|
},
|
|
742
|
-
|
|
742
|
+
y.id
|
|
743
743
|
);
|
|
744
744
|
}),
|
|
745
|
-
|
|
745
|
+
f.status === "ready" && f.paging ? /* @__PURE__ */ n("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ n(Le, { kind: "loading", title: c.loading, placement: "inline" }) }) : null
|
|
746
746
|
]
|
|
747
747
|
}
|
|
748
748
|
)
|
|
@@ -752,7 +752,7 @@ function tl(e) {
|
|
|
752
752
|
);
|
|
753
753
|
}
|
|
754
754
|
const nn = 64;
|
|
755
|
-
function
|
|
755
|
+
function ct(e, t) {
|
|
756
756
|
for (let l = e instanceof Element ? e : null; l !== null; l = l.parentElement) {
|
|
757
757
|
if (l instanceof HTMLElement && l.scrollTop > 0) return !1;
|
|
758
758
|
if (l === t) return !0;
|
|
@@ -760,27 +760,27 @@ function ot(e, t) {
|
|
|
760
760
|
return t.scrollTop <= 0;
|
|
761
761
|
}
|
|
762
762
|
function dt(e, t) {
|
|
763
|
-
const [l, s] =
|
|
763
|
+
const [l, s] = I(0), a = z(t);
|
|
764
764
|
return a.current = t, Q(() => {
|
|
765
|
-
const
|
|
766
|
-
if (
|
|
767
|
-
let
|
|
768
|
-
const
|
|
769
|
-
|
|
770
|
-
}, b = (
|
|
771
|
-
if (
|
|
772
|
-
const
|
|
773
|
-
if (
|
|
774
|
-
|
|
765
|
+
const r = e.current;
|
|
766
|
+
if (r === null) return;
|
|
767
|
+
let m = null, c = 0;
|
|
768
|
+
const d = (g) => {
|
|
769
|
+
m = ct(g.target, r) && g.touches.length === 1 ? g.touches[0].clientY : null, c = 0;
|
|
770
|
+
}, b = (g) => {
|
|
771
|
+
if (m === null || a.current === null) return;
|
|
772
|
+
const u = g.touches[0].clientY - m;
|
|
773
|
+
if (u <= 0) {
|
|
774
|
+
m = null, s(0);
|
|
775
775
|
return;
|
|
776
776
|
}
|
|
777
|
-
|
|
778
|
-
},
|
|
779
|
-
var
|
|
780
|
-
|
|
777
|
+
g.cancelable && g.preventDefault(), c = Math.min(u * 0.6, nn * 1.5), s(c);
|
|
778
|
+
}, i = () => {
|
|
779
|
+
var g;
|
|
780
|
+
m !== null && c >= nn && ((g = a.current) == null || g.call(a)), m = null, c = 0, s(0);
|
|
781
781
|
};
|
|
782
|
-
return
|
|
783
|
-
|
|
782
|
+
return r.addEventListener("touchstart", d, { passive: !0 }), r.addEventListener("touchmove", b, { passive: !1 }), r.addEventListener("touchend", i), r.addEventListener("touchcancel", i), () => {
|
|
783
|
+
r.removeEventListener("touchstart", d), r.removeEventListener("touchmove", b), r.removeEventListener("touchend", i), r.removeEventListener("touchcancel", i);
|
|
784
784
|
};
|
|
785
785
|
}, [e]), l;
|
|
786
786
|
}
|
|
@@ -788,175 +788,180 @@ const En = Rn(null);
|
|
|
788
788
|
function ut() {
|
|
789
789
|
return Fn(En);
|
|
790
790
|
}
|
|
791
|
-
function ll({ label: e, rows: t, error: l, onRetry: s, loadingText: a = "Loading", emptyTitle:
|
|
792
|
-
const
|
|
791
|
+
function ll({ label: e, rows: t, error: l, onRetry: s, loadingText: a = "Loading", emptyTitle: r = "Nothing here yet", emptyHint: m, emptyIcon: c, selected: d, onOpen: b, onRowMenu: i }) {
|
|
792
|
+
const g = z([]), u = ut();
|
|
793
793
|
if (l != null) return /* @__PURE__ */ n(Yn, { message: l, onRetry: s });
|
|
794
794
|
if (t === null) return /* @__PURE__ */ n(Gn, { what: a, layout: "block" });
|
|
795
|
-
if (t.length === 0) return /* @__PURE__ */ n(jn, { title:
|
|
796
|
-
const
|
|
797
|
-
var
|
|
798
|
-
if (
|
|
799
|
-
|
|
800
|
-
else if (
|
|
801
|
-
b == null || b(
|
|
802
|
-
else if ((
|
|
803
|
-
|
|
804
|
-
const
|
|
805
|
-
|
|
795
|
+
if (t.length === 0) return /* @__PURE__ */ n(jn, { title: r, hint: m, ...c === void 0 ? {} : { icon: c } });
|
|
796
|
+
const k = (f, x, L) => {
|
|
797
|
+
var S;
|
|
798
|
+
if (f.key === "ArrowDown" || f.key === "ArrowUp")
|
|
799
|
+
f.preventDefault(), (S = g.current[Math.min(t.length - 1, Math.max(0, x + (f.key === "ArrowDown" ? 1 : -1)))]) == null || S.focus();
|
|
800
|
+
else if (f.key === "Enter")
|
|
801
|
+
b == null || b(L);
|
|
802
|
+
else if ((f.key === "ContextMenu" || f.shiftKey && f.key === "F10") && i) {
|
|
803
|
+
f.preventDefault();
|
|
804
|
+
const _ = f.currentTarget.getBoundingClientRect();
|
|
805
|
+
i(L, { x: _.left + 16, y: _.bottom });
|
|
806
806
|
}
|
|
807
807
|
};
|
|
808
|
-
return /* @__PURE__ */
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
808
|
+
return /* @__PURE__ */ h(ge, { children: [
|
|
809
|
+
u !== null && (u.distance > 0 || u.refreshing) ? /* @__PURE__ */ h("div", { className: "cms-list__pull", role: "status", style: { height: u.refreshing ? void 0 : u.distance }, "data-ready": u.distance >= nn ? "" : void 0, children: [
|
|
810
|
+
u.refreshing ? /* @__PURE__ */ n(se, { name: "spinner" }) : null,
|
|
811
|
+
u.text != null ? /* @__PURE__ */ n("span", { className: "cms-list__pull-text", children: u.text }) : null
|
|
812
812
|
] }) : null,
|
|
813
|
-
/* @__PURE__ */ n("ul", { className: "cms-list", role: "listbox", "aria-label": e, children: t.map((
|
|
814
|
-
const
|
|
815
|
-
return /* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ n("ul", { className: "cms-list", role: "listbox", "aria-label": e, children: t.map((f, x) => {
|
|
814
|
+
const L = f.id === d;
|
|
815
|
+
return /* @__PURE__ */ h(
|
|
816
816
|
"li",
|
|
817
817
|
{
|
|
818
|
-
ref: (
|
|
819
|
-
|
|
818
|
+
ref: (S) => {
|
|
819
|
+
g.current[x] = S;
|
|
820
820
|
},
|
|
821
821
|
role: "option",
|
|
822
|
-
"aria-selected":
|
|
823
|
-
tabIndex:
|
|
824
|
-
className:
|
|
825
|
-
onClick: () => b == null ? void 0 : b(
|
|
826
|
-
onKeyDown: (
|
|
827
|
-
onContextMenu:
|
|
828
|
-
|
|
822
|
+
"aria-selected": L,
|
|
823
|
+
tabIndex: L || d == null && x === 0 ? 0 : -1,
|
|
824
|
+
className: H("cms-list__row", L && "is-selected"),
|
|
825
|
+
onClick: () => b == null ? void 0 : b(f.id),
|
|
826
|
+
onKeyDown: (S) => k(S, x, f.id),
|
|
827
|
+
onContextMenu: i ? (S) => {
|
|
828
|
+
S.preventDefault(), i(f.id, { x: S.clientX, y: S.clientY });
|
|
829
829
|
} : void 0,
|
|
830
830
|
children: [
|
|
831
|
-
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
/* @__PURE__ */ n("span", { className:
|
|
834
|
-
|
|
831
|
+
f.lead != null ? /* @__PURE__ */ n("span", { className: "cms-list__lead", children: f.lead }) : null,
|
|
832
|
+
/* @__PURE__ */ h("span", { className: "cms-list__text", children: [
|
|
833
|
+
/* @__PURE__ */ n("span", { className: H("cms-list__primary", f.unread === !0 && "is-unread"), children: f.primary }),
|
|
834
|
+
f.secondary != null ? /* @__PURE__ */ n("span", { className: "cms-list__secondary", children: f.secondary }) : null
|
|
835
835
|
] }),
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
836
|
+
f.meta != null || f.count !== void 0 ? /* @__PURE__ */ h("span", { className: "cms-list__end", children: [
|
|
837
|
+
f.meta != null ? /* @__PURE__ */ n("span", { className: "cms-list__meta", children: f.meta }) : null,
|
|
838
|
+
f.count !== void 0 && f.count > 0 ? /* @__PURE__ */ n("span", { className: "cms-badge cms-list__count", children: f.count }) : null
|
|
839
839
|
] }) : null
|
|
840
840
|
]
|
|
841
841
|
},
|
|
842
|
-
|
|
842
|
+
f.id
|
|
843
843
|
);
|
|
844
844
|
}) })
|
|
845
845
|
] });
|
|
846
846
|
}
|
|
847
|
-
function Ke({ at: e, items: t, onClose: l, label: s = "Actions", focus: a = "current" }) {
|
|
848
|
-
const
|
|
847
|
+
function Ke({ at: e, items: t, onClose: l, label: s = "Actions", focus: a = "current", corner: r = "top-left" }) {
|
|
848
|
+
const m = z(null), c = z(null), d = he(), [b, i] = I(e), g = t.filter((_) => _.offer.offered);
|
|
849
849
|
if ($e(() => {
|
|
850
850
|
if (!e) return;
|
|
851
|
-
const
|
|
852
|
-
|
|
853
|
-
}, [e]), Q(() => {
|
|
854
|
-
var
|
|
851
|
+
const _ = m.current, N = (_ == null ? void 0 : _.offsetWidth) ?? 0, v = (_ == null ? void 0 : _.offsetHeight) ?? 0, w = r === "bottom-right" ? e.x - N : e.x, T = r === "bottom-right" ? e.y - v : e.y;
|
|
852
|
+
i({ x: Math.max(0, Math.min(w, window.innerWidth - N)), y: Math.max(0, Math.min(T, window.innerHeight - v)) });
|
|
853
|
+
}, [e, r]), Q(() => {
|
|
854
|
+
var w, T;
|
|
855
855
|
if (!e) return;
|
|
856
|
-
|
|
857
|
-
const
|
|
858
|
-
(
|
|
859
|
-
const
|
|
860
|
-
var
|
|
861
|
-
(
|
|
856
|
+
c.current = document.activeElement;
|
|
857
|
+
const _ = Array.from(((w = m.current) == null ? void 0 : w.querySelectorAll('[role^="menuitem"]:not([aria-disabled="true"])')) ?? []), N = a === "current" ? _.find((B) => B.getAttribute("aria-checked") === "true") : void 0;
|
|
858
|
+
(T = a === "last" ? _[_.length - 1] : N ?? _[0]) == null || T.focus();
|
|
859
|
+
const v = (B) => {
|
|
860
|
+
var F;
|
|
861
|
+
(F = m.current) != null && F.contains(B.target) || l();
|
|
862
862
|
};
|
|
863
|
-
return document.addEventListener("mousedown",
|
|
864
|
-
var
|
|
865
|
-
document.removeEventListener("mousedown",
|
|
863
|
+
return document.addEventListener("mousedown", v), () => {
|
|
864
|
+
var B, F;
|
|
865
|
+
document.removeEventListener("mousedown", v), (F = (B = c.current) == null ? void 0 : B.focus) == null || F.call(B);
|
|
866
866
|
};
|
|
867
|
-
}, [e, l, a]), !e ||
|
|
868
|
-
const
|
|
869
|
-
var
|
|
870
|
-
const
|
|
871
|
-
if (
|
|
872
|
-
|
|
873
|
-
else if (
|
|
874
|
-
|
|
875
|
-
const
|
|
876
|
-
(
|
|
867
|
+
}, [e, l, a]), !e || g.length === 0) return null;
|
|
868
|
+
const u = (_) => {
|
|
869
|
+
var w, T;
|
|
870
|
+
const N = Array.from(((w = m.current) == null ? void 0 : w.querySelectorAll('[role^="menuitem"]')) ?? []), v = N.indexOf(document.activeElement);
|
|
871
|
+
if (_.key === "Escape" || _.key === "Tab")
|
|
872
|
+
_.preventDefault(), l();
|
|
873
|
+
else if (_.key === "ArrowDown" || _.key === "ArrowUp") {
|
|
874
|
+
_.preventDefault();
|
|
875
|
+
const B = _.key === "ArrowDown" ? 1 : -1;
|
|
876
|
+
(T = N[(v + B + N.length) % N.length]) == null || T.focus();
|
|
877
877
|
}
|
|
878
|
-
},
|
|
879
|
-
const
|
|
880
|
-
return /* @__PURE__ */
|
|
878
|
+
}, k = g.flatMap((_) => _.offer.refusal === void 0 ? [] : [_.offer.refusal]), f = k.length > 1 && k.every((_) => _ === k[0]) ? k[0] : void 0, x = `${d}-shared`, L = (_) => {
|
|
879
|
+
const N = _.offer.refusal !== void 0, v = N ? f !== void 0 ? x : `${d}-${_.id}` : void 0;
|
|
880
|
+
return /* @__PURE__ */ h(
|
|
881
881
|
"div",
|
|
882
882
|
{
|
|
883
|
-
role:
|
|
884
|
-
"aria-checked":
|
|
883
|
+
role: _.checked === void 0 ? "menuitem" : "menuitemradio",
|
|
884
|
+
"aria-checked": _.checked,
|
|
885
885
|
tabIndex: -1,
|
|
886
|
-
"aria-disabled":
|
|
887
|
-
"aria-describedby":
|
|
888
|
-
title:
|
|
889
|
-
className:
|
|
886
|
+
"aria-disabled": N || void 0,
|
|
887
|
+
"aria-describedby": v,
|
|
888
|
+
title: N ? _.offer.refusal : void 0,
|
|
889
|
+
className: H("cms-menu__item", _.danger && "is-danger", _.offer.locked && "is-locked", N && "is-refused"),
|
|
890
890
|
onClick: () => {
|
|
891
|
-
|
|
891
|
+
N || (l(), _.onSelect());
|
|
892
892
|
},
|
|
893
|
-
onKeyDown: (
|
|
894
|
-
(
|
|
893
|
+
onKeyDown: (w) => {
|
|
894
|
+
(w.key === "Enter" || w.key === " ") && !N && (w.preventDefault(), l(), _.onSelect());
|
|
895
895
|
},
|
|
896
896
|
children: [
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
|
|
897
|
+
_.checked !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-menu__check", children: _.checked ? /* @__PURE__ */ n(se, { name: "check" }) : null }) : null,
|
|
898
|
+
_.offer.locked ? /* @__PURE__ */ n(se, { name: "lock" }) : null,
|
|
899
|
+
/* @__PURE__ */ h("span", { className: "cms-menu__text", children: [
|
|
900
|
+
/* @__PURE__ */ n("span", { className: "cms-menu__label", children: _.label }),
|
|
901
|
+
N && f === void 0 ? /* @__PURE__ */ n("span", { id: `${d}-${_.id}`, className: "cms-menu__refusal", children: _.offer.refusal }) : null
|
|
902
|
+
] })
|
|
901
903
|
]
|
|
902
904
|
},
|
|
903
|
-
|
|
905
|
+
_.id
|
|
904
906
|
);
|
|
905
|
-
},
|
|
906
|
-
for (const
|
|
907
|
-
const
|
|
908
|
-
|
|
907
|
+
}, S = [];
|
|
908
|
+
for (const _ of g) {
|
|
909
|
+
const N = S[S.length - 1];
|
|
910
|
+
N !== void 0 && N.group === _.group ? N.items.push(_) : S.push({ group: _.group, items: [_] });
|
|
909
911
|
}
|
|
910
912
|
return an(
|
|
911
|
-
/* @__PURE__ */
|
|
913
|
+
/* @__PURE__ */ h(
|
|
912
914
|
"div",
|
|
913
915
|
{
|
|
914
|
-
ref:
|
|
916
|
+
ref: m,
|
|
915
917
|
className: "cms-menu",
|
|
916
918
|
role: "menu",
|
|
917
919
|
"aria-label": s,
|
|
918
|
-
style: { left: (
|
|
919
|
-
onKeyDown:
|
|
920
|
-
onContextMenu: (
|
|
921
|
-
children:
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
/* @__PURE__ */ n("div", { className: "cms-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
920
|
+
style: { left: (b ?? e).x, top: (b ?? e).y },
|
|
921
|
+
onKeyDown: u,
|
|
922
|
+
onContextMenu: (_) => _.preventDefault(),
|
|
923
|
+
children: [
|
|
924
|
+
f === void 0 ? null : /* @__PURE__ */ n("div", { id: x, className: "cms-menu__reason", children: f }),
|
|
925
|
+
S.map((_, N) => /* @__PURE__ */ h(Hn, { children: [
|
|
926
|
+
N > 0 ? /* @__PURE__ */ n("div", { className: "cms-menu__separator", role: "separator" }) : null,
|
|
927
|
+
_.group === void 0 ? _.items.map(L) : /* @__PURE__ */ h("div", { role: "group", "aria-label": _.group, children: [
|
|
928
|
+
/* @__PURE__ */ n("div", { className: "cms-menu__group", "aria-hidden": "true", children: _.group }),
|
|
929
|
+
_.items.map(L)
|
|
930
|
+
] })
|
|
931
|
+
] }, N))
|
|
932
|
+
]
|
|
928
933
|
}
|
|
929
934
|
),
|
|
930
935
|
document.body
|
|
931
936
|
);
|
|
932
937
|
}
|
|
933
938
|
function dn() {
|
|
934
|
-
const [e, t] =
|
|
935
|
-
if (!b.has(
|
|
936
|
-
const
|
|
937
|
-
return
|
|
939
|
+
const [e, t] = I(/* @__PURE__ */ new Set()), [l, s] = I(null), a = z(null), r = z(null), m = (d) => t((b) => b.has(d) ? b : /* @__PURE__ */ new Set([...b, d])), c = (d) => t((b) => {
|
|
940
|
+
if (!b.has(d)) return b;
|
|
941
|
+
const i = new Set(b);
|
|
942
|
+
return i.delete(d), i;
|
|
938
943
|
});
|
|
939
944
|
return Q(() => {
|
|
940
945
|
if (l === null) return;
|
|
941
|
-
const
|
|
942
|
-
b.key === "Escape" &&
|
|
946
|
+
const d = (b) => {
|
|
947
|
+
b.key === "Escape" && m(l);
|
|
943
948
|
};
|
|
944
|
-
return window.addEventListener("keydown",
|
|
949
|
+
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
945
950
|
}, [l]), {
|
|
946
|
-
dismissed: (
|
|
947
|
-
dismiss:
|
|
948
|
-
show:
|
|
949
|
-
pointerIn: (
|
|
950
|
-
|
|
951
|
+
dismissed: (d) => e.has(d),
|
|
952
|
+
dismiss: m,
|
|
953
|
+
show: c,
|
|
954
|
+
pointerIn: (d) => {
|
|
955
|
+
r.current = d, s(d);
|
|
951
956
|
},
|
|
952
|
-
pointerOut: (
|
|
953
|
-
|
|
957
|
+
pointerOut: (d) => {
|
|
958
|
+
r.current === d && (r.current = null), s((b) => b === d ? null : b), a.current !== d && c(d);
|
|
954
959
|
},
|
|
955
|
-
focusIn: (
|
|
956
|
-
a.current =
|
|
960
|
+
focusIn: (d) => {
|
|
961
|
+
a.current = d;
|
|
957
962
|
},
|
|
958
|
-
focusOut: (
|
|
959
|
-
a.current ===
|
|
963
|
+
focusOut: (d) => {
|
|
964
|
+
a.current === d && (a.current = null), r.current !== d && c(d);
|
|
960
965
|
}
|
|
961
966
|
};
|
|
962
967
|
}
|
|
@@ -964,10 +969,10 @@ function mt(e, t, l) {
|
|
|
964
969
|
return Math.min(Math.max(e - l / 2, 0), Math.max(0, t - l));
|
|
965
970
|
}
|
|
966
971
|
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:
|
|
968
|
-
var X, Ne,
|
|
969
|
-
const [
|
|
970
|
-
...(
|
|
972
|
+
function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secondary: r, more: m = [], moreLabel: c, context: d, fullWidth: b = !1 }) {
|
|
973
|
+
var X, Ne, ce;
|
|
974
|
+
const [i, g] = I(null), [u, k] = I(yn), [f, x] = I(null), [L, S] = I(null), _ = dn(), N = z(null), v = z(null), w = z(null), T = he(), B = he(), F = [
|
|
975
|
+
...(r ?? []).map((o) => ({
|
|
971
976
|
id: o.id,
|
|
972
977
|
label: o.label,
|
|
973
978
|
name: o.label,
|
|
@@ -977,7 +982,7 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
|
|
|
977
982
|
offer: o.offer ?? { offered: !0, locked: !1 },
|
|
978
983
|
run: o.onPress
|
|
979
984
|
})),
|
|
980
|
-
...
|
|
985
|
+
...m.map((o) => ({
|
|
981
986
|
id: o.id,
|
|
982
987
|
label: o.label,
|
|
983
988
|
name: typeof o.label == "string" ? o.label : o.id,
|
|
@@ -987,29 +992,29 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
|
|
|
987
992
|
offer: o.offer,
|
|
988
993
|
run: o.onSelect
|
|
989
994
|
}))
|
|
990
|
-
].filter((o) => o.offer.offered),
|
|
995
|
+
].filter((o) => o.offer.offered), M = F.filter((o) => o.overflow === 0), R = F.filter((o) => o.overflow !== 0), U = M.length === 1 ? M[0] ?? null : null, j = pt(R), K = R.filter((o) => o.overflow === void 0).map((o) => o.id).reverse(), G = [...j, ...K.map((o) => [o])], Y = [...U !== null ? [[U.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 && (((ce = a.offer) == null ? void 0 : ce.offered) === !1 || ie !== void 0), oe = a !== void 0 && "menu" in a ? a.menu.filter((o) => o.offer.offered) : [], de = a !== void 0 && "menu" in a && oe.length > 0 ? a : null, Ce = s.filter((o) => o.elsewhere === !0), fe = JSON.stringify([
|
|
991
996
|
e,
|
|
992
997
|
t ?? null,
|
|
993
998
|
l ?? null,
|
|
994
999
|
s.map((o) => [o.id, o.text, o.elsewhere === !0]),
|
|
995
1000
|
ee ? [a.label, a.icon, de !== null] : null,
|
|
996
|
-
|
|
1001
|
+
F.map((o) => [o.id, o.name, o.icon, o.overflow ?? null])
|
|
997
1002
|
]), te = Ie(() => {
|
|
998
|
-
const o =
|
|
1003
|
+
const o = N.current, A = v.current;
|
|
999
1004
|
if (o === null || A === null) return;
|
|
1000
|
-
const
|
|
1005
|
+
const C = getComputedStyle(o), P = parseFloat(C.columnGap || "0") || 0, le = o.clientWidth - (parseFloat(C.paddingLeft) || 0) - (parseFloat(C.paddingRight) || 0), J = (re) => {
|
|
1001
1006
|
var Me;
|
|
1002
1007
|
return ((Me = A.querySelector(re)) == null ? void 0 : Me.getBoundingClientRect().width) ?? 0;
|
|
1003
1008
|
}, ke = J('[data-measure="title"]'), Re = Math.min(ke, ft), He = (re) => {
|
|
1004
1009
|
const Me = pe(re), xe = [];
|
|
1005
1010
|
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
1011
|
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
|
|
1012
|
+
for (const ve of F) {
|
|
1008
1013
|
if (Me.has(ve.id)) continue;
|
|
1009
1014
|
const Ze = re.bare.has(ve.id) && ve.icon !== null;
|
|
1010
1015
|
xe.push(J(`[data-measure="${Ze ? "icon" : "full"}"][data-measure-id="${CSS.escape(ve.id)}"]`));
|
|
1011
1016
|
}
|
|
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) +
|
|
1017
|
+
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) + P * Math.max(0, xe.length - 1);
|
|
1013
1018
|
};
|
|
1014
1019
|
let V = { ...yn, titleFloor: Re };
|
|
1015
1020
|
const Oe = (re) => (V = re, He(re) <= le), pn = (() => {
|
|
@@ -1022,7 +1027,7 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
|
|
|
1022
1027
|
}
|
|
1023
1028
|
if (ee && Oe({ ...V, primaryBare: !0 })) return V;
|
|
1024
1029
|
V = { ...V, primaryBare: ee };
|
|
1025
|
-
const Me = /* @__PURE__ */ new Set(), xe = [...G, ...ee ? [[Ae]] : []], ve = () => Me.size +
|
|
1030
|
+
const Me = /* @__PURE__ */ new Set(), xe = [...G, ...ee ? [[Ae]] : []], ve = () => Me.size + M.length >= 2, Ze = (Ve) => ({ ...V, hidden: new Set([...Ve].filter((Ge) => Ge !== Ae)), primaryHidden: Ve.has(Ae) }), bn = V;
|
|
1026
1031
|
for (const Ve of xe) {
|
|
1027
1032
|
for (const Ge of Ve) Me.add(Ge);
|
|
1028
1033
|
if (ve() && Oe(Ze(Me))) return V;
|
|
@@ -1031,10 +1036,10 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
|
|
|
1031
1036
|
const _n = ve() ? Ze(Me) : bn;
|
|
1032
1037
|
return Oe({ ..._n, titleCut: !0 }) ? V : { ..._n, titleCut: !0, chipsCut: !0 };
|
|
1033
1038
|
})();
|
|
1034
|
-
|
|
1039
|
+
k((re) => ht(re, pn) ? re : pn);
|
|
1035
1040
|
}, [fe]);
|
|
1036
1041
|
$e(te, [te]), Q(() => {
|
|
1037
|
-
const o =
|
|
1042
|
+
const o = N.current;
|
|
1038
1043
|
if (o === null || typeof ResizeObserver > "u") return;
|
|
1039
1044
|
const A = new ResizeObserver(() => te());
|
|
1040
1045
|
return A.observe(o), () => A.disconnect();
|
|
@@ -1042,150 +1047,150 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
|
|
|
1042
1047
|
const o = typeof document > "u" ? void 0 : document.fonts;
|
|
1043
1048
|
if (o === void 0) return;
|
|
1044
1049
|
let A = !0;
|
|
1045
|
-
const
|
|
1050
|
+
const C = () => {
|
|
1046
1051
|
A && te();
|
|
1047
1052
|
};
|
|
1048
|
-
return o.ready.then(
|
|
1049
|
-
A = !1, o.removeEventListener("loadingdone",
|
|
1053
|
+
return o.ready.then(C), o.addEventListener("loadingdone", C), () => {
|
|
1054
|
+
A = !1, o.removeEventListener("loadingdone", C);
|
|
1050
1055
|
};
|
|
1051
1056
|
}, [te]);
|
|
1052
1057
|
function pe(o) {
|
|
1053
1058
|
const A = o.hidden.size + (o.primaryHidden ? 1 : 0);
|
|
1054
|
-
return /* @__PURE__ */ new Set([...
|
|
1059
|
+
return /* @__PURE__ */ new Set([...M.filter((C) => C !== U || A > 0).map((C) => C.id), ...o.hidden, ...o.primaryHidden ? [Ae] : []]);
|
|
1055
1060
|
}
|
|
1056
|
-
const _e = pe(
|
|
1057
|
-
...ee &&
|
|
1061
|
+
const _e = pe(u), we = F.filter((o) => !_e.has(o.id) && o !== U), ne = U !== null && !_e.has(U.id) ? U : null, ye = ee && !u.primaryHidden, y = (o) => F.find((A) => A.id === o), E = G.flat().filter((o) => u.hidden.has(o)).map(y).filter((o) => o !== void 0), W = (o) => ({ id: o.id, label: o.label, offer: o.offer, ...o.danger ? { danger: !0 } : {}, onSelect: o.run }), q = [
|
|
1062
|
+
...ee && u.primaryHidden ? [{ id: Ae, label: a.label, offer: a.offer ?? { offered: !0, locked: !1 }, onSelect: () => {
|
|
1058
1063
|
be || a.onPress();
|
|
1059
|
-
} }, ...
|
|
1064
|
+
} }, ...oe] : [],
|
|
1060
1065
|
...E.map(W),
|
|
1061
|
-
..._e.size > 0 ?
|
|
1062
|
-
], p = q.length > 0,
|
|
1066
|
+
..._e.size > 0 ? M.map(W) : []
|
|
1067
|
+
], p = q.length > 0, D = [
|
|
1063
1068
|
...we.map((o) => o.id),
|
|
1064
1069
|
...ne !== null ? [ne.id] : [],
|
|
1065
1070
|
...ye ? [Ae, ...de !== null ? ["primary-menu"] : []] : [],
|
|
1066
1071
|
...p ? ["more"] : []
|
|
1067
|
-
], Z =
|
|
1072
|
+
], Z = f !== null && D.includes(f) ? f : D[0] ?? null;
|
|
1068
1073
|
Q(() => {
|
|
1069
1074
|
var o, A;
|
|
1070
|
-
|
|
1071
|
-
}, [
|
|
1072
|
-
const ue = (o) => `${
|
|
1075
|
+
f === null || D.includes(f) || !p || ((o = N.current) != null && o.contains(document.activeElement) || document.activeElement === document.body) && (x("more"), (A = w.current) == null || A.focus());
|
|
1076
|
+
}, [u]);
|
|
1077
|
+
const ue = (o) => `${B}-${o}`, ae = (o) => {
|
|
1073
1078
|
var le;
|
|
1074
|
-
const A =
|
|
1075
|
-
let
|
|
1076
|
-
if (o.key === "ArrowRight" ?
|
|
1079
|
+
const A = D.indexOf(Z ?? "");
|
|
1080
|
+
let C = null;
|
|
1081
|
+
if (o.key === "ArrowRight" ? C = Math.min(D.length - 1, A + 1) : o.key === "ArrowLeft" ? C = Math.max(0, A - 1) : o.key === "Home" ? C = 0 : o.key === "End" && (C = D.length - 1), C === null) return;
|
|
1077
1082
|
o.preventDefault();
|
|
1078
|
-
const
|
|
1079
|
-
|
|
1083
|
+
const P = D[C] ?? null;
|
|
1084
|
+
x(P), P !== null && ((le = document.getElementById(ue(P))) == null || le.focus());
|
|
1080
1085
|
}, me = (o, A) => {
|
|
1081
|
-
const
|
|
1082
|
-
|
|
1083
|
-
}, Se = (o) => ({ id: ue(o), tabIndex: Z === o ? 0 : -1, onFocus: () =>
|
|
1084
|
-
...
|
|
1085
|
-
...
|
|
1086
|
-
onFocus: (
|
|
1087
|
-
|
|
1086
|
+
const C = A.getBoundingClientRect();
|
|
1087
|
+
g((i == null ? void 0 : i.which) === o ? null : { which: o, x: C.left, y: C.bottom + 4 });
|
|
1088
|
+
}, Se = (o) => ({ id: ue(o), tabIndex: Z === o ? 0 : -1, onFocus: () => x(o) }), We = (o, A, C) => A ? {
|
|
1089
|
+
...L === o ? { "data-reason-shown": "" } : {},
|
|
1090
|
+
..._.dismissed(o) ? { "data-tip-dismissed": "" } : {},
|
|
1091
|
+
onFocus: (P) => {
|
|
1092
|
+
x(o), _.focusIn(o), Te(P.currentTarget, C);
|
|
1088
1093
|
},
|
|
1089
1094
|
onBlur: () => {
|
|
1090
|
-
|
|
1095
|
+
S((P) => P === o ? null : P), _.focusOut(o);
|
|
1091
1096
|
},
|
|
1092
|
-
onMouseEnter: (
|
|
1093
|
-
|
|
1097
|
+
onMouseEnter: (P) => {
|
|
1098
|
+
_.pointerIn(o), Te(P.currentTarget, C);
|
|
1094
1099
|
},
|
|
1095
|
-
onMouseLeave: () =>
|
|
1096
|
-
onKeyDown: (
|
|
1097
|
-
|
|
1100
|
+
onMouseLeave: () => _.pointerOut(o),
|
|
1101
|
+
onKeyDown: (P) => {
|
|
1102
|
+
P.key === "Escape" && (S((le) => le === o ? null : le), _.dismiss(o));
|
|
1098
1103
|
}
|
|
1099
|
-
} : {}, Fe = (o, A,
|
|
1100
|
-
|
|
1104
|
+
} : {}, Fe = (o, A, C) => {
|
|
1105
|
+
S(o), _.show(o), Te(A, C);
|
|
1101
1106
|
}, Te = (o, A) => {
|
|
1102
|
-
const
|
|
1103
|
-
if (
|
|
1104
|
-
const le =
|
|
1105
|
-
|
|
1106
|
-
const J =
|
|
1107
|
-
|
|
1108
|
-
const ke =
|
|
1109
|
-
|
|
1110
|
-
}, Ee = (o, A,
|
|
1111
|
-
|
|
1112
|
-
|
|
1107
|
+
const C = document.getElementById(A), P = N.current;
|
|
1108
|
+
if (C === null || P === null) return;
|
|
1109
|
+
const le = C.style.display;
|
|
1110
|
+
C.style.display = "block";
|
|
1111
|
+
const J = C.offsetWidth;
|
|
1112
|
+
C.style.display = le;
|
|
1113
|
+
const ke = P.getBoundingClientRect(), Re = o.getBoundingClientRect();
|
|
1114
|
+
C.style.left = `${String(mt(Re.left + Re.width / 2 - ke.left, ke.width, J))}px`, C.style.right = "auto";
|
|
1115
|
+
}, Ee = (o, A, C) => /* @__PURE__ */ h("span", { id: o, className: "cms-section-header__tip", role: "tooltip", children: [
|
|
1116
|
+
C !== null ? /* @__PURE__ */ h("span", { "aria-hidden": "true", children: [
|
|
1117
|
+
C,
|
|
1113
1118
|
": "
|
|
1114
1119
|
] }) : null,
|
|
1115
1120
|
A
|
|
1116
|
-
] }),
|
|
1117
|
-
const A =
|
|
1118
|
-
return /* @__PURE__ */
|
|
1121
|
+
] }), O = (o) => {
|
|
1122
|
+
const A = u.bare.has(o.id) && o.icon !== null, C = o.offer.refusal, P = `${B}-reason-${o.id}`;
|
|
1123
|
+
return /* @__PURE__ */ h(
|
|
1119
1124
|
"button",
|
|
1120
1125
|
{
|
|
1121
1126
|
type: "button",
|
|
1122
|
-
className:
|
|
1127
|
+
className: H("cms-button", "cms-button--quiet", "cms-section-header__secondary", A && "cms-section-header__secondary--bare", o.danger && "is-danger"),
|
|
1123
1128
|
"data-action": o.id,
|
|
1124
|
-
"aria-label": A ||
|
|
1125
|
-
"aria-disabled":
|
|
1126
|
-
"aria-describedby":
|
|
1127
|
-
title:
|
|
1129
|
+
"aria-label": A || C !== void 0 ? o.name : void 0,
|
|
1130
|
+
"aria-disabled": C !== void 0 ? "true" : void 0,
|
|
1131
|
+
"aria-describedby": C !== void 0 ? P : void 0,
|
|
1132
|
+
title: C === void 0 && A ? o.name : void 0,
|
|
1128
1133
|
...Se(o.id),
|
|
1129
|
-
...We(o.id,
|
|
1134
|
+
...We(o.id, C !== void 0, P),
|
|
1130
1135
|
onClick: (le) => {
|
|
1131
|
-
|
|
1136
|
+
C === void 0 ? o.run() : Fe(o.id, le.currentTarget, P);
|
|
1132
1137
|
},
|
|
1133
1138
|
children: [
|
|
1134
1139
|
o.icon !== null ? /* @__PURE__ */ n($, { name: o.icon, size: 18 }) : null,
|
|
1135
1140
|
A ? null : /* @__PURE__ */ n("span", { className: "cms-section-header__label", children: o.label }),
|
|
1136
|
-
|
|
1141
|
+
C !== void 0 ? Ee(P, C, A ? o.name : null) : null
|
|
1137
1142
|
]
|
|
1138
1143
|
},
|
|
1139
1144
|
o.id
|
|
1140
1145
|
);
|
|
1141
1146
|
};
|
|
1142
|
-
return /* @__PURE__ */
|
|
1143
|
-
/* @__PURE__ */
|
|
1147
|
+
return /* @__PURE__ */ h("header", { className: H("cms-section-header", b && "cms-section-header--full"), children: [
|
|
1148
|
+
/* @__PURE__ */ h("div", { ref: N, className: H("cms-section-header__row", u.chipsCut && "cms-section-header__row--chips-cut"), "data-row": "1", children: [
|
|
1144
1149
|
t !== void 0 ? /* @__PURE__ */ n($, { name: t }) : null,
|
|
1145
1150
|
/* @__PURE__ */ n(
|
|
1146
1151
|
"h1",
|
|
1147
1152
|
{
|
|
1148
1153
|
className: "cms-section-header__title",
|
|
1149
1154
|
title: e,
|
|
1150
|
-
style: { minWidth:
|
|
1155
|
+
style: { minWidth: u.titleCut ? `${u.titleFloor}px` : "max-content" },
|
|
1151
1156
|
children: e
|
|
1152
1157
|
}
|
|
1153
1158
|
),
|
|
1154
|
-
l !== void 0 ? /* @__PURE__ */ n("span", { className:
|
|
1159
|
+
l !== void 0 ? /* @__PURE__ */ n("span", { className: H("cms-section-header__description", u.descriptionHidden && "cms-visually-hidden"), children: l }) : null,
|
|
1155
1160
|
s.map((o, A) => /* @__PURE__ */ n(
|
|
1156
1161
|
"span",
|
|
1157
1162
|
{
|
|
1158
1163
|
className: "cms-section-header__meta",
|
|
1159
1164
|
"data-meta": o.id,
|
|
1160
|
-
hidden: o.elsewhere === !0 &&
|
|
1161
|
-
style:
|
|
1162
|
-
...
|
|
1165
|
+
hidden: o.elsewhere === !0 && u.elsewhereHidden,
|
|
1166
|
+
style: u.chipsCut && o.elsewhere !== !0 ? { flexShrink: A + 1 } : void 0,
|
|
1167
|
+
...u.chipsCut && o.elsewhere !== !0 ? { title: o.text, "aria-label": o.text } : {},
|
|
1163
1168
|
children: o.content
|
|
1164
1169
|
},
|
|
1165
1170
|
o.id
|
|
1166
1171
|
)),
|
|
1167
|
-
/* @__PURE__ */
|
|
1168
|
-
we.map(
|
|
1169
|
-
ne !== null ?
|
|
1170
|
-
ye ? /* @__PURE__ */
|
|
1171
|
-
/* @__PURE__ */
|
|
1172
|
+
/* @__PURE__ */ h("div", { className: "cms-section-header__actions", role: "toolbar", "aria-label": e, onKeyDown: ae, children: [
|
|
1173
|
+
we.map(O),
|
|
1174
|
+
ne !== null ? O(ne) : null,
|
|
1175
|
+
ye ? /* @__PURE__ */ h("span", { className: H("cms-section-header__primary", de !== null && "cms-section-header__primary--split"), children: [
|
|
1176
|
+
/* @__PURE__ */ h(
|
|
1172
1177
|
"button",
|
|
1173
1178
|
{
|
|
1174
1179
|
type: "button",
|
|
1175
|
-
className:
|
|
1180
|
+
className: H("cms-button", "cms-button--primary", u.primaryBare && "cms-section-header__primary--bare"),
|
|
1176
1181
|
"data-action": "primary",
|
|
1177
|
-
"aria-label":
|
|
1182
|
+
"aria-label": u.primaryBare ? a.label : void 0,
|
|
1178
1183
|
"aria-disabled": be ? "true" : void 0,
|
|
1179
|
-
"aria-describedby": ie !== void 0 ?
|
|
1180
|
-
title:
|
|
1184
|
+
"aria-describedby": ie !== void 0 ? T : void 0,
|
|
1185
|
+
title: u.primaryBare && ie === void 0 ? a.label : void 0,
|
|
1181
1186
|
...Se(Ae),
|
|
1182
|
-
...We(Ae, ie !== void 0,
|
|
1187
|
+
...We(Ae, ie !== void 0, T),
|
|
1183
1188
|
onClick: (o) => {
|
|
1184
|
-
be ? ie !== void 0 && Fe(Ae, o.currentTarget,
|
|
1189
|
+
be ? ie !== void 0 && Fe(Ae, o.currentTarget, T) : a.onPress();
|
|
1185
1190
|
},
|
|
1186
1191
|
children: [
|
|
1187
1192
|
/* @__PURE__ */ n($, { name: a.icon }),
|
|
1188
|
-
|
|
1193
|
+
u.primaryBare ? null : /* @__PURE__ */ h(ge, { children: [
|
|
1189
1194
|
" ",
|
|
1190
1195
|
/* @__PURE__ */ n("span", { children: a.label })
|
|
1191
1196
|
] })
|
|
@@ -1199,54 +1204,54 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
|
|
|
1199
1204
|
className: "cms-button cms-button--primary cms-section-header__split",
|
|
1200
1205
|
"data-action": "primary-menu",
|
|
1201
1206
|
"aria-haspopup": "menu",
|
|
1202
|
-
"aria-expanded": (
|
|
1207
|
+
"aria-expanded": (i == null ? void 0 : i.which) === "primary",
|
|
1203
1208
|
"aria-label": de.menuLabel,
|
|
1204
1209
|
...Se("primary-menu"),
|
|
1205
1210
|
onClick: (o) => me("primary", o.currentTarget),
|
|
1206
1211
|
children: /* @__PURE__ */ n($, { name: "chevron-down" })
|
|
1207
1212
|
}
|
|
1208
1213
|
) : null,
|
|
1209
|
-
ie !== void 0 ? Ee(
|
|
1214
|
+
ie !== void 0 ? Ee(T, ie, u.primaryBare ? a.label : null) : null
|
|
1210
1215
|
] }) : null,
|
|
1211
1216
|
p ? /* @__PURE__ */ n(
|
|
1212
1217
|
"button",
|
|
1213
1218
|
{
|
|
1214
|
-
ref:
|
|
1219
|
+
ref: w,
|
|
1215
1220
|
type: "button",
|
|
1216
1221
|
className: "cms-section-header__more",
|
|
1217
1222
|
"data-action": "more",
|
|
1218
1223
|
"aria-haspopup": "menu",
|
|
1219
|
-
"aria-expanded": (
|
|
1220
|
-
"aria-label":
|
|
1221
|
-
title:
|
|
1224
|
+
"aria-expanded": (i == null ? void 0 : i.which) === "more",
|
|
1225
|
+
"aria-label": c,
|
|
1226
|
+
title: c,
|
|
1222
1227
|
...Se("more"),
|
|
1223
1228
|
onClick: (o) => me("more", o.currentTarget),
|
|
1224
1229
|
children: /* @__PURE__ */ n($, { name: "more" })
|
|
1225
1230
|
}
|
|
1226
1231
|
) : null
|
|
1227
1232
|
] }),
|
|
1228
|
-
/* @__PURE__ */
|
|
1233
|
+
/* @__PURE__ */ h("div", { ref: v, className: "cms-section-header__measure", "aria-hidden": "true", children: [
|
|
1229
1234
|
t !== void 0 ? /* @__PURE__ */ n("span", { "data-measure": "lead", children: /* @__PURE__ */ n($, { name: t }) }) : null,
|
|
1230
1235
|
/* @__PURE__ */ n("span", { "data-measure": "title", className: "cms-section-header__title", children: e }),
|
|
1231
1236
|
l !== void 0 ? /* @__PURE__ */ n("span", { "data-measure": "description", className: "cms-section-header__description", children: l }) : null,
|
|
1232
1237
|
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
|
-
|
|
1234
|
-
/* @__PURE__ */
|
|
1238
|
+
F.map((o) => /* @__PURE__ */ h("span", { children: [
|
|
1239
|
+
/* @__PURE__ */ h("span", { "data-measure": "full", "data-measure-id": o.id, className: "cms-button cms-button--quiet cms-section-header__secondary", children: [
|
|
1235
1240
|
o.icon !== null ? /* @__PURE__ */ n($, { name: o.icon, size: 18 }) : null,
|
|
1236
1241
|
/* @__PURE__ */ n("span", { className: "cms-section-header__label", children: o.label })
|
|
1237
1242
|
] }),
|
|
1238
1243
|
/* @__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 })
|
|
1239
1244
|
] }, o.id)),
|
|
1240
|
-
ee ? /* @__PURE__ */
|
|
1241
|
-
/* @__PURE__ */
|
|
1242
|
-
/* @__PURE__ */
|
|
1245
|
+
ee ? /* @__PURE__ */ h(ge, { children: [
|
|
1246
|
+
/* @__PURE__ */ h("span", { "data-measure": "primary", className: "cms-section-header__primary", children: [
|
|
1247
|
+
/* @__PURE__ */ h("span", { className: "cms-button cms-button--primary", children: [
|
|
1243
1248
|
/* @__PURE__ */ n($, { name: a.icon }),
|
|
1244
1249
|
" ",
|
|
1245
1250
|
/* @__PURE__ */ n("span", { children: a.label })
|
|
1246
1251
|
] }),
|
|
1247
1252
|
de !== null ? /* @__PURE__ */ n("span", { className: "cms-button cms-button--primary cms-section-header__split", children: /* @__PURE__ */ n($, { name: "chevron-down" }) }) : null
|
|
1248
1253
|
] }),
|
|
1249
|
-
/* @__PURE__ */
|
|
1254
|
+
/* @__PURE__ */ h("span", { "data-measure": "primary-icon", className: "cms-section-header__primary", children: [
|
|
1250
1255
|
/* @__PURE__ */ n("span", { className: "cms-button cms-button--primary cms-section-header__primary--bare", children: /* @__PURE__ */ n($, { name: a.icon }) }),
|
|
1251
1256
|
de !== null ? /* @__PURE__ */ n("span", { className: "cms-button cms-button--primary cms-section-header__split", children: /* @__PURE__ */ n($, { name: "chevron-down" }) }) : null
|
|
1252
1257
|
] })
|
|
@@ -1254,9 +1259,9 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
|
|
|
1254
1259
|
/* @__PURE__ */ n("span", { "data-measure": "more", className: "cms-section-header__more", children: /* @__PURE__ */ n($, { name: "more" }) })
|
|
1255
1260
|
] })
|
|
1256
1261
|
] }),
|
|
1257
|
-
|
|
1258
|
-
de !== null ? /* @__PURE__ */ n(Ke, { at: (
|
|
1259
|
-
/* @__PURE__ */ n(Ke, { at: (
|
|
1262
|
+
d != null ? /* @__PURE__ */ n("div", { className: "cms-section-header__context", "data-row": "2", children: d }) : null,
|
|
1263
|
+
de !== null ? /* @__PURE__ */ n(Ke, { at: (i == null ? void 0 : i.which) === "primary" ? i : null, items: oe, onClose: () => g(null), label: de.menuLabel }) : null,
|
|
1264
|
+
/* @__PURE__ */ n(Ke, { at: (i == null ? void 0 : i.which) === "more" ? i : null, items: q, onClose: () => g(null), label: c })
|
|
1260
1265
|
] });
|
|
1261
1266
|
}
|
|
1262
1267
|
function pt(e) {
|
|
@@ -1264,15 +1269,15 @@ function pt(e) {
|
|
|
1264
1269
|
for (const l of e) l.overflow !== void 0 && l.overflow !== 0 && t.set(l.overflow, [...t.get(l.overflow) ?? [], l.id]);
|
|
1265
1270
|
return [...t.entries()].sort(([l], [s]) => l - s).map(([, l]) => l);
|
|
1266
1271
|
}
|
|
1267
|
-
function al({ head: e, children: t, className: l, scrollRef: s, onScroll: a, bodyProps:
|
|
1268
|
-
return /* @__PURE__ */
|
|
1272
|
+
function al({ head: e, children: t, className: l, scrollRef: s, onScroll: a, bodyProps: r }) {
|
|
1273
|
+
return /* @__PURE__ */ h("div", { className: H("cms-column", l), children: [
|
|
1269
1274
|
e == null ? null : /* @__PURE__ */ n("div", { className: "cms-column__head", children: e }),
|
|
1270
|
-
/* @__PURE__ */ n("div", { ...
|
|
1275
|
+
/* @__PURE__ */ n("div", { ...r, className: H("cms-column__body", r == null ? void 0 : r.className), ref: s, onScroll: a, children: t })
|
|
1271
1276
|
] });
|
|
1272
1277
|
}
|
|
1273
1278
|
function rl({ title: e, scope: t, actions: l, backLink: s }) {
|
|
1274
|
-
return /* @__PURE__ */
|
|
1275
|
-
s ? /* @__PURE__ */
|
|
1279
|
+
return /* @__PURE__ */ h("header", { className: "cms-page-header", children: [
|
|
1280
|
+
s ? /* @__PURE__ */ h(
|
|
1276
1281
|
"a",
|
|
1277
1282
|
{
|
|
1278
1283
|
className: "cms-page-header__back",
|
|
@@ -1287,8 +1292,8 @@ function rl({ title: e, scope: t, actions: l, backLink: s }) {
|
|
|
1287
1292
|
]
|
|
1288
1293
|
}
|
|
1289
1294
|
) : null,
|
|
1290
|
-
/* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1295
|
+
/* @__PURE__ */ h("div", { className: "cms-page-header__row", children: [
|
|
1296
|
+
/* @__PURE__ */ h("div", { className: "cms-page-header__titles", children: [
|
|
1292
1297
|
/* @__PURE__ */ n("h1", { className: "cms-page-header__title", children: e }),
|
|
1293
1298
|
t != null ? /* @__PURE__ */ n("p", { className: "cms-page-header__scope", children: t }) : null
|
|
1294
1299
|
] }),
|
|
@@ -1297,42 +1302,42 @@ function rl({ title: e, scope: t, actions: l, backLink: s }) {
|
|
|
1297
1302
|
] });
|
|
1298
1303
|
}
|
|
1299
1304
|
function il({ tabs: e, active: t, onSelect: l, label: s }) {
|
|
1300
|
-
const a =
|
|
1301
|
-
var
|
|
1302
|
-
const
|
|
1305
|
+
const a = z([]), r = (m, c) => {
|
|
1306
|
+
var g;
|
|
1307
|
+
const d = e.length - 1, b = m.key === "ArrowRight" ? c === d ? 0 : c + 1 : m.key === "ArrowLeft" ? c === 0 ? d : c - 1 : m.key === "Home" ? 0 : m.key === "End" ? d : null;
|
|
1303
1308
|
if (b === null) return;
|
|
1304
|
-
|
|
1305
|
-
const
|
|
1306
|
-
|
|
1309
|
+
m.preventDefault();
|
|
1310
|
+
const i = e[b];
|
|
1311
|
+
i && (l(i.id), (g = a.current[b]) == null || g.focus());
|
|
1307
1312
|
};
|
|
1308
|
-
return /* @__PURE__ */ n("div", { className: "cms-tabs", role: "tablist", "aria-label": s, children: e.map((
|
|
1309
|
-
const
|
|
1310
|
-
return /* @__PURE__ */
|
|
1313
|
+
return /* @__PURE__ */ n("div", { className: "cms-tabs", role: "tablist", "aria-label": s, children: e.map((m, c) => {
|
|
1314
|
+
const d = m.id === t;
|
|
1315
|
+
return /* @__PURE__ */ h(
|
|
1311
1316
|
"button",
|
|
1312
1317
|
{
|
|
1313
1318
|
ref: (b) => {
|
|
1314
|
-
a.current[
|
|
1319
|
+
a.current[c] = b;
|
|
1315
1320
|
},
|
|
1316
1321
|
type: "button",
|
|
1317
1322
|
role: "tab",
|
|
1318
|
-
className:
|
|
1319
|
-
"aria-selected":
|
|
1320
|
-
tabIndex:
|
|
1321
|
-
onClick: () => l(
|
|
1322
|
-
onKeyDown: (b) =>
|
|
1323
|
+
className: H("cms-tab", d && "is-active"),
|
|
1324
|
+
"aria-selected": d,
|
|
1325
|
+
tabIndex: d ? 0 : -1,
|
|
1326
|
+
onClick: () => l(m.id),
|
|
1327
|
+
onKeyDown: (b) => r(b, c),
|
|
1323
1328
|
children: [
|
|
1324
|
-
|
|
1325
|
-
|
|
1329
|
+
m.label,
|
|
1330
|
+
m.count !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-tab__count", children: m.count }) : null
|
|
1326
1331
|
]
|
|
1327
1332
|
},
|
|
1328
|
-
|
|
1333
|
+
m.id
|
|
1329
1334
|
);
|
|
1330
1335
|
}) });
|
|
1331
1336
|
}
|
|
1332
1337
|
function bt(e) {
|
|
1333
1338
|
const t = e.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), l = (a) => {
|
|
1334
|
-
var
|
|
1335
|
-
return (
|
|
1339
|
+
var r;
|
|
1340
|
+
return (r = a == null ? void 0 : a.match(/[\p{L}\p{N}]/u)) == null ? void 0 : r[0];
|
|
1336
1341
|
};
|
|
1337
1342
|
return (t.length > 1 ? [l(t[0]), l(t[t.length - 1])] : [l(t[0])]).filter(Boolean).join("").toUpperCase();
|
|
1338
1343
|
}
|
|
@@ -1342,19 +1347,19 @@ function _t(e) {
|
|
|
1342
1347
|
t = t * 31 + (l.codePointAt(0) ?? 0) >>> 0;
|
|
1343
1348
|
return t % 6 + 1;
|
|
1344
1349
|
}
|
|
1345
|
-
function Ye({ name: e, pictureUrl: t, presence: l, connection: s, deleted: a = !1, placeholder:
|
|
1346
|
-
const b = a ||
|
|
1347
|
-
return /* @__PURE__ */
|
|
1350
|
+
function Ye({ name: e, pictureUrl: t, presence: l, connection: s, deleted: a = !1, placeholder: r = !1, size: m = 32, tintSeed: c, unnamedLabel: d }) {
|
|
1351
|
+
const b = a || r, i = bt(e) || "?", g = e.trim() === "" ? (d == null ? void 0 : d.trim()) || "?" : e, u = s !== void 0 ? `is-${s.state === "offline" ? "disconnected" : s.state}` : l === void 0 ? null : `is-${l === "busy" ? "away" : l}`, k = s !== void 0 ? `${g}, ${s.label}` : l ? `${g}, ${l}` : g;
|
|
1352
|
+
return /* @__PURE__ */ h(
|
|
1348
1353
|
"span",
|
|
1349
1354
|
{
|
|
1350
|
-
className:
|
|
1351
|
-
style: { width:
|
|
1355
|
+
className: H("cms-avatar", b ? "cms-avatar--deleted" : `cms-avatar--tint-${_t(c ?? e)}`),
|
|
1356
|
+
style: { width: m, height: m, fontSize: Math.round(m * 0.4) },
|
|
1352
1357
|
role: "img",
|
|
1353
|
-
"aria-label":
|
|
1358
|
+
"aria-label": k,
|
|
1354
1359
|
...s === void 0 ? {} : { title: s.label },
|
|
1355
1360
|
children: [
|
|
1356
|
-
b ? /* @__PURE__ */ n($, { name: "user", size: Math.round(
|
|
1357
|
-
|
|
1361
|
+
b ? /* @__PURE__ */ n($, { name: "user", size: Math.round(m * 0.6) }) : t ? /* @__PURE__ */ n("img", { src: t, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ n("span", { "aria-hidden": "true", children: i }),
|
|
1362
|
+
u === null ? null : /* @__PURE__ */ n("span", { className: H("cms-avatar__presence", u), "aria-hidden": "true" })
|
|
1358
1363
|
]
|
|
1359
1364
|
}
|
|
1360
1365
|
);
|
|
@@ -1384,26 +1389,26 @@ function wt(e) {
|
|
|
1384
1389
|
} catch {
|
|
1385
1390
|
}
|
|
1386
1391
|
}
|
|
1387
|
-
function yt({ storageKey: e, value: t, default: l, min: s, max: a, step:
|
|
1388
|
-
const
|
|
1389
|
-
const
|
|
1390
|
-
return v
|
|
1391
|
-
}),
|
|
1392
|
+
function yt({ storageKey: e, value: t, default: l, min: s, max: a, step: r = 16, label: m, onChange: c, className: d, style: b }) {
|
|
1393
|
+
const i = Math.max(s, a), g = (v) => Math.round(Math.min(Math.max(v, s), i)), [u, k] = I(() => {
|
|
1394
|
+
const v = e === void 0 ? null : tn(e);
|
|
1395
|
+
return g(v ?? l);
|
|
1396
|
+
}), f = g(t ?? u), x = z(null), [L, S] = I(!1);
|
|
1392
1397
|
$e(() => {
|
|
1393
1398
|
if (e === void 0) return;
|
|
1394
|
-
const
|
|
1395
|
-
if (
|
|
1396
|
-
const
|
|
1397
|
-
(t === void 0 ||
|
|
1399
|
+
const v = tn(e);
|
|
1400
|
+
if (v === null) return;
|
|
1401
|
+
const w = g(v);
|
|
1402
|
+
(t === void 0 || w !== g(t)) && (k(w), c(w, !0));
|
|
1398
1403
|
}, []), $e(() => {
|
|
1399
|
-
t !== void 0 &&
|
|
1400
|
-
}, [t, s,
|
|
1401
|
-
const
|
|
1402
|
-
const
|
|
1403
|
-
|
|
1404
|
-
},
|
|
1405
|
-
const
|
|
1406
|
-
|
|
1404
|
+
t !== void 0 && g(t) !== t && c(g(t), !0);
|
|
1405
|
+
}, [t, s, i]);
|
|
1406
|
+
const _ = (v, w) => {
|
|
1407
|
+
const T = g(v);
|
|
1408
|
+
k(T), w && gt(e, T), c(T, w);
|
|
1409
|
+
}, N = () => {
|
|
1410
|
+
const v = x.current;
|
|
1411
|
+
x.current = null, S(!1), v !== null && v.last !== v.from && _(v.last, !0);
|
|
1407
1412
|
};
|
|
1408
1413
|
return /* @__PURE__ */ n(
|
|
1409
1414
|
"div",
|
|
@@ -1411,87 +1416,87 @@ function yt({ storageKey: e, value: t, default: l, min: s, max: a, step: i = 16,
|
|
|
1411
1416
|
role: "separator",
|
|
1412
1417
|
tabIndex: 0,
|
|
1413
1418
|
"aria-orientation": "vertical",
|
|
1414
|
-
"aria-label":
|
|
1415
|
-
"aria-valuenow":
|
|
1419
|
+
"aria-label": m,
|
|
1420
|
+
"aria-valuenow": f,
|
|
1416
1421
|
"aria-valuemin": s,
|
|
1417
|
-
"aria-valuemax":
|
|
1418
|
-
className:
|
|
1422
|
+
"aria-valuemax": i,
|
|
1423
|
+
className: H("cms-splitter", L && "is-dragging", f <= s && "is-at-min", f >= i && "is-at-max", d),
|
|
1419
1424
|
style: b,
|
|
1420
|
-
onPointerDown: (
|
|
1421
|
-
var
|
|
1422
|
-
if (
|
|
1423
|
-
|
|
1424
|
-
const
|
|
1425
|
-
|
|
1425
|
+
onPointerDown: (v) => {
|
|
1426
|
+
var T, B;
|
|
1427
|
+
if (v.button > 0) return;
|
|
1428
|
+
v.preventDefault(), (B = (T = v.currentTarget).setPointerCapture) == null || B.call(T, v.pointerId);
|
|
1429
|
+
const w = getComputedStyle(v.currentTarget).direction === "rtl" ? -1 : 1;
|
|
1430
|
+
x.current = { x: v.clientX, from: f, last: f, sign: w }, S(!0);
|
|
1426
1431
|
},
|
|
1427
|
-
onPointerMove: (
|
|
1428
|
-
const
|
|
1429
|
-
|
|
1432
|
+
onPointerMove: (v) => {
|
|
1433
|
+
const w = x.current;
|
|
1434
|
+
w === null || !Number.isFinite(v.clientX) || (w.last = g(w.from + w.sign * (v.clientX - w.x)), _(w.last, !1));
|
|
1430
1435
|
},
|
|
1431
|
-
onPointerUp:
|
|
1432
|
-
onPointerCancel:
|
|
1436
|
+
onPointerUp: N,
|
|
1437
|
+
onPointerCancel: N,
|
|
1433
1438
|
onDoubleClick: () => {
|
|
1434
1439
|
wt(e);
|
|
1435
|
-
const
|
|
1436
|
-
|
|
1440
|
+
const v = g(l);
|
|
1441
|
+
k(v), c(v, !0);
|
|
1437
1442
|
},
|
|
1438
|
-
onKeyDown: (
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1443
|
+
onKeyDown: (v) => {
|
|
1444
|
+
const w = v.shiftKey ? vt : r, T = getComputedStyle(v.currentTarget).direction === "rtl" ? -1 : 1, B = v.key === "ArrowLeft" ? f - T * w : v.key === "ArrowRight" ? f + T * w : v.key === "Home" ? s : v.key === "End" ? i : null;
|
|
1445
|
+
B !== null && (v.preventDefault(), _(B, !0));
|
|
1441
1446
|
}
|
|
1442
1447
|
}
|
|
1443
1448
|
);
|
|
1444
1449
|
}
|
|
1445
1450
|
function Nt({ count: e, label: t, max: l = 99 }) {
|
|
1446
|
-
return e <= 0 ? null : /* @__PURE__ */
|
|
1451
|
+
return e <= 0 ? null : /* @__PURE__ */ h("span", { className: "cms-badge", children: [
|
|
1447
1452
|
/* @__PURE__ */ n("span", { "aria-hidden": "true", children: e > l ? `${l}+` : e }),
|
|
1448
1453
|
/* @__PURE__ */ n("span", { className: "cms-visually-hidden", children: t })
|
|
1449
1454
|
] });
|
|
1450
1455
|
}
|
|
1451
|
-
function
|
|
1452
|
-
return /* @__PURE__ */
|
|
1453
|
-
/* @__PURE__ */
|
|
1456
|
+
function ol({ product: e, mark: t, rail: l, active: s, onNavigate: a, server: r, search: m, account: c, children: d, railLabel: b = "Sections" }) {
|
|
1457
|
+
return /* @__PURE__ */ h("div", { className: "cms-shell", children: [
|
|
1458
|
+
/* @__PURE__ */ h("nav", { className: "cms-shell__rail", "aria-label": b, children: [
|
|
1454
1459
|
/* @__PURE__ */ n("span", { className: "cms-shell__mark", "aria-hidden": "true", children: t }),
|
|
1455
|
-
/* @__PURE__ */ n("ul", { className: "cms-shell__items", children: l.map((
|
|
1456
|
-
const
|
|
1457
|
-
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */
|
|
1460
|
+
/* @__PURE__ */ n("ul", { className: "cms-shell__items", children: l.map((i) => {
|
|
1461
|
+
const g = i.id === s;
|
|
1462
|
+
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
1458
1463
|
"a",
|
|
1459
1464
|
{
|
|
1460
|
-
href:
|
|
1461
|
-
className:
|
|
1462
|
-
"aria-current":
|
|
1463
|
-
title:
|
|
1464
|
-
onClick: (
|
|
1465
|
-
a && (
|
|
1465
|
+
href: i.href,
|
|
1466
|
+
className: H("cms-shell__item", g && "is-active"),
|
|
1467
|
+
"aria-current": g ? "page" : void 0,
|
|
1468
|
+
title: i.label,
|
|
1469
|
+
onClick: (u) => {
|
|
1470
|
+
a && (u.preventDefault(), a(i.id));
|
|
1466
1471
|
},
|
|
1467
1472
|
children: [
|
|
1468
|
-
/* @__PURE__ */
|
|
1469
|
-
/* @__PURE__ */ n($, { name:
|
|
1470
|
-
|
|
1473
|
+
/* @__PURE__ */ h("span", { className: "cms-shell__icon", children: [
|
|
1474
|
+
/* @__PURE__ */ n($, { name: i.icon, size: 22 }),
|
|
1475
|
+
i.badge ? /* @__PURE__ */ n(Nt, { count: i.badge.count, label: i.badge.label }) : null
|
|
1471
1476
|
] }),
|
|
1472
|
-
/* @__PURE__ */ n("span", { className: "cms-shell__label", children:
|
|
1477
|
+
/* @__PURE__ */ n("span", { className: "cms-shell__label", children: i.label })
|
|
1473
1478
|
]
|
|
1474
1479
|
}
|
|
1475
|
-
) },
|
|
1480
|
+
) }, i.id);
|
|
1476
1481
|
}) })
|
|
1477
1482
|
] }),
|
|
1478
|
-
/* @__PURE__ */
|
|
1483
|
+
/* @__PURE__ */ h("header", { className: "cms-shell__top", children: [
|
|
1479
1484
|
/* @__PURE__ */ n("span", { className: "cms-shell__product", children: e }),
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1485
|
+
r != null ? /* @__PURE__ */ n("div", { className: "cms-shell__server", children: r }) : null,
|
|
1486
|
+
m != null ? /* @__PURE__ */ n("div", { className: "cms-shell__search", children: m }) : null,
|
|
1487
|
+
c != null ? /* @__PURE__ */ n("div", { className: "cms-shell__account", children: c }) : null
|
|
1483
1488
|
] }),
|
|
1484
|
-
/* @__PURE__ */ n("main", { className: "cms-shell__main", children:
|
|
1489
|
+
/* @__PURE__ */ n("main", { className: "cms-shell__main", children: d })
|
|
1485
1490
|
] });
|
|
1486
1491
|
}
|
|
1487
|
-
function
|
|
1488
|
-
return /* @__PURE__ */
|
|
1492
|
+
function cl({ label: e, placeholder: t, value: l, onChange: s, onSearch: a }) {
|
|
1493
|
+
return /* @__PURE__ */ h(
|
|
1489
1494
|
"form",
|
|
1490
1495
|
{
|
|
1491
1496
|
role: "search",
|
|
1492
1497
|
className: "cms-search",
|
|
1493
|
-
onSubmit: (
|
|
1494
|
-
|
|
1498
|
+
onSubmit: (r) => {
|
|
1499
|
+
r.preventDefault(), a == null || a(l);
|
|
1495
1500
|
},
|
|
1496
1501
|
children: [
|
|
1497
1502
|
/* @__PURE__ */ n($, { name: "search", size: 18 }),
|
|
@@ -1503,7 +1508,7 @@ function ol({ label: e, placeholder: t, value: l, onChange: s, onSearch: a }) {
|
|
|
1503
1508
|
"aria-label": e,
|
|
1504
1509
|
placeholder: t,
|
|
1505
1510
|
value: l,
|
|
1506
|
-
onChange: (
|
|
1511
|
+
onChange: (r) => s(r.target.value)
|
|
1507
1512
|
}
|
|
1508
1513
|
)
|
|
1509
1514
|
]
|
|
@@ -1511,64 +1516,64 @@ function ol({ label: e, placeholder: t, value: l, onChange: s, onSearch: a }) {
|
|
|
1511
1516
|
);
|
|
1512
1517
|
}
|
|
1513
1518
|
function kt(e, t, l) {
|
|
1514
|
-
const s = e.map((
|
|
1515
|
-
let a = s.reduce((
|
|
1516
|
-
for (let
|
|
1517
|
-
const
|
|
1518
|
-
s[
|
|
1519
|
+
const s = e.map((r) => Math.min(Math.max(r.width, r.min), r.max));
|
|
1520
|
+
let a = s.reduce((r, m) => r + m, 0) + l - t;
|
|
1521
|
+
for (let r = s.length - 1; r >= 0 && a > 0; r -= 1) {
|
|
1522
|
+
const m = Math.min(a, s[r] - e[r].min);
|
|
1523
|
+
s[r] = s[r] - m, a -= m;
|
|
1519
1524
|
}
|
|
1520
1525
|
return s;
|
|
1521
1526
|
}
|
|
1522
|
-
function dl({ panes: e, active: t, back: l, sizes: s, lastMin: a = 360, onResize:
|
|
1523
|
-
const
|
|
1527
|
+
function dl({ panes: e, active: t, back: l, sizes: s, lastMin: a = 360, onResize: r, storageKey: m }) {
|
|
1528
|
+
const c = Math.min(Math.max(t ?? e.length - 1, 0), e.length - 1), d = z(null), [b, i] = I(0), g = (s ?? []).slice(0, e.length - 1), [u, k] = I(() => m === void 0 ? [] : g.map((v, w) => tn(`${m}:${String(w)}`) ?? void 0)), [f, x] = I(!1), L = g.map((v, w) => v !== void 0 && u[w] !== void 0 ? { ...v, width: u[w] } : v), S = L.length === e.length - 1 && L.every((v) => v !== void 0);
|
|
1524
1529
|
$e(() => {
|
|
1525
|
-
const
|
|
1526
|
-
if (
|
|
1527
|
-
const
|
|
1528
|
-
if (
|
|
1529
|
-
const
|
|
1530
|
-
return
|
|
1531
|
-
}, [
|
|
1532
|
-
const
|
|
1533
|
-
[`--split-pane-${String(
|
|
1534
|
-
[`--split-pane-end-${String(
|
|
1530
|
+
const v = d.current;
|
|
1531
|
+
if (v === null || !S) return;
|
|
1532
|
+
const w = () => i(v.clientWidth);
|
|
1533
|
+
if (w(), typeof ResizeObserver > "u") return;
|
|
1534
|
+
const T = new ResizeObserver(w);
|
|
1535
|
+
return T.observe(v), () => T.disconnect();
|
|
1536
|
+
}, [S]);
|
|
1537
|
+
const _ = S ? kt(L, b > 0 ? b : Number.POSITIVE_INFINITY, a) : [], N = S ? Object.fromEntries(_.flatMap((v, w) => [
|
|
1538
|
+
[`--split-pane-${String(w)}`, `${String(v)}px`],
|
|
1539
|
+
[`--split-pane-end-${String(w)}`, `${String(_.slice(0, w + 1).reduce((T, B) => T + B, 0))}px`]
|
|
1535
1540
|
])) : void 0;
|
|
1536
|
-
return /* @__PURE__ */
|
|
1541
|
+
return /* @__PURE__ */ h(
|
|
1537
1542
|
"div",
|
|
1538
1543
|
{
|
|
1539
|
-
ref:
|
|
1540
|
-
className:
|
|
1541
|
-
"data-active":
|
|
1542
|
-
style:
|
|
1544
|
+
ref: d,
|
|
1545
|
+
className: H("cms-panes", e.length === 3 ? "cms-panes--three" : "cms-panes--two", S && "cms-panes--sized", f && "is-resizing"),
|
|
1546
|
+
"data-active": c,
|
|
1547
|
+
style: N,
|
|
1543
1548
|
children: [
|
|
1544
|
-
e.map((
|
|
1545
|
-
|
|
1549
|
+
e.map((v, w) => /* @__PURE__ */ h("section", { className: "cms-panes__pane", "aria-label": v.label, "data-offset": c - w, children: [
|
|
1550
|
+
w === c && l ? /* @__PURE__ */ h("a", { className: "cms-panes__back", href: l.href, children: [
|
|
1546
1551
|
/* @__PURE__ */ n($, { name: "chevron-left", size: 18 }),
|
|
1547
1552
|
l.label
|
|
1548
1553
|
] }) : null,
|
|
1549
|
-
|
|
1550
|
-
] },
|
|
1551
|
-
|
|
1552
|
-
const
|
|
1554
|
+
v.content
|
|
1555
|
+
] }, v.label)),
|
|
1556
|
+
S ? L.map((v, w) => {
|
|
1557
|
+
const T = _.reduce((F, M, R) => R === w ? F : F + M, 0), B = Math.max(v.min, Math.min(v.max, b > 0 ? b - T - a : v.max));
|
|
1553
1558
|
return /* @__PURE__ */ n(
|
|
1554
1559
|
yt,
|
|
1555
1560
|
{
|
|
1556
|
-
...
|
|
1557
|
-
value:
|
|
1558
|
-
default:
|
|
1559
|
-
min:
|
|
1560
|
-
max:
|
|
1561
|
-
label:
|
|
1561
|
+
...m === void 0 ? {} : { storageKey: `${m}:${String(w)}` },
|
|
1562
|
+
value: _[w],
|
|
1563
|
+
default: v.reset,
|
|
1564
|
+
min: v.min,
|
|
1565
|
+
max: B,
|
|
1566
|
+
label: v.label,
|
|
1562
1567
|
className: "cms-panes__splitter",
|
|
1563
|
-
style: { "--split-at": `var(--split-pane-end-${String(
|
|
1564
|
-
onChange: (
|
|
1565
|
-
|
|
1566
|
-
const
|
|
1567
|
-
return
|
|
1568
|
-
}),
|
|
1568
|
+
style: { "--split-at": `var(--split-pane-end-${String(w)})` },
|
|
1569
|
+
onChange: (F, M) => {
|
|
1570
|
+
m !== void 0 && k((R) => {
|
|
1571
|
+
const U = [...R];
|
|
1572
|
+
return U[w] = F, U;
|
|
1573
|
+
}), x(!M), r == null || r(w, F, M);
|
|
1569
1574
|
}
|
|
1570
1575
|
},
|
|
1571
|
-
|
|
1576
|
+
v.label
|
|
1572
1577
|
);
|
|
1573
1578
|
}) : null
|
|
1574
1579
|
]
|
|
@@ -1576,11 +1581,11 @@ function dl({ panes: e, active: t, back: l, sizes: s, lastMin: a = 360, onResize
|
|
|
1576
1581
|
);
|
|
1577
1582
|
}
|
|
1578
1583
|
const xt = { attachment: "Has an attachment", unread: "Unread" };
|
|
1579
|
-
function ul({ from: e, fromPlaceholder: t = !1, subject: l, preview: s, time: a, unread:
|
|
1580
|
-
const
|
|
1581
|
-
return /* @__PURE__ */
|
|
1582
|
-
b !== void 0 ? /* @__PURE__ */
|
|
1583
|
-
|
|
1584
|
+
function ul({ from: e, fromPlaceholder: t = !1, subject: l, preview: s, time: a, unread: r, hasAttachment: m, selected: c, onOpen: d, check: b, selecting: i, labels: g }) {
|
|
1585
|
+
const u = qe(xt, g), k = /* @__PURE__ */ n(Ye, { name: e, size: 40, placeholder: t });
|
|
1586
|
+
return /* @__PURE__ */ h("div", { className: H("cms-mail-row", r && "is-unread", c && "is-selected", i && "is-selecting", (b == null ? void 0 : b.checked) && "is-checked"), children: [
|
|
1587
|
+
b !== void 0 ? /* @__PURE__ */ h("span", { className: "cms-mail-row__lead", children: [
|
|
1588
|
+
k,
|
|
1584
1589
|
/* @__PURE__ */ n(
|
|
1585
1590
|
"input",
|
|
1586
1591
|
{
|
|
@@ -1593,34 +1598,34 @@ function ul({ from: e, fromPlaceholder: t = !1, subject: l, preview: s, time: a,
|
|
|
1593
1598
|
"aria-label": b.label,
|
|
1594
1599
|
onChange: () => {
|
|
1595
1600
|
},
|
|
1596
|
-
onClick: (
|
|
1597
|
-
if (
|
|
1598
|
-
|
|
1601
|
+
onClick: (f) => {
|
|
1602
|
+
if (f.stopPropagation(), b.pending) {
|
|
1603
|
+
f.preventDefault();
|
|
1599
1604
|
return;
|
|
1600
1605
|
}
|
|
1601
|
-
b.onCheck({ shift:
|
|
1606
|
+
b.onCheck({ shift: f.shiftKey, toggle: f.ctrlKey || f.metaKey });
|
|
1602
1607
|
}
|
|
1603
1608
|
}
|
|
1604
1609
|
)
|
|
1605
1610
|
] }) : null,
|
|
1606
|
-
/* @__PURE__ */
|
|
1611
|
+
/* @__PURE__ */ h(
|
|
1607
1612
|
"button",
|
|
1608
1613
|
{
|
|
1609
1614
|
type: "button",
|
|
1610
1615
|
className: "cms-mail-row__open",
|
|
1611
|
-
"aria-current":
|
|
1612
|
-
onClick:
|
|
1616
|
+
"aria-current": c ? "true" : void 0,
|
|
1617
|
+
onClick: d,
|
|
1613
1618
|
children: [
|
|
1614
|
-
b === void 0 ?
|
|
1615
|
-
/* @__PURE__ */
|
|
1616
|
-
/* @__PURE__ */
|
|
1619
|
+
b === void 0 ? k : null,
|
|
1620
|
+
/* @__PURE__ */ h("span", { className: "cms-mail-row__body", children: [
|
|
1621
|
+
/* @__PURE__ */ h("span", { className: "cms-mail-row__line", children: [
|
|
1617
1622
|
/* @__PURE__ */ n("span", { className: "cms-mail-row__from", children: e }),
|
|
1618
|
-
|
|
1623
|
+
m ? /* @__PURE__ */ n($, { name: "paperclip", size: 16, label: u.attachment }) : null,
|
|
1619
1624
|
/* @__PURE__ */ n("span", { className: "cms-mail-row__time", children: a })
|
|
1620
1625
|
] }),
|
|
1621
|
-
/* @__PURE__ */
|
|
1626
|
+
/* @__PURE__ */ h("span", { className: "cms-mail-row__line", children: [
|
|
1622
1627
|
/* @__PURE__ */ n("span", { className: "cms-mail-row__subject", children: l }),
|
|
1623
|
-
|
|
1628
|
+
r ? /* @__PURE__ */ n("span", { className: "cms-mail-row__dot", role: "img", "aria-label": u.unread }) : null
|
|
1624
1629
|
] }),
|
|
1625
1630
|
/* @__PURE__ */ n("span", { className: "cms-mail-row__preview", children: s })
|
|
1626
1631
|
] })
|
|
@@ -1630,42 +1635,42 @@ function ul({ from: e, fromPlaceholder: t = !1, subject: l, preview: s, time: a,
|
|
|
1630
1635
|
] });
|
|
1631
1636
|
}
|
|
1632
1637
|
function ml({ direction: e, children: t, time: l, read: s, readLabel: a = "Read" }) {
|
|
1633
|
-
return /* @__PURE__ */
|
|
1638
|
+
return /* @__PURE__ */ h("div", { className: H("cms-bubble", `cms-bubble--${e}`), children: [
|
|
1634
1639
|
/* @__PURE__ */ n("div", { className: "cms-bubble__text", children: t }),
|
|
1635
|
-
/* @__PURE__ */
|
|
1640
|
+
/* @__PURE__ */ h("div", { className: "cms-bubble__meta", children: [
|
|
1636
1641
|
l,
|
|
1637
|
-
e === "out" && s ? /* @__PURE__ */
|
|
1642
|
+
e === "out" && s ? /* @__PURE__ */ h(ge, { children: [
|
|
1638
1643
|
" · ",
|
|
1639
1644
|
a
|
|
1640
1645
|
] }) : null
|
|
1641
1646
|
] })
|
|
1642
1647
|
] });
|
|
1643
1648
|
}
|
|
1644
|
-
function hl({ label: e, value: t, onChange: l, onSend: s, onAttach: a, placeholder:
|
|
1645
|
-
const
|
|
1646
|
-
|
|
1647
|
-
},
|
|
1648
|
-
return /* @__PURE__ */
|
|
1649
|
-
/* @__PURE__ */ n("label", { htmlFor:
|
|
1650
|
-
|
|
1649
|
+
function hl({ label: e, value: t, onChange: l, onSend: s, onAttach: a, placeholder: r, variant: m = "chat", sendLabel: c = "Send", attachLabel: d = "Attach a file", leading: b, canSend: i }) {
|
|
1650
|
+
const g = he(), u = i ?? t.trim() !== "", k = (x) => {
|
|
1651
|
+
x.preventDefault(), u && s();
|
|
1652
|
+
}, f = a ? /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": d, onClick: a, children: /* @__PURE__ */ n($, { name: "paperclip" }) }) : null;
|
|
1653
|
+
return /* @__PURE__ */ h("form", { className: H("cms-composer", `cms-composer--${m}`), onSubmit: k, children: [
|
|
1654
|
+
/* @__PURE__ */ n("label", { htmlFor: g, className: m === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: e }),
|
|
1655
|
+
m === "chat" ? f : null,
|
|
1651
1656
|
/* @__PURE__ */ n(
|
|
1652
1657
|
"textarea",
|
|
1653
1658
|
{
|
|
1654
|
-
id:
|
|
1659
|
+
id: g,
|
|
1655
1660
|
className: "cms-composer__input",
|
|
1656
|
-
rows:
|
|
1657
|
-
placeholder:
|
|
1661
|
+
rows: m === "reply" ? 3 : 1,
|
|
1662
|
+
placeholder: r,
|
|
1658
1663
|
value: t,
|
|
1659
|
-
onChange: (
|
|
1660
|
-
onKeyDown: (
|
|
1661
|
-
|
|
1664
|
+
onChange: (x) => l(x.target.value),
|
|
1665
|
+
onKeyDown: (x) => {
|
|
1666
|
+
x.nativeEvent.isComposing || x.keyCode === 229 || m === "chat" && x.key === "Enter" && !x.shiftKey && (x.preventDefault(), u && s());
|
|
1662
1667
|
}
|
|
1663
1668
|
}
|
|
1664
1669
|
),
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1670
|
+
m === "reply" && b !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-composer__leading", children: b }) : null,
|
|
1671
|
+
m === "reply" ? f : null,
|
|
1672
|
+
m === "chat" ? /* @__PURE__ */ n("button", { type: "submit", className: "cms-composer__send-round", "aria-label": c, disabled: !u, children: /* @__PURE__ */ n($, { name: "send" }) }) : /* @__PURE__ */ h("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !u, children: [
|
|
1673
|
+
c,
|
|
1669
1674
|
" ",
|
|
1670
1675
|
/* @__PURE__ */ n($, { name: "send", size: 18 })
|
|
1671
1676
|
] })
|
|
@@ -1692,24 +1697,24 @@ const mn = {
|
|
|
1692
1697
|
onCallWith: (e) => `On a call with ${e}`,
|
|
1693
1698
|
returnToCall: "Return to call"
|
|
1694
1699
|
};
|
|
1695
|
-
function fl({ name: e, namePlaceholder: t = !1, media: l, onAccept: s, onDecline: a, labels:
|
|
1696
|
-
const
|
|
1697
|
-
return /* @__PURE__ */
|
|
1700
|
+
function fl({ name: e, namePlaceholder: t = !1, media: l, onAccept: s, onDecline: a, labels: r }) {
|
|
1701
|
+
const m = qe(mn, r), c = l === "video" ? m.incomingVideo : m.incomingAudio;
|
|
1702
|
+
return /* @__PURE__ */ h("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": m.incomingFrom(c, e), children: [
|
|
1698
1703
|
/* @__PURE__ */ n("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ n(Ye, { name: e, size: 112, placeholder: t }) }),
|
|
1699
1704
|
/* @__PURE__ */ n("p", { className: "cms-call-incoming__name", children: e }),
|
|
1700
|
-
/* @__PURE__ */ n("p", { className: "cms-call-incoming__what", children:
|
|
1701
|
-
/* @__PURE__ */
|
|
1702
|
-
/* @__PURE__ */ n(Ue, { icon: "phone-off", label:
|
|
1703
|
-
/* @__PURE__ */ n(Ue, { icon: "phone", label:
|
|
1705
|
+
/* @__PURE__ */ n("p", { className: "cms-call-incoming__what", children: c }),
|
|
1706
|
+
/* @__PURE__ */ h("div", { className: "cms-call-incoming__actions", children: [
|
|
1707
|
+
/* @__PURE__ */ n(Ue, { icon: "phone-off", label: m.decline, tone: "hang-up", onClick: a }),
|
|
1708
|
+
/* @__PURE__ */ n(Ue, { icon: "phone", label: m.accept, tone: "accept", onClick: s })
|
|
1704
1709
|
] })
|
|
1705
1710
|
] });
|
|
1706
1711
|
}
|
|
1707
1712
|
function Ue({ icon: e, label: t, onClick: l, tone: s = "plain", pressed: a }) {
|
|
1708
|
-
return /* @__PURE__ */
|
|
1713
|
+
return /* @__PURE__ */ h(
|
|
1709
1714
|
"button",
|
|
1710
1715
|
{
|
|
1711
1716
|
type: "button",
|
|
1712
|
-
className:
|
|
1717
|
+
className: H("cms-call-button", `cms-call-button--${s}`, a && "is-pressed"),
|
|
1713
1718
|
"aria-pressed": a,
|
|
1714
1719
|
onClick: l,
|
|
1715
1720
|
children: [
|
|
@@ -1719,61 +1724,61 @@ function Ue({ icon: e, label: t, onClick: l, tone: s = "plain", pressed: a }) {
|
|
|
1719
1724
|
}
|
|
1720
1725
|
);
|
|
1721
1726
|
}
|
|
1722
|
-
function pl({ name: e, duration: t, connection: l, you: s, muted: a, speaker:
|
|
1723
|
-
const
|
|
1724
|
-
return /* @__PURE__ */
|
|
1725
|
-
/* @__PURE__ */
|
|
1727
|
+
function pl({ name: e, duration: t, connection: l, you: s, muted: a, speaker: r, onToggleMute: m, onToggleSpeaker: c, onAddPerson: d, onChat: b, onHangUp: i, labels: g }) {
|
|
1728
|
+
const u = qe(mn, g);
|
|
1729
|
+
return /* @__PURE__ */ h("section", { className: "cms-call-panel", "aria-label": u.callWith(e), children: [
|
|
1730
|
+
/* @__PURE__ */ h("div", { className: "cms-call-panel__head", children: [
|
|
1726
1731
|
/* @__PURE__ */ n(Ye, { name: e, size: 64 }),
|
|
1727
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ h("div", { className: "cms-call-panel__who", children: [
|
|
1728
1733
|
/* @__PURE__ */ n("p", { className: "cms-call-panel__name", children: e }),
|
|
1729
|
-
/* @__PURE__ */ n("p", { className: "cms-call-panel__time", "aria-label":
|
|
1734
|
+
/* @__PURE__ */ n("p", { className: "cms-call-panel__time", "aria-label": u.callTime(t), children: t })
|
|
1730
1735
|
] }),
|
|
1731
|
-
/* @__PURE__ */ n("span", { className:
|
|
1736
|
+
/* @__PURE__ */ n("span", { className: H("cms-pill", l === "good" ? "cms-pill--success" : "cms-pill--warning"), children: l === "good" ? u.goodConnection : u.poorConnection })
|
|
1732
1737
|
] }),
|
|
1733
|
-
/* @__PURE__ */
|
|
1738
|
+
/* @__PURE__ */ h("div", { className: "cms-call-panel__you", children: [
|
|
1734
1739
|
/* @__PURE__ */ n(Ye, { name: s.name, size: 36 }),
|
|
1735
|
-
/* @__PURE__ */ n("span", { children:
|
|
1736
|
-
s.speaking ? /* @__PURE__ */ n("span", { className: "cms-call-panel__level", role: "img", "aria-label":
|
|
1740
|
+
/* @__PURE__ */ n("span", { children: u.you }),
|
|
1741
|
+
s.speaking ? /* @__PURE__ */ n("span", { className: "cms-call-panel__level", role: "img", "aria-label": u.speaking }) : null
|
|
1737
1742
|
] }),
|
|
1738
|
-
/* @__PURE__ */
|
|
1739
|
-
/* @__PURE__ */ n(Ue, { icon: "mic", label: a ?
|
|
1740
|
-
/* @__PURE__ */ n(Ue, { icon: "speaker", label:
|
|
1741
|
-
|
|
1742
|
-
b ? /* @__PURE__ */ n(Ue, { icon: "chat", label:
|
|
1743
|
-
/* @__PURE__ */ n(Ue, { icon: "phone-off", label:
|
|
1743
|
+
/* @__PURE__ */ h("div", { className: "cms-call-panel__controls", children: [
|
|
1744
|
+
/* @__PURE__ */ n(Ue, { icon: "mic", label: a ? u.unmute : u.mute, pressed: a, onClick: m }),
|
|
1745
|
+
/* @__PURE__ */ n(Ue, { icon: "speaker", label: u.speaker, pressed: r, onClick: c }),
|
|
1746
|
+
d ? /* @__PURE__ */ n(Ue, { icon: "user-plus", label: u.addPerson, onClick: d }) : null,
|
|
1747
|
+
b ? /* @__PURE__ */ n(Ue, { icon: "chat", label: u.chat, onClick: b }) : null,
|
|
1748
|
+
/* @__PURE__ */ n(Ue, { icon: "phone-off", label: u.hangUp, tone: "hang-up", onClick: i })
|
|
1744
1749
|
] })
|
|
1745
1750
|
] });
|
|
1746
1751
|
}
|
|
1747
|
-
function bl({ name: e, duration: t, muted: l, onToggleMute: s, onReturn: a, onHangUp:
|
|
1748
|
-
const
|
|
1749
|
-
return /* @__PURE__ */
|
|
1752
|
+
function bl({ name: e, duration: t, muted: l, onToggleMute: s, onReturn: a, onHangUp: r, labels: m }) {
|
|
1753
|
+
const c = qe(mn, m);
|
|
1754
|
+
return /* @__PURE__ */ h("section", { className: "cms-call-bar", "aria-label": c.callWith(e), children: [
|
|
1750
1755
|
/* @__PURE__ */ n("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
|
|
1751
|
-
/* @__PURE__ */ n("span", { className: "cms-call-bar__name", children:
|
|
1756
|
+
/* @__PURE__ */ n("span", { className: "cms-call-bar__name", children: c.onCallWith(e) }),
|
|
1752
1757
|
/* @__PURE__ */ n("span", { className: "cms-call-bar__time", children: t }),
|
|
1753
|
-
/* @__PURE__ */
|
|
1754
|
-
/* @__PURE__ */ n("button", { type: "button", className: "cms-call-bar__icon", "aria-label": l ?
|
|
1755
|
-
/* @__PURE__ */ n("button", { type: "button", className: "cms-button cms-button--primary", onClick: a, children:
|
|
1756
|
-
/* @__PURE__ */ n("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label":
|
|
1758
|
+
/* @__PURE__ */ h("span", { className: "cms-call-bar__actions", children: [
|
|
1759
|
+
/* @__PURE__ */ n("button", { type: "button", className: "cms-call-bar__icon", "aria-label": l ? c.unmute : c.mute, "aria-pressed": l, onClick: s, children: /* @__PURE__ */ n($, { name: "mic" }) }),
|
|
1760
|
+
/* @__PURE__ */ n("button", { type: "button", className: "cms-button cms-button--primary", onClick: a, children: c.returnToCall }),
|
|
1761
|
+
/* @__PURE__ */ n("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": c.hangUp, onClick: r, children: /* @__PURE__ */ n($, { name: "phone-off" }) })
|
|
1757
1762
|
] })
|
|
1758
1763
|
] });
|
|
1759
1764
|
}
|
|
1760
|
-
function _l({ mark: e, product: t, headline: l, lead: s, features: a = [], children:
|
|
1761
|
-
return /* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
/* @__PURE__ */
|
|
1765
|
+
function _l({ mark: e, product: t, headline: l, lead: s, features: a = [], children: r }) {
|
|
1766
|
+
return /* @__PURE__ */ h("div", { className: "cms-signin", children: [
|
|
1767
|
+
/* @__PURE__ */ h("aside", { className: "cms-signin__brand", children: [
|
|
1768
|
+
/* @__PURE__ */ h("p", { className: "cms-signin__logo", children: [
|
|
1764
1769
|
/* @__PURE__ */ n("span", { className: "cms-signin__mark", "aria-hidden": "true", children: e }),
|
|
1765
1770
|
t
|
|
1766
1771
|
] }),
|
|
1767
|
-
/* @__PURE__ */
|
|
1772
|
+
/* @__PURE__ */ h("div", { className: "cms-signin__pitch", children: [
|
|
1768
1773
|
/* @__PURE__ */ n("p", { className: "cms-signin__headline", children: l }),
|
|
1769
1774
|
/* @__PURE__ */ n("p", { className: "cms-signin__lead", children: s }),
|
|
1770
|
-
a.length ? /* @__PURE__ */ n("ul", { className: "cms-signin__features", children: a.map((
|
|
1771
|
-
/* @__PURE__ */ n($, { name:
|
|
1772
|
-
|
|
1773
|
-
] },
|
|
1775
|
+
a.length ? /* @__PURE__ */ n("ul", { className: "cms-signin__features", children: a.map((m) => /* @__PURE__ */ h("li", { children: [
|
|
1776
|
+
/* @__PURE__ */ n($, { name: m.icon, size: 18 }),
|
|
1777
|
+
m.label
|
|
1778
|
+
] }, m.label)) }) : null
|
|
1774
1779
|
] })
|
|
1775
1780
|
] }),
|
|
1776
|
-
/* @__PURE__ */ n("main", { className: "cms-signin__form", children:
|
|
1781
|
+
/* @__PURE__ */ n("main", { className: "cms-signin__form", children: r })
|
|
1777
1782
|
] });
|
|
1778
1783
|
}
|
|
1779
1784
|
const Mt = {
|
|
@@ -1788,52 +1793,52 @@ const Mt = {
|
|
|
1788
1793
|
newHere: "New here?",
|
|
1789
1794
|
create: "Create an account"
|
|
1790
1795
|
};
|
|
1791
|
-
function vl({ server: e, onSubmit: t, forgotHref: l, createHref: s, error: a, busy:
|
|
1792
|
-
const
|
|
1793
|
-
return /* @__PURE__ */
|
|
1794
|
-
|
|
1795
|
-
}, "aria-describedby": a ? `${
|
|
1796
|
-
/* @__PURE__ */ n("h1", { className: "cms-signin-form__title", children:
|
|
1797
|
-
/* @__PURE__ */
|
|
1796
|
+
function vl({ server: e, onSubmit: t, forgotHref: l, createHref: s, error: a, busy: r, labels: m }) {
|
|
1797
|
+
const c = qe(Mt, m), d = he(), [b, i] = I(""), [g, u] = I(""), [k, f] = I(!1);
|
|
1798
|
+
return /* @__PURE__ */ h("form", { className: "cms-signin-form", onSubmit: (L) => {
|
|
1799
|
+
L.preventDefault(), t(b, g);
|
|
1800
|
+
}, "aria-describedby": a ? `${d}-error` : void 0, children: [
|
|
1801
|
+
/* @__PURE__ */ n("h1", { className: "cms-signin-form__title", children: c.title }),
|
|
1802
|
+
/* @__PURE__ */ h("p", { className: "cms-signin-form__server", children: [
|
|
1798
1803
|
/* @__PURE__ */ n($, { name: "server", size: 18 }),
|
|
1799
1804
|
e
|
|
1800
1805
|
] }),
|
|
1801
|
-
/* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${
|
|
1806
|
+
/* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${d}-identifier`, children: c.identifier }),
|
|
1802
1807
|
/* @__PURE__ */ n(
|
|
1803
1808
|
"input",
|
|
1804
1809
|
{
|
|
1805
|
-
id: `${
|
|
1810
|
+
id: `${d}-identifier`,
|
|
1806
1811
|
className: "cms-signin-form__input",
|
|
1807
1812
|
type: "text",
|
|
1808
1813
|
autoComplete: "username",
|
|
1809
|
-
placeholder:
|
|
1814
|
+
placeholder: c.identifierPlaceholder,
|
|
1810
1815
|
value: b,
|
|
1811
|
-
onChange: (
|
|
1816
|
+
onChange: (L) => i(L.target.value),
|
|
1812
1817
|
required: !0
|
|
1813
1818
|
}
|
|
1814
1819
|
),
|
|
1815
|
-
/* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${
|
|
1816
|
-
/* @__PURE__ */
|
|
1820
|
+
/* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${d}-password`, children: c.password }),
|
|
1821
|
+
/* @__PURE__ */ h("span", { className: "cms-signin-form__password", children: [
|
|
1817
1822
|
/* @__PURE__ */ n(
|
|
1818
1823
|
"input",
|
|
1819
1824
|
{
|
|
1820
|
-
id: `${
|
|
1825
|
+
id: `${d}-password`,
|
|
1821
1826
|
className: "cms-signin-form__input",
|
|
1822
|
-
type:
|
|
1827
|
+
type: k ? "text" : "password",
|
|
1823
1828
|
autoComplete: "current-password",
|
|
1824
|
-
value:
|
|
1825
|
-
onChange: (
|
|
1829
|
+
value: g,
|
|
1830
|
+
onChange: (L) => u(L.target.value),
|
|
1826
1831
|
required: !0
|
|
1827
1832
|
}
|
|
1828
1833
|
),
|
|
1829
|
-
/* @__PURE__ */ n("button", { type: "button", className: "cms-signin-form__show", "aria-pressed":
|
|
1834
|
+
/* @__PURE__ */ n("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": k, onClick: () => f((L) => !L), children: k ? c.hide : c.show })
|
|
1830
1835
|
] }),
|
|
1831
|
-
l ? /* @__PURE__ */ n("a", { className: "cms-signin-form__forgot", href: l, children:
|
|
1832
|
-
a ? /* @__PURE__ */ n("p", { id: `${
|
|
1833
|
-
/* @__PURE__ */ n("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled:
|
|
1834
|
-
s ? /* @__PURE__ */
|
|
1835
|
-
/* @__PURE__ */ n("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ n("span", { children:
|
|
1836
|
-
/* @__PURE__ */ n("a", { className: "cms-button cms-signin-form__create", href: s, children:
|
|
1836
|
+
l ? /* @__PURE__ */ n("a", { className: "cms-signin-form__forgot", href: l, children: c.forgot }) : null,
|
|
1837
|
+
a ? /* @__PURE__ */ n("p", { id: `${d}-error`, className: "cms-signin-form__error", role: "alert", children: a }) : null,
|
|
1838
|
+
/* @__PURE__ */ n("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: r, "aria-busy": r || void 0, children: c.submit }),
|
|
1839
|
+
s ? /* @__PURE__ */ h(ge, { children: [
|
|
1840
|
+
/* @__PURE__ */ n("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ n("span", { children: c.newHere }) }),
|
|
1841
|
+
/* @__PURE__ */ n("a", { className: "cms-button cms-signin-form__create", href: s, children: c.create })
|
|
1837
1842
|
] }) : null
|
|
1838
1843
|
] });
|
|
1839
1844
|
}
|
|
@@ -1866,8 +1871,8 @@ function fn(e, t) {
|
|
|
1866
1871
|
return e.find((l) => l.id === t) ?? e[0];
|
|
1867
1872
|
}
|
|
1868
1873
|
function Dn(e) {
|
|
1869
|
-
var
|
|
1870
|
-
const t =
|
|
1874
|
+
var r;
|
|
1875
|
+
const t = z(null), l = (e == null ? void 0 : e.value) ?? null, a = e === void 0 || e.options.some((m) => m.id === e.value) ? null : ((r = fn(e.options, e.defaultValue)) == null ? void 0 : r.id) ?? null;
|
|
1871
1876
|
Q(() => {
|
|
1872
1877
|
a === null ? t.current = null : t.current !== l && (t.current = l, e == null || e.onChange(a));
|
|
1873
1878
|
}, [a, l]);
|
|
@@ -1876,33 +1881,33 @@ function In({ iconOnly: e = !1, onOpenChange: t, ...l }) {
|
|
|
1876
1881
|
return l.options.length < 2 ? null : /* @__PURE__ */ n(St, { ...l, iconOnly: e, onOpenChange: t });
|
|
1877
1882
|
}
|
|
1878
1883
|
function St({ iconOnly: e, onOpenChange: t, ...l }) {
|
|
1879
|
-
const [s, a] =
|
|
1880
|
-
Q(() => (t == null || t(
|
|
1881
|
-
const
|
|
1882
|
-
const
|
|
1883
|
-
a({ x:
|
|
1884
|
+
const [s, a] = I(null), r = Ie(() => a(null), []), m = z(!1), c = s !== null;
|
|
1885
|
+
Q(() => (t == null || t(c), () => t == null ? void 0 : t(!1)), [c, t]);
|
|
1886
|
+
const d = An(l), b = d !== null && !e, i = Tn(l), g = (u, k) => {
|
|
1887
|
+
const f = u.getBoundingClientRect();
|
|
1888
|
+
a({ x: f.left, y: f.bottom + 4, focus: k });
|
|
1884
1889
|
};
|
|
1885
|
-
return /* @__PURE__ */
|
|
1890
|
+
return /* @__PURE__ */ h(ge, { children: [
|
|
1886
1891
|
/* @__PURE__ */ n(
|
|
1887
1892
|
"button",
|
|
1888
1893
|
{
|
|
1889
1894
|
type: "button",
|
|
1890
|
-
className:
|
|
1895
|
+
className: H("cms-filter-menu", d !== null && "cms-filter-menu--active", b && "cms-filter-menu--named"),
|
|
1891
1896
|
"aria-haspopup": "menu",
|
|
1892
|
-
"aria-expanded":
|
|
1893
|
-
"aria-label":
|
|
1894
|
-
title:
|
|
1897
|
+
"aria-expanded": c,
|
|
1898
|
+
"aria-label": i,
|
|
1899
|
+
title: i,
|
|
1895
1900
|
onMouseDown: () => {
|
|
1896
|
-
|
|
1901
|
+
m.current = c;
|
|
1897
1902
|
},
|
|
1898
|
-
onClick: (
|
|
1899
|
-
|
|
1903
|
+
onClick: (u) => {
|
|
1904
|
+
c || m.current ? r() : g(u.currentTarget, "current"), m.current = !1;
|
|
1900
1905
|
},
|
|
1901
|
-
onKeyDown: (
|
|
1902
|
-
|
|
1906
|
+
onKeyDown: (u) => {
|
|
1907
|
+
m.current = !1, (u.key === "ArrowDown" || u.key === "ArrowUp") && (u.preventDefault(), g(u.currentTarget, u.key === "ArrowUp" ? "last" : "current"));
|
|
1903
1908
|
},
|
|
1904
|
-
children: b ? /* @__PURE__ */
|
|
1905
|
-
/* @__PURE__ */ n("span", { className: "cms-filter-menu__choice", children:
|
|
1909
|
+
children: b ? /* @__PURE__ */ h(ge, { children: [
|
|
1910
|
+
/* @__PURE__ */ n("span", { className: "cms-filter-menu__choice", children: d.label }),
|
|
1906
1911
|
/* @__PURE__ */ n($, { name: "chevron-down", size: 16 })
|
|
1907
1912
|
] }) : /* @__PURE__ */ n($, { name: "funnel" })
|
|
1908
1913
|
}
|
|
@@ -1912,7 +1917,7 @@ function St({ iconOnly: e, onOpenChange: t, ...l }) {
|
|
|
1912
1917
|
{
|
|
1913
1918
|
at: s,
|
|
1914
1919
|
items: Ln(l),
|
|
1915
|
-
onClose:
|
|
1920
|
+
onClose: r,
|
|
1916
1921
|
label: l.label,
|
|
1917
1922
|
focus: s == null ? void 0 : s.focus
|
|
1918
1923
|
}
|
|
@@ -1923,7 +1928,7 @@ function Et(e) {
|
|
|
1923
1928
|
return Dn(e), /* @__PURE__ */ n(In, { ...e });
|
|
1924
1929
|
}
|
|
1925
1930
|
function gl({ leading: e, name: t, filter: l }) {
|
|
1926
|
-
return /* @__PURE__ */
|
|
1931
|
+
return /* @__PURE__ */ h("div", { className: "cms-list-head", children: [
|
|
1927
1932
|
e != null ? /* @__PURE__ */ n("span", { className: "cms-list-head__leading", children: e }) : null,
|
|
1928
1933
|
/* @__PURE__ */ n("h2", { className: "cms-list-head__name", title: t, children: t }),
|
|
1929
1934
|
l !== void 0 ? /* @__PURE__ */ n(Et, { ...l }) : null
|
|
@@ -1940,72 +1945,72 @@ function Tt(e) {
|
|
|
1940
1945
|
for (const l of e) l.overflow !== void 0 && l.overflow !== 0 && t.set(l.overflow, [...t.get(l.overflow) ?? [], l.id]);
|
|
1941
1946
|
return [...t.entries()].sort(([l], [s]) => l - s).map(([, l]) => l);
|
|
1942
1947
|
}
|
|
1943
|
-
function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leading:
|
|
1948
|
+
function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leading: r }) {
|
|
1944
1949
|
var q;
|
|
1945
|
-
const
|
|
1946
|
-
const p =
|
|
1947
|
-
if (p === null ||
|
|
1950
|
+
const m = t.filter((p) => p.entries === void 0 || p.entries.length > 0), c = z(null), d = z(null), b = z(null), [i, g] = I(kn), [u, k] = I(null), [f, x] = I("first"), [L, S] = I(null), [_, N] = I(null), v = At(m), w = v.flat(), T = ((q = w.find((p) => p.primary === !0 && p.overflow !== 0)) == null ? void 0 : q.id) ?? null, B = Tt(m.filter((p) => p.id !== T)), F = w.filter((p) => p.overflow === 0), M = w.filter((p) => p.overflow !== 0), R = F.length === 1 ? F[0] ?? null : null, U = JSON.stringify([m.map((p) => [p.id, p.label, p.icon, p.group, p.overflow ?? null, p.primary === !0, p.entries !== void 0]), s ?? "", r !== void 0]), j = (p) => /* @__PURE__ */ new Set([...F.filter((D) => D !== R || p.size > 0).map((D) => D.id), ...p]), K = Ie(() => {
|
|
1951
|
+
const p = c.current, D = d.current;
|
|
1952
|
+
if (p === null || D === null) return;
|
|
1948
1953
|
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
|
|
1950
|
-
return ((
|
|
1951
|
-
}, Se = me('[data-measure="leading"]'), We = me('[data-measure="separator"]'), Fe = me('[data-measure="more"]'), Te = (A,
|
|
1952
|
-
const
|
|
1953
|
-
return Se + ke.reduce((He, V) => He + Te(V.id, !A.has(V.id)), 0) + We * Math.max(0, J.length - 1) + (
|
|
1954
|
-
},
|
|
1955
|
-
let
|
|
1956
|
-
if (Ee(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= ae)
|
|
1954
|
+
var C;
|
|
1955
|
+
return ((C = D.querySelector(A)) == null ? void 0 : C.getBoundingClientRect().width) ?? 0;
|
|
1956
|
+
}, Se = me('[data-measure="leading"]'), We = me('[data-measure="separator"]'), Fe = me('[data-measure="more"]'), Te = (A, C) => me(`[data-measure="${C ? "full" : "icon"}"][data-measure-action="${CSS.escape(A)}"]`), Ee = (A, C) => {
|
|
1957
|
+
const P = j(C), le = R !== null && !P.has(R.id) ? R : null, J = v.map((He) => He.filter((V) => !P.has(V.id) && V !== le)).filter((He) => He.length > 0), ke = [...J.flat(), ...le !== null ? [le] : []], Re = ke.length + (J.length - 1) + (P.size > 0 ? 1 : 0) + (Se > 0 ? 1 : 0);
|
|
1958
|
+
return Se + ke.reduce((He, V) => He + Te(V.id, !A.has(V.id)), 0) + We * Math.max(0, J.length - 1) + (P.size > 0 ? Fe : 0) + ue * Math.max(0, Re - 1);
|
|
1959
|
+
}, O = M.filter((A) => A.id !== T && !B.some((C) => C.includes(A.id))).map((A) => A.id), X = [...B, ...[...O].reverse().map((A) => [A]), ...T !== null ? [[T]] : []], Ne = [...R !== null ? [[R.id]] : [], ...X];
|
|
1960
|
+
let ce = null;
|
|
1961
|
+
if (Ee(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= ae) ce = kn;
|
|
1957
1962
|
else {
|
|
1958
1963
|
const A = /* @__PURE__ */ new Set();
|
|
1959
|
-
for (const
|
|
1960
|
-
for (const
|
|
1964
|
+
for (const C of Ne) {
|
|
1965
|
+
for (const P of C) A.add(P);
|
|
1961
1966
|
if (Ee(A, /* @__PURE__ */ new Set()) <= ae) {
|
|
1962
|
-
|
|
1967
|
+
ce = { bare: A, hidden: /* @__PURE__ */ new Set() };
|
|
1963
1968
|
break;
|
|
1964
1969
|
}
|
|
1965
1970
|
}
|
|
1966
1971
|
}
|
|
1967
|
-
if (
|
|
1968
|
-
const A = new Set(Ne.flat()),
|
|
1972
|
+
if (ce === null) {
|
|
1973
|
+
const A = new Set(Ne.flat()), C = /* @__PURE__ */ new Set(), P = () => C.size + F.length >= 2;
|
|
1969
1974
|
for (const le of X) {
|
|
1970
|
-
for (const J of le)
|
|
1971
|
-
if (
|
|
1975
|
+
for (const J of le) C.add(J);
|
|
1976
|
+
if (P() && Ee(A, C) <= ae) break;
|
|
1972
1977
|
}
|
|
1973
|
-
|
|
1978
|
+
P() || C.clear(), ce = { bare: A, hidden: C };
|
|
1974
1979
|
}
|
|
1975
|
-
const o =
|
|
1976
|
-
|
|
1977
|
-
}, [
|
|
1980
|
+
const o = ce;
|
|
1981
|
+
g((A) => xn(A.bare, o.bare) && xn(A.hidden, o.hidden) ? A : o);
|
|
1982
|
+
}, [U]);
|
|
1978
1983
|
$e(K, [K]), Q(() => {
|
|
1979
|
-
const p =
|
|
1984
|
+
const p = c.current;
|
|
1980
1985
|
if (p === null || typeof ResizeObserver > "u") return;
|
|
1981
|
-
const
|
|
1982
|
-
return
|
|
1986
|
+
const D = new ResizeObserver(() => K());
|
|
1987
|
+
return D.observe(p), () => D.disconnect();
|
|
1983
1988
|
}, [K]), Q(() => {
|
|
1984
1989
|
const p = typeof document > "u" ? void 0 : document.fonts;
|
|
1985
1990
|
if (p === void 0) return;
|
|
1986
|
-
let
|
|
1991
|
+
let D = !0;
|
|
1987
1992
|
const Z = () => {
|
|
1988
|
-
|
|
1993
|
+
D && K();
|
|
1989
1994
|
};
|
|
1990
1995
|
return p.ready.then(Z), p.addEventListener("loadingdone", Z), () => {
|
|
1991
|
-
|
|
1996
|
+
D = !1, p.removeEventListener("loadingdone", Z);
|
|
1992
1997
|
};
|
|
1993
1998
|
}, [K]);
|
|
1994
|
-
const G = j(
|
|
1995
|
-
...
|
|
1996
|
-
...de.filter((p) =>
|
|
1997
|
-
...G.size > 0 ?
|
|
1998
|
-
].filter((p) => p !== void 0 && G.has(p.id)), fe = new Set(
|
|
1999
|
+
const G = j(i.hidden), Y = R !== null && !G.has(R.id) ? R : null, ee = (p) => G.has(p.id) || p === Y, be = [...v.map((p) => p.filter((D) => !ee(D))).filter((p) => p.length > 0).flat(), ...Y !== null ? [Y] : []], oe = (p) => w.find((D) => D.id === p), de = [...B.flat(), ...M.filter((p) => p.id !== T && !B.some((D) => D.includes(p.id))).map((p) => p.id).reverse()], Ce = [
|
|
2000
|
+
...T !== null && i.hidden.has(T) ? [oe(T)] : [],
|
|
2001
|
+
...de.filter((p) => i.hidden.has(p)).map(oe),
|
|
2002
|
+
...G.size > 0 ? F : []
|
|
2003
|
+
].filter((p) => p !== void 0 && G.has(p.id)), fe = new Set(M.filter((p) => !B.some((D) => D.includes(p.id))).map((p) => p.id)), te = [...be.map((p) => p.id), ...Ce.length > 0 ? ["more"] : []], pe = L !== null && te.includes(L) ? L : te[0] ?? null, _e = (p) => {
|
|
1999
2004
|
var ae, me;
|
|
2000
|
-
const
|
|
2005
|
+
const D = te.indexOf(pe ?? "");
|
|
2001
2006
|
let Z = null;
|
|
2002
|
-
if (p.key === "ArrowRight" ? Z = Math.min(te.length - 1,
|
|
2007
|
+
if (p.key === "ArrowRight" ? Z = Math.min(te.length - 1, D + 1) : p.key === "ArrowLeft" ? Z = Math.max(0, D - 1) : p.key === "Home" ? Z = 0 : p.key === "End" ? Z = te.length - 1 : p.key === "Escape" && N(pe), Z === null) return;
|
|
2003
2008
|
p.preventDefault();
|
|
2004
2009
|
const ue = te[Z] ?? null;
|
|
2005
|
-
|
|
2010
|
+
S(ue), (me = (ae = c.current) == null ? void 0 : ae.querySelector(`[data-stop="${CSS.escape(ue ?? "")}"]`)) == null || me.focus();
|
|
2006
2011
|
}, we = Ce.map((p) => ({
|
|
2007
2012
|
id: p.id,
|
|
2008
|
-
label: /* @__PURE__ */
|
|
2013
|
+
label: /* @__PURE__ */ h(ge, { children: [
|
|
2009
2014
|
/* @__PURE__ */ n(je, { name: p.icon }),
|
|
2010
2015
|
p.label
|
|
2011
2016
|
] }),
|
|
@@ -2018,12 +2023,12 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
|
|
|
2018
2023
|
l(p.id);
|
|
2019
2024
|
return;
|
|
2020
2025
|
}
|
|
2021
|
-
const
|
|
2022
|
-
|
|
2026
|
+
const D = (Z = b.current) == null ? void 0 : Z.getBoundingClientRect();
|
|
2027
|
+
x("first"), k({ which: p.id, x: (D == null ? void 0 : D.left) ?? 0, y: (D == null ? void 0 : D.bottom) ?? 0 });
|
|
2023
2028
|
}
|
|
2024
|
-
})), ne =
|
|
2029
|
+
})), ne = u === null || u.which === "more" ? void 0 : w.find((p) => p.id === u.which), ye = ((ne == null ? void 0 : ne.entries) ?? []).map((p) => ({
|
|
2025
2030
|
id: p.id,
|
|
2026
|
-
label: /* @__PURE__ */
|
|
2031
|
+
label: /* @__PURE__ */ h(ge, { children: [
|
|
2027
2032
|
p.icon !== void 0 ? /* @__PURE__ */ n(je, { name: p.icon }) : null,
|
|
2028
2033
|
p.label
|
|
2029
2034
|
] }),
|
|
@@ -2032,49 +2037,49 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
|
|
|
2032
2037
|
onSelect: () => {
|
|
2033
2038
|
p.disabled || l(p.id);
|
|
2034
2039
|
}
|
|
2035
|
-
})),
|
|
2036
|
-
const ue =
|
|
2037
|
-
|
|
2038
|
-
}, E =
|
|
2040
|
+
})), y = (p, D, Z) => {
|
|
2041
|
+
const ue = D.getBoundingClientRect();
|
|
2042
|
+
x(Z), k({ which: p, x: ue.left, y: ue.bottom });
|
|
2043
|
+
}, E = M.length + (R !== null ? 1 : 0), W = (p) => /* @__PURE__ */ n(
|
|
2039
2044
|
Lt,
|
|
2040
2045
|
{
|
|
2041
2046
|
action: p,
|
|
2042
|
-
primary: p.id ===
|
|
2043
|
-
labels: !
|
|
2047
|
+
primary: p.id === T,
|
|
2048
|
+
labels: !i.bare.has(p.id),
|
|
2044
2049
|
overflowed: G.has(p.id),
|
|
2045
2050
|
pinned: fe.has(p.id),
|
|
2046
2051
|
tabbable: pe === p.id,
|
|
2047
|
-
tipOff:
|
|
2048
|
-
menuOpen: (
|
|
2049
|
-
onChoose: (
|
|
2050
|
-
p.entries === void 0 ? l(p.id) : (
|
|
2052
|
+
tipOff: _ === p.id,
|
|
2053
|
+
menuOpen: (u == null ? void 0 : u.which) === p.id,
|
|
2054
|
+
onChoose: (D, Z) => {
|
|
2055
|
+
p.entries === void 0 ? l(p.id) : (u == null ? void 0 : u.which) === p.id && Z === null ? k(null) : y(p.id, D, Z ?? "first");
|
|
2051
2056
|
},
|
|
2052
2057
|
onFocus: () => {
|
|
2053
|
-
|
|
2058
|
+
S(p.id), N(null);
|
|
2054
2059
|
}
|
|
2055
2060
|
},
|
|
2056
2061
|
p.id
|
|
2057
2062
|
);
|
|
2058
|
-
return /* @__PURE__ */
|
|
2063
|
+
return /* @__PURE__ */ h(
|
|
2059
2064
|
"div",
|
|
2060
2065
|
{
|
|
2061
|
-
ref:
|
|
2066
|
+
ref: c,
|
|
2062
2067
|
role: "toolbar",
|
|
2063
2068
|
"aria-label": e,
|
|
2064
|
-
className:
|
|
2069
|
+
className: H(
|
|
2065
2070
|
"cms-pane-toolbar",
|
|
2066
|
-
E > 0 &&
|
|
2067
|
-
|
|
2071
|
+
E > 0 && i.bare.size >= E && "cms-pane-toolbar--labels-hidden",
|
|
2072
|
+
i.bare.size > 0 && i.bare.size < E && "cms-pane-toolbar--labels-partly-hidden"
|
|
2068
2073
|
),
|
|
2069
2074
|
onKeyDown: _e,
|
|
2070
2075
|
children: [
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
const Z = p.filter((ae) => !ee(ae)), ue =
|
|
2074
|
-
return /* @__PURE__ */
|
|
2076
|
+
r !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-pane-toolbar__leading", children: r }) : null,
|
|
2077
|
+
v.map((p, D) => {
|
|
2078
|
+
const Z = p.filter((ae) => !ee(ae)), ue = v.slice(0, D).some((ae) => ae.some((me) => !ee(me)));
|
|
2079
|
+
return /* @__PURE__ */ h("div", { className: "cms-pane-toolbar__group-wrap", children: [
|
|
2075
2080
|
Z.length > 0 && ue ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
|
|
2076
2081
|
/* @__PURE__ */ n("div", { className: "cms-pane-toolbar__group", hidden: Z.length === 0, children: p.filter((ae) => ae !== Y).map((ae) => W(ae)) })
|
|
2077
|
-
] },
|
|
2082
|
+
] }, D);
|
|
2078
2083
|
}),
|
|
2079
2084
|
Y !== null ? /* @__PURE__ */ n("div", { className: "cms-pane-toolbar__group cms-pane-toolbar__lone", children: W(Y) }) : null,
|
|
2080
2085
|
Ce.length > 0 ? /* @__PURE__ */ n(
|
|
@@ -2087,32 +2092,32 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
|
|
|
2087
2092
|
"aria-label": a,
|
|
2088
2093
|
title: a,
|
|
2089
2094
|
"aria-haspopup": "menu",
|
|
2090
|
-
"aria-expanded": (
|
|
2095
|
+
"aria-expanded": (u == null ? void 0 : u.which) === "more",
|
|
2091
2096
|
tabIndex: pe === "more" ? 0 : -1,
|
|
2092
|
-
onFocus: () =>
|
|
2097
|
+
onFocus: () => S("more"),
|
|
2093
2098
|
onClick: (p) => {
|
|
2094
|
-
(
|
|
2099
|
+
(u == null ? void 0 : u.which) === "more" ? k(null) : y("more", p.currentTarget, "first");
|
|
2095
2100
|
},
|
|
2096
2101
|
onKeyDown: (p) => {
|
|
2097
|
-
(p.key === "ArrowDown" || p.key === "ArrowUp") && (p.preventDefault(), p.stopPropagation(),
|
|
2102
|
+
(p.key === "ArrowDown" || p.key === "ArrowUp") && (p.preventDefault(), p.stopPropagation(), y("more", p.currentTarget, p.key === "ArrowUp" ? "last" : "first"));
|
|
2098
2103
|
},
|
|
2099
2104
|
children: /* @__PURE__ */ n($, { name: "more" })
|
|
2100
2105
|
}
|
|
2101
2106
|
) : null,
|
|
2102
2107
|
s !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__status", title: s, children: s }) : null,
|
|
2103
|
-
/* @__PURE__ */ n(Ke, { at: (
|
|
2104
|
-
/* @__PURE__ */ n(Ke, { at: ne !== void 0 ?
|
|
2105
|
-
/* @__PURE__ */
|
|
2106
|
-
|
|
2108
|
+
/* @__PURE__ */ n(Ke, { at: (u == null ? void 0 : u.which) === "more" ? u : null, items: we, onClose: () => k(null), label: a, focus: f }),
|
|
2109
|
+
/* @__PURE__ */ n(Ke, { at: ne !== void 0 ? u : null, items: ye, onClose: () => k(null), label: (ne == null ? void 0 : ne.label) ?? "", focus: f }),
|
|
2110
|
+
/* @__PURE__ */ h("div", { ref: d, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
|
|
2111
|
+
r !== void 0 ? /* @__PURE__ */ n("div", { "data-measure": "leading", children: r }) : null,
|
|
2107
2112
|
/* @__PURE__ */ n("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
|
|
2108
2113
|
/* @__PURE__ */ n("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ n($, { name: "more" }) }),
|
|
2109
|
-
|
|
2110
|
-
/* @__PURE__ */
|
|
2114
|
+
w.map((p) => /* @__PURE__ */ h("span", { children: [
|
|
2115
|
+
/* @__PURE__ */ h("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: [
|
|
2111
2116
|
/* @__PURE__ */ n(je, { name: p.icon }),
|
|
2112
2117
|
/* @__PURE__ */ n("span", { className: "cms-pane-toolbar__label", children: p.label }),
|
|
2113
2118
|
p.entries !== void 0 ? /* @__PURE__ */ n(ln, {}) : null
|
|
2114
2119
|
] }),
|
|
2115
|
-
/* @__PURE__ */
|
|
2120
|
+
/* @__PURE__ */ h("span", { "data-measure": "icon", "data-measure-action": p.id, className: H("cms-pane-toolbar__action", Be(p.icon) !== null && "cms-pane-toolbar__action--bare", p.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
|
|
2116
2121
|
Be(p.icon) !== null ? /* @__PURE__ */ n(je, { name: p.icon }) : /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__label", children: p.label }),
|
|
2117
2122
|
p.entries !== void 0 ? /* @__PURE__ */ n(ln, {}) : null
|
|
2118
2123
|
] })
|
|
@@ -2123,22 +2128,22 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
|
|
|
2123
2128
|
);
|
|
2124
2129
|
}
|
|
2125
2130
|
const Pe = "tip";
|
|
2126
|
-
function Lt({ action: e, primary: t, labels: l, overflowed: s, pinned: a, tabbable:
|
|
2127
|
-
const [
|
|
2131
|
+
function Lt({ action: e, primary: t, labels: l, overflowed: s, pinned: a, tabbable: r, tipOff: m, menuOpen: c, onChoose: d, onFocus: b }) {
|
|
2132
|
+
const [i, g] = I(!1);
|
|
2128
2133
|
Q(() => {
|
|
2129
2134
|
if (!e.busy) {
|
|
2130
|
-
|
|
2135
|
+
g(!1);
|
|
2131
2136
|
return;
|
|
2132
2137
|
}
|
|
2133
|
-
const
|
|
2134
|
-
return () => clearTimeout(
|
|
2138
|
+
const w = setTimeout(() => g(!0), en);
|
|
2139
|
+
return () => clearTimeout(w);
|
|
2135
2140
|
}, [e.busy]);
|
|
2136
|
-
const
|
|
2137
|
-
return /* @__PURE__ */
|
|
2141
|
+
const u = Be(e.icon) === null, k = l || u, f = e.disabled && e.reason ? e.reason : null, x = f ?? (k ? null : e.label), L = he(), [S, _] = I(!1), N = dn(), v = e.entries !== void 0;
|
|
2142
|
+
return /* @__PURE__ */ h(
|
|
2138
2143
|
"button",
|
|
2139
2144
|
{
|
|
2140
2145
|
type: "button",
|
|
2141
|
-
className:
|
|
2146
|
+
className: H("cms-pane-toolbar__action", t && "cms-pane-toolbar__action--primary", !k && "cms-pane-toolbar__action--bare", u && "cms-pane-toolbar__action--text", v && "cms-pane-toolbar__action--menu", e.danger && "is-danger"),
|
|
2142
2147
|
"data-action": e.id,
|
|
2143
2148
|
"data-stop": e.id,
|
|
2144
2149
|
...s ? { "data-overflowed": "" } : {},
|
|
@@ -2147,30 +2152,30 @@ function Lt({ action: e, primary: t, labels: l, overflowed: s, pinned: a, tabbab
|
|
|
2147
2152
|
"aria-label": e.label,
|
|
2148
2153
|
"aria-disabled": e.disabled || void 0,
|
|
2149
2154
|
"aria-busy": e.busy || void 0,
|
|
2150
|
-
...
|
|
2151
|
-
...
|
|
2152
|
-
...
|
|
2153
|
-
...
|
|
2154
|
-
tabIndex:
|
|
2155
|
+
...v ? { "aria-haspopup": "menu", "aria-expanded": c } : {},
|
|
2156
|
+
...f === null ? {} : { "aria-describedby": L },
|
|
2157
|
+
...S && f !== null ? { "data-reason-shown": "" } : {},
|
|
2158
|
+
...N.dismissed(Pe) ? { "data-tip-dismissed": "" } : {},
|
|
2159
|
+
tabIndex: r ? 0 : -1,
|
|
2155
2160
|
onFocus: () => {
|
|
2156
|
-
b(),
|
|
2161
|
+
b(), N.focusIn(Pe);
|
|
2157
2162
|
},
|
|
2158
2163
|
onBlur: () => {
|
|
2159
|
-
|
|
2164
|
+
_(!1), N.focusOut(Pe);
|
|
2160
2165
|
},
|
|
2161
|
-
onMouseEnter: () =>
|
|
2162
|
-
onMouseLeave: () =>
|
|
2163
|
-
onKeyDown: (
|
|
2164
|
-
|
|
2166
|
+
onMouseEnter: () => N.pointerIn(Pe),
|
|
2167
|
+
onMouseLeave: () => N.pointerOut(Pe),
|
|
2168
|
+
onKeyDown: (w) => {
|
|
2169
|
+
w.key === "Escape" && (_(!1), N.dismiss(Pe)), v && (w.key === "ArrowDown" || w.key === "ArrowUp") && (w.preventDefault(), f !== null ? _(!0) : !e.disabled && !e.busy && d(w.currentTarget, w.key === "ArrowUp" ? "last" : "first"));
|
|
2165
2170
|
},
|
|
2166
|
-
onClick: (
|
|
2167
|
-
|
|
2171
|
+
onClick: (w) => {
|
|
2172
|
+
f !== null ? (_(!0), N.show(Pe)) : !e.disabled && !e.busy && d(w.currentTarget, null);
|
|
2168
2173
|
},
|
|
2169
2174
|
children: [
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2175
|
+
i ? /* @__PURE__ */ n(se, { name: "spinner" }) : /* @__PURE__ */ n(je, { name: e.icon }),
|
|
2176
|
+
k ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: e.label }) : null,
|
|
2177
|
+
v ? /* @__PURE__ */ n(ln, {}) : null,
|
|
2178
|
+
f !== null || x !== null && !m ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: L, children: x }) : null
|
|
2174
2179
|
]
|
|
2175
2180
|
}
|
|
2176
2181
|
);
|
|
@@ -2182,31 +2187,31 @@ function je({ name: e }) {
|
|
|
2182
2187
|
const t = Be(e);
|
|
2183
2188
|
return t === null ? null : /* @__PURE__ */ n($, { name: t, size: 18 });
|
|
2184
2189
|
}
|
|
2185
|
-
function yl({ title: e, body: t = null, time: l = null, unread: s, unreadLabel: a, expandLabel:
|
|
2186
|
-
const [
|
|
2187
|
-
s &&
|
|
2188
|
-
},
|
|
2189
|
-
var
|
|
2190
|
-
|
|
2190
|
+
function yl({ title: e, body: t = null, time: l = null, unread: s, unreadLabel: a, expandLabel: r, collapseLabel: m, action: c = null, onRead: d, leading: b }) {
|
|
2191
|
+
const [i, g] = I(!1), u = he(), k = () => {
|
|
2192
|
+
s && d();
|
|
2193
|
+
}, f = (c == null ? void 0 : c.presentation) === "row" && c.onAction !== void 0, x = (c == null ? void 0 : c.presentation) === "button" && c.onAction !== void 0 ? c : null, L = () => {
|
|
2194
|
+
var S;
|
|
2195
|
+
k(), f && ((S = c.onAction) == null || S.call(c));
|
|
2191
2196
|
};
|
|
2192
|
-
return /* @__PURE__ */
|
|
2193
|
-
/* @__PURE__ */
|
|
2197
|
+
return /* @__PURE__ */ h("article", { className: H("cms-notification", s && "is-unread", i && "is-expanded", f && "is-row-action"), "data-state": s ? "unread" : "read", children: [
|
|
2198
|
+
/* @__PURE__ */ h(
|
|
2194
2199
|
"div",
|
|
2195
2200
|
{
|
|
2196
2201
|
className: "cms-notification__row",
|
|
2197
2202
|
role: "button",
|
|
2198
2203
|
tabIndex: 0,
|
|
2199
|
-
"aria-describedby": t === null ? void 0 :
|
|
2200
|
-
onClick:
|
|
2201
|
-
onKeyDown: (
|
|
2202
|
-
|
|
2204
|
+
"aria-describedby": t === null ? void 0 : u,
|
|
2205
|
+
onClick: L,
|
|
2206
|
+
onKeyDown: (S) => {
|
|
2207
|
+
S.target !== S.currentTarget || S.key !== "Enter" && S.key !== " " || (S.preventDefault(), L());
|
|
2203
2208
|
},
|
|
2204
2209
|
children: [
|
|
2205
2210
|
b != null ? /* @__PURE__ */ n("span", { className: "cms-notification__leading", children: b }) : null,
|
|
2206
|
-
/* @__PURE__ */
|
|
2207
|
-
/* @__PURE__ */
|
|
2208
|
-
/* @__PURE__ */
|
|
2209
|
-
s ? /* @__PURE__ */
|
|
2211
|
+
/* @__PURE__ */ h("span", { className: "cms-notification__text", children: [
|
|
2212
|
+
/* @__PURE__ */ h("span", { className: "cms-notification__head", children: [
|
|
2213
|
+
/* @__PURE__ */ h("span", { className: "cms-notification__title", children: [
|
|
2214
|
+
s ? /* @__PURE__ */ h("span", { className: "cms-visually-hidden", children: [
|
|
2210
2215
|
a,
|
|
2211
2216
|
" "
|
|
2212
2217
|
] }) : null,
|
|
@@ -2214,7 +2219,7 @@ function yl({ title: e, body: t = null, time: l = null, unread: s, unreadLabel:
|
|
|
2214
2219
|
] }),
|
|
2215
2220
|
l !== null ? /* @__PURE__ */ n("span", { className: "cms-notification__time", children: l }) : null
|
|
2216
2221
|
] }),
|
|
2217
|
-
t !== null && t !== "" ? /* @__PURE__ */ n("span", { className: "cms-notification__body", id:
|
|
2222
|
+
t !== null && t !== "" ? /* @__PURE__ */ n("span", { className: "cms-notification__body", id: u, children: t }) : null
|
|
2218
2223
|
] }),
|
|
2219
2224
|
s ? /* @__PURE__ */ n("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
|
|
2220
2225
|
]
|
|
@@ -2225,26 +2230,26 @@ function yl({ title: e, body: t = null, time: l = null, unread: s, unreadLabel:
|
|
|
2225
2230
|
{
|
|
2226
2231
|
type: "button",
|
|
2227
2232
|
className: "cms-notification__chevron",
|
|
2228
|
-
"aria-expanded":
|
|
2229
|
-
"aria-controls":
|
|
2230
|
-
"aria-label":
|
|
2231
|
-
title:
|
|
2233
|
+
"aria-expanded": i,
|
|
2234
|
+
"aria-controls": u,
|
|
2235
|
+
"aria-label": i ? m : r,
|
|
2236
|
+
title: i ? m : r,
|
|
2232
2237
|
onClick: () => {
|
|
2233
|
-
|
|
2238
|
+
i || k(), g((S) => !S);
|
|
2234
2239
|
},
|
|
2235
2240
|
children: /* @__PURE__ */ n($, { name: "chevron-down", size: 18 })
|
|
2236
2241
|
}
|
|
2237
2242
|
) : null,
|
|
2238
|
-
|
|
2243
|
+
x !== null ? /* @__PURE__ */ n(
|
|
2239
2244
|
"button",
|
|
2240
2245
|
{
|
|
2241
2246
|
type: "button",
|
|
2242
2247
|
className: "cms-button cms-notification__action",
|
|
2243
2248
|
onClick: () => {
|
|
2244
|
-
var
|
|
2245
|
-
|
|
2249
|
+
var S;
|
|
2250
|
+
k(), (S = x.onAction) == null || S.call(x);
|
|
2246
2251
|
},
|
|
2247
|
-
children:
|
|
2252
|
+
children: x.label
|
|
2248
2253
|
}
|
|
2249
2254
|
) : null
|
|
2250
2255
|
] });
|
|
@@ -2287,26 +2292,26 @@ function xl() {
|
|
|
2287
2292
|
window.dispatchEvent(new Event(sn));
|
|
2288
2293
|
}
|
|
2289
2294
|
function Ml(e) {
|
|
2290
|
-
const [t, l] =
|
|
2291
|
-
|
|
2292
|
-
const
|
|
2293
|
-
const
|
|
2294
|
-
|
|
2295
|
-
(
|
|
2296
|
-
|
|
2295
|
+
const [t, l] = I(void 0), [s, a] = I(void 0), [r, m] = I(!0), c = z(e);
|
|
2296
|
+
c.current = e;
|
|
2297
|
+
const d = z(0), b = Ie(() => {
|
|
2298
|
+
const i = ++d.current;
|
|
2299
|
+
m(!0), c.current().then(
|
|
2300
|
+
(g) => {
|
|
2301
|
+
i === d.current && (l(g), a(void 0), m(!1));
|
|
2297
2302
|
},
|
|
2298
|
-
(
|
|
2299
|
-
|
|
2303
|
+
(g) => {
|
|
2304
|
+
i === d.current && (a(g), m(!1));
|
|
2300
2305
|
}
|
|
2301
2306
|
);
|
|
2302
2307
|
}, []);
|
|
2303
2308
|
return Q(() => {
|
|
2304
2309
|
b();
|
|
2305
|
-
const
|
|
2306
|
-
return window.addEventListener("focus",
|
|
2307
|
-
window.removeEventListener("focus",
|
|
2310
|
+
const i = () => b();
|
|
2311
|
+
return window.addEventListener("focus", i), window.addEventListener(sn, i), () => {
|
|
2312
|
+
window.removeEventListener("focus", i), window.removeEventListener(sn, i);
|
|
2308
2313
|
};
|
|
2309
|
-
}, [b]), { value: t, error: s, loading:
|
|
2314
|
+
}, [b]), { value: t, error: s, loading: r, reread: b };
|
|
2310
2315
|
}
|
|
2311
2316
|
function Cl(e) {
|
|
2312
2317
|
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 };
|
|
@@ -2315,8 +2320,8 @@ const Bt = "/errors/client-update-required";
|
|
|
2315
2320
|
function Ft(e, t) {
|
|
2316
2321
|
const l = e.split(".").map((a) => Number.parseInt(a, 10) || 0), s = t.split(".").map((a) => Number.parseInt(a, 10) || 0);
|
|
2317
2322
|
for (let a = 0; a < Math.max(l.length, s.length); a++) {
|
|
2318
|
-
const
|
|
2319
|
-
if (
|
|
2323
|
+
const r = l[a] ?? 0, m = s[a] ?? 0;
|
|
2324
|
+
if (r !== m) return r < m;
|
|
2320
2325
|
}
|
|
2321
2326
|
return !1;
|
|
2322
2327
|
}
|
|
@@ -2330,129 +2335,129 @@ function Ht(e, t, l) {
|
|
|
2330
2335
|
}
|
|
2331
2336
|
const Ot = 800, Pt = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "]);
|
|
2332
2337
|
function zt(e, t) {
|
|
2333
|
-
const [l, s] =
|
|
2338
|
+
const [l, s] = I(!1);
|
|
2334
2339
|
return Q(() => {
|
|
2335
2340
|
const a = e.current;
|
|
2336
2341
|
if (a === null || !t) {
|
|
2337
2342
|
s(!1);
|
|
2338
2343
|
return;
|
|
2339
2344
|
}
|
|
2340
|
-
const
|
|
2341
|
-
let
|
|
2342
|
-
const
|
|
2343
|
-
|
|
2344
|
-
}, b = (
|
|
2345
|
-
const
|
|
2346
|
-
!(
|
|
2347
|
-
},
|
|
2348
|
-
const
|
|
2349
|
-
if (!(
|
|
2350
|
-
const
|
|
2351
|
-
if (
|
|
2345
|
+
const r = /* @__PURE__ */ new WeakMap();
|
|
2346
|
+
let m = Number.NEGATIVE_INFINITY, c = null;
|
|
2347
|
+
const d = (u) => {
|
|
2348
|
+
m = performance.now(), c = u.target;
|
|
2349
|
+
}, b = (u) => {
|
|
2350
|
+
const k = u.target;
|
|
2351
|
+
!(k instanceof HTMLElement && (k.isContentEditable || k.closest("input, textarea, select") !== null)) && Pt.has(u.key) && d(u);
|
|
2352
|
+
}, i = (u) => {
|
|
2353
|
+
const k = u.target;
|
|
2354
|
+
if (!(k instanceof HTMLElement)) return;
|
|
2355
|
+
const f = k.scrollTop, x = r.get(k) ?? 0;
|
|
2356
|
+
if (r.set(k, f), f <= 0) {
|
|
2352
2357
|
s(!1);
|
|
2353
2358
|
return;
|
|
2354
2359
|
}
|
|
2355
|
-
performance.now() -
|
|
2356
|
-
},
|
|
2357
|
-
for (const [
|
|
2358
|
-
return a.addEventListener("scroll",
|
|
2359
|
-
for (const [
|
|
2360
|
-
a.removeEventListener("scroll",
|
|
2360
|
+
performance.now() - m > Ot || !(c === a || c === document.body || c instanceof Node && k.contains(c)) || (f < x - Mn ? s(!1) : f > x + Mn && f > Rt && Ht(a, k, f) && s(!0));
|
|
2361
|
+
}, g = [["wheel", d], ["touchmove", d], ["pointerdown", d], ["keydown", b]];
|
|
2362
|
+
for (const [u, k] of g) a.addEventListener(u, k, { capture: !0, passive: !0 });
|
|
2363
|
+
return a.addEventListener("scroll", i, { capture: !0, passive: !0 }), () => {
|
|
2364
|
+
for (const [u, k] of g) a.removeEventListener(u, k, { capture: !0 });
|
|
2365
|
+
a.removeEventListener("scroll", i, { capture: !0 });
|
|
2361
2366
|
};
|
|
2362
2367
|
}, [e, t]), [l, s];
|
|
2363
2368
|
}
|
|
2364
2369
|
const Ut = 64;
|
|
2365
|
-
function Kt({ bar: e, leading: t, gap: l, icon: s, iconGap: a, search:
|
|
2366
|
-
const
|
|
2367
|
-
return e - (t > 0 ? t + l : 0) - l -
|
|
2370
|
+
function Kt({ bar: e, leading: t, gap: l, icon: s, iconGap: a, search: r, more: m, globals: c, name: d, choice: b }) {
|
|
2371
|
+
const i = [...r ? [s] : [], s, s, ...c], g = i.reduce((k, f) => k + f, 0) + a * (i.length - 1);
|
|
2372
|
+
return e - (t > 0 ? t + l : 0) - l - g + 0.01 < Math.min(Ut, d) + b;
|
|
2368
2373
|
}
|
|
2369
|
-
function El({ title: e, back: t, navigation: l, search: s, searching: a, more:
|
|
2374
|
+
function El({ title: e, back: t, navigation: l, search: s, searching: a, more: r = [], moreLabel: m = "More actions", globals: c, filter: d, primary: b, onRefresh: i, pullText: g, barHidden: u, children: k }) {
|
|
2370
2375
|
var Te, Ee;
|
|
2371
|
-
const
|
|
2372
|
-
Dn(
|
|
2373
|
-
const
|
|
2374
|
-
...
|
|
2375
|
-
onChange: (
|
|
2376
|
-
fe.current = !0,
|
|
2376
|
+
const f = b === void 0 || ("menu" in b ? !b.menu.some((O) => O.offer.offered) : ((Te = b.offer) == null ? void 0 : Te.offered) === !1) ? void 0 : b, x = f !== void 0 && !("menu" in f) ? ((Ee = f.offer) == null ? void 0 : Ee.refusal) ?? null : null, L = he(), [S, _] = I(!1), N = dn(), v = z(null), w = z(null), [T, B] = I(!1), [F, M] = I(null), [R, U] = I(null), j = Ie(() => U(null), []), K = z(!1), G = z(null), Y = z(null), ee = z(null), ie = r.some((O) => O.offer.offered), be = R !== null && ie && a === void 0;
|
|
2377
|
+
Dn(d);
|
|
2378
|
+
const oe = d === void 0 ? null : An(d), [de, Ce] = I(!1), fe = z(!1), te = z(!1), pe = z(null), _e = d === void 0 ? void 0 : {
|
|
2379
|
+
...d,
|
|
2380
|
+
onChange: (O) => {
|
|
2381
|
+
fe.current = !0, d.onChange(O);
|
|
2377
2382
|
}
|
|
2378
|
-
}, we =
|
|
2379
|
-
const
|
|
2380
|
-
if (
|
|
2381
|
-
const
|
|
2383
|
+
}, we = oe === null ? "" : ` · ${oe.label}`, ne = d !== void 0 && d.options.length >= 2, [ye, y] = I(!1), E = ne && ie && ye, W = JSON.stringify([ne, ie, E, s !== void 0, a !== void 0, t !== void 0, e, we]), q = Ie(() => {
|
|
2384
|
+
const O = G.current, X = Y.current, Ne = ee.current;
|
|
2385
|
+
if (O === null || X === null || Ne === null || !ne) return null;
|
|
2386
|
+
const ce = (J) => parseFloat(J) || 0, o = getComputedStyle(O), A = O.getBoundingClientRect().width;
|
|
2382
2387
|
if (A === 0) return null;
|
|
2383
|
-
const
|
|
2388
|
+
const C = (J) => {
|
|
2384
2389
|
var ke;
|
|
2385
|
-
return ((ke =
|
|
2386
|
-
},
|
|
2390
|
+
return ((ke = O.querySelector(`.cms-screen__ruler > [data-ruler="${J}"]`)) == null ? void 0 : ke.getBoundingClientRect().width) ?? 0;
|
|
2391
|
+
}, P = O.querySelector(".cms-screen__leading"), le = (s !== void 0 ? 1 : 0) + (E ? 0 : 1) + 1;
|
|
2387
2392
|
return Kt({
|
|
2388
|
-
bar: A -
|
|
2389
|
-
leading:
|
|
2390
|
-
gap:
|
|
2393
|
+
bar: A - ce(o.paddingLeft) - ce(o.paddingRight),
|
|
2394
|
+
leading: P === null || P.childNodes.length === 0 ? 0 : ce(getComputedStyle(P).minWidth),
|
|
2395
|
+
gap: ce(o.columnGap),
|
|
2391
2396
|
icon: Ne.getBoundingClientRect().width,
|
|
2392
|
-
iconGap:
|
|
2397
|
+
iconGap: ce(getComputedStyle(X).columnGap),
|
|
2393
2398
|
search: s !== void 0,
|
|
2394
2399
|
more: !0,
|
|
2395
2400
|
globals: Array.from(X.children).slice(le).map((J) => J.getBoundingClientRect().width),
|
|
2396
|
-
name:
|
|
2397
|
-
choice:
|
|
2401
|
+
name: C("name"),
|
|
2402
|
+
choice: C("choice")
|
|
2398
2403
|
});
|
|
2399
2404
|
}, [W]);
|
|
2400
2405
|
$e(() => {
|
|
2401
|
-
const
|
|
2402
|
-
|
|
2406
|
+
const O = q() ?? ye;
|
|
2407
|
+
O !== ye && fe.current && (te.current = !0), fe.current = !1, y(O);
|
|
2403
2408
|
}, [q]), Q(() => {
|
|
2404
2409
|
if (G.current === null || typeof ResizeObserver > "u") return;
|
|
2405
|
-
const
|
|
2410
|
+
const O = new ResizeObserver(() => {
|
|
2406
2411
|
const X = q();
|
|
2407
|
-
X !== null &&
|
|
2412
|
+
X !== null && y(X);
|
|
2408
2413
|
});
|
|
2409
|
-
for (const X of [G.current, Y.current, ...G.current.querySelectorAll(".cms-screen__ruler > span")]) X !== null &&
|
|
2410
|
-
return () =>
|
|
2414
|
+
for (const X of [G.current, Y.current, ...G.current.querySelectorAll(".cms-screen__ruler > span")]) X !== null && O.observe(X);
|
|
2415
|
+
return () => O.disconnect();
|
|
2411
2416
|
}, [q]);
|
|
2412
|
-
const p =
|
|
2417
|
+
const p = z(E);
|
|
2413
2418
|
$e(() => {
|
|
2414
|
-
var Ne,
|
|
2419
|
+
var Ne, ce, o;
|
|
2415
2420
|
if (p.current === E) return;
|
|
2416
|
-
p.current = E,
|
|
2417
|
-
const
|
|
2418
|
-
(
|
|
2421
|
+
p.current = E, U(null);
|
|
2422
|
+
const O = document.activeElement;
|
|
2423
|
+
(O === document.body && pe.current !== null && !pe.current.isConnected || te.current && (O === document.body || ((Ne = G.current) == null ? void 0 : Ne.contains(O)) === !0)) && ((o = E ? ee.current : (ce = Y.current) == null ? void 0 : ce.querySelector(".cms-filter-menu")) == null || o.focus()), te.current = !1;
|
|
2419
2424
|
}, [E]);
|
|
2420
|
-
const
|
|
2421
|
-
|
|
2422
|
-
}), ae =
|
|
2423
|
-
return /* @__PURE__ */
|
|
2425
|
+
const D = E && oe !== null && d !== void 0 ? `${m}, ${Tn(d)}` : m, ue = dt(w, i === void 0 ? null : () => {
|
|
2426
|
+
T || (B(!0), i().finally(() => B(!1)));
|
|
2427
|
+
}), ae = i === void 0 ? null : { distance: ue, refreshing: T, text: g ?? null }, me = a !== void 0 || ue > 0 || T || be || de, [Se, We] = zt(v, u === void 0 && !me), Fe = !me && (u ?? Se);
|
|
2428
|
+
return /* @__PURE__ */ h(
|
|
2424
2429
|
"div",
|
|
2425
2430
|
{
|
|
2426
|
-
ref:
|
|
2427
|
-
className:
|
|
2431
|
+
ref: v,
|
|
2432
|
+
className: H("cms-screen", f !== void 0 && "cms-screen--with-primary"),
|
|
2428
2433
|
"data-bar-hidden": Fe ? "" : void 0,
|
|
2429
|
-
onFocus: (
|
|
2430
|
-
pe.current =
|
|
2434
|
+
onFocus: (O) => {
|
|
2435
|
+
pe.current = O.target, Fe && O.target instanceof Element && O.target.closest(".cms-screen__bar") !== null && We(!1);
|
|
2431
2436
|
},
|
|
2432
2437
|
children: [
|
|
2433
|
-
a !== void 0 ? /* @__PURE__ */
|
|
2438
|
+
a !== void 0 ? /* @__PURE__ */ h("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
|
|
2434
2439
|
/* @__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
2440
|
/* @__PURE__ */ n("div", { className: "cms-screen__search", children: a.field })
|
|
2436
|
-
] }) : /* @__PURE__ */
|
|
2437
|
-
/* @__PURE__ */ n("div", { className: "cms-screen__leading", children: t !== void 0 ? t.href !== void 0 ? /* @__PURE__ */
|
|
2441
|
+
] }) : /* @__PURE__ */ h("header", { ref: G, className: "cms-screen__bar", children: [
|
|
2442
|
+
/* @__PURE__ */ n("div", { className: "cms-screen__leading", children: t !== void 0 ? t.href !== void 0 ? /* @__PURE__ */ h("a", { className: "cms-screen__back", href: t.href, onClick: t.onBack, children: [
|
|
2438
2443
|
/* @__PURE__ */ n($, { name: "chevron-left" }),
|
|
2439
2444
|
/* @__PURE__ */ n("span", { className: "cms-screen__back-name", children: t.label })
|
|
2440
|
-
] }) : /* @__PURE__ */
|
|
2445
|
+
] }) : /* @__PURE__ */ h("button", { type: "button", className: "cms-screen__back", onClick: t.onBack, children: [
|
|
2441
2446
|
/* @__PURE__ */ n($, { name: "chevron-left" }),
|
|
2442
2447
|
/* @__PURE__ */ n("span", { className: "cms-screen__back-name", children: t.label })
|
|
2443
2448
|
] }) : l }),
|
|
2444
|
-
|
|
2445
|
-
/* @__PURE__ */
|
|
2449
|
+
oe === null ? /* @__PURE__ */ n("h1", { className: "cms-screen__title", title: e, children: e }) : /* @__PURE__ */ h("h1", { className: "cms-screen__title cms-screen__title--filtered", title: e + we, children: [
|
|
2450
|
+
/* @__PURE__ */ h("span", { className: "cms-screen__title-place", children: [
|
|
2446
2451
|
/* @__PURE__ */ n("span", { className: "cms-screen__title-name", children: e }),
|
|
2447
2452
|
/* @__PURE__ */ n("span", { className: "cms-screen__title-dot", children: " · " })
|
|
2448
2453
|
] }),
|
|
2449
|
-
/* @__PURE__ */ n("span", { className: "cms-screen__title-choice", children:
|
|
2454
|
+
/* @__PURE__ */ n("span", { className: "cms-screen__title-choice", children: oe.label })
|
|
2450
2455
|
] }),
|
|
2451
|
-
ne && ie ? /* @__PURE__ */
|
|
2456
|
+
ne && ie ? /* @__PURE__ */ h("span", { className: "cms-screen__ruler", "aria-hidden": "true", children: [
|
|
2452
2457
|
/* @__PURE__ */ n("span", { "data-ruler": "name", children: e }),
|
|
2453
|
-
|
|
2458
|
+
oe !== null ? /* @__PURE__ */ n("span", { "data-ruler": "choice", children: we }) : null
|
|
2454
2459
|
] }) : null,
|
|
2455
|
-
/* @__PURE__ */
|
|
2460
|
+
/* @__PURE__ */ h("div", { ref: Y, className: "cms-screen__trailing", children: [
|
|
2456
2461
|
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
2462
|
_e !== void 0 && !E ? /* @__PURE__ */ n(In, { ..._e, iconOnly: !0, onOpenChange: Ce }) : null,
|
|
2458
2463
|
ie ? /* @__PURE__ */ n(
|
|
@@ -2460,80 +2465,80 @@ function El({ title: e, back: t, navigation: l, search: s, searching: a, more: i
|
|
|
2460
2465
|
{
|
|
2461
2466
|
ref: ee,
|
|
2462
2467
|
type: "button",
|
|
2463
|
-
className:
|
|
2468
|
+
className: H("cms-icon-button cms-screen__icon", E && oe !== null && "cms-screen__icon--active"),
|
|
2464
2469
|
"data-action": "more",
|
|
2465
2470
|
"aria-haspopup": "menu",
|
|
2466
2471
|
"aria-expanded": be,
|
|
2467
|
-
"aria-label":
|
|
2468
|
-
title:
|
|
2472
|
+
"aria-label": D,
|
|
2473
|
+
title: D,
|
|
2469
2474
|
onMouseDown: () => {
|
|
2470
2475
|
K.current = be;
|
|
2471
2476
|
},
|
|
2472
|
-
onClick: (
|
|
2473
|
-
const X =
|
|
2474
|
-
|
|
2477
|
+
onClick: (O) => {
|
|
2478
|
+
const X = O.currentTarget.getBoundingClientRect();
|
|
2479
|
+
U(K.current ? null : { x: X.left, y: X.bottom + 4 }), K.current = !1;
|
|
2475
2480
|
},
|
|
2476
2481
|
children: /* @__PURE__ */ n($, { name: "more" })
|
|
2477
2482
|
}
|
|
2478
2483
|
) : null,
|
|
2479
|
-
|
|
2484
|
+
c
|
|
2480
2485
|
] })
|
|
2481
2486
|
] }),
|
|
2482
|
-
/* @__PURE__ */ n("div", { ref:
|
|
2483
|
-
|
|
2487
|
+
/* @__PURE__ */ n("div", { ref: w, className: "cms-screen__content", "data-pulling": ue > 0 ? "" : void 0, "data-refreshing": T ? "" : void 0, children: /* @__PURE__ */ n(En.Provider, { value: ae, children: k }) }),
|
|
2488
|
+
f !== void 0 ? /* @__PURE__ */ h(
|
|
2484
2489
|
"button",
|
|
2485
2490
|
{
|
|
2486
2491
|
type: "button",
|
|
2487
2492
|
className: "cms-button cms-button--primary cms-screen__primary",
|
|
2488
|
-
"aria-label":
|
|
2489
|
-
...
|
|
2493
|
+
"aria-label": f.label,
|
|
2494
|
+
...x === null ? { title: f.label } : {
|
|
2490
2495
|
"aria-disabled": !0,
|
|
2491
|
-
"aria-describedby":
|
|
2492
|
-
...
|
|
2493
|
-
...
|
|
2496
|
+
"aria-describedby": L,
|
|
2497
|
+
...S ? { "data-reason-shown": "" } : {},
|
|
2498
|
+
...N.dismissed(ze) ? { "data-tip-dismissed": "" } : {}
|
|
2494
2499
|
},
|
|
2495
|
-
..."menu" in
|
|
2496
|
-
onFocus: () =>
|
|
2500
|
+
..."menu" in f ? { "aria-haspopup": "menu", "aria-expanded": F !== null } : {},
|
|
2501
|
+
onFocus: () => N.focusIn(ze),
|
|
2497
2502
|
onBlur: () => {
|
|
2498
|
-
|
|
2503
|
+
_(!1), N.focusOut(ze);
|
|
2499
2504
|
},
|
|
2500
|
-
onMouseEnter: () =>
|
|
2501
|
-
onMouseLeave: () =>
|
|
2502
|
-
onKeyDown: (
|
|
2503
|
-
|
|
2505
|
+
onMouseEnter: () => N.pointerIn(ze),
|
|
2506
|
+
onMouseLeave: () => N.pointerOut(ze),
|
|
2507
|
+
onKeyDown: (O) => {
|
|
2508
|
+
O.key === "Escape" && x !== null && (_(!1), N.dismiss(ze));
|
|
2504
2509
|
},
|
|
2505
|
-
onClick: (
|
|
2506
|
-
if (
|
|
2507
|
-
|
|
2508
|
-
else if ("menu" in
|
|
2509
|
-
const X =
|
|
2510
|
-
|
|
2510
|
+
onClick: (O) => {
|
|
2511
|
+
if (x !== null)
|
|
2512
|
+
_(!0), N.show(ze);
|
|
2513
|
+
else if ("menu" in f) {
|
|
2514
|
+
const X = O.currentTarget.getBoundingClientRect();
|
|
2515
|
+
M(F === null ? { x: X.left, y: X.top } : null);
|
|
2511
2516
|
} else
|
|
2512
|
-
|
|
2517
|
+
f.onPress();
|
|
2513
2518
|
},
|
|
2514
2519
|
children: [
|
|
2515
|
-
/* @__PURE__ */ n($, { name:
|
|
2516
|
-
|
|
2520
|
+
/* @__PURE__ */ n($, { name: f.icon, size: 24 }),
|
|
2521
|
+
x !== null ? /* @__PURE__ */ n("span", { className: "cms-screen__tip", role: "tooltip", id: L, children: x }) : null
|
|
2517
2522
|
]
|
|
2518
2523
|
}
|
|
2519
2524
|
) : null,
|
|
2520
2525
|
/* @__PURE__ */ n(
|
|
2521
2526
|
Ke,
|
|
2522
2527
|
{
|
|
2523
|
-
at: be ?
|
|
2524
|
-
items: E && _e !== void 0 ? [...
|
|
2528
|
+
at: be ? R : null,
|
|
2529
|
+
items: E && _e !== void 0 ? [...r, ...Ln(_e, _e.label)] : r,
|
|
2525
2530
|
onClose: j,
|
|
2526
|
-
label:
|
|
2531
|
+
label: m,
|
|
2527
2532
|
focus: "first"
|
|
2528
2533
|
}
|
|
2529
2534
|
),
|
|
2530
|
-
|
|
2535
|
+
f !== void 0 && "menu" in f ? /* @__PURE__ */ n(Ke, { at: F, items: f.menu, onClose: () => M(null), label: f.label }) : null
|
|
2531
2536
|
]
|
|
2532
2537
|
}
|
|
2533
2538
|
);
|
|
2534
2539
|
}
|
|
2535
2540
|
export {
|
|
2536
|
-
|
|
2541
|
+
ol as AppShell,
|
|
2537
2542
|
Ye as Avatar,
|
|
2538
2543
|
vn as BOOTSTRAP_ICONS,
|
|
2539
2544
|
Nt as Badge,
|
|
@@ -2573,7 +2578,7 @@ export {
|
|
|
2573
2578
|
Mt as SIGN_IN_LABELS,
|
|
2574
2579
|
en as STATE_DELAY_MS,
|
|
2575
2580
|
El as ScreenShell,
|
|
2576
|
-
|
|
2581
|
+
cl as SearchField,
|
|
2577
2582
|
sl as SectionHeader,
|
|
2578
2583
|
Yt as Select,
|
|
2579
2584
|
vl as SignInForm,
|