@coolms/ui-react 0.1.0-alpha.45 → 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 +8 -0
- package/dist/components/Collections.d.ts +2 -2
- package/dist/index.js +692 -687
- package/package.json +1 -1
- package/src/kit.css +11 -1
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 }) {
|
|
@@ -46,19 +46,19 @@ function De({
|
|
|
46
46
|
...g
|
|
47
47
|
}) {
|
|
48
48
|
const u = !!m || t;
|
|
49
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ h(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
52
|
...g,
|
|
53
53
|
type: b,
|
|
54
|
-
className:
|
|
54
|
+
className: H("cms-button", `cms-button--${e}`, t && "is-busy", s && "is-locked", c),
|
|
55
55
|
disabled: u,
|
|
56
56
|
"aria-busy": t || void 0,
|
|
57
57
|
title: s ? a ?? i : i,
|
|
58
58
|
children: [
|
|
59
59
|
t ? /* @__PURE__ */ n(se, { name: "spinner" }) : s ? /* @__PURE__ */ n(se, { name: "lock" }) : r,
|
|
60
60
|
/* @__PURE__ */ n("span", { className: "cms-button__label", children: t && l !== void 0 ? l : d }),
|
|
61
|
-
s && a ? /* @__PURE__ */
|
|
61
|
+
s && a ? /* @__PURE__ */ h("span", { className: "cms-visually-hidden", children: [
|
|
62
62
|
", ",
|
|
63
63
|
a
|
|
64
64
|
] }) : null
|
|
@@ -108,10 +108,10 @@ function Cn({ name: e, size: t = 18 }) {
|
|
|
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
110
|
function on({ id: e, label: t, help: l, error: s, pinned: a, children: r }) {
|
|
111
|
-
return /* @__PURE__ */
|
|
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
113
|
r,
|
|
114
|
-
a != null ? /* @__PURE__ */
|
|
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
|
|
@@ -153,57 +153,57 @@ 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: r, value: m, onChange: c, placeholder: d, type: b = "text", name: i, locale: g, min: u, max:
|
|
157
|
-
const v = he(), [
|
|
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
160
|
id: v,
|
|
161
161
|
name: i,
|
|
162
|
-
type:
|
|
163
|
-
autoComplete:
|
|
162
|
+
type: F || R && w ? "text" : b,
|
|
163
|
+
autoComplete: _,
|
|
164
164
|
className: "cms-input",
|
|
165
|
-
value:
|
|
166
|
-
...
|
|
165
|
+
value: F ? Zn(b, m, g) : m,
|
|
166
|
+
...F ? { "data-value": m } : {},
|
|
167
167
|
lang: g,
|
|
168
168
|
placeholder: d,
|
|
169
169
|
disabled: s,
|
|
170
|
-
readOnly:
|
|
171
|
-
required:
|
|
172
|
-
"aria-required":
|
|
173
|
-
min:
|
|
174
|
-
max:
|
|
175
|
-
step:
|
|
176
|
-
minLength:
|
|
177
|
-
maxLength:
|
|
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
178
|
inputMode: b === "number" ? M ? "decimal" : "numeric" : void 0,
|
|
179
179
|
"aria-invalid": l != null || void 0,
|
|
180
180
|
"aria-describedby": cn(v, { help: t, error: l, pinned: r }),
|
|
181
181
|
onChange: (j) => c == null ? void 0 : c(j.target.value)
|
|
182
182
|
}
|
|
183
183
|
);
|
|
184
|
-
return /* @__PURE__ */ n(on, { id: v, label: e, help: t, error: l, pinned: r, children:
|
|
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
191
|
"aria-controls": v,
|
|
192
|
-
"aria-label":
|
|
193
|
-
title:
|
|
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: r, value: m, onChange: c, placeholder: d, rows: b = 4, name: i, locale: g, minLength: u, maxLength:
|
|
202
|
-
const
|
|
203
|
-
return /* @__PURE__ */ n(on, { id:
|
|
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:
|
|
206
|
+
id: x,
|
|
207
207
|
name: i,
|
|
208
208
|
className: "cms-input cms-textarea",
|
|
209
209
|
rows: b,
|
|
@@ -212,13 +212,13 @@ function jt({ label: e, help: t, error: l, disabled: s, readOnly: a, pinned: r,
|
|
|
212
212
|
placeholder: d,
|
|
213
213
|
disabled: s,
|
|
214
214
|
readOnly: a === !0 || r != null,
|
|
215
|
-
required:
|
|
216
|
-
"aria-required":
|
|
215
|
+
required: f,
|
|
216
|
+
"aria-required": f || void 0,
|
|
217
217
|
minLength: u,
|
|
218
|
-
maxLength:
|
|
218
|
+
maxLength: k,
|
|
219
219
|
"aria-invalid": l != null || void 0,
|
|
220
|
-
"aria-describedby": cn(
|
|
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
|
}
|
|
@@ -244,14 +244,14 @@ function Yt({ label: e, help: t, error: l, disabled: s, readOnly: a, value: r, o
|
|
|
244
244
|
}
|
|
245
245
|
function Xt({ label: e, checked: t, onChange: l, disabled: s, readOnly: a, help: r }) {
|
|
246
246
|
const m = he();
|
|
247
|
-
return /* @__PURE__ */
|
|
247
|
+
return /* @__PURE__ */ h("div", { className: "cms-toggle-row", children: [
|
|
248
248
|
/* @__PURE__ */ n(
|
|
249
249
|
"button",
|
|
250
250
|
{
|
|
251
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
257
|
"aria-describedby": r != null ? `${m}-help` : void 0,
|
|
@@ -268,56 +268,56 @@ function Xt({ label: e, checked: t, onChange: l, disabled: s, readOnly: a, help:
|
|
|
268
268
|
}
|
|
269
269
|
const qn = 150;
|
|
270
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] =
|
|
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
277
|
if (!i) return;
|
|
278
|
-
|
|
279
|
-
const
|
|
280
|
-
var
|
|
281
|
-
g(!1),
|
|
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(
|
|
283
|
+
return () => window.clearTimeout(_);
|
|
284
284
|
}, [e, i]), Q(() => {
|
|
285
|
-
var
|
|
285
|
+
var _, N;
|
|
286
286
|
if (e && i) {
|
|
287
287
|
const v = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
|
|
288
|
-
(
|
|
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
290
|
}, [e, i, d]), !i) return null;
|
|
291
|
-
const
|
|
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 v = (
|
|
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
312
|
if (!v || v.length === 0) return;
|
|
313
|
-
const
|
|
314
|
-
|
|
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": c, onClick:
|
|
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
322
|
/* @__PURE__ */ n("div", { className: "cms-modal__body", children: r }),
|
|
323
323
|
m != null ? /* @__PURE__ */ n("footer", { className: "cms-modal__foot", children: m }) : null
|
|
@@ -336,11 +336,11 @@ function Jt({ open: e, title: t, message: l, kind: s = "default", confirmLabel:
|
|
|
336
336
|
title: t,
|
|
337
337
|
onClose: d,
|
|
338
338
|
...m === void 0 ? {} : { closeLabel: m },
|
|
339
|
-
footer: /* @__PURE__ */
|
|
339
|
+
footer: /* @__PURE__ */ h(ge, { children: [
|
|
340
340
|
/* @__PURE__ */ n(De, { onClick: d, children: r ?? (b ? "Keep editing" : "Cancel") }),
|
|
341
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,13 +389,13 @@ 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
397
|
function Le({ kind: e, title: t, description: l, action: s, placement: a = "page", icon: r }) {
|
|
398
|
-
const [m, c] =
|
|
398
|
+
const [m, c] = I(e !== "loading");
|
|
399
399
|
Q(() => {
|
|
400
400
|
if (e !== "loading") {
|
|
401
401
|
c(!0);
|
|
@@ -406,10 +406,10 @@ function Le({ kind: e, title: t, description: l, action: s, placement: a = "page
|
|
|
406
406
|
return () => window.clearTimeout(b);
|
|
407
407
|
}, [e]);
|
|
408
408
|
const d = a === "block";
|
|
409
|
-
return /* @__PURE__ */
|
|
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,
|
|
@@ -417,7 +417,7 @@ function Le({ kind: e, title: t, description: l, action: s, placement: a = "page
|
|
|
417
417
|
e === "loading" ? /* @__PURE__ */ n(Jn, {}) : null,
|
|
418
418
|
(e === "error" || e === "denied") && !d ? /* @__PURE__ */ n(se, { name: e === "error" ? "warning" : "lock" }) : null,
|
|
419
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__ */
|
|
420
|
+
/* @__PURE__ */ h("span", { className: "cms-state__text", children: [
|
|
421
421
|
/* @__PURE__ */ n("span", { className: "cms-state__title", children: t }),
|
|
422
422
|
l !== void 0 && !d ? /* @__PURE__ */ n("span", { className: "cms-state__description", children: l }) : null
|
|
423
423
|
] }),
|
|
@@ -437,72 +437,72 @@ 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: r = [], moreLabel: m = "More", edit: c, editing: d, state: b, siblings: i, bar: g, thumbnails: u, strip:
|
|
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 M = document.activeElement,
|
|
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
|
|
449
|
+
const T = () => {
|
|
450
450
|
d != null && d.dirty ? d.onDirtyClose() : a();
|
|
451
|
-
},
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
},
|
|
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
471
|
onKeyDown: (M) => {
|
|
472
|
-
var
|
|
472
|
+
var R, U, j;
|
|
473
473
|
if (M.key === "Escape") {
|
|
474
474
|
if (d !== void 0) return;
|
|
475
|
-
M.stopPropagation(),
|
|
475
|
+
M.stopPropagation(), N ? v(!1) : a();
|
|
476
476
|
} else if (M.key === "Tab") {
|
|
477
|
-
const K = Array.from(((
|
|
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
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" ? (
|
|
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
484
|
i !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-visually-hidden", role: "status", children: `${t}, ${i.position}` }) : null,
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
/* @__PURE__ */ n("button", { ref:
|
|
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:
|
|
488
|
+
/* @__PURE__ */ n("h2", { className: "cms-viewer__name", id: _, title: t, children: t }),
|
|
489
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
|
-
d !== void 0 ? /* @__PURE__ */
|
|
491
|
+
d !== void 0 ? /* @__PURE__ */ h(ge, { children: [
|
|
492
492
|
/* @__PURE__ */ n("span", { className: "cms-viewer__status", role: "status", children: d.status }),
|
|
493
493
|
/* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: d.onDone, children: d.doneLabel })
|
|
494
|
-
] }) : /* @__PURE__ */
|
|
495
|
-
/* @__PURE__ */ n("span", { className: "cms-viewer__actions", children: r.map((M) => /* @__PURE__ */
|
|
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
496
|
M.icon,
|
|
497
497
|
M.label
|
|
498
498
|
] }, M.label)) }),
|
|
499
|
-
c !== void 0 ? /* @__PURE__ */
|
|
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
500
|
c.icon,
|
|
501
501
|
/* @__PURE__ */ n("span", { className: "cms-viewer__wide", children: c.label })
|
|
502
502
|
] }) : null,
|
|
503
|
-
r.length > 0 ? /* @__PURE__ */
|
|
504
|
-
/* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__icon", "aria-label": m, "aria-expanded":
|
|
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",
|
|
@@ -520,21 +520,21 @@ function nl(e) {
|
|
|
520
520
|
] }) : null
|
|
521
521
|
] })
|
|
522
522
|
] }),
|
|
523
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ h("div", { className: "cms-viewer__body", children: [
|
|
524
524
|
u != null && d === void 0 ? /* @__PURE__ */ n("nav", { className: "cms-viewer__thumbnails", children: u }) : null,
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
(d == null ? void 0 : d.conflict) !== void 0 ? /* @__PURE__ */
|
|
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
527
|
/* @__PURE__ */ n("p", { className: "cms-viewer__conflict-text", children: d.conflict.message }),
|
|
528
528
|
/* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button", onClick: d.conflict.onOverwrite, children: d.conflict.overwriteLabel }),
|
|
529
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 ?
|
|
531
|
+
b === void 0 ? x : /* @__PURE__ */ n(st, { state: b }),
|
|
532
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
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,
|
|
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
|
-
d === void 0 &&
|
|
537
|
+
d === void 0 && k != null ? /* @__PURE__ */ n("div", { className: "cms-viewer__strip", children: k }) : null,
|
|
538
538
|
g != null ? /* @__PURE__ */ n("footer", { className: "cms-viewer__bar", children: g }) : null
|
|
539
539
|
]
|
|
540
540
|
}
|
|
@@ -584,165 +584,165 @@ const Je = (e, t) => `${e}
|
|
|
584
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: r, formatSize: m, labels: c, onConfirm: d, onCancel: b } = e, [i, g] =
|
|
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
589
|
M.current = !1;
|
|
590
590
|
}, [t, i, u]);
|
|
591
|
-
const
|
|
591
|
+
const R = he();
|
|
592
592
|
Q(() => {
|
|
593
|
-
var
|
|
594
|
-
t && (g(((
|
|
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
596
|
if (!t || i === "") return;
|
|
597
|
-
let
|
|
598
|
-
return
|
|
599
|
-
(E) =>
|
|
600
|
-
(E) =>
|
|
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, i, u, s,
|
|
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
|
-
M.current = !1,
|
|
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
617
|
if (M.current) {
|
|
618
|
-
|
|
618
|
+
x({ status: "error" });
|
|
619
619
|
return;
|
|
620
620
|
}
|
|
621
|
-
M.current = !0,
|
|
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 = r == null ? void 0 : r.cost) == null ? void 0 : E.call(r,
|
|
627
|
-
}, [r]), K = Bn(() => [...
|
|
628
|
-
if (
|
|
629
|
-
const E = a == null ? void 0 : a(
|
|
630
|
-
return E || (Y !== null && !
|
|
631
|
-
}, be = (
|
|
632
|
-
const E = Je(i,
|
|
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
|
-
}, oe = (
|
|
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 =
|
|
639
|
+
return W.delete(y), W;
|
|
640
|
+
}), fe = f.status === "ready" ? f.entries : [], te = (y) => {
|
|
641
641
|
const E = fe[v];
|
|
642
|
-
if (
|
|
643
|
-
|
|
644
|
-
const W = fe.length - 1, q =
|
|
645
|
-
|
|
646
|
-
} else
|
|
647
|
-
}, pe = u === "" ? [] : u.split("/"), _e = ((ye = l.find((
|
|
648
|
-
return /* @__PURE__ */
|
|
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
652
|
title: c.title,
|
|
653
653
|
onClose: b,
|
|
654
654
|
closeLabel: c.close,
|
|
655
|
-
initialFocus:
|
|
655
|
+
initialFocus: F,
|
|
656
656
|
className: "cms-file-picker",
|
|
657
|
-
footer: /* @__PURE__ */
|
|
658
|
-
/* @__PURE__ */
|
|
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
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:
|
|
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__ */
|
|
662
|
+
/* @__PURE__ */ h("div", { className: "cms-file-picker__actions", children: [
|
|
663
663
|
/* @__PURE__ */ n(De, { variant: "secondary", onClick: b, children: c.cancel }),
|
|
664
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__ */
|
|
668
|
+
/* @__PURE__ */ h("div", { className: "cms-file-picker__top", children: [
|
|
669
|
+
l.length > 1 ? /* @__PURE__ */ h("label", { className: "cms-file-picker__space", children: [
|
|
670
670
|
/* @__PURE__ */ n("span", { className: "cms-visually-hidden", children: c.space }),
|
|
671
|
-
/* @__PURE__ */ n("select", { className: "cms-input cms-select", value: i, onChange: (
|
|
672
|
-
g(
|
|
673
|
-
}, children: l.map((
|
|
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__ */
|
|
675
|
+
/* @__PURE__ */ h("nav", { className: "cms-file-picker__path", "aria-label": c.path, children: [
|
|
676
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__ */
|
|
678
|
-
/* @__PURE__ */ n("li", { children: /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": u === "" ? "location" : void 0, onClick: () =>
|
|
679
|
-
pe.map((
|
|
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 === u ? "location" : void 0, onClick: () =>
|
|
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": c.remove(E.name), onClick: () => Ce(
|
|
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
|
-
|
|
693
|
+
N(/* @__PURE__ */ new Map()), B(!1);
|
|
694
694
|
}, children: c.clear })
|
|
695
695
|
] }) : null,
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
const E =
|
|
698
|
-
E.scrollTop + E.clientHeight >= E.scrollHeight - ot &&
|
|
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
|
-
M.current = !1,
|
|
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
712
|
"aria-label": c.files,
|
|
713
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
|
)
|
|
@@ -760,7 +760,7 @@ function ct(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
765
|
const r = e.current;
|
|
766
766
|
if (r === null) return;
|
|
@@ -789,126 +789,128 @@ function ut() {
|
|
|
789
789
|
return Fn(En);
|
|
790
790
|
}
|
|
791
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 =
|
|
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
795
|
if (t.length === 0) return /* @__PURE__ */ n(jn, { title: r, hint: m, ...c === void 0 ? {} : { icon: c } });
|
|
796
|
-
const
|
|
797
|
-
var
|
|
798
|
-
if (
|
|
799
|
-
|
|
800
|
-
else if (
|
|
801
|
-
b == null || b(
|
|
802
|
-
else if ((
|
|
803
|
-
|
|
804
|
-
const
|
|
805
|
-
i(
|
|
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
|
-
u !== null && (u.distance > 0 || u.refreshing) ? /* @__PURE__ */
|
|
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
810
|
u.refreshing ? /* @__PURE__ */ n(se, { name: "spinner" }) : null,
|
|
811
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
|
-
g.current[
|
|
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: i ? (
|
|
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
847
|
function Ke({ at: e, items: t, onClose: l, label: s = "Actions", focus: a = "current", corner: r = "top-left" }) {
|
|
848
|
-
const m =
|
|
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 _ = m.current,
|
|
852
|
-
i({ x: Math.max(0, Math.min(
|
|
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
853
|
}, [e, r]), Q(() => {
|
|
854
|
-
var
|
|
854
|
+
var w, T;
|
|
855
855
|
if (!e) return;
|
|
856
856
|
c.current = document.activeElement;
|
|
857
|
-
const _ = Array.from(((
|
|
858
|
-
(
|
|
859
|
-
const
|
|
860
|
-
var
|
|
861
|
-
(
|
|
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
867
|
}, [e, l, a]), !e || g.length === 0) return null;
|
|
868
868
|
const u = (_) => {
|
|
869
|
-
var
|
|
870
|
-
const
|
|
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
871
|
if (_.key === "Escape" || _.key === "Tab")
|
|
872
872
|
_.preventDefault(), l();
|
|
873
873
|
else if (_.key === "ArrowDown" || _.key === "ArrowUp") {
|
|
874
874
|
_.preventDefault();
|
|
875
|
-
const
|
|
876
|
-
(
|
|
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
883
|
role: _.checked === void 0 ? "menuitem" : "menuitemradio",
|
|
884
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
897
|
_.checked !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-menu__check", children: _.checked ? /* @__PURE__ */ n(se, { name: "check" }) : null }) : null,
|
|
898
898
|
_.offer.locked ? /* @__PURE__ */ n(se, { name: "lock" }) : null,
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
|
|
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
|
-
},
|
|
907
|
+
}, S = [];
|
|
906
908
|
for (const _ of g) {
|
|
907
|
-
const
|
|
908
|
-
|
|
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
916
|
ref: m,
|
|
@@ -918,20 +920,23 @@ function Ke({ at: e, items: t, onClose: l, label: s = "Actions", focus: a = "cur
|
|
|
918
920
|
style: { left: (b ?? e).x, top: (b ?? e).y },
|
|
919
921
|
onKeyDown: u,
|
|
920
922
|
onContextMenu: (_) => _.preventDefault(),
|
|
921
|
-
children:
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
/* @__PURE__ */ n("div", { className: "cms-
|
|
925
|
-
_.items.map(
|
|
926
|
-
|
|
927
|
-
|
|
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] =
|
|
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) => {
|
|
935
940
|
if (!b.has(d)) return b;
|
|
936
941
|
const i = new Set(b);
|
|
937
942
|
return i.delete(d), i;
|
|
@@ -966,7 +971,7 @@ function mt(e, t, l) {
|
|
|
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
972
|
function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secondary: r, more: m = [], moreLabel: c, context: d, fullWidth: b = !1 }) {
|
|
968
973
|
var X, Ne, ce;
|
|
969
|
-
const [i, g] =
|
|
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 = [
|
|
970
975
|
...(r ?? []).map((o) => ({
|
|
971
976
|
id: o.id,
|
|
972
977
|
label: o.label,
|
|
@@ -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), M =
|
|
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 =
|
|
999
|
-
if (o === null ||
|
|
1000
|
-
const
|
|
1003
|
+
const o = N.current, A = v.current;
|
|
1004
|
+
if (o === null || A === null) return;
|
|
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
|
-
return ((Me =
|
|
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 = (() => {
|
|
@@ -1031,116 +1036,116 @@ 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
|
-
const
|
|
1040
|
-
return
|
|
1044
|
+
const A = new ResizeObserver(() => te());
|
|
1045
|
+
return A.observe(o), () => A.disconnect();
|
|
1041
1046
|
}, [te]), Q(() => {
|
|
1042
1047
|
const o = typeof document > "u" ? void 0 : document.fonts;
|
|
1043
1048
|
if (o === void 0) return;
|
|
1044
|
-
let
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1049
|
+
let A = !0;
|
|
1050
|
+
const C = () => {
|
|
1051
|
+
A && te();
|
|
1047
1052
|
};
|
|
1048
|
-
return o.ready.then(
|
|
1049
|
-
|
|
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
|
-
const
|
|
1054
|
-
return /* @__PURE__ */ new Set([...M.filter((
|
|
1058
|
+
const A = o.hidden.size + (o.primaryHidden ? 1 : 0);
|
|
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(u), we =
|
|
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 = [
|
|
1057
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
1066
|
..._e.size > 0 ? M.map(W) : []
|
|
1062
|
-
], p = q.length > 0,
|
|
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
|
-
var o,
|
|
1070
|
-
|
|
1074
|
+
var o, A;
|
|
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());
|
|
1071
1076
|
}, [u]);
|
|
1072
|
-
const ue = (o) => `${
|
|
1077
|
+
const ue = (o) => `${B}-${o}`, ae = (o) => {
|
|
1073
1078
|
var le;
|
|
1074
|
-
const
|
|
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
|
-
|
|
1080
|
-
}, me = (o,
|
|
1081
|
-
const
|
|
1082
|
-
g((i == null ? void 0 : i.which) === o ? null : { which: o, x:
|
|
1083
|
-
}, Se = (o) => ({ id: ue(o), tabIndex: Z === o ? 0 : -1, onFocus: () =>
|
|
1084
|
-
...
|
|
1085
|
-
...
|
|
1086
|
-
onFocus: (
|
|
1087
|
-
|
|
1083
|
+
const P = D[C] ?? null;
|
|
1084
|
+
x(P), P !== null && ((le = document.getElementById(ue(P))) == null || le.focus());
|
|
1085
|
+
}, me = (o, A) => {
|
|
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,
|
|
1100
|
-
|
|
1101
|
-
}, Te = (o,
|
|
1102
|
-
const
|
|
1103
|
-
if (
|
|
1104
|
-
const le =
|
|
1105
|
-
|
|
1106
|
-
const J =
|
|
1107
|
-
|
|
1108
|
-
const ke =
|
|
1109
|
-
|
|
1110
|
-
}, Ee = (o,
|
|
1111
|
-
|
|
1112
|
-
|
|
1104
|
+
} : {}, Fe = (o, A, C) => {
|
|
1105
|
+
S(o), _.show(o), Te(A, C);
|
|
1106
|
+
}, Te = (o, A) => {
|
|
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
|
-
|
|
1116
|
-
] }),
|
|
1117
|
-
const
|
|
1118
|
-
return /* @__PURE__ */
|
|
1120
|
+
A
|
|
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":
|
|
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
|
-
|
|
1136
|
-
|
|
1140
|
+
A ? null : /* @__PURE__ */ n("span", { className: "cms-section-header__label", children: o.label }),
|
|
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",
|
|
@@ -1151,41 +1156,41 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
|
|
|
1151
1156
|
children: e
|
|
1152
1157
|
}
|
|
1153
1158
|
),
|
|
1154
|
-
l !== void 0 ? /* @__PURE__ */ n("span", { className:
|
|
1155
|
-
s.map((o,
|
|
1159
|
+
l !== void 0 ? /* @__PURE__ */ n("span", { className: H("cms-section-header__description", u.descriptionHidden && "cms-visually-hidden"), children: l }) : null,
|
|
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
1165
|
hidden: o.elsewhere === !0 && u.elsewhereHidden,
|
|
1161
|
-
style: u.chipsCut && o.elsewhere !== !0 ? { flexShrink:
|
|
1166
|
+
style: u.chipsCut && o.elsewhere !== !0 ? { flexShrink: A + 1 } : void 0,
|
|
1162
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
1182
|
"aria-label": u.primaryBare ? a.label : void 0,
|
|
1178
1183
|
"aria-disabled": be ? "true" : void 0,
|
|
1179
|
-
"aria-describedby": ie !== void 0 ?
|
|
1184
|
+
"aria-describedby": ie !== void 0 ? T : void 0,
|
|
1180
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
|
-
u.primaryBare ? null : /* @__PURE__ */
|
|
1193
|
+
u.primaryBare ? null : /* @__PURE__ */ h(ge, { children: [
|
|
1189
1194
|
" ",
|
|
1190
1195
|
/* @__PURE__ */ n("span", { children: a.label })
|
|
1191
1196
|
] })
|
|
@@ -1206,12 +1211,12 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
|
|
|
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",
|
|
@@ -1225,28 +1230,28 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
|
|
|
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
|
] })
|
|
@@ -1265,14 +1270,14 @@ function pt(e) {
|
|
|
1265
1270
|
return [...t.entries()].sort(([l], [s]) => l - s).map(([, l]) => l);
|
|
1266
1271
|
}
|
|
1267
1272
|
function al({ head: e, children: t, className: l, scrollRef: s, onScroll: a, bodyProps: r }) {
|
|
1268
|
-
return /* @__PURE__ */
|
|
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", { ...r, className:
|
|
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,7 +1302,7 @@ 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 =
|
|
1305
|
+
const a = z([]), r = (m, c) => {
|
|
1301
1306
|
var g;
|
|
1302
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;
|
|
@@ -1307,7 +1312,7 @@ function il({ tabs: e, active: t, onSelect: l, label: s }) {
|
|
|
1307
1312
|
};
|
|
1308
1313
|
return /* @__PURE__ */ n("div", { className: "cms-tabs", role: "tablist", "aria-label": s, children: e.map((m, c) => {
|
|
1309
1314
|
const d = m.id === t;
|
|
1310
|
-
return /* @__PURE__ */
|
|
1315
|
+
return /* @__PURE__ */ h(
|
|
1311
1316
|
"button",
|
|
1312
1317
|
{
|
|
1313
1318
|
ref: (b) => {
|
|
@@ -1315,7 +1320,7 @@ function il({ tabs: e, active: t, onSelect: l, label: s }) {
|
|
|
1315
1320
|
},
|
|
1316
1321
|
type: "button",
|
|
1317
1322
|
role: "tab",
|
|
1318
|
-
className:
|
|
1323
|
+
className: H("cms-tab", d && "is-active"),
|
|
1319
1324
|
"aria-selected": d,
|
|
1320
1325
|
tabIndex: d ? 0 : -1,
|
|
1321
1326
|
onClick: () => l(m.id),
|
|
@@ -1343,18 +1348,18 @@ function _t(e) {
|
|
|
1343
1348
|
return t % 6 + 1;
|
|
1344
1349
|
}
|
|
1345
1350
|
function Ye({ name: e, pictureUrl: t, presence: l, connection: s, deleted: a = !1, placeholder: r = !1, size: m = 32, tintSeed: c, unnamedLabel: d }) {
|
|
1346
|
-
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}`,
|
|
1347
|
-
return /* @__PURE__ */
|
|
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:
|
|
1355
|
+
className: H("cms-avatar", b ? "cms-avatar--deleted" : `cms-avatar--tint-${_t(c ?? e)}`),
|
|
1351
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
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 }),
|
|
1357
|
-
u === null ? null : /* @__PURE__ */ n("span", { className:
|
|
1362
|
+
u === null ? null : /* @__PURE__ */ n("span", { className: H("cms-avatar__presence", u), "aria-hidden": "true" })
|
|
1358
1363
|
]
|
|
1359
1364
|
}
|
|
1360
1365
|
);
|
|
@@ -1385,25 +1390,25 @@ function wt(e) {
|
|
|
1385
1390
|
}
|
|
1386
1391
|
}
|
|
1387
1392
|
function yt({ storageKey: e, value: t, default: l, min: s, max: a, step: r = 16, label: m, onChange: c, className: d, style: b }) {
|
|
1388
|
-
const i = Math.max(s, a), g = (v) => Math.round(Math.min(Math.max(v, s), i)), [u,
|
|
1393
|
+
const i = Math.max(s, a), g = (v) => Math.round(Math.min(Math.max(v, s), i)), [u, k] = I(() => {
|
|
1389
1394
|
const v = e === void 0 ? null : tn(e);
|
|
1390
1395
|
return g(v ?? l);
|
|
1391
|
-
}),
|
|
1396
|
+
}), f = g(t ?? u), x = z(null), [L, S] = I(!1);
|
|
1392
1397
|
$e(() => {
|
|
1393
1398
|
if (e === void 0) return;
|
|
1394
1399
|
const v = tn(e);
|
|
1395
1400
|
if (v === null) return;
|
|
1396
|
-
const
|
|
1397
|
-
(t === void 0 ||
|
|
1401
|
+
const w = g(v);
|
|
1402
|
+
(t === void 0 || w !== g(t)) && (k(w), c(w, !0));
|
|
1398
1403
|
}, []), $e(() => {
|
|
1399
1404
|
t !== void 0 && g(t) !== t && c(g(t), !0);
|
|
1400
1405
|
}, [t, s, i]);
|
|
1401
|
-
const
|
|
1402
|
-
const
|
|
1403
|
-
|
|
1404
|
-
},
|
|
1405
|
-
const v =
|
|
1406
|
-
|
|
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",
|
|
@@ -1412,60 +1417,60 @@ function yt({ storageKey: e, value: t, default: l, min: s, max: a, step: r = 16,
|
|
|
1412
1417
|
tabIndex: 0,
|
|
1413
1418
|
"aria-orientation": "vertical",
|
|
1414
1419
|
"aria-label": m,
|
|
1415
|
-
"aria-valuenow":
|
|
1420
|
+
"aria-valuenow": f,
|
|
1416
1421
|
"aria-valuemin": s,
|
|
1417
1422
|
"aria-valuemax": i,
|
|
1418
|
-
className:
|
|
1423
|
+
className: H("cms-splitter", L && "is-dragging", f <= s && "is-at-min", f >= i && "is-at-max", d),
|
|
1419
1424
|
style: b,
|
|
1420
1425
|
onPointerDown: (v) => {
|
|
1421
|
-
var
|
|
1426
|
+
var T, B;
|
|
1422
1427
|
if (v.button > 0) return;
|
|
1423
|
-
v.preventDefault(), (
|
|
1424
|
-
const
|
|
1425
|
-
|
|
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
1432
|
onPointerMove: (v) => {
|
|
1428
|
-
const
|
|
1429
|
-
|
|
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
1440
|
const v = g(l);
|
|
1436
|
-
|
|
1441
|
+
k(v), c(v, !0);
|
|
1437
1442
|
},
|
|
1438
1443
|
onKeyDown: (v) => {
|
|
1439
|
-
const
|
|
1440
|
-
|
|
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
1456
|
function ol({ product: e, mark: t, rail: l, active: s, onNavigate: a, server: r, search: m, account: c, children: d, railLabel: b = "Sections" }) {
|
|
1452
|
-
return /* @__PURE__ */
|
|
1453
|
-
/* @__PURE__ */
|
|
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
1460
|
/* @__PURE__ */ n("ul", { className: "cms-shell__items", children: l.map((i) => {
|
|
1456
1461
|
const g = i.id === s;
|
|
1457
|
-
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */
|
|
1462
|
+
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
1458
1463
|
"a",
|
|
1459
1464
|
{
|
|
1460
1465
|
href: i.href,
|
|
1461
|
-
className:
|
|
1466
|
+
className: H("cms-shell__item", g && "is-active"),
|
|
1462
1467
|
"aria-current": g ? "page" : void 0,
|
|
1463
1468
|
title: i.label,
|
|
1464
1469
|
onClick: (u) => {
|
|
1465
1470
|
a && (u.preventDefault(), a(i.id));
|
|
1466
1471
|
},
|
|
1467
1472
|
children: [
|
|
1468
|
-
/* @__PURE__ */
|
|
1473
|
+
/* @__PURE__ */ h("span", { className: "cms-shell__icon", children: [
|
|
1469
1474
|
/* @__PURE__ */ n($, { name: i.icon, size: 22 }),
|
|
1470
1475
|
i.badge ? /* @__PURE__ */ n(Nt, { count: i.badge.count, label: i.badge.label }) : null
|
|
1471
1476
|
] }),
|
|
@@ -1475,7 +1480,7 @@ function ol({ product: e, mark: t, rail: l, active: s, onNavigate: a, server: r,
|
|
|
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
1485
|
r != null ? /* @__PURE__ */ n("div", { className: "cms-shell__server", children: r }) : null,
|
|
1481
1486
|
m != null ? /* @__PURE__ */ n("div", { className: "cms-shell__search", children: m }) : null,
|
|
@@ -1485,7 +1490,7 @@ function ol({ product: e, mark: t, rail: l, active: s, onNavigate: a, server: r,
|
|
|
1485
1490
|
] });
|
|
1486
1491
|
}
|
|
1487
1492
|
function cl({ label: e, placeholder: t, value: l, onChange: s, onSearch: a }) {
|
|
1488
|
-
return /* @__PURE__ */
|
|
1493
|
+
return /* @__PURE__ */ h(
|
|
1489
1494
|
"form",
|
|
1490
1495
|
{
|
|
1491
1496
|
role: "search",
|
|
@@ -1520,52 +1525,52 @@ function kt(e, t, l) {
|
|
|
1520
1525
|
return s;
|
|
1521
1526
|
}
|
|
1522
1527
|
function dl({ panes: e, active: t, back: l, sizes: s, lastMin: a = 360, onResize: r, storageKey: m }) {
|
|
1523
|
-
const c = Math.min(Math.max(t ?? e.length - 1, 0), e.length - 1), d =
|
|
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
1530
|
const v = d.current;
|
|
1526
|
-
if (v === null || !
|
|
1527
|
-
const
|
|
1528
|
-
if (
|
|
1529
|
-
const
|
|
1530
|
-
return
|
|
1531
|
-
}, [
|
|
1532
|
-
const
|
|
1533
|
-
[`--split-pane-${String(
|
|
1534
|
-
[`--split-pane-end-${String(
|
|
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
1544
|
ref: d,
|
|
1540
|
-
className:
|
|
1545
|
+
className: H("cms-panes", e.length === 3 ? "cms-panes--three" : "cms-panes--two", S && "cms-panes--sized", f && "is-resizing"),
|
|
1541
1546
|
"data-active": c,
|
|
1542
|
-
style:
|
|
1547
|
+
style: N,
|
|
1543
1548
|
children: [
|
|
1544
|
-
e.map((v,
|
|
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
1554
|
v.content
|
|
1550
1555
|
] }, v.label)),
|
|
1551
|
-
|
|
1552
|
-
const
|
|
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
|
-
...m === void 0 ? {} : { storageKey: `${m}:${String(
|
|
1557
|
-
value:
|
|
1561
|
+
...m === void 0 ? {} : { storageKey: `${m}:${String(w)}` },
|
|
1562
|
+
value: _[w],
|
|
1558
1563
|
default: v.reset,
|
|
1559
1564
|
min: v.min,
|
|
1560
|
-
max:
|
|
1565
|
+
max: B,
|
|
1561
1566
|
label: v.label,
|
|
1562
1567
|
className: "cms-panes__splitter",
|
|
1563
|
-
style: { "--split-at": `var(--split-pane-end-${String(
|
|
1564
|
-
onChange: (
|
|
1565
|
-
m !== void 0 &&
|
|
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
|
|
@@ -1577,10 +1582,10 @@ function dl({ panes: e, active: t, back: l, sizes: s, lastMin: a = 360, onResize
|
|
|
1577
1582
|
}
|
|
1578
1583
|
const xt = { attachment: "Has an attachment", unread: "Unread" };
|
|
1579
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 }) {
|
|
1580
|
-
const u = qe(xt, g),
|
|
1581
|
-
return /* @__PURE__ */
|
|
1582
|
-
b !== void 0 ? /* @__PURE__ */
|
|
1583
|
-
|
|
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,17 +1598,17 @@ 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",
|
|
@@ -1611,14 +1616,14 @@ function ul({ from: e, fromPlaceholder: t = !1, subject: l, preview: s, time: a,
|
|
|
1611
1616
|
"aria-current": c ? "true" : void 0,
|
|
1612
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
|
] }),
|
|
@@ -1630,11 +1635,11 @@ 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
|
|
@@ -1642,12 +1647,12 @@ function ml({ direction: e, children: t, time: l, read: s, readLabel: a = "Read"
|
|
|
1642
1647
|
] });
|
|
1643
1648
|
}
|
|
1644
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 }) {
|
|
1645
|
-
const g = he(), u = i ?? t.trim() !== "",
|
|
1646
|
-
|
|
1647
|
-
},
|
|
1648
|
-
return /* @__PURE__ */
|
|
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: [
|
|
1649
1654
|
/* @__PURE__ */ n("label", { htmlFor: g, className: m === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: e }),
|
|
1650
|
-
m === "chat" ?
|
|
1655
|
+
m === "chat" ? f : null,
|
|
1651
1656
|
/* @__PURE__ */ n(
|
|
1652
1657
|
"textarea",
|
|
1653
1658
|
{
|
|
@@ -1656,15 +1661,15 @@ function hl({ label: e, value: t, onChange: l, onSend: s, onAttach: a, placehold
|
|
|
1656
1661
|
rows: m === "reply" ? 3 : 1,
|
|
1657
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
1670
|
m === "reply" && b !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-composer__leading", children: b }) : null,
|
|
1666
|
-
m === "reply" ?
|
|
1667
|
-
m === "chat" ? /* @__PURE__ */ n("button", { type: "submit", className: "cms-composer__send-round", "aria-label": c, disabled: !u, children: /* @__PURE__ */ n($, { name: "send" }) }) : /* @__PURE__ */
|
|
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: [
|
|
1668
1673
|
c,
|
|
1669
1674
|
" ",
|
|
1670
1675
|
/* @__PURE__ */ n($, { name: "send", size: 18 })
|
|
@@ -1694,22 +1699,22 @@ const mn = {
|
|
|
1694
1699
|
};
|
|
1695
1700
|
function fl({ name: e, namePlaceholder: t = !1, media: l, onAccept: s, onDecline: a, labels: r }) {
|
|
1696
1701
|
const m = qe(mn, r), c = l === "video" ? m.incomingVideo : m.incomingAudio;
|
|
1697
|
-
return /* @__PURE__ */
|
|
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
1705
|
/* @__PURE__ */ n("p", { className: "cms-call-incoming__what", children: c }),
|
|
1701
|
-
/* @__PURE__ */
|
|
1706
|
+
/* @__PURE__ */ h("div", { className: "cms-call-incoming__actions", children: [
|
|
1702
1707
|
/* @__PURE__ */ n(Ue, { icon: "phone-off", label: m.decline, tone: "hang-up", onClick: a }),
|
|
1703
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: [
|
|
@@ -1721,21 +1726,21 @@ function Ue({ icon: e, label: t, onClick: l, tone: s = "plain", pressed: a }) {
|
|
|
1721
1726
|
}
|
|
1722
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 }) {
|
|
1723
1728
|
const u = qe(mn, g);
|
|
1724
|
-
return /* @__PURE__ */
|
|
1725
|
-
/* @__PURE__ */
|
|
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
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
1740
|
/* @__PURE__ */ n("span", { children: u.you }),
|
|
1736
1741
|
s.speaking ? /* @__PURE__ */ n("span", { className: "cms-call-panel__level", role: "img", "aria-label": u.speaking }) : null
|
|
1737
1742
|
] }),
|
|
1738
|
-
/* @__PURE__ */
|
|
1743
|
+
/* @__PURE__ */ h("div", { className: "cms-call-panel__controls", children: [
|
|
1739
1744
|
/* @__PURE__ */ n(Ue, { icon: "mic", label: a ? u.unmute : u.mute, pressed: a, onClick: m }),
|
|
1740
1745
|
/* @__PURE__ */ n(Ue, { icon: "speaker", label: u.speaker, pressed: r, onClick: c }),
|
|
1741
1746
|
d ? /* @__PURE__ */ n(Ue, { icon: "user-plus", label: u.addPerson, onClick: d }) : null,
|
|
@@ -1746,11 +1751,11 @@ function pl({ name: e, duration: t, connection: l, you: s, muted: a, speaker: r,
|
|
|
1746
1751
|
}
|
|
1747
1752
|
function bl({ name: e, duration: t, muted: l, onToggleMute: s, onReturn: a, onHangUp: r, labels: m }) {
|
|
1748
1753
|
const c = qe(mn, m);
|
|
1749
|
-
return /* @__PURE__ */
|
|
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
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__ */
|
|
1758
|
+
/* @__PURE__ */ h("span", { className: "cms-call-bar__actions", children: [
|
|
1754
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" }) }),
|
|
1755
1760
|
/* @__PURE__ */ n("button", { type: "button", className: "cms-button cms-button--primary", onClick: a, children: c.returnToCall }),
|
|
1756
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" }) })
|
|
@@ -1758,16 +1763,16 @@ function bl({ name: e, duration: t, muted: l, onToggleMute: s, onReturn: a, onHa
|
|
|
1758
1763
|
] });
|
|
1759
1764
|
}
|
|
1760
1765
|
function _l({ mark: e, product: t, headline: l, lead: s, features: a = [], children: r }) {
|
|
1761
|
-
return /* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
/* @__PURE__ */
|
|
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((m) => /* @__PURE__ */
|
|
1775
|
+
a.length ? /* @__PURE__ */ n("ul", { className: "cms-signin__features", children: a.map((m) => /* @__PURE__ */ h("li", { children: [
|
|
1771
1776
|
/* @__PURE__ */ n($, { name: m.icon, size: 18 }),
|
|
1772
1777
|
m.label
|
|
1773
1778
|
] }, m.label)) }) : null
|
|
@@ -1789,12 +1794,12 @@ const Mt = {
|
|
|
1789
1794
|
create: "Create an account"
|
|
1790
1795
|
};
|
|
1791
1796
|
function vl({ server: e, onSubmit: t, forgotHref: l, createHref: s, error: a, busy: r, labels: m }) {
|
|
1792
|
-
const c = qe(Mt, m), d = he(), [b, i] =
|
|
1793
|
-
return /* @__PURE__ */
|
|
1794
|
-
|
|
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);
|
|
1795
1800
|
}, "aria-describedby": a ? `${d}-error` : void 0, children: [
|
|
1796
1801
|
/* @__PURE__ */ n("h1", { className: "cms-signin-form__title", children: c.title }),
|
|
1797
|
-
/* @__PURE__ */
|
|
1802
|
+
/* @__PURE__ */ h("p", { className: "cms-signin-form__server", children: [
|
|
1798
1803
|
/* @__PURE__ */ n($, { name: "server", size: 18 }),
|
|
1799
1804
|
e
|
|
1800
1805
|
] }),
|
|
@@ -1808,30 +1813,30 @@ function vl({ server: e, onSubmit: t, forgotHref: l, createHref: s, error: a, bu
|
|
|
1808
1813
|
autoComplete: "username",
|
|
1809
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
1820
|
/* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${d}-password`, children: c.password }),
|
|
1816
|
-
/* @__PURE__ */
|
|
1821
|
+
/* @__PURE__ */ h("span", { className: "cms-signin-form__password", children: [
|
|
1817
1822
|
/* @__PURE__ */ n(
|
|
1818
1823
|
"input",
|
|
1819
1824
|
{
|
|
1820
1825
|
id: `${d}-password`,
|
|
1821
1826
|
className: "cms-signin-form__input",
|
|
1822
|
-
type:
|
|
1827
|
+
type: k ? "text" : "password",
|
|
1823
1828
|
autoComplete: "current-password",
|
|
1824
1829
|
value: g,
|
|
1825
|
-
onChange: (
|
|
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
1836
|
l ? /* @__PURE__ */ n("a", { className: "cms-signin-form__forgot", href: l, children: c.forgot }) : null,
|
|
1832
1837
|
a ? /* @__PURE__ */ n("p", { id: `${d}-error`, className: "cms-signin-form__error", role: "alert", children: a }) : null,
|
|
1833
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 }),
|
|
1834
|
-
s ? /* @__PURE__ */
|
|
1839
|
+
s ? /* @__PURE__ */ h(ge, { children: [
|
|
1835
1840
|
/* @__PURE__ */ n("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ n("span", { children: c.newHere }) }),
|
|
1836
1841
|
/* @__PURE__ */ n("a", { className: "cms-button cms-signin-form__create", href: s, children: c.create })
|
|
1837
1842
|
] }) : null
|
|
@@ -1867,7 +1872,7 @@ function fn(e, t) {
|
|
|
1867
1872
|
}
|
|
1868
1873
|
function Dn(e) {
|
|
1869
1874
|
var r;
|
|
1870
|
-
const t =
|
|
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,18 +1881,18 @@ 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] =
|
|
1884
|
+
const [s, a] = I(null), r = Ie(() => a(null), []), m = z(!1), c = s !== null;
|
|
1880
1885
|
Q(() => (t == null || t(c), () => t == null ? void 0 : t(!1)), [c, t]);
|
|
1881
|
-
const d = An(l), b = d !== null && !e, i = Tn(l), g = (u,
|
|
1882
|
-
const
|
|
1883
|
-
a({ x:
|
|
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
1897
|
"aria-expanded": c,
|
|
1893
1898
|
"aria-label": i,
|
|
@@ -1901,7 +1906,7 @@ function St({ iconOnly: e, onOpenChange: t, ...l }) {
|
|
|
1901
1906
|
onKeyDown: (u) => {
|
|
1902
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__ */
|
|
1909
|
+
children: b ? /* @__PURE__ */ h(ge, { children: [
|
|
1905
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" })
|
|
@@ -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
|
|
@@ -1942,70 +1947,70 @@ function Tt(e) {
|
|
|
1942
1947
|
}
|
|
1943
1948
|
function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leading: r }) {
|
|
1944
1949
|
var q;
|
|
1945
|
-
const m = t.filter((p) => p.entries === void 0 || p.entries.length > 0), c =
|
|
1946
|
-
const p = c.current,
|
|
1947
|
-
if (p === null ||
|
|
1948
|
-
const Z = getComputedStyle(p), ue = parseFloat(Z.columnGap || "0") || 0, ae = p.clientWidth - (parseFloat(Z.paddingLeft) || 0) - (parseFloat(Z.paddingRight) || 0), me = (
|
|
1949
|
-
var
|
|
1950
|
-
return ((
|
|
1951
|
-
}, Se = me('[data-measure="leading"]'), We = me('[data-measure="separator"]'), Fe = me('[data-measure="more"]'), Te = (
|
|
1952
|
-
const
|
|
1953
|
-
return Se + ke.reduce((He, V) => He + Te(V.id, !
|
|
1954
|
-
},
|
|
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;
|
|
1953
|
+
const Z = getComputedStyle(p), ue = parseFloat(Z.columnGap || "0") || 0, ae = p.clientWidth - (parseFloat(Z.paddingLeft) || 0) - (parseFloat(Z.paddingRight) || 0), me = (A) => {
|
|
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];
|
|
1955
1960
|
let ce = null;
|
|
1956
1961
|
if (Ee(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= ae) ce = kn;
|
|
1957
1962
|
else {
|
|
1958
|
-
const
|
|
1959
|
-
for (const
|
|
1960
|
-
for (const
|
|
1961
|
-
if (Ee(
|
|
1962
|
-
ce = { bare:
|
|
1963
|
+
const A = /* @__PURE__ */ new Set();
|
|
1964
|
+
for (const C of Ne) {
|
|
1965
|
+
for (const P of C) A.add(P);
|
|
1966
|
+
if (Ee(A, /* @__PURE__ */ new Set()) <= ae) {
|
|
1967
|
+
ce = { bare: A, hidden: /* @__PURE__ */ new Set() };
|
|
1963
1968
|
break;
|
|
1964
1969
|
}
|
|
1965
1970
|
}
|
|
1966
1971
|
}
|
|
1967
1972
|
if (ce === null) {
|
|
1968
|
-
const
|
|
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
1980
|
const o = ce;
|
|
1976
|
-
g((
|
|
1977
|
-
}, [
|
|
1981
|
+
g((A) => xn(A.bare, o.bare) && xn(A.hidden, o.hidden) ? A : o);
|
|
1982
|
+
}, [U]);
|
|
1978
1983
|
$e(K, [K]), Q(() => {
|
|
1979
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(i.hidden), Y =
|
|
1995
|
-
...
|
|
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)] : [],
|
|
1996
2001
|
...de.filter((p) => i.hidden.has(p)).map(oe),
|
|
1997
|
-
...G.size > 0 ?
|
|
1998
|
-
].filter((p) => p !== void 0 && G.has(p.id)), fe = new Set(M.filter((p) => !
|
|
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 = u === null || u.which === "more" ? void 0 :
|
|
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,36 +2037,36 @@ 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 = M.length + (
|
|
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 ===
|
|
2047
|
+
primary: p.id === T,
|
|
2043
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:
|
|
2052
|
+
tipOff: _ === p.id,
|
|
2048
2053
|
menuOpen: (u == null ? void 0 : u.which) === p.id,
|
|
2049
|
-
onChoose: (
|
|
2050
|
-
p.entries === void 0 ? l(p.id) : (u == null ? void 0 : u.which) === p.id && Z === null ?
|
|
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
2066
|
ref: c,
|
|
2062
2067
|
role: "toolbar",
|
|
2063
2068
|
"aria-label": e,
|
|
2064
|
-
className:
|
|
2069
|
+
className: H(
|
|
2065
2070
|
"cms-pane-toolbar",
|
|
2066
2071
|
E > 0 && i.bare.size >= E && "cms-pane-toolbar--labels-hidden",
|
|
2067
2072
|
i.bare.size > 0 && i.bare.size < E && "cms-pane-toolbar--labels-partly-hidden"
|
|
@@ -2069,12 +2074,12 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
|
|
|
2069
2074
|
onKeyDown: _e,
|
|
2070
2075
|
children: [
|
|
2071
2076
|
r !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-pane-toolbar__leading", children: r }) : null,
|
|
2072
|
-
v.map((p,
|
|
2073
|
-
const Z = p.filter((ae) => !ee(ae)), ue = v.slice(0,
|
|
2074
|
-
return /* @__PURE__ */
|
|
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(
|
|
@@ -2089,30 +2094,30 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
|
|
|
2089
2094
|
"aria-haspopup": "menu",
|
|
2090
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
|
-
(u == null ? void 0 : u.which) === "more" ?
|
|
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: (u == null ? void 0 : u.which) === "more" ? u : null, items: we, onClose: () =>
|
|
2104
|
-
/* @__PURE__ */ n(Ke, { at: ne !== void 0 ? u : null, items: ye, onClose: () =>
|
|
2105
|
-
/* @__PURE__ */
|
|
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: [
|
|
2106
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
|
] })
|
|
@@ -2124,21 +2129,21 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
|
|
|
2124
2129
|
}
|
|
2125
2130
|
const Pe = "tip";
|
|
2126
2131
|
function Lt({ action: e, primary: t, labels: l, overflowed: s, pinned: a, tabbable: r, tipOff: m, menuOpen: c, onChoose: d, onFocus: b }) {
|
|
2127
|
-
const [i, g] =
|
|
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 u = Be(e.icon) === null,
|
|
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": "" } : {},
|
|
@@ -2148,29 +2153,29 @@ function Lt({ action: e, primary: t, labels: l, overflowed: s, pinned: a, tabbab
|
|
|
2148
2153
|
"aria-disabled": e.disabled || void 0,
|
|
2149
2154
|
"aria-busy": e.busy || void 0,
|
|
2150
2155
|
...v ? { "aria-haspopup": "menu", "aria-expanded": c } : {},
|
|
2151
|
-
...
|
|
2152
|
-
...
|
|
2153
|
-
...
|
|
2156
|
+
...f === null ? {} : { "aria-describedby": L },
|
|
2157
|
+
...S && f !== null ? { "data-reason-shown": "" } : {},
|
|
2158
|
+
...N.dismissed(Pe) ? { "data-tip-dismissed": "" } : {},
|
|
2154
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
2175
|
i ? /* @__PURE__ */ n(se, { name: "spinner" }) : /* @__PURE__ */ n(je, { name: e.icon }),
|
|
2171
|
-
|
|
2176
|
+
k ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: e.label }) : null,
|
|
2172
2177
|
v ? /* @__PURE__ */ n(ln, {}) : null,
|
|
2173
|
-
|
|
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
|
);
|
|
@@ -2183,30 +2188,30 @@ function je({ name: e }) {
|
|
|
2183
2188
|
return t === null ? null : /* @__PURE__ */ n($, { name: t, size: 18 });
|
|
2184
2189
|
}
|
|
2185
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 }) {
|
|
2186
|
-
const [i, g] =
|
|
2191
|
+
const [i, g] = I(!1), u = he(), k = () => {
|
|
2187
2192
|
s && d();
|
|
2188
|
-
},
|
|
2189
|
-
var
|
|
2190
|
-
|
|
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
2204
|
"aria-describedby": t === null ? void 0 : u,
|
|
2200
|
-
onClick:
|
|
2201
|
-
onKeyDown: (
|
|
2202
|
-
|
|
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,
|
|
@@ -2230,21 +2235,21 @@ function yl({ title: e, body: t = null, time: l = null, unread: s, unreadLabel:
|
|
|
2230
2235
|
"aria-label": i ? m : r,
|
|
2231
2236
|
title: i ? m : r,
|
|
2232
2237
|
onClick: () => {
|
|
2233
|
-
i ||
|
|
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,9 +2292,9 @@ function xl() {
|
|
|
2287
2292
|
window.dispatchEvent(new Event(sn));
|
|
2288
2293
|
}
|
|
2289
2294
|
function Ml(e) {
|
|
2290
|
-
const [t, l] =
|
|
2295
|
+
const [t, l] = I(void 0), [s, a] = I(void 0), [r, m] = I(!0), c = z(e);
|
|
2291
2296
|
c.current = e;
|
|
2292
|
-
const d =
|
|
2297
|
+
const d = z(0), b = Ie(() => {
|
|
2293
2298
|
const i = ++d.current;
|
|
2294
2299
|
m(!0), c.current().then(
|
|
2295
2300
|
(g) => {
|
|
@@ -2330,7 +2335,7 @@ 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) {
|
|
@@ -2342,117 +2347,117 @@ function zt(e, t) {
|
|
|
2342
2347
|
const d = (u) => {
|
|
2343
2348
|
m = performance.now(), c = u.target;
|
|
2344
2349
|
}, b = (u) => {
|
|
2345
|
-
const
|
|
2346
|
-
!(
|
|
2350
|
+
const k = u.target;
|
|
2351
|
+
!(k instanceof HTMLElement && (k.isContentEditable || k.closest("input, textarea, select") !== null)) && Pt.has(u.key) && d(u);
|
|
2347
2352
|
}, i = (u) => {
|
|
2348
|
-
const
|
|
2349
|
-
if (!(
|
|
2350
|
-
const
|
|
2351
|
-
if (r.set(
|
|
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() - m > Ot || !(c === a || c === document.body || c instanceof Node &&
|
|
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));
|
|
2356
2361
|
}, g = [["wheel", d], ["touchmove", d], ["pointerdown", d], ["keydown", b]];
|
|
2357
|
-
for (const [u,
|
|
2362
|
+
for (const [u, k] of g) a.addEventListener(u, k, { capture: !0, passive: !0 });
|
|
2358
2363
|
return a.addEventListener("scroll", i, { capture: !0, passive: !0 }), () => {
|
|
2359
|
-
for (const [u,
|
|
2364
|
+
for (const [u, k] of g) a.removeEventListener(u, k, { capture: !0 });
|
|
2360
2365
|
a.removeEventListener("scroll", i, { capture: !0 });
|
|
2361
2366
|
};
|
|
2362
2367
|
}, [e, t]), [l, s];
|
|
2363
2368
|
}
|
|
2364
2369
|
const Ut = 64;
|
|
2365
2370
|
function Kt({ bar: e, leading: t, gap: l, icon: s, iconGap: a, search: r, more: m, globals: c, name: d, choice: b }) {
|
|
2366
|
-
const i = [...r ? [s] : [], s, s, ...c], g = i.reduce((
|
|
2371
|
+
const i = [...r ? [s] : [], s, s, ...c], g = i.reduce((k, f) => k + f, 0) + a * (i.length - 1);
|
|
2367
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: r = [], moreLabel: m = "More actions", globals: c, filter: d, primary: b, onRefresh: i, pullText: g, barHidden: u, children:
|
|
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
|
|
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;
|
|
2372
2377
|
Dn(d);
|
|
2373
|
-
const oe = d === void 0 ? null : An(d), [de, Ce] =
|
|
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 : {
|
|
2374
2379
|
...d,
|
|
2375
|
-
onChange: (
|
|
2376
|
-
fe.current = !0, d.onChange(
|
|
2380
|
+
onChange: (O) => {
|
|
2381
|
+
fe.current = !0, d.onChange(O);
|
|
2377
2382
|
}
|
|
2378
|
-
}, we = oe === null ? "" : ` · ${oe.label}`, ne = d !== void 0 && d.options.length >= 2, [ye,
|
|
2379
|
-
const
|
|
2380
|
-
if (
|
|
2381
|
-
const ce = (J) => parseFloat(J) || 0, o = getComputedStyle(
|
|
2382
|
-
if (
|
|
2383
|
-
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;
|
|
2387
|
+
if (A === 0) return null;
|
|
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:
|
|
2389
|
-
leading:
|
|
2393
|
+
bar: A - ce(o.paddingLeft) - ce(o.paddingRight),
|
|
2394
|
+
leading: P === null || P.childNodes.length === 0 ? 0 : ce(getComputedStyle(P).minWidth),
|
|
2390
2395
|
gap: ce(o.columnGap),
|
|
2391
2396
|
icon: Ne.getBoundingClientRect().width,
|
|
2392
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
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 = i === void 0 ? null : { distance: ue, refreshing:
|
|
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
2431
|
ref: v,
|
|
2427
|
-
className:
|
|
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
|
-
oe === null ? /* @__PURE__ */ n("h1", { className: "cms-screen__title", title: e, children: e }) : /* @__PURE__ */
|
|
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
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,18 +2465,18 @@ function El({ title: e, back: t, navigation: l, search: s, searching: a, more: r
|
|
|
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
|
}
|
|
@@ -2479,55 +2484,55 @@ function El({ title: e, back: t, navigation: l, search: s, searching: a, more: r
|
|
|
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
|
-
M(
|
|
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 ?
|
|
2528
|
+
at: be ? R : null,
|
|
2524
2529
|
items: E && _e !== void 0 ? [...r, ...Ln(_e, _e.label)] : r,
|
|
2525
2530
|
onClose: j,
|
|
2526
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
|
);
|