@coolms/ui-react 0.1.0-alpha.29 → 0.1.0-alpha.30
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 +10 -0
- package/design-tokens.lock.json +4 -4
- package/dist/components/FilePicker.d.ts +8 -0
- package/dist/components/Icon.d.ts +1 -1
- package/dist/components/SectionHeader.d.ts +42 -0
- package/dist/components/Workspace.d.ts +26 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1231 -1104
- package/kit.contract.json +1 -0
- package/package.json +1 -1
- package/src/kit.css +30 -2
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
function
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { useId as Y, useState as E, useRef as I, useEffect as q, useCallback as _e, useMemo as Ke, useContext as Oe, createContext as Ue, useLayoutEffect as Ne } from "react";
|
|
3
|
+
import { createPortal as Ce } from "react-dom";
|
|
4
|
+
function de(n, l) {
|
|
5
5
|
const t = { ...n };
|
|
6
|
-
for (const
|
|
7
|
-
const c = l == null ? void 0 : l[
|
|
8
|
-
c !== void 0 && (t[
|
|
6
|
+
for (const d of Object.keys(l ?? {})) {
|
|
7
|
+
const c = l == null ? void 0 : l[d];
|
|
8
|
+
c !== void 0 && (t[d] = c);
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function T(...n) {
|
|
13
13
|
return n.filter(Boolean).join(" ");
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function U({ name: n }) {
|
|
16
16
|
const l = { width: 16, height: 16, viewBox: "0 0 16 16", "aria-hidden": !0, focusable: !1 };
|
|
17
17
|
switch (n) {
|
|
18
18
|
case "lock":
|
|
@@ -31,34 +31,34 @@ function z({ name: n }) {
|
|
|
31
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
|
|
34
|
+
function te({
|
|
35
35
|
variant: n = "secondary",
|
|
36
36
|
busy: l = !1,
|
|
37
37
|
busyLabel: t,
|
|
38
|
-
locked:
|
|
38
|
+
locked: d = !1,
|
|
39
39
|
lockedReason: c,
|
|
40
|
-
icon:
|
|
41
|
-
disabled:
|
|
42
|
-
className:
|
|
43
|
-
children:
|
|
44
|
-
type:
|
|
40
|
+
icon: r,
|
|
41
|
+
disabled: m,
|
|
42
|
+
className: s,
|
|
43
|
+
children: h,
|
|
44
|
+
type: b = "button",
|
|
45
45
|
title: o,
|
|
46
|
-
...
|
|
46
|
+
...u
|
|
47
47
|
}) {
|
|
48
|
-
const a = !!
|
|
49
|
-
return /* @__PURE__ */
|
|
48
|
+
const a = !!m || l;
|
|
49
|
+
return /* @__PURE__ */ i(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
|
-
...
|
|
53
|
-
type:
|
|
54
|
-
className:
|
|
52
|
+
...u,
|
|
53
|
+
type: b,
|
|
54
|
+
className: T("cms-button", `cms-button--${n}`, l && "is-busy", d && "is-locked", s),
|
|
55
55
|
disabled: a,
|
|
56
56
|
"aria-busy": l || void 0,
|
|
57
|
-
title:
|
|
57
|
+
title: d ? c ?? o : o,
|
|
58
58
|
children: [
|
|
59
|
-
l ? /* @__PURE__ */ e(
|
|
60
|
-
/* @__PURE__ */ e("span", { className: "cms-button__label", children: l && t !== void 0 ? t :
|
|
61
|
-
|
|
59
|
+
l ? /* @__PURE__ */ e(U, { name: "spinner" }) : d ? /* @__PURE__ */ e(U, { name: "lock" }) : r,
|
|
60
|
+
/* @__PURE__ */ e("span", { className: "cms-button__label", children: l && t !== void 0 ? t : h }),
|
|
61
|
+
d && c ? /* @__PURE__ */ i("span", { className: "cms-visually-hidden", children: [
|
|
62
62
|
", ",
|
|
63
63
|
c
|
|
64
64
|
] }) : null
|
|
@@ -66,45 +66,45 @@ function le({
|
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
return /* @__PURE__ */
|
|
69
|
+
function Se({ id: n, label: l, help: t, error: d, pinned: c, children: r }) {
|
|
70
|
+
return /* @__PURE__ */ i("div", { className: T("cms-field", d != null && "is-invalid"), children: [
|
|
71
71
|
/* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: n, children: l }),
|
|
72
|
-
|
|
73
|
-
c != null ? /* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */ e(
|
|
72
|
+
r,
|
|
73
|
+
c != null ? /* @__PURE__ */ i("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
|
|
74
|
+
/* @__PURE__ */ e(U, { name: "lock" }),
|
|
75
75
|
" ",
|
|
76
76
|
c
|
|
77
77
|
] }) : null,
|
|
78
|
-
|
|
78
|
+
d != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: d }) : null,
|
|
79
79
|
t != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${n}-help`, children: t }) : null
|
|
80
80
|
] });
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Ee(n, l) {
|
|
83
83
|
const t = [l.error != null && `${n}-error`, l.pinned != null && `${n}-pinned`, l.help != null && `${n}-help`].filter(Boolean).join(" ");
|
|
84
84
|
return t === "" ? void 0 : t;
|
|
85
85
|
}
|
|
86
86
|
const ze = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Ve = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
|
|
87
87
|
function Ze(n, l, t) {
|
|
88
|
-
const
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
}, c = (
|
|
88
|
+
const d = (r, m, s, h = 0, b = 0, o = 0) => {
|
|
89
|
+
const u = new Date(Date.UTC(r, m - 1, s, h, b, o));
|
|
90
|
+
return u.setUTCFullYear(r), u.getUTCFullYear() === r && u.getUTCMonth() === m - 1 && u.getUTCDate() === s && u.getUTCHours() === h && u.getUTCMinutes() === b && u.getUTCSeconds() === o ? u : null;
|
|
91
|
+
}, c = (r) => ({ hour: Number(r[1]), minute: Number(r[2]), second: Number(r[3] ?? 0) });
|
|
92
92
|
try {
|
|
93
93
|
if (n === "time") {
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
96
|
-
const
|
|
97
|
-
return
|
|
94
|
+
const m = l.match(Ve);
|
|
95
|
+
if (m === null) return l;
|
|
96
|
+
const s = c(m), h = d(2e3, 1, 1, s.hour, s.minute, s.second);
|
|
97
|
+
return h === null ? l : new Intl.DateTimeFormat(t, { timeStyle: m[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(h);
|
|
98
98
|
}
|
|
99
|
-
const
|
|
100
|
-
if (
|
|
101
|
-
if (n === "date" &&
|
|
102
|
-
const
|
|
103
|
-
return
|
|
99
|
+
const r = l.match(ze);
|
|
100
|
+
if (r === null) return l;
|
|
101
|
+
if (n === "date" && r[4] === void 0) {
|
|
102
|
+
const m = d(Number(r[1]), Number(r[2]), Number(r[3]));
|
|
103
|
+
return m === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeZone: "UTC" }).format(m);
|
|
104
104
|
}
|
|
105
|
-
if (n === "datetime-local" &&
|
|
106
|
-
const
|
|
107
|
-
return
|
|
105
|
+
if (n === "datetime-local" && r[4] !== void 0) {
|
|
106
|
+
const m = d(Number(r[1]), Number(r[2]), Number(r[3]), Number(r[4]), Number(r[5]), Number(r[6] ?? 0));
|
|
107
|
+
return m === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeStyle: r[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(m);
|
|
108
108
|
}
|
|
109
109
|
} catch {
|
|
110
110
|
return l;
|
|
@@ -112,343 +112,349 @@ function Ze(n, l, t) {
|
|
|
112
112
|
return l;
|
|
113
113
|
}
|
|
114
114
|
const We = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
|
|
115
|
-
function
|
|
116
|
-
const x =
|
|
117
|
-
return /* @__PURE__ */ e(
|
|
115
|
+
function Rn({ label: n, help: l, error: t, disabled: d, readOnly: c, pinned: r, value: m, onChange: s, placeholder: h, type: b = "text", name: o, locale: u, min: a, max: f, step: p, minLength: _, maxLength: N, required: y }) {
|
|
116
|
+
const x = Y(), C = c === !0 || r != null, S = C && We.has(b), F = b === "number" && (p === "any" || typeof p == "number" && !Number.isInteger(p));
|
|
117
|
+
return /* @__PURE__ */ e(Se, { id: x, label: n, help: l, error: t, pinned: r, children: /* @__PURE__ */ e(
|
|
118
118
|
"input",
|
|
119
119
|
{
|
|
120
120
|
id: x,
|
|
121
121
|
name: o,
|
|
122
|
-
type:
|
|
122
|
+
type: S ? "text" : b,
|
|
123
123
|
className: "cms-input",
|
|
124
|
-
value:
|
|
125
|
-
...
|
|
126
|
-
lang:
|
|
127
|
-
placeholder:
|
|
128
|
-
disabled:
|
|
129
|
-
readOnly:
|
|
130
|
-
required:
|
|
131
|
-
"aria-required":
|
|
132
|
-
min:
|
|
133
|
-
max:
|
|
134
|
-
step:
|
|
135
|
-
minLength:
|
|
124
|
+
value: S ? Ze(b, m, u) : m,
|
|
125
|
+
...S ? { "data-value": m } : {},
|
|
126
|
+
lang: u,
|
|
127
|
+
placeholder: h,
|
|
128
|
+
disabled: d,
|
|
129
|
+
readOnly: C,
|
|
130
|
+
required: y,
|
|
131
|
+
"aria-required": y || void 0,
|
|
132
|
+
min: S ? void 0 : a,
|
|
133
|
+
max: S ? void 0 : f,
|
|
134
|
+
step: S ? void 0 : p,
|
|
135
|
+
minLength: _,
|
|
136
136
|
maxLength: N,
|
|
137
|
-
inputMode:
|
|
137
|
+
inputMode: b === "number" ? F ? "decimal" : "numeric" : void 0,
|
|
138
138
|
"aria-invalid": t != null || void 0,
|
|
139
|
-
"aria-describedby":
|
|
140
|
-
onChange: (
|
|
139
|
+
"aria-describedby": Ee(x, { help: l, error: t, pinned: r }),
|
|
140
|
+
onChange: (R) => s == null ? void 0 : s(R.target.value)
|
|
141
141
|
}
|
|
142
142
|
) });
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
const
|
|
146
|
-
return /* @__PURE__ */ e(
|
|
144
|
+
function Hn({ label: n, help: l, error: t, disabled: d, readOnly: c, pinned: r, value: m, onChange: s, placeholder: h, rows: b = 4, name: o, locale: u, minLength: a, maxLength: f, required: p }) {
|
|
145
|
+
const _ = Y();
|
|
146
|
+
return /* @__PURE__ */ e(Se, { id: _, label: n, help: l, error: t, pinned: r, children: /* @__PURE__ */ e(
|
|
147
147
|
"textarea",
|
|
148
148
|
{
|
|
149
|
-
id:
|
|
149
|
+
id: _,
|
|
150
150
|
name: o,
|
|
151
151
|
className: "cms-input cms-textarea",
|
|
152
|
-
rows:
|
|
153
|
-
value:
|
|
154
|
-
lang:
|
|
155
|
-
placeholder:
|
|
156
|
-
disabled:
|
|
157
|
-
readOnly: c === !0 ||
|
|
152
|
+
rows: b,
|
|
153
|
+
value: m,
|
|
154
|
+
lang: u,
|
|
155
|
+
placeholder: h,
|
|
156
|
+
disabled: d,
|
|
157
|
+
readOnly: c === !0 || r != null,
|
|
158
158
|
required: p,
|
|
159
159
|
"aria-required": p || void 0,
|
|
160
160
|
minLength: a,
|
|
161
|
-
maxLength:
|
|
161
|
+
maxLength: f,
|
|
162
162
|
"aria-invalid": t != null || void 0,
|
|
163
|
-
"aria-describedby":
|
|
164
|
-
onChange: (N) =>
|
|
163
|
+
"aria-describedby": Ee(_, { help: l, error: t, pinned: r }),
|
|
164
|
+
onChange: (N) => s == null ? void 0 : s(N.target.value)
|
|
165
165
|
}
|
|
166
166
|
) });
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
const o =
|
|
170
|
-
return /* @__PURE__ */ e(
|
|
168
|
+
function Kn({ label: n, help: l, error: t, disabled: d, readOnly: c, value: r, options: m, onChange: s, emptyText: h = "Nothing to choose from yet.", name: b }) {
|
|
169
|
+
const o = Y(), u = m.length === 0;
|
|
170
|
+
return /* @__PURE__ */ e(Se, { id: o, label: n, help: u ? h : l, error: t, children: /* @__PURE__ */ e(
|
|
171
171
|
"select",
|
|
172
172
|
{
|
|
173
173
|
id: o,
|
|
174
|
-
name:
|
|
174
|
+
name: b,
|
|
175
175
|
className: "cms-input cms-select",
|
|
176
|
-
value:
|
|
177
|
-
disabled:
|
|
176
|
+
value: r,
|
|
177
|
+
disabled: d || u,
|
|
178
178
|
"aria-readonly": c || void 0,
|
|
179
179
|
"aria-invalid": t != null || void 0,
|
|
180
|
-
"aria-describedby":
|
|
180
|
+
"aria-describedby": Ee(o, { help: u ? h : l, error: t }),
|
|
181
181
|
onChange: (a) => {
|
|
182
|
-
c ||
|
|
182
|
+
c || s == null || s(a.target.value);
|
|
183
183
|
},
|
|
184
|
-
children:
|
|
184
|
+
children: m.map((a) => /* @__PURE__ */ e("option", { value: a.value, disabled: c && a.value !== r, children: a.label }, a.value))
|
|
185
185
|
}
|
|
186
186
|
) });
|
|
187
187
|
}
|
|
188
|
-
function On({ label: n, checked: l, onChange: t, disabled:
|
|
189
|
-
const
|
|
190
|
-
return /* @__PURE__ */
|
|
188
|
+
function On({ label: n, checked: l, onChange: t, disabled: d, readOnly: c, help: r }) {
|
|
189
|
+
const m = Y();
|
|
190
|
+
return /* @__PURE__ */ i("div", { className: "cms-toggle-row", children: [
|
|
191
191
|
/* @__PURE__ */ e(
|
|
192
192
|
"button",
|
|
193
193
|
{
|
|
194
|
-
id:
|
|
194
|
+
id: m,
|
|
195
195
|
type: "button",
|
|
196
196
|
role: "switch",
|
|
197
|
-
className:
|
|
197
|
+
className: T("cms-toggle", l && "is-on"),
|
|
198
198
|
"aria-checked": l,
|
|
199
199
|
"aria-readonly": c || void 0,
|
|
200
|
-
"aria-describedby":
|
|
201
|
-
disabled:
|
|
200
|
+
"aria-describedby": r != null ? `${m}-help` : void 0,
|
|
201
|
+
disabled: d,
|
|
202
202
|
onClick: () => {
|
|
203
203
|
c || t == null || t(!l);
|
|
204
204
|
},
|
|
205
205
|
children: /* @__PURE__ */ e("span", { className: "cms-toggle__thumb" })
|
|
206
206
|
}
|
|
207
207
|
),
|
|
208
|
-
/* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor:
|
|
209
|
-
|
|
208
|
+
/* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor: m, children: n }),
|
|
209
|
+
r != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${m}-help`, children: r }) : null
|
|
210
210
|
] });
|
|
211
211
|
}
|
|
212
212
|
const je = 150;
|
|
213
|
-
function
|
|
214
|
-
const [o,
|
|
215
|
-
if (
|
|
213
|
+
function Be({ open: n, title: l, onClose: t, dirty: d = !1, onDirtyClose: c, children: r, footer: m, closeLabel: s = "Close", initialFocus: h, className: b }) {
|
|
214
|
+
const [o, u] = E(n), [a, f] = E(!1), p = I(null), _ = I(null), N = Y();
|
|
215
|
+
if (q(() => {
|
|
216
216
|
if (n) {
|
|
217
|
-
|
|
217
|
+
_.current = document.activeElement, u(!0), f(!1);
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
220
|
if (!o) return;
|
|
221
|
-
|
|
221
|
+
f(!0);
|
|
222
222
|
const x = window.setTimeout(() => {
|
|
223
|
-
var
|
|
224
|
-
|
|
223
|
+
var C, S;
|
|
224
|
+
u(!1), f(!1), (S = (C = _.current) == null ? void 0 : C.focus) == null || S.call(C);
|
|
225
225
|
}, je);
|
|
226
226
|
return () => window.clearTimeout(x);
|
|
227
|
-
}, [n, o]),
|
|
228
|
-
var x,
|
|
227
|
+
}, [n, o]), q(() => {
|
|
228
|
+
var x, C;
|
|
229
229
|
if (n && o) {
|
|
230
|
-
const
|
|
231
|
-
(
|
|
230
|
+
const S = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
|
|
231
|
+
(C = (h == null ? void 0 : h.current) ?? ((x = p.current) == null ? void 0 : x.querySelector(`.cms-modal__body :is(${S}), .cms-modal__foot :is(${S})`)) ?? p.current) == null || C.focus();
|
|
232
232
|
}
|
|
233
|
-
}, [n, o,
|
|
234
|
-
const
|
|
235
|
-
|
|
233
|
+
}, [n, o, h]), !o) return null;
|
|
234
|
+
const y = () => {
|
|
235
|
+
d ? c == null || c() : t();
|
|
236
236
|
};
|
|
237
|
-
return
|
|
238
|
-
/* @__PURE__ */ e("div", { className:
|
|
239
|
-
x.target === x.currentTarget &&
|
|
240
|
-
}, children: /* @__PURE__ */
|
|
237
|
+
return Ce(
|
|
238
|
+
/* @__PURE__ */ e("div", { className: T("cms-modal-scrim", a && "is-closing"), onMouseDown: (x) => {
|
|
239
|
+
x.target === x.currentTarget && y();
|
|
240
|
+
}, children: /* @__PURE__ */ i(
|
|
241
241
|
"div",
|
|
242
242
|
{
|
|
243
243
|
ref: p,
|
|
244
|
-
className:
|
|
244
|
+
className: T("cms-modal", b, a && "is-closing", d && "is-dirty"),
|
|
245
245
|
role: "dialog",
|
|
246
246
|
"aria-modal": "true",
|
|
247
247
|
"aria-labelledby": N,
|
|
248
248
|
tabIndex: -1,
|
|
249
249
|
onKeyDown: (x) => {
|
|
250
|
-
var
|
|
250
|
+
var C;
|
|
251
251
|
if (x.key === "Escape")
|
|
252
|
-
x.stopPropagation(),
|
|
252
|
+
x.stopPropagation(), y();
|
|
253
253
|
else if (x.key === "Tab") {
|
|
254
|
-
const
|
|
255
|
-
if (!
|
|
256
|
-
const
|
|
257
|
-
x.shiftKey && document.activeElement ===
|
|
254
|
+
const S = (C = p.current) == null ? void 0 : C.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
|
|
255
|
+
if (!S || S.length === 0) return;
|
|
256
|
+
const F = S[0], R = S[S.length - 1];
|
|
257
|
+
x.shiftKey && document.activeElement === F ? (x.preventDefault(), R.focus()) : !x.shiftKey && document.activeElement === R && (x.preventDefault(), F.focus());
|
|
258
258
|
}
|
|
259
259
|
},
|
|
260
260
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ i("header", { className: "cms-modal__head", children: [
|
|
262
262
|
/* @__PURE__ */ e("h2", { className: "cms-modal__title", id: N, children: l }),
|
|
263
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
263
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": s, onClick: y, children: /* @__PURE__ */ e(U, { name: "close" }) })
|
|
264
264
|
] }),
|
|
265
|
-
/* @__PURE__ */ e("div", { className: "cms-modal__body", children:
|
|
266
|
-
|
|
265
|
+
/* @__PURE__ */ e("div", { className: "cms-modal__body", children: r }),
|
|
266
|
+
m != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: m }) : null
|
|
267
267
|
]
|
|
268
268
|
}
|
|
269
269
|
) }),
|
|
270
270
|
document.body
|
|
271
271
|
);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
const
|
|
273
|
+
function Un({ open: n, title: l, message: t, kind: d = "default", confirmLabel: c, cancelLabel: r, closeLabel: m, onConfirm: s, onCancel: h }) {
|
|
274
|
+
const b = d === "discard-changes";
|
|
275
275
|
return /* @__PURE__ */ e(
|
|
276
|
-
|
|
276
|
+
Be,
|
|
277
277
|
{
|
|
278
278
|
open: n,
|
|
279
279
|
title: l,
|
|
280
|
-
onClose:
|
|
281
|
-
...
|
|
282
|
-
footer: /* @__PURE__ */
|
|
283
|
-
/* @__PURE__ */ e(
|
|
284
|
-
/* @__PURE__ */ e(
|
|
280
|
+
onClose: h,
|
|
281
|
+
...m === void 0 ? {} : { closeLabel: m },
|
|
282
|
+
footer: /* @__PURE__ */ i(M, { children: [
|
|
283
|
+
/* @__PURE__ */ e(te, { onClick: h, children: r ?? (b ? "Keep editing" : "Cancel") }),
|
|
284
|
+
/* @__PURE__ */ e(te, { variant: d === "default" ? "primary" : "danger", onClick: s, children: c ?? (b ? "Discard changes" : "Confirm") })
|
|
285
285
|
] }),
|
|
286
|
-
children:
|
|
287
|
-
/* @__PURE__ */ e(
|
|
286
|
+
children: d !== "default" ? /* @__PURE__ */ i("p", { className: "cms-confirm__warning", children: [
|
|
287
|
+
/* @__PURE__ */ e(U, { name: "warning" }),
|
|
288
288
|
" ",
|
|
289
289
|
t
|
|
290
290
|
] }) : /* @__PURE__ */ e("p", { children: t })
|
|
291
291
|
}
|
|
292
292
|
);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
return /* @__PURE__ */
|
|
296
|
-
/* @__PURE__ */ e(
|
|
294
|
+
function zn({ kind: n, message: l, action: t, onDismiss: d, dismissLabel: c = "Dismiss" }) {
|
|
295
|
+
return /* @__PURE__ */ i("div", { className: T("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
|
|
296
|
+
/* @__PURE__ */ e(U, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
|
|
297
297
|
/* @__PURE__ */ e("span", { className: "cms-toast__message", children: l }),
|
|
298
|
-
t ? /* @__PURE__ */ e(
|
|
299
|
-
|
|
298
|
+
t ? /* @__PURE__ */ e(te, { className: "cms-toast__action", onClick: t.onAction, children: t.label }) : null,
|
|
299
|
+
d ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": c, onClick: d, children: /* @__PURE__ */ e(U, { name: "close" }) }) : null
|
|
300
300
|
] });
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function Vn({ children: n }) {
|
|
303
303
|
return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: n });
|
|
304
304
|
}
|
|
305
305
|
function qe({ what: n, layout: l = "inline" }) {
|
|
306
|
-
return /* @__PURE__ */
|
|
307
|
-
/* @__PURE__ */ e(
|
|
306
|
+
return /* @__PURE__ */ i("div", { className: T("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
|
|
307
|
+
/* @__PURE__ */ e(U, { name: "spinner" }),
|
|
308
308
|
/* @__PURE__ */ e("span", { children: n })
|
|
309
309
|
] });
|
|
310
310
|
}
|
|
311
311
|
function Ye({ title: n, hint: l, action: t }) {
|
|
312
|
-
return /* @__PURE__ */
|
|
312
|
+
return /* @__PURE__ */ i("div", { className: "cms-empty", children: [
|
|
313
313
|
/* @__PURE__ */ e("p", { className: "cms-empty__title", children: n }),
|
|
314
314
|
l != null ? /* @__PURE__ */ e("p", { className: "cms-empty__hint", children: l }) : null,
|
|
315
315
|
t != null ? /* @__PURE__ */ e("div", { className: "cms-empty__action", children: t }) : null
|
|
316
316
|
] });
|
|
317
317
|
}
|
|
318
318
|
function Ge({ message: n, onRetry: l, retryLabel: t = "Try again" }) {
|
|
319
|
-
return /* @__PURE__ */
|
|
320
|
-
/* @__PURE__ */ e(
|
|
319
|
+
return /* @__PURE__ */ i("div", { className: "cms-error-banner", role: "alert", children: [
|
|
320
|
+
/* @__PURE__ */ e(U, { name: "warning" }),
|
|
321
321
|
/* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: n }),
|
|
322
|
-
l ? /* @__PURE__ */ e(
|
|
322
|
+
l ? /* @__PURE__ */ e(te, { onClick: l, children: t }) : null
|
|
323
323
|
] });
|
|
324
324
|
}
|
|
325
|
-
const
|
|
326
|
-
mail: /* @__PURE__ */
|
|
325
|
+
const Fe = {
|
|
326
|
+
mail: /* @__PURE__ */ i(M, { children: [
|
|
327
327
|
/* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
328
328
|
/* @__PURE__ */ e("path", { d: "m3 7 9 6 9-6" })
|
|
329
329
|
] }),
|
|
330
|
+
// A gear: a ring with eight short teeth, the hole in its middle.
|
|
331
|
+
settings: /* @__PURE__ */ i(M, { children: [
|
|
332
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" }),
|
|
333
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "7" }),
|
|
334
|
+
/* @__PURE__ */ e("path", { d: "M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9 7 7M17 17l2.1 2.1M4.9 19.1 7 17M17 7l2.1-2.1" })
|
|
335
|
+
] }),
|
|
330
336
|
// The envelope with its flap open above it: a message read, or the message itself again.
|
|
331
|
-
"mail-open": /* @__PURE__ */
|
|
337
|
+
"mail-open": /* @__PURE__ */ i(M, { children: [
|
|
332
338
|
/* @__PURE__ */ e("path", { d: "M3 10v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9" }),
|
|
333
339
|
/* @__PURE__ */ e("path", { d: "m3 10 9-6 9 6" }),
|
|
334
340
|
/* @__PURE__ */ e("path", { d: "m3 10 9 6 9-6" })
|
|
335
341
|
] }),
|
|
336
342
|
// A clipboard: copy what is shown.
|
|
337
|
-
copy: /* @__PURE__ */
|
|
343
|
+
copy: /* @__PURE__ */ i(M, { children: [
|
|
338
344
|
/* @__PURE__ */ e("rect", { x: "6", y: "4", width: "12", height: "17", rx: "2" }),
|
|
339
345
|
/* @__PURE__ */ e("path", { d: "M9 4V3h6v1" }),
|
|
340
346
|
/* @__PURE__ */ e("path", { d: "M9 10h6M9 14h6M9 18h3" })
|
|
341
347
|
] }),
|
|
342
348
|
chat: /* @__PURE__ */ e("path", { d: "M4 12a8 8 0 1 1 4 6.9L4 20l1.1-4A8 8 0 0 1 4 12Z" }),
|
|
343
349
|
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" }),
|
|
344
|
-
calendar: /* @__PURE__ */
|
|
350
|
+
calendar: /* @__PURE__ */ i(M, { children: [
|
|
345
351
|
/* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "16", rx: "2" }),
|
|
346
352
|
/* @__PURE__ */ e("path", { d: "M3 10h18M8 3v4M16 3v4" })
|
|
347
353
|
] }),
|
|
348
|
-
file: /* @__PURE__ */
|
|
354
|
+
file: /* @__PURE__ */ i(M, { children: [
|
|
349
355
|
/* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
|
|
350
356
|
/* @__PURE__ */ e("path", { d: "M14 3v6h6M8 13h8M8 17h6" })
|
|
351
357
|
] }),
|
|
352
358
|
// The file, with code's angle brackets in place of its lines: a message's source.
|
|
353
|
-
"file-code": /* @__PURE__ */
|
|
359
|
+
"file-code": /* @__PURE__ */ i(M, { children: [
|
|
354
360
|
/* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
|
|
355
361
|
/* @__PURE__ */ e("path", { d: "M14 3v6h6" }),
|
|
356
362
|
/* @__PURE__ */ e("path", { d: "m10 12-2 2.5 2 2.5M14 12l2 2.5-2 2.5" })
|
|
357
363
|
] }),
|
|
358
|
-
image: /* @__PURE__ */
|
|
364
|
+
image: /* @__PURE__ */ i(M, { children: [
|
|
359
365
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
|
|
360
366
|
/* @__PURE__ */ e("circle", { cx: "9", cy: "10", r: "2" }),
|
|
361
367
|
/* @__PURE__ */ e("path", { d: "m21 17-5-5-9 8" })
|
|
362
368
|
] }),
|
|
363
|
-
search: /* @__PURE__ */
|
|
369
|
+
search: /* @__PURE__ */ i(M, { children: [
|
|
364
370
|
/* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "7" }),
|
|
365
371
|
/* @__PURE__ */ e("path", { d: "m20 20-4-4" })
|
|
366
372
|
] }),
|
|
367
|
-
bell: /* @__PURE__ */
|
|
373
|
+
bell: /* @__PURE__ */ i(M, { children: [
|
|
368
374
|
/* @__PURE__ */ e("path", { d: "M6 9a6 6 0 1 1 12 0c0 6 2 8 2 8H4s2-2 2-8Z" }),
|
|
369
375
|
/* @__PURE__ */ e("path", { d: "M10 20a2 2 0 0 0 4 0" })
|
|
370
376
|
] }),
|
|
371
|
-
pencil: /* @__PURE__ */
|
|
377
|
+
pencil: /* @__PURE__ */ i(M, { children: [
|
|
372
378
|
/* @__PURE__ */ e("path", { d: "M4 20h4L19 9l-4-4L4 16Z" }),
|
|
373
379
|
/* @__PURE__ */ e("path", { d: "m13 7 4 4" })
|
|
374
380
|
] }),
|
|
375
|
-
download: /* @__PURE__ */
|
|
381
|
+
download: /* @__PURE__ */ i(M, { children: [
|
|
376
382
|
/* @__PURE__ */ e("path", { d: "M12 4v11" }),
|
|
377
383
|
/* @__PURE__ */ e("path", { d: "m7 11 5 5 5-5" }),
|
|
378
384
|
/* @__PURE__ */ e("path", { d: "M4 20h16" })
|
|
379
385
|
] }),
|
|
380
386
|
// Download's arrow turned up, from the line: a file sent up.
|
|
381
|
-
upload: /* @__PURE__ */
|
|
387
|
+
upload: /* @__PURE__ */ i(M, { children: [
|
|
382
388
|
/* @__PURE__ */ e("path", { d: "M12 20V9" }),
|
|
383
389
|
/* @__PURE__ */ e("path", { d: "m7 13 5-5 5 5" }),
|
|
384
390
|
/* @__PURE__ */ e("path", { d: "M4 4h16" })
|
|
385
391
|
] }),
|
|
386
|
-
print: /* @__PURE__ */
|
|
392
|
+
print: /* @__PURE__ */ i(M, { children: [
|
|
387
393
|
/* @__PURE__ */ e("path", { d: "M7 8V4h10v4" }),
|
|
388
394
|
/* @__PURE__ */ e("rect", { x: "3", y: "8", width: "18", height: "8", rx: "2" }),
|
|
389
395
|
/* @__PURE__ */ e("path", { d: "M7 14h10v6H7Z" })
|
|
390
396
|
] }),
|
|
391
|
-
"open-separately": /* @__PURE__ */
|
|
397
|
+
"open-separately": /* @__PURE__ */ i(M, { children: [
|
|
392
398
|
/* @__PURE__ */ e("path", { d: "M14 4h6v6" }),
|
|
393
399
|
/* @__PURE__ */ e("path", { d: "m20 4-9 9" }),
|
|
394
400
|
/* @__PURE__ */ e("path", { d: "M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5" })
|
|
395
401
|
] }),
|
|
396
402
|
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" }),
|
|
397
|
-
send: /* @__PURE__ */
|
|
403
|
+
send: /* @__PURE__ */ i(M, { children: [
|
|
398
404
|
/* @__PURE__ */ e("path", { d: "M21 3 10 14" }),
|
|
399
405
|
/* @__PURE__ */ e("path", { d: "M21 3 14 21l-4-7-7-4Z" })
|
|
400
406
|
] }),
|
|
401
|
-
inbox: /* @__PURE__ */
|
|
407
|
+
inbox: /* @__PURE__ */ i(M, { children: [
|
|
402
408
|
/* @__PURE__ */ e("path", { d: "M3 13h5l1 3h6l1-3h5" }),
|
|
403
409
|
/* @__PURE__ */ e("path", { d: "M5 5h14l2 8v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" })
|
|
404
410
|
] }),
|
|
405
|
-
archive: /* @__PURE__ */
|
|
411
|
+
archive: /* @__PURE__ */ i(M, { children: [
|
|
406
412
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "5", rx: "1" }),
|
|
407
413
|
/* @__PURE__ */ e("path", { d: "M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4" })
|
|
408
414
|
] }),
|
|
409
|
-
trash: /* @__PURE__ */
|
|
415
|
+
trash: /* @__PURE__ */ i(M, { children: [
|
|
410
416
|
/* @__PURE__ */ e("path", { d: "M4 7h16M10 11v6M14 11v6" }),
|
|
411
417
|
/* @__PURE__ */ e("path", { d: "M6 7l1 13a2 2 0 0 0 2 1h6a2 2 0 0 0 2-1l1-13M9 7V4h6v3" })
|
|
412
418
|
] }),
|
|
413
419
|
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" }),
|
|
414
|
-
mic: /* @__PURE__ */
|
|
420
|
+
mic: /* @__PURE__ */ i(M, { children: [
|
|
415
421
|
/* @__PURE__ */ e("rect", { x: "9", y: "3", width: "6", height: "11", rx: "3" }),
|
|
416
422
|
/* @__PURE__ */ e("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v3" })
|
|
417
423
|
] }),
|
|
418
|
-
speaker: /* @__PURE__ */
|
|
424
|
+
speaker: /* @__PURE__ */ i(M, { children: [
|
|
419
425
|
/* @__PURE__ */ e("path", { d: "M4 9h4l5-4v14l-5-4H4Z" }),
|
|
420
426
|
/* @__PURE__ */ e("path", { d: "M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12" })
|
|
421
427
|
] }),
|
|
422
|
-
"user-plus": /* @__PURE__ */
|
|
428
|
+
"user-plus": /* @__PURE__ */ i(M, { children: [
|
|
423
429
|
/* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
|
|
424
430
|
/* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M19 8v6M16 11h6" })
|
|
425
431
|
] }),
|
|
426
432
|
// A person, nothing more: one whose account is gone.
|
|
427
|
-
user: /* @__PURE__ */
|
|
433
|
+
user: /* @__PURE__ */ i(M, { children: [
|
|
428
434
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "8", r: "4" }),
|
|
429
435
|
/* @__PURE__ */ e("path", { d: "M4 21a8 8 0 0 1 16 0" })
|
|
430
436
|
] }),
|
|
431
437
|
// A person with a tick: someone allowed.
|
|
432
|
-
"user-check": /* @__PURE__ */
|
|
438
|
+
"user-check": /* @__PURE__ */ i(M, { children: [
|
|
433
439
|
/* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
|
|
434
440
|
/* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M16 11l2 2 4-4" })
|
|
435
441
|
] }),
|
|
436
442
|
// A person with a cross: someone no longer allowed.
|
|
437
|
-
"user-x": /* @__PURE__ */
|
|
443
|
+
"user-x": /* @__PURE__ */ i(M, { children: [
|
|
438
444
|
/* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
|
|
439
445
|
/* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M17 8l4 4M21 8l-4 4" })
|
|
440
446
|
] }),
|
|
441
447
|
// Two people: the members of a group.
|
|
442
|
-
users: /* @__PURE__ */
|
|
448
|
+
users: /* @__PURE__ */ i(M, { children: [
|
|
443
449
|
/* @__PURE__ */ e("circle", { cx: "9", cy: "8", r: "3.5" }),
|
|
444
450
|
/* @__PURE__ */ e("path", { d: "M2.5 20a6.5 6.5 0 0 1 13 0M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14a6.5 6.5 0 0 1 3.5 6" })
|
|
445
451
|
] }),
|
|
446
452
|
"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" }),
|
|
447
|
-
video: /* @__PURE__ */
|
|
453
|
+
video: /* @__PURE__ */ i(M, { children: [
|
|
448
454
|
/* @__PURE__ */ e("rect", { x: "3", y: "6", width: "13", height: "12", rx: "2" }),
|
|
449
455
|
/* @__PURE__ */ e("path", { d: "m16 10 5-3v10l-5-3" })
|
|
450
456
|
] }),
|
|
451
|
-
info: /* @__PURE__ */
|
|
457
|
+
info: /* @__PURE__ */ i(M, { children: [
|
|
452
458
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
|
|
453
459
|
/* @__PURE__ */ e("path", { d: "M12 11v6M12 7.5v.5" })
|
|
454
460
|
] }),
|
|
@@ -457,17 +463,17 @@ const Be = {
|
|
|
457
463
|
plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
|
|
458
464
|
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" }),
|
|
459
465
|
// The folder with a plus inside: a new folder.
|
|
460
|
-
"folder-plus": /* @__PURE__ */
|
|
466
|
+
"folder-plus": /* @__PURE__ */ i(M, { children: [
|
|
461
467
|
/* @__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" }),
|
|
462
468
|
/* @__PURE__ */ e("path", { d: "M12 10.5v6M9 13.5h6" })
|
|
463
469
|
] }),
|
|
464
470
|
// The folder with a cross inside: a folder removed.
|
|
465
|
-
"folder-x": /* @__PURE__ */
|
|
471
|
+
"folder-x": /* @__PURE__ */ i(M, { children: [
|
|
466
472
|
/* @__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" }),
|
|
467
473
|
/* @__PURE__ */ e("path", { d: "m9.5 11 5 5M14.5 11l-5 5" })
|
|
468
474
|
] }),
|
|
469
475
|
check: /* @__PURE__ */ e("path", { d: "m5 12 5 5 9-10" }),
|
|
470
|
-
server: /* @__PURE__ */
|
|
476
|
+
server: /* @__PURE__ */ i(M, { children: [
|
|
471
477
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "7", rx: "2" }),
|
|
472
478
|
/* @__PURE__ */ e("rect", { x: "3", y: "13", width: "18", height: "7", rx: "2" }),
|
|
473
479
|
/* @__PURE__ */ e("path", { d: "M7 7.5h.5M7 16.5h.5" })
|
|
@@ -479,7 +485,7 @@ const Be = {
|
|
|
479
485
|
more: /* @__PURE__ */ e("path", { d: "M5 12h.5M12 12h.5M19 12h.5" }),
|
|
480
486
|
important: /* @__PURE__ */ e("path", { d: "M4 6h11l5 6-5 6H4l4-6-4-6Z" })
|
|
481
487
|
};
|
|
482
|
-
function
|
|
488
|
+
function A({ name: n, size: l = 20, label: t }) {
|
|
483
489
|
return /* @__PURE__ */ e(
|
|
484
490
|
"svg",
|
|
485
491
|
{
|
|
@@ -494,11 +500,11 @@ function T({ name: n, size: l = 20, label: t }) {
|
|
|
494
500
|
strokeLinejoin: "round",
|
|
495
501
|
focusable: !1,
|
|
496
502
|
...t ? { role: "img", "aria-label": t } : { "aria-hidden": !0 },
|
|
497
|
-
children:
|
|
503
|
+
children: Fe[n]
|
|
498
504
|
}
|
|
499
505
|
);
|
|
500
506
|
}
|
|
501
|
-
const
|
|
507
|
+
const Zn = Object.keys(Fe), Te = {
|
|
502
508
|
reply: "reply",
|
|
503
509
|
"reply-all": "reply",
|
|
504
510
|
forward: "forward",
|
|
@@ -525,6 +531,9 @@ const Vn = Object.keys(Be), Ae = {
|
|
|
525
531
|
"person-x": "user-x",
|
|
526
532
|
"arrow-left": "chevron-left",
|
|
527
533
|
"pencil-square": "pencil",
|
|
534
|
+
"plus-lg": "plus",
|
|
535
|
+
gear: "settings",
|
|
536
|
+
upload: "upload",
|
|
528
537
|
"cloud-upload": "upload",
|
|
529
538
|
people: "users",
|
|
530
539
|
"file-earmark-word": "file",
|
|
@@ -536,8 +545,8 @@ const Vn = Object.keys(Be), Ae = {
|
|
|
536
545
|
images: "image",
|
|
537
546
|
paperclip: "paperclip"
|
|
538
547
|
};
|
|
539
|
-
function
|
|
540
|
-
return Object.prototype.hasOwnProperty.call(
|
|
548
|
+
function ce(n) {
|
|
549
|
+
return Object.prototype.hasOwnProperty.call(Te, n) ? Te[n] : null;
|
|
541
550
|
}
|
|
542
551
|
function Xe() {
|
|
543
552
|
try {
|
|
@@ -549,47 +558,47 @@ function Xe() {
|
|
|
549
558
|
const Le = /* @__PURE__ */ new Set();
|
|
550
559
|
function Je({ name: n, size: l = 18 }) {
|
|
551
560
|
if (n === "") return null;
|
|
552
|
-
const t =
|
|
553
|
-
return t !== null ? /* @__PURE__ */ e(
|
|
561
|
+
const t = ce(n);
|
|
562
|
+
return t !== null ? /* @__PURE__ */ e(A, { name: t, size: l }) : (!Le.has(n) && Xe() && (Le.add(n), console.warn(`@coolms/ui-react: no icon for the server's icon name "${n}"; its space is kept empty`)), /* @__PURE__ */ e("span", { className: "cms-icon cms-icon--blank", style: { width: l, height: l }, "aria-hidden": "true", "data-icon-name": n }));
|
|
554
563
|
}
|
|
555
|
-
const
|
|
564
|
+
const ke = 300;
|
|
556
565
|
function Qe() {
|
|
557
|
-
if (typeof window > "u" || typeof getComputedStyle != "function") return
|
|
566
|
+
if (typeof window > "u" || typeof getComputedStyle != "function") return ke;
|
|
558
567
|
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;
|
|
559
|
-
return Number.isFinite(l) && l >= 0 ? l :
|
|
568
|
+
return Number.isFinite(l) && l >= 0 ? l : ke;
|
|
560
569
|
}
|
|
561
570
|
function en() {
|
|
562
|
-
return /* @__PURE__ */
|
|
571
|
+
return /* @__PURE__ */ i("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
|
|
563
572
|
/* @__PURE__ */ e("circle", { className: "cms-state__track", cx: "12", cy: "12", r: "10", fill: "none" }),
|
|
564
573
|
/* @__PURE__ */ e("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
|
|
565
574
|
] });
|
|
566
575
|
}
|
|
567
|
-
function
|
|
568
|
-
const [
|
|
569
|
-
return
|
|
576
|
+
function le({ kind: n, title: l, description: t, action: d, placement: c = "block", icon: r }) {
|
|
577
|
+
const [m, s] = E(n !== "loading");
|
|
578
|
+
return q(() => {
|
|
570
579
|
if (n !== "loading") {
|
|
571
|
-
|
|
580
|
+
s(!0);
|
|
572
581
|
return;
|
|
573
582
|
}
|
|
574
|
-
|
|
575
|
-
const
|
|
576
|
-
return () => window.clearTimeout(
|
|
577
|
-
}, [n]), /* @__PURE__ */
|
|
583
|
+
s(!1);
|
|
584
|
+
const h = window.setTimeout(() => s(!0), Qe());
|
|
585
|
+
return () => window.clearTimeout(h);
|
|
586
|
+
}, [n]), /* @__PURE__ */ i(
|
|
578
587
|
"div",
|
|
579
588
|
{
|
|
580
|
-
className:
|
|
589
|
+
className: T("cms-state", `cms-state--${n}`, `cms-state--${c}`, !m && "is-waiting"),
|
|
581
590
|
role: "status",
|
|
582
591
|
"aria-live": "polite",
|
|
583
592
|
"data-kind": n,
|
|
584
593
|
children: [
|
|
585
594
|
n === "loading" ? /* @__PURE__ */ e(en, {}) : null,
|
|
586
|
-
n === "error" || n === "denied" ? /* @__PURE__ */ e(
|
|
587
|
-
n === "empty" &&
|
|
588
|
-
/* @__PURE__ */
|
|
595
|
+
n === "error" || n === "denied" ? /* @__PURE__ */ e(U, { name: n === "error" ? "warning" : "lock" }) : null,
|
|
596
|
+
n === "empty" && r !== void 0 && ce(r) !== null ? /* @__PURE__ */ e("span", { className: "cms-state__icon", "aria-hidden": "true", children: /* @__PURE__ */ e(Je, { name: r, size: c === "page" ? 32 : 24 }) }) : null,
|
|
597
|
+
/* @__PURE__ */ i("span", { className: "cms-state__text", children: [
|
|
589
598
|
/* @__PURE__ */ e("span", { className: "cms-state__title", children: l }),
|
|
590
599
|
t !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-state__description", children: t }) : null
|
|
591
600
|
] }),
|
|
592
|
-
|
|
601
|
+
d !== void 0 && n !== "denied" ? /* @__PURE__ */ e(te, { className: "cms-state__action", onClick: d.onAction, children: d.label }) : null
|
|
593
602
|
]
|
|
594
603
|
}
|
|
595
604
|
);
|
|
@@ -604,106 +613,106 @@ function an(n) {
|
|
|
604
613
|
function sn(n) {
|
|
605
614
|
return n.getClientRects().length > 0;
|
|
606
615
|
}
|
|
607
|
-
function
|
|
608
|
-
const { name: l, badge: t, closeLabel:
|
|
609
|
-
|
|
616
|
+
function Wn(n) {
|
|
617
|
+
const { name: l, badge: t, closeLabel: d, onClose: c, actions: r = [], moreLabel: m = "More", edit: s, editing: h, state: b, siblings: o, bar: u, thumbnails: a, strip: f, onZoom: p, children: _ } = n, N = I(null), y = I(null), x = Y(), [C, S] = E(!1), F = I(null);
|
|
618
|
+
q(() => {
|
|
610
619
|
var Z;
|
|
611
|
-
const
|
|
612
|
-
return document.body.style.overflow = "hidden", (Z =
|
|
613
|
-
var
|
|
614
|
-
document.body.style.overflow =
|
|
620
|
+
const w = document.activeElement, B = document.body.style.overflow;
|
|
621
|
+
return document.body.style.overflow = "hidden", (Z = y.current) == null || Z.focus(), () => {
|
|
622
|
+
var z;
|
|
623
|
+
document.body.style.overflow = B, (z = w == null ? void 0 : w.focus) == null || z.call(w);
|
|
615
624
|
};
|
|
616
625
|
}, []);
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
},
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
},
|
|
623
|
-
var
|
|
624
|
-
const
|
|
625
|
-
if (
|
|
626
|
-
const
|
|
627
|
-
Math.abs(
|
|
626
|
+
const R = () => {
|
|
627
|
+
h != null && h.dirty ? h.onDirtyClose() : c();
|
|
628
|
+
}, Q = (w) => {
|
|
629
|
+
const B = w.touches.length === 1 ? w.touches[0] : void 0;
|
|
630
|
+
F.current = B === void 0 || h !== void 0 || an(w.target) ? null : { x: B.clientX, y: B.clientY };
|
|
631
|
+
}, G = (w) => {
|
|
632
|
+
var H, W;
|
|
633
|
+
const B = F.current, Z = w.changedTouches[0];
|
|
634
|
+
if (F.current = null, B === null || Z === void 0) return;
|
|
635
|
+
const z = Z.clientX - B.x;
|
|
636
|
+
Math.abs(z) < ln || Math.abs(z) < Math.abs(Z.clientY - B.y) || (z > 0 ? (H = o == null ? void 0 : o.onPrevious) == null || H.call(o) : (W = o == null ? void 0 : o.onNext) == null || W.call(o));
|
|
628
637
|
};
|
|
629
|
-
return
|
|
630
|
-
/* @__PURE__ */
|
|
638
|
+
return Ce(
|
|
639
|
+
/* @__PURE__ */ i(
|
|
631
640
|
"div",
|
|
632
641
|
{
|
|
633
642
|
ref: N,
|
|
634
|
-
className:
|
|
643
|
+
className: T("cms-viewer", h !== void 0 && "is-editing"),
|
|
635
644
|
role: "dialog",
|
|
636
645
|
"aria-modal": "true",
|
|
637
646
|
"aria-labelledby": x,
|
|
638
647
|
tabIndex: -1,
|
|
639
|
-
onKeyDown: (
|
|
640
|
-
var
|
|
641
|
-
if (
|
|
642
|
-
if (
|
|
643
|
-
|
|
644
|
-
} else if (
|
|
645
|
-
const
|
|
646
|
-
if (
|
|
647
|
-
const
|
|
648
|
-
|
|
649
|
-
} else
|
|
648
|
+
onKeyDown: (w) => {
|
|
649
|
+
var B, Z, z;
|
|
650
|
+
if (w.key === "Escape") {
|
|
651
|
+
if (h !== void 0) return;
|
|
652
|
+
w.stopPropagation(), C ? S(!1) : c();
|
|
653
|
+
} else if (w.key === "Tab") {
|
|
654
|
+
const H = Array.from(((B = N.current) == null ? void 0 : B.querySelectorAll(nn)) ?? []).filter(sn);
|
|
655
|
+
if (H.length === 0) return;
|
|
656
|
+
const W = H[0], j = H[H.length - 1];
|
|
657
|
+
w.shiftKey && document.activeElement === W ? (w.preventDefault(), j.focus()) : !w.shiftKey && document.activeElement === j && (w.preventDefault(), W.focus());
|
|
658
|
+
} else h === void 0 && !tn(w.target) && !w.ctrlKey && !w.metaKey && !w.altKey && (w.key === "ArrowLeft" ? (Z = o == null ? void 0 : o.onPrevious) == null || Z.call(o) : w.key === "ArrowRight" ? (z = o == null ? void 0 : o.onNext) == null || z.call(o) : w.key === "+" || w.key === "=" ? p == null || p("in") : w.key === "-" ? p == null || p("out") : w.key === "0" && (p == null || p("reset")));
|
|
650
659
|
},
|
|
651
660
|
children: [
|
|
652
661
|
o !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${o.position}` }) : null,
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
/* @__PURE__ */ e("button", { ref:
|
|
662
|
+
/* @__PURE__ */ i("header", { className: "cms-viewer__top", children: [
|
|
663
|
+
/* @__PURE__ */ e("button", { ref: y, type: "button", className: "cms-viewer__icon", "aria-label": d, onClick: R, children: /* @__PURE__ */ e(U, { name: "close" }) }),
|
|
655
664
|
/* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: t }),
|
|
656
665
|
/* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: x, title: l, children: l }),
|
|
657
666
|
o !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: o.position }) : null,
|
|
658
667
|
/* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
|
|
659
|
-
|
|
660
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children:
|
|
661
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick:
|
|
662
|
-
] }) : /* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children:
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
] },
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children:
|
|
668
|
+
h !== void 0 ? /* @__PURE__ */ i(M, { children: [
|
|
669
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: h.status }),
|
|
670
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: h.onDone, children: h.doneLabel })
|
|
671
|
+
] }) : /* @__PURE__ */ i(M, { children: [
|
|
672
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: r.map((w) => /* @__PURE__ */ i("button", { type: "button", className: "cms-viewer__button", onClick: w.onSelect, children: [
|
|
673
|
+
w.icon,
|
|
674
|
+
w.label
|
|
675
|
+
] }, w.label)) }),
|
|
676
|
+
s !== void 0 ? /* @__PURE__ */ i("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": s.label, onClick: s.onEdit, children: [
|
|
677
|
+
s.icon,
|
|
678
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: s.label })
|
|
670
679
|
] }) : null,
|
|
671
|
-
|
|
672
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label":
|
|
673
|
-
|
|
680
|
+
r.length > 0 ? /* @__PURE__ */ i("span", { className: "cms-viewer__more", children: [
|
|
681
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": m, "aria-expanded": C, onClick: () => S((w) => !w), children: /* @__PURE__ */ e(A, { name: "more" }) }),
|
|
682
|
+
C ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: r.map((w) => /* @__PURE__ */ i(
|
|
674
683
|
"button",
|
|
675
684
|
{
|
|
676
685
|
type: "button",
|
|
677
686
|
className: "cms-viewer__button",
|
|
678
687
|
onClick: () => {
|
|
679
|
-
|
|
688
|
+
S(!1), w.onSelect();
|
|
680
689
|
},
|
|
681
690
|
children: [
|
|
682
|
-
|
|
683
|
-
|
|
691
|
+
w.icon,
|
|
692
|
+
w.label
|
|
684
693
|
]
|
|
685
694
|
},
|
|
686
|
-
|
|
695
|
+
w.label
|
|
687
696
|
)) }) : null
|
|
688
697
|
] }) : null
|
|
689
698
|
] })
|
|
690
699
|
] }),
|
|
691
|
-
/* @__PURE__ */
|
|
692
|
-
a != null &&
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
(
|
|
695
|
-
/* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children:
|
|
696
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick:
|
|
697
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick:
|
|
700
|
+
/* @__PURE__ */ i("div", { className: "cms-viewer__body", children: [
|
|
701
|
+
a != null && h === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: a }) : null,
|
|
702
|
+
/* @__PURE__ */ i("div", { className: "cms-viewer__content", onTouchStart: Q, onTouchEnd: G, children: [
|
|
703
|
+
(h == null ? void 0 : h.conflict) !== void 0 ? /* @__PURE__ */ i("div", { className: "cms-viewer__conflict", role: "alert", children: [
|
|
704
|
+
/* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children: h.conflict.message }),
|
|
705
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick: h.conflict.onOverwrite, children: h.conflict.overwriteLabel }),
|
|
706
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: h.conflict.onKeepBoth, children: h.conflict.keepBothLabel })
|
|
698
707
|
] }) : null,
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
708
|
+
b === void 0 ? _ : /* @__PURE__ */ e(rn, { state: b }),
|
|
709
|
+
h === void 0 && (o != null && o.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": o.previousLabel, title: o.previousLabel, onClick: o.onPrevious, children: /* @__PURE__ */ e(U, { name: "back" }) }) : null,
|
|
710
|
+
h === void 0 && (o != null && o.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": o.nextLabel, title: o.nextLabel, onClick: o.onNext, children: /* @__PURE__ */ e(U, { name: "back" }) }) : null,
|
|
711
|
+
h === void 0 && o !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(o.total, 7) }, (w, B) => /* @__PURE__ */ e("i", { className: B === Math.min(o.index, 6) ? "is-current" : void 0 }, B)) }) : null
|
|
703
712
|
] })
|
|
704
713
|
] }),
|
|
705
|
-
|
|
706
|
-
|
|
714
|
+
h === void 0 && f != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: f }) : null,
|
|
715
|
+
u != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: u }) : null
|
|
707
716
|
]
|
|
708
717
|
}
|
|
709
718
|
),
|
|
@@ -713,10 +722,10 @@ function Zn(n) {
|
|
|
713
722
|
function rn({ state: n }) {
|
|
714
723
|
switch (n.kind) {
|
|
715
724
|
case "loading":
|
|
716
|
-
return /* @__PURE__ */ e(
|
|
725
|
+
return /* @__PURE__ */ e(le, { kind: "loading", title: n.title, placement: "page" });
|
|
717
726
|
case "error":
|
|
718
727
|
return /* @__PURE__ */ e(
|
|
719
|
-
|
|
728
|
+
le,
|
|
720
729
|
{
|
|
721
730
|
kind: "error",
|
|
722
731
|
title: n.title,
|
|
@@ -727,7 +736,7 @@ function rn({ state: n }) {
|
|
|
727
736
|
);
|
|
728
737
|
case "no-preview":
|
|
729
738
|
return /* @__PURE__ */ e(
|
|
730
|
-
|
|
739
|
+
le,
|
|
731
740
|
{
|
|
732
741
|
kind: "empty",
|
|
733
742
|
title: n.title,
|
|
@@ -743,151 +752,174 @@ class cn extends Error {
|
|
|
743
752
|
super(l), this.name = "FilePickerDenied";
|
|
744
753
|
}
|
|
745
754
|
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
+
class on extends Error {
|
|
756
|
+
constructor(l = "restart") {
|
|
757
|
+
super(l), this.name = "FilePickerRestart";
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
const we = (n, l) => `${n}
|
|
761
|
+
${l}`, dn = (n, l) => n === "" ? l : `${n}/${l}`, un = 48;
|
|
762
|
+
function jn(n) {
|
|
763
|
+
var he, ne;
|
|
764
|
+
const { open: l, spaces: t, list: d, disabledReason: c, budget: r, formatSize: m, labels: s, onConfirm: h, onCancel: b } = n, [o, u] = E(((he = t[0]) == null ? void 0 : he.id) ?? ""), [a, f] = E(""), [p, _] = E({ status: "loading" }), [N, y] = E(0), [x, C] = E(/* @__PURE__ */ new Map()), [S, F] = E(0), [R, Q] = E(!1), G = I(null), w = I(!1);
|
|
765
|
+
q(() => {
|
|
766
|
+
w.current = !1;
|
|
767
|
+
}, [l, o, a]);
|
|
768
|
+
const B = Y();
|
|
769
|
+
q(() => {
|
|
770
|
+
var v;
|
|
771
|
+
l && (u(((v = t[0]) == null ? void 0 : v.id) ?? ""), f(""), C(/* @__PURE__ */ new Map()), Q(!1));
|
|
772
|
+
}, [l]), q(() => {
|
|
755
773
|
if (!l || o === "") return;
|
|
756
|
-
let
|
|
757
|
-
return
|
|
758
|
-
(k) =>
|
|
759
|
-
(k) =>
|
|
774
|
+
let v = !0;
|
|
775
|
+
return _({ status: "loading" }), F(0), d(o, a).then(
|
|
776
|
+
(k) => v && _({ status: "ready", entries: k.entries, next: k.next ?? null, paging: !1 }),
|
|
777
|
+
(k) => v && _({ status: k instanceof cn ? "denied" : "error" })
|
|
760
778
|
), () => {
|
|
761
|
-
|
|
779
|
+
v = !1;
|
|
762
780
|
};
|
|
763
|
-
}, [l, o, a,
|
|
764
|
-
const
|
|
781
|
+
}, [l, o, a, d, N]);
|
|
782
|
+
const Z = _e(() => {
|
|
765
783
|
if (p.status !== "ready" || p.next === null || p.paging) return;
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
(
|
|
769
|
-
|
|
784
|
+
const v = p.next, k = p.entries;
|
|
785
|
+
_({ ...p, paging: !0 }), d(o, a, v).then(
|
|
786
|
+
($) => {
|
|
787
|
+
w.current = !1, _({ status: "ready", entries: [...k, ...$.entries], next: $.next ?? null, paging: !1 });
|
|
788
|
+
},
|
|
789
|
+
($) => {
|
|
790
|
+
if (!($ instanceof on)) {
|
|
791
|
+
_({ status: "ready", entries: k, next: v, paging: !1 });
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
if (w.current) {
|
|
795
|
+
_({ status: "error" });
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
798
|
+
w.current = !0, y((K) => K + 1);
|
|
799
|
+
}
|
|
770
800
|
);
|
|
771
|
-
}, [p,
|
|
801
|
+
}, [p, d, o, a]), z = _e((v) => {
|
|
772
802
|
var k;
|
|
773
|
-
return ((k =
|
|
774
|
-
}, [
|
|
775
|
-
if (
|
|
776
|
-
const k = c == null ? void 0 : c(
|
|
777
|
-
return k || (
|
|
778
|
-
},
|
|
779
|
-
const k =
|
|
780
|
-
!x.has(k) &&
|
|
781
|
-
const K = new Map(
|
|
782
|
-
return K.has(k) ? K.delete(k) : K.set(k, { ...
|
|
803
|
+
return ((k = r == null ? void 0 : r.cost) == null ? void 0 : k.call(r, v)) ?? v.size ?? 0;
|
|
804
|
+
}, [r]), H = Ke(() => [...x.values()], [x]), W = H.reduce((v, k) => v + (k.size ?? 0), 0), j = r === void 0 ? null : r.limitBytes - r.usedBytes - H.reduce((v, k) => v + z(k), 0), ie = j !== null && j < 0, ue = (v) => {
|
|
805
|
+
if (v.kind !== "file") return null;
|
|
806
|
+
const k = c == null ? void 0 : c(v);
|
|
807
|
+
return k || (j !== null && !x.has(we(o, v.id)) && z(v) > j ? s.overBudget : null);
|
|
808
|
+
}, g = (v) => {
|
|
809
|
+
const k = we(o, v.id);
|
|
810
|
+
!x.has(k) && ue(v) !== null || C(($) => {
|
|
811
|
+
const K = new Map($);
|
|
812
|
+
return K.has(k) ? K.delete(k) : K.set(k, { ...v, space: o, path: a }), K;
|
|
783
813
|
});
|
|
784
|
-
},
|
|
785
|
-
const
|
|
786
|
-
return
|
|
787
|
-
}),
|
|
788
|
-
const k =
|
|
789
|
-
if (
|
|
790
|
-
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
-
} else
|
|
794
|
-
},
|
|
795
|
-
return /* @__PURE__ */
|
|
796
|
-
|
|
814
|
+
}, D = (v) => f(dn(a, v.name)), V = () => f(a.includes("/") ? a.slice(0, a.lastIndexOf("/")) : ""), ee = (v) => C((k) => {
|
|
815
|
+
const $ = new Map(k);
|
|
816
|
+
return $.delete(v), $;
|
|
817
|
+
}), L = p.status === "ready" ? p.entries : [], X = (v) => {
|
|
818
|
+
const k = L[S];
|
|
819
|
+
if (v.key === "ArrowDown" || v.key === "ArrowUp" || v.key === "Home" || v.key === "End") {
|
|
820
|
+
v.preventDefault();
|
|
821
|
+
const $ = L.length - 1, K = v.key === "Home" ? 0 : v.key === "End" ? $ : Math.min($, Math.max(0, S + (v.key === "ArrowDown" ? 1 : -1)));
|
|
822
|
+
F(K), K >= $ - 1 && Z();
|
|
823
|
+
} else v.key === "Enter" && (k == null ? void 0 : k.kind) === "folder" ? (v.preventDefault(), D(k)) : v.key === " " && (k == null ? void 0 : k.kind) === "file" ? (v.preventDefault(), g(k)) : v.key === "Backspace" && a !== "" && (v.preventDefault(), V());
|
|
824
|
+
}, oe = a === "" ? [] : a.split("/"), ye = ((ne = t.find((v) => v.id === o)) == null ? void 0 : ne.name) ?? "", me = (v) => `${B}-entry-${String(v)}`;
|
|
825
|
+
return /* @__PURE__ */ i(
|
|
826
|
+
Be,
|
|
797
827
|
{
|
|
798
828
|
open: l,
|
|
799
|
-
title:
|
|
800
|
-
onClose:
|
|
801
|
-
closeLabel:
|
|
802
|
-
initialFocus:
|
|
829
|
+
title: s.title,
|
|
830
|
+
onClose: b,
|
|
831
|
+
closeLabel: s.close,
|
|
832
|
+
initialFocus: G,
|
|
803
833
|
className: "cms-file-picker",
|
|
804
|
-
footer: /* @__PURE__ */
|
|
805
|
-
/* @__PURE__ */
|
|
806
|
-
|
|
807
|
-
|
|
834
|
+
footer: /* @__PURE__ */ i("div", { className: "cms-file-picker__foot", children: [
|
|
835
|
+
/* @__PURE__ */ i("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
|
|
836
|
+
H.length > 0 ? /* @__PURE__ */ e("span", { children: s.total(H.length, m(W)) }) : null,
|
|
837
|
+
r !== void 0 && j !== null ? /* @__PURE__ */ e("span", { className: T(ie && "is-over"), children: ie ? s.overBudget : s.left(m(Math.max(0, j)), m(r.limitBytes)) }) : null
|
|
808
838
|
] }),
|
|
809
|
-
/* @__PURE__ */
|
|
810
|
-
/* @__PURE__ */ e(
|
|
811
|
-
/* @__PURE__ */ e(
|
|
839
|
+
/* @__PURE__ */ i("div", { className: "cms-file-picker__actions", children: [
|
|
840
|
+
/* @__PURE__ */ e(te, { variant: "secondary", onClick: b, children: s.cancel }),
|
|
841
|
+
/* @__PURE__ */ e(te, { variant: "primary", disabled: H.length === 0 || ie, onClick: () => h(H), children: s.confirm(H.length) })
|
|
812
842
|
] })
|
|
813
843
|
] }),
|
|
814
844
|
children: [
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
t.length > 1 ? /* @__PURE__ */
|
|
817
|
-
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children:
|
|
818
|
-
/* @__PURE__ */ e("select", { className: "cms-input cms-select", value: o, onChange: (
|
|
819
|
-
|
|
820
|
-
}, children: t.map((
|
|
845
|
+
/* @__PURE__ */ i("div", { className: "cms-file-picker__top", children: [
|
|
846
|
+
t.length > 1 ? /* @__PURE__ */ i("label", { className: "cms-file-picker__space", children: [
|
|
847
|
+
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: s.space }),
|
|
848
|
+
/* @__PURE__ */ e("select", { className: "cms-input cms-select", value: o, onChange: (v) => {
|
|
849
|
+
u(v.target.value), f("");
|
|
850
|
+
}, children: t.map((v) => /* @__PURE__ */ e("option", { value: v.id, children: v.name }, v.id)) })
|
|
821
851
|
] }) : null,
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
824
|
-
/* @__PURE__ */
|
|
825
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": a === "" ? "location" : void 0, onClick: () =>
|
|
826
|
-
|
|
827
|
-
const
|
|
828
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current":
|
|
852
|
+
/* @__PURE__ */ i("nav", { className: "cms-file-picker__path", "aria-label": s.path, children: [
|
|
853
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": s.up, disabled: a === "", onClick: V, children: /* @__PURE__ */ e(A, { name: "chevron-left" }) }),
|
|
854
|
+
/* @__PURE__ */ i("ol", { children: [
|
|
855
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": a === "" ? "location" : void 0, onClick: () => f(""), children: ye }) }),
|
|
856
|
+
oe.map((v, k) => {
|
|
857
|
+
const $ = oe.slice(0, k + 1).join("/");
|
|
858
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": $ === a ? "location" : void 0, onClick: () => f($), children: v }) }, $);
|
|
829
859
|
})
|
|
830
860
|
] })
|
|
831
861
|
] }),
|
|
832
|
-
|
|
862
|
+
H.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": R, onClick: () => Q((v) => !v), children: s.selected(H.length) }) : null
|
|
833
863
|
] }),
|
|
834
|
-
|
|
835
|
-
/* @__PURE__ */ e("ul", { children: [...x.entries()].map(([
|
|
864
|
+
R && H.length > 0 ? /* @__PURE__ */ i("div", { className: "cms-file-picker__chosen", children: [
|
|
865
|
+
/* @__PURE__ */ e("ul", { children: [...x.entries()].map(([v, k]) => /* @__PURE__ */ i("li", { children: [
|
|
836
866
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: k.name }),
|
|
837
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
838
|
-
] },
|
|
839
|
-
/* @__PURE__ */ e(
|
|
840
|
-
|
|
841
|
-
}, children:
|
|
867
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": s.remove(k.name), onClick: () => ee(v), children: /* @__PURE__ */ e(U, { name: "close" }) })
|
|
868
|
+
] }, v)) }),
|
|
869
|
+
/* @__PURE__ */ e(te, { variant: "secondary", onClick: () => {
|
|
870
|
+
C(/* @__PURE__ */ new Map()), Q(!1);
|
|
871
|
+
}, children: s.clear })
|
|
842
872
|
] }) : null,
|
|
843
|
-
/* @__PURE__ */
|
|
844
|
-
const k =
|
|
845
|
-
k.scrollTop + k.clientHeight >= k.scrollHeight -
|
|
873
|
+
/* @__PURE__ */ i("div", { className: "cms-file-picker__list", onScroll: (v) => {
|
|
874
|
+
const k = v.currentTarget;
|
|
875
|
+
k.scrollTop + k.clientHeight >= k.scrollHeight - un && Z();
|
|
846
876
|
}, children: [
|
|
847
|
-
p.status === "loading" ? /* @__PURE__ */ e(
|
|
848
|
-
p.status === "error" ? /* @__PURE__ */ e(
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
/* @__PURE__ */
|
|
877
|
+
p.status === "loading" ? /* @__PURE__ */ e(le, { kind: "loading", title: s.loading, placement: "block" }) : null,
|
|
878
|
+
p.status === "error" ? /* @__PURE__ */ e(le, { kind: "error", title: s.error, placement: "block", action: { label: s.retry, onAction: () => {
|
|
879
|
+
w.current = !1, y((v) => v + 1);
|
|
880
|
+
} } }) : null,
|
|
881
|
+
p.status === "denied" ? /* @__PURE__ */ e(le, { kind: "denied", title: s.denied, placement: "block" }) : null,
|
|
882
|
+
p.status === "ready" && L.length === 0 ? /* @__PURE__ */ e(le, { kind: "empty", title: s.empty, placement: "block" }) : null,
|
|
883
|
+
/* @__PURE__ */ i(
|
|
852
884
|
"div",
|
|
853
885
|
{
|
|
854
|
-
ref:
|
|
886
|
+
ref: G,
|
|
855
887
|
role: "listbox",
|
|
856
888
|
"aria-multiselectable": "true",
|
|
857
|
-
"aria-label":
|
|
858
|
-
"aria-activedescendant":
|
|
889
|
+
"aria-label": s.files,
|
|
890
|
+
"aria-activedescendant": L.length > 0 ? me(S) : void 0,
|
|
859
891
|
tabIndex: 0,
|
|
860
892
|
className: "cms-file-picker__entries",
|
|
861
|
-
hidden: p.status !== "ready" ||
|
|
862
|
-
onKeyDown:
|
|
893
|
+
hidden: p.status !== "ready" || L.length === 0,
|
|
894
|
+
onKeyDown: X,
|
|
863
895
|
children: [
|
|
864
|
-
|
|
865
|
-
const
|
|
866
|
-
return /* @__PURE__ */
|
|
896
|
+
L.map((v, k) => {
|
|
897
|
+
const $ = v.kind === "file" && x.has(we(o, v.id)), K = ue(v);
|
|
898
|
+
return /* @__PURE__ */ i(
|
|
867
899
|
"div",
|
|
868
900
|
{
|
|
869
|
-
id:
|
|
901
|
+
id: me(k),
|
|
870
902
|
role: "option",
|
|
871
|
-
"aria-selected":
|
|
903
|
+
"aria-selected": v.kind === "file" ? $ : void 0,
|
|
872
904
|
"aria-disabled": K !== null || void 0,
|
|
873
|
-
className:
|
|
905
|
+
className: T("cms-file-picker__entry", k === S && "is-active", $ && "is-ticked", K !== null && "is-disabled"),
|
|
874
906
|
onClick: () => {
|
|
875
|
-
|
|
907
|
+
F(k), v.kind === "folder" ? D(v) : g(v);
|
|
876
908
|
},
|
|
877
909
|
children: [
|
|
878
|
-
/* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children:
|
|
879
|
-
/* @__PURE__ */ e(
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children:
|
|
910
|
+
/* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: $ ? /* @__PURE__ */ e(A, { name: "check" }) : null }),
|
|
911
|
+
/* @__PURE__ */ e(A, { name: v.kind === "folder" ? "folder" : "file" }),
|
|
912
|
+
/* @__PURE__ */ i("span", { className: "cms-file-picker__text", children: [
|
|
913
|
+
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: v.name }),
|
|
882
914
|
K !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: K }) : null
|
|
883
915
|
] }),
|
|
884
|
-
|
|
916
|
+
v.kind === "file" && v.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: m(v.size) }) : null
|
|
885
917
|
]
|
|
886
918
|
},
|
|
887
|
-
|
|
919
|
+
v.id
|
|
888
920
|
);
|
|
889
921
|
}),
|
|
890
|
-
p.status === "ready" && p.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(
|
|
922
|
+
p.status === "ready" && p.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(le, { kind: "loading", title: s.loading, placement: "inline" }) }) : null
|
|
891
923
|
]
|
|
892
924
|
}
|
|
893
925
|
)
|
|
@@ -896,25 +928,259 @@ function Wn(n) {
|
|
|
896
928
|
}
|
|
897
929
|
);
|
|
898
930
|
}
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
931
|
+
const xe = 64;
|
|
932
|
+
function mn(n, l) {
|
|
933
|
+
for (let t = n instanceof Element ? n : null; t !== null; t = t.parentElement) {
|
|
934
|
+
if (t instanceof HTMLElement && t.scrollTop > 0) return !1;
|
|
935
|
+
if (t === l) return !0;
|
|
936
|
+
}
|
|
937
|
+
return l.scrollTop <= 0;
|
|
938
|
+
}
|
|
939
|
+
function hn(n, l) {
|
|
940
|
+
const [t, d] = E(0), c = I(l);
|
|
941
|
+
return c.current = l, q(() => {
|
|
942
|
+
const r = n.current;
|
|
943
|
+
if (r === null) return;
|
|
944
|
+
let m = null, s = 0;
|
|
945
|
+
const h = (u) => {
|
|
946
|
+
m = mn(u.target, r) && u.touches.length === 1 ? u.touches[0].clientY : null, s = 0;
|
|
947
|
+
}, b = (u) => {
|
|
948
|
+
if (m === null || c.current === null) return;
|
|
949
|
+
const a = u.touches[0].clientY - m;
|
|
950
|
+
if (a <= 0) {
|
|
951
|
+
m = null, d(0);
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
u.cancelable && u.preventDefault(), s = Math.min(a * 0.6, xe * 1.5), d(s);
|
|
955
|
+
}, o = () => {
|
|
956
|
+
var u;
|
|
957
|
+
m !== null && s >= xe && ((u = c.current) == null || u.call(c)), m = null, s = 0, d(0);
|
|
958
|
+
};
|
|
959
|
+
return r.addEventListener("touchstart", h, { passive: !0 }), r.addEventListener("touchmove", b, { passive: !1 }), r.addEventListener("touchend", o), r.addEventListener("touchcancel", o), () => {
|
|
960
|
+
r.removeEventListener("touchstart", h), r.removeEventListener("touchmove", b), r.removeEventListener("touchend", o), r.removeEventListener("touchcancel", o);
|
|
961
|
+
};
|
|
962
|
+
}, [n]), t;
|
|
963
|
+
}
|
|
964
|
+
const Re = Ue(null);
|
|
965
|
+
function fn() {
|
|
966
|
+
return Oe(Re);
|
|
967
|
+
}
|
|
968
|
+
function qn({ label: n, rows: l, error: t, onRetry: d, loadingText: c = "Loading", emptyTitle: r = "Nothing here yet", emptyHint: m, selected: s, onOpen: h, onRowMenu: b }) {
|
|
969
|
+
const o = I([]), u = fn();
|
|
970
|
+
if (t != null) return /* @__PURE__ */ e(Ge, { message: t, onRetry: d });
|
|
971
|
+
if (l === null) return /* @__PURE__ */ e(qe, { what: c, layout: "block" });
|
|
972
|
+
if (l.length === 0) return /* @__PURE__ */ e(Ye, { title: r, hint: m });
|
|
973
|
+
const a = (f, p, _) => {
|
|
974
|
+
var N;
|
|
975
|
+
if (f.key === "ArrowDown" || f.key === "ArrowUp")
|
|
976
|
+
f.preventDefault(), (N = o.current[Math.min(l.length - 1, Math.max(0, p + (f.key === "ArrowDown" ? 1 : -1)))]) == null || N.focus();
|
|
977
|
+
else if (f.key === "Enter")
|
|
978
|
+
h == null || h(_);
|
|
979
|
+
else if ((f.key === "ContextMenu" || f.shiftKey && f.key === "F10") && b) {
|
|
980
|
+
f.preventDefault();
|
|
981
|
+
const y = f.currentTarget.getBoundingClientRect();
|
|
982
|
+
b(_, { x: y.left + 16, y: y.bottom });
|
|
983
|
+
}
|
|
984
|
+
};
|
|
985
|
+
return /* @__PURE__ */ i(M, { children: [
|
|
986
|
+
u !== null && (u.distance > 0 || u.refreshing) ? /* @__PURE__ */ i("div", { className: "cms-list__pull", role: "status", style: { height: u.refreshing ? void 0 : u.distance }, "data-ready": u.distance >= xe ? "" : void 0, children: [
|
|
987
|
+
u.refreshing ? /* @__PURE__ */ e(U, { name: "spinner" }) : null,
|
|
988
|
+
u.text != null ? /* @__PURE__ */ e("span", { className: "cms-list__pull-text", children: u.text }) : null
|
|
989
|
+
] }) : null,
|
|
990
|
+
/* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((f, p) => {
|
|
991
|
+
const _ = f.id === s;
|
|
992
|
+
return /* @__PURE__ */ i(
|
|
993
|
+
"li",
|
|
994
|
+
{
|
|
995
|
+
ref: (N) => {
|
|
996
|
+
o.current[p] = N;
|
|
997
|
+
},
|
|
998
|
+
role: "option",
|
|
999
|
+
"aria-selected": _,
|
|
1000
|
+
tabIndex: _ || s == null && p === 0 ? 0 : -1,
|
|
1001
|
+
className: T("cms-list__row", _ && "is-selected"),
|
|
1002
|
+
onClick: () => h == null ? void 0 : h(f.id),
|
|
1003
|
+
onKeyDown: (N) => a(N, p, f.id),
|
|
1004
|
+
onContextMenu: b ? (N) => {
|
|
1005
|
+
N.preventDefault(), b(f.id, { x: N.clientX, y: N.clientY });
|
|
1006
|
+
} : void 0,
|
|
1007
|
+
children: [
|
|
1008
|
+
f.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: f.lead }) : null,
|
|
1009
|
+
/* @__PURE__ */ i("span", { className: "cms-list__text", children: [
|
|
1010
|
+
/* @__PURE__ */ e("span", { className: T("cms-list__primary", f.unread === !0 && "is-unread"), children: f.primary }),
|
|
1011
|
+
f.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: f.secondary }) : null
|
|
1012
|
+
] }),
|
|
1013
|
+
f.meta != null || f.count !== void 0 ? /* @__PURE__ */ i("span", { className: "cms-list__end", children: [
|
|
1014
|
+
f.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: f.meta }) : null,
|
|
1015
|
+
f.count !== void 0 && f.count > 0 ? /* @__PURE__ */ e("span", { className: "cms-badge cms-list__count", children: f.count }) : null
|
|
1016
|
+
] }) : null
|
|
1017
|
+
]
|
|
1018
|
+
},
|
|
1019
|
+
f.id
|
|
1020
|
+
);
|
|
1021
|
+
}) })
|
|
1022
|
+
] });
|
|
1023
|
+
}
|
|
1024
|
+
function ve({ at: n, items: l, onClose: t, label: d = "Actions", focus: c = "first" }) {
|
|
1025
|
+
const r = I(null), m = I(null), s = Y(), [h, b] = E(n), o = l.filter((a) => a.offer.offered);
|
|
1026
|
+
if (Ne(() => {
|
|
1027
|
+
if (!n) return;
|
|
1028
|
+
const a = r.current, f = (a == null ? void 0 : a.offsetWidth) ?? 0, p = (a == null ? void 0 : a.offsetHeight) ?? 0;
|
|
1029
|
+
b({ x: Math.max(0, Math.min(n.x, window.innerWidth - f)), y: Math.max(0, Math.min(n.y, window.innerHeight - p)) });
|
|
1030
|
+
}, [n]), q(() => {
|
|
1031
|
+
var p, _;
|
|
1032
|
+
if (!n) return;
|
|
1033
|
+
m.current = document.activeElement;
|
|
1034
|
+
const a = Array.from(((p = r.current) == null ? void 0 : p.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
|
|
1035
|
+
(_ = c === "last" ? a[a.length - 1] : a[0]) == null || _.focus();
|
|
1036
|
+
const f = (N) => {
|
|
1037
|
+
var y;
|
|
1038
|
+
(y = r.current) != null && y.contains(N.target) || t();
|
|
1039
|
+
};
|
|
1040
|
+
return document.addEventListener("mousedown", f), () => {
|
|
1041
|
+
var N, y;
|
|
1042
|
+
document.removeEventListener("mousedown", f), (y = (N = m.current) == null ? void 0 : N.focus) == null || y.call(N);
|
|
1043
|
+
};
|
|
1044
|
+
}, [n, t, c]), !n || o.length === 0) return null;
|
|
1045
|
+
const u = (a) => {
|
|
1046
|
+
var _, N;
|
|
1047
|
+
const f = Array.from(((_ = r.current) == null ? void 0 : _.querySelectorAll('[role="menuitem"]')) ?? []), p = f.indexOf(document.activeElement);
|
|
1048
|
+
if (a.key === "Escape" || a.key === "Tab")
|
|
1049
|
+
a.preventDefault(), t();
|
|
1050
|
+
else if (a.key === "ArrowDown" || a.key === "ArrowUp") {
|
|
1051
|
+
a.preventDefault();
|
|
1052
|
+
const y = a.key === "ArrowDown" ? 1 : -1;
|
|
1053
|
+
(N = f[(p + y + f.length) % f.length]) == null || N.focus();
|
|
1054
|
+
}
|
|
1055
|
+
};
|
|
1056
|
+
return Ce(
|
|
1057
|
+
/* @__PURE__ */ e(
|
|
1058
|
+
"div",
|
|
1059
|
+
{
|
|
1060
|
+
ref: r,
|
|
1061
|
+
className: "cms-menu",
|
|
1062
|
+
role: "menu",
|
|
1063
|
+
"aria-label": d,
|
|
1064
|
+
style: { left: (h ?? n).x, top: (h ?? n).y },
|
|
1065
|
+
onKeyDown: u,
|
|
1066
|
+
onContextMenu: (a) => a.preventDefault(),
|
|
1067
|
+
children: o.map((a) => {
|
|
1068
|
+
const f = a.offer.refusal !== void 0;
|
|
1069
|
+
return /* @__PURE__ */ i(
|
|
1070
|
+
"div",
|
|
1071
|
+
{
|
|
1072
|
+
role: "menuitem",
|
|
1073
|
+
tabIndex: -1,
|
|
1074
|
+
"aria-disabled": f || void 0,
|
|
1075
|
+
"aria-describedby": f ? `${s}-${a.id}` : void 0,
|
|
1076
|
+
title: f ? a.offer.refusal : void 0,
|
|
1077
|
+
className: T("cms-menu__item", a.danger && "is-danger", a.offer.locked && "is-locked", f && "is-refused"),
|
|
1078
|
+
onClick: () => {
|
|
1079
|
+
f || (t(), a.onSelect());
|
|
1080
|
+
},
|
|
1081
|
+
onKeyDown: (p) => {
|
|
1082
|
+
(p.key === "Enter" || p.key === " ") && !f && (p.preventDefault(), t(), a.onSelect());
|
|
1083
|
+
},
|
|
1084
|
+
children: [
|
|
1085
|
+
a.offer.locked ? /* @__PURE__ */ e(U, { name: "lock" }) : null,
|
|
1086
|
+
/* @__PURE__ */ e("span", { className: "cms-menu__label", children: a.label }),
|
|
1087
|
+
f ? /* @__PURE__ */ e("span", { id: `${s}-${a.id}`, className: "cms-menu__refusal", children: a.offer.refusal }) : null
|
|
1088
|
+
]
|
|
1089
|
+
},
|
|
1090
|
+
a.id
|
|
1091
|
+
);
|
|
1092
|
+
})
|
|
1093
|
+
}
|
|
1094
|
+
),
|
|
1095
|
+
document.body
|
|
1096
|
+
);
|
|
1097
|
+
}
|
|
1098
|
+
function Yn({ title: n, icon: l, primary: t, more: d = [], moreLabel: c, context: r, fullWidth: m = !1 }) {
|
|
1099
|
+
var p, _, N;
|
|
1100
|
+
const [s, h] = E(null), b = Y(), o = d.filter((y) => y.offer.offered), u = (p = t == null ? void 0 : t.offer) == null ? void 0 : p.refusal, a = t !== void 0 && (((_ = t.offer) == null ? void 0 : _.offered) === !1 || u !== void 0), f = (y, x) => {
|
|
1101
|
+
const C = x.getBoundingClientRect();
|
|
1102
|
+
h((s == null ? void 0 : s.which) === y ? null : { which: y, x: C.left, y: C.bottom + 4 });
|
|
1103
|
+
};
|
|
1104
|
+
return /* @__PURE__ */ i("header", { className: `cms-section-header${m ? " cms-section-header--full" : ""}`, children: [
|
|
1105
|
+
/* @__PURE__ */ i("div", { className: "cms-section-header__row", "data-row": "1", children: [
|
|
1106
|
+
l !== void 0 ? /* @__PURE__ */ e(A, { name: l }) : null,
|
|
1107
|
+
/* @__PURE__ */ e("h1", { className: "cms-section-header__title", title: n, children: n }),
|
|
1108
|
+
/* @__PURE__ */ i("div", { className: "cms-section-header__actions", children: [
|
|
1109
|
+
t !== void 0 && ((N = t.offer) == null ? void 0 : N.offered) !== !1 ? /* @__PURE__ */ i("span", { className: `cms-section-header__primary${"menu" in t ? " cms-section-header__primary--split" : ""}`, children: [
|
|
1110
|
+
/* @__PURE__ */ i(
|
|
1111
|
+
"button",
|
|
1112
|
+
{
|
|
1113
|
+
type: "button",
|
|
1114
|
+
className: "cms-button cms-button--primary",
|
|
1115
|
+
"data-action": "primary",
|
|
1116
|
+
"aria-disabled": a ? "true" : void 0,
|
|
1117
|
+
"aria-describedby": u !== void 0 ? b : void 0,
|
|
1118
|
+
title: u,
|
|
1119
|
+
onClick: () => {
|
|
1120
|
+
a || t.onPress();
|
|
1121
|
+
},
|
|
1122
|
+
children: [
|
|
1123
|
+
/* @__PURE__ */ e(A, { name: t.icon }),
|
|
1124
|
+
" ",
|
|
1125
|
+
/* @__PURE__ */ e("span", { children: t.label })
|
|
1126
|
+
]
|
|
1127
|
+
}
|
|
1128
|
+
),
|
|
1129
|
+
"menu" in t ? /* @__PURE__ */ e(
|
|
1130
|
+
"button",
|
|
1131
|
+
{
|
|
1132
|
+
type: "button",
|
|
1133
|
+
className: "cms-button cms-button--primary cms-section-header__split",
|
|
1134
|
+
"data-action": "primary-menu",
|
|
1135
|
+
"aria-haspopup": "menu",
|
|
1136
|
+
"aria-expanded": (s == null ? void 0 : s.which) === "primary",
|
|
1137
|
+
"aria-label": t.menuLabel,
|
|
1138
|
+
onClick: (y) => f("primary", y.currentTarget),
|
|
1139
|
+
children: /* @__PURE__ */ e(A, { name: "chevron-down" })
|
|
1140
|
+
}
|
|
1141
|
+
) : null,
|
|
1142
|
+
u !== void 0 ? /* @__PURE__ */ e("span", { id: b, className: "cms-visually-hidden", children: u }) : null
|
|
1143
|
+
] }) : null,
|
|
1144
|
+
o.length > 0 ? /* @__PURE__ */ e(
|
|
1145
|
+
"button",
|
|
1146
|
+
{
|
|
1147
|
+
type: "button",
|
|
1148
|
+
className: "cms-section-header__more",
|
|
1149
|
+
"data-action": "more",
|
|
1150
|
+
"aria-haspopup": "menu",
|
|
1151
|
+
"aria-expanded": (s == null ? void 0 : s.which) === "more",
|
|
1152
|
+
"aria-label": c,
|
|
1153
|
+
title: c,
|
|
1154
|
+
onClick: (y) => f("more", y.currentTarget),
|
|
1155
|
+
children: /* @__PURE__ */ e(A, { name: "more" })
|
|
1156
|
+
}
|
|
1157
|
+
) : null
|
|
1158
|
+
] })
|
|
1159
|
+
] }),
|
|
1160
|
+
r != null ? /* @__PURE__ */ e("div", { className: "cms-section-header__context", "data-row": "2", children: r }) : null,
|
|
1161
|
+
t !== void 0 && "menu" in t ? /* @__PURE__ */ e(ve, { at: (s == null ? void 0 : s.which) === "primary" ? s : null, items: t.menu, onClose: () => h(null), label: t.menuLabel }) : null,
|
|
1162
|
+
/* @__PURE__ */ e(ve, { at: (s == null ? void 0 : s.which) === "more" ? s : null, items: d, onClose: () => h(null), label: c })
|
|
1163
|
+
] });
|
|
1164
|
+
}
|
|
1165
|
+
function Gn({ title: n, scope: l, actions: t, backLink: d }) {
|
|
1166
|
+
return /* @__PURE__ */ i("header", { className: "cms-page-header", children: [
|
|
1167
|
+
d ? /* @__PURE__ */ i(
|
|
902
1168
|
"a",
|
|
903
1169
|
{
|
|
904
1170
|
className: "cms-page-header__back",
|
|
905
|
-
href:
|
|
1171
|
+
href: d.href ?? "#",
|
|
906
1172
|
onClick: (c) => {
|
|
907
|
-
|
|
1173
|
+
d.onBack && (c.preventDefault(), d.onBack());
|
|
908
1174
|
},
|
|
909
1175
|
children: [
|
|
910
|
-
/* @__PURE__ */ e(
|
|
1176
|
+
/* @__PURE__ */ e(U, { name: "back" }),
|
|
911
1177
|
" ",
|
|
912
|
-
|
|
1178
|
+
d.label
|
|
913
1179
|
]
|
|
914
1180
|
}
|
|
915
1181
|
) : null,
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
1182
|
+
/* @__PURE__ */ i("div", { className: "cms-page-header__row", children: [
|
|
1183
|
+
/* @__PURE__ */ i("div", { className: "cms-page-header__titles", children: [
|
|
918
1184
|
/* @__PURE__ */ e("h1", { className: "cms-page-header__title", children: n }),
|
|
919
1185
|
l != null ? /* @__PURE__ */ e("p", { className: "cms-page-header__scope", children: l }) : null
|
|
920
1186
|
] }),
|
|
@@ -922,95 +1188,95 @@ function jn({ title: n, scope: l, actions: t, backLink: i }) {
|
|
|
922
1188
|
] })
|
|
923
1189
|
] });
|
|
924
1190
|
}
|
|
925
|
-
function
|
|
926
|
-
const c =
|
|
927
|
-
var
|
|
928
|
-
const
|
|
929
|
-
if (
|
|
930
|
-
|
|
931
|
-
const o = n[
|
|
932
|
-
o && (t(o.id), (
|
|
1191
|
+
function Xn({ tabs: n, active: l, onSelect: t, label: d }) {
|
|
1192
|
+
const c = I([]), r = (m, s) => {
|
|
1193
|
+
var u;
|
|
1194
|
+
const h = n.length - 1, b = m.key === "ArrowRight" ? s === h ? 0 : s + 1 : m.key === "ArrowLeft" ? s === 0 ? h : s - 1 : m.key === "Home" ? 0 : m.key === "End" ? h : null;
|
|
1195
|
+
if (b === null) return;
|
|
1196
|
+
m.preventDefault();
|
|
1197
|
+
const o = n[b];
|
|
1198
|
+
o && (t(o.id), (u = c.current[b]) == null || u.focus());
|
|
933
1199
|
};
|
|
934
|
-
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label":
|
|
935
|
-
const
|
|
936
|
-
return /* @__PURE__ */
|
|
1200
|
+
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": d, children: n.map((m, s) => {
|
|
1201
|
+
const h = m.id === l;
|
|
1202
|
+
return /* @__PURE__ */ i(
|
|
937
1203
|
"button",
|
|
938
1204
|
{
|
|
939
|
-
ref: (
|
|
940
|
-
c.current[
|
|
1205
|
+
ref: (b) => {
|
|
1206
|
+
c.current[s] = b;
|
|
941
1207
|
},
|
|
942
1208
|
type: "button",
|
|
943
1209
|
role: "tab",
|
|
944
|
-
className:
|
|
945
|
-
"aria-selected":
|
|
946
|
-
tabIndex:
|
|
947
|
-
onClick: () => t(
|
|
948
|
-
onKeyDown: (
|
|
1210
|
+
className: T("cms-tab", h && "is-active"),
|
|
1211
|
+
"aria-selected": h,
|
|
1212
|
+
tabIndex: h ? 0 : -1,
|
|
1213
|
+
onClick: () => t(m.id),
|
|
1214
|
+
onKeyDown: (b) => r(b, s),
|
|
949
1215
|
children: [
|
|
950
|
-
|
|
951
|
-
|
|
1216
|
+
m.label,
|
|
1217
|
+
m.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: m.count }) : null
|
|
952
1218
|
]
|
|
953
1219
|
},
|
|
954
|
-
|
|
1220
|
+
m.id
|
|
955
1221
|
);
|
|
956
1222
|
}) });
|
|
957
1223
|
}
|
|
958
|
-
function
|
|
1224
|
+
function pn(n) {
|
|
959
1225
|
const l = n.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), t = (c) => {
|
|
960
|
-
var
|
|
961
|
-
return (
|
|
1226
|
+
var r;
|
|
1227
|
+
return (r = c == null ? void 0 : c.match(/[\p{L}\p{N}]/u)) == null ? void 0 : r[0];
|
|
962
1228
|
};
|
|
963
1229
|
return (l.length > 1 ? [t(l[0]), t(l[l.length - 1])] : [t(l[0])]).filter(Boolean).join("").toUpperCase();
|
|
964
1230
|
}
|
|
965
|
-
function
|
|
1231
|
+
function bn(n) {
|
|
966
1232
|
let l = 0;
|
|
967
1233
|
for (const t of n.trim().toLowerCase())
|
|
968
1234
|
l = l * 31 + (t.codePointAt(0) ?? 0) >>> 0;
|
|
969
1235
|
return l % 6 + 1;
|
|
970
1236
|
}
|
|
971
|
-
function
|
|
972
|
-
const
|
|
973
|
-
return /* @__PURE__ */
|
|
1237
|
+
function ge({ name: n, pictureUrl: l, presence: t, connection: d, deleted: c = !1, size: r = 32 }) {
|
|
1238
|
+
const m = d !== void 0 ? `is-${d.state === "offline" ? "disconnected" : d.state}` : t === void 0 ? null : `is-${t === "busy" ? "away" : t}`, s = d !== void 0 ? `${n}, ${d.label}` : t ? `${n}, ${t}` : n;
|
|
1239
|
+
return /* @__PURE__ */ i(
|
|
974
1240
|
"span",
|
|
975
1241
|
{
|
|
976
|
-
className:
|
|
977
|
-
style: { width:
|
|
1242
|
+
className: T("cms-avatar", c ? "cms-avatar--deleted" : `cms-avatar--tint-${bn(n)}`),
|
|
1243
|
+
style: { width: r, height: r, fontSize: Math.round(r * 0.4) },
|
|
978
1244
|
role: "img",
|
|
979
|
-
"aria-label":
|
|
980
|
-
...
|
|
1245
|
+
"aria-label": s,
|
|
1246
|
+
...d === void 0 ? {} : { title: d.label },
|
|
981
1247
|
children: [
|
|
982
|
-
c ? /* @__PURE__ */ e(
|
|
983
|
-
|
|
1248
|
+
c ? /* @__PURE__ */ e(A, { name: "user", size: Math.round(r * 0.6) }) : l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: pn(n) }),
|
|
1249
|
+
m === null ? null : /* @__PURE__ */ e("span", { className: T("cms-avatar__presence", m), "aria-hidden": "true" })
|
|
984
1250
|
]
|
|
985
1251
|
}
|
|
986
1252
|
);
|
|
987
1253
|
}
|
|
988
|
-
function
|
|
989
|
-
return n <= 0 ? null : /* @__PURE__ */
|
|
1254
|
+
function _n({ count: n, label: l, max: t = 99 }) {
|
|
1255
|
+
return n <= 0 ? null : /* @__PURE__ */ i("span", { className: "cms-badge", children: [
|
|
990
1256
|
/* @__PURE__ */ e("span", { "aria-hidden": "true", children: n > t ? `${t}+` : n }),
|
|
991
1257
|
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: l })
|
|
992
1258
|
] });
|
|
993
1259
|
}
|
|
994
|
-
function
|
|
995
|
-
return /* @__PURE__ */
|
|
996
|
-
/* @__PURE__ */
|
|
1260
|
+
function Jn({ product: n, mark: l, rail: t, active: d, onNavigate: c, server: r, search: m, account: s, children: h, railLabel: b = "Sections" }) {
|
|
1261
|
+
return /* @__PURE__ */ i("div", { className: "cms-shell", children: [
|
|
1262
|
+
/* @__PURE__ */ i("nav", { className: "cms-shell__rail", "aria-label": b, children: [
|
|
997
1263
|
/* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: l }),
|
|
998
1264
|
/* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((o) => {
|
|
999
|
-
const
|
|
1000
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
1265
|
+
const u = o.id === d;
|
|
1266
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1001
1267
|
"a",
|
|
1002
1268
|
{
|
|
1003
1269
|
href: o.href,
|
|
1004
|
-
className:
|
|
1005
|
-
"aria-current":
|
|
1270
|
+
className: T("cms-shell__item", u && "is-active"),
|
|
1271
|
+
"aria-current": u ? "page" : void 0,
|
|
1006
1272
|
title: o.label,
|
|
1007
1273
|
onClick: (a) => {
|
|
1008
1274
|
c && (a.preventDefault(), c(o.id));
|
|
1009
1275
|
},
|
|
1010
1276
|
children: [
|
|
1011
|
-
/* @__PURE__ */
|
|
1012
|
-
/* @__PURE__ */ e(
|
|
1013
|
-
o.badge ? /* @__PURE__ */ e(
|
|
1277
|
+
/* @__PURE__ */ i("span", { className: "cms-shell__icon", children: [
|
|
1278
|
+
/* @__PURE__ */ e(A, { name: o.icon, size: 22 }),
|
|
1279
|
+
o.badge ? /* @__PURE__ */ e(_n, { count: o.badge.count, label: o.badge.label }) : null
|
|
1014
1280
|
] }),
|
|
1015
1281
|
/* @__PURE__ */ e("span", { className: "cms-shell__label", children: o.label })
|
|
1016
1282
|
]
|
|
@@ -1018,26 +1284,26 @@ function Yn({ product: n, mark: l, rail: t, active: i, onNavigate: c, server: s,
|
|
|
1018
1284
|
) }, o.id);
|
|
1019
1285
|
}) })
|
|
1020
1286
|
] }),
|
|
1021
|
-
/* @__PURE__ */
|
|
1287
|
+
/* @__PURE__ */ i("header", { className: "cms-shell__top", children: [
|
|
1022
1288
|
/* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1289
|
+
r != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: r }) : null,
|
|
1290
|
+
m != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: m }) : null,
|
|
1291
|
+
s != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: s }) : null
|
|
1026
1292
|
] }),
|
|
1027
|
-
/* @__PURE__ */ e("main", { className: "cms-shell__main", children:
|
|
1293
|
+
/* @__PURE__ */ e("main", { className: "cms-shell__main", children: h })
|
|
1028
1294
|
] });
|
|
1029
1295
|
}
|
|
1030
|
-
function
|
|
1031
|
-
return /* @__PURE__ */
|
|
1296
|
+
function Qn({ label: n, placeholder: l, value: t, onChange: d, onSearch: c }) {
|
|
1297
|
+
return /* @__PURE__ */ i(
|
|
1032
1298
|
"form",
|
|
1033
1299
|
{
|
|
1034
1300
|
role: "search",
|
|
1035
1301
|
className: "cms-search",
|
|
1036
|
-
onSubmit: (
|
|
1037
|
-
|
|
1302
|
+
onSubmit: (r) => {
|
|
1303
|
+
r.preventDefault(), c == null || c(t);
|
|
1038
1304
|
},
|
|
1039
1305
|
children: [
|
|
1040
|
-
/* @__PURE__ */ e(
|
|
1306
|
+
/* @__PURE__ */ e(A, { name: "search", size: 18 }),
|
|
1041
1307
|
/* @__PURE__ */ e(
|
|
1042
1308
|
"input",
|
|
1043
1309
|
{
|
|
@@ -1046,43 +1312,43 @@ function Gn({ label: n, placeholder: l, value: t, onChange: i, onSearch: c }) {
|
|
|
1046
1312
|
"aria-label": n,
|
|
1047
1313
|
placeholder: l,
|
|
1048
1314
|
value: t,
|
|
1049
|
-
onChange: (
|
|
1315
|
+
onChange: (r) => d(r.target.value)
|
|
1050
1316
|
}
|
|
1051
1317
|
)
|
|
1052
1318
|
]
|
|
1053
1319
|
}
|
|
1054
1320
|
);
|
|
1055
1321
|
}
|
|
1056
|
-
function
|
|
1057
|
-
const c =
|
|
1058
|
-
const
|
|
1059
|
-
if (
|
|
1060
|
-
const a = Math.abs(
|
|
1061
|
-
|
|
1322
|
+
function vn({ options: n, value: l, onChange: t, label: d }) {
|
|
1323
|
+
const c = I([]), r = I(null), [m, s] = E({ start: !1, end: !1 }), h = () => {
|
|
1324
|
+
const u = r.current;
|
|
1325
|
+
if (u === null) return;
|
|
1326
|
+
const a = Math.abs(u.scrollLeft), f = a > 1, p = a + u.clientWidth < u.scrollWidth - 1;
|
|
1327
|
+
s((_) => _.start === f && _.end === p ? _ : { start: f, end: p });
|
|
1062
1328
|
};
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
const
|
|
1066
|
-
if (
|
|
1067
|
-
const a = new ResizeObserver(
|
|
1068
|
-
a.observe(
|
|
1069
|
-
for (const
|
|
1329
|
+
Ne(() => {
|
|
1330
|
+
h();
|
|
1331
|
+
const u = r.current;
|
|
1332
|
+
if (u === null || typeof ResizeObserver > "u") return;
|
|
1333
|
+
const a = new ResizeObserver(h);
|
|
1334
|
+
a.observe(u);
|
|
1335
|
+
for (const f of c.current) f !== null && a.observe(f);
|
|
1070
1336
|
return () => a.disconnect();
|
|
1071
1337
|
}, [n]);
|
|
1072
|
-
const
|
|
1073
|
-
var a,
|
|
1074
|
-
return (
|
|
1075
|
-
}, o = (
|
|
1338
|
+
const b = (u) => {
|
|
1339
|
+
var a, f;
|
|
1340
|
+
return (f = (a = c.current[u]) == null ? void 0 : a.scrollIntoView) == null ? void 0 : f.call(a, { block: "nearest", inline: "nearest" });
|
|
1341
|
+
}, o = (u, a) => {
|
|
1076
1342
|
var N;
|
|
1077
|
-
const
|
|
1343
|
+
const f = n.length - 1, p = u.key === "ArrowRight" || u.key === "ArrowDown" ? a === f ? 0 : a + 1 : u.key === "ArrowLeft" || u.key === "ArrowUp" ? a === 0 ? f : a - 1 : null;
|
|
1078
1344
|
if (p === null) return;
|
|
1079
|
-
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1345
|
+
u.preventDefault();
|
|
1346
|
+
const _ = n[p];
|
|
1347
|
+
_ && (t(_.id), (N = c.current[p]) == null || N.focus(), b(p));
|
|
1082
1348
|
};
|
|
1083
|
-
return /* @__PURE__ */ e("div", { ref:
|
|
1084
|
-
const
|
|
1085
|
-
return /* @__PURE__ */
|
|
1349
|
+
return /* @__PURE__ */ e("div", { ref: r, className: T("cms-chips", m.start && "is-past-start", m.end && "is-past-end"), role: "radiogroup", "aria-label": d, onScroll: h, "data-scrolls-sideways": "", children: n.map((u, a) => {
|
|
1350
|
+
const f = u.id === l;
|
|
1351
|
+
return /* @__PURE__ */ i(
|
|
1086
1352
|
"button",
|
|
1087
1353
|
{
|
|
1088
1354
|
ref: (p) => {
|
|
@@ -1090,34 +1356,34 @@ function fn({ options: n, value: l, onChange: t, label: i }) {
|
|
|
1090
1356
|
},
|
|
1091
1357
|
type: "button",
|
|
1092
1358
|
role: "radio",
|
|
1093
|
-
"aria-checked":
|
|
1094
|
-
tabIndex:
|
|
1095
|
-
className:
|
|
1359
|
+
"aria-checked": f,
|
|
1360
|
+
tabIndex: f ? 0 : -1,
|
|
1361
|
+
className: T("cms-chip", f && "is-on"),
|
|
1096
1362
|
onClick: () => {
|
|
1097
|
-
t(
|
|
1363
|
+
t(u.id), b(a);
|
|
1098
1364
|
},
|
|
1099
1365
|
onKeyDown: (p) => o(p, a),
|
|
1100
1366
|
children: [
|
|
1101
|
-
|
|
1102
|
-
|
|
1367
|
+
f ? /* @__PURE__ */ e(A, { name: "check", size: 16 }) : null,
|
|
1368
|
+
u.label
|
|
1103
1369
|
]
|
|
1104
1370
|
},
|
|
1105
|
-
|
|
1371
|
+
u.id
|
|
1106
1372
|
);
|
|
1107
1373
|
}) });
|
|
1108
1374
|
}
|
|
1109
|
-
const
|
|
1110
|
-
function
|
|
1111
|
-
const
|
|
1112
|
-
let c =
|
|
1113
|
-
for (let
|
|
1114
|
-
const
|
|
1115
|
-
|
|
1375
|
+
const De = 16;
|
|
1376
|
+
function gn(n, l, t) {
|
|
1377
|
+
const d = n.map((r) => Math.min(Math.max(r.width, r.min), r.max));
|
|
1378
|
+
let c = d.reduce((r, m) => r + m, 0) + t - l;
|
|
1379
|
+
for (let r = d.length - 1; r >= 0 && c > 0; r -= 1) {
|
|
1380
|
+
const m = Math.min(c, d[r] - n[r].min);
|
|
1381
|
+
d[r] = d[r] - m, c -= m;
|
|
1116
1382
|
}
|
|
1117
|
-
return
|
|
1383
|
+
return d;
|
|
1118
1384
|
}
|
|
1119
|
-
function
|
|
1120
|
-
const
|
|
1385
|
+
function Nn({ index: n, size: l, shown: t, others: d, room: c, lastMin: r, onResize: m }) {
|
|
1386
|
+
const s = Math.max(l.min, Math.min(l.max, c > 0 ? c - d - r : l.max)), h = (u) => Math.round(Math.min(Math.max(u, l.min), s)), b = I(null), o = (u, a) => m == null ? void 0 : m(n, h(u), a);
|
|
1121
1387
|
return /* @__PURE__ */ e(
|
|
1122
1388
|
"div",
|
|
1123
1389
|
{
|
|
@@ -1127,74 +1393,74 @@ function _n({ index: n, size: l, shown: t, others: i, room: c, lastMin: s, onRes
|
|
|
1127
1393
|
"aria-label": l.label,
|
|
1128
1394
|
"aria-valuenow": t,
|
|
1129
1395
|
"aria-valuemin": l.min,
|
|
1130
|
-
"aria-valuemax":
|
|
1396
|
+
"aria-valuemax": s,
|
|
1131
1397
|
className: "cms-panes__splitter",
|
|
1132
1398
|
style: { "--split-at": `var(--split-pane-end-${String(n)})` },
|
|
1133
|
-
onPointerDown: (
|
|
1134
|
-
var a,
|
|
1135
|
-
|
|
1399
|
+
onPointerDown: (u) => {
|
|
1400
|
+
var a, f, p;
|
|
1401
|
+
u.button > 0 || (u.preventDefault(), (f = (a = u.currentTarget).setPointerCapture) == null || f.call(a, u.pointerId), b.current = { x: u.clientX, from: t, last: t }, (p = u.currentTarget.closest(".cms-panes")) == null || p.classList.add("is-resizing"));
|
|
1136
1402
|
},
|
|
1137
|
-
onPointerMove: (
|
|
1138
|
-
const a =
|
|
1139
|
-
a === null || !Number.isFinite(
|
|
1403
|
+
onPointerMove: (u) => {
|
|
1404
|
+
const a = b.current;
|
|
1405
|
+
a === null || !Number.isFinite(u.clientX) || (a.last = h(a.from + u.clientX - a.x), o(a.last, !1));
|
|
1140
1406
|
},
|
|
1141
|
-
onPointerUp: (
|
|
1142
|
-
var
|
|
1143
|
-
const a =
|
|
1144
|
-
a !== null && (
|
|
1407
|
+
onPointerUp: (u) => {
|
|
1408
|
+
var f;
|
|
1409
|
+
const a = b.current;
|
|
1410
|
+
a !== null && (b.current = null, (f = u.currentTarget.closest(".cms-panes")) == null || f.classList.remove("is-resizing"), o(a.last, !0));
|
|
1145
1411
|
},
|
|
1146
|
-
onPointerCancel: (
|
|
1147
|
-
var
|
|
1148
|
-
const a =
|
|
1149
|
-
|
|
1412
|
+
onPointerCancel: (u) => {
|
|
1413
|
+
var f;
|
|
1414
|
+
const a = b.current;
|
|
1415
|
+
b.current = null, (f = u.currentTarget.closest(".cms-panes")) == null || f.classList.remove("is-resizing"), a !== null && o(a.last, !0);
|
|
1150
1416
|
},
|
|
1151
1417
|
onDoubleClick: () => o(l.reset, !0),
|
|
1152
|
-
onKeyDown: (
|
|
1153
|
-
const a =
|
|
1154
|
-
a !== null && (
|
|
1418
|
+
onKeyDown: (u) => {
|
|
1419
|
+
const a = u.key === "ArrowLeft" ? t - De : u.key === "ArrowRight" ? t + De : u.key === "Home" ? l.min : u.key === "End" ? s : u.key === "Enter" ? l.reset : null;
|
|
1420
|
+
a !== null && (u.preventDefault(), o(a, !0));
|
|
1155
1421
|
}
|
|
1156
1422
|
}
|
|
1157
1423
|
);
|
|
1158
1424
|
}
|
|
1159
|
-
function
|
|
1160
|
-
const
|
|
1161
|
-
|
|
1162
|
-
const p =
|
|
1163
|
-
if (p === null || !
|
|
1164
|
-
const
|
|
1165
|
-
if (
|
|
1166
|
-
const N = new ResizeObserver(
|
|
1425
|
+
function el({ panes: n, active: l, back: t, sizes: d, lastMin: c = 360, onResize: r }) {
|
|
1426
|
+
const m = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), s = I(null), [h, b] = E(0), o = (d ?? []).slice(0, n.length - 1), u = o.length === n.length - 1 && o.every((p) => p !== void 0);
|
|
1427
|
+
Ne(() => {
|
|
1428
|
+
const p = s.current;
|
|
1429
|
+
if (p === null || !u) return;
|
|
1430
|
+
const _ = () => b(p.clientWidth);
|
|
1431
|
+
if (_(), typeof ResizeObserver > "u") return;
|
|
1432
|
+
const N = new ResizeObserver(_);
|
|
1167
1433
|
return N.observe(p), () => N.disconnect();
|
|
1168
|
-
}, [
|
|
1169
|
-
const a =
|
|
1170
|
-
[`--split-pane-${String(
|
|
1171
|
-
[`--split-pane-end-${String(
|
|
1434
|
+
}, [u]);
|
|
1435
|
+
const a = u ? gn(o, h > 0 ? h : Number.POSITIVE_INFINITY, c) : [], f = u ? Object.fromEntries(a.flatMap((p, _) => [
|
|
1436
|
+
[`--split-pane-${String(_)}`, `${String(p)}px`],
|
|
1437
|
+
[`--split-pane-end-${String(_)}`, `${String(a.slice(0, _ + 1).reduce((N, y) => N + y, 0))}px`]
|
|
1172
1438
|
])) : void 0;
|
|
1173
|
-
return /* @__PURE__ */
|
|
1439
|
+
return /* @__PURE__ */ i(
|
|
1174
1440
|
"div",
|
|
1175
1441
|
{
|
|
1176
|
-
ref:
|
|
1177
|
-
className:
|
|
1178
|
-
"data-active":
|
|
1179
|
-
style:
|
|
1442
|
+
ref: s,
|
|
1443
|
+
className: T("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", u && "cms-panes--sized"),
|
|
1444
|
+
"data-active": m,
|
|
1445
|
+
style: f,
|
|
1180
1446
|
children: [
|
|
1181
|
-
n.map((p,
|
|
1182
|
-
|
|
1183
|
-
/* @__PURE__ */ e(
|
|
1447
|
+
n.map((p, _) => /* @__PURE__ */ i("section", { className: "cms-panes__pane", "aria-label": p.label, "data-offset": m - _, children: [
|
|
1448
|
+
_ === m && t ? /* @__PURE__ */ i("a", { className: "cms-panes__back", href: t.href, children: [
|
|
1449
|
+
/* @__PURE__ */ e(A, { name: "chevron-left", size: 18 }),
|
|
1184
1450
|
t.label
|
|
1185
1451
|
] }) : null,
|
|
1186
1452
|
p.content
|
|
1187
1453
|
] }, p.label)),
|
|
1188
|
-
|
|
1189
|
-
|
|
1454
|
+
u ? o.map((p, _) => /* @__PURE__ */ e(
|
|
1455
|
+
Nn,
|
|
1190
1456
|
{
|
|
1191
|
-
index:
|
|
1457
|
+
index: _,
|
|
1192
1458
|
size: p,
|
|
1193
|
-
shown: a[
|
|
1194
|
-
others: a.reduce((N,
|
|
1195
|
-
room:
|
|
1459
|
+
shown: a[_],
|
|
1460
|
+
others: a.reduce((N, y, x) => x === _ ? N : N + y, 0),
|
|
1461
|
+
room: h,
|
|
1196
1462
|
lastMin: c,
|
|
1197
|
-
onResize:
|
|
1463
|
+
onResize: r
|
|
1198
1464
|
},
|
|
1199
1465
|
p.label
|
|
1200
1466
|
)) : null
|
|
@@ -1202,77 +1468,103 @@ function Xn({ panes: n, active: l, back: t, sizes: i, lastMin: c = 360, onResize
|
|
|
1202
1468
|
}
|
|
1203
1469
|
);
|
|
1204
1470
|
}
|
|
1205
|
-
const
|
|
1206
|
-
function
|
|
1207
|
-
const
|
|
1208
|
-
return /* @__PURE__ */
|
|
1209
|
-
"
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1471
|
+
const yn = { attachment: "Has an attachment", unread: "Unread" };
|
|
1472
|
+
function nl({ from: n, subject: l, preview: t, time: d, unread: c, hasAttachment: r, selected: m, onOpen: s, check: h, selecting: b, labels: o }) {
|
|
1473
|
+
const u = de(yn, o), a = /* @__PURE__ */ e(ge, { name: n, size: 40 });
|
|
1474
|
+
return /* @__PURE__ */ i("div", { className: T("cms-mail-row", c && "is-unread", m && "is-selected", b && "is-selecting", (h == null ? void 0 : h.checked) && "is-checked"), children: [
|
|
1475
|
+
h !== void 0 ? /* @__PURE__ */ i("span", { className: "cms-mail-row__lead", children: [
|
|
1476
|
+
a,
|
|
1477
|
+
/* @__PURE__ */ e(
|
|
1478
|
+
"input",
|
|
1479
|
+
{
|
|
1480
|
+
type: "checkbox",
|
|
1481
|
+
className: "cms-mail-row__check",
|
|
1482
|
+
checked: h.checked,
|
|
1483
|
+
disabled: h.disabled,
|
|
1484
|
+
"aria-disabled": h.pending ? "true" : void 0,
|
|
1485
|
+
"aria-busy": h.pending ? "true" : void 0,
|
|
1486
|
+
"aria-label": h.label,
|
|
1487
|
+
onChange: () => {
|
|
1488
|
+
},
|
|
1489
|
+
onClick: (f) => {
|
|
1490
|
+
if (f.stopPropagation(), h.pending) {
|
|
1491
|
+
f.preventDefault();
|
|
1492
|
+
return;
|
|
1493
|
+
}
|
|
1494
|
+
h.onCheck({ shift: f.shiftKey, toggle: f.ctrlKey || f.metaKey });
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
)
|
|
1498
|
+
] }) : null,
|
|
1499
|
+
/* @__PURE__ */ i(
|
|
1500
|
+
"button",
|
|
1501
|
+
{
|
|
1502
|
+
type: "button",
|
|
1503
|
+
className: "cms-mail-row__open",
|
|
1504
|
+
"aria-current": m ? "true" : void 0,
|
|
1505
|
+
onClick: s,
|
|
1506
|
+
children: [
|
|
1507
|
+
h === void 0 ? a : null,
|
|
1508
|
+
/* @__PURE__ */ i("span", { className: "cms-mail-row__body", children: [
|
|
1509
|
+
/* @__PURE__ */ i("span", { className: "cms-mail-row__line", children: [
|
|
1510
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
|
|
1511
|
+
r ? /* @__PURE__ */ e(A, { name: "paperclip", size: 16, label: u.attachment }) : null,
|
|
1512
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: d })
|
|
1513
|
+
] }),
|
|
1514
|
+
/* @__PURE__ */ i("span", { className: "cms-mail-row__line", children: [
|
|
1515
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
|
|
1516
|
+
c ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": u.unread }) : null
|
|
1517
|
+
] }),
|
|
1518
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: t })
|
|
1519
|
+
] })
|
|
1520
|
+
]
|
|
1521
|
+
}
|
|
1522
|
+
)
|
|
1523
|
+
] });
|
|
1232
1524
|
}
|
|
1233
|
-
function
|
|
1234
|
-
return /* @__PURE__ */
|
|
1525
|
+
function ll({ direction: n, children: l, time: t, read: d, readLabel: c = "Read" }) {
|
|
1526
|
+
return /* @__PURE__ */ i("div", { className: T("cms-bubble", `cms-bubble--${n}`), children: [
|
|
1235
1527
|
/* @__PURE__ */ e("div", { className: "cms-bubble__text", children: l }),
|
|
1236
|
-
/* @__PURE__ */
|
|
1528
|
+
/* @__PURE__ */ i("div", { className: "cms-bubble__meta", children: [
|
|
1237
1529
|
t,
|
|
1238
|
-
n === "out" &&
|
|
1530
|
+
n === "out" && d ? /* @__PURE__ */ i(M, { children: [
|
|
1239
1531
|
" · ",
|
|
1240
1532
|
c
|
|
1241
1533
|
] }) : null
|
|
1242
1534
|
] })
|
|
1243
1535
|
] });
|
|
1244
1536
|
}
|
|
1245
|
-
function
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
-
}, p = c ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label":
|
|
1249
|
-
return /* @__PURE__ */
|
|
1250
|
-
/* @__PURE__ */ e("label", { htmlFor:
|
|
1251
|
-
|
|
1537
|
+
function tl({ label: n, value: l, onChange: t, onSend: d, onAttach: c, placeholder: r, variant: m = "chat", sendLabel: s = "Send", attachLabel: h = "Attach a file", leading: b, canSend: o }) {
|
|
1538
|
+
const u = Y(), a = o ?? l.trim() !== "", f = (_) => {
|
|
1539
|
+
_.preventDefault(), a && d();
|
|
1540
|
+
}, p = c ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": h, onClick: c, children: /* @__PURE__ */ e(A, { name: "paperclip" }) }) : null;
|
|
1541
|
+
return /* @__PURE__ */ i("form", { className: T("cms-composer", `cms-composer--${m}`), onSubmit: f, children: [
|
|
1542
|
+
/* @__PURE__ */ e("label", { htmlFor: u, className: m === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
|
|
1543
|
+
m === "chat" ? p : null,
|
|
1252
1544
|
/* @__PURE__ */ e(
|
|
1253
1545
|
"textarea",
|
|
1254
1546
|
{
|
|
1255
|
-
id:
|
|
1547
|
+
id: u,
|
|
1256
1548
|
className: "cms-composer__input",
|
|
1257
|
-
rows:
|
|
1258
|
-
placeholder:
|
|
1549
|
+
rows: m === "reply" ? 3 : 1,
|
|
1550
|
+
placeholder: r,
|
|
1259
1551
|
value: l,
|
|
1260
|
-
onChange: (
|
|
1261
|
-
onKeyDown: (
|
|
1262
|
-
|
|
1552
|
+
onChange: (_) => t(_.target.value),
|
|
1553
|
+
onKeyDown: (_) => {
|
|
1554
|
+
_.nativeEvent.isComposing || _.keyCode === 229 || m === "chat" && _.key === "Enter" && !_.shiftKey && (_.preventDefault(), a && d());
|
|
1263
1555
|
}
|
|
1264
1556
|
}
|
|
1265
1557
|
),
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1558
|
+
m === "reply" && b !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: b }) : null,
|
|
1559
|
+
m === "reply" ? p : null,
|
|
1560
|
+
m === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": s, disabled: !a, children: /* @__PURE__ */ e(A, { name: "send" }) }) : /* @__PURE__ */ i("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !a, children: [
|
|
1561
|
+
s,
|
|
1270
1562
|
" ",
|
|
1271
|
-
/* @__PURE__ */ e(
|
|
1563
|
+
/* @__PURE__ */ e(A, { name: "send", size: 18 })
|
|
1272
1564
|
] })
|
|
1273
1565
|
] });
|
|
1274
1566
|
}
|
|
1275
|
-
const
|
|
1567
|
+
const Ae = {
|
|
1276
1568
|
incomingAudio: "Incoming audio call",
|
|
1277
1569
|
incomingVideo: "Incoming video call",
|
|
1278
1570
|
incomingFrom: (n, l) => `${n} from ${l}`,
|
|
@@ -1293,91 +1585,91 @@ const Ee = {
|
|
|
1293
1585
|
onCallWith: (n) => `On a call with ${n}`,
|
|
1294
1586
|
returnToCall: "Return to call"
|
|
1295
1587
|
};
|
|
1296
|
-
function
|
|
1297
|
-
const
|
|
1298
|
-
return /* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
1588
|
+
function al({ name: n, media: l, onAccept: t, onDecline: d, labels: c }) {
|
|
1589
|
+
const r = de(Ae, c), m = l === "video" ? r.incomingVideo : r.incomingAudio;
|
|
1590
|
+
return /* @__PURE__ */ i("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": r.incomingFrom(m, n), children: [
|
|
1591
|
+
/* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(ge, { name: n, size: 112 }) }),
|
|
1300
1592
|
/* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: n }),
|
|
1301
|
-
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children:
|
|
1302
|
-
/* @__PURE__ */
|
|
1303
|
-
/* @__PURE__ */ e(
|
|
1304
|
-
/* @__PURE__ */ e(
|
|
1593
|
+
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: m }),
|
|
1594
|
+
/* @__PURE__ */ i("div", { className: "cms-call-incoming__actions", children: [
|
|
1595
|
+
/* @__PURE__ */ e(se, { icon: "phone-off", label: r.decline, tone: "hang-up", onClick: d }),
|
|
1596
|
+
/* @__PURE__ */ e(se, { icon: "phone", label: r.accept, tone: "accept", onClick: t })
|
|
1305
1597
|
] })
|
|
1306
1598
|
] });
|
|
1307
1599
|
}
|
|
1308
|
-
function
|
|
1309
|
-
return /* @__PURE__ */
|
|
1600
|
+
function se({ icon: n, label: l, onClick: t, tone: d = "plain", pressed: c }) {
|
|
1601
|
+
return /* @__PURE__ */ i(
|
|
1310
1602
|
"button",
|
|
1311
1603
|
{
|
|
1312
1604
|
type: "button",
|
|
1313
|
-
className:
|
|
1605
|
+
className: T("cms-call-button", `cms-call-button--${d}`, c && "is-pressed"),
|
|
1314
1606
|
"aria-pressed": c,
|
|
1315
1607
|
onClick: t,
|
|
1316
1608
|
children: [
|
|
1317
|
-
/* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(
|
|
1609
|
+
/* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(A, { name: n, size: 24 }) }),
|
|
1318
1610
|
/* @__PURE__ */ e("span", { className: "cms-call-button__label", children: l })
|
|
1319
1611
|
]
|
|
1320
1612
|
}
|
|
1321
1613
|
);
|
|
1322
1614
|
}
|
|
1323
|
-
function
|
|
1324
|
-
const a =
|
|
1325
|
-
return /* @__PURE__ */
|
|
1326
|
-
/* @__PURE__ */
|
|
1327
|
-
/* @__PURE__ */ e(
|
|
1328
|
-
/* @__PURE__ */
|
|
1615
|
+
function sl({ name: n, duration: l, connection: t, you: d, muted: c, speaker: r, onToggleMute: m, onToggleSpeaker: s, onAddPerson: h, onChat: b, onHangUp: o, labels: u }) {
|
|
1616
|
+
const a = de(Ae, u);
|
|
1617
|
+
return /* @__PURE__ */ i("section", { className: "cms-call-panel", "aria-label": a.callWith(n), children: [
|
|
1618
|
+
/* @__PURE__ */ i("div", { className: "cms-call-panel__head", children: [
|
|
1619
|
+
/* @__PURE__ */ e(ge, { name: n, size: 64 }),
|
|
1620
|
+
/* @__PURE__ */ i("div", { className: "cms-call-panel__who", children: [
|
|
1329
1621
|
/* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
|
|
1330
1622
|
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": a.callTime(l), children: l })
|
|
1331
1623
|
] }),
|
|
1332
|
-
/* @__PURE__ */ e("span", { className:
|
|
1624
|
+
/* @__PURE__ */ e("span", { className: T("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? a.goodConnection : a.poorConnection })
|
|
1333
1625
|
] }),
|
|
1334
|
-
/* @__PURE__ */
|
|
1335
|
-
/* @__PURE__ */ e(
|
|
1626
|
+
/* @__PURE__ */ i("div", { className: "cms-call-panel__you", children: [
|
|
1627
|
+
/* @__PURE__ */ e(ge, { name: d.name, size: 36 }),
|
|
1336
1628
|
/* @__PURE__ */ e("span", { children: a.you }),
|
|
1337
|
-
|
|
1629
|
+
d.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": a.speaking }) : null
|
|
1338
1630
|
] }),
|
|
1339
|
-
/* @__PURE__ */
|
|
1340
|
-
/* @__PURE__ */ e(
|
|
1341
|
-
/* @__PURE__ */ e(
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
/* @__PURE__ */ e(
|
|
1631
|
+
/* @__PURE__ */ i("div", { className: "cms-call-panel__controls", children: [
|
|
1632
|
+
/* @__PURE__ */ e(se, { icon: "mic", label: c ? a.unmute : a.mute, pressed: c, onClick: m }),
|
|
1633
|
+
/* @__PURE__ */ e(se, { icon: "speaker", label: a.speaker, pressed: r, onClick: s }),
|
|
1634
|
+
h ? /* @__PURE__ */ e(se, { icon: "user-plus", label: a.addPerson, onClick: h }) : null,
|
|
1635
|
+
b ? /* @__PURE__ */ e(se, { icon: "chat", label: a.chat, onClick: b }) : null,
|
|
1636
|
+
/* @__PURE__ */ e(se, { icon: "phone-off", label: a.hangUp, tone: "hang-up", onClick: o })
|
|
1345
1637
|
] })
|
|
1346
1638
|
] });
|
|
1347
1639
|
}
|
|
1348
|
-
function
|
|
1349
|
-
const
|
|
1350
|
-
return /* @__PURE__ */
|
|
1640
|
+
function rl({ name: n, duration: l, muted: t, onToggleMute: d, onReturn: c, onHangUp: r, labels: m }) {
|
|
1641
|
+
const s = de(Ae, m);
|
|
1642
|
+
return /* @__PURE__ */ i("section", { className: "cms-call-bar", "aria-label": s.callWith(n), children: [
|
|
1351
1643
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
|
|
1352
|
-
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children:
|
|
1644
|
+
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: s.onCallWith(n) }),
|
|
1353
1645
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: l }),
|
|
1354
|
-
/* @__PURE__ */
|
|
1355
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ?
|
|
1356
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: c, children:
|
|
1357
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label":
|
|
1646
|
+
/* @__PURE__ */ i("span", { className: "cms-call-bar__actions", children: [
|
|
1647
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ? s.unmute : s.mute, "aria-pressed": t, onClick: d, children: /* @__PURE__ */ e(A, { name: "mic" }) }),
|
|
1648
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: c, children: s.returnToCall }),
|
|
1649
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": s.hangUp, onClick: r, children: /* @__PURE__ */ e(A, { name: "phone-off" }) })
|
|
1358
1650
|
] })
|
|
1359
1651
|
] });
|
|
1360
1652
|
}
|
|
1361
|
-
function
|
|
1362
|
-
return /* @__PURE__ */
|
|
1363
|
-
/* @__PURE__ */
|
|
1364
|
-
/* @__PURE__ */
|
|
1653
|
+
function cl({ mark: n, product: l, headline: t, lead: d, features: c = [], children: r }) {
|
|
1654
|
+
return /* @__PURE__ */ i("div", { className: "cms-signin", children: [
|
|
1655
|
+
/* @__PURE__ */ i("aside", { className: "cms-signin__brand", children: [
|
|
1656
|
+
/* @__PURE__ */ i("p", { className: "cms-signin__logo", children: [
|
|
1365
1657
|
/* @__PURE__ */ e("span", { className: "cms-signin__mark", "aria-hidden": "true", children: n }),
|
|
1366
1658
|
l
|
|
1367
1659
|
] }),
|
|
1368
|
-
/* @__PURE__ */
|
|
1660
|
+
/* @__PURE__ */ i("div", { className: "cms-signin__pitch", children: [
|
|
1369
1661
|
/* @__PURE__ */ e("p", { className: "cms-signin__headline", children: t }),
|
|
1370
|
-
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children:
|
|
1371
|
-
c.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: c.map((
|
|
1372
|
-
/* @__PURE__ */ e(
|
|
1373
|
-
|
|
1374
|
-
] },
|
|
1662
|
+
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children: d }),
|
|
1663
|
+
c.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: c.map((m) => /* @__PURE__ */ i("li", { children: [
|
|
1664
|
+
/* @__PURE__ */ e(A, { name: m.icon, size: 18 }),
|
|
1665
|
+
m.label
|
|
1666
|
+
] }, m.label)) }) : null
|
|
1375
1667
|
] })
|
|
1376
1668
|
] }),
|
|
1377
|
-
/* @__PURE__ */ e("main", { className: "cms-signin__form", children:
|
|
1669
|
+
/* @__PURE__ */ e("main", { className: "cms-signin__form", children: r })
|
|
1378
1670
|
] });
|
|
1379
1671
|
}
|
|
1380
|
-
const
|
|
1672
|
+
const wn = {
|
|
1381
1673
|
title: "Sign in",
|
|
1382
1674
|
identifier: "Email or username",
|
|
1383
1675
|
identifierPlaceholder: "name@example.com",
|
|
@@ -1389,294 +1681,127 @@ const vn = {
|
|
|
1389
1681
|
newHere: "New here?",
|
|
1390
1682
|
create: "Create an account"
|
|
1391
1683
|
};
|
|
1392
|
-
function
|
|
1393
|
-
const
|
|
1394
|
-
return /* @__PURE__ */
|
|
1395
|
-
N.preventDefault(), l(
|
|
1396
|
-
}, "aria-describedby": c ? `${
|
|
1397
|
-
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children:
|
|
1398
|
-
/* @__PURE__ */
|
|
1399
|
-
/* @__PURE__ */ e(
|
|
1684
|
+
function il({ server: n, onSubmit: l, forgotHref: t, createHref: d, error: c, busy: r, labels: m }) {
|
|
1685
|
+
const s = de(wn, m), h = Y(), [b, o] = E(""), [u, a] = E(""), [f, p] = E(!1);
|
|
1686
|
+
return /* @__PURE__ */ i("form", { className: "cms-signin-form", onSubmit: (N) => {
|
|
1687
|
+
N.preventDefault(), l(b, u);
|
|
1688
|
+
}, "aria-describedby": c ? `${h}-error` : void 0, children: [
|
|
1689
|
+
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: s.title }),
|
|
1690
|
+
/* @__PURE__ */ i("p", { className: "cms-signin-form__server", children: [
|
|
1691
|
+
/* @__PURE__ */ e(A, { name: "server", size: 18 }),
|
|
1400
1692
|
n
|
|
1401
1693
|
] }),
|
|
1402
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${
|
|
1694
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${h}-identifier`, children: s.identifier }),
|
|
1403
1695
|
/* @__PURE__ */ e(
|
|
1404
1696
|
"input",
|
|
1405
1697
|
{
|
|
1406
|
-
id: `${
|
|
1698
|
+
id: `${h}-identifier`,
|
|
1407
1699
|
className: "cms-signin-form__input",
|
|
1408
1700
|
type: "text",
|
|
1409
1701
|
autoComplete: "username",
|
|
1410
|
-
placeholder:
|
|
1411
|
-
value:
|
|
1702
|
+
placeholder: s.identifierPlaceholder,
|
|
1703
|
+
value: b,
|
|
1412
1704
|
onChange: (N) => o(N.target.value),
|
|
1413
1705
|
required: !0
|
|
1414
1706
|
}
|
|
1415
1707
|
),
|
|
1416
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${
|
|
1417
|
-
/* @__PURE__ */
|
|
1708
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${h}-password`, children: s.password }),
|
|
1709
|
+
/* @__PURE__ */ i("span", { className: "cms-signin-form__password", children: [
|
|
1418
1710
|
/* @__PURE__ */ e(
|
|
1419
1711
|
"input",
|
|
1420
1712
|
{
|
|
1421
|
-
id: `${
|
|
1713
|
+
id: `${h}-password`,
|
|
1422
1714
|
className: "cms-signin-form__input",
|
|
1423
|
-
type:
|
|
1715
|
+
type: f ? "text" : "password",
|
|
1424
1716
|
autoComplete: "current-password",
|
|
1425
|
-
value:
|
|
1717
|
+
value: u,
|
|
1426
1718
|
onChange: (N) => a(N.target.value),
|
|
1427
1719
|
required: !0
|
|
1428
1720
|
}
|
|
1429
1721
|
),
|
|
1430
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed":
|
|
1722
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": f, onClick: () => p((N) => !N), children: f ? s.hide : s.show })
|
|
1431
1723
|
] }),
|
|
1432
|
-
t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children:
|
|
1433
|
-
c ? /* @__PURE__ */ e("p", { id: `${
|
|
1434
|
-
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled:
|
|
1435
|
-
|
|
1436
|
-
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children:
|
|
1437
|
-
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href:
|
|
1724
|
+
t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children: s.forgot }) : null,
|
|
1725
|
+
c ? /* @__PURE__ */ e("p", { id: `${h}-error`, className: "cms-signin-form__error", role: "alert", children: c }) : null,
|
|
1726
|
+
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: r, "aria-busy": r || void 0, children: s.submit }),
|
|
1727
|
+
d ? /* @__PURE__ */ i(M, { children: [
|
|
1728
|
+
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: s.newHere }) }),
|
|
1729
|
+
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: d, children: s.create })
|
|
1438
1730
|
] }) : null
|
|
1439
1731
|
] });
|
|
1440
1732
|
}
|
|
1441
|
-
const
|
|
1442
|
-
function
|
|
1443
|
-
for (let t = n instanceof Element ? n : null; t !== null; t = t.parentElement) {
|
|
1444
|
-
if (t instanceof HTMLElement && t.scrollTop > 0) return !1;
|
|
1445
|
-
if (t === l) return !0;
|
|
1446
|
-
}
|
|
1447
|
-
return l.scrollTop <= 0;
|
|
1448
|
-
}
|
|
1449
|
-
function Nn(n, l) {
|
|
1450
|
-
const [t, i] = E(0), c = F(l);
|
|
1451
|
-
return c.current = l, Y(() => {
|
|
1452
|
-
const s = n.current;
|
|
1453
|
-
if (s === null) return;
|
|
1454
|
-
let d = null, r = 0;
|
|
1455
|
-
const f = (m) => {
|
|
1456
|
-
d = gn(m.target, s) && m.touches.length === 1 ? m.touches[0].clientY : null, r = 0;
|
|
1457
|
-
}, _ = (m) => {
|
|
1458
|
-
if (d === null || c.current === null) return;
|
|
1459
|
-
const a = m.touches[0].clientY - d;
|
|
1460
|
-
if (a <= 0) {
|
|
1461
|
-
d = null, i(0);
|
|
1462
|
-
return;
|
|
1463
|
-
}
|
|
1464
|
-
m.cancelable && m.preventDefault(), r = Math.min(a * 0.6, ke * 1.5), i(r);
|
|
1465
|
-
}, o = () => {
|
|
1466
|
-
var m;
|
|
1467
|
-
d !== null && r >= ke && ((m = c.current) == null || m.call(c)), d = null, r = 0, i(0);
|
|
1468
|
-
};
|
|
1469
|
-
return s.addEventListener("touchstart", f, { passive: !0 }), s.addEventListener("touchmove", _, { passive: !1 }), s.addEventListener("touchend", o), s.addEventListener("touchcancel", o), () => {
|
|
1470
|
-
s.removeEventListener("touchstart", f), s.removeEventListener("touchmove", _), s.removeEventListener("touchend", o), s.removeEventListener("touchcancel", o);
|
|
1471
|
-
};
|
|
1472
|
-
}, [n]), t;
|
|
1473
|
-
}
|
|
1474
|
-
const Fe = Ue(null);
|
|
1475
|
-
function yn() {
|
|
1476
|
-
return Ke(Fe);
|
|
1477
|
-
}
|
|
1478
|
-
function rl({ label: n, rows: l, error: t, onRetry: i, loadingText: c = "Loading", emptyTitle: s = "Nothing here yet", emptyHint: d, selected: r, onOpen: f, onRowMenu: _ }) {
|
|
1479
|
-
const o = F([]), m = yn();
|
|
1480
|
-
if (t != null) return /* @__PURE__ */ e(Ge, { message: t, onRetry: i });
|
|
1481
|
-
if (l === null) return /* @__PURE__ */ e(qe, { what: c, layout: "block" });
|
|
1482
|
-
if (l.length === 0) return /* @__PURE__ */ e(Ye, { title: s, hint: d });
|
|
1483
|
-
const a = (h, p, v) => {
|
|
1484
|
-
var N;
|
|
1485
|
-
if (h.key === "ArrowDown" || h.key === "ArrowUp")
|
|
1486
|
-
h.preventDefault(), (N = o.current[Math.min(l.length - 1, Math.max(0, p + (h.key === "ArrowDown" ? 1 : -1)))]) == null || N.focus();
|
|
1487
|
-
else if (h.key === "Enter")
|
|
1488
|
-
f == null || f(v);
|
|
1489
|
-
else if ((h.key === "ContextMenu" || h.shiftKey && h.key === "F10") && _) {
|
|
1490
|
-
h.preventDefault();
|
|
1491
|
-
const w = h.currentTarget.getBoundingClientRect();
|
|
1492
|
-
_(v, { x: w.left + 16, y: w.bottom });
|
|
1493
|
-
}
|
|
1494
|
-
};
|
|
1495
|
-
return /* @__PURE__ */ u(M, { children: [
|
|
1496
|
-
m !== null && (m.distance > 0 || m.refreshing) ? /* @__PURE__ */ u("div", { className: "cms-list__pull", role: "status", style: { height: m.refreshing ? void 0 : m.distance }, "data-ready": m.distance >= ke ? "" : void 0, children: [
|
|
1497
|
-
m.refreshing ? /* @__PURE__ */ e(z, { name: "spinner" }) : null,
|
|
1498
|
-
m.text != null ? /* @__PURE__ */ e("span", { className: "cms-list__pull-text", children: m.text }) : null
|
|
1499
|
-
] }) : null,
|
|
1500
|
-
/* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((h, p) => {
|
|
1501
|
-
const v = h.id === r;
|
|
1502
|
-
return /* @__PURE__ */ u(
|
|
1503
|
-
"li",
|
|
1504
|
-
{
|
|
1505
|
-
ref: (N) => {
|
|
1506
|
-
o.current[p] = N;
|
|
1507
|
-
},
|
|
1508
|
-
role: "option",
|
|
1509
|
-
"aria-selected": v,
|
|
1510
|
-
tabIndex: v || r == null && p === 0 ? 0 : -1,
|
|
1511
|
-
className: A("cms-list__row", v && "is-selected"),
|
|
1512
|
-
onClick: () => f == null ? void 0 : f(h.id),
|
|
1513
|
-
onKeyDown: (N) => a(N, p, h.id),
|
|
1514
|
-
onContextMenu: _ ? (N) => {
|
|
1515
|
-
N.preventDefault(), _(h.id, { x: N.clientX, y: N.clientY });
|
|
1516
|
-
} : void 0,
|
|
1517
|
-
children: [
|
|
1518
|
-
h.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: h.lead }) : null,
|
|
1519
|
-
/* @__PURE__ */ u("span", { className: "cms-list__text", children: [
|
|
1520
|
-
/* @__PURE__ */ e("span", { className: A("cms-list__primary", h.unread === !0 && "is-unread"), children: h.primary }),
|
|
1521
|
-
h.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: h.secondary }) : null
|
|
1522
|
-
] }),
|
|
1523
|
-
h.meta != null || h.count !== void 0 ? /* @__PURE__ */ u("span", { className: "cms-list__end", children: [
|
|
1524
|
-
h.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: h.meta }) : null,
|
|
1525
|
-
h.count !== void 0 && h.count > 0 ? /* @__PURE__ */ e("span", { className: "cms-badge cms-list__count", children: h.count }) : null
|
|
1526
|
-
] }) : null
|
|
1527
|
-
]
|
|
1528
|
-
},
|
|
1529
|
-
h.id
|
|
1530
|
-
);
|
|
1531
|
-
}) })
|
|
1532
|
-
] });
|
|
1533
|
-
}
|
|
1534
|
-
function Re({ at: n, items: l, onClose: t, label: i = "Actions", focus: c = "first" }) {
|
|
1535
|
-
const s = F(null), d = F(null), r = G(), [f, _] = E(n), o = l.filter((a) => a.offer.offered);
|
|
1536
|
-
if (ge(() => {
|
|
1537
|
-
if (!n) return;
|
|
1538
|
-
const a = s.current, h = (a == null ? void 0 : a.offsetWidth) ?? 0, p = (a == null ? void 0 : a.offsetHeight) ?? 0;
|
|
1539
|
-
_({ x: Math.max(0, Math.min(n.x, window.innerWidth - h)), y: Math.max(0, Math.min(n.y, window.innerHeight - p)) });
|
|
1540
|
-
}, [n]), Y(() => {
|
|
1541
|
-
var p, v;
|
|
1542
|
-
if (!n) return;
|
|
1543
|
-
d.current = document.activeElement;
|
|
1544
|
-
const a = Array.from(((p = s.current) == null ? void 0 : p.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
|
|
1545
|
-
(v = c === "last" ? a[a.length - 1] : a[0]) == null || v.focus();
|
|
1546
|
-
const h = (N) => {
|
|
1547
|
-
var w;
|
|
1548
|
-
(w = s.current) != null && w.contains(N.target) || t();
|
|
1549
|
-
};
|
|
1550
|
-
return document.addEventListener("mousedown", h), () => {
|
|
1551
|
-
var N, w;
|
|
1552
|
-
document.removeEventListener("mousedown", h), (w = (N = d.current) == null ? void 0 : N.focus) == null || w.call(N);
|
|
1553
|
-
};
|
|
1554
|
-
}, [n, t, c]), !n || o.length === 0) return null;
|
|
1555
|
-
const m = (a) => {
|
|
1556
|
-
var v, N;
|
|
1557
|
-
const h = Array.from(((v = s.current) == null ? void 0 : v.querySelectorAll('[role="menuitem"]')) ?? []), p = h.indexOf(document.activeElement);
|
|
1558
|
-
if (a.key === "Escape" || a.key === "Tab")
|
|
1559
|
-
a.preventDefault(), t();
|
|
1560
|
-
else if (a.key === "ArrowDown" || a.key === "ArrowUp") {
|
|
1561
|
-
a.preventDefault();
|
|
1562
|
-
const w = a.key === "ArrowDown" ? 1 : -1;
|
|
1563
|
-
(N = h[(p + w + h.length) % h.length]) == null || N.focus();
|
|
1564
|
-
}
|
|
1565
|
-
};
|
|
1566
|
-
return Me(
|
|
1567
|
-
/* @__PURE__ */ e(
|
|
1568
|
-
"div",
|
|
1569
|
-
{
|
|
1570
|
-
ref: s,
|
|
1571
|
-
className: "cms-menu",
|
|
1572
|
-
role: "menu",
|
|
1573
|
-
"aria-label": i,
|
|
1574
|
-
style: { left: (f ?? n).x, top: (f ?? n).y },
|
|
1575
|
-
onKeyDown: m,
|
|
1576
|
-
onContextMenu: (a) => a.preventDefault(),
|
|
1577
|
-
children: o.map((a) => {
|
|
1578
|
-
const h = a.offer.refusal !== void 0;
|
|
1579
|
-
return /* @__PURE__ */ u(
|
|
1580
|
-
"div",
|
|
1581
|
-
{
|
|
1582
|
-
role: "menuitem",
|
|
1583
|
-
tabIndex: -1,
|
|
1584
|
-
"aria-disabled": h || void 0,
|
|
1585
|
-
"aria-describedby": h ? `${r}-${a.id}` : void 0,
|
|
1586
|
-
title: h ? a.offer.refusal : void 0,
|
|
1587
|
-
className: A("cms-menu__item", a.danger && "is-danger", a.offer.locked && "is-locked", h && "is-refused"),
|
|
1588
|
-
onClick: () => {
|
|
1589
|
-
h || (t(), a.onSelect());
|
|
1590
|
-
},
|
|
1591
|
-
onKeyDown: (p) => {
|
|
1592
|
-
(p.key === "Enter" || p.key === " ") && !h && (p.preventDefault(), t(), a.onSelect());
|
|
1593
|
-
},
|
|
1594
|
-
children: [
|
|
1595
|
-
a.offer.locked ? /* @__PURE__ */ e(z, { name: "lock" }) : null,
|
|
1596
|
-
/* @__PURE__ */ e("span", { className: "cms-menu__label", children: a.label }),
|
|
1597
|
-
h ? /* @__PURE__ */ e("span", { id: `${r}-${a.id}`, className: "cms-menu__refusal", children: a.offer.refusal }) : null
|
|
1598
|
-
]
|
|
1599
|
-
},
|
|
1600
|
-
a.id
|
|
1601
|
-
);
|
|
1602
|
-
})
|
|
1603
|
-
}
|
|
1604
|
-
),
|
|
1605
|
-
document.body
|
|
1606
|
-
);
|
|
1607
|
-
}
|
|
1608
|
-
const De = { bare: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Set() }, $e = (n, l) => n.size === l.size && [...n].every((t) => l.has(t));
|
|
1609
|
-
function wn(n) {
|
|
1733
|
+
const $e = { bare: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Set() }, Pe = (n, l) => n.size === l.size && [...n].every((t) => l.has(t));
|
|
1734
|
+
function kn(n) {
|
|
1610
1735
|
const l = /* @__PURE__ */ new Map();
|
|
1611
1736
|
for (const t of n) l.set(t.group, [...l.get(t.group) ?? [], t]);
|
|
1612
1737
|
return [...l.values()];
|
|
1613
1738
|
}
|
|
1614
|
-
function
|
|
1739
|
+
function xn(n) {
|
|
1615
1740
|
const l = /* @__PURE__ */ new Map();
|
|
1616
1741
|
for (const t of n) t.overflow !== void 0 && t.overflow !== 0 && l.set(t.overflow, [...l.get(t.overflow) ?? [], t.id]);
|
|
1617
|
-
return [...l.entries()].sort(([t], [
|
|
1618
|
-
}
|
|
1619
|
-
function
|
|
1620
|
-
const
|
|
1621
|
-
const g =
|
|
1622
|
-
if (g === null ||
|
|
1623
|
-
const V = getComputedStyle(g),
|
|
1624
|
-
var
|
|
1625
|
-
return ((
|
|
1626
|
-
},
|
|
1627
|
-
const
|
|
1628
|
-
return
|
|
1629
|
-
},
|
|
1630
|
-
let
|
|
1631
|
-
if (
|
|
1742
|
+
return [...l.entries()].sort(([t], [d]) => t - d).map(([, t]) => t);
|
|
1743
|
+
}
|
|
1744
|
+
function ol({ label: n, actions: l, onAction: t, status: d, moreLabel: c, leading: r }) {
|
|
1745
|
+
const m = I(null), s = I(null), [h, b] = E($e), [o, u] = E(null), [a, f] = E("first"), [p, _] = E(null), [N, y] = E(null), x = kn(l), C = xn(l), S = x.flat(), F = S.filter((g) => g.overflow === 0), R = S.filter((g) => g.overflow !== 0), Q = JSON.stringify([l.map((g) => [g.id, g.label, g.icon, g.group, g.overflow ?? null]), d ?? "", r !== void 0]), G = _e(() => {
|
|
1746
|
+
const g = m.current, D = s.current;
|
|
1747
|
+
if (g === null || D === null) return;
|
|
1748
|
+
const V = getComputedStyle(g), ee = parseFloat(V.columnGap || "0") || 0, L = g.clientWidth - (parseFloat(V.paddingLeft) || 0) - (parseFloat(V.paddingRight) || 0), X = (P) => {
|
|
1749
|
+
var O;
|
|
1750
|
+
return ((O = D.querySelector(P)) == null ? void 0 : O.getBoundingClientRect().width) ?? 0;
|
|
1751
|
+
}, oe = X('[data-measure="leading"]'), ye = X('[data-measure="separator"]'), me = X('[data-measure="more"]'), he = (P, O) => X(`[data-measure="${O ? "full" : "icon"}"][data-measure-action="${CSS.escape(P)}"]`), ne = (P, O) => {
|
|
1752
|
+
const J = /* @__PURE__ */ new Set([...F.map((ae) => ae.id), ...O]), re = x.map((ae) => ae.filter((pe) => !J.has(pe.id))).filter((ae) => ae.length > 0), fe = re.flat(), He = fe.length + (re.length - 1) + (J.size > 0 ? 1 : 0) + (oe > 0 ? 1 : 0);
|
|
1753
|
+
return oe + fe.reduce((ae, pe) => ae + he(pe.id, !P.has(pe.id)), 0) + ye * Math.max(0, re.length - 1) + (J.size > 0 ? me : 0) + ee * Math.max(0, He - 1);
|
|
1754
|
+
}, v = R.filter((P) => !C.some((O) => O.includes(P.id))).map((P) => P.id), k = [...C, ...[...v].reverse().map((P) => [P])];
|
|
1755
|
+
let $ = null;
|
|
1756
|
+
if (ne(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= L) $ = $e;
|
|
1632
1757
|
else {
|
|
1633
|
-
const
|
|
1634
|
-
for (const
|
|
1635
|
-
for (const
|
|
1636
|
-
if (
|
|
1637
|
-
|
|
1758
|
+
const P = /* @__PURE__ */ new Set();
|
|
1759
|
+
for (const O of k) {
|
|
1760
|
+
for (const J of O) P.add(J);
|
|
1761
|
+
if (ne(P, /* @__PURE__ */ new Set()) <= L) {
|
|
1762
|
+
$ = { bare: P, hidden: /* @__PURE__ */ new Set() };
|
|
1638
1763
|
break;
|
|
1639
1764
|
}
|
|
1640
1765
|
}
|
|
1641
1766
|
}
|
|
1642
|
-
if (
|
|
1643
|
-
const
|
|
1644
|
-
for (const
|
|
1645
|
-
for (const
|
|
1646
|
-
if (
|
|
1767
|
+
if ($ === null) {
|
|
1768
|
+
const P = new Set(R.map((J) => J.id)), O = /* @__PURE__ */ new Set();
|
|
1769
|
+
for (const J of C) {
|
|
1770
|
+
for (const re of J) R.some((fe) => fe.id === re) && O.add(re);
|
|
1771
|
+
if (O.size >= 2 && ne(P, O) <= L) break;
|
|
1647
1772
|
}
|
|
1648
|
-
if (
|
|
1649
|
-
for (const
|
|
1650
|
-
if (
|
|
1773
|
+
if (ne(P, O) > L) {
|
|
1774
|
+
for (const J of [...v].reverse())
|
|
1775
|
+
if (O.add(J), ne(P, O) <= L) break;
|
|
1651
1776
|
}
|
|
1652
|
-
|
|
1777
|
+
$ = { bare: P, hidden: O };
|
|
1653
1778
|
}
|
|
1654
|
-
const
|
|
1655
|
-
|
|
1656
|
-
}, [
|
|
1657
|
-
|
|
1658
|
-
const g =
|
|
1779
|
+
const K = $;
|
|
1780
|
+
b((P) => Pe(P.bare, K.bare) && Pe(P.hidden, K.hidden) ? P : K);
|
|
1781
|
+
}, [Q]);
|
|
1782
|
+
Ne(G, [G]), q(() => {
|
|
1783
|
+
const g = m.current;
|
|
1659
1784
|
if (g === null || typeof ResizeObserver > "u") return;
|
|
1660
|
-
const
|
|
1661
|
-
return
|
|
1662
|
-
}, [
|
|
1663
|
-
const
|
|
1664
|
-
...
|
|
1665
|
-
...
|
|
1785
|
+
const D = new ResizeObserver(() => G());
|
|
1786
|
+
return D.observe(g), () => D.disconnect();
|
|
1787
|
+
}, [G]);
|
|
1788
|
+
const w = /* @__PURE__ */ new Set([...F.map((g) => g.id), ...h.hidden]), Z = x.map((g) => g.filter((D) => !w.has(D.id))).filter((g) => g.length > 0).flat(), z = [
|
|
1789
|
+
...F,
|
|
1790
|
+
...C.flat().map((g) => S.find((D) => D.id === g)).filter((g) => g !== void 0 && h.hidden.has(g.id)),
|
|
1666
1791
|
// The pinned that a row too narrow for them sent behind ..., in the row's order.
|
|
1667
|
-
...
|
|
1668
|
-
],
|
|
1669
|
-
var
|
|
1670
|
-
const
|
|
1792
|
+
...R.filter((g) => h.hidden.has(g.id) && !C.some((D) => D.includes(g.id)))
|
|
1793
|
+
], H = new Set(R.filter((g) => !C.some((D) => D.includes(g.id))).map((g) => g.id)), W = [...Z.map((g) => g.id), ...z.length > 0 ? ["more"] : []], j = p !== null && W.includes(p) ? p : W[0] ?? null, ie = (g) => {
|
|
1794
|
+
var L, X;
|
|
1795
|
+
const D = W.indexOf(j ?? "");
|
|
1671
1796
|
let V = null;
|
|
1672
|
-
if (g.key === "ArrowRight" ? V = Math.min(
|
|
1797
|
+
if (g.key === "ArrowRight" ? V = Math.min(W.length - 1, D + 1) : g.key === "ArrowLeft" ? V = Math.max(0, D - 1) : g.key === "Home" ? V = 0 : g.key === "End" ? V = W.length - 1 : g.key === "Escape" && y(j), V === null) return;
|
|
1673
1798
|
g.preventDefault();
|
|
1674
|
-
const
|
|
1675
|
-
|
|
1676
|
-
},
|
|
1799
|
+
const ee = W[V] ?? null;
|
|
1800
|
+
_(ee), (X = (L = m.current) == null ? void 0 : L.querySelector(`[data-stop="${CSS.escape(ee ?? "")}"]`)) == null || X.focus();
|
|
1801
|
+
}, ue = z.map((g) => ({
|
|
1677
1802
|
id: g.id,
|
|
1678
|
-
label: /* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */ e(
|
|
1803
|
+
label: /* @__PURE__ */ i(M, { children: [
|
|
1804
|
+
/* @__PURE__ */ e(be, { name: g.icon }),
|
|
1680
1805
|
g.label
|
|
1681
1806
|
] }),
|
|
1682
1807
|
offer: g.disabled ? { offered: !0, locked: !1, refusal: g.reason ?? "" } : { offered: !0, locked: !1 },
|
|
@@ -1685,43 +1810,43 @@ function cl({ label: n, actions: l, onAction: t, status: i, moreLabel: c, leadin
|
|
|
1685
1810
|
!g.disabled && !g.busy && t(g.id);
|
|
1686
1811
|
}
|
|
1687
1812
|
}));
|
|
1688
|
-
return /* @__PURE__ */
|
|
1813
|
+
return /* @__PURE__ */ i(
|
|
1689
1814
|
"div",
|
|
1690
1815
|
{
|
|
1691
|
-
ref:
|
|
1816
|
+
ref: m,
|
|
1692
1817
|
role: "toolbar",
|
|
1693
1818
|
"aria-label": n,
|
|
1694
|
-
className:
|
|
1819
|
+
className: T(
|
|
1695
1820
|
"cms-pane-toolbar",
|
|
1696
|
-
|
|
1697
|
-
|
|
1821
|
+
R.length > 0 && h.bare.size >= R.length && "cms-pane-toolbar--labels-hidden",
|
|
1822
|
+
h.bare.size > 0 && h.bare.size < R.length && "cms-pane-toolbar--labels-partly-hidden"
|
|
1698
1823
|
),
|
|
1699
1824
|
onKeyDown: ie,
|
|
1700
1825
|
children: [
|
|
1701
|
-
|
|
1702
|
-
x.map((g,
|
|
1703
|
-
const V = g.filter((
|
|
1704
|
-
return /* @__PURE__ */
|
|
1705
|
-
V.length > 0 &&
|
|
1706
|
-
/* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: V.length === 0, children: g.map((
|
|
1707
|
-
|
|
1826
|
+
r !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: r }) : null,
|
|
1827
|
+
x.map((g, D) => {
|
|
1828
|
+
const V = g.filter((L) => !w.has(L.id)), ee = x.slice(0, D).some((L) => L.some((X) => !w.has(X.id)));
|
|
1829
|
+
return /* @__PURE__ */ i("div", { className: "cms-pane-toolbar__group-wrap", children: [
|
|
1830
|
+
V.length > 0 && ee ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
|
|
1831
|
+
/* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: V.length === 0, children: g.map((L) => /* @__PURE__ */ e(
|
|
1832
|
+
Mn,
|
|
1708
1833
|
{
|
|
1709
|
-
action:
|
|
1710
|
-
labels: !
|
|
1711
|
-
overflowed:
|
|
1712
|
-
pinned:
|
|
1713
|
-
tabbable:
|
|
1714
|
-
tipOff: N ===
|
|
1715
|
-
onChoose: () => t(
|
|
1834
|
+
action: L,
|
|
1835
|
+
labels: !h.bare.has(L.id),
|
|
1836
|
+
overflowed: w.has(L.id),
|
|
1837
|
+
pinned: H.has(L.id),
|
|
1838
|
+
tabbable: j === L.id,
|
|
1839
|
+
tipOff: N === L.id,
|
|
1840
|
+
onChoose: () => t(L.id),
|
|
1716
1841
|
onFocus: () => {
|
|
1717
|
-
|
|
1842
|
+
_(L.id), y(null);
|
|
1718
1843
|
}
|
|
1719
1844
|
},
|
|
1720
|
-
|
|
1845
|
+
L.id
|
|
1721
1846
|
)) })
|
|
1722
|
-
] },
|
|
1847
|
+
] }, D);
|
|
1723
1848
|
}),
|
|
1724
|
-
|
|
1849
|
+
z.length > 0 ? /* @__PURE__ */ e(
|
|
1725
1850
|
"button",
|
|
1726
1851
|
{
|
|
1727
1852
|
type: "button",
|
|
@@ -1731,96 +1856,96 @@ function cl({ label: n, actions: l, onAction: t, status: i, moreLabel: c, leadin
|
|
|
1731
1856
|
title: c,
|
|
1732
1857
|
"aria-haspopup": "menu",
|
|
1733
1858
|
"aria-expanded": o !== null,
|
|
1734
|
-
tabIndex:
|
|
1735
|
-
onFocus: () =>
|
|
1859
|
+
tabIndex: j === "more" ? 0 : -1,
|
|
1860
|
+
onFocus: () => _("more"),
|
|
1736
1861
|
onClick: (g) => {
|
|
1737
|
-
const
|
|
1738
|
-
|
|
1862
|
+
const D = g.currentTarget.getBoundingClientRect();
|
|
1863
|
+
f("first"), u(o === null ? { x: D.left, y: D.bottom } : null);
|
|
1739
1864
|
},
|
|
1740
1865
|
onKeyDown: (g) => {
|
|
1741
1866
|
if (g.key === "ArrowDown" || g.key === "ArrowUp") {
|
|
1742
1867
|
g.preventDefault(), g.stopPropagation();
|
|
1743
|
-
const
|
|
1744
|
-
|
|
1868
|
+
const D = g.currentTarget.getBoundingClientRect();
|
|
1869
|
+
f(g.key === "ArrowUp" ? "last" : "first"), u({ x: D.left, y: D.bottom });
|
|
1745
1870
|
}
|
|
1746
1871
|
},
|
|
1747
|
-
children: /* @__PURE__ */ e(
|
|
1872
|
+
children: /* @__PURE__ */ e(A, { name: "more" })
|
|
1748
1873
|
}
|
|
1749
1874
|
) : null,
|
|
1750
|
-
|
|
1751
|
-
/* @__PURE__ */ e(
|
|
1752
|
-
/* @__PURE__ */
|
|
1753
|
-
|
|
1875
|
+
d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: d, children: d }) : null,
|
|
1876
|
+
/* @__PURE__ */ e(ve, { at: o, items: ue, onClose: () => u(null), label: c, focus: a }),
|
|
1877
|
+
/* @__PURE__ */ i("div", { ref: s, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
|
|
1878
|
+
r !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: r }) : null,
|
|
1754
1879
|
/* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
|
|
1755
|
-
/* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(
|
|
1756
|
-
|
|
1757
|
-
/* @__PURE__ */
|
|
1758
|
-
/* @__PURE__ */ e(
|
|
1880
|
+
/* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(A, { name: "more" }) }),
|
|
1881
|
+
S.map((g) => /* @__PURE__ */ i("span", { children: [
|
|
1882
|
+
/* @__PURE__ */ i("span", { "data-measure": "full", "data-measure-action": g.id, className: "cms-pane-toolbar__action", children: [
|
|
1883
|
+
/* @__PURE__ */ e(be, { name: g.icon }),
|
|
1759
1884
|
/* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: g.label })
|
|
1760
1885
|
] }),
|
|
1761
|
-
/* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": g.id, className:
|
|
1886
|
+
/* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": g.id, className: T("cms-pane-toolbar__action", ce(g.icon) !== null && "cms-pane-toolbar__action--bare"), children: ce(g.icon) !== null ? /* @__PURE__ */ e(be, { name: g.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: g.label }) })
|
|
1762
1887
|
] }, g.id))
|
|
1763
1888
|
] })
|
|
1764
1889
|
]
|
|
1765
1890
|
}
|
|
1766
1891
|
);
|
|
1767
1892
|
}
|
|
1768
|
-
function
|
|
1769
|
-
const [
|
|
1770
|
-
|
|
1893
|
+
function Mn({ action: n, labels: l, overflowed: t, pinned: d, tabbable: c, tipOff: r, onChoose: m, onFocus: s }) {
|
|
1894
|
+
const [h, b] = E(!1);
|
|
1895
|
+
q(() => {
|
|
1771
1896
|
if (!n.busy) {
|
|
1772
|
-
|
|
1897
|
+
b(!1);
|
|
1773
1898
|
return;
|
|
1774
1899
|
}
|
|
1775
|
-
const
|
|
1776
|
-
return () => clearTimeout(
|
|
1900
|
+
const y = setTimeout(() => b(!0), ke);
|
|
1901
|
+
return () => clearTimeout(y);
|
|
1777
1902
|
}, [n.busy]);
|
|
1778
|
-
const o =
|
|
1779
|
-
return /* @__PURE__ */
|
|
1903
|
+
const o = ce(n.icon) === null, u = l || o, a = n.disabled && n.reason ? n.reason : null, f = a ?? (u ? null : n.label), p = Y(), [_, N] = E(!1);
|
|
1904
|
+
return /* @__PURE__ */ i(
|
|
1780
1905
|
"button",
|
|
1781
1906
|
{
|
|
1782
1907
|
type: "button",
|
|
1783
|
-
className:
|
|
1908
|
+
className: T("cms-pane-toolbar__action", !u && "cms-pane-toolbar__action--bare", o && "cms-pane-toolbar__action--text", n.danger && "is-danger"),
|
|
1784
1909
|
"data-action": n.id,
|
|
1785
1910
|
"data-stop": n.id,
|
|
1786
1911
|
...t ? { "data-overflowed": "" } : {},
|
|
1787
|
-
...
|
|
1912
|
+
...d ? { "data-pinned": "" } : {},
|
|
1788
1913
|
hidden: t,
|
|
1789
1914
|
"aria-label": n.label,
|
|
1790
1915
|
"aria-disabled": n.disabled || void 0,
|
|
1791
1916
|
"aria-busy": n.busy || void 0,
|
|
1792
1917
|
...a === null ? {} : { "aria-describedby": p },
|
|
1793
|
-
...
|
|
1918
|
+
..._ && a !== null ? { "data-reason-shown": "" } : {},
|
|
1794
1919
|
tabIndex: c ? 0 : -1,
|
|
1795
|
-
onFocus:
|
|
1920
|
+
onFocus: s,
|
|
1796
1921
|
onBlur: () => N(!1),
|
|
1797
|
-
onKeyDown: (
|
|
1798
|
-
|
|
1922
|
+
onKeyDown: (y) => {
|
|
1923
|
+
y.key === "Escape" && N(!1);
|
|
1799
1924
|
},
|
|
1800
1925
|
onClick: () => {
|
|
1801
|
-
a !== null ? N(!0) : !n.disabled && !n.busy &&
|
|
1926
|
+
a !== null ? N(!0) : !n.disabled && !n.busy && m();
|
|
1802
1927
|
},
|
|
1803
1928
|
children: [
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
a !== null ||
|
|
1929
|
+
h ? /* @__PURE__ */ e(U, { name: "spinner" }) : /* @__PURE__ */ e(be, { name: n.icon }),
|
|
1930
|
+
u ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
|
|
1931
|
+
a !== null || f !== null && !r ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: p, children: f }) : null
|
|
1807
1932
|
]
|
|
1808
1933
|
}
|
|
1809
1934
|
);
|
|
1810
1935
|
}
|
|
1811
|
-
function
|
|
1812
|
-
const l =
|
|
1813
|
-
return l === null ? null : /* @__PURE__ */ e(
|
|
1936
|
+
function be({ name: n }) {
|
|
1937
|
+
const l = ce(n);
|
|
1938
|
+
return l === null ? null : /* @__PURE__ */ e(A, { name: l, size: 18 });
|
|
1814
1939
|
}
|
|
1815
|
-
function
|
|
1816
|
-
const [o,
|
|
1817
|
-
|
|
1818
|
-
}, p = (
|
|
1819
|
-
var
|
|
1820
|
-
|
|
1940
|
+
function dl({ title: n, body: l = null, time: t = null, unread: d, unreadLabel: c, expandLabel: r, collapseLabel: m, action: s = null, onRead: h, leading: b }) {
|
|
1941
|
+
const [o, u] = E(!1), a = Y(), f = () => {
|
|
1942
|
+
d && h();
|
|
1943
|
+
}, p = (s == null ? void 0 : s.presentation) === "row" && s.onAction !== void 0, _ = (s == null ? void 0 : s.presentation) === "button" && s.onAction !== void 0 ? s : null, N = () => {
|
|
1944
|
+
var y;
|
|
1945
|
+
f(), p && ((y = s.onAction) == null || y.call(s));
|
|
1821
1946
|
};
|
|
1822
|
-
return /* @__PURE__ */
|
|
1823
|
-
/* @__PURE__ */
|
|
1947
|
+
return /* @__PURE__ */ i("article", { className: T("cms-notification", d && "is-unread", o && "is-expanded", p && "is-row-action"), "data-state": d ? "unread" : "read", children: [
|
|
1948
|
+
/* @__PURE__ */ i(
|
|
1824
1949
|
"div",
|
|
1825
1950
|
{
|
|
1826
1951
|
className: "cms-notification__row",
|
|
@@ -1828,15 +1953,15 @@ function il({ title: n, body: l = null, time: t = null, unread: i, unreadLabel:
|
|
|
1828
1953
|
tabIndex: 0,
|
|
1829
1954
|
"aria-describedby": l === null ? void 0 : a,
|
|
1830
1955
|
onClick: N,
|
|
1831
|
-
onKeyDown: (
|
|
1832
|
-
|
|
1956
|
+
onKeyDown: (y) => {
|
|
1957
|
+
y.target !== y.currentTarget || y.key !== "Enter" && y.key !== " " || (y.preventDefault(), N());
|
|
1833
1958
|
},
|
|
1834
1959
|
children: [
|
|
1835
|
-
|
|
1836
|
-
/* @__PURE__ */
|
|
1837
|
-
/* @__PURE__ */
|
|
1838
|
-
/* @__PURE__ */
|
|
1839
|
-
|
|
1960
|
+
b != null ? /* @__PURE__ */ e("span", { className: "cms-notification__leading", children: b }) : null,
|
|
1961
|
+
/* @__PURE__ */ i("span", { className: "cms-notification__text", children: [
|
|
1962
|
+
/* @__PURE__ */ i("span", { className: "cms-notification__head", children: [
|
|
1963
|
+
/* @__PURE__ */ i("span", { className: "cms-notification__title", children: [
|
|
1964
|
+
d ? /* @__PURE__ */ i("span", { className: "cms-visually-hidden", children: [
|
|
1840
1965
|
c,
|
|
1841
1966
|
" "
|
|
1842
1967
|
] }) : null,
|
|
@@ -1846,7 +1971,7 @@ function il({ title: n, body: l = null, time: t = null, unread: i, unreadLabel:
|
|
|
1846
1971
|
] }),
|
|
1847
1972
|
l !== null && l !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id: a, children: l }) : null
|
|
1848
1973
|
] }),
|
|
1849
|
-
|
|
1974
|
+
d ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
|
|
1850
1975
|
]
|
|
1851
1976
|
}
|
|
1852
1977
|
),
|
|
@@ -1857,33 +1982,33 @@ function il({ title: n, body: l = null, time: t = null, unread: i, unreadLabel:
|
|
|
1857
1982
|
className: "cms-notification__chevron",
|
|
1858
1983
|
"aria-expanded": o,
|
|
1859
1984
|
"aria-controls": a,
|
|
1860
|
-
"aria-label": o ?
|
|
1861
|
-
title: o ?
|
|
1985
|
+
"aria-label": o ? m : r,
|
|
1986
|
+
title: o ? m : r,
|
|
1862
1987
|
onClick: () => {
|
|
1863
|
-
o ||
|
|
1988
|
+
o || f(), u((y) => !y);
|
|
1864
1989
|
},
|
|
1865
|
-
children: /* @__PURE__ */ e(
|
|
1990
|
+
children: /* @__PURE__ */ e(A, { name: "chevron-down", size: 18 })
|
|
1866
1991
|
}
|
|
1867
1992
|
) : null,
|
|
1868
|
-
|
|
1993
|
+
_ !== null ? /* @__PURE__ */ e(
|
|
1869
1994
|
"button",
|
|
1870
1995
|
{
|
|
1871
1996
|
type: "button",
|
|
1872
1997
|
className: "cms-button cms-notification__action",
|
|
1873
1998
|
onClick: () => {
|
|
1874
|
-
var
|
|
1875
|
-
|
|
1999
|
+
var y;
|
|
2000
|
+
f(), (y = _.onAction) == null || y.call(_);
|
|
1876
2001
|
},
|
|
1877
|
-
children:
|
|
2002
|
+
children: _.label
|
|
1878
2003
|
}
|
|
1879
2004
|
) : null
|
|
1880
2005
|
] });
|
|
1881
2006
|
}
|
|
1882
|
-
function
|
|
2007
|
+
function Cn(n) {
|
|
1883
2008
|
return n === "allowed" || n === "elevate" || n === "denied";
|
|
1884
2009
|
}
|
|
1885
|
-
function
|
|
1886
|
-
if (!
|
|
2010
|
+
function ul(n, l) {
|
|
2011
|
+
if (!Cn(n))
|
|
1887
2012
|
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 };
|
|
1888
2013
|
switch (n) {
|
|
1889
2014
|
case "allowed":
|
|
@@ -1894,217 +2019,219 @@ function ol(n, l) {
|
|
|
1894
2019
|
return l.showRefused ? { offered: !0, locked: !1, refusal: l.refusal ?? "not allowed" } : { offered: !1, locked: !1 };
|
|
1895
2020
|
}
|
|
1896
2021
|
}
|
|
1897
|
-
function
|
|
2022
|
+
function Sn(n, l) {
|
|
1898
2023
|
if (!n) return;
|
|
1899
2024
|
if (typeof n.get == "function") return n.get(l) ?? void 0;
|
|
1900
|
-
const t = n,
|
|
1901
|
-
return
|
|
2025
|
+
const t = n, d = Object.keys(t).find((c) => c.toLowerCase() === l.toLowerCase());
|
|
2026
|
+
return d === void 0 ? void 0 : t[d];
|
|
1902
2027
|
}
|
|
1903
|
-
function
|
|
2028
|
+
function En(n) {
|
|
1904
2029
|
if (n && typeof n == "object") {
|
|
1905
2030
|
const l = n;
|
|
1906
2031
|
if (typeof l.detail == "string" && l.detail !== "") return l.detail;
|
|
1907
2032
|
if (typeof l.title == "string" && l.title !== "") return l.title;
|
|
1908
2033
|
}
|
|
1909
2034
|
}
|
|
1910
|
-
function
|
|
2035
|
+
function ml(n, l, t, d) {
|
|
1911
2036
|
if (n !== 403) return { kind: "none" };
|
|
1912
|
-
const c =
|
|
1913
|
-
return
|
|
1914
|
-
}
|
|
1915
|
-
const
|
|
1916
|
-
function
|
|
1917
|
-
window.dispatchEvent(new Event(
|
|
1918
|
-
}
|
|
1919
|
-
function
|
|
1920
|
-
const [l, t] = E(void 0), [
|
|
1921
|
-
|
|
1922
|
-
const
|
|
1923
|
-
const o = ++
|
|
1924
|
-
|
|
1925
|
-
(
|
|
1926
|
-
o ===
|
|
2037
|
+
const c = En(t);
|
|
2038
|
+
return Sn(l, "X-Elevation-Required") !== void 0 ? d.elevates ? { kind: "elevation-required", message: c ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: c ?? "The server refused this." };
|
|
2039
|
+
}
|
|
2040
|
+
const Me = "coolms-kit:reread";
|
|
2041
|
+
function hl() {
|
|
2042
|
+
window.dispatchEvent(new Event(Me));
|
|
2043
|
+
}
|
|
2044
|
+
function fl(n) {
|
|
2045
|
+
const [l, t] = E(void 0), [d, c] = E(void 0), [r, m] = E(!0), s = I(n);
|
|
2046
|
+
s.current = n;
|
|
2047
|
+
const h = I(0), b = _e(() => {
|
|
2048
|
+
const o = ++h.current;
|
|
2049
|
+
m(!0), s.current().then(
|
|
2050
|
+
(u) => {
|
|
2051
|
+
o === h.current && (t(u), c(void 0), m(!1));
|
|
1927
2052
|
},
|
|
1928
|
-
(
|
|
1929
|
-
o ===
|
|
2053
|
+
(u) => {
|
|
2054
|
+
o === h.current && (c(u), m(!1));
|
|
1930
2055
|
}
|
|
1931
2056
|
);
|
|
1932
2057
|
}, []);
|
|
1933
|
-
return
|
|
1934
|
-
|
|
1935
|
-
const o = () =>
|
|
1936
|
-
return window.addEventListener("focus", o), window.addEventListener(
|
|
1937
|
-
window.removeEventListener("focus", o), window.removeEventListener(
|
|
2058
|
+
return q(() => {
|
|
2059
|
+
b();
|
|
2060
|
+
const o = () => b();
|
|
2061
|
+
return window.addEventListener("focus", o), window.addEventListener(Me, o), () => {
|
|
2062
|
+
window.removeEventListener("focus", o), window.removeEventListener(Me, o);
|
|
1938
2063
|
};
|
|
1939
|
-
}, [
|
|
2064
|
+
}, [b]), { value: l, error: d, loading: r, reread: b };
|
|
1940
2065
|
}
|
|
1941
|
-
function
|
|
2066
|
+
function pl(n) {
|
|
1942
2067
|
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 };
|
|
1943
2068
|
}
|
|
1944
|
-
const
|
|
1945
|
-
function
|
|
1946
|
-
const t = n.split(".").map((c) => Number.parseInt(c, 10) || 0),
|
|
1947
|
-
for (let c = 0; c < Math.max(t.length,
|
|
1948
|
-
const
|
|
1949
|
-
if (
|
|
2069
|
+
const An = "/errors/client-update-required";
|
|
2070
|
+
function Tn(n, l) {
|
|
2071
|
+
const t = n.split(".").map((c) => Number.parseInt(c, 10) || 0), d = l.split(".").map((c) => Number.parseInt(c, 10) || 0);
|
|
2072
|
+
for (let c = 0; c < Math.max(t.length, d.length); c++) {
|
|
2073
|
+
const r = t[c] ?? 0, m = d[c] ?? 0;
|
|
2074
|
+
if (r !== m) return r < m;
|
|
1950
2075
|
}
|
|
1951
2076
|
return !1;
|
|
1952
2077
|
}
|
|
1953
|
-
function
|
|
1954
|
-
return n.problemType !== void 0 && n.problemType.endsWith(
|
|
2078
|
+
function bl(n) {
|
|
2079
|
+
return n.problemType !== void 0 && n.problemType.endsWith(An) ? !0 : n.minimumVersion !== void 0 && Tn(n.version, n.minimumVersion);
|
|
1955
2080
|
}
|
|
1956
|
-
const Ie = 4, Ln = 48,
|
|
1957
|
-
function
|
|
1958
|
-
const [t,
|
|
1959
|
-
return
|
|
2081
|
+
const Ie = 4, Ln = 48, Dn = 800, $n = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "]);
|
|
2082
|
+
function Pn(n, l) {
|
|
2083
|
+
const [t, d] = E(!1);
|
|
2084
|
+
return q(() => {
|
|
1960
2085
|
const c = n.current;
|
|
1961
2086
|
if (c === null || !l) {
|
|
1962
|
-
|
|
2087
|
+
d(!1);
|
|
1963
2088
|
return;
|
|
1964
2089
|
}
|
|
1965
|
-
const
|
|
1966
|
-
let
|
|
1967
|
-
const
|
|
1968
|
-
|
|
1969
|
-
},
|
|
1970
|
-
const
|
|
1971
|
-
!(
|
|
2090
|
+
const r = /* @__PURE__ */ new WeakMap();
|
|
2091
|
+
let m = Number.NEGATIVE_INFINITY, s = null;
|
|
2092
|
+
const h = (a) => {
|
|
2093
|
+
m = performance.now(), s = a.target;
|
|
2094
|
+
}, b = (a) => {
|
|
2095
|
+
const f = a.target;
|
|
2096
|
+
!(f instanceof HTMLElement && (f.isContentEditable || f.closest("input, textarea, select") !== null)) && $n.has(a.key) && h(a);
|
|
1972
2097
|
}, o = (a) => {
|
|
1973
|
-
const
|
|
1974
|
-
if (!(
|
|
1975
|
-
const p =
|
|
1976
|
-
if (
|
|
1977
|
-
|
|
2098
|
+
const f = a.target;
|
|
2099
|
+
if (!(f instanceof HTMLElement)) return;
|
|
2100
|
+
const p = f.scrollTop, _ = r.get(f) ?? 0;
|
|
2101
|
+
if (r.set(f, p), p <= 0) {
|
|
2102
|
+
d(!1);
|
|
1978
2103
|
return;
|
|
1979
2104
|
}
|
|
1980
|
-
performance.now() -
|
|
1981
|
-
},
|
|
1982
|
-
for (const [a,
|
|
2105
|
+
performance.now() - m > Dn || !(s === c || s === document.body || s instanceof Node && f.contains(s)) || (p < _ - Ie ? d(!1) : p > _ + Ie && p > Ln && d(!0));
|
|
2106
|
+
}, u = [["wheel", h], ["touchmove", h], ["pointerdown", h], ["keydown", b]];
|
|
2107
|
+
for (const [a, f] of u) c.addEventListener(a, f, { capture: !0, passive: !0 });
|
|
1983
2108
|
return c.addEventListener("scroll", o, { capture: !0, passive: !0 }), () => {
|
|
1984
|
-
for (const [a,
|
|
2109
|
+
for (const [a, f] of u) c.removeEventListener(a, f, { capture: !0 });
|
|
1985
2110
|
c.removeEventListener("scroll", o, { capture: !0 });
|
|
1986
2111
|
};
|
|
1987
|
-
}, [n, l]), [t,
|
|
2112
|
+
}, [n, l]), [t, d];
|
|
1988
2113
|
}
|
|
1989
|
-
function
|
|
1990
|
-
const a =
|
|
1991
|
-
p || (
|
|
1992
|
-
}),
|
|
1993
|
-
return /* @__PURE__ */
|
|
2114
|
+
function _l({ title: n, back: l, navigation: t, search: d, searching: c, globals: r, filters: m, primary: s, onRefresh: h, pullText: b, barHidden: o, children: u }) {
|
|
2115
|
+
const a = I(null), f = I(null), [p, _] = E(!1), [N, y] = E(null), C = hn(f, h === void 0 ? null : () => {
|
|
2116
|
+
p || (_(!0), h().finally(() => _(!1)));
|
|
2117
|
+
}), S = h === void 0 ? null : { distance: C, refreshing: p, text: b ?? null }, F = c !== void 0 || C > 0 || p, [R, Q] = Pn(a, o === void 0 && !F), G = !F && (o ?? R);
|
|
2118
|
+
return /* @__PURE__ */ i(
|
|
1994
2119
|
"div",
|
|
1995
2120
|
{
|
|
1996
2121
|
ref: a,
|
|
1997
|
-
className:
|
|
1998
|
-
"data-bar-hidden":
|
|
1999
|
-
onFocus: (
|
|
2000
|
-
|
|
2122
|
+
className: T("cms-screen", s !== void 0 && "cms-screen--with-primary"),
|
|
2123
|
+
"data-bar-hidden": G ? "" : void 0,
|
|
2124
|
+
onFocus: (w) => {
|
|
2125
|
+
G && w.target instanceof Element && w.target.closest(".cms-screen__bar, .cms-screen__filters") !== null && Q(!1);
|
|
2001
2126
|
},
|
|
2002
2127
|
children: [
|
|
2003
|
-
c !== void 0 ? /* @__PURE__ */
|
|
2004
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": c.closeLabel, title: c.closeLabel, onClick: c.onClose, children: /* @__PURE__ */ e(
|
|
2128
|
+
c !== void 0 ? /* @__PURE__ */ i("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
|
|
2129
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": c.closeLabel, title: c.closeLabel, onClick: c.onClose, children: /* @__PURE__ */ e(A, { name: "chevron-left" }) }),
|
|
2005
2130
|
/* @__PURE__ */ e("div", { className: "cms-screen__search", children: c.field })
|
|
2006
|
-
] }) : /* @__PURE__ */
|
|
2007
|
-
/* @__PURE__ */ e("div", { className: "cms-screen__leading", children: l !== void 0 ? l.href !== void 0 ? /* @__PURE__ */
|
|
2008
|
-
/* @__PURE__ */ e(
|
|
2131
|
+
] }) : /* @__PURE__ */ i("header", { className: "cms-screen__bar", children: [
|
|
2132
|
+
/* @__PURE__ */ e("div", { className: "cms-screen__leading", children: l !== void 0 ? l.href !== void 0 ? /* @__PURE__ */ i("a", { className: "cms-screen__back", href: l.href, onClick: l.onBack, children: [
|
|
2133
|
+
/* @__PURE__ */ e(A, { name: "chevron-left" }),
|
|
2009
2134
|
/* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: l.label })
|
|
2010
|
-
] }) : /* @__PURE__ */
|
|
2011
|
-
/* @__PURE__ */ e(
|
|
2135
|
+
] }) : /* @__PURE__ */ i("button", { type: "button", className: "cms-screen__back", onClick: l.onBack, children: [
|
|
2136
|
+
/* @__PURE__ */ e(A, { name: "chevron-left" }),
|
|
2012
2137
|
/* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: l.label })
|
|
2013
2138
|
] }) : t }),
|
|
2014
2139
|
/* @__PURE__ */ e("h1", { className: "cms-screen__title", title: n, children: n }),
|
|
2015
|
-
/* @__PURE__ */
|
|
2016
|
-
|
|
2017
|
-
|
|
2140
|
+
/* @__PURE__ */ i("div", { className: "cms-screen__trailing", children: [
|
|
2141
|
+
d !== void 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": d.label, title: d.label, onClick: d.onOpen, children: /* @__PURE__ */ e(A, { name: "search" }) }) : null,
|
|
2142
|
+
r
|
|
2018
2143
|
] })
|
|
2019
2144
|
] }),
|
|
2020
|
-
|
|
2021
|
-
/* @__PURE__ */ e("div", { ref:
|
|
2022
|
-
|
|
2145
|
+
m !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-screen__filters", children: /* @__PURE__ */ e(vn, { label: m.label, options: m.options, value: m.selected, onChange: m.onSelect }) }) : null,
|
|
2146
|
+
/* @__PURE__ */ e("div", { ref: f, className: "cms-screen__content", "data-pulling": C > 0 ? "" : void 0, "data-refreshing": p ? "" : void 0, children: /* @__PURE__ */ e(Re.Provider, { value: S, children: u }) }),
|
|
2147
|
+
s !== void 0 ? /* @__PURE__ */ e(
|
|
2023
2148
|
"button",
|
|
2024
2149
|
{
|
|
2025
2150
|
type: "button",
|
|
2026
2151
|
className: "cms-button cms-button--primary cms-screen__primary",
|
|
2027
|
-
"aria-label":
|
|
2028
|
-
title:
|
|
2029
|
-
..."menu" in
|
|
2030
|
-
onClick: (
|
|
2031
|
-
if ("menu" in
|
|
2032
|
-
const
|
|
2033
|
-
|
|
2152
|
+
"aria-label": s.label,
|
|
2153
|
+
title: s.label,
|
|
2154
|
+
..."menu" in s ? { "aria-haspopup": "menu", "aria-expanded": N !== null } : {},
|
|
2155
|
+
onClick: (w) => {
|
|
2156
|
+
if ("menu" in s) {
|
|
2157
|
+
const B = w.currentTarget.getBoundingClientRect();
|
|
2158
|
+
y(N === null ? { x: B.left, y: B.top } : null);
|
|
2034
2159
|
} else
|
|
2035
|
-
|
|
2160
|
+
s.onPress();
|
|
2036
2161
|
},
|
|
2037
|
-
children: /* @__PURE__ */ e(
|
|
2162
|
+
children: /* @__PURE__ */ e(A, { name: s.icon, size: 24 })
|
|
2038
2163
|
}
|
|
2039
2164
|
) : null,
|
|
2040
|
-
|
|
2165
|
+
s !== void 0 && "menu" in s ? /* @__PURE__ */ e(ve, { at: N, items: s.menu, onClose: () => y(null), label: s.label }) : null
|
|
2041
2166
|
]
|
|
2042
2167
|
}
|
|
2043
2168
|
);
|
|
2044
2169
|
}
|
|
2045
2170
|
export {
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2171
|
+
Jn as AppShell,
|
|
2172
|
+
ge as Avatar,
|
|
2173
|
+
Te as BOOTSTRAP_ICONS,
|
|
2174
|
+
_n as Badge,
|
|
2175
|
+
te as Button,
|
|
2176
|
+
Ae as CALL_LABELS,
|
|
2177
|
+
An as CLIENT_UPDATE_REQUIRED,
|
|
2178
|
+
rl as CallBar,
|
|
2179
|
+
sl as CallPanel,
|
|
2180
|
+
ll as ChatBubble,
|
|
2181
|
+
tl as Composer,
|
|
2182
|
+
Un as ConfirmDialog,
|
|
2183
|
+
ve as ContextMenu,
|
|
2059
2184
|
Ye as EmptyState,
|
|
2060
2185
|
Ge as ErrorBanner,
|
|
2061
|
-
|
|
2186
|
+
jn as FilePicker,
|
|
2062
2187
|
cn as FilePickerDenied,
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2188
|
+
on as FilePickerRestart,
|
|
2189
|
+
Wn as FileViewer,
|
|
2190
|
+
vn as FilterChips,
|
|
2191
|
+
Zn as ICON_NAMES,
|
|
2192
|
+
A as Icon,
|
|
2193
|
+
al as IncomingCall,
|
|
2194
|
+
qn as List,
|
|
2069
2195
|
qe as Loading,
|
|
2070
|
-
|
|
2196
|
+
yn as MAIL_ROW_LABELS,
|
|
2071
2197
|
je as MODAL_CLOSE_MS,
|
|
2072
|
-
|
|
2073
|
-
|
|
2198
|
+
nl as MailRow,
|
|
2199
|
+
Be as Modal,
|
|
2074
2200
|
Je as NamedIcon,
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
zn as
|
|
2201
|
+
dl as Notification,
|
|
2202
|
+
xe as PULL_AT,
|
|
2203
|
+
Gn as PageHeader,
|
|
2204
|
+
ol as PaneToolbar,
|
|
2205
|
+
wn as SIGN_IN_LABELS,
|
|
2206
|
+
ke as STATE_DELAY_MS,
|
|
2207
|
+
_l as ScreenShell,
|
|
2208
|
+
Qn as SearchField,
|
|
2209
|
+
Yn as SectionHeader,
|
|
2210
|
+
Kn as Select,
|
|
2211
|
+
il as SignInForm,
|
|
2212
|
+
cl as SignInLayout,
|
|
2213
|
+
el as SplitPanes,
|
|
2214
|
+
le as State,
|
|
2215
|
+
Xn as TabStrip,
|
|
2216
|
+
Hn as TextArea,
|
|
2217
|
+
Rn as TextField,
|
|
2218
|
+
zn as Toast,
|
|
2219
|
+
Vn as ToastRegion,
|
|
2093
2220
|
On as Toggle,
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2221
|
+
gn as fitPanes,
|
|
2222
|
+
ce as iconForName,
|
|
2223
|
+
pn as initialsOf,
|
|
2224
|
+
Cn as isCapability,
|
|
2225
|
+
bl as needsClientUpdate,
|
|
2226
|
+
ul as offerFor,
|
|
2227
|
+
pl as readConflict,
|
|
2228
|
+
ml as readRefusal,
|
|
2229
|
+
En as refusalText,
|
|
2230
|
+
hl as rereadAll,
|
|
2231
|
+
bn as tintOf,
|
|
2232
|
+
hn as usePull,
|
|
2233
|
+
fn as usePullState,
|
|
2234
|
+
fl as useReread,
|
|
2235
|
+
Tn as versionBelow,
|
|
2109
2236
|
Ze as writtenOut
|
|
2110
2237
|
};
|