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