@coolms/ui-react 0.1.0-alpha.38 → 0.1.0-alpha.39
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 +9 -0
- package/dist/components/Call.d.ts +3 -1
- package/dist/components/ScreenShell.d.ts +7 -1
- package/dist/components/Structure.d.ts +6 -1
- package/dist/components/Workspace.d.ts +6 -1
- package/dist/index.js +1318 -1298
- package/package.json +1 -1
- package/src/kit.css +9 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as e, jsxs as c, Fragment as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
function
|
|
1
|
+
import { jsx as e, jsxs as c, Fragment as B } from "react/jsx-runtime";
|
|
2
|
+
import { useId as fe, useState as D, useRef as P, useEffect as Q, useCallback as Ie, useMemo as Ln, useContext as Dn, createContext as In, useLayoutEffect as $e, Fragment as $n } from "react";
|
|
3
|
+
import { createPortal as ln } from "react-dom";
|
|
4
|
+
function qe(n, t) {
|
|
5
5
|
const l = { ...n };
|
|
6
6
|
for (const r of Object.keys(t ?? {})) {
|
|
7
7
|
const s = t == null ? void 0 : t[r];
|
|
@@ -9,10 +9,10 @@ function Ze(n, t) {
|
|
|
9
9
|
}
|
|
10
10
|
return l;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function F(...n) {
|
|
13
13
|
return n.filter(Boolean).join(" ");
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function re({ name: n }) {
|
|
16
16
|
const t = { width: 16, height: 16, viewBox: "0 0 16 16", "aria-hidden": !0, focusable: !1 };
|
|
17
17
|
switch (n) {
|
|
18
18
|
case "lock":
|
|
@@ -31,33 +31,33 @@ function se({ name: n }) {
|
|
|
31
31
|
return /* @__PURE__ */ e("svg", { ...t, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 5.5a1 1 0 0 0-1 1V11a1 1 0 1 0 2 0V7.5a1 1 0 0 0-1-1ZM8 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" }) });
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function De({
|
|
35
35
|
variant: n = "secondary",
|
|
36
36
|
busy: t = !1,
|
|
37
37
|
busyLabel: l,
|
|
38
38
|
locked: r = !1,
|
|
39
39
|
lockedReason: s,
|
|
40
40
|
icon: a,
|
|
41
|
-
disabled:
|
|
41
|
+
disabled: h,
|
|
42
42
|
className: d,
|
|
43
|
-
children:
|
|
44
|
-
type:
|
|
43
|
+
children: m,
|
|
44
|
+
type: b = "button",
|
|
45
45
|
title: i,
|
|
46
|
-
...
|
|
46
|
+
...g
|
|
47
47
|
}) {
|
|
48
|
-
const
|
|
48
|
+
const f = !!h || t;
|
|
49
49
|
return /* @__PURE__ */ c(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
|
-
...
|
|
53
|
-
type:
|
|
54
|
-
className:
|
|
55
|
-
disabled:
|
|
52
|
+
...g,
|
|
53
|
+
type: b,
|
|
54
|
+
className: F("cms-button", `cms-button--${n}`, t && "is-busy", r && "is-locked", d),
|
|
55
|
+
disabled: f,
|
|
56
56
|
"aria-busy": t || void 0,
|
|
57
57
|
title: r ? s ?? i : i,
|
|
58
58
|
children: [
|
|
59
|
-
t ? /* @__PURE__ */ e(
|
|
60
|
-
/* @__PURE__ */ e("span", { className: "cms-button__label", children: t && l !== void 0 ? l :
|
|
59
|
+
t ? /* @__PURE__ */ e(re, { name: "spinner" }) : r ? /* @__PURE__ */ e(re, { name: "lock" }) : a,
|
|
60
|
+
/* @__PURE__ */ e("span", { className: "cms-button__label", children: t && l !== void 0 ? l : m }),
|
|
61
61
|
r && s ? /* @__PURE__ */ c("span", { className: "cms-visually-hidden", children: [
|
|
62
62
|
", ",
|
|
63
63
|
s
|
|
@@ -66,12 +66,12 @@ function Ie({
|
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
return /* @__PURE__ */ c("div", { className:
|
|
69
|
+
function sn({ id: n, label: t, help: l, error: r, pinned: s, children: a }) {
|
|
70
|
+
return /* @__PURE__ */ c("div", { className: F("cms-field", r != null && "is-invalid"), children: [
|
|
71
71
|
/* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: n, children: t }),
|
|
72
72
|
a,
|
|
73
73
|
s != null ? /* @__PURE__ */ c("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
|
|
74
|
-
/* @__PURE__ */ e(
|
|
74
|
+
/* @__PURE__ */ e(re, { name: "lock" }),
|
|
75
75
|
" ",
|
|
76
76
|
s
|
|
77
77
|
] }) : null,
|
|
@@ -79,125 +79,125 @@ function ln({ id: n, label: t, help: l, error: r, pinned: s, children: a }) {
|
|
|
79
79
|
l != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${n}-help`, children: l }) : null
|
|
80
80
|
] });
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function rn(n, t) {
|
|
83
83
|
const l = [t.error != null && `${n}-error`, t.pinned != null && `${n}-pinned`, t.help != null && `${n}-help`].filter(Boolean).join(" ");
|
|
84
84
|
return l === "" ? void 0 : l;
|
|
85
85
|
}
|
|
86
|
-
const
|
|
87
|
-
function
|
|
88
|
-
const r = (a,
|
|
89
|
-
const
|
|
90
|
-
return
|
|
86
|
+
const Bn = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Fn = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
|
|
87
|
+
function Hn(n, t, l) {
|
|
88
|
+
const r = (a, h, d, m = 0, b = 0, i = 0) => {
|
|
89
|
+
const g = new Date(Date.UTC(a, h - 1, d, m, b, i));
|
|
90
|
+
return g.setUTCFullYear(a), g.getUTCFullYear() === a && g.getUTCMonth() === h - 1 && g.getUTCDate() === d && g.getUTCHours() === m && g.getUTCMinutes() === b && g.getUTCSeconds() === i ? g : null;
|
|
91
91
|
}, s = (a) => ({ hour: Number(a[1]), minute: Number(a[2]), second: Number(a[3] ?? 0) });
|
|
92
92
|
try {
|
|
93
93
|
if (n === "time") {
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
96
|
-
const d = s(
|
|
97
|
-
return
|
|
94
|
+
const h = t.match(Fn);
|
|
95
|
+
if (h === null) return t;
|
|
96
|
+
const d = s(h), m = r(2e3, 1, 1, d.hour, d.minute, d.second);
|
|
97
|
+
return m === null ? t : new Intl.DateTimeFormat(l, { timeStyle: h[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(m);
|
|
98
98
|
}
|
|
99
|
-
const a = t.match(
|
|
99
|
+
const a = t.match(Bn);
|
|
100
100
|
if (a === null) return t;
|
|
101
101
|
if (n === "date" && a[4] === void 0) {
|
|
102
|
-
const
|
|
103
|
-
return
|
|
102
|
+
const h = r(Number(a[1]), Number(a[2]), Number(a[3]));
|
|
103
|
+
return h === null ? t : new Intl.DateTimeFormat(l, { dateStyle: "medium", timeZone: "UTC" }).format(h);
|
|
104
104
|
}
|
|
105
105
|
if (n === "datetime-local" && a[4] !== void 0) {
|
|
106
|
-
const
|
|
107
|
-
return
|
|
106
|
+
const h = r(Number(a[1]), Number(a[2]), Number(a[3]), Number(a[4]), Number(a[5]), Number(a[6] ?? 0));
|
|
107
|
+
return h === null ? t : new Intl.DateTimeFormat(l, { dateStyle: "medium", timeStyle: a[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(h);
|
|
108
108
|
}
|
|
109
109
|
} catch {
|
|
110
110
|
return t;
|
|
111
111
|
}
|
|
112
112
|
return t;
|
|
113
113
|
}
|
|
114
|
-
const
|
|
115
|
-
function
|
|
116
|
-
const x =
|
|
117
|
-
return /* @__PURE__ */ e(
|
|
114
|
+
const Rn = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
|
|
115
|
+
function zt({ label: n, help: t, error: l, disabled: r, readOnly: s, pinned: a, value: h, onChange: d, placeholder: m, type: b = "text", name: i, locale: g, min: f, max: v, step: u, minLength: w, maxLength: S, required: A }) {
|
|
116
|
+
const x = fe(), T = s === !0 || a != null, _ = T && Rn.has(b), N = b === "number" && (u === "any" || typeof u == "number" && !Number.isInteger(u));
|
|
117
|
+
return /* @__PURE__ */ e(sn, { id: x, label: n, help: t, error: l, pinned: a, children: /* @__PURE__ */ e(
|
|
118
118
|
"input",
|
|
119
119
|
{
|
|
120
120
|
id: x,
|
|
121
121
|
name: i,
|
|
122
|
-
type:
|
|
122
|
+
type: _ ? "text" : b,
|
|
123
123
|
className: "cms-input",
|
|
124
|
-
value:
|
|
125
|
-
...
|
|
126
|
-
lang:
|
|
127
|
-
placeholder:
|
|
124
|
+
value: _ ? Hn(b, h, g) : h,
|
|
125
|
+
..._ ? { "data-value": h } : {},
|
|
126
|
+
lang: g,
|
|
127
|
+
placeholder: m,
|
|
128
128
|
disabled: r,
|
|
129
|
-
readOnly:
|
|
130
|
-
required:
|
|
131
|
-
"aria-required":
|
|
132
|
-
min:
|
|
133
|
-
max:
|
|
134
|
-
step:
|
|
129
|
+
readOnly: T,
|
|
130
|
+
required: A,
|
|
131
|
+
"aria-required": A || void 0,
|
|
132
|
+
min: _ ? void 0 : f,
|
|
133
|
+
max: _ ? void 0 : v,
|
|
134
|
+
step: _ ? void 0 : u,
|
|
135
135
|
minLength: w,
|
|
136
|
-
maxLength:
|
|
137
|
-
inputMode:
|
|
136
|
+
maxLength: S,
|
|
137
|
+
inputMode: b === "number" ? N ? "decimal" : "numeric" : void 0,
|
|
138
138
|
"aria-invalid": l != null || void 0,
|
|
139
|
-
"aria-describedby":
|
|
140
|
-
onChange: (
|
|
139
|
+
"aria-describedby": rn(x, { help: t, error: l, pinned: a }),
|
|
140
|
+
onChange: (I) => d == null ? void 0 : d(I.target.value)
|
|
141
141
|
}
|
|
142
142
|
) });
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
const w =
|
|
146
|
-
return /* @__PURE__ */ e(
|
|
144
|
+
function Ut({ label: n, help: t, error: l, disabled: r, readOnly: s, pinned: a, value: h, onChange: d, placeholder: m, rows: b = 4, name: i, locale: g, minLength: f, maxLength: v, required: u }) {
|
|
145
|
+
const w = fe();
|
|
146
|
+
return /* @__PURE__ */ e(sn, { id: w, label: n, help: t, error: l, pinned: a, children: /* @__PURE__ */ e(
|
|
147
147
|
"textarea",
|
|
148
148
|
{
|
|
149
149
|
id: w,
|
|
150
150
|
name: i,
|
|
151
151
|
className: "cms-input cms-textarea",
|
|
152
|
-
rows:
|
|
153
|
-
value:
|
|
154
|
-
lang:
|
|
155
|
-
placeholder:
|
|
152
|
+
rows: b,
|
|
153
|
+
value: h,
|
|
154
|
+
lang: g,
|
|
155
|
+
placeholder: m,
|
|
156
156
|
disabled: r,
|
|
157
157
|
readOnly: s === !0 || a != null,
|
|
158
|
-
required:
|
|
159
|
-
"aria-required":
|
|
160
|
-
minLength:
|
|
161
|
-
maxLength:
|
|
158
|
+
required: u,
|
|
159
|
+
"aria-required": u || void 0,
|
|
160
|
+
minLength: f,
|
|
161
|
+
maxLength: v,
|
|
162
162
|
"aria-invalid": l != null || void 0,
|
|
163
|
-
"aria-describedby":
|
|
164
|
-
onChange: (
|
|
163
|
+
"aria-describedby": rn(w, { help: t, error: l, pinned: a }),
|
|
164
|
+
onChange: (S) => d == null ? void 0 : d(S.target.value)
|
|
165
165
|
}
|
|
166
166
|
) });
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
const i =
|
|
170
|
-
return /* @__PURE__ */ e(
|
|
168
|
+
function Kt({ label: n, help: t, error: l, disabled: r, readOnly: s, value: a, options: h, onChange: d, emptyText: m = "Nothing to choose from yet.", name: b }) {
|
|
169
|
+
const i = fe(), g = h.length === 0;
|
|
170
|
+
return /* @__PURE__ */ e(sn, { id: i, label: n, help: g ? m : t, error: l, children: /* @__PURE__ */ e(
|
|
171
171
|
"select",
|
|
172
172
|
{
|
|
173
173
|
id: i,
|
|
174
|
-
name:
|
|
174
|
+
name: b,
|
|
175
175
|
className: "cms-input cms-select",
|
|
176
176
|
value: a,
|
|
177
|
-
disabled: r ||
|
|
177
|
+
disabled: r || g,
|
|
178
178
|
"aria-readonly": s || void 0,
|
|
179
179
|
"aria-invalid": l != null || void 0,
|
|
180
|
-
"aria-describedby":
|
|
181
|
-
onChange: (
|
|
182
|
-
s || d == null || d(
|
|
180
|
+
"aria-describedby": rn(i, { help: g ? m : t, error: l }),
|
|
181
|
+
onChange: (f) => {
|
|
182
|
+
s || d == null || d(f.target.value);
|
|
183
183
|
},
|
|
184
|
-
children:
|
|
184
|
+
children: h.map((f) => /* @__PURE__ */ e("option", { value: f.value, disabled: s && f.value !== a, children: f.label }, f.value))
|
|
185
185
|
}
|
|
186
186
|
) });
|
|
187
187
|
}
|
|
188
|
-
function
|
|
189
|
-
const
|
|
188
|
+
function Wt({ label: n, checked: t, onChange: l, disabled: r, readOnly: s, help: a }) {
|
|
189
|
+
const h = fe();
|
|
190
190
|
return /* @__PURE__ */ c("div", { className: "cms-toggle-row", children: [
|
|
191
191
|
/* @__PURE__ */ e(
|
|
192
192
|
"button",
|
|
193
193
|
{
|
|
194
|
-
id:
|
|
194
|
+
id: h,
|
|
195
195
|
type: "button",
|
|
196
196
|
role: "switch",
|
|
197
|
-
className:
|
|
197
|
+
className: F("cms-toggle", t && "is-on"),
|
|
198
198
|
"aria-checked": t,
|
|
199
199
|
"aria-readonly": s || void 0,
|
|
200
|
-
"aria-describedby": a != null ? `${
|
|
200
|
+
"aria-describedby": a != null ? `${h}-help` : void 0,
|
|
201
201
|
disabled: r,
|
|
202
202
|
onClick: () => {
|
|
203
203
|
s || l == null || l(!t);
|
|
@@ -205,256 +205,256 @@ function Kt({ label: n, checked: t, onChange: l, disabled: r, readOnly: s, help:
|
|
|
205
205
|
children: /* @__PURE__ */ e("span", { className: "cms-toggle__thumb" })
|
|
206
206
|
}
|
|
207
207
|
),
|
|
208
|
-
/* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor:
|
|
209
|
-
a != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${
|
|
208
|
+
/* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor: h, children: n }),
|
|
209
|
+
a != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${h}-help`, children: a }) : null
|
|
210
210
|
] });
|
|
211
211
|
}
|
|
212
|
-
const
|
|
213
|
-
function
|
|
214
|
-
const [i,
|
|
215
|
-
if (
|
|
212
|
+
const On = 150;
|
|
213
|
+
function kn({ open: n, title: t, onClose: l, dirty: r = !1, onDirtyClose: s, children: a, footer: h, closeLabel: d = "Close", initialFocus: m, className: b }) {
|
|
214
|
+
const [i, g] = D(n), [f, v] = D(!1), u = P(null), w = P(null), S = fe();
|
|
215
|
+
if (Q(() => {
|
|
216
216
|
if (n) {
|
|
217
|
-
w.current = document.activeElement,
|
|
217
|
+
w.current = document.activeElement, g(!0), v(!1);
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
220
|
if (!i) return;
|
|
221
|
-
|
|
221
|
+
v(!0);
|
|
222
222
|
const x = window.setTimeout(() => {
|
|
223
|
-
var
|
|
224
|
-
|
|
225
|
-
},
|
|
223
|
+
var T, _;
|
|
224
|
+
g(!1), v(!1), (_ = (T = w.current) == null ? void 0 : T.focus) == null || _.call(T);
|
|
225
|
+
}, On);
|
|
226
226
|
return () => window.clearTimeout(x);
|
|
227
|
-
}, [n, i]),
|
|
228
|
-
var x,
|
|
227
|
+
}, [n, i]), Q(() => {
|
|
228
|
+
var x, T;
|
|
229
229
|
if (n && i) {
|
|
230
|
-
const
|
|
231
|
-
(
|
|
230
|
+
const _ = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
|
|
231
|
+
(T = (m == null ? void 0 : m.current) ?? ((x = u.current) == null ? void 0 : x.querySelector(`.cms-modal__body :is(${_}), .cms-modal__foot :is(${_})`)) ?? u.current) == null || T.focus();
|
|
232
232
|
}
|
|
233
|
-
}, [n, i,
|
|
234
|
-
const
|
|
233
|
+
}, [n, i, m]), !i) return null;
|
|
234
|
+
const A = () => {
|
|
235
235
|
r ? s == null || s() : l();
|
|
236
236
|
};
|
|
237
|
-
return
|
|
238
|
-
/* @__PURE__ */ e("div", { className:
|
|
239
|
-
x.target === x.currentTarget &&
|
|
237
|
+
return ln(
|
|
238
|
+
/* @__PURE__ */ e("div", { className: F("cms-modal-scrim", f && "is-closing"), onMouseDown: (x) => {
|
|
239
|
+
x.target === x.currentTarget && A();
|
|
240
240
|
}, children: /* @__PURE__ */ c(
|
|
241
241
|
"div",
|
|
242
242
|
{
|
|
243
|
-
ref:
|
|
244
|
-
className:
|
|
243
|
+
ref: u,
|
|
244
|
+
className: F("cms-modal", b, f && "is-closing", r && "is-dirty"),
|
|
245
245
|
role: "dialog",
|
|
246
246
|
"aria-modal": "true",
|
|
247
|
-
"aria-labelledby":
|
|
247
|
+
"aria-labelledby": S,
|
|
248
248
|
tabIndex: -1,
|
|
249
249
|
onKeyDown: (x) => {
|
|
250
|
-
var
|
|
250
|
+
var T;
|
|
251
251
|
if (x.key === "Escape")
|
|
252
|
-
x.stopPropagation(),
|
|
252
|
+
x.stopPropagation(), A();
|
|
253
253
|
else if (x.key === "Tab") {
|
|
254
|
-
const
|
|
255
|
-
if (!
|
|
256
|
-
const
|
|
257
|
-
x.shiftKey && document.activeElement ===
|
|
254
|
+
const _ = (T = u.current) == null ? void 0 : T.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
|
|
255
|
+
if (!_ || _.length === 0) return;
|
|
256
|
+
const N = _[0], I = _[_.length - 1];
|
|
257
|
+
x.shiftKey && document.activeElement === N ? (x.preventDefault(), I.focus()) : !x.shiftKey && document.activeElement === I && (x.preventDefault(), N.focus());
|
|
258
258
|
}
|
|
259
259
|
},
|
|
260
260
|
children: [
|
|
261
261
|
/* @__PURE__ */ c("header", { className: "cms-modal__head", children: [
|
|
262
|
-
/* @__PURE__ */ e("h2", { className: "cms-modal__title", id:
|
|
263
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": d, onClick:
|
|
262
|
+
/* @__PURE__ */ e("h2", { className: "cms-modal__title", id: S, children: t }),
|
|
263
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": d, onClick: A, children: /* @__PURE__ */ e(re, { name: "close" }) })
|
|
264
264
|
] }),
|
|
265
265
|
/* @__PURE__ */ e("div", { className: "cms-modal__body", children: a }),
|
|
266
|
-
|
|
266
|
+
h != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: h }) : null
|
|
267
267
|
]
|
|
268
268
|
}
|
|
269
269
|
) }),
|
|
270
270
|
document.body
|
|
271
271
|
);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
const
|
|
273
|
+
function Vt({ open: n, title: t, message: l, kind: r = "default", confirmLabel: s, cancelLabel: a, closeLabel: h, onConfirm: d, onCancel: m }) {
|
|
274
|
+
const b = r === "discard-changes";
|
|
275
275
|
return /* @__PURE__ */ e(
|
|
276
|
-
|
|
276
|
+
kn,
|
|
277
277
|
{
|
|
278
278
|
open: n,
|
|
279
279
|
title: t,
|
|
280
|
-
onClose:
|
|
281
|
-
...
|
|
282
|
-
footer: /* @__PURE__ */ c(
|
|
283
|
-
/* @__PURE__ */ e(
|
|
284
|
-
/* @__PURE__ */ e(
|
|
280
|
+
onClose: m,
|
|
281
|
+
...h === void 0 ? {} : { closeLabel: h },
|
|
282
|
+
footer: /* @__PURE__ */ c(B, { children: [
|
|
283
|
+
/* @__PURE__ */ e(De, { onClick: m, children: a ?? (b ? "Keep editing" : "Cancel") }),
|
|
284
|
+
/* @__PURE__ */ e(De, { variant: r === "default" ? "primary" : "danger", onClick: d, children: s ?? (b ? "Discard changes" : "Confirm") })
|
|
285
285
|
] }),
|
|
286
286
|
children: r !== "default" ? /* @__PURE__ */ c("p", { className: "cms-confirm__warning", children: [
|
|
287
|
-
/* @__PURE__ */ e(
|
|
287
|
+
/* @__PURE__ */ e(re, { name: "warning" }),
|
|
288
288
|
" ",
|
|
289
289
|
l
|
|
290
290
|
] }) : /* @__PURE__ */ e("p", { children: l })
|
|
291
291
|
}
|
|
292
292
|
);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
return /* @__PURE__ */ c("div", { className:
|
|
296
|
-
/* @__PURE__ */ e(
|
|
294
|
+
function Zt({ kind: n, message: t, action: l, onDismiss: r, dismissLabel: s = "Dismiss" }) {
|
|
295
|
+
return /* @__PURE__ */ c("div", { className: F("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
|
|
296
|
+
/* @__PURE__ */ e(re, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
|
|
297
297
|
/* @__PURE__ */ e("span", { className: "cms-toast__message", children: t }),
|
|
298
|
-
l ? /* @__PURE__ */ e(
|
|
299
|
-
r ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": s, onClick: r, children: /* @__PURE__ */ e(
|
|
298
|
+
l ? /* @__PURE__ */ e(De, { className: "cms-toast__action", onClick: l.onAction, children: l.label }) : null,
|
|
299
|
+
r ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": s, onClick: r, children: /* @__PURE__ */ e(re, { name: "close" }) }) : null
|
|
300
300
|
] });
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function qt({ children: n }) {
|
|
303
303
|
return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: n });
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
return /* @__PURE__ */ c("div", { className:
|
|
307
|
-
/* @__PURE__ */ e(
|
|
305
|
+
function Pn({ what: n, layout: t = "inline" }) {
|
|
306
|
+
return /* @__PURE__ */ c("div", { className: F("cms-loading", `cms-loading--${t}`), role: "status", "aria-live": "polite", children: [
|
|
307
|
+
/* @__PURE__ */ e(re, { name: "spinner" }),
|
|
308
308
|
/* @__PURE__ */ e("span", { children: n })
|
|
309
309
|
] });
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function zn({ title: n, hint: t, action: l }) {
|
|
312
312
|
return /* @__PURE__ */ c("div", { className: "cms-empty", children: [
|
|
313
313
|
/* @__PURE__ */ e("p", { className: "cms-empty__title", children: n }),
|
|
314
314
|
t != null ? /* @__PURE__ */ e("p", { className: "cms-empty__hint", children: t }) : null,
|
|
315
315
|
l != null ? /* @__PURE__ */ e("div", { className: "cms-empty__action", children: l }) : null
|
|
316
316
|
] });
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Un({ message: n, onRetry: t, retryLabel: l = "Try again" }) {
|
|
319
319
|
return /* @__PURE__ */ c("div", { className: "cms-error-banner", role: "alert", children: [
|
|
320
|
-
/* @__PURE__ */ e(
|
|
320
|
+
/* @__PURE__ */ e(re, { name: "warning" }),
|
|
321
321
|
/* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: n }),
|
|
322
|
-
t ? /* @__PURE__ */ e(
|
|
322
|
+
t ? /* @__PURE__ */ e(De, { onClick: t, children: l }) : null
|
|
323
323
|
] });
|
|
324
324
|
}
|
|
325
|
-
const
|
|
326
|
-
mail: /* @__PURE__ */ c(
|
|
325
|
+
const xn = {
|
|
326
|
+
mail: /* @__PURE__ */ c(B, { 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
330
|
// A gear: a ring with eight short teeth, the hole in its middle.
|
|
331
|
-
settings: /* @__PURE__ */ c(
|
|
331
|
+
settings: /* @__PURE__ */ c(B, { children: [
|
|
332
332
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" }),
|
|
333
333
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "7" }),
|
|
334
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
335
|
] }),
|
|
336
336
|
// The envelope with its flap open above it: a message read, or the message itself again.
|
|
337
|
-
"mail-open": /* @__PURE__ */ c(
|
|
337
|
+
"mail-open": /* @__PURE__ */ c(B, { children: [
|
|
338
338
|
/* @__PURE__ */ e("path", { d: "M3 10v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9" }),
|
|
339
339
|
/* @__PURE__ */ e("path", { d: "m3 10 9-6 9 6" }),
|
|
340
340
|
/* @__PURE__ */ e("path", { d: "m3 10 9 6 9-6" })
|
|
341
341
|
] }),
|
|
342
342
|
// A clipboard: copy what is shown.
|
|
343
|
-
copy: /* @__PURE__ */ c(
|
|
343
|
+
copy: /* @__PURE__ */ c(B, { children: [
|
|
344
344
|
/* @__PURE__ */ e("rect", { x: "6", y: "4", width: "12", height: "17", rx: "2" }),
|
|
345
345
|
/* @__PURE__ */ e("path", { d: "M9 4V3h6v1" }),
|
|
346
346
|
/* @__PURE__ */ e("path", { d: "M9 10h6M9 14h6M9 18h3" })
|
|
347
347
|
] }),
|
|
348
348
|
chat: /* @__PURE__ */ e("path", { d: "M4 12a8 8 0 1 1 4 6.9L4 20l1.1-4A8 8 0 0 1 4 12Z" }),
|
|
349
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" }),
|
|
350
|
-
calendar: /* @__PURE__ */ c(
|
|
350
|
+
calendar: /* @__PURE__ */ c(B, { children: [
|
|
351
351
|
/* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "16", rx: "2" }),
|
|
352
352
|
/* @__PURE__ */ e("path", { d: "M3 10h18M8 3v4M16 3v4" })
|
|
353
353
|
] }),
|
|
354
|
-
file: /* @__PURE__ */ c(
|
|
354
|
+
file: /* @__PURE__ */ c(B, { children: [
|
|
355
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" }),
|
|
356
356
|
/* @__PURE__ */ e("path", { d: "M14 3v6h6M8 13h8M8 17h6" })
|
|
357
357
|
] }),
|
|
358
358
|
// The file, with code's angle brackets in place of its lines: a message's source.
|
|
359
|
-
"file-code": /* @__PURE__ */ c(
|
|
359
|
+
"file-code": /* @__PURE__ */ c(B, { children: [
|
|
360
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" }),
|
|
361
361
|
/* @__PURE__ */ e("path", { d: "M14 3v6h6" }),
|
|
362
362
|
/* @__PURE__ */ e("path", { d: "m10 12-2 2.5 2 2.5M14 12l2 2.5-2 2.5" })
|
|
363
363
|
] }),
|
|
364
|
-
image: /* @__PURE__ */ c(
|
|
364
|
+
image: /* @__PURE__ */ c(B, { children: [
|
|
365
365
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
|
|
366
366
|
/* @__PURE__ */ e("circle", { cx: "9", cy: "10", r: "2" }),
|
|
367
367
|
/* @__PURE__ */ e("path", { d: "m21 17-5-5-9 8" })
|
|
368
368
|
] }),
|
|
369
|
-
search: /* @__PURE__ */ c(
|
|
369
|
+
search: /* @__PURE__ */ c(B, { children: [
|
|
370
370
|
/* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "7" }),
|
|
371
371
|
/* @__PURE__ */ e("path", { d: "m20 20-4-4" })
|
|
372
372
|
] }),
|
|
373
|
-
bell: /* @__PURE__ */ c(
|
|
373
|
+
bell: /* @__PURE__ */ c(B, { children: [
|
|
374
374
|
/* @__PURE__ */ e("path", { d: "M6 9a6 6 0 1 1 12 0c0 6 2 8 2 8H4s2-2 2-8Z" }),
|
|
375
375
|
/* @__PURE__ */ e("path", { d: "M10 20a2 2 0 0 0 4 0" })
|
|
376
376
|
] }),
|
|
377
|
-
pencil: /* @__PURE__ */ c(
|
|
377
|
+
pencil: /* @__PURE__ */ c(B, { children: [
|
|
378
378
|
/* @__PURE__ */ e("path", { d: "M4 20h4L19 9l-4-4L4 16Z" }),
|
|
379
379
|
/* @__PURE__ */ e("path", { d: "m13 7 4 4" })
|
|
380
380
|
] }),
|
|
381
|
-
download: /* @__PURE__ */ c(
|
|
381
|
+
download: /* @__PURE__ */ c(B, { children: [
|
|
382
382
|
/* @__PURE__ */ e("path", { d: "M12 4v11" }),
|
|
383
383
|
/* @__PURE__ */ e("path", { d: "m7 11 5 5 5-5" }),
|
|
384
384
|
/* @__PURE__ */ e("path", { d: "M4 20h16" })
|
|
385
385
|
] }),
|
|
386
386
|
// Download's arrow turned up, from the line: a file sent up.
|
|
387
|
-
upload: /* @__PURE__ */ c(
|
|
387
|
+
upload: /* @__PURE__ */ c(B, { children: [
|
|
388
388
|
/* @__PURE__ */ e("path", { d: "M12 20V9" }),
|
|
389
389
|
/* @__PURE__ */ e("path", { d: "m7 13 5-5 5 5" }),
|
|
390
390
|
/* @__PURE__ */ e("path", { d: "M4 4h16" })
|
|
391
391
|
] }),
|
|
392
|
-
print: /* @__PURE__ */ c(
|
|
392
|
+
print: /* @__PURE__ */ c(B, { children: [
|
|
393
393
|
/* @__PURE__ */ e("path", { d: "M7 8V4h10v4" }),
|
|
394
394
|
/* @__PURE__ */ e("rect", { x: "3", y: "8", width: "18", height: "8", rx: "2" }),
|
|
395
395
|
/* @__PURE__ */ e("path", { d: "M7 14h10v6H7Z" })
|
|
396
396
|
] }),
|
|
397
|
-
"open-separately": /* @__PURE__ */ c(
|
|
397
|
+
"open-separately": /* @__PURE__ */ c(B, { children: [
|
|
398
398
|
/* @__PURE__ */ e("path", { d: "M14 4h6v6" }),
|
|
399
399
|
/* @__PURE__ */ e("path", { d: "m20 4-9 9" }),
|
|
400
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" })
|
|
401
401
|
] }),
|
|
402
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" }),
|
|
403
|
-
send: /* @__PURE__ */ c(
|
|
403
|
+
send: /* @__PURE__ */ c(B, { children: [
|
|
404
404
|
/* @__PURE__ */ e("path", { d: "M21 3 10 14" }),
|
|
405
405
|
/* @__PURE__ */ e("path", { d: "M21 3 14 21l-4-7-7-4Z" })
|
|
406
406
|
] }),
|
|
407
|
-
inbox: /* @__PURE__ */ c(
|
|
407
|
+
inbox: /* @__PURE__ */ c(B, { children: [
|
|
408
408
|
/* @__PURE__ */ e("path", { d: "M3 13h5l1 3h6l1-3h5" }),
|
|
409
409
|
/* @__PURE__ */ e("path", { d: "M5 5h14l2 8v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" })
|
|
410
410
|
] }),
|
|
411
|
-
archive: /* @__PURE__ */ c(
|
|
411
|
+
archive: /* @__PURE__ */ c(B, { children: [
|
|
412
412
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "5", rx: "1" }),
|
|
413
413
|
/* @__PURE__ */ e("path", { d: "M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4" })
|
|
414
414
|
] }),
|
|
415
|
-
trash: /* @__PURE__ */ c(
|
|
415
|
+
trash: /* @__PURE__ */ c(B, { children: [
|
|
416
416
|
/* @__PURE__ */ e("path", { d: "M4 7h16M10 11v6M14 11v6" }),
|
|
417
417
|
/* @__PURE__ */ e("path", { d: "M6 7l1 13a2 2 0 0 0 2 1h6a2 2 0 0 0 2-1l1-13M9 7V4h6v3" })
|
|
418
418
|
] }),
|
|
419
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" }),
|
|
420
|
-
mic: /* @__PURE__ */ c(
|
|
420
|
+
mic: /* @__PURE__ */ c(B, { children: [
|
|
421
421
|
/* @__PURE__ */ e("rect", { x: "9", y: "3", width: "6", height: "11", rx: "3" }),
|
|
422
422
|
/* @__PURE__ */ e("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v3" })
|
|
423
423
|
] }),
|
|
424
|
-
speaker: /* @__PURE__ */ c(
|
|
424
|
+
speaker: /* @__PURE__ */ c(B, { children: [
|
|
425
425
|
/* @__PURE__ */ e("path", { d: "M4 9h4l5-4v14l-5-4H4Z" }),
|
|
426
426
|
/* @__PURE__ */ e("path", { d: "M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12" })
|
|
427
427
|
] }),
|
|
428
|
-
"user-plus": /* @__PURE__ */ c(
|
|
428
|
+
"user-plus": /* @__PURE__ */ c(B, { children: [
|
|
429
429
|
/* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
|
|
430
430
|
/* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M19 8v6M16 11h6" })
|
|
431
431
|
] }),
|
|
432
432
|
// A person, nothing more: one whose account is gone.
|
|
433
|
-
user: /* @__PURE__ */ c(
|
|
433
|
+
user: /* @__PURE__ */ c(B, { children: [
|
|
434
434
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "8", r: "4" }),
|
|
435
435
|
/* @__PURE__ */ e("path", { d: "M4 21a8 8 0 0 1 16 0" })
|
|
436
436
|
] }),
|
|
437
437
|
// A person with a tick: someone allowed.
|
|
438
|
-
"user-check": /* @__PURE__ */ c(
|
|
438
|
+
"user-check": /* @__PURE__ */ c(B, { children: [
|
|
439
439
|
/* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
|
|
440
440
|
/* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M16 11l2 2 4-4" })
|
|
441
441
|
] }),
|
|
442
442
|
// A person with a cross: someone no longer allowed.
|
|
443
|
-
"user-x": /* @__PURE__ */ c(
|
|
443
|
+
"user-x": /* @__PURE__ */ c(B, { children: [
|
|
444
444
|
/* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
|
|
445
445
|
/* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M17 8l4 4M21 8l-4 4" })
|
|
446
446
|
] }),
|
|
447
447
|
// Two people: the members of a group.
|
|
448
|
-
users: /* @__PURE__ */ c(
|
|
448
|
+
users: /* @__PURE__ */ c(B, { children: [
|
|
449
449
|
/* @__PURE__ */ e("circle", { cx: "9", cy: "8", r: "3.5" }),
|
|
450
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" })
|
|
451
451
|
] }),
|
|
452
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" }),
|
|
453
|
-
video: /* @__PURE__ */ c(
|
|
453
|
+
video: /* @__PURE__ */ c(B, { children: [
|
|
454
454
|
/* @__PURE__ */ e("rect", { x: "3", y: "6", width: "13", height: "12", rx: "2" }),
|
|
455
455
|
/* @__PURE__ */ e("path", { d: "m16 10 5-3v10l-5-3" })
|
|
456
456
|
] }),
|
|
457
|
-
info: /* @__PURE__ */ c(
|
|
457
|
+
info: /* @__PURE__ */ c(B, { children: [
|
|
458
458
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
|
|
459
459
|
/* @__PURE__ */ e("path", { d: "M12 11v6M12 7.5v.5" })
|
|
460
460
|
] }),
|
|
@@ -463,17 +463,17 @@ const Nn = {
|
|
|
463
463
|
plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
|
|
464
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" }),
|
|
465
465
|
// The folder with a plus inside: a new folder.
|
|
466
|
-
"folder-plus": /* @__PURE__ */ c(
|
|
466
|
+
"folder-plus": /* @__PURE__ */ c(B, { children: [
|
|
467
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" }),
|
|
468
468
|
/* @__PURE__ */ e("path", { d: "M12 10.5v6M9 13.5h6" })
|
|
469
469
|
] }),
|
|
470
470
|
// The folder with a cross inside: a folder removed.
|
|
471
|
-
"folder-x": /* @__PURE__ */ c(
|
|
471
|
+
"folder-x": /* @__PURE__ */ c(B, { children: [
|
|
472
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" }),
|
|
473
473
|
/* @__PURE__ */ e("path", { d: "m9.5 11 5 5M14.5 11l-5 5" })
|
|
474
474
|
] }),
|
|
475
475
|
check: /* @__PURE__ */ e("path", { d: "m5 12 5 5 9-10" }),
|
|
476
|
-
server: /* @__PURE__ */ c(
|
|
476
|
+
server: /* @__PURE__ */ c(B, { children: [
|
|
477
477
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "7", rx: "2" }),
|
|
478
478
|
/* @__PURE__ */ e("rect", { x: "3", y: "13", width: "18", height: "7", rx: "2" }),
|
|
479
479
|
/* @__PURE__ */ e("path", { d: "M7 7.5h.5M7 16.5h.5" })
|
|
@@ -489,7 +489,7 @@ const Nn = {
|
|
|
489
489
|
funnel: /* @__PURE__ */ e("path", { d: "M4 5h16l-6 8v6l-4-2v-4Z" }),
|
|
490
490
|
important: /* @__PURE__ */ e("path", { d: "M4 6h11l5 6-5 6H4l4-6-4-6Z" })
|
|
491
491
|
};
|
|
492
|
-
function
|
|
492
|
+
function $({ name: n, size: t = 20, label: l }) {
|
|
493
493
|
return /* @__PURE__ */ e(
|
|
494
494
|
"svg",
|
|
495
495
|
{
|
|
@@ -504,11 +504,11 @@ function B({ name: n, size: t = 20, label: l }) {
|
|
|
504
504
|
strokeLinejoin: "round",
|
|
505
505
|
focusable: !1,
|
|
506
506
|
...l ? { role: "img", "aria-label": l } : { "aria-hidden": !0 },
|
|
507
|
-
children:
|
|
507
|
+
children: xn[n]
|
|
508
508
|
}
|
|
509
509
|
);
|
|
510
510
|
}
|
|
511
|
-
const
|
|
511
|
+
const Gt = Object.keys(xn), pn = {
|
|
512
512
|
reply: "reply",
|
|
513
513
|
"reply-all": "reply",
|
|
514
514
|
forward: "forward",
|
|
@@ -552,186 +552,186 @@ const qt = Object.keys(Nn), hn = {
|
|
|
552
552
|
funnel: "funnel"
|
|
553
553
|
};
|
|
554
554
|
function Ue(n) {
|
|
555
|
-
return Object.prototype.hasOwnProperty.call(
|
|
555
|
+
return Object.prototype.hasOwnProperty.call(pn, n) ? pn[n] : null;
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function Kn() {
|
|
558
558
|
try {
|
|
559
559
|
return process.env.NODE_ENV !== "production";
|
|
560
560
|
} catch {
|
|
561
561
|
return !1;
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
|
-
const
|
|
565
|
-
function
|
|
564
|
+
const bn = /* @__PURE__ */ new Set();
|
|
565
|
+
function Wn({ name: n, size: t = 18 }) {
|
|
566
566
|
if (n === "") return null;
|
|
567
567
|
const l = Ue(n);
|
|
568
|
-
return l !== null ? /* @__PURE__ */ e(
|
|
568
|
+
return l !== null ? /* @__PURE__ */ e($, { name: l, size: t }) : (!bn.has(n) && Kn() && (bn.add(n), console.warn(`@coolms/ui-react: no icon for the server's icon name "${n}"; its space is kept empty`)), /* @__PURE__ */ e("span", { className: "cms-icon cms-icon--blank", style: { width: t, height: t }, "aria-hidden": "true", "data-icon-name": n }));
|
|
569
569
|
}
|
|
570
|
-
const
|
|
571
|
-
function
|
|
572
|
-
if (typeof window > "u" || typeof getComputedStyle != "function") return
|
|
570
|
+
const Je = 300;
|
|
571
|
+
function Vn() {
|
|
572
|
+
if (typeof window > "u" || typeof getComputedStyle != "function") return Je;
|
|
573
573
|
const n = getComputedStyle(document.documentElement).getPropertyValue("--cms-state-delay").trim(), t = n.endsWith("ms") ? Number.parseFloat(n) : n.endsWith("s") ? Number.parseFloat(n) * 1e3 : Number.NaN;
|
|
574
|
-
return Number.isFinite(t) && t >= 0 ? t :
|
|
574
|
+
return Number.isFinite(t) && t >= 0 ? t : Je;
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function Zn() {
|
|
577
577
|
return /* @__PURE__ */ c("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
|
|
578
578
|
/* @__PURE__ */ e("circle", { className: "cms-state__track", cx: "12", cy: "12", r: "10", fill: "none" }),
|
|
579
579
|
/* @__PURE__ */ e("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
|
|
580
580
|
] });
|
|
581
581
|
}
|
|
582
|
-
function
|
|
583
|
-
const [
|
|
584
|
-
return
|
|
582
|
+
function Le({ kind: n, title: t, description: l, action: r, placement: s = "block", icon: a }) {
|
|
583
|
+
const [h, d] = D(n !== "loading");
|
|
584
|
+
return Q(() => {
|
|
585
585
|
if (n !== "loading") {
|
|
586
586
|
d(!0);
|
|
587
587
|
return;
|
|
588
588
|
}
|
|
589
589
|
d(!1);
|
|
590
|
-
const
|
|
591
|
-
return () => window.clearTimeout(
|
|
590
|
+
const m = window.setTimeout(() => d(!0), Vn());
|
|
591
|
+
return () => window.clearTimeout(m);
|
|
592
592
|
}, [n]), /* @__PURE__ */ c(
|
|
593
593
|
"div",
|
|
594
594
|
{
|
|
595
|
-
className:
|
|
595
|
+
className: F("cms-state", `cms-state--${n}`, `cms-state--${s}`, !h && "is-waiting"),
|
|
596
596
|
role: "status",
|
|
597
597
|
"aria-live": "polite",
|
|
598
598
|
"data-kind": n,
|
|
599
599
|
children: [
|
|
600
|
-
n === "loading" ? /* @__PURE__ */ e(
|
|
601
|
-
n === "error" || n === "denied" ? /* @__PURE__ */ e(
|
|
602
|
-
n === "empty" && a !== void 0 && Ue(a) !== null ? /* @__PURE__ */ e("span", { className: "cms-state__icon", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
600
|
+
n === "loading" ? /* @__PURE__ */ e(Zn, {}) : null,
|
|
601
|
+
n === "error" || n === "denied" ? /* @__PURE__ */ e(re, { name: n === "error" ? "warning" : "lock" }) : null,
|
|
602
|
+
n === "empty" && a !== void 0 && Ue(a) !== null ? /* @__PURE__ */ e("span", { className: "cms-state__icon", "aria-hidden": "true", children: /* @__PURE__ */ e(Wn, { name: a, size: s === "page" ? 32 : 24 }) }) : null,
|
|
603
603
|
/* @__PURE__ */ c("span", { className: "cms-state__text", children: [
|
|
604
604
|
/* @__PURE__ */ e("span", { className: "cms-state__title", children: t }),
|
|
605
605
|
l !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-state__description", children: l }) : null
|
|
606
606
|
] }),
|
|
607
|
-
r !== void 0 && n !== "denied" ? /* @__PURE__ */ e(
|
|
607
|
+
r !== void 0 && n !== "denied" ? /* @__PURE__ */ e(De, { className: "cms-state__action", onClick: r.onAction, children: r.label }) : null
|
|
608
608
|
]
|
|
609
609
|
}
|
|
610
610
|
);
|
|
611
611
|
}
|
|
612
|
-
const
|
|
613
|
-
function
|
|
612
|
+
const qn = 'input, select, textarea, button:not([disabled]), iframe, [href], [tabindex]:not([tabindex="-1"])', Gn = 60;
|
|
613
|
+
function jn(n) {
|
|
614
614
|
return n instanceof Element && n.closest('input, select, textarea, [contenteditable="true"], [data-viewer-keys]') !== null;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function Yn(n) {
|
|
617
617
|
return n instanceof Element && n.closest("[data-viewer-gestures]") !== null;
|
|
618
618
|
}
|
|
619
|
-
function
|
|
619
|
+
function Xn(n) {
|
|
620
620
|
return n.getClientRects().length > 0;
|
|
621
621
|
}
|
|
622
|
-
function
|
|
623
|
-
const { name: t, badge: l, closeLabel: r, onClose: s, actions: a = [], moreLabel:
|
|
624
|
-
|
|
625
|
-
var
|
|
626
|
-
const
|
|
627
|
-
return document.body.style.overflow = "hidden", (
|
|
628
|
-
var
|
|
629
|
-
document.body.style.overflow =
|
|
622
|
+
function jt(n) {
|
|
623
|
+
const { name: t, badge: l, closeLabel: r, onClose: s, actions: a = [], moreLabel: h = "More", edit: d, editing: m, state: b, siblings: i, bar: g, thumbnails: f, strip: v, onZoom: u, children: w } = n, S = P(null), A = P(null), x = fe(), [T, _] = D(!1), N = P(null);
|
|
624
|
+
Q(() => {
|
|
625
|
+
var U;
|
|
626
|
+
const k = document.activeElement, H = document.body.style.overflow;
|
|
627
|
+
return document.body.style.overflow = "hidden", (U = A.current) == null || U.focus(), () => {
|
|
628
|
+
var te;
|
|
629
|
+
document.body.style.overflow = H, (te = k == null ? void 0 : k.focus) == null || te.call(k);
|
|
630
630
|
};
|
|
631
631
|
}, []);
|
|
632
|
-
const
|
|
633
|
-
|
|
634
|
-
},
|
|
635
|
-
const
|
|
636
|
-
|
|
637
|
-
},
|
|
638
|
-
var
|
|
639
|
-
const
|
|
640
|
-
if (
|
|
641
|
-
const
|
|
642
|
-
Math.abs(
|
|
632
|
+
const I = () => {
|
|
633
|
+
m != null && m.dirty ? m.onDirtyClose() : s();
|
|
634
|
+
}, q = (k) => {
|
|
635
|
+
const H = k.touches.length === 1 ? k.touches[0] : void 0;
|
|
636
|
+
N.current = H === void 0 || m !== void 0 || Yn(k.target) ? null : { x: H.clientX, y: H.clientY };
|
|
637
|
+
}, V = (k) => {
|
|
638
|
+
var z, j;
|
|
639
|
+
const H = N.current, U = k.changedTouches[0];
|
|
640
|
+
if (N.current = null, H === null || U === void 0) return;
|
|
641
|
+
const te = U.clientX - H.x;
|
|
642
|
+
Math.abs(te) < Gn || Math.abs(te) < Math.abs(U.clientY - H.y) || (te > 0 ? (z = i == null ? void 0 : i.onPrevious) == null || z.call(i) : (j = i == null ? void 0 : i.onNext) == null || j.call(i));
|
|
643
643
|
};
|
|
644
|
-
return
|
|
644
|
+
return ln(
|
|
645
645
|
/* @__PURE__ */ c(
|
|
646
646
|
"div",
|
|
647
647
|
{
|
|
648
|
-
ref:
|
|
649
|
-
className:
|
|
648
|
+
ref: S,
|
|
649
|
+
className: F("cms-viewer", m !== void 0 && "is-editing"),
|
|
650
650
|
role: "dialog",
|
|
651
651
|
"aria-modal": "true",
|
|
652
652
|
"aria-labelledby": x,
|
|
653
653
|
tabIndex: -1,
|
|
654
|
-
onKeyDown: (
|
|
655
|
-
var
|
|
656
|
-
if (
|
|
657
|
-
if (
|
|
658
|
-
|
|
659
|
-
} else if (
|
|
660
|
-
const
|
|
661
|
-
if (
|
|
662
|
-
const j =
|
|
663
|
-
|
|
664
|
-
} else
|
|
654
|
+
onKeyDown: (k) => {
|
|
655
|
+
var H, U, te;
|
|
656
|
+
if (k.key === "Escape") {
|
|
657
|
+
if (m !== void 0) return;
|
|
658
|
+
k.stopPropagation(), T ? _(!1) : s();
|
|
659
|
+
} else if (k.key === "Tab") {
|
|
660
|
+
const z = Array.from(((H = S.current) == null ? void 0 : H.querySelectorAll(qn)) ?? []).filter(Xn);
|
|
661
|
+
if (z.length === 0) return;
|
|
662
|
+
const j = z[0], Y = z[z.length - 1];
|
|
663
|
+
k.shiftKey && document.activeElement === j ? (k.preventDefault(), Y.focus()) : !k.shiftKey && document.activeElement === Y && (k.preventDefault(), j.focus());
|
|
664
|
+
} else m === void 0 && !jn(k.target) && !k.ctrlKey && !k.metaKey && !k.altKey && (k.key === "ArrowLeft" ? (U = i == null ? void 0 : i.onPrevious) == null || U.call(i) : k.key === "ArrowRight" ? (te = i == null ? void 0 : i.onNext) == null || te.call(i) : k.key === "+" || k.key === "=" ? u == null || u("in") : k.key === "-" ? u == null || u("out") : k.key === "0" && (u == null || u("reset")));
|
|
665
665
|
},
|
|
666
666
|
children: [
|
|
667
667
|
i !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${t}, ${i.position}` }) : null,
|
|
668
668
|
/* @__PURE__ */ c("header", { className: "cms-viewer__top", children: [
|
|
669
|
-
/* @__PURE__ */ e("button", { ref:
|
|
669
|
+
/* @__PURE__ */ e("button", { ref: A, type: "button", className: "cms-viewer__icon", "aria-label": r, onClick: I, children: /* @__PURE__ */ e(re, { name: "close" }) }),
|
|
670
670
|
/* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: l }),
|
|
671
671
|
/* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: x, title: t, children: t }),
|
|
672
672
|
i !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: i.position }) : null,
|
|
673
673
|
/* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
|
|
674
|
-
|
|
675
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children:
|
|
676
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick:
|
|
677
|
-
] }) : /* @__PURE__ */ c(
|
|
678
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: a.map((
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
] },
|
|
674
|
+
m !== void 0 ? /* @__PURE__ */ c(B, { children: [
|
|
675
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: m.status }),
|
|
676
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: m.onDone, children: m.doneLabel })
|
|
677
|
+
] }) : /* @__PURE__ */ c(B, { children: [
|
|
678
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: a.map((k) => /* @__PURE__ */ c("button", { type: "button", className: "cms-viewer__button", onClick: k.onSelect, children: [
|
|
679
|
+
k.icon,
|
|
680
|
+
k.label
|
|
681
|
+
] }, k.label)) }),
|
|
682
682
|
d !== void 0 ? /* @__PURE__ */ c("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": d.label, onClick: d.onEdit, children: [
|
|
683
683
|
d.icon,
|
|
684
684
|
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: d.label })
|
|
685
685
|
] }) : null,
|
|
686
686
|
a.length > 0 ? /* @__PURE__ */ c("span", { className: "cms-viewer__more", children: [
|
|
687
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label":
|
|
688
|
-
|
|
687
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": h, "aria-expanded": T, onClick: () => _((k) => !k), children: /* @__PURE__ */ e($, { name: "more" }) }),
|
|
688
|
+
T ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: a.map((k) => /* @__PURE__ */ c(
|
|
689
689
|
"button",
|
|
690
690
|
{
|
|
691
691
|
type: "button",
|
|
692
692
|
className: "cms-viewer__button",
|
|
693
693
|
onClick: () => {
|
|
694
|
-
|
|
694
|
+
_(!1), k.onSelect();
|
|
695
695
|
},
|
|
696
696
|
children: [
|
|
697
|
-
|
|
698
|
-
|
|
697
|
+
k.icon,
|
|
698
|
+
k.label
|
|
699
699
|
]
|
|
700
700
|
},
|
|
701
|
-
|
|
701
|
+
k.label
|
|
702
702
|
)) }) : null
|
|
703
703
|
] }) : null
|
|
704
704
|
] })
|
|
705
705
|
] }),
|
|
706
706
|
/* @__PURE__ */ c("div", { className: "cms-viewer__body", children: [
|
|
707
|
-
|
|
708
|
-
/* @__PURE__ */ c("div", { className: "cms-viewer__content", onTouchStart:
|
|
709
|
-
(
|
|
710
|
-
/* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children:
|
|
711
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick:
|
|
712
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick:
|
|
707
|
+
f != null && m === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: f }) : null,
|
|
708
|
+
/* @__PURE__ */ c("div", { className: "cms-viewer__content", onTouchStart: q, onTouchEnd: V, children: [
|
|
709
|
+
(m == null ? void 0 : m.conflict) !== void 0 ? /* @__PURE__ */ c("div", { className: "cms-viewer__conflict", role: "alert", children: [
|
|
710
|
+
/* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children: m.conflict.message }),
|
|
711
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick: m.conflict.onOverwrite, children: m.conflict.overwriteLabel }),
|
|
712
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: m.conflict.onKeepBoth, children: m.conflict.keepBothLabel })
|
|
713
713
|
] }) : null,
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
714
|
+
b === void 0 ? w : /* @__PURE__ */ e(Jn, { state: b }),
|
|
715
|
+
m === void 0 && (i != null && i.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": i.previousLabel, title: i.previousLabel, onClick: i.onPrevious, children: /* @__PURE__ */ e(re, { name: "back" }) }) : null,
|
|
716
|
+
m === void 0 && (i != null && i.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": i.nextLabel, title: i.nextLabel, onClick: i.onNext, children: /* @__PURE__ */ e(re, { name: "back" }) }) : null,
|
|
717
|
+
m === void 0 && i !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(i.total, 7) }, (k, H) => /* @__PURE__ */ e("i", { className: H === Math.min(i.index, 6) ? "is-current" : void 0 }, H)) }) : null
|
|
718
718
|
] })
|
|
719
719
|
] }),
|
|
720
|
-
|
|
721
|
-
|
|
720
|
+
m === void 0 && v != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: v }) : null,
|
|
721
|
+
g != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: g }) : null
|
|
722
722
|
]
|
|
723
723
|
}
|
|
724
724
|
),
|
|
725
725
|
document.body
|
|
726
726
|
);
|
|
727
727
|
}
|
|
728
|
-
function
|
|
728
|
+
function Jn({ state: n }) {
|
|
729
729
|
switch (n.kind) {
|
|
730
730
|
case "loading":
|
|
731
|
-
return /* @__PURE__ */ e(
|
|
731
|
+
return /* @__PURE__ */ e(Le, { kind: "loading", title: n.title, placement: "page" });
|
|
732
732
|
case "error":
|
|
733
733
|
return /* @__PURE__ */ e(
|
|
734
|
-
|
|
734
|
+
Le,
|
|
735
735
|
{
|
|
736
736
|
kind: "error",
|
|
737
737
|
title: n.title,
|
|
@@ -742,7 +742,7 @@ function Xn({ state: n }) {
|
|
|
742
742
|
);
|
|
743
743
|
case "no-preview":
|
|
744
744
|
return /* @__PURE__ */ e(
|
|
745
|
-
|
|
745
|
+
Le,
|
|
746
746
|
{
|
|
747
747
|
kind: "empty",
|
|
748
748
|
title: n.title,
|
|
@@ -753,98 +753,98 @@ function Xn({ state: n }) {
|
|
|
753
753
|
);
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
|
-
class
|
|
756
|
+
class Qn extends Error {
|
|
757
757
|
constructor(t = "denied") {
|
|
758
758
|
super(t), this.name = "FilePickerDenied";
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
|
-
class
|
|
761
|
+
class et extends Error {
|
|
762
762
|
constructor(t = "restart") {
|
|
763
763
|
super(t), this.name = "FilePickerRestart";
|
|
764
764
|
}
|
|
765
765
|
}
|
|
766
|
-
const
|
|
767
|
-
${t}`,
|
|
768
|
-
function
|
|
769
|
-
var ne,
|
|
770
|
-
const { open: t, spaces: l, list: r, disabledReason: s, budget: a, formatSize:
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
}, [t, i,
|
|
774
|
-
const
|
|
775
|
-
|
|
766
|
+
const Xe = (n, t) => `${n}
|
|
767
|
+
${t}`, nt = (n, t) => n === "" ? t : `${n}/${t}`, tt = 48;
|
|
768
|
+
function Yt(n) {
|
|
769
|
+
var ne, ye;
|
|
770
|
+
const { open: t, spaces: l, list: r, disabledReason: s, budget: a, formatSize: h, labels: d, onConfirm: m, onCancel: b } = n, [i, g] = D(((ne = l[0]) == null ? void 0 : ne.id) ?? ""), [f, v] = D(""), [u, w] = D({ status: "loading" }), [S, A] = D(0), [x, T] = D(/* @__PURE__ */ new Map()), [_, N] = D(0), [I, q] = D(!1), V = P(null), k = P(!1);
|
|
771
|
+
Q(() => {
|
|
772
|
+
k.current = !1;
|
|
773
|
+
}, [t, i, f]);
|
|
774
|
+
const H = fe();
|
|
775
|
+
Q(() => {
|
|
776
776
|
var y;
|
|
777
|
-
t && (
|
|
778
|
-
}, [t]),
|
|
777
|
+
t && (g(((y = l[0]) == null ? void 0 : y.id) ?? ""), v(""), T(/* @__PURE__ */ new Map()), q(!1));
|
|
778
|
+
}, [t]), Q(() => {
|
|
779
779
|
if (!t || i === "") return;
|
|
780
780
|
let y = !0;
|
|
781
|
-
return w({ status: "loading" }),
|
|
782
|
-
(
|
|
783
|
-
(
|
|
781
|
+
return w({ status: "loading" }), N(0), r(i, f).then(
|
|
782
|
+
(C) => y && w({ status: "ready", entries: C.entries, next: C.next ?? null, paging: !1 }),
|
|
783
|
+
(C) => y && w({ status: C instanceof Qn ? "denied" : "error" })
|
|
784
784
|
), () => {
|
|
785
785
|
y = !1;
|
|
786
786
|
};
|
|
787
|
-
}, [t, i,
|
|
788
|
-
const
|
|
789
|
-
if (
|
|
790
|
-
const y =
|
|
791
|
-
w({ ...
|
|
792
|
-
(
|
|
793
|
-
|
|
787
|
+
}, [t, i, f, r, S]);
|
|
788
|
+
const U = Ie(() => {
|
|
789
|
+
if (u.status !== "ready" || u.next === null || u.paging) return;
|
|
790
|
+
const y = u.next, C = u.entries;
|
|
791
|
+
w({ ...u, paging: !0 }), r(i, f, y).then(
|
|
792
|
+
(K) => {
|
|
793
|
+
k.current = !1, w({ status: "ready", entries: [...C, ...K.entries], next: K.next ?? null, paging: !1 });
|
|
794
794
|
},
|
|
795
|
-
(
|
|
796
|
-
if (!(
|
|
797
|
-
w({ status: "ready", entries:
|
|
795
|
+
(K) => {
|
|
796
|
+
if (!(K instanceof et)) {
|
|
797
|
+
w({ status: "ready", entries: C, next: y, paging: !1 });
|
|
798
798
|
return;
|
|
799
799
|
}
|
|
800
|
-
if (
|
|
800
|
+
if (k.current) {
|
|
801
801
|
w({ status: "error" });
|
|
802
802
|
return;
|
|
803
803
|
}
|
|
804
|
-
|
|
804
|
+
k.current = !0, A((G) => G + 1);
|
|
805
805
|
}
|
|
806
806
|
);
|
|
807
|
-
}, [
|
|
808
|
-
var
|
|
809
|
-
return ((
|
|
810
|
-
}, [a]),
|
|
807
|
+
}, [u, r, i, f]), te = Ie((y) => {
|
|
808
|
+
var C;
|
|
809
|
+
return ((C = a == null ? void 0 : a.cost) == null ? void 0 : C.call(a, y)) ?? y.size ?? 0;
|
|
810
|
+
}, [a]), z = Ln(() => [...x.values()], [x]), j = z.reduce((y, C) => y + (C.size ?? 0), 0), Y = a === void 0 ? null : a.limitBytes - a.usedBytes - z.reduce((y, C) => y + te(C), 0), ee = Y !== null && Y < 0, ce = (y) => {
|
|
811
811
|
if (y.kind !== "file") return null;
|
|
812
|
-
const
|
|
813
|
-
return
|
|
812
|
+
const C = s == null ? void 0 : s(y);
|
|
813
|
+
return C || (Y !== null && !x.has(Xe(i, y.id)) && te(y) > Y ? d.overBudget : null);
|
|
814
814
|
}, _e = (y) => {
|
|
815
|
-
const
|
|
816
|
-
!x.has(
|
|
817
|
-
const
|
|
818
|
-
return
|
|
815
|
+
const C = Xe(i, y.id);
|
|
816
|
+
!x.has(C) && ce(y) !== null || T((K) => {
|
|
817
|
+
const G = new Map(K);
|
|
818
|
+
return G.has(C) ? G.delete(C) : G.set(C, { ...y, space: i, path: f }), G;
|
|
819
819
|
});
|
|
820
|
-
},
|
|
821
|
-
const
|
|
822
|
-
return
|
|
823
|
-
}),
|
|
824
|
-
const
|
|
820
|
+
}, oe = (y) => v(nt(f, y.name)), ue = () => v(f.includes("/") ? f.slice(0, f.lastIndexOf("/")) : ""), Ce = (y) => T((C) => {
|
|
821
|
+
const K = new Map(C);
|
|
822
|
+
return K.delete(y), K;
|
|
823
|
+
}), pe = u.status === "ready" ? u.entries : [], le = (y) => {
|
|
824
|
+
const C = pe[_];
|
|
825
825
|
if (y.key === "ArrowDown" || y.key === "ArrowUp" || y.key === "Home" || y.key === "End") {
|
|
826
826
|
y.preventDefault();
|
|
827
|
-
const
|
|
828
|
-
|
|
829
|
-
} else y.key === "Enter" && (
|
|
830
|
-
},
|
|
827
|
+
const K = pe.length - 1, G = y.key === "Home" ? 0 : y.key === "End" ? K : Math.min(K, Math.max(0, _ + (y.key === "ArrowDown" ? 1 : -1)));
|
|
828
|
+
N(G), G >= K - 1 && U();
|
|
829
|
+
} else y.key === "Enter" && (C == null ? void 0 : C.kind) === "folder" ? (y.preventDefault(), oe(C)) : y.key === " " && (C == null ? void 0 : C.kind) === "file" ? (y.preventDefault(), _e(C)) : y.key === "Backspace" && f !== "" && (y.preventDefault(), ue());
|
|
830
|
+
}, be = f === "" ? [] : f.split("/"), ve = ((ye = l.find((y) => y.id === i)) == null ? void 0 : ye.name) ?? "", we = (y) => `${H}-entry-${String(y)}`;
|
|
831
831
|
return /* @__PURE__ */ c(
|
|
832
|
-
|
|
832
|
+
kn,
|
|
833
833
|
{
|
|
834
834
|
open: t,
|
|
835
835
|
title: d.title,
|
|
836
|
-
onClose:
|
|
836
|
+
onClose: b,
|
|
837
837
|
closeLabel: d.close,
|
|
838
|
-
initialFocus:
|
|
838
|
+
initialFocus: V,
|
|
839
839
|
className: "cms-file-picker",
|
|
840
840
|
footer: /* @__PURE__ */ c("div", { className: "cms-file-picker__foot", children: [
|
|
841
841
|
/* @__PURE__ */ c("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
|
|
842
|
-
|
|
843
|
-
a !== void 0 &&
|
|
842
|
+
z.length > 0 ? /* @__PURE__ */ e("span", { children: d.total(z.length, h(j)) }) : null,
|
|
843
|
+
a !== void 0 && Y !== null ? /* @__PURE__ */ e("span", { className: F(ee && "is-over"), children: ee ? d.overBudget : d.left(h(Math.max(0, Y)), h(a.limitBytes)) }) : null
|
|
844
844
|
] }),
|
|
845
845
|
/* @__PURE__ */ c("div", { className: "cms-file-picker__actions", children: [
|
|
846
|
-
/* @__PURE__ */ e(
|
|
847
|
-
/* @__PURE__ */ e(
|
|
846
|
+
/* @__PURE__ */ e(De, { variant: "secondary", onClick: b, children: d.cancel }),
|
|
847
|
+
/* @__PURE__ */ e(De, { variant: "primary", disabled: z.length === 0 || ee, onClick: () => m(z), children: d.confirm(z.length) })
|
|
848
848
|
] })
|
|
849
849
|
] }),
|
|
850
850
|
children: [
|
|
@@ -852,80 +852,80 @@ function jt(n) {
|
|
|
852
852
|
l.length > 1 ? /* @__PURE__ */ c("label", { className: "cms-file-picker__space", children: [
|
|
853
853
|
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: d.space }),
|
|
854
854
|
/* @__PURE__ */ e("select", { className: "cms-input cms-select", value: i, onChange: (y) => {
|
|
855
|
-
|
|
855
|
+
g(y.target.value), v("");
|
|
856
856
|
}, children: l.map((y) => /* @__PURE__ */ e("option", { value: y.id, children: y.name }, y.id)) })
|
|
857
857
|
] }) : null,
|
|
858
858
|
/* @__PURE__ */ c("nav", { className: "cms-file-picker__path", "aria-label": d.path, children: [
|
|
859
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": d.up, disabled:
|
|
859
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": d.up, disabled: f === "", onClick: ue, children: /* @__PURE__ */ e($, { name: "chevron-left" }) }),
|
|
860
860
|
/* @__PURE__ */ c("ol", { children: [
|
|
861
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current":
|
|
862
|
-
|
|
863
|
-
const
|
|
864
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current":
|
|
861
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": f === "" ? "location" : void 0, onClick: () => v(""), children: ve }) }),
|
|
862
|
+
be.map((y, C) => {
|
|
863
|
+
const K = be.slice(0, C + 1).join("/");
|
|
864
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": K === f ? "location" : void 0, onClick: () => v(K), children: y }) }, K);
|
|
865
865
|
})
|
|
866
866
|
] })
|
|
867
867
|
] }),
|
|
868
|
-
|
|
868
|
+
z.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": I, onClick: () => q((y) => !y), children: d.selected(z.length) }) : null
|
|
869
869
|
] }),
|
|
870
|
-
|
|
871
|
-
/* @__PURE__ */ e("ul", { children: [...x.entries()].map(([y,
|
|
872
|
-
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children:
|
|
873
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": d.remove(
|
|
870
|
+
I && z.length > 0 ? /* @__PURE__ */ c("div", { className: "cms-file-picker__chosen", children: [
|
|
871
|
+
/* @__PURE__ */ e("ul", { children: [...x.entries()].map(([y, C]) => /* @__PURE__ */ c("li", { children: [
|
|
872
|
+
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: C.name }),
|
|
873
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": d.remove(C.name), onClick: () => Ce(y), children: /* @__PURE__ */ e(re, { name: "close" }) })
|
|
874
874
|
] }, y)) }),
|
|
875
|
-
/* @__PURE__ */ e(
|
|
876
|
-
|
|
875
|
+
/* @__PURE__ */ e(De, { variant: "secondary", onClick: () => {
|
|
876
|
+
T(/* @__PURE__ */ new Map()), q(!1);
|
|
877
877
|
}, children: d.clear })
|
|
878
878
|
] }) : null,
|
|
879
879
|
/* @__PURE__ */ c("div", { className: "cms-file-picker__list", onScroll: (y) => {
|
|
880
|
-
const
|
|
881
|
-
|
|
880
|
+
const C = y.currentTarget;
|
|
881
|
+
C.scrollTop + C.clientHeight >= C.scrollHeight - tt && U();
|
|
882
882
|
}, children: [
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
883
|
+
u.status === "loading" ? /* @__PURE__ */ e(Le, { kind: "loading", title: d.loading, placement: "block" }) : null,
|
|
884
|
+
u.status === "error" ? /* @__PURE__ */ e(Le, { kind: "error", title: d.error, placement: "block", action: { label: d.retry, onAction: () => {
|
|
885
|
+
k.current = !1, A((y) => y + 1);
|
|
886
886
|
} } }) : null,
|
|
887
|
-
|
|
888
|
-
|
|
887
|
+
u.status === "denied" ? /* @__PURE__ */ e(Le, { kind: "denied", title: d.denied, placement: "block" }) : null,
|
|
888
|
+
u.status === "ready" && pe.length === 0 ? /* @__PURE__ */ e(Le, { kind: "empty", title: d.empty, placement: "block" }) : null,
|
|
889
889
|
/* @__PURE__ */ c(
|
|
890
890
|
"div",
|
|
891
891
|
{
|
|
892
|
-
ref:
|
|
892
|
+
ref: V,
|
|
893
893
|
role: "listbox",
|
|
894
894
|
"aria-multiselectable": "true",
|
|
895
895
|
"aria-label": d.files,
|
|
896
|
-
"aria-activedescendant":
|
|
896
|
+
"aria-activedescendant": pe.length > 0 ? we(_) : void 0,
|
|
897
897
|
tabIndex: 0,
|
|
898
898
|
className: "cms-file-picker__entries",
|
|
899
|
-
hidden:
|
|
900
|
-
onKeyDown:
|
|
899
|
+
hidden: u.status !== "ready" || pe.length === 0,
|
|
900
|
+
onKeyDown: le,
|
|
901
901
|
children: [
|
|
902
|
-
|
|
903
|
-
const
|
|
902
|
+
pe.map((y, C) => {
|
|
903
|
+
const K = y.kind === "file" && x.has(Xe(i, y.id)), G = ce(y);
|
|
904
904
|
return /* @__PURE__ */ c(
|
|
905
905
|
"div",
|
|
906
906
|
{
|
|
907
|
-
id:
|
|
907
|
+
id: we(C),
|
|
908
908
|
role: "option",
|
|
909
|
-
"aria-selected": y.kind === "file" ?
|
|
910
|
-
"aria-disabled":
|
|
911
|
-
className:
|
|
909
|
+
"aria-selected": y.kind === "file" ? K : void 0,
|
|
910
|
+
"aria-disabled": G !== null || void 0,
|
|
911
|
+
className: F("cms-file-picker__entry", C === _ && "is-active", K && "is-ticked", G !== null && "is-disabled"),
|
|
912
912
|
onClick: () => {
|
|
913
|
-
|
|
913
|
+
N(C), y.kind === "folder" ? oe(y) : _e(y);
|
|
914
914
|
},
|
|
915
915
|
children: [
|
|
916
|
-
/* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children:
|
|
917
|
-
/* @__PURE__ */ e(
|
|
916
|
+
/* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: K ? /* @__PURE__ */ e($, { name: "check" }) : null }),
|
|
917
|
+
/* @__PURE__ */ e($, { name: y.kind === "folder" ? "folder" : "file" }),
|
|
918
918
|
/* @__PURE__ */ c("span", { className: "cms-file-picker__text", children: [
|
|
919
919
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: y.name }),
|
|
920
|
-
|
|
920
|
+
G !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: G }) : null
|
|
921
921
|
] }),
|
|
922
|
-
y.kind === "file" && y.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children:
|
|
922
|
+
y.kind === "file" && y.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: h(y.size) }) : null
|
|
923
923
|
]
|
|
924
924
|
},
|
|
925
925
|
y.id
|
|
926
926
|
);
|
|
927
927
|
}),
|
|
928
|
-
|
|
928
|
+
u.status === "ready" && u.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(Le, { kind: "loading", title: d.loading, placement: "inline" }) }) : null
|
|
929
929
|
]
|
|
930
930
|
}
|
|
931
931
|
)
|
|
@@ -934,163 +934,163 @@ function jt(n) {
|
|
|
934
934
|
}
|
|
935
935
|
);
|
|
936
936
|
}
|
|
937
|
-
const
|
|
938
|
-
function
|
|
937
|
+
const Qe = 64;
|
|
938
|
+
function lt(n, t) {
|
|
939
939
|
for (let l = n instanceof Element ? n : null; l !== null; l = l.parentElement) {
|
|
940
940
|
if (l instanceof HTMLElement && l.scrollTop > 0) return !1;
|
|
941
941
|
if (l === t) return !0;
|
|
942
942
|
}
|
|
943
943
|
return t.scrollTop <= 0;
|
|
944
944
|
}
|
|
945
|
-
function
|
|
946
|
-
const [l, r] =
|
|
947
|
-
return s.current = t,
|
|
945
|
+
function st(n, t) {
|
|
946
|
+
const [l, r] = D(0), s = P(t);
|
|
947
|
+
return s.current = t, Q(() => {
|
|
948
948
|
const a = n.current;
|
|
949
949
|
if (a === null) return;
|
|
950
|
-
let
|
|
951
|
-
const
|
|
952
|
-
|
|
953
|
-
},
|
|
954
|
-
if (
|
|
955
|
-
const
|
|
956
|
-
if (
|
|
957
|
-
|
|
950
|
+
let h = null, d = 0;
|
|
951
|
+
const m = (g) => {
|
|
952
|
+
h = lt(g.target, a) && g.touches.length === 1 ? g.touches[0].clientY : null, d = 0;
|
|
953
|
+
}, b = (g) => {
|
|
954
|
+
if (h === null || s.current === null) return;
|
|
955
|
+
const f = g.touches[0].clientY - h;
|
|
956
|
+
if (f <= 0) {
|
|
957
|
+
h = null, r(0);
|
|
958
958
|
return;
|
|
959
959
|
}
|
|
960
|
-
|
|
960
|
+
g.cancelable && g.preventDefault(), d = Math.min(f * 0.6, Qe * 1.5), r(d);
|
|
961
961
|
}, i = () => {
|
|
962
|
-
var
|
|
963
|
-
|
|
962
|
+
var g;
|
|
963
|
+
h !== null && d >= Qe && ((g = s.current) == null || g.call(s)), h = null, d = 0, r(0);
|
|
964
964
|
};
|
|
965
|
-
return a.addEventListener("touchstart",
|
|
966
|
-
a.removeEventListener("touchstart",
|
|
965
|
+
return a.addEventListener("touchstart", m, { passive: !0 }), a.addEventListener("touchmove", b, { passive: !1 }), a.addEventListener("touchend", i), a.addEventListener("touchcancel", i), () => {
|
|
966
|
+
a.removeEventListener("touchstart", m), a.removeEventListener("touchmove", b), a.removeEventListener("touchend", i), a.removeEventListener("touchcancel", i);
|
|
967
967
|
};
|
|
968
968
|
}, [n]), l;
|
|
969
969
|
}
|
|
970
|
-
const
|
|
971
|
-
function
|
|
972
|
-
return
|
|
973
|
-
}
|
|
974
|
-
function
|
|
975
|
-
const i =
|
|
976
|
-
if (l != null) return /* @__PURE__ */ e(
|
|
977
|
-
if (t === null) return /* @__PURE__ */ e(
|
|
978
|
-
if (t.length === 0) return /* @__PURE__ */ e(
|
|
979
|
-
const
|
|
980
|
-
var
|
|
981
|
-
if (
|
|
982
|
-
|
|
983
|
-
else if (
|
|
984
|
-
|
|
985
|
-
else if ((
|
|
986
|
-
|
|
987
|
-
const
|
|
988
|
-
|
|
970
|
+
const Mn = In(null);
|
|
971
|
+
function rt() {
|
|
972
|
+
return Dn(Mn);
|
|
973
|
+
}
|
|
974
|
+
function Xt({ label: n, rows: t, error: l, onRetry: r, loadingText: s = "Loading", emptyTitle: a = "Nothing here yet", emptyHint: h, selected: d, onOpen: m, onRowMenu: b }) {
|
|
975
|
+
const i = P([]), g = rt();
|
|
976
|
+
if (l != null) return /* @__PURE__ */ e(Un, { message: l, onRetry: r });
|
|
977
|
+
if (t === null) return /* @__PURE__ */ e(Pn, { what: s, layout: "block" });
|
|
978
|
+
if (t.length === 0) return /* @__PURE__ */ e(zn, { title: a, hint: h });
|
|
979
|
+
const f = (v, u, w) => {
|
|
980
|
+
var S;
|
|
981
|
+
if (v.key === "ArrowDown" || v.key === "ArrowUp")
|
|
982
|
+
v.preventDefault(), (S = i.current[Math.min(t.length - 1, Math.max(0, u + (v.key === "ArrowDown" ? 1 : -1)))]) == null || S.focus();
|
|
983
|
+
else if (v.key === "Enter")
|
|
984
|
+
m == null || m(w);
|
|
985
|
+
else if ((v.key === "ContextMenu" || v.shiftKey && v.key === "F10") && b) {
|
|
986
|
+
v.preventDefault();
|
|
987
|
+
const A = v.currentTarget.getBoundingClientRect();
|
|
988
|
+
b(w, { x: A.left + 16, y: A.bottom });
|
|
989
989
|
}
|
|
990
990
|
};
|
|
991
|
-
return /* @__PURE__ */ c(
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
991
|
+
return /* @__PURE__ */ c(B, { children: [
|
|
992
|
+
g !== null && (g.distance > 0 || g.refreshing) ? /* @__PURE__ */ c("div", { className: "cms-list__pull", role: "status", style: { height: g.refreshing ? void 0 : g.distance }, "data-ready": g.distance >= Qe ? "" : void 0, children: [
|
|
993
|
+
g.refreshing ? /* @__PURE__ */ e(re, { name: "spinner" }) : null,
|
|
994
|
+
g.text != null ? /* @__PURE__ */ e("span", { className: "cms-list__pull-text", children: g.text }) : null
|
|
995
995
|
] }) : null,
|
|
996
|
-
/* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: t.map((
|
|
997
|
-
const w =
|
|
996
|
+
/* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: t.map((v, u) => {
|
|
997
|
+
const w = v.id === d;
|
|
998
998
|
return /* @__PURE__ */ c(
|
|
999
999
|
"li",
|
|
1000
1000
|
{
|
|
1001
|
-
ref: (
|
|
1002
|
-
i.current[
|
|
1001
|
+
ref: (S) => {
|
|
1002
|
+
i.current[u] = S;
|
|
1003
1003
|
},
|
|
1004
1004
|
role: "option",
|
|
1005
1005
|
"aria-selected": w,
|
|
1006
|
-
tabIndex: w || d == null &&
|
|
1007
|
-
className:
|
|
1008
|
-
onClick: () =>
|
|
1009
|
-
onKeyDown: (
|
|
1010
|
-
onContextMenu:
|
|
1011
|
-
|
|
1006
|
+
tabIndex: w || d == null && u === 0 ? 0 : -1,
|
|
1007
|
+
className: F("cms-list__row", w && "is-selected"),
|
|
1008
|
+
onClick: () => m == null ? void 0 : m(v.id),
|
|
1009
|
+
onKeyDown: (S) => f(S, u, v.id),
|
|
1010
|
+
onContextMenu: b ? (S) => {
|
|
1011
|
+
S.preventDefault(), b(v.id, { x: S.clientX, y: S.clientY });
|
|
1012
1012
|
} : void 0,
|
|
1013
1013
|
children: [
|
|
1014
|
-
|
|
1014
|
+
v.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: v.lead }) : null,
|
|
1015
1015
|
/* @__PURE__ */ c("span", { className: "cms-list__text", children: [
|
|
1016
|
-
/* @__PURE__ */ e("span", { className:
|
|
1017
|
-
|
|
1016
|
+
/* @__PURE__ */ e("span", { className: F("cms-list__primary", v.unread === !0 && "is-unread"), children: v.primary }),
|
|
1017
|
+
v.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: v.secondary }) : null
|
|
1018
1018
|
] }),
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1019
|
+
v.meta != null || v.count !== void 0 ? /* @__PURE__ */ c("span", { className: "cms-list__end", children: [
|
|
1020
|
+
v.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: v.meta }) : null,
|
|
1021
|
+
v.count !== void 0 && v.count > 0 ? /* @__PURE__ */ e("span", { className: "cms-badge cms-list__count", children: v.count }) : null
|
|
1022
1022
|
] }) : null
|
|
1023
1023
|
]
|
|
1024
1024
|
},
|
|
1025
|
-
|
|
1025
|
+
v.id
|
|
1026
1026
|
);
|
|
1027
1027
|
}) })
|
|
1028
1028
|
] });
|
|
1029
1029
|
}
|
|
1030
1030
|
function Ke({ at: n, items: t, onClose: l, label: r = "Actions", focus: s = "current" }) {
|
|
1031
|
-
const a =
|
|
1032
|
-
if (
|
|
1031
|
+
const a = P(null), h = P(null), d = fe(), [m, b] = D(n), i = t.filter((u) => u.offer.offered);
|
|
1032
|
+
if ($e(() => {
|
|
1033
1033
|
if (!n) return;
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1036
|
-
}, [n]),
|
|
1037
|
-
var
|
|
1034
|
+
const u = a.current, w = (u == null ? void 0 : u.offsetWidth) ?? 0, S = (u == null ? void 0 : u.offsetHeight) ?? 0;
|
|
1035
|
+
b({ x: Math.max(0, Math.min(n.x, window.innerWidth - w)), y: Math.max(0, Math.min(n.y, window.innerHeight - S)) });
|
|
1036
|
+
}, [n]), Q(() => {
|
|
1037
|
+
var A, x;
|
|
1038
1038
|
if (!n) return;
|
|
1039
|
-
|
|
1040
|
-
const
|
|
1041
|
-
(x = s === "last" ?
|
|
1042
|
-
const
|
|
1043
|
-
var
|
|
1044
|
-
(
|
|
1039
|
+
h.current = document.activeElement;
|
|
1040
|
+
const u = Array.from(((A = a.current) == null ? void 0 : A.querySelectorAll('[role^="menuitem"]:not([aria-disabled="true"])')) ?? []), w = s === "current" ? u.find((T) => T.getAttribute("aria-checked") === "true") : void 0;
|
|
1041
|
+
(x = s === "last" ? u[u.length - 1] : w ?? u[0]) == null || x.focus();
|
|
1042
|
+
const S = (T) => {
|
|
1043
|
+
var _;
|
|
1044
|
+
(_ = a.current) != null && _.contains(T.target) || l();
|
|
1045
1045
|
};
|
|
1046
|
-
return document.addEventListener("mousedown",
|
|
1047
|
-
var
|
|
1048
|
-
document.removeEventListener("mousedown",
|
|
1046
|
+
return document.addEventListener("mousedown", S), () => {
|
|
1047
|
+
var T, _;
|
|
1048
|
+
document.removeEventListener("mousedown", S), (_ = (T = h.current) == null ? void 0 : T.focus) == null || _.call(T);
|
|
1049
1049
|
};
|
|
1050
1050
|
}, [n, l, s]), !n || i.length === 0) return null;
|
|
1051
|
-
const
|
|
1052
|
-
var
|
|
1053
|
-
const w = Array.from(((
|
|
1054
|
-
if (
|
|
1055
|
-
|
|
1056
|
-
else if (
|
|
1057
|
-
|
|
1058
|
-
const
|
|
1059
|
-
(x = w[(
|
|
1051
|
+
const g = (u) => {
|
|
1052
|
+
var A, x;
|
|
1053
|
+
const w = Array.from(((A = a.current) == null ? void 0 : A.querySelectorAll('[role^="menuitem"]')) ?? []), S = w.indexOf(document.activeElement);
|
|
1054
|
+
if (u.key === "Escape" || u.key === "Tab")
|
|
1055
|
+
u.preventDefault(), l();
|
|
1056
|
+
else if (u.key === "ArrowDown" || u.key === "ArrowUp") {
|
|
1057
|
+
u.preventDefault();
|
|
1058
|
+
const T = u.key === "ArrowDown" ? 1 : -1;
|
|
1059
|
+
(x = w[(S + T + w.length) % w.length]) == null || x.focus();
|
|
1060
1060
|
}
|
|
1061
|
-
},
|
|
1062
|
-
const w =
|
|
1061
|
+
}, f = (u) => {
|
|
1062
|
+
const w = u.offer.refusal !== void 0;
|
|
1063
1063
|
return /* @__PURE__ */ c(
|
|
1064
1064
|
"div",
|
|
1065
1065
|
{
|
|
1066
|
-
role:
|
|
1067
|
-
"aria-checked":
|
|
1066
|
+
role: u.checked === void 0 ? "menuitem" : "menuitemradio",
|
|
1067
|
+
"aria-checked": u.checked,
|
|
1068
1068
|
tabIndex: -1,
|
|
1069
1069
|
"aria-disabled": w || void 0,
|
|
1070
|
-
"aria-describedby": w ? `${d}-${
|
|
1071
|
-
title: w ?
|
|
1072
|
-
className:
|
|
1070
|
+
"aria-describedby": w ? `${d}-${u.id}` : void 0,
|
|
1071
|
+
title: w ? u.offer.refusal : void 0,
|
|
1072
|
+
className: F("cms-menu__item", u.danger && "is-danger", u.offer.locked && "is-locked", w && "is-refused"),
|
|
1073
1073
|
onClick: () => {
|
|
1074
|
-
w || (l(),
|
|
1074
|
+
w || (l(), u.onSelect());
|
|
1075
1075
|
},
|
|
1076
|
-
onKeyDown: (
|
|
1077
|
-
(
|
|
1076
|
+
onKeyDown: (S) => {
|
|
1077
|
+
(S.key === "Enter" || S.key === " ") && !w && (S.preventDefault(), l(), u.onSelect());
|
|
1078
1078
|
},
|
|
1079
1079
|
children: [
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
/* @__PURE__ */ e("span", { className: "cms-menu__label", children:
|
|
1083
|
-
w ? /* @__PURE__ */ e("span", { id: `${d}-${
|
|
1080
|
+
u.checked !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-menu__check", children: u.checked ? /* @__PURE__ */ e(re, { name: "check" }) : null }) : null,
|
|
1081
|
+
u.offer.locked ? /* @__PURE__ */ e(re, { name: "lock" }) : null,
|
|
1082
|
+
/* @__PURE__ */ e("span", { className: "cms-menu__label", children: u.label }),
|
|
1083
|
+
w ? /* @__PURE__ */ e("span", { id: `${d}-${u.id}`, className: "cms-menu__refusal", children: u.offer.refusal }) : null
|
|
1084
1084
|
]
|
|
1085
1085
|
},
|
|
1086
|
-
|
|
1086
|
+
u.id
|
|
1087
1087
|
);
|
|
1088
|
-
},
|
|
1089
|
-
for (const
|
|
1090
|
-
const w =
|
|
1091
|
-
w !== void 0 && w.group ===
|
|
1088
|
+
}, v = [];
|
|
1089
|
+
for (const u of i) {
|
|
1090
|
+
const w = v[v.length - 1];
|
|
1091
|
+
w !== void 0 && w.group === u.group ? w.items.push(u) : v.push({ group: u.group, items: [u] });
|
|
1092
1092
|
}
|
|
1093
|
-
return
|
|
1093
|
+
return ln(
|
|
1094
1094
|
/* @__PURE__ */ e(
|
|
1095
1095
|
"div",
|
|
1096
1096
|
{
|
|
@@ -1098,14 +1098,14 @@ function Ke({ at: n, items: t, onClose: l, label: r = "Actions", focus: s = "cur
|
|
|
1098
1098
|
className: "cms-menu",
|
|
1099
1099
|
role: "menu",
|
|
1100
1100
|
"aria-label": r,
|
|
1101
|
-
style: { left: (
|
|
1102
|
-
onKeyDown:
|
|
1103
|
-
onContextMenu: (
|
|
1104
|
-
children:
|
|
1101
|
+
style: { left: (m ?? n).x, top: (m ?? n).y },
|
|
1102
|
+
onKeyDown: g,
|
|
1103
|
+
onContextMenu: (u) => u.preventDefault(),
|
|
1104
|
+
children: v.map((u, w) => /* @__PURE__ */ c($n, { children: [
|
|
1105
1105
|
w > 0 ? /* @__PURE__ */ e("div", { className: "cms-menu__separator", role: "separator" }) : null,
|
|
1106
|
-
|
|
1107
|
-
/* @__PURE__ */ e("div", { className: "cms-menu__group", "aria-hidden": "true", children:
|
|
1108
|
-
|
|
1106
|
+
u.group === void 0 ? u.items.map(f) : /* @__PURE__ */ c("div", { role: "group", "aria-label": u.group, children: [
|
|
1107
|
+
/* @__PURE__ */ e("div", { className: "cms-menu__group", "aria-hidden": "true", children: u.group }),
|
|
1108
|
+
u.items.map(f)
|
|
1109
1109
|
] })
|
|
1110
1110
|
] }, w))
|
|
1111
1111
|
}
|
|
@@ -1113,269 +1113,269 @@ function Ke({ at: n, items: t, onClose: l, label: r = "Actions", focus: s = "cur
|
|
|
1113
1113
|
document.body
|
|
1114
1114
|
);
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1117
|
-
const [n, t] =
|
|
1118
|
-
if (!
|
|
1119
|
-
const i = new Set(
|
|
1120
|
-
return i.delete(
|
|
1116
|
+
function an() {
|
|
1117
|
+
const [n, t] = D(/* @__PURE__ */ new Set()), [l, r] = D(null), s = P(null), a = P(null), h = (m) => t((b) => b.has(m) ? b : /* @__PURE__ */ new Set([...b, m])), d = (m) => t((b) => {
|
|
1118
|
+
if (!b.has(m)) return b;
|
|
1119
|
+
const i = new Set(b);
|
|
1120
|
+
return i.delete(m), i;
|
|
1121
1121
|
});
|
|
1122
|
-
return
|
|
1122
|
+
return Q(() => {
|
|
1123
1123
|
if (l === null) return;
|
|
1124
|
-
const
|
|
1125
|
-
|
|
1124
|
+
const m = (b) => {
|
|
1125
|
+
b.key === "Escape" && h(l);
|
|
1126
1126
|
};
|
|
1127
|
-
return window.addEventListener("keydown",
|
|
1127
|
+
return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
|
|
1128
1128
|
}, [l]), {
|
|
1129
|
-
dismissed: (
|
|
1130
|
-
dismiss:
|
|
1129
|
+
dismissed: (m) => n.has(m),
|
|
1130
|
+
dismiss: h,
|
|
1131
1131
|
show: d,
|
|
1132
|
-
pointerIn: (
|
|
1133
|
-
a.current =
|
|
1132
|
+
pointerIn: (m) => {
|
|
1133
|
+
a.current = m, r(m);
|
|
1134
1134
|
},
|
|
1135
|
-
pointerOut: (
|
|
1136
|
-
a.current ===
|
|
1135
|
+
pointerOut: (m) => {
|
|
1136
|
+
a.current === m && (a.current = null), r((b) => b === m ? null : b), s.current !== m && d(m);
|
|
1137
1137
|
},
|
|
1138
|
-
focusIn: (
|
|
1139
|
-
s.current =
|
|
1138
|
+
focusIn: (m) => {
|
|
1139
|
+
s.current = m;
|
|
1140
1140
|
},
|
|
1141
|
-
focusOut: (
|
|
1142
|
-
s.current ===
|
|
1141
|
+
focusOut: (m) => {
|
|
1142
|
+
s.current === m && (s.current = null), a.current !== m && d(m);
|
|
1143
1143
|
}
|
|
1144
1144
|
};
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1146
|
+
function at(n, t, l) {
|
|
1147
1147
|
return Math.min(Math.max(n - l / 2, 0), Math.max(0, t - l));
|
|
1148
1148
|
}
|
|
1149
|
-
const
|
|
1150
|
-
function
|
|
1151
|
-
var
|
|
1152
|
-
const [i,
|
|
1153
|
-
...(a ?? []).map((
|
|
1154
|
-
id:
|
|
1155
|
-
label:
|
|
1156
|
-
name:
|
|
1157
|
-
icon:
|
|
1158
|
-
overflow:
|
|
1159
|
-
danger:
|
|
1160
|
-
offer:
|
|
1161
|
-
run:
|
|
1149
|
+
const _n = /* @__PURE__ */ new Set(), vn = { descriptionHidden: !1, elsewhereHidden: !1, titleCut: !1, titleFloor: 0, bare: _n, primaryBare: !1, hidden: _n, primaryHidden: !1, chipsCut: !1 }, gn = (n, t) => n.size === t.size && [...n].every((l) => t.has(l)), it = (n, t) => n.descriptionHidden === t.descriptionHidden && n.elsewhereHidden === t.elsewhereHidden && n.titleCut === t.titleCut && n.titleFloor === t.titleFloor && gn(n.bare, t.bare) && n.primaryBare === t.primaryBare && gn(n.hidden, t.hidden) && n.primaryHidden === t.primaryHidden && n.chipsCut === t.chipsCut, ct = 64, Ae = "primary";
|
|
1150
|
+
function Jt({ title: n, icon: t, description: l, meta: r = [], primary: s, secondary: a, more: h = [], moreLabel: d, context: m, fullWidth: b = !1 }) {
|
|
1151
|
+
var X, Ne, de;
|
|
1152
|
+
const [i, g] = D(null), [f, v] = D(vn), [u, w] = D(null), [S, A] = D(null), x = an(), T = P(null), _ = P(null), N = P(null), I = fe(), q = fe(), V = [
|
|
1153
|
+
...(a ?? []).map((o) => ({
|
|
1154
|
+
id: o.id,
|
|
1155
|
+
label: o.label,
|
|
1156
|
+
name: o.label,
|
|
1157
|
+
icon: o.icon === void 0 ? null : Ue(o.icon),
|
|
1158
|
+
overflow: o.overflow,
|
|
1159
|
+
danger: o.danger === !0,
|
|
1160
|
+
offer: o.offer ?? { offered: !0, locked: !1 },
|
|
1161
|
+
run: o.onPress
|
|
1162
1162
|
})),
|
|
1163
|
-
...
|
|
1164
|
-
id:
|
|
1165
|
-
label:
|
|
1166
|
-
name: typeof
|
|
1163
|
+
...h.map((o) => ({
|
|
1164
|
+
id: o.id,
|
|
1165
|
+
label: o.label,
|
|
1166
|
+
name: typeof o.label == "string" ? o.label : o.id,
|
|
1167
1167
|
icon: null,
|
|
1168
1168
|
overflow: void 0,
|
|
1169
|
-
danger:
|
|
1170
|
-
offer:
|
|
1171
|
-
run:
|
|
1169
|
+
danger: o.danger === !0,
|
|
1170
|
+
offer: o.offer,
|
|
1171
|
+
run: o.onSelect
|
|
1172
1172
|
}))
|
|
1173
|
-
].filter((
|
|
1173
|
+
].filter((o) => o.offer.offered), k = V.filter((o) => o.overflow === 0), H = V.filter((o) => o.overflow !== 0), U = k.length === 1 ? k[0] ?? null : null, te = ot(H), z = H.filter((o) => o.overflow === void 0).map((o) => o.id).reverse(), j = [...te, ...z.map((o) => [o])], Y = [...U !== null ? [[U.id]] : [], ...j], ee = s !== void 0 && ((X = s.offer) == null ? void 0 : X.offered) !== !1, ce = (Ne = s == null ? void 0 : s.offer) == null ? void 0 : Ne.refusal, _e = s !== void 0 && (((de = s.offer) == null ? void 0 : de.offered) === !1 || ce !== void 0), oe = s !== void 0 && "menu" in s ? s.menu.filter((o) => o.offer.offered) : [], ue = s !== void 0 && "menu" in s && oe.length > 0 ? s : null, Ce = r.filter((o) => o.elsewhere === !0), pe = JSON.stringify([
|
|
1174
1174
|
n,
|
|
1175
1175
|
t ?? null,
|
|
1176
1176
|
l ?? null,
|
|
1177
|
-
r.map((
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
]),
|
|
1181
|
-
const
|
|
1182
|
-
if (
|
|
1183
|
-
const
|
|
1177
|
+
r.map((o) => [o.id, o.text, o.elsewhere === !0]),
|
|
1178
|
+
ee ? [s.label, s.icon, ue !== null] : null,
|
|
1179
|
+
V.map((o) => [o.id, o.name, o.icon, o.overflow ?? null])
|
|
1180
|
+
]), le = Ie(() => {
|
|
1181
|
+
const o = T.current, E = _.current;
|
|
1182
|
+
if (o === null || E === null) return;
|
|
1183
|
+
const M = getComputedStyle(o), O = parseFloat(M.columnGap || "0") || 0, se = o.clientWidth - (parseFloat(M.paddingLeft) || 0) - (parseFloat(M.paddingRight) || 0), J = (ie) => {
|
|
1184
1184
|
var Me;
|
|
1185
|
-
return ((Me = E.querySelector(
|
|
1186
|
-
},
|
|
1187
|
-
const Me =
|
|
1188
|
-
t !== void 0 &&
|
|
1189
|
-
for (const
|
|
1190
|
-
for (const
|
|
1191
|
-
if (Me.has(
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1185
|
+
return ((Me = E.querySelector(ie)) == null ? void 0 : Me.getBoundingClientRect().width) ?? 0;
|
|
1186
|
+
}, ke = J('[data-measure="title"]'), Fe = Math.min(ke, ct), He = (ie) => {
|
|
1187
|
+
const Me = be(ie), xe = [];
|
|
1188
|
+
t !== void 0 && xe.push(J('[data-measure="lead"]')), xe.push(ie.titleCut ? Fe : ke), l !== void 0 && !ie.descriptionHidden && xe.push(J('[data-measure="description"]'));
|
|
1189
|
+
for (const ge of r) ge.elsewhere === !0 && ie.elsewhereHidden || xe.push(J(`[data-measure="meta"][data-measure-id="${CSS.escape(ge.id)}"]`));
|
|
1190
|
+
for (const ge of V) {
|
|
1191
|
+
if (Me.has(ge.id)) continue;
|
|
1192
|
+
const Ve = ie.bare.has(ge.id) && ge.icon !== null;
|
|
1193
|
+
xe.push(J(`[data-measure="${Ve ? "icon" : "full"}"][data-measure-id="${CSS.escape(ge.id)}"]`));
|
|
1194
1194
|
}
|
|
1195
|
-
return
|
|
1195
|
+
return ee && !ie.primaryHidden && xe.push(J(`[data-measure="${ie.primaryBare ? "primary-icon" : "primary"}"]`)), Me.size > 0 && xe.push(J('[data-measure="more"]')), xe.reduce((ge, Ve) => ge + Ve, 0) + O * Math.max(0, xe.length - 1);
|
|
1196
1196
|
};
|
|
1197
|
-
let
|
|
1198
|
-
const
|
|
1199
|
-
if (
|
|
1200
|
-
|
|
1201
|
-
const
|
|
1202
|
-
for (const
|
|
1203
|
-
for (const
|
|
1204
|
-
if (
|
|
1197
|
+
let Z = { ...vn, titleFloor: Fe };
|
|
1198
|
+
const Re = (ie) => (Z = ie, He(ie) <= se), mn = (() => {
|
|
1199
|
+
if (Re(Z) || l !== void 0 && Re({ ...Z, descriptionHidden: !0 }) || (Z = { ...Z, descriptionHidden: !0 }, Ce.length > 0 && Re({ ...Z, elsewhereHidden: !0 }))) return Z;
|
|
1200
|
+
Z = { ...Z, elsewhereHidden: !0 };
|
|
1201
|
+
const ie = /* @__PURE__ */ new Set();
|
|
1202
|
+
for (const Ze of Y) {
|
|
1203
|
+
for (const Ge of Ze) ie.add(Ge);
|
|
1204
|
+
if (Re({ ...Z, bare: new Set(ie) })) return Z;
|
|
1205
1205
|
}
|
|
1206
|
-
if (
|
|
1207
|
-
|
|
1208
|
-
const Me = /* @__PURE__ */ new Set(),
|
|
1209
|
-
for (const
|
|
1210
|
-
for (const
|
|
1211
|
-
if (
|
|
1212
|
-
|
|
1206
|
+
if (ee && Re({ ...Z, primaryBare: !0 })) return Z;
|
|
1207
|
+
Z = { ...Z, primaryBare: ee };
|
|
1208
|
+
const Me = /* @__PURE__ */ new Set(), xe = [...j, ...ee ? [[Ae]] : []], ge = () => Me.size + k.length >= 2, Ve = (Ze) => ({ ...Z, hidden: new Set([...Ze].filter((Ge) => Ge !== Ae)), primaryHidden: Ze.has(Ae) }), hn = Z;
|
|
1209
|
+
for (const Ze of xe) {
|
|
1210
|
+
for (const Ge of Ze) Me.add(Ge);
|
|
1211
|
+
if (ge() && Re(Ve(Me))) return Z;
|
|
1212
|
+
Z = hn;
|
|
1213
1213
|
}
|
|
1214
|
-
const
|
|
1215
|
-
return
|
|
1214
|
+
const fn = ge() ? Ve(Me) : hn;
|
|
1215
|
+
return Re({ ...fn, titleCut: !0 }) ? Z : { ...fn, titleCut: !0, chipsCut: !0 };
|
|
1216
1216
|
})();
|
|
1217
|
-
|
|
1218
|
-
}, [
|
|
1219
|
-
|
|
1220
|
-
const
|
|
1221
|
-
if (
|
|
1222
|
-
const E = new ResizeObserver(() =>
|
|
1223
|
-
return E.observe(
|
|
1224
|
-
}, [
|
|
1225
|
-
const
|
|
1226
|
-
if (
|
|
1217
|
+
v((ie) => it(ie, mn) ? ie : mn);
|
|
1218
|
+
}, [pe]);
|
|
1219
|
+
$e(le, [le]), Q(() => {
|
|
1220
|
+
const o = T.current;
|
|
1221
|
+
if (o === null || typeof ResizeObserver > "u") return;
|
|
1222
|
+
const E = new ResizeObserver(() => le());
|
|
1223
|
+
return E.observe(o), () => E.disconnect();
|
|
1224
|
+
}, [le]), Q(() => {
|
|
1225
|
+
const o = typeof document > "u" ? void 0 : document.fonts;
|
|
1226
|
+
if (o === void 0) return;
|
|
1227
1227
|
let E = !0;
|
|
1228
|
-
const
|
|
1229
|
-
E &&
|
|
1228
|
+
const M = () => {
|
|
1229
|
+
E && le();
|
|
1230
1230
|
};
|
|
1231
|
-
return
|
|
1232
|
-
E = !1,
|
|
1231
|
+
return o.ready.then(M), o.addEventListener("loadingdone", M), () => {
|
|
1232
|
+
E = !1, o.removeEventListener("loadingdone", M);
|
|
1233
1233
|
};
|
|
1234
|
-
}, [
|
|
1235
|
-
function
|
|
1236
|
-
const E =
|
|
1237
|
-
return /* @__PURE__ */ new Set([...
|
|
1234
|
+
}, [le]);
|
|
1235
|
+
function be(o) {
|
|
1236
|
+
const E = o.hidden.size + (o.primaryHidden ? 1 : 0);
|
|
1237
|
+
return /* @__PURE__ */ new Set([...k.filter((M) => M !== U || E > 0).map((M) => M.id), ...o.hidden, ...o.primaryHidden ? [Ae] : []]);
|
|
1238
1238
|
}
|
|
1239
|
-
const
|
|
1240
|
-
...
|
|
1239
|
+
const ve = be(f), we = V.filter((o) => !ve.has(o.id) && o !== U), ne = U !== null && !ve.has(U.id) ? U : null, ye = ee && !f.primaryHidden, y = (o) => V.find((E) => E.id === o), C = j.flat().filter((o) => f.hidden.has(o)).map(y).filter((o) => o !== void 0), K = (o) => ({ id: o.id, label: o.label, offer: o.offer, ...o.danger ? { danger: !0 } : {}, onSelect: o.run }), G = [
|
|
1240
|
+
...ee && f.primaryHidden ? [{ id: Ae, label: s.label, offer: s.offer ?? { offered: !0, locked: !1 }, onSelect: () => {
|
|
1241
1241
|
_e || s.onPress();
|
|
1242
|
-
} }, ...
|
|
1243
|
-
...
|
|
1244
|
-
...
|
|
1245
|
-
], p =
|
|
1246
|
-
...
|
|
1242
|
+
} }, ...oe] : [],
|
|
1243
|
+
...C.map(K),
|
|
1244
|
+
...ve.size > 0 ? k.map(K) : []
|
|
1245
|
+
], p = G.length > 0, L = [
|
|
1246
|
+
...we.map((o) => o.id),
|
|
1247
1247
|
...ne !== null ? [ne.id] : [],
|
|
1248
|
-
...
|
|
1248
|
+
...ye ? [Ae, ...ue !== null ? ["primary-menu"] : []] : [],
|
|
1249
1249
|
...p ? ["more"] : []
|
|
1250
|
-
],
|
|
1251
|
-
|
|
1252
|
-
var
|
|
1253
|
-
|
|
1254
|
-
}, [
|
|
1255
|
-
const
|
|
1256
|
-
var
|
|
1257
|
-
const E = L.indexOf(
|
|
1258
|
-
let
|
|
1259
|
-
if (
|
|
1260
|
-
|
|
1261
|
-
const
|
|
1262
|
-
w(
|
|
1263
|
-
},
|
|
1264
|
-
const
|
|
1265
|
-
|
|
1266
|
-
},
|
|
1267
|
-
...
|
|
1268
|
-
...x.dismissed(
|
|
1269
|
-
onFocus: (
|
|
1270
|
-
w(
|
|
1250
|
+
], W = u !== null && L.includes(u) ? u : L[0] ?? null;
|
|
1251
|
+
Q(() => {
|
|
1252
|
+
var o, E;
|
|
1253
|
+
u === null || L.includes(u) || !p || ((o = T.current) != null && o.contains(document.activeElement) || document.activeElement === document.body) && (w("more"), (E = N.current) == null || E.focus());
|
|
1254
|
+
}, [f]);
|
|
1255
|
+
const me = (o) => `${q}-${o}`, ae = (o) => {
|
|
1256
|
+
var se;
|
|
1257
|
+
const E = L.indexOf(W ?? "");
|
|
1258
|
+
let M = null;
|
|
1259
|
+
if (o.key === "ArrowRight" ? M = Math.min(L.length - 1, E + 1) : o.key === "ArrowLeft" ? M = Math.max(0, E - 1) : o.key === "Home" ? M = 0 : o.key === "End" && (M = L.length - 1), M === null) return;
|
|
1260
|
+
o.preventDefault();
|
|
1261
|
+
const O = L[M] ?? null;
|
|
1262
|
+
w(O), O !== null && ((se = document.getElementById(me(O))) == null || se.focus());
|
|
1263
|
+
}, he = (o, E) => {
|
|
1264
|
+
const M = E.getBoundingClientRect();
|
|
1265
|
+
g((i == null ? void 0 : i.which) === o ? null : { which: o, x: M.left, y: M.bottom + 4 });
|
|
1266
|
+
}, Se = (o) => ({ id: me(o), tabIndex: W === o ? 0 : -1, onFocus: () => w(o) }), We = (o, E, M) => E ? {
|
|
1267
|
+
...S === o ? { "data-reason-shown": "" } : {},
|
|
1268
|
+
...x.dismissed(o) ? { "data-tip-dismissed": "" } : {},
|
|
1269
|
+
onFocus: (O) => {
|
|
1270
|
+
w(o), x.focusIn(o), Te(O.currentTarget, M);
|
|
1271
1271
|
},
|
|
1272
1272
|
onBlur: () => {
|
|
1273
|
-
|
|
1273
|
+
A((O) => O === o ? null : O), x.focusOut(o);
|
|
1274
1274
|
},
|
|
1275
|
-
onMouseEnter: (
|
|
1276
|
-
x.pointerIn(
|
|
1275
|
+
onMouseEnter: (O) => {
|
|
1276
|
+
x.pointerIn(o), Te(O.currentTarget, M);
|
|
1277
1277
|
},
|
|
1278
|
-
onMouseLeave: () => x.pointerOut(
|
|
1279
|
-
onKeyDown: (
|
|
1280
|
-
|
|
1278
|
+
onMouseLeave: () => x.pointerOut(o),
|
|
1279
|
+
onKeyDown: (O) => {
|
|
1280
|
+
O.key === "Escape" && (A((se) => se === o ? null : se), x.dismiss(o));
|
|
1281
1281
|
}
|
|
1282
|
-
} : {},
|
|
1283
|
-
|
|
1284
|
-
},
|
|
1285
|
-
const
|
|
1286
|
-
if (
|
|
1287
|
-
const
|
|
1288
|
-
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1291
|
-
const
|
|
1292
|
-
|
|
1293
|
-
},
|
|
1294
|
-
|
|
1295
|
-
|
|
1282
|
+
} : {}, Be = (o, E, M) => {
|
|
1283
|
+
A(o), x.show(o), Te(E, M);
|
|
1284
|
+
}, Te = (o, E) => {
|
|
1285
|
+
const M = document.getElementById(E), O = T.current;
|
|
1286
|
+
if (M === null || O === null) return;
|
|
1287
|
+
const se = M.style.display;
|
|
1288
|
+
M.style.display = "block";
|
|
1289
|
+
const J = M.offsetWidth;
|
|
1290
|
+
M.style.display = se;
|
|
1291
|
+
const ke = O.getBoundingClientRect(), Fe = o.getBoundingClientRect();
|
|
1292
|
+
M.style.left = `${String(at(Fe.left + Fe.width / 2 - ke.left, ke.width, J))}px`, M.style.right = "auto";
|
|
1293
|
+
}, Ee = (o, E, M) => /* @__PURE__ */ c("span", { id: o, className: "cms-section-header__tip", role: "tooltip", children: [
|
|
1294
|
+
M !== null ? /* @__PURE__ */ c("span", { "aria-hidden": "true", children: [
|
|
1295
|
+
M,
|
|
1296
1296
|
": "
|
|
1297
1297
|
] }) : null,
|
|
1298
1298
|
E
|
|
1299
|
-
] }),
|
|
1300
|
-
const E =
|
|
1299
|
+
] }), R = (o) => {
|
|
1300
|
+
const E = f.bare.has(o.id) && o.icon !== null, M = o.offer.refusal, O = `${q}-reason-${o.id}`;
|
|
1301
1301
|
return /* @__PURE__ */ c(
|
|
1302
1302
|
"button",
|
|
1303
1303
|
{
|
|
1304
1304
|
type: "button",
|
|
1305
|
-
className:
|
|
1306
|
-
"data-action":
|
|
1307
|
-
"aria-label": E ||
|
|
1308
|
-
"aria-disabled":
|
|
1309
|
-
"aria-describedby":
|
|
1310
|
-
title:
|
|
1311
|
-
...
|
|
1312
|
-
...
|
|
1313
|
-
onClick: (
|
|
1314
|
-
|
|
1305
|
+
className: F("cms-button", "cms-button--quiet", "cms-section-header__secondary", E && "cms-section-header__secondary--bare", o.danger && "is-danger"),
|
|
1306
|
+
"data-action": o.id,
|
|
1307
|
+
"aria-label": E || M !== void 0 ? o.name : void 0,
|
|
1308
|
+
"aria-disabled": M !== void 0 ? "true" : void 0,
|
|
1309
|
+
"aria-describedby": M !== void 0 ? O : void 0,
|
|
1310
|
+
title: M === void 0 && E ? o.name : void 0,
|
|
1311
|
+
...Se(o.id),
|
|
1312
|
+
...We(o.id, M !== void 0, O),
|
|
1313
|
+
onClick: (se) => {
|
|
1314
|
+
M === void 0 ? o.run() : Be(o.id, se.currentTarget, O);
|
|
1315
1315
|
},
|
|
1316
1316
|
children: [
|
|
1317
|
-
|
|
1318
|
-
E ? null : /* @__PURE__ */ e("span", { className: "cms-section-header__label", children:
|
|
1319
|
-
|
|
1317
|
+
o.icon !== null ? /* @__PURE__ */ e($, { name: o.icon, size: 18 }) : null,
|
|
1318
|
+
E ? null : /* @__PURE__ */ e("span", { className: "cms-section-header__label", children: o.label }),
|
|
1319
|
+
M !== void 0 ? Ee(O, M, E ? o.name : null) : null
|
|
1320
1320
|
]
|
|
1321
1321
|
},
|
|
1322
|
-
|
|
1322
|
+
o.id
|
|
1323
1323
|
);
|
|
1324
1324
|
};
|
|
1325
|
-
return /* @__PURE__ */ c("header", { className:
|
|
1326
|
-
/* @__PURE__ */ c("div", { ref:
|
|
1327
|
-
t !== void 0 ? /* @__PURE__ */ e(
|
|
1325
|
+
return /* @__PURE__ */ c("header", { className: F("cms-section-header", b && "cms-section-header--full"), children: [
|
|
1326
|
+
/* @__PURE__ */ c("div", { ref: T, className: F("cms-section-header__row", f.chipsCut && "cms-section-header__row--chips-cut"), "data-row": "1", children: [
|
|
1327
|
+
t !== void 0 ? /* @__PURE__ */ e($, { name: t }) : null,
|
|
1328
1328
|
/* @__PURE__ */ e(
|
|
1329
1329
|
"h1",
|
|
1330
1330
|
{
|
|
1331
1331
|
className: "cms-section-header__title",
|
|
1332
1332
|
title: n,
|
|
1333
|
-
style: { minWidth:
|
|
1333
|
+
style: { minWidth: f.titleCut ? `${f.titleFloor}px` : "max-content" },
|
|
1334
1334
|
children: n
|
|
1335
1335
|
}
|
|
1336
1336
|
),
|
|
1337
|
-
l !== void 0 ? /* @__PURE__ */ e("span", { className:
|
|
1338
|
-
r.map((
|
|
1337
|
+
l !== void 0 ? /* @__PURE__ */ e("span", { className: F("cms-section-header__description", f.descriptionHidden && "cms-visually-hidden"), children: l }) : null,
|
|
1338
|
+
r.map((o, E) => /* @__PURE__ */ e(
|
|
1339
1339
|
"span",
|
|
1340
1340
|
{
|
|
1341
1341
|
className: "cms-section-header__meta",
|
|
1342
|
-
"data-meta":
|
|
1343
|
-
hidden:
|
|
1344
|
-
style:
|
|
1345
|
-
...
|
|
1346
|
-
children:
|
|
1342
|
+
"data-meta": o.id,
|
|
1343
|
+
hidden: o.elsewhere === !0 && f.elsewhereHidden,
|
|
1344
|
+
style: f.chipsCut && o.elsewhere !== !0 ? { flexShrink: E + 1 } : void 0,
|
|
1345
|
+
...f.chipsCut && o.elsewhere !== !0 ? { title: o.text, "aria-label": o.text } : {},
|
|
1346
|
+
children: o.content
|
|
1347
1347
|
},
|
|
1348
|
-
|
|
1348
|
+
o.id
|
|
1349
1349
|
)),
|
|
1350
|
-
/* @__PURE__ */ c("div", { className: "cms-section-header__actions", role: "toolbar", "aria-label": n, onKeyDown:
|
|
1351
|
-
|
|
1352
|
-
ne !== null ?
|
|
1353
|
-
|
|
1350
|
+
/* @__PURE__ */ c("div", { className: "cms-section-header__actions", role: "toolbar", "aria-label": n, onKeyDown: ae, children: [
|
|
1351
|
+
we.map(R),
|
|
1352
|
+
ne !== null ? R(ne) : null,
|
|
1353
|
+
ye ? /* @__PURE__ */ c("span", { className: F("cms-section-header__primary", ue !== null && "cms-section-header__primary--split"), children: [
|
|
1354
1354
|
/* @__PURE__ */ c(
|
|
1355
1355
|
"button",
|
|
1356
1356
|
{
|
|
1357
1357
|
type: "button",
|
|
1358
|
-
className:
|
|
1358
|
+
className: F("cms-button", "cms-button--primary", f.primaryBare && "cms-section-header__primary--bare"),
|
|
1359
1359
|
"data-action": "primary",
|
|
1360
|
-
"aria-label":
|
|
1360
|
+
"aria-label": f.primaryBare ? s.label : void 0,
|
|
1361
1361
|
"aria-disabled": _e ? "true" : void 0,
|
|
1362
|
-
"aria-describedby": ce !== void 0 ?
|
|
1363
|
-
title:
|
|
1364
|
-
...
|
|
1365
|
-
...
|
|
1366
|
-
onClick: (
|
|
1367
|
-
_e ? ce !== void 0 &&
|
|
1362
|
+
"aria-describedby": ce !== void 0 ? I : void 0,
|
|
1363
|
+
title: f.primaryBare && ce === void 0 ? s.label : void 0,
|
|
1364
|
+
...Se(Ae),
|
|
1365
|
+
...We(Ae, ce !== void 0, I),
|
|
1366
|
+
onClick: (o) => {
|
|
1367
|
+
_e ? ce !== void 0 && Be(Ae, o.currentTarget, I) : s.onPress();
|
|
1368
1368
|
},
|
|
1369
1369
|
children: [
|
|
1370
|
-
/* @__PURE__ */ e(
|
|
1371
|
-
|
|
1370
|
+
/* @__PURE__ */ e($, { name: s.icon }),
|
|
1371
|
+
f.primaryBare ? null : /* @__PURE__ */ c(B, { children: [
|
|
1372
1372
|
" ",
|
|
1373
1373
|
/* @__PURE__ */ e("span", { children: s.label })
|
|
1374
1374
|
] })
|
|
1375
1375
|
]
|
|
1376
1376
|
}
|
|
1377
1377
|
),
|
|
1378
|
-
|
|
1378
|
+
ue !== null ? /* @__PURE__ */ e(
|
|
1379
1379
|
"button",
|
|
1380
1380
|
{
|
|
1381
1381
|
type: "button",
|
|
@@ -1383,18 +1383,18 @@ function Xt({ title: n, icon: t, description: l, meta: r = [], primary: s, secon
|
|
|
1383
1383
|
"data-action": "primary-menu",
|
|
1384
1384
|
"aria-haspopup": "menu",
|
|
1385
1385
|
"aria-expanded": (i == null ? void 0 : i.which) === "primary",
|
|
1386
|
-
"aria-label":
|
|
1387
|
-
...
|
|
1388
|
-
onClick: (
|
|
1389
|
-
children: /* @__PURE__ */ e(
|
|
1386
|
+
"aria-label": ue.menuLabel,
|
|
1387
|
+
...Se("primary-menu"),
|
|
1388
|
+
onClick: (o) => he("primary", o.currentTarget),
|
|
1389
|
+
children: /* @__PURE__ */ e($, { name: "chevron-down" })
|
|
1390
1390
|
}
|
|
1391
1391
|
) : null,
|
|
1392
|
-
ce !== void 0 ?
|
|
1392
|
+
ce !== void 0 ? Ee(I, ce, f.primaryBare ? s.label : null) : null
|
|
1393
1393
|
] }) : null,
|
|
1394
1394
|
p ? /* @__PURE__ */ e(
|
|
1395
1395
|
"button",
|
|
1396
1396
|
{
|
|
1397
|
-
ref:
|
|
1397
|
+
ref: N,
|
|
1398
1398
|
type: "button",
|
|
1399
1399
|
className: "cms-section-header__more",
|
|
1400
1400
|
"data-action": "more",
|
|
@@ -1402,58 +1402,58 @@ function Xt({ title: n, icon: t, description: l, meta: r = [], primary: s, secon
|
|
|
1402
1402
|
"aria-expanded": (i == null ? void 0 : i.which) === "more",
|
|
1403
1403
|
"aria-label": d,
|
|
1404
1404
|
title: d,
|
|
1405
|
-
...
|
|
1406
|
-
onClick: (
|
|
1407
|
-
children: /* @__PURE__ */ e(
|
|
1405
|
+
...Se("more"),
|
|
1406
|
+
onClick: (o) => he("more", o.currentTarget),
|
|
1407
|
+
children: /* @__PURE__ */ e($, { name: "more" })
|
|
1408
1408
|
}
|
|
1409
1409
|
) : null
|
|
1410
1410
|
] }),
|
|
1411
|
-
/* @__PURE__ */ c("div", { ref:
|
|
1412
|
-
t !== void 0 ? /* @__PURE__ */ e("span", { "data-measure": "lead", children: /* @__PURE__ */ e(
|
|
1411
|
+
/* @__PURE__ */ c("div", { ref: _, className: "cms-section-header__measure", "aria-hidden": "true", children: [
|
|
1412
|
+
t !== void 0 ? /* @__PURE__ */ e("span", { "data-measure": "lead", children: /* @__PURE__ */ e($, { name: t }) }) : null,
|
|
1413
1413
|
/* @__PURE__ */ e("span", { "data-measure": "title", className: "cms-section-header__title", children: n }),
|
|
1414
1414
|
l !== void 0 ? /* @__PURE__ */ e("span", { "data-measure": "description", className: "cms-section-header__description", children: l }) : null,
|
|
1415
|
-
r.map((
|
|
1416
|
-
|
|
1417
|
-
/* @__PURE__ */ c("span", { "data-measure": "full", "data-measure-id":
|
|
1418
|
-
|
|
1419
|
-
/* @__PURE__ */ e("span", { className: "cms-section-header__label", children:
|
|
1415
|
+
r.map((o) => /* @__PURE__ */ e("span", { "data-measure": "meta", "data-measure-id": o.id, className: "cms-section-header__meta", children: o.content }, o.id)),
|
|
1416
|
+
V.map((o) => /* @__PURE__ */ c("span", { children: [
|
|
1417
|
+
/* @__PURE__ */ c("span", { "data-measure": "full", "data-measure-id": o.id, className: "cms-button cms-button--quiet cms-section-header__secondary", children: [
|
|
1418
|
+
o.icon !== null ? /* @__PURE__ */ e($, { name: o.icon, size: 18 }) : null,
|
|
1419
|
+
/* @__PURE__ */ e("span", { className: "cms-section-header__label", children: o.label })
|
|
1420
1420
|
] }),
|
|
1421
|
-
/* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-id":
|
|
1422
|
-
] },
|
|
1423
|
-
|
|
1421
|
+
/* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-id": o.id, className: "cms-button cms-button--quiet cms-section-header__secondary cms-section-header__secondary--bare", children: o.icon !== null ? /* @__PURE__ */ e($, { name: o.icon, size: 18 }) : null })
|
|
1422
|
+
] }, o.id)),
|
|
1423
|
+
ee ? /* @__PURE__ */ c(B, { children: [
|
|
1424
1424
|
/* @__PURE__ */ c("span", { "data-measure": "primary", className: "cms-section-header__primary", children: [
|
|
1425
1425
|
/* @__PURE__ */ c("span", { className: "cms-button cms-button--primary", children: [
|
|
1426
|
-
/* @__PURE__ */ e(
|
|
1426
|
+
/* @__PURE__ */ e($, { name: s.icon }),
|
|
1427
1427
|
" ",
|
|
1428
1428
|
/* @__PURE__ */ e("span", { children: s.label })
|
|
1429
1429
|
] }),
|
|
1430
|
-
|
|
1430
|
+
ue !== null ? /* @__PURE__ */ e("span", { className: "cms-button cms-button--primary cms-section-header__split", children: /* @__PURE__ */ e($, { name: "chevron-down" }) }) : null
|
|
1431
1431
|
] }),
|
|
1432
1432
|
/* @__PURE__ */ c("span", { "data-measure": "primary-icon", className: "cms-section-header__primary", children: [
|
|
1433
|
-
/* @__PURE__ */ e("span", { className: "cms-button cms-button--primary cms-section-header__primary--bare", children: /* @__PURE__ */ e(
|
|
1434
|
-
|
|
1433
|
+
/* @__PURE__ */ e("span", { className: "cms-button cms-button--primary cms-section-header__primary--bare", children: /* @__PURE__ */ e($, { name: s.icon }) }),
|
|
1434
|
+
ue !== null ? /* @__PURE__ */ e("span", { className: "cms-button cms-button--primary cms-section-header__split", children: /* @__PURE__ */ e($, { name: "chevron-down" }) }) : null
|
|
1435
1435
|
] })
|
|
1436
1436
|
] }) : null,
|
|
1437
|
-
/* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-section-header__more", children: /* @__PURE__ */ e(
|
|
1437
|
+
/* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-section-header__more", children: /* @__PURE__ */ e($, { name: "more" }) })
|
|
1438
1438
|
] })
|
|
1439
1439
|
] }),
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
/* @__PURE__ */ e(Ke, { at: (i == null ? void 0 : i.which) === "more" ? i : null, items:
|
|
1440
|
+
m != null ? /* @__PURE__ */ e("div", { className: "cms-section-header__context", "data-row": "2", children: m }) : null,
|
|
1441
|
+
ue !== null ? /* @__PURE__ */ e(Ke, { at: (i == null ? void 0 : i.which) === "primary" ? i : null, items: oe, onClose: () => g(null), label: ue.menuLabel }) : null,
|
|
1442
|
+
/* @__PURE__ */ e(Ke, { at: (i == null ? void 0 : i.which) === "more" ? i : null, items: G, onClose: () => g(null), label: d })
|
|
1443
1443
|
] });
|
|
1444
1444
|
}
|
|
1445
|
-
function
|
|
1445
|
+
function ot(n) {
|
|
1446
1446
|
const t = /* @__PURE__ */ new Map();
|
|
1447
1447
|
for (const l of n) l.overflow !== void 0 && l.overflow !== 0 && t.set(l.overflow, [...t.get(l.overflow) ?? [], l.id]);
|
|
1448
1448
|
return [...t.entries()].sort(([l], [r]) => l - r).map(([, l]) => l);
|
|
1449
1449
|
}
|
|
1450
|
-
function
|
|
1451
|
-
return /* @__PURE__ */ c("div", { className:
|
|
1450
|
+
function Qt({ head: n, children: t, className: l, scrollRef: r, onScroll: s, bodyProps: a }) {
|
|
1451
|
+
return /* @__PURE__ */ c("div", { className: F("cms-column", l), children: [
|
|
1452
1452
|
n == null ? null : /* @__PURE__ */ e("div", { className: "cms-column__head", children: n }),
|
|
1453
|
-
/* @__PURE__ */ e("div", { ...a, className:
|
|
1453
|
+
/* @__PURE__ */ e("div", { ...a, className: F("cms-column__body", a == null ? void 0 : a.className), ref: r, onScroll: s, children: t })
|
|
1454
1454
|
] });
|
|
1455
1455
|
}
|
|
1456
|
-
function
|
|
1456
|
+
function el({ title: n, scope: t, actions: l, backLink: r }) {
|
|
1457
1457
|
return /* @__PURE__ */ c("header", { className: "cms-page-header", children: [
|
|
1458
1458
|
r ? /* @__PURE__ */ c(
|
|
1459
1459
|
"a",
|
|
@@ -1464,7 +1464,7 @@ function Qt({ title: n, scope: t, actions: l, backLink: r }) {
|
|
|
1464
1464
|
r.onBack && (s.preventDefault(), r.onBack());
|
|
1465
1465
|
},
|
|
1466
1466
|
children: [
|
|
1467
|
-
/* @__PURE__ */ e(
|
|
1467
|
+
/* @__PURE__ */ e(re, { name: "back" }),
|
|
1468
1468
|
" ",
|
|
1469
1469
|
r.label
|
|
1470
1470
|
]
|
|
@@ -1479,73 +1479,73 @@ function Qt({ title: n, scope: t, actions: l, backLink: r }) {
|
|
|
1479
1479
|
] })
|
|
1480
1480
|
] });
|
|
1481
1481
|
}
|
|
1482
|
-
function
|
|
1483
|
-
const s =
|
|
1484
|
-
var
|
|
1485
|
-
const
|
|
1486
|
-
if (
|
|
1487
|
-
|
|
1488
|
-
const i = n[
|
|
1489
|
-
i && (l(i.id), (
|
|
1482
|
+
function nl({ tabs: n, active: t, onSelect: l, label: r }) {
|
|
1483
|
+
const s = P([]), a = (h, d) => {
|
|
1484
|
+
var g;
|
|
1485
|
+
const m = n.length - 1, b = h.key === "ArrowRight" ? d === m ? 0 : d + 1 : h.key === "ArrowLeft" ? d === 0 ? m : d - 1 : h.key === "Home" ? 0 : h.key === "End" ? m : null;
|
|
1486
|
+
if (b === null) return;
|
|
1487
|
+
h.preventDefault();
|
|
1488
|
+
const i = n[b];
|
|
1489
|
+
i && (l(i.id), (g = s.current[b]) == null || g.focus());
|
|
1490
1490
|
};
|
|
1491
|
-
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": r, children: n.map((
|
|
1492
|
-
const
|
|
1491
|
+
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": r, children: n.map((h, d) => {
|
|
1492
|
+
const m = h.id === t;
|
|
1493
1493
|
return /* @__PURE__ */ c(
|
|
1494
1494
|
"button",
|
|
1495
1495
|
{
|
|
1496
|
-
ref: (
|
|
1497
|
-
s.current[d] =
|
|
1496
|
+
ref: (b) => {
|
|
1497
|
+
s.current[d] = b;
|
|
1498
1498
|
},
|
|
1499
1499
|
type: "button",
|
|
1500
1500
|
role: "tab",
|
|
1501
|
-
className:
|
|
1502
|
-
"aria-selected":
|
|
1503
|
-
tabIndex:
|
|
1504
|
-
onClick: () => l(
|
|
1505
|
-
onKeyDown: (
|
|
1501
|
+
className: F("cms-tab", m && "is-active"),
|
|
1502
|
+
"aria-selected": m,
|
|
1503
|
+
tabIndex: m ? 0 : -1,
|
|
1504
|
+
onClick: () => l(h.id),
|
|
1505
|
+
onKeyDown: (b) => a(b, d),
|
|
1506
1506
|
children: [
|
|
1507
|
-
|
|
1508
|
-
|
|
1507
|
+
h.label,
|
|
1508
|
+
h.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: h.count }) : null
|
|
1509
1509
|
]
|
|
1510
1510
|
},
|
|
1511
|
-
|
|
1511
|
+
h.id
|
|
1512
1512
|
);
|
|
1513
1513
|
}) });
|
|
1514
1514
|
}
|
|
1515
|
-
function
|
|
1515
|
+
function dt(n) {
|
|
1516
1516
|
const t = n.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), l = (s) => {
|
|
1517
1517
|
var a;
|
|
1518
1518
|
return (a = s == null ? void 0 : s.match(/[\p{L}\p{N}]/u)) == null ? void 0 : a[0];
|
|
1519
1519
|
};
|
|
1520
1520
|
return (t.length > 1 ? [l(t[0]), l(t[t.length - 1])] : [l(t[0])]).filter(Boolean).join("").toUpperCase();
|
|
1521
1521
|
}
|
|
1522
|
-
function
|
|
1522
|
+
function ut(n) {
|
|
1523
1523
|
let t = 0;
|
|
1524
1524
|
for (const l of n.trim().toLowerCase())
|
|
1525
1525
|
t = t * 31 + (l.codePointAt(0) ?? 0) >>> 0;
|
|
1526
1526
|
return t % 6 + 1;
|
|
1527
1527
|
}
|
|
1528
|
-
function
|
|
1529
|
-
const
|
|
1528
|
+
function Ye({ name: n, pictureUrl: t, presence: l, connection: r, deleted: s = !1, placeholder: a = !1, size: h = 32, tintSeed: d, unnamedLabel: m }) {
|
|
1529
|
+
const b = s || a, i = dt(n) || "?", g = n.trim() === "" ? (m == null ? void 0 : m.trim()) || "?" : n, f = r !== void 0 ? `is-${r.state === "offline" ? "disconnected" : r.state}` : l === void 0 ? null : `is-${l === "busy" ? "away" : l}`, v = r !== void 0 ? `${g}, ${r.label}` : l ? `${g}, ${l}` : g;
|
|
1530
1530
|
return /* @__PURE__ */ c(
|
|
1531
1531
|
"span",
|
|
1532
1532
|
{
|
|
1533
|
-
className:
|
|
1534
|
-
style: { width:
|
|
1533
|
+
className: F("cms-avatar", b ? "cms-avatar--deleted" : `cms-avatar--tint-${ut(d ?? n)}`),
|
|
1534
|
+
style: { width: h, height: h, fontSize: Math.round(h * 0.4) },
|
|
1535
1535
|
role: "img",
|
|
1536
1536
|
"aria-label": v,
|
|
1537
1537
|
...r === void 0 ? {} : { title: r.label },
|
|
1538
1538
|
children: [
|
|
1539
|
-
|
|
1540
|
-
|
|
1539
|
+
b ? /* @__PURE__ */ e($, { name: "user", size: Math.round(h * 0.6) }) : t ? /* @__PURE__ */ e("img", { src: t, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: i }),
|
|
1540
|
+
f === null ? null : /* @__PURE__ */ e("span", { className: F("cms-avatar__presence", f), "aria-hidden": "true" })
|
|
1541
1541
|
]
|
|
1542
1542
|
}
|
|
1543
1543
|
);
|
|
1544
1544
|
}
|
|
1545
|
-
const
|
|
1546
|
-
function
|
|
1545
|
+
const mt = 64, cn = "cms-splitter:";
|
|
1546
|
+
function en(n) {
|
|
1547
1547
|
try {
|
|
1548
|
-
const t = window.localStorage.getItem(
|
|
1548
|
+
const t = window.localStorage.getItem(cn + n);
|
|
1549
1549
|
if (t === null) return null;
|
|
1550
1550
|
const l = Number(t);
|
|
1551
1551
|
return Number.isFinite(l) ? l : null;
|
|
@@ -1553,40 +1553,40 @@ function Qe(n) {
|
|
|
1553
1553
|
return null;
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
1556
|
-
function
|
|
1556
|
+
function ht(n, t) {
|
|
1557
1557
|
if (n !== void 0)
|
|
1558
1558
|
try {
|
|
1559
|
-
window.localStorage.setItem(
|
|
1559
|
+
window.localStorage.setItem(cn + n, String(t));
|
|
1560
1560
|
} catch {
|
|
1561
1561
|
}
|
|
1562
1562
|
}
|
|
1563
|
-
function
|
|
1563
|
+
function ft(n) {
|
|
1564
1564
|
if (n !== void 0)
|
|
1565
1565
|
try {
|
|
1566
|
-
window.localStorage.removeItem(
|
|
1566
|
+
window.localStorage.removeItem(cn + n);
|
|
1567
1567
|
} catch {
|
|
1568
1568
|
}
|
|
1569
1569
|
}
|
|
1570
|
-
function
|
|
1571
|
-
const i = Math.max(r, s),
|
|
1572
|
-
const
|
|
1573
|
-
return
|
|
1574
|
-
}),
|
|
1575
|
-
|
|
1570
|
+
function pt({ storageKey: n, value: t, default: l, min: r, max: s, step: a = 16, label: h, onChange: d, className: m, style: b }) {
|
|
1571
|
+
const i = Math.max(r, s), g = (_) => Math.round(Math.min(Math.max(_, r), i)), [f, v] = D(() => {
|
|
1572
|
+
const _ = n === void 0 ? null : en(n);
|
|
1573
|
+
return g(_ ?? l);
|
|
1574
|
+
}), u = g(t ?? f), w = P(null), [S, A] = D(!1);
|
|
1575
|
+
$e(() => {
|
|
1576
1576
|
if (n === void 0) return;
|
|
1577
|
-
const
|
|
1578
|
-
if (
|
|
1579
|
-
const
|
|
1580
|
-
(t === void 0 ||
|
|
1581
|
-
}, []),
|
|
1582
|
-
t !== void 0 &&
|
|
1577
|
+
const _ = en(n);
|
|
1578
|
+
if (_ === null) return;
|
|
1579
|
+
const N = g(_);
|
|
1580
|
+
(t === void 0 || N !== g(t)) && (v(N), d(N, !0));
|
|
1581
|
+
}, []), $e(() => {
|
|
1582
|
+
t !== void 0 && g(t) !== t && d(g(t), !0);
|
|
1583
1583
|
}, [t, r, i]);
|
|
1584
|
-
const x = (
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1587
|
-
},
|
|
1588
|
-
const
|
|
1589
|
-
w.current = null,
|
|
1584
|
+
const x = (_, N) => {
|
|
1585
|
+
const I = g(_);
|
|
1586
|
+
v(I), N && ht(n, I), d(I, N);
|
|
1587
|
+
}, T = () => {
|
|
1588
|
+
const _ = w.current;
|
|
1589
|
+
w.current = null, A(!1), _ !== null && _.last !== _.from && x(_.last, !0);
|
|
1590
1590
|
};
|
|
1591
1591
|
return /* @__PURE__ */ e(
|
|
1592
1592
|
"div",
|
|
@@ -1594,63 +1594,63 @@ function ft({ storageKey: n, value: t, default: l, min: r, max: s, step: a = 16,
|
|
|
1594
1594
|
role: "separator",
|
|
1595
1595
|
tabIndex: 0,
|
|
1596
1596
|
"aria-orientation": "vertical",
|
|
1597
|
-
"aria-label":
|
|
1598
|
-
"aria-valuenow":
|
|
1597
|
+
"aria-label": h,
|
|
1598
|
+
"aria-valuenow": u,
|
|
1599
1599
|
"aria-valuemin": r,
|
|
1600
1600
|
"aria-valuemax": i,
|
|
1601
|
-
className:
|
|
1602
|
-
style:
|
|
1603
|
-
onPointerDown: (
|
|
1604
|
-
var
|
|
1605
|
-
if (
|
|
1606
|
-
|
|
1607
|
-
const
|
|
1608
|
-
w.current = { x:
|
|
1601
|
+
className: F("cms-splitter", S && "is-dragging", u <= r && "is-at-min", u >= i && "is-at-max", m),
|
|
1602
|
+
style: b,
|
|
1603
|
+
onPointerDown: (_) => {
|
|
1604
|
+
var I, q;
|
|
1605
|
+
if (_.button > 0) return;
|
|
1606
|
+
_.preventDefault(), (q = (I = _.currentTarget).setPointerCapture) == null || q.call(I, _.pointerId);
|
|
1607
|
+
const N = getComputedStyle(_.currentTarget).direction === "rtl" ? -1 : 1;
|
|
1608
|
+
w.current = { x: _.clientX, from: u, last: u, sign: N }, A(!0);
|
|
1609
1609
|
},
|
|
1610
|
-
onPointerMove: (
|
|
1611
|
-
const
|
|
1612
|
-
|
|
1610
|
+
onPointerMove: (_) => {
|
|
1611
|
+
const N = w.current;
|
|
1612
|
+
N === null || !Number.isFinite(_.clientX) || (N.last = g(N.from + N.sign * (_.clientX - N.x)), x(N.last, !1));
|
|
1613
1613
|
},
|
|
1614
|
-
onPointerUp:
|
|
1615
|
-
onPointerCancel:
|
|
1614
|
+
onPointerUp: T,
|
|
1615
|
+
onPointerCancel: T,
|
|
1616
1616
|
onDoubleClick: () => {
|
|
1617
|
-
|
|
1618
|
-
const
|
|
1619
|
-
_
|
|
1617
|
+
ft(n);
|
|
1618
|
+
const _ = g(l);
|
|
1619
|
+
v(_), d(_, !0);
|
|
1620
1620
|
},
|
|
1621
|
-
onKeyDown: (
|
|
1622
|
-
const
|
|
1623
|
-
|
|
1621
|
+
onKeyDown: (_) => {
|
|
1622
|
+
const N = _.shiftKey ? mt : a, I = getComputedStyle(_.currentTarget).direction === "rtl" ? -1 : 1, q = _.key === "ArrowLeft" ? u - I * N : _.key === "ArrowRight" ? u + I * N : _.key === "Home" ? r : _.key === "End" ? i : null;
|
|
1623
|
+
q !== null && (_.preventDefault(), x(q, !0));
|
|
1624
1624
|
}
|
|
1625
1625
|
}
|
|
1626
1626
|
);
|
|
1627
1627
|
}
|
|
1628
|
-
function
|
|
1628
|
+
function bt({ count: n, label: t, max: l = 99 }) {
|
|
1629
1629
|
return n <= 0 ? null : /* @__PURE__ */ c("span", { className: "cms-badge", children: [
|
|
1630
1630
|
/* @__PURE__ */ e("span", { "aria-hidden": "true", children: n > l ? `${l}+` : n }),
|
|
1631
1631
|
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: t })
|
|
1632
1632
|
] });
|
|
1633
1633
|
}
|
|
1634
|
-
function
|
|
1634
|
+
function tl({ product: n, mark: t, rail: l, active: r, onNavigate: s, server: a, search: h, account: d, children: m, railLabel: b = "Sections" }) {
|
|
1635
1635
|
return /* @__PURE__ */ c("div", { className: "cms-shell", children: [
|
|
1636
|
-
/* @__PURE__ */ c("nav", { className: "cms-shell__rail", "aria-label":
|
|
1636
|
+
/* @__PURE__ */ c("nav", { className: "cms-shell__rail", "aria-label": b, children: [
|
|
1637
1637
|
/* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: t }),
|
|
1638
1638
|
/* @__PURE__ */ e("ul", { className: "cms-shell__items", children: l.map((i) => {
|
|
1639
|
-
const
|
|
1639
|
+
const g = i.id === r;
|
|
1640
1640
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(
|
|
1641
1641
|
"a",
|
|
1642
1642
|
{
|
|
1643
1643
|
href: i.href,
|
|
1644
|
-
className:
|
|
1645
|
-
"aria-current":
|
|
1644
|
+
className: F("cms-shell__item", g && "is-active"),
|
|
1645
|
+
"aria-current": g ? "page" : void 0,
|
|
1646
1646
|
title: i.label,
|
|
1647
|
-
onClick: (
|
|
1648
|
-
s && (
|
|
1647
|
+
onClick: (f) => {
|
|
1648
|
+
s && (f.preventDefault(), s(i.id));
|
|
1649
1649
|
},
|
|
1650
1650
|
children: [
|
|
1651
1651
|
/* @__PURE__ */ c("span", { className: "cms-shell__icon", children: [
|
|
1652
|
-
/* @__PURE__ */ e(
|
|
1653
|
-
i.badge ? /* @__PURE__ */ e(
|
|
1652
|
+
/* @__PURE__ */ e($, { name: i.icon, size: 22 }),
|
|
1653
|
+
i.badge ? /* @__PURE__ */ e(bt, { count: i.badge.count, label: i.badge.label }) : null
|
|
1654
1654
|
] }),
|
|
1655
1655
|
/* @__PURE__ */ e("span", { className: "cms-shell__label", children: i.label })
|
|
1656
1656
|
]
|
|
@@ -1661,13 +1661,13 @@ function nl({ product: n, mark: t, rail: l, active: r, onNavigate: s, server: a,
|
|
|
1661
1661
|
/* @__PURE__ */ c("header", { className: "cms-shell__top", children: [
|
|
1662
1662
|
/* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
|
|
1663
1663
|
a != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: a }) : null,
|
|
1664
|
-
|
|
1664
|
+
h != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: h }) : null,
|
|
1665
1665
|
d != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: d }) : null
|
|
1666
1666
|
] }),
|
|
1667
|
-
/* @__PURE__ */ e("main", { className: "cms-shell__main", children:
|
|
1667
|
+
/* @__PURE__ */ e("main", { className: "cms-shell__main", children: m })
|
|
1668
1668
|
] });
|
|
1669
1669
|
}
|
|
1670
|
-
function
|
|
1670
|
+
function ll({ label: n, placeholder: t, value: l, onChange: r, onSearch: s }) {
|
|
1671
1671
|
return /* @__PURE__ */ c(
|
|
1672
1672
|
"form",
|
|
1673
1673
|
{
|
|
@@ -1677,7 +1677,7 @@ function tl({ label: n, placeholder: t, value: l, onChange: r, onSearch: s }) {
|
|
|
1677
1677
|
a.preventDefault(), s == null || s(l);
|
|
1678
1678
|
},
|
|
1679
1679
|
children: [
|
|
1680
|
-
/* @__PURE__ */ e(
|
|
1680
|
+
/* @__PURE__ */ e($, { name: "search", size: 18 }),
|
|
1681
1681
|
/* @__PURE__ */ e(
|
|
1682
1682
|
"input",
|
|
1683
1683
|
{
|
|
@@ -1693,95 +1693,95 @@ function tl({ label: n, placeholder: t, value: l, onChange: r, onSearch: s }) {
|
|
|
1693
1693
|
}
|
|
1694
1694
|
);
|
|
1695
1695
|
}
|
|
1696
|
-
function
|
|
1696
|
+
function _t(n, t, l) {
|
|
1697
1697
|
const r = n.map((a) => Math.min(Math.max(a.width, a.min), a.max));
|
|
1698
|
-
let s = r.reduce((a,
|
|
1698
|
+
let s = r.reduce((a, h) => a + h, 0) + l - t;
|
|
1699
1699
|
for (let a = r.length - 1; a >= 0 && s > 0; a -= 1) {
|
|
1700
|
-
const
|
|
1701
|
-
r[a] = r[a] -
|
|
1700
|
+
const h = Math.min(s, r[a] - n[a].min);
|
|
1701
|
+
r[a] = r[a] - h, s -= h;
|
|
1702
1702
|
}
|
|
1703
1703
|
return r;
|
|
1704
1704
|
}
|
|
1705
|
-
function
|
|
1706
|
-
const d = Math.min(Math.max(t ?? n.length - 1, 0), n.length - 1),
|
|
1707
|
-
|
|
1708
|
-
const
|
|
1709
|
-
if (
|
|
1710
|
-
const
|
|
1711
|
-
if (
|
|
1712
|
-
const
|
|
1713
|
-
return
|
|
1714
|
-
}, [
|
|
1715
|
-
const x =
|
|
1716
|
-
[`--split-pane-${String(
|
|
1717
|
-
[`--split-pane-end-${String(
|
|
1705
|
+
function sl({ panes: n, active: t, back: l, sizes: r, lastMin: s = 360, onResize: a, storageKey: h }) {
|
|
1706
|
+
const d = Math.min(Math.max(t ?? n.length - 1, 0), n.length - 1), m = P(null), [b, i] = D(0), g = (r ?? []).slice(0, n.length - 1), [f, v] = D(() => h === void 0 ? [] : g.map((_, N) => en(`${h}:${String(N)}`) ?? void 0)), [u, w] = D(!1), S = g.map((_, N) => _ !== void 0 && f[N] !== void 0 ? { ..._, width: f[N] } : _), A = S.length === n.length - 1 && S.every((_) => _ !== void 0);
|
|
1707
|
+
$e(() => {
|
|
1708
|
+
const _ = m.current;
|
|
1709
|
+
if (_ === null || !A) return;
|
|
1710
|
+
const N = () => i(_.clientWidth);
|
|
1711
|
+
if (N(), typeof ResizeObserver > "u") return;
|
|
1712
|
+
const I = new ResizeObserver(N);
|
|
1713
|
+
return I.observe(_), () => I.disconnect();
|
|
1714
|
+
}, [A]);
|
|
1715
|
+
const x = A ? _t(S, b > 0 ? b : Number.POSITIVE_INFINITY, s) : [], T = A ? Object.fromEntries(x.flatMap((_, N) => [
|
|
1716
|
+
[`--split-pane-${String(N)}`, `${String(_)}px`],
|
|
1717
|
+
[`--split-pane-end-${String(N)}`, `${String(x.slice(0, N + 1).reduce((I, q) => I + q, 0))}px`]
|
|
1718
1718
|
])) : void 0;
|
|
1719
1719
|
return /* @__PURE__ */ c(
|
|
1720
1720
|
"div",
|
|
1721
1721
|
{
|
|
1722
|
-
ref:
|
|
1723
|
-
className:
|
|
1722
|
+
ref: m,
|
|
1723
|
+
className: F("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", A && "cms-panes--sized", u && "is-resizing"),
|
|
1724
1724
|
"data-active": d,
|
|
1725
|
-
style:
|
|
1725
|
+
style: T,
|
|
1726
1726
|
children: [
|
|
1727
|
-
n.map((
|
|
1728
|
-
|
|
1729
|
-
/* @__PURE__ */ e(
|
|
1727
|
+
n.map((_, N) => /* @__PURE__ */ c("section", { className: "cms-panes__pane", "aria-label": _.label, "data-offset": d - N, children: [
|
|
1728
|
+
N === d && l ? /* @__PURE__ */ c("a", { className: "cms-panes__back", href: l.href, children: [
|
|
1729
|
+
/* @__PURE__ */ e($, { name: "chevron-left", size: 18 }),
|
|
1730
1730
|
l.label
|
|
1731
1731
|
] }) : null,
|
|
1732
|
-
|
|
1733
|
-
] },
|
|
1734
|
-
|
|
1735
|
-
const
|
|
1732
|
+
_.content
|
|
1733
|
+
] }, _.label)),
|
|
1734
|
+
A ? S.map((_, N) => {
|
|
1735
|
+
const I = x.reduce((V, k, H) => H === N ? V : V + k, 0), q = Math.max(_.min, Math.min(_.max, b > 0 ? b - I - s : _.max));
|
|
1736
1736
|
return /* @__PURE__ */ e(
|
|
1737
|
-
|
|
1737
|
+
pt,
|
|
1738
1738
|
{
|
|
1739
|
-
...
|
|
1740
|
-
value: x[
|
|
1741
|
-
default:
|
|
1742
|
-
min:
|
|
1743
|
-
max:
|
|
1744
|
-
label:
|
|
1739
|
+
...h === void 0 ? {} : { storageKey: `${h}:${String(N)}` },
|
|
1740
|
+
value: x[N],
|
|
1741
|
+
default: _.reset,
|
|
1742
|
+
min: _.min,
|
|
1743
|
+
max: q,
|
|
1744
|
+
label: _.label,
|
|
1745
1745
|
className: "cms-panes__splitter",
|
|
1746
|
-
style: { "--split-at": `var(--split-pane-end-${String(
|
|
1747
|
-
onChange: (
|
|
1748
|
-
|
|
1749
|
-
const
|
|
1750
|
-
return
|
|
1751
|
-
}), w(!
|
|
1746
|
+
style: { "--split-at": `var(--split-pane-end-${String(N)})` },
|
|
1747
|
+
onChange: (V, k) => {
|
|
1748
|
+
h !== void 0 && v((H) => {
|
|
1749
|
+
const U = [...H];
|
|
1750
|
+
return U[N] = V, U;
|
|
1751
|
+
}), w(!k), a == null || a(N, V, k);
|
|
1752
1752
|
}
|
|
1753
1753
|
},
|
|
1754
|
-
|
|
1754
|
+
_.label
|
|
1755
1755
|
);
|
|
1756
1756
|
}) : null
|
|
1757
1757
|
]
|
|
1758
1758
|
}
|
|
1759
1759
|
);
|
|
1760
1760
|
}
|
|
1761
|
-
const
|
|
1762
|
-
function
|
|
1763
|
-
const
|
|
1764
|
-
return /* @__PURE__ */ c("div", { className:
|
|
1765
|
-
|
|
1766
|
-
|
|
1761
|
+
const vt = { attachment: "Has an attachment", unread: "Unread" };
|
|
1762
|
+
function rl({ from: n, fromPlaceholder: t = !1, subject: l, preview: r, time: s, unread: a, hasAttachment: h, selected: d, onOpen: m, check: b, selecting: i, labels: g }) {
|
|
1763
|
+
const f = qe(vt, g), v = /* @__PURE__ */ e(Ye, { name: n, size: 40, placeholder: t });
|
|
1764
|
+
return /* @__PURE__ */ c("div", { className: F("cms-mail-row", a && "is-unread", d && "is-selected", i && "is-selecting", (b == null ? void 0 : b.checked) && "is-checked"), children: [
|
|
1765
|
+
b !== void 0 ? /* @__PURE__ */ c("span", { className: "cms-mail-row__lead", children: [
|
|
1766
|
+
v,
|
|
1767
1767
|
/* @__PURE__ */ e(
|
|
1768
1768
|
"input",
|
|
1769
1769
|
{
|
|
1770
1770
|
type: "checkbox",
|
|
1771
1771
|
className: "cms-mail-row__check",
|
|
1772
|
-
checked:
|
|
1773
|
-
disabled:
|
|
1774
|
-
"aria-disabled":
|
|
1775
|
-
"aria-busy":
|
|
1776
|
-
"aria-label":
|
|
1772
|
+
checked: b.checked,
|
|
1773
|
+
disabled: b.disabled,
|
|
1774
|
+
"aria-disabled": b.pending ? "true" : void 0,
|
|
1775
|
+
"aria-busy": b.pending ? "true" : void 0,
|
|
1776
|
+
"aria-label": b.label,
|
|
1777
1777
|
onChange: () => {
|
|
1778
1778
|
},
|
|
1779
|
-
onClick: (
|
|
1780
|
-
if (
|
|
1781
|
-
|
|
1779
|
+
onClick: (u) => {
|
|
1780
|
+
if (u.stopPropagation(), b.pending) {
|
|
1781
|
+
u.preventDefault();
|
|
1782
1782
|
return;
|
|
1783
1783
|
}
|
|
1784
|
-
|
|
1784
|
+
b.onCheck({ shift: u.shiftKey, toggle: u.ctrlKey || u.metaKey });
|
|
1785
1785
|
}
|
|
1786
1786
|
}
|
|
1787
1787
|
)
|
|
@@ -1791,70 +1791,70 @@ function sl({ from: n, subject: t, preview: l, time: r, unread: s, hasAttachment
|
|
|
1791
1791
|
{
|
|
1792
1792
|
type: "button",
|
|
1793
1793
|
className: "cms-mail-row__open",
|
|
1794
|
-
"aria-current":
|
|
1795
|
-
onClick:
|
|
1794
|
+
"aria-current": d ? "true" : void 0,
|
|
1795
|
+
onClick: m,
|
|
1796
1796
|
children: [
|
|
1797
|
-
|
|
1797
|
+
b === void 0 ? v : null,
|
|
1798
1798
|
/* @__PURE__ */ c("span", { className: "cms-mail-row__body", children: [
|
|
1799
1799
|
/* @__PURE__ */ c("span", { className: "cms-mail-row__line", children: [
|
|
1800
1800
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
|
|
1801
|
-
|
|
1802
|
-
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children:
|
|
1801
|
+
h ? /* @__PURE__ */ e($, { name: "paperclip", size: 16, label: f.attachment }) : null,
|
|
1802
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: s })
|
|
1803
1803
|
] }),
|
|
1804
1804
|
/* @__PURE__ */ c("span", { className: "cms-mail-row__line", children: [
|
|
1805
|
-
/* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children:
|
|
1806
|
-
|
|
1805
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
|
|
1806
|
+
a ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": f.unread }) : null
|
|
1807
1807
|
] }),
|
|
1808
|
-
/* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children:
|
|
1808
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: r })
|
|
1809
1809
|
] })
|
|
1810
1810
|
]
|
|
1811
1811
|
}
|
|
1812
1812
|
)
|
|
1813
1813
|
] });
|
|
1814
1814
|
}
|
|
1815
|
-
function
|
|
1816
|
-
return /* @__PURE__ */ c("div", { className:
|
|
1815
|
+
function al({ direction: n, children: t, time: l, read: r, readLabel: s = "Read" }) {
|
|
1816
|
+
return /* @__PURE__ */ c("div", { className: F("cms-bubble", `cms-bubble--${n}`), children: [
|
|
1817
1817
|
/* @__PURE__ */ e("div", { className: "cms-bubble__text", children: t }),
|
|
1818
1818
|
/* @__PURE__ */ c("div", { className: "cms-bubble__meta", children: [
|
|
1819
1819
|
l,
|
|
1820
|
-
n === "out" && r ? /* @__PURE__ */ c(
|
|
1820
|
+
n === "out" && r ? /* @__PURE__ */ c(B, { children: [
|
|
1821
1821
|
" · ",
|
|
1822
1822
|
s
|
|
1823
1823
|
] }) : null
|
|
1824
1824
|
] })
|
|
1825
1825
|
] });
|
|
1826
1826
|
}
|
|
1827
|
-
function
|
|
1828
|
-
const
|
|
1829
|
-
w.preventDefault(),
|
|
1830
|
-
},
|
|
1831
|
-
return /* @__PURE__ */ c("form", { className:
|
|
1832
|
-
/* @__PURE__ */ e("label", { htmlFor:
|
|
1833
|
-
|
|
1827
|
+
function il({ label: n, value: t, onChange: l, onSend: r, onAttach: s, placeholder: a, variant: h = "chat", sendLabel: d = "Send", attachLabel: m = "Attach a file", leading: b, canSend: i }) {
|
|
1828
|
+
const g = fe(), f = i ?? t.trim() !== "", v = (w) => {
|
|
1829
|
+
w.preventDefault(), f && r();
|
|
1830
|
+
}, u = s ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": m, onClick: s, children: /* @__PURE__ */ e($, { name: "paperclip" }) }) : null;
|
|
1831
|
+
return /* @__PURE__ */ c("form", { className: F("cms-composer", `cms-composer--${h}`), onSubmit: v, children: [
|
|
1832
|
+
/* @__PURE__ */ e("label", { htmlFor: g, className: h === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
|
|
1833
|
+
h === "chat" ? u : null,
|
|
1834
1834
|
/* @__PURE__ */ e(
|
|
1835
1835
|
"textarea",
|
|
1836
1836
|
{
|
|
1837
|
-
id:
|
|
1837
|
+
id: g,
|
|
1838
1838
|
className: "cms-composer__input",
|
|
1839
|
-
rows:
|
|
1839
|
+
rows: h === "reply" ? 3 : 1,
|
|
1840
1840
|
placeholder: a,
|
|
1841
1841
|
value: t,
|
|
1842
1842
|
onChange: (w) => l(w.target.value),
|
|
1843
1843
|
onKeyDown: (w) => {
|
|
1844
|
-
w.nativeEvent.isComposing || w.keyCode === 229 ||
|
|
1844
|
+
w.nativeEvent.isComposing || w.keyCode === 229 || h === "chat" && w.key === "Enter" && !w.shiftKey && (w.preventDefault(), f && r());
|
|
1845
1845
|
}
|
|
1846
1846
|
}
|
|
1847
1847
|
),
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1848
|
+
h === "reply" && b !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: b }) : null,
|
|
1849
|
+
h === "reply" ? u : null,
|
|
1850
|
+
h === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": d, disabled: !f, children: /* @__PURE__ */ e($, { name: "send" }) }) : /* @__PURE__ */ c("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !f, children: [
|
|
1851
1851
|
d,
|
|
1852
1852
|
" ",
|
|
1853
|
-
/* @__PURE__ */ e(
|
|
1853
|
+
/* @__PURE__ */ e($, { name: "send", size: 18 })
|
|
1854
1854
|
] })
|
|
1855
1855
|
] });
|
|
1856
1856
|
}
|
|
1857
|
-
const
|
|
1857
|
+
const on = {
|
|
1858
1858
|
incomingAudio: "Incoming audio call",
|
|
1859
1859
|
incomingVideo: "Incoming video call",
|
|
1860
1860
|
incomingFrom: (n, t) => `${n} from ${t}`,
|
|
@@ -1875,15 +1875,15 @@ const an = {
|
|
|
1875
1875
|
onCallWith: (n) => `On a call with ${n}`,
|
|
1876
1876
|
returnToCall: "Return to call"
|
|
1877
1877
|
};
|
|
1878
|
-
function
|
|
1879
|
-
const
|
|
1880
|
-
return /* @__PURE__ */ c("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label":
|
|
1881
|
-
/* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
1878
|
+
function cl({ name: n, namePlaceholder: t = !1, media: l, onAccept: r, onDecline: s, labels: a }) {
|
|
1879
|
+
const h = qe(on, a), d = l === "video" ? h.incomingVideo : h.incomingAudio;
|
|
1880
|
+
return /* @__PURE__ */ c("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": h.incomingFrom(d, n), children: [
|
|
1881
|
+
/* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(Ye, { name: n, size: 112, placeholder: t }) }),
|
|
1882
1882
|
/* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: n }),
|
|
1883
|
-
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children:
|
|
1883
|
+
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: d }),
|
|
1884
1884
|
/* @__PURE__ */ c("div", { className: "cms-call-incoming__actions", children: [
|
|
1885
|
-
/* @__PURE__ */ e(ze, { icon: "phone-off", label:
|
|
1886
|
-
/* @__PURE__ */ e(ze, { icon: "phone", label:
|
|
1885
|
+
/* @__PURE__ */ e(ze, { icon: "phone-off", label: h.decline, tone: "hang-up", onClick: s }),
|
|
1886
|
+
/* @__PURE__ */ e(ze, { icon: "phone", label: h.accept, tone: "accept", onClick: r })
|
|
1887
1887
|
] })
|
|
1888
1888
|
] });
|
|
1889
1889
|
}
|
|
@@ -1892,55 +1892,55 @@ function ze({ icon: n, label: t, onClick: l, tone: r = "plain", pressed: s }) {
|
|
|
1892
1892
|
"button",
|
|
1893
1893
|
{
|
|
1894
1894
|
type: "button",
|
|
1895
|
-
className:
|
|
1895
|
+
className: F("cms-call-button", `cms-call-button--${r}`, s && "is-pressed"),
|
|
1896
1896
|
"aria-pressed": s,
|
|
1897
1897
|
onClick: l,
|
|
1898
1898
|
children: [
|
|
1899
|
-
/* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(
|
|
1899
|
+
/* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e($, { name: n, size: 24 }) }),
|
|
1900
1900
|
/* @__PURE__ */ e("span", { className: "cms-call-button__label", children: t })
|
|
1901
1901
|
]
|
|
1902
1902
|
}
|
|
1903
1903
|
);
|
|
1904
1904
|
}
|
|
1905
|
-
function
|
|
1906
|
-
const
|
|
1907
|
-
return /* @__PURE__ */ c("section", { className: "cms-call-panel", "aria-label":
|
|
1905
|
+
function ol({ name: n, duration: t, connection: l, you: r, muted: s, speaker: a, onToggleMute: h, onToggleSpeaker: d, onAddPerson: m, onChat: b, onHangUp: i, labels: g }) {
|
|
1906
|
+
const f = qe(on, g);
|
|
1907
|
+
return /* @__PURE__ */ c("section", { className: "cms-call-panel", "aria-label": f.callWith(n), children: [
|
|
1908
1908
|
/* @__PURE__ */ c("div", { className: "cms-call-panel__head", children: [
|
|
1909
|
-
/* @__PURE__ */ e(
|
|
1909
|
+
/* @__PURE__ */ e(Ye, { name: n, size: 64 }),
|
|
1910
1910
|
/* @__PURE__ */ c("div", { className: "cms-call-panel__who", children: [
|
|
1911
1911
|
/* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
|
|
1912
|
-
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label":
|
|
1912
|
+
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": f.callTime(t), children: t })
|
|
1913
1913
|
] }),
|
|
1914
|
-
/* @__PURE__ */ e("span", { className:
|
|
1914
|
+
/* @__PURE__ */ e("span", { className: F("cms-pill", l === "good" ? "cms-pill--success" : "cms-pill--warning"), children: l === "good" ? f.goodConnection : f.poorConnection })
|
|
1915
1915
|
] }),
|
|
1916
1916
|
/* @__PURE__ */ c("div", { className: "cms-call-panel__you", children: [
|
|
1917
|
-
/* @__PURE__ */ e(
|
|
1918
|
-
/* @__PURE__ */ e("span", { children:
|
|
1919
|
-
r.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label":
|
|
1917
|
+
/* @__PURE__ */ e(Ye, { name: r.name, size: 36 }),
|
|
1918
|
+
/* @__PURE__ */ e("span", { children: f.you }),
|
|
1919
|
+
r.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": f.speaking }) : null
|
|
1920
1920
|
] }),
|
|
1921
1921
|
/* @__PURE__ */ c("div", { className: "cms-call-panel__controls", children: [
|
|
1922
|
-
/* @__PURE__ */ e(ze, { icon: "mic", label: s ?
|
|
1923
|
-
/* @__PURE__ */ e(ze, { icon: "speaker", label:
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
/* @__PURE__ */ e(ze, { icon: "phone-off", label:
|
|
1922
|
+
/* @__PURE__ */ e(ze, { icon: "mic", label: s ? f.unmute : f.mute, pressed: s, onClick: h }),
|
|
1923
|
+
/* @__PURE__ */ e(ze, { icon: "speaker", label: f.speaker, pressed: a, onClick: d }),
|
|
1924
|
+
m ? /* @__PURE__ */ e(ze, { icon: "user-plus", label: f.addPerson, onClick: m }) : null,
|
|
1925
|
+
b ? /* @__PURE__ */ e(ze, { icon: "chat", label: f.chat, onClick: b }) : null,
|
|
1926
|
+
/* @__PURE__ */ e(ze, { icon: "phone-off", label: f.hangUp, tone: "hang-up", onClick: i })
|
|
1927
1927
|
] })
|
|
1928
1928
|
] });
|
|
1929
1929
|
}
|
|
1930
|
-
function
|
|
1931
|
-
const d =
|
|
1930
|
+
function dl({ name: n, duration: t, muted: l, onToggleMute: r, onReturn: s, onHangUp: a, labels: h }) {
|
|
1931
|
+
const d = qe(on, h);
|
|
1932
1932
|
return /* @__PURE__ */ c("section", { className: "cms-call-bar", "aria-label": d.callWith(n), children: [
|
|
1933
1933
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
|
|
1934
1934
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: d.onCallWith(n) }),
|
|
1935
1935
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: t }),
|
|
1936
1936
|
/* @__PURE__ */ c("span", { className: "cms-call-bar__actions", children: [
|
|
1937
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": l ? d.unmute : d.mute, "aria-pressed": l, onClick: r, children: /* @__PURE__ */ e(
|
|
1937
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": l ? d.unmute : d.mute, "aria-pressed": l, onClick: r, children: /* @__PURE__ */ e($, { name: "mic" }) }),
|
|
1938
1938
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: s, children: d.returnToCall }),
|
|
1939
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": d.hangUp, onClick: a, children: /* @__PURE__ */ e(
|
|
1939
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": d.hangUp, onClick: a, children: /* @__PURE__ */ e($, { name: "phone-off" }) })
|
|
1940
1940
|
] })
|
|
1941
1941
|
] });
|
|
1942
1942
|
}
|
|
1943
|
-
function
|
|
1943
|
+
function ul({ mark: n, product: t, headline: l, lead: r, features: s = [], children: a }) {
|
|
1944
1944
|
return /* @__PURE__ */ c("div", { className: "cms-signin", children: [
|
|
1945
1945
|
/* @__PURE__ */ c("aside", { className: "cms-signin__brand", children: [
|
|
1946
1946
|
/* @__PURE__ */ c("p", { className: "cms-signin__logo", children: [
|
|
@@ -1950,16 +1950,16 @@ function dl({ mark: n, product: t, headline: l, lead: r, features: s = [], child
|
|
|
1950
1950
|
/* @__PURE__ */ c("div", { className: "cms-signin__pitch", children: [
|
|
1951
1951
|
/* @__PURE__ */ e("p", { className: "cms-signin__headline", children: l }),
|
|
1952
1952
|
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children: r }),
|
|
1953
|
-
s.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: s.map((
|
|
1954
|
-
/* @__PURE__ */ e(
|
|
1955
|
-
|
|
1956
|
-
] },
|
|
1953
|
+
s.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: s.map((h) => /* @__PURE__ */ c("li", { children: [
|
|
1954
|
+
/* @__PURE__ */ e($, { name: h.icon, size: 18 }),
|
|
1955
|
+
h.label
|
|
1956
|
+
] }, h.label)) }) : null
|
|
1957
1957
|
] })
|
|
1958
1958
|
] }),
|
|
1959
1959
|
/* @__PURE__ */ e("main", { className: "cms-signin__form", children: a })
|
|
1960
1960
|
] });
|
|
1961
1961
|
}
|
|
1962
|
-
const
|
|
1962
|
+
const gt = {
|
|
1963
1963
|
title: "Sign in",
|
|
1964
1964
|
identifier: "Email or username",
|
|
1965
1965
|
identifierPlaceholder: "name@example.com",
|
|
@@ -1971,69 +1971,69 @@ const vt = {
|
|
|
1971
1971
|
newHere: "New here?",
|
|
1972
1972
|
create: "Create an account"
|
|
1973
1973
|
};
|
|
1974
|
-
function
|
|
1975
|
-
const d =
|
|
1976
|
-
return /* @__PURE__ */ c("form", { className: "cms-signin-form", onSubmit: (
|
|
1977
|
-
|
|
1978
|
-
}, "aria-describedby": s ? `${
|
|
1974
|
+
function ml({ server: n, onSubmit: t, forgotHref: l, createHref: r, error: s, busy: a, labels: h }) {
|
|
1975
|
+
const d = qe(gt, h), m = fe(), [b, i] = D(""), [g, f] = D(""), [v, u] = D(!1);
|
|
1976
|
+
return /* @__PURE__ */ c("form", { className: "cms-signin-form", onSubmit: (S) => {
|
|
1977
|
+
S.preventDefault(), t(b, g);
|
|
1978
|
+
}, "aria-describedby": s ? `${m}-error` : void 0, children: [
|
|
1979
1979
|
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: d.title }),
|
|
1980
1980
|
/* @__PURE__ */ c("p", { className: "cms-signin-form__server", children: [
|
|
1981
|
-
/* @__PURE__ */ e(
|
|
1981
|
+
/* @__PURE__ */ e($, { name: "server", size: 18 }),
|
|
1982
1982
|
n
|
|
1983
1983
|
] }),
|
|
1984
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${
|
|
1984
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${m}-identifier`, children: d.identifier }),
|
|
1985
1985
|
/* @__PURE__ */ e(
|
|
1986
1986
|
"input",
|
|
1987
1987
|
{
|
|
1988
|
-
id: `${
|
|
1988
|
+
id: `${m}-identifier`,
|
|
1989
1989
|
className: "cms-signin-form__input",
|
|
1990
1990
|
type: "text",
|
|
1991
1991
|
autoComplete: "username",
|
|
1992
1992
|
placeholder: d.identifierPlaceholder,
|
|
1993
|
-
value:
|
|
1994
|
-
onChange: (
|
|
1993
|
+
value: b,
|
|
1994
|
+
onChange: (S) => i(S.target.value),
|
|
1995
1995
|
required: !0
|
|
1996
1996
|
}
|
|
1997
1997
|
),
|
|
1998
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${
|
|
1998
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${m}-password`, children: d.password }),
|
|
1999
1999
|
/* @__PURE__ */ c("span", { className: "cms-signin-form__password", children: [
|
|
2000
2000
|
/* @__PURE__ */ e(
|
|
2001
2001
|
"input",
|
|
2002
2002
|
{
|
|
2003
|
-
id: `${
|
|
2003
|
+
id: `${m}-password`,
|
|
2004
2004
|
className: "cms-signin-form__input",
|
|
2005
|
-
type:
|
|
2005
|
+
type: v ? "text" : "password",
|
|
2006
2006
|
autoComplete: "current-password",
|
|
2007
|
-
value:
|
|
2008
|
-
onChange: (
|
|
2007
|
+
value: g,
|
|
2008
|
+
onChange: (S) => f(S.target.value),
|
|
2009
2009
|
required: !0
|
|
2010
2010
|
}
|
|
2011
2011
|
),
|
|
2012
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed":
|
|
2012
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": v, onClick: () => u((S) => !S), children: v ? d.hide : d.show })
|
|
2013
2013
|
] }),
|
|
2014
2014
|
l ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: l, children: d.forgot }) : null,
|
|
2015
|
-
s ? /* @__PURE__ */ e("p", { id: `${
|
|
2015
|
+
s ? /* @__PURE__ */ e("p", { id: `${m}-error`, className: "cms-signin-form__error", role: "alert", children: s }) : null,
|
|
2016
2016
|
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: a, "aria-busy": a || void 0, children: d.submit }),
|
|
2017
|
-
r ? /* @__PURE__ */ c(
|
|
2017
|
+
r ? /* @__PURE__ */ c(B, { children: [
|
|
2018
2018
|
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: d.newHere }) }),
|
|
2019
2019
|
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: r, children: d.create })
|
|
2020
2020
|
] }) : null
|
|
2021
2021
|
] });
|
|
2022
2022
|
}
|
|
2023
|
-
const
|
|
2024
|
-
function
|
|
2025
|
-
const t =
|
|
2026
|
-
return t ===
|
|
2023
|
+
const wt = { name: (n, t) => `${n}: ${t}` };
|
|
2024
|
+
function Cn(n) {
|
|
2025
|
+
const t = dn(n);
|
|
2026
|
+
return t === un(n.options, n.defaultValue) ? null : t ?? null;
|
|
2027
2027
|
}
|
|
2028
|
-
function
|
|
2029
|
-
return n.find((r) => r.id === t) ??
|
|
2028
|
+
function dn({ options: n, value: t, defaultValue: l }) {
|
|
2029
|
+
return n.find((r) => r.id === t) ?? un(n, l);
|
|
2030
2030
|
}
|
|
2031
|
-
function
|
|
2031
|
+
function Sn(n) {
|
|
2032
2032
|
var t;
|
|
2033
|
-
return
|
|
2033
|
+
return qe(wt, n.labels).name(n.label, ((t = dn(n)) == null ? void 0 : t.label) ?? "");
|
|
2034
2034
|
}
|
|
2035
|
-
function
|
|
2036
|
-
const l =
|
|
2035
|
+
function En(n, t) {
|
|
2036
|
+
const l = dn(n);
|
|
2037
2037
|
return n.options.map((r) => ({
|
|
2038
2038
|
id: r.id,
|
|
2039
2039
|
label: r.label,
|
|
@@ -2045,56 +2045,56 @@ function Sn(n, t) {
|
|
|
2045
2045
|
}
|
|
2046
2046
|
}));
|
|
2047
2047
|
}
|
|
2048
|
-
function
|
|
2048
|
+
function un(n, t) {
|
|
2049
2049
|
return n.find((l) => l.id === t) ?? n[0];
|
|
2050
2050
|
}
|
|
2051
|
-
function
|
|
2051
|
+
function An(n) {
|
|
2052
2052
|
var a;
|
|
2053
|
-
const t =
|
|
2054
|
-
|
|
2053
|
+
const t = P(null), l = (n == null ? void 0 : n.value) ?? null, s = n === void 0 || n.options.some((h) => h.id === n.value) ? null : ((a = un(n.options, n.defaultValue)) == null ? void 0 : a.id) ?? null;
|
|
2054
|
+
Q(() => {
|
|
2055
2055
|
s === null ? t.current = null : t.current !== l && (t.current = l, n == null || n.onChange(s));
|
|
2056
2056
|
}, [s, l]);
|
|
2057
2057
|
}
|
|
2058
|
-
function
|
|
2059
|
-
return l.options.length < 2 ? null : /* @__PURE__ */ e(
|
|
2058
|
+
function Tn({ iconOnly: n = !1, onOpenChange: t, ...l }) {
|
|
2059
|
+
return l.options.length < 2 ? null : /* @__PURE__ */ e(yt, { ...l, iconOnly: n, onOpenChange: t });
|
|
2060
2060
|
}
|
|
2061
|
-
function
|
|
2062
|
-
const [r, s] =
|
|
2063
|
-
|
|
2064
|
-
const
|
|
2065
|
-
const
|
|
2066
|
-
s({ x:
|
|
2061
|
+
function yt({ iconOnly: n, onOpenChange: t, ...l }) {
|
|
2062
|
+
const [r, s] = D(null), a = Ie(() => s(null), []), h = P(!1), d = r !== null;
|
|
2063
|
+
Q(() => (t == null || t(d), () => t == null ? void 0 : t(!1)), [d, t]);
|
|
2064
|
+
const m = Cn(l), b = m !== null && !n, i = Sn(l), g = (f, v) => {
|
|
2065
|
+
const u = f.getBoundingClientRect();
|
|
2066
|
+
s({ x: u.left, y: u.bottom + 4, focus: v });
|
|
2067
2067
|
};
|
|
2068
|
-
return /* @__PURE__ */ c(
|
|
2068
|
+
return /* @__PURE__ */ c(B, { children: [
|
|
2069
2069
|
/* @__PURE__ */ e(
|
|
2070
2070
|
"button",
|
|
2071
2071
|
{
|
|
2072
2072
|
type: "button",
|
|
2073
|
-
className:
|
|
2073
|
+
className: F("cms-filter-menu", m !== null && "cms-filter-menu--active", b && "cms-filter-menu--named"),
|
|
2074
2074
|
"aria-haspopup": "menu",
|
|
2075
2075
|
"aria-expanded": d,
|
|
2076
2076
|
"aria-label": i,
|
|
2077
2077
|
title: i,
|
|
2078
2078
|
onMouseDown: () => {
|
|
2079
|
-
|
|
2079
|
+
h.current = d;
|
|
2080
2080
|
},
|
|
2081
|
-
onClick: (
|
|
2082
|
-
d ||
|
|
2081
|
+
onClick: (f) => {
|
|
2082
|
+
d || h.current ? a() : g(f.currentTarget, "current"), h.current = !1;
|
|
2083
2083
|
},
|
|
2084
|
-
onKeyDown: (
|
|
2085
|
-
|
|
2084
|
+
onKeyDown: (f) => {
|
|
2085
|
+
h.current = !1, (f.key === "ArrowDown" || f.key === "ArrowUp") && (f.preventDefault(), g(f.currentTarget, f.key === "ArrowUp" ? "last" : "current"));
|
|
2086
2086
|
},
|
|
2087
|
-
children:
|
|
2088
|
-
/* @__PURE__ */ e("span", { className: "cms-filter-menu__choice", children:
|
|
2089
|
-
/* @__PURE__ */ e(
|
|
2090
|
-
] }) : /* @__PURE__ */ e(
|
|
2087
|
+
children: b ? /* @__PURE__ */ c(B, { children: [
|
|
2088
|
+
/* @__PURE__ */ e("span", { className: "cms-filter-menu__choice", children: m.label }),
|
|
2089
|
+
/* @__PURE__ */ e($, { name: "chevron-down", size: 16 })
|
|
2090
|
+
] }) : /* @__PURE__ */ e($, { name: "funnel" })
|
|
2091
2091
|
}
|
|
2092
2092
|
),
|
|
2093
2093
|
/* @__PURE__ */ e(
|
|
2094
2094
|
Ke,
|
|
2095
2095
|
{
|
|
2096
2096
|
at: r,
|
|
2097
|
-
items:
|
|
2097
|
+
items: En(l),
|
|
2098
2098
|
onClose: a,
|
|
2099
2099
|
label: l.label,
|
|
2100
2100
|
focus: r == null ? void 0 : r.focus
|
|
@@ -2102,112 +2102,112 @@ function wt({ iconOnly: n, onOpenChange: t, ...l }) {
|
|
|
2102
2102
|
)
|
|
2103
2103
|
] });
|
|
2104
2104
|
}
|
|
2105
|
-
function
|
|
2106
|
-
return
|
|
2105
|
+
function Nt(n) {
|
|
2106
|
+
return An(n), /* @__PURE__ */ e(Tn, { ...n });
|
|
2107
2107
|
}
|
|
2108
|
-
function
|
|
2108
|
+
function hl({ leading: n, name: t, filter: l }) {
|
|
2109
2109
|
return /* @__PURE__ */ c("div", { className: "cms-list-head", children: [
|
|
2110
2110
|
n != null ? /* @__PURE__ */ e("span", { className: "cms-list-head__leading", children: n }) : null,
|
|
2111
2111
|
/* @__PURE__ */ e("h2", { className: "cms-list-head__name", title: t, children: t }),
|
|
2112
|
-
l !== void 0 ? /* @__PURE__ */ e(
|
|
2112
|
+
l !== void 0 ? /* @__PURE__ */ e(Nt, { ...l }) : null
|
|
2113
2113
|
] });
|
|
2114
2114
|
}
|
|
2115
|
-
const
|
|
2116
|
-
function
|
|
2115
|
+
const wn = { bare: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Set() }, yn = (n, t) => n.size === t.size && [...n].every((l) => t.has(l));
|
|
2116
|
+
function kt(n) {
|
|
2117
2117
|
const t = /* @__PURE__ */ new Map();
|
|
2118
2118
|
for (const l of n) t.set(l.group, [...t.get(l.group) ?? [], l]);
|
|
2119
2119
|
return [...t.values()];
|
|
2120
2120
|
}
|
|
2121
|
-
function
|
|
2121
|
+
function xt(n) {
|
|
2122
2122
|
const t = /* @__PURE__ */ new Map();
|
|
2123
2123
|
for (const l of n) l.overflow !== void 0 && l.overflow !== 0 && t.set(l.overflow, [...t.get(l.overflow) ?? [], l.id]);
|
|
2124
2124
|
return [...t.entries()].sort(([l], [r]) => l - r).map(([, l]) => l);
|
|
2125
2125
|
}
|
|
2126
|
-
function
|
|
2127
|
-
var
|
|
2128
|
-
const
|
|
2129
|
-
const p = d.current, L =
|
|
2126
|
+
function fl({ label: n, actions: t, onAction: l, status: r, moreLabel: s, leading: a }) {
|
|
2127
|
+
var G;
|
|
2128
|
+
const h = t.filter((p) => p.entries === void 0 || p.entries.length > 0), d = P(null), m = P(null), b = P(null), [i, g] = D(wn), [f, v] = D(null), [u, w] = D("first"), [S, A] = D(null), [x, T] = D(null), _ = kt(h), N = _.flat(), I = ((G = N.find((p) => p.primary === !0 && p.overflow !== 0)) == null ? void 0 : G.id) ?? null, q = xt(h.filter((p) => p.id !== I)), V = N.filter((p) => p.overflow === 0), k = N.filter((p) => p.overflow !== 0), H = V.length === 1 ? V[0] ?? null : null, U = JSON.stringify([h.map((p) => [p.id, p.label, p.icon, p.group, p.overflow ?? null, p.primary === !0, p.entries !== void 0]), r ?? "", a !== void 0]), te = (p) => /* @__PURE__ */ new Set([...V.filter((L) => L !== H || p.size > 0).map((L) => L.id), ...p]), z = Ie(() => {
|
|
2129
|
+
const p = d.current, L = m.current;
|
|
2130
2130
|
if (p === null || L === null) return;
|
|
2131
|
-
const
|
|
2132
|
-
var
|
|
2133
|
-
return ((
|
|
2134
|
-
},
|
|
2135
|
-
const
|
|
2136
|
-
return
|
|
2137
|
-
},
|
|
2138
|
-
let
|
|
2139
|
-
if (
|
|
2131
|
+
const W = getComputedStyle(p), me = parseFloat(W.columnGap || "0") || 0, ae = p.clientWidth - (parseFloat(W.paddingLeft) || 0) - (parseFloat(W.paddingRight) || 0), he = (E) => {
|
|
2132
|
+
var M;
|
|
2133
|
+
return ((M = L.querySelector(E)) == null ? void 0 : M.getBoundingClientRect().width) ?? 0;
|
|
2134
|
+
}, Se = he('[data-measure="leading"]'), We = he('[data-measure="separator"]'), Be = he('[data-measure="more"]'), Te = (E, M) => he(`[data-measure="${M ? "full" : "icon"}"][data-measure-action="${CSS.escape(E)}"]`), Ee = (E, M) => {
|
|
2135
|
+
const O = te(M), se = H !== null && !O.has(H.id) ? H : null, J = _.map((He) => He.filter((Z) => !O.has(Z.id) && Z !== se)).filter((He) => He.length > 0), ke = [...J.flat(), ...se !== null ? [se] : []], Fe = ke.length + (J.length - 1) + (O.size > 0 ? 1 : 0) + (Se > 0 ? 1 : 0);
|
|
2136
|
+
return Se + ke.reduce((He, Z) => He + Te(Z.id, !E.has(Z.id)), 0) + We * Math.max(0, J.length - 1) + (O.size > 0 ? Be : 0) + me * Math.max(0, Fe - 1);
|
|
2137
|
+
}, R = k.filter((E) => E.id !== I && !q.some((M) => M.includes(E.id))).map((E) => E.id), X = [...q, ...[...R].reverse().map((E) => [E]), ...I !== null ? [[I]] : []], Ne = [...H !== null ? [[H.id]] : [], ...X];
|
|
2138
|
+
let de = null;
|
|
2139
|
+
if (Ee(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= ae) de = wn;
|
|
2140
2140
|
else {
|
|
2141
2141
|
const E = /* @__PURE__ */ new Set();
|
|
2142
|
-
for (const
|
|
2143
|
-
for (const
|
|
2144
|
-
if (
|
|
2145
|
-
|
|
2142
|
+
for (const M of Ne) {
|
|
2143
|
+
for (const O of M) E.add(O);
|
|
2144
|
+
if (Ee(E, /* @__PURE__ */ new Set()) <= ae) {
|
|
2145
|
+
de = { bare: E, hidden: /* @__PURE__ */ new Set() };
|
|
2146
2146
|
break;
|
|
2147
2147
|
}
|
|
2148
2148
|
}
|
|
2149
2149
|
}
|
|
2150
|
-
if (
|
|
2151
|
-
const E = new Set(
|
|
2152
|
-
for (const
|
|
2153
|
-
for (const
|
|
2154
|
-
if (
|
|
2150
|
+
if (de === null) {
|
|
2151
|
+
const E = new Set(Ne.flat()), M = /* @__PURE__ */ new Set(), O = () => M.size + V.length >= 2;
|
|
2152
|
+
for (const se of X) {
|
|
2153
|
+
for (const J of se) M.add(J);
|
|
2154
|
+
if (O() && Ee(E, M) <= ae) break;
|
|
2155
2155
|
}
|
|
2156
|
-
|
|
2156
|
+
O() || M.clear(), de = { bare: E, hidden: M };
|
|
2157
2157
|
}
|
|
2158
|
-
const
|
|
2159
|
-
|
|
2160
|
-
}, [
|
|
2161
|
-
|
|
2158
|
+
const o = de;
|
|
2159
|
+
g((E) => yn(E.bare, o.bare) && yn(E.hidden, o.hidden) ? E : o);
|
|
2160
|
+
}, [U]);
|
|
2161
|
+
$e(z, [z]), Q(() => {
|
|
2162
2162
|
const p = d.current;
|
|
2163
2163
|
if (p === null || typeof ResizeObserver > "u") return;
|
|
2164
|
-
const L = new ResizeObserver(() =>
|
|
2164
|
+
const L = new ResizeObserver(() => z());
|
|
2165
2165
|
return L.observe(p), () => L.disconnect();
|
|
2166
|
-
}, [
|
|
2166
|
+
}, [z]), Q(() => {
|
|
2167
2167
|
const p = typeof document > "u" ? void 0 : document.fonts;
|
|
2168
2168
|
if (p === void 0) return;
|
|
2169
2169
|
let L = !0;
|
|
2170
|
-
const
|
|
2171
|
-
L &&
|
|
2170
|
+
const W = () => {
|
|
2171
|
+
L && z();
|
|
2172
2172
|
};
|
|
2173
|
-
return p.ready.then(
|
|
2174
|
-
L = !1, p.removeEventListener("loadingdone",
|
|
2173
|
+
return p.ready.then(W), p.addEventListener("loadingdone", W), () => {
|
|
2174
|
+
L = !1, p.removeEventListener("loadingdone", W);
|
|
2175
2175
|
};
|
|
2176
|
-
}, [
|
|
2177
|
-
const j =
|
|
2178
|
-
|
|
2179
|
-
...
|
|
2180
|
-
...j.size > 0 ?
|
|
2181
|
-
].filter((p) => p !== void 0 && j.has(p.id)),
|
|
2182
|
-
var
|
|
2183
|
-
const L =
|
|
2184
|
-
let
|
|
2185
|
-
if (p.key === "ArrowRight" ?
|
|
2176
|
+
}, [z]);
|
|
2177
|
+
const j = te(i.hidden), Y = H !== null && !j.has(H.id) ? H : null, ee = (p) => j.has(p.id) || p === Y, _e = [..._.map((p) => p.filter((L) => !ee(L))).filter((p) => p.length > 0).flat(), ...Y !== null ? [Y] : []], oe = (p) => N.find((L) => L.id === p), ue = [...q.flat(), ...k.filter((p) => p.id !== I && !q.some((L) => L.includes(p.id))).map((p) => p.id).reverse()], Ce = [
|
|
2178
|
+
...I !== null && i.hidden.has(I) ? [oe(I)] : [],
|
|
2179
|
+
...ue.filter((p) => i.hidden.has(p)).map(oe),
|
|
2180
|
+
...j.size > 0 ? V : []
|
|
2181
|
+
].filter((p) => p !== void 0 && j.has(p.id)), pe = new Set(k.filter((p) => !q.some((L) => L.includes(p.id))).map((p) => p.id)), le = [..._e.map((p) => p.id), ...Ce.length > 0 ? ["more"] : []], be = S !== null && le.includes(S) ? S : le[0] ?? null, ve = (p) => {
|
|
2182
|
+
var ae, he;
|
|
2183
|
+
const L = le.indexOf(be ?? "");
|
|
2184
|
+
let W = null;
|
|
2185
|
+
if (p.key === "ArrowRight" ? W = Math.min(le.length - 1, L + 1) : p.key === "ArrowLeft" ? W = Math.max(0, L - 1) : p.key === "Home" ? W = 0 : p.key === "End" ? W = le.length - 1 : p.key === "Escape" && T(be), W === null) return;
|
|
2186
2186
|
p.preventDefault();
|
|
2187
|
-
const
|
|
2188
|
-
|
|
2189
|
-
},
|
|
2187
|
+
const me = le[W] ?? null;
|
|
2188
|
+
A(me), (he = (ae = d.current) == null ? void 0 : ae.querySelector(`[data-stop="${CSS.escape(me ?? "")}"]`)) == null || he.focus();
|
|
2189
|
+
}, we = Ce.map((p) => ({
|
|
2190
2190
|
id: p.id,
|
|
2191
|
-
label: /* @__PURE__ */ c(
|
|
2192
|
-
/* @__PURE__ */ e(
|
|
2191
|
+
label: /* @__PURE__ */ c(B, { children: [
|
|
2192
|
+
/* @__PURE__ */ e(je, { name: p.icon }),
|
|
2193
2193
|
p.label
|
|
2194
2194
|
] }),
|
|
2195
2195
|
offer: p.disabled ? { offered: !0, locked: !1, refusal: p.reason ?? "" } : { offered: !0, locked: !1 },
|
|
2196
2196
|
...p.danger ? { danger: !0 } : {},
|
|
2197
2197
|
onSelect: () => {
|
|
2198
|
-
var
|
|
2198
|
+
var W;
|
|
2199
2199
|
if (p.disabled || p.busy) return;
|
|
2200
2200
|
if (p.entries === void 0) {
|
|
2201
2201
|
l(p.id);
|
|
2202
2202
|
return;
|
|
2203
2203
|
}
|
|
2204
|
-
const L = (
|
|
2205
|
-
w("first"),
|
|
2204
|
+
const L = (W = b.current) == null ? void 0 : W.getBoundingClientRect();
|
|
2205
|
+
w("first"), v({ which: p.id, x: (L == null ? void 0 : L.left) ?? 0, y: (L == null ? void 0 : L.bottom) ?? 0 });
|
|
2206
2206
|
}
|
|
2207
|
-
})), ne =
|
|
2207
|
+
})), ne = f === null || f.which === "more" ? void 0 : N.find((p) => p.id === f.which), ye = ((ne == null ? void 0 : ne.entries) ?? []).map((p) => ({
|
|
2208
2208
|
id: p.id,
|
|
2209
|
-
label: /* @__PURE__ */ c(
|
|
2210
|
-
p.icon !== void 0 ? /* @__PURE__ */ e(
|
|
2209
|
+
label: /* @__PURE__ */ c(B, { children: [
|
|
2210
|
+
p.icon !== void 0 ? /* @__PURE__ */ e(je, { name: p.icon }) : null,
|
|
2211
2211
|
p.label
|
|
2212
2212
|
] }),
|
|
2213
2213
|
offer: p.disabled ? { offered: !0, locked: !1, refusal: p.reason ?? "" } : { offered: !0, locked: !1 },
|
|
@@ -2215,24 +2215,24 @@ function hl({ label: n, actions: t, onAction: l, status: r, moreLabel: s, leadin
|
|
|
2215
2215
|
onSelect: () => {
|
|
2216
2216
|
p.disabled || l(p.id);
|
|
2217
2217
|
}
|
|
2218
|
-
})), y = (p, L,
|
|
2219
|
-
const
|
|
2220
|
-
w(
|
|
2221
|
-
},
|
|
2222
|
-
|
|
2218
|
+
})), y = (p, L, W) => {
|
|
2219
|
+
const me = L.getBoundingClientRect();
|
|
2220
|
+
w(W), v({ which: p, x: me.left, y: me.bottom });
|
|
2221
|
+
}, C = k.length + (H !== null ? 1 : 0), K = (p) => /* @__PURE__ */ e(
|
|
2222
|
+
Mt,
|
|
2223
2223
|
{
|
|
2224
2224
|
action: p,
|
|
2225
2225
|
labels: !i.bare.has(p.id),
|
|
2226
2226
|
overflowed: j.has(p.id),
|
|
2227
|
-
pinned:
|
|
2228
|
-
tabbable:
|
|
2227
|
+
pinned: pe.has(p.id),
|
|
2228
|
+
tabbable: be === p.id,
|
|
2229
2229
|
tipOff: x === p.id,
|
|
2230
|
-
menuOpen: (
|
|
2231
|
-
onChoose: (L,
|
|
2232
|
-
p.entries === void 0 ? l(p.id) : (
|
|
2230
|
+
menuOpen: (f == null ? void 0 : f.which) === p.id,
|
|
2231
|
+
onChoose: (L, W) => {
|
|
2232
|
+
p.entries === void 0 ? l(p.id) : (f == null ? void 0 : f.which) === p.id && W === null ? v(null) : y(p.id, L, W ?? "first");
|
|
2233
2233
|
},
|
|
2234
2234
|
onFocus: () => {
|
|
2235
|
-
|
|
2235
|
+
A(p.id), T(null);
|
|
2236
2236
|
}
|
|
2237
2237
|
},
|
|
2238
2238
|
p.id
|
|
@@ -2243,60 +2243,60 @@ function hl({ label: n, actions: t, onAction: l, status: r, moreLabel: s, leadin
|
|
|
2243
2243
|
ref: d,
|
|
2244
2244
|
role: "toolbar",
|
|
2245
2245
|
"aria-label": n,
|
|
2246
|
-
className:
|
|
2246
|
+
className: F(
|
|
2247
2247
|
"cms-pane-toolbar",
|
|
2248
|
-
|
|
2249
|
-
i.bare.size > 0 && i.bare.size <
|
|
2248
|
+
C > 0 && i.bare.size >= C && "cms-pane-toolbar--labels-hidden",
|
|
2249
|
+
i.bare.size > 0 && i.bare.size < C && "cms-pane-toolbar--labels-partly-hidden"
|
|
2250
2250
|
),
|
|
2251
|
-
onKeyDown:
|
|
2251
|
+
onKeyDown: ve,
|
|
2252
2252
|
children: [
|
|
2253
2253
|
a !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: a }) : null,
|
|
2254
|
-
|
|
2255
|
-
const
|
|
2254
|
+
_.map((p, L) => {
|
|
2255
|
+
const W = p.filter((ae) => !ee(ae)), me = _.slice(0, L).some((ae) => ae.some((he) => !ee(he)));
|
|
2256
2256
|
return /* @__PURE__ */ c("div", { className: "cms-pane-toolbar__group-wrap", children: [
|
|
2257
|
-
|
|
2258
|
-
/* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden:
|
|
2257
|
+
W.length > 0 && me ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
|
|
2258
|
+
/* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: W.length === 0, children: p.filter((ae) => ae !== Y).map((ae) => K(ae)) })
|
|
2259
2259
|
] }, L);
|
|
2260
2260
|
}),
|
|
2261
|
-
|
|
2262
|
-
|
|
2261
|
+
Y !== null ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group cms-pane-toolbar__lone", children: K(Y) }) : null,
|
|
2262
|
+
Ce.length > 0 ? /* @__PURE__ */ e(
|
|
2263
2263
|
"button",
|
|
2264
2264
|
{
|
|
2265
|
-
ref:
|
|
2265
|
+
ref: b,
|
|
2266
2266
|
type: "button",
|
|
2267
2267
|
className: "cms-icon-button cms-pane-toolbar__more",
|
|
2268
2268
|
"data-stop": "more",
|
|
2269
2269
|
"aria-label": s,
|
|
2270
2270
|
title: s,
|
|
2271
2271
|
"aria-haspopup": "menu",
|
|
2272
|
-
"aria-expanded": (
|
|
2273
|
-
tabIndex:
|
|
2274
|
-
onFocus: () =>
|
|
2272
|
+
"aria-expanded": (f == null ? void 0 : f.which) === "more",
|
|
2273
|
+
tabIndex: be === "more" ? 0 : -1,
|
|
2274
|
+
onFocus: () => A("more"),
|
|
2275
2275
|
onClick: (p) => {
|
|
2276
|
-
(
|
|
2276
|
+
(f == null ? void 0 : f.which) === "more" ? v(null) : y("more", p.currentTarget, "first");
|
|
2277
2277
|
},
|
|
2278
2278
|
onKeyDown: (p) => {
|
|
2279
2279
|
(p.key === "ArrowDown" || p.key === "ArrowUp") && (p.preventDefault(), p.stopPropagation(), y("more", p.currentTarget, p.key === "ArrowUp" ? "last" : "first"));
|
|
2280
2280
|
},
|
|
2281
|
-
children: /* @__PURE__ */ e(
|
|
2281
|
+
children: /* @__PURE__ */ e($, { name: "more" })
|
|
2282
2282
|
}
|
|
2283
2283
|
) : null,
|
|
2284
2284
|
r !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: r, children: r }) : null,
|
|
2285
|
-
/* @__PURE__ */ e(Ke, { at: (
|
|
2286
|
-
/* @__PURE__ */ e(Ke, { at: ne !== void 0 ?
|
|
2287
|
-
/* @__PURE__ */ c("div", { ref:
|
|
2285
|
+
/* @__PURE__ */ e(Ke, { at: (f == null ? void 0 : f.which) === "more" ? f : null, items: we, onClose: () => v(null), label: s, focus: u }),
|
|
2286
|
+
/* @__PURE__ */ e(Ke, { at: ne !== void 0 ? f : null, items: ye, onClose: () => v(null), label: (ne == null ? void 0 : ne.label) ?? "", focus: u }),
|
|
2287
|
+
/* @__PURE__ */ c("div", { ref: m, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
|
|
2288
2288
|
a !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: a }) : null,
|
|
2289
2289
|
/* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
|
|
2290
|
-
/* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(
|
|
2291
|
-
|
|
2292
|
-
/* @__PURE__ */ c("span", { "data-measure": "full", "data-measure-action": p.id, className:
|
|
2293
|
-
/* @__PURE__ */ e(
|
|
2290
|
+
/* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e($, { name: "more" }) }),
|
|
2291
|
+
N.map((p) => /* @__PURE__ */ c("span", { children: [
|
|
2292
|
+
/* @__PURE__ */ c("span", { "data-measure": "full", "data-measure-action": p.id, className: F("cms-pane-toolbar__action", p.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
|
|
2293
|
+
/* @__PURE__ */ e(je, { name: p.icon }),
|
|
2294
2294
|
/* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: p.label }),
|
|
2295
|
-
p.entries !== void 0 ? /* @__PURE__ */ e(
|
|
2295
|
+
p.entries !== void 0 ? /* @__PURE__ */ e(nn, {}) : null
|
|
2296
2296
|
] }),
|
|
2297
|
-
/* @__PURE__ */ c("span", { "data-measure": "icon", "data-measure-action": p.id, className:
|
|
2298
|
-
Ue(p.icon) !== null ? /* @__PURE__ */ e(
|
|
2299
|
-
p.entries !== void 0 ? /* @__PURE__ */ e(
|
|
2297
|
+
/* @__PURE__ */ c("span", { "data-measure": "icon", "data-measure-action": p.id, className: F("cms-pane-toolbar__action", Ue(p.icon) !== null && "cms-pane-toolbar__action--bare", p.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
|
|
2298
|
+
Ue(p.icon) !== null ? /* @__PURE__ */ e(je, { name: p.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: p.label }),
|
|
2299
|
+
p.entries !== void 0 ? /* @__PURE__ */ e(nn, {}) : null
|
|
2300
2300
|
] })
|
|
2301
2301
|
] }, p.id))
|
|
2302
2302
|
] })
|
|
@@ -2304,23 +2304,23 @@ function hl({ label: n, actions: t, onAction: l, status: r, moreLabel: s, leadin
|
|
|
2304
2304
|
}
|
|
2305
2305
|
);
|
|
2306
2306
|
}
|
|
2307
|
-
const
|
|
2308
|
-
function
|
|
2309
|
-
const [
|
|
2310
|
-
|
|
2307
|
+
const Oe = "tip";
|
|
2308
|
+
function Mt({ action: n, labels: t, overflowed: l, pinned: r, tabbable: s, tipOff: a, menuOpen: h, onChoose: d, onFocus: m }) {
|
|
2309
|
+
const [b, i] = D(!1);
|
|
2310
|
+
Q(() => {
|
|
2311
2311
|
if (!n.busy) {
|
|
2312
2312
|
i(!1);
|
|
2313
2313
|
return;
|
|
2314
2314
|
}
|
|
2315
|
-
const
|
|
2316
|
-
return () => clearTimeout(
|
|
2315
|
+
const _ = setTimeout(() => i(!0), Je);
|
|
2316
|
+
return () => clearTimeout(_);
|
|
2317
2317
|
}, [n.busy]);
|
|
2318
|
-
const
|
|
2318
|
+
const g = Ue(n.icon) === null, f = t || g, v = n.disabled && n.reason ? n.reason : null, u = v ?? (f ? null : n.label), w = fe(), [S, A] = D(!1), x = an(), T = n.entries !== void 0;
|
|
2319
2319
|
return /* @__PURE__ */ c(
|
|
2320
2320
|
"button",
|
|
2321
2321
|
{
|
|
2322
2322
|
type: "button",
|
|
2323
|
-
className:
|
|
2323
|
+
className: F("cms-pane-toolbar__action", !f && "cms-pane-toolbar__action--bare", g && "cms-pane-toolbar__action--text", T && "cms-pane-toolbar__action--menu", n.danger && "is-danger"),
|
|
2324
2324
|
"data-action": n.id,
|
|
2325
2325
|
"data-stop": n.id,
|
|
2326
2326
|
...l ? { "data-overflowed": "" } : {},
|
|
@@ -2329,62 +2329,62 @@ function xt({ action: n, labels: t, overflowed: l, pinned: r, tabbable: s, tipOf
|
|
|
2329
2329
|
"aria-label": n.label,
|
|
2330
2330
|
"aria-disabled": n.disabled || void 0,
|
|
2331
2331
|
"aria-busy": n.busy || void 0,
|
|
2332
|
-
...
|
|
2333
|
-
...
|
|
2334
|
-
...
|
|
2335
|
-
...x.dismissed(
|
|
2332
|
+
...T ? { "aria-haspopup": "menu", "aria-expanded": h } : {},
|
|
2333
|
+
...v === null ? {} : { "aria-describedby": w },
|
|
2334
|
+
...S && v !== null ? { "data-reason-shown": "" } : {},
|
|
2335
|
+
...x.dismissed(Oe) ? { "data-tip-dismissed": "" } : {},
|
|
2336
2336
|
tabIndex: s ? 0 : -1,
|
|
2337
2337
|
onFocus: () => {
|
|
2338
|
-
|
|
2338
|
+
m(), x.focusIn(Oe);
|
|
2339
2339
|
},
|
|
2340
2340
|
onBlur: () => {
|
|
2341
|
-
|
|
2341
|
+
A(!1), x.focusOut(Oe);
|
|
2342
2342
|
},
|
|
2343
|
-
onMouseEnter: () => x.pointerIn(
|
|
2344
|
-
onMouseLeave: () => x.pointerOut(
|
|
2345
|
-
onKeyDown: (
|
|
2346
|
-
|
|
2343
|
+
onMouseEnter: () => x.pointerIn(Oe),
|
|
2344
|
+
onMouseLeave: () => x.pointerOut(Oe),
|
|
2345
|
+
onKeyDown: (_) => {
|
|
2346
|
+
_.key === "Escape" && (A(!1), x.dismiss(Oe)), T && (_.key === "ArrowDown" || _.key === "ArrowUp") && (_.preventDefault(), v !== null ? A(!0) : !n.disabled && !n.busy && d(_.currentTarget, _.key === "ArrowUp" ? "last" : "first"));
|
|
2347
2347
|
},
|
|
2348
|
-
onClick: (
|
|
2349
|
-
|
|
2348
|
+
onClick: (_) => {
|
|
2349
|
+
v !== null ? (A(!0), x.show(Oe)) : !n.disabled && !n.busy && d(_.currentTarget, null);
|
|
2350
2350
|
},
|
|
2351
2351
|
children: [
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2352
|
+
b ? /* @__PURE__ */ e(re, { name: "spinner" }) : /* @__PURE__ */ e(je, { name: n.icon }),
|
|
2353
|
+
f ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
|
|
2354
|
+
T ? /* @__PURE__ */ e(nn, {}) : null,
|
|
2355
|
+
v !== null || u !== null && !a ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: w, children: u }) : null
|
|
2356
2356
|
]
|
|
2357
2357
|
}
|
|
2358
2358
|
);
|
|
2359
2359
|
}
|
|
2360
|
-
function
|
|
2361
|
-
return /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__chevron", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
2360
|
+
function nn() {
|
|
2361
|
+
return /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__chevron", "aria-hidden": "true", children: /* @__PURE__ */ e($, { name: "chevron-down", size: 14 }) });
|
|
2362
2362
|
}
|
|
2363
|
-
function
|
|
2363
|
+
function je({ name: n }) {
|
|
2364
2364
|
const t = Ue(n);
|
|
2365
|
-
return t === null ? null : /* @__PURE__ */ e(
|
|
2366
|
-
}
|
|
2367
|
-
function
|
|
2368
|
-
const [i,
|
|
2369
|
-
r &&
|
|
2370
|
-
},
|
|
2371
|
-
var
|
|
2372
|
-
|
|
2365
|
+
return t === null ? null : /* @__PURE__ */ e($, { name: t, size: 18 });
|
|
2366
|
+
}
|
|
2367
|
+
function pl({ title: n, body: t = null, time: l = null, unread: r, unreadLabel: s, expandLabel: a, collapseLabel: h, action: d = null, onRead: m, leading: b }) {
|
|
2368
|
+
const [i, g] = D(!1), f = fe(), v = () => {
|
|
2369
|
+
r && m();
|
|
2370
|
+
}, u = (d == null ? void 0 : d.presentation) === "row" && d.onAction !== void 0, w = (d == null ? void 0 : d.presentation) === "button" && d.onAction !== void 0 ? d : null, S = () => {
|
|
2371
|
+
var A;
|
|
2372
|
+
v(), u && ((A = d.onAction) == null || A.call(d));
|
|
2373
2373
|
};
|
|
2374
|
-
return /* @__PURE__ */ c("article", { className:
|
|
2374
|
+
return /* @__PURE__ */ c("article", { className: F("cms-notification", r && "is-unread", i && "is-expanded", u && "is-row-action"), "data-state": r ? "unread" : "read", children: [
|
|
2375
2375
|
/* @__PURE__ */ c(
|
|
2376
2376
|
"div",
|
|
2377
2377
|
{
|
|
2378
2378
|
className: "cms-notification__row",
|
|
2379
2379
|
role: "button",
|
|
2380
2380
|
tabIndex: 0,
|
|
2381
|
-
"aria-describedby": t === null ? void 0 :
|
|
2382
|
-
onClick:
|
|
2383
|
-
onKeyDown: (
|
|
2384
|
-
|
|
2381
|
+
"aria-describedby": t === null ? void 0 : f,
|
|
2382
|
+
onClick: S,
|
|
2383
|
+
onKeyDown: (A) => {
|
|
2384
|
+
A.target !== A.currentTarget || A.key !== "Enter" && A.key !== " " || (A.preventDefault(), S());
|
|
2385
2385
|
},
|
|
2386
2386
|
children: [
|
|
2387
|
-
|
|
2387
|
+
b != null ? /* @__PURE__ */ e("span", { className: "cms-notification__leading", children: b }) : null,
|
|
2388
2388
|
/* @__PURE__ */ c("span", { className: "cms-notification__text", children: [
|
|
2389
2389
|
/* @__PURE__ */ c("span", { className: "cms-notification__head", children: [
|
|
2390
2390
|
/* @__PURE__ */ c("span", { className: "cms-notification__title", children: [
|
|
@@ -2396,7 +2396,7 @@ function fl({ title: n, body: t = null, time: l = null, unread: r, unreadLabel:
|
|
|
2396
2396
|
] }),
|
|
2397
2397
|
l !== null ? /* @__PURE__ */ e("span", { className: "cms-notification__time", children: l }) : null
|
|
2398
2398
|
] }),
|
|
2399
|
-
t !== null && t !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id:
|
|
2399
|
+
t !== null && t !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id: f, children: t }) : null
|
|
2400
2400
|
] }),
|
|
2401
2401
|
r ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
|
|
2402
2402
|
]
|
|
@@ -2408,13 +2408,13 @@ function fl({ title: n, body: t = null, time: l = null, unread: r, unreadLabel:
|
|
|
2408
2408
|
type: "button",
|
|
2409
2409
|
className: "cms-notification__chevron",
|
|
2410
2410
|
"aria-expanded": i,
|
|
2411
|
-
"aria-controls":
|
|
2412
|
-
"aria-label": i ?
|
|
2413
|
-
title: i ?
|
|
2411
|
+
"aria-controls": f,
|
|
2412
|
+
"aria-label": i ? h : a,
|
|
2413
|
+
title: i ? h : a,
|
|
2414
2414
|
onClick: () => {
|
|
2415
|
-
i ||
|
|
2415
|
+
i || v(), g((A) => !A);
|
|
2416
2416
|
},
|
|
2417
|
-
children: /* @__PURE__ */ e(
|
|
2417
|
+
children: /* @__PURE__ */ e($, { name: "chevron-down", size: 18 })
|
|
2418
2418
|
}
|
|
2419
2419
|
) : null,
|
|
2420
2420
|
w !== null ? /* @__PURE__ */ e(
|
|
@@ -2423,19 +2423,19 @@ function fl({ title: n, body: t = null, time: l = null, unread: r, unreadLabel:
|
|
|
2423
2423
|
type: "button",
|
|
2424
2424
|
className: "cms-button cms-notification__action",
|
|
2425
2425
|
onClick: () => {
|
|
2426
|
-
var
|
|
2427
|
-
|
|
2426
|
+
var A;
|
|
2427
|
+
v(), (A = w.onAction) == null || A.call(w);
|
|
2428
2428
|
},
|
|
2429
2429
|
children: w.label
|
|
2430
2430
|
}
|
|
2431
2431
|
) : null
|
|
2432
2432
|
] });
|
|
2433
2433
|
}
|
|
2434
|
-
function
|
|
2434
|
+
function Ct(n) {
|
|
2435
2435
|
return n === "allowed" || n === "elevate" || n === "denied";
|
|
2436
2436
|
}
|
|
2437
|
-
function
|
|
2438
|
-
if (!
|
|
2437
|
+
function bl(n, t) {
|
|
2438
|
+
if (!Ct(n))
|
|
2439
2439
|
return t.showRefused ? { offered: !0, locked: !1, refusal: "not available: the server gave an answer this app does not know", unknown: !0 } : { offered: !1, locked: !1, unknown: !0 };
|
|
2440
2440
|
switch (n) {
|
|
2441
2441
|
case "allowed":
|
|
@@ -2446,323 +2446,343 @@ function pl(n, t) {
|
|
|
2446
2446
|
return t.showRefused ? { offered: !0, locked: !1, refusal: t.refusal ?? "not allowed" } : { offered: !1, locked: !1 };
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
|
-
function
|
|
2449
|
+
function St(n, t) {
|
|
2450
2450
|
if (!n) return;
|
|
2451
2451
|
if (typeof n.get == "function") return n.get(t) ?? void 0;
|
|
2452
2452
|
const l = n, r = Object.keys(l).find((s) => s.toLowerCase() === t.toLowerCase());
|
|
2453
2453
|
return r === void 0 ? void 0 : l[r];
|
|
2454
2454
|
}
|
|
2455
|
-
function
|
|
2455
|
+
function Et(n) {
|
|
2456
2456
|
if (n && typeof n == "object") {
|
|
2457
2457
|
const t = n;
|
|
2458
2458
|
if (typeof t.detail == "string" && t.detail !== "") return t.detail;
|
|
2459
2459
|
if (typeof t.title == "string" && t.title !== "") return t.title;
|
|
2460
2460
|
}
|
|
2461
2461
|
}
|
|
2462
|
-
function
|
|
2462
|
+
function _l(n, t, l, r) {
|
|
2463
2463
|
if (n !== 403) return { kind: "none" };
|
|
2464
|
-
const s =
|
|
2465
|
-
return
|
|
2464
|
+
const s = Et(l);
|
|
2465
|
+
return St(t, "X-Elevation-Required") !== void 0 ? r.elevates ? { kind: "elevation-required", message: s ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: s ?? "The server refused this." };
|
|
2466
2466
|
}
|
|
2467
|
-
const
|
|
2468
|
-
function
|
|
2469
|
-
window.dispatchEvent(new Event(
|
|
2467
|
+
const tn = "coolms-kit:reread";
|
|
2468
|
+
function vl() {
|
|
2469
|
+
window.dispatchEvent(new Event(tn));
|
|
2470
2470
|
}
|
|
2471
|
-
function
|
|
2472
|
-
const [t, l] =
|
|
2471
|
+
function gl(n) {
|
|
2472
|
+
const [t, l] = D(void 0), [r, s] = D(void 0), [a, h] = D(!0), d = P(n);
|
|
2473
2473
|
d.current = n;
|
|
2474
|
-
const
|
|
2475
|
-
const i = ++
|
|
2476
|
-
|
|
2477
|
-
(
|
|
2478
|
-
i ===
|
|
2474
|
+
const m = P(0), b = Ie(() => {
|
|
2475
|
+
const i = ++m.current;
|
|
2476
|
+
h(!0), d.current().then(
|
|
2477
|
+
(g) => {
|
|
2478
|
+
i === m.current && (l(g), s(void 0), h(!1));
|
|
2479
2479
|
},
|
|
2480
|
-
(
|
|
2481
|
-
i ===
|
|
2480
|
+
(g) => {
|
|
2481
|
+
i === m.current && (s(g), h(!1));
|
|
2482
2482
|
}
|
|
2483
2483
|
);
|
|
2484
2484
|
}, []);
|
|
2485
|
-
return
|
|
2486
|
-
|
|
2487
|
-
const i = () =>
|
|
2488
|
-
return window.addEventListener("focus", i), window.addEventListener(
|
|
2489
|
-
window.removeEventListener("focus", i), window.removeEventListener(
|
|
2485
|
+
return Q(() => {
|
|
2486
|
+
b();
|
|
2487
|
+
const i = () => b();
|
|
2488
|
+
return window.addEventListener("focus", i), window.addEventListener(tn, i), () => {
|
|
2489
|
+
window.removeEventListener("focus", i), window.removeEventListener(tn, i);
|
|
2490
2490
|
};
|
|
2491
|
-
}, [
|
|
2491
|
+
}, [b]), { value: t, error: r, loading: a, reread: b };
|
|
2492
2492
|
}
|
|
2493
|
-
function
|
|
2493
|
+
function wl(n) {
|
|
2494
2494
|
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 };
|
|
2495
2495
|
}
|
|
2496
|
-
const
|
|
2497
|
-
function
|
|
2496
|
+
const At = "/errors/client-update-required";
|
|
2497
|
+
function Tt(n, t) {
|
|
2498
2498
|
const l = n.split(".").map((s) => Number.parseInt(s, 10) || 0), r = t.split(".").map((s) => Number.parseInt(s, 10) || 0);
|
|
2499
2499
|
for (let s = 0; s < Math.max(l.length, r.length); s++) {
|
|
2500
|
-
const a = l[s] ?? 0,
|
|
2501
|
-
if (a !==
|
|
2500
|
+
const a = l[s] ?? 0, h = r[s] ?? 0;
|
|
2501
|
+
if (a !== h) return a < h;
|
|
2502
2502
|
}
|
|
2503
2503
|
return !1;
|
|
2504
2504
|
}
|
|
2505
|
-
function
|
|
2506
|
-
return n.problemType !== void 0 && n.problemType.endsWith(
|
|
2505
|
+
function yl(n) {
|
|
2506
|
+
return n.problemType !== void 0 && n.problemType.endsWith(At) ? !0 : n.minimumVersion !== void 0 && Tt(n.version, n.minimumVersion);
|
|
2507
2507
|
}
|
|
2508
|
-
const
|
|
2509
|
-
function
|
|
2508
|
+
const Pe = "primary", Nn = 4, Lt = 48;
|
|
2509
|
+
function Dt(n, t, l) {
|
|
2510
2510
|
const r = n.querySelector(":scope > .cms-screen__bar");
|
|
2511
2511
|
return l <= t.scrollHeight - t.clientHeight - ((r == null ? void 0 : r.offsetHeight) ?? 0);
|
|
2512
2512
|
}
|
|
2513
|
-
const
|
|
2514
|
-
function
|
|
2515
|
-
const [l, r] =
|
|
2516
|
-
return
|
|
2513
|
+
const It = 800, $t = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "]);
|
|
2514
|
+
function Bt(n, t) {
|
|
2515
|
+
const [l, r] = D(!1);
|
|
2516
|
+
return Q(() => {
|
|
2517
2517
|
const s = n.current;
|
|
2518
2518
|
if (s === null || !t) {
|
|
2519
2519
|
r(!1);
|
|
2520
2520
|
return;
|
|
2521
2521
|
}
|
|
2522
2522
|
const a = /* @__PURE__ */ new WeakMap();
|
|
2523
|
-
let
|
|
2524
|
-
const
|
|
2525
|
-
|
|
2526
|
-
},
|
|
2527
|
-
const
|
|
2528
|
-
!(
|
|
2529
|
-
}, i = (
|
|
2530
|
-
const
|
|
2531
|
-
if (!(
|
|
2532
|
-
const
|
|
2533
|
-
if (a.set(
|
|
2523
|
+
let h = Number.NEGATIVE_INFINITY, d = null;
|
|
2524
|
+
const m = (f) => {
|
|
2525
|
+
h = performance.now(), d = f.target;
|
|
2526
|
+
}, b = (f) => {
|
|
2527
|
+
const v = f.target;
|
|
2528
|
+
!(v instanceof HTMLElement && (v.isContentEditable || v.closest("input, textarea, select") !== null)) && $t.has(f.key) && m(f);
|
|
2529
|
+
}, i = (f) => {
|
|
2530
|
+
const v = f.target;
|
|
2531
|
+
if (!(v instanceof HTMLElement)) return;
|
|
2532
|
+
const u = v.scrollTop, w = a.get(v) ?? 0;
|
|
2533
|
+
if (a.set(v, u), u <= 0) {
|
|
2534
2534
|
r(!1);
|
|
2535
2535
|
return;
|
|
2536
2536
|
}
|
|
2537
|
-
performance.now() -
|
|
2538
|
-
},
|
|
2539
|
-
for (const [
|
|
2537
|
+
performance.now() - h > It || !(d === s || d === document.body || d instanceof Node && v.contains(d)) || (u < w - Nn ? r(!1) : u > w + Nn && u > Lt && Dt(s, v, u) && r(!0));
|
|
2538
|
+
}, g = [["wheel", m], ["touchmove", m], ["pointerdown", m], ["keydown", b]];
|
|
2539
|
+
for (const [f, v] of g) s.addEventListener(f, v, { capture: !0, passive: !0 });
|
|
2540
2540
|
return s.addEventListener("scroll", i, { capture: !0, passive: !0 }), () => {
|
|
2541
|
-
for (const [
|
|
2541
|
+
for (const [f, v] of g) s.removeEventListener(f, v, { capture: !0 });
|
|
2542
2542
|
s.removeEventListener("scroll", i, { capture: !0 });
|
|
2543
2543
|
};
|
|
2544
2544
|
}, [n, t]), [l, r];
|
|
2545
2545
|
}
|
|
2546
|
-
const
|
|
2547
|
-
function
|
|
2548
|
-
const i = [...a ? [r] : [], r, r, ...d],
|
|
2549
|
-
return n - (t > 0 ? t + l : 0) - l -
|
|
2550
|
-
}
|
|
2551
|
-
function
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2546
|
+
const Ft = 64;
|
|
2547
|
+
function Ht({ bar: n, leading: t, gap: l, icon: r, iconGap: s, search: a, more: h, globals: d, name: m, choice: b }) {
|
|
2548
|
+
const i = [...a ? [r] : [], r, r, ...d], g = i.reduce((v, u) => v + u, 0) + s * (i.length - 1);
|
|
2549
|
+
return n - (t > 0 ? t + l : 0) - l - g + 0.01 < Math.min(Ft, m) + b;
|
|
2550
|
+
}
|
|
2551
|
+
function Nl({ title: n, back: t, navigation: l, search: r, searching: s, more: a = [], moreLabel: h = "More actions", globals: d, filter: m, primary: b, onRefresh: i, pullText: g, barHidden: f, children: v }) {
|
|
2552
|
+
var Te, Ee;
|
|
2553
|
+
const u = b === void 0 || ("menu" in b ? !b.menu.some((R) => R.offer.offered) : ((Te = b.offer) == null ? void 0 : Te.offered) === !1) ? void 0 : b, w = u !== void 0 && !("menu" in u) ? ((Ee = u.offer) == null ? void 0 : Ee.refusal) ?? null : null, S = fe(), [A, x] = D(!1), T = an(), _ = P(null), N = P(null), [I, q] = D(!1), [V, k] = D(null), [H, U] = D(null), te = Ie(() => U(null), []), z = P(!1), j = P(null), Y = P(null), ee = P(null), ce = a.some((R) => R.offer.offered), _e = H !== null && ce && s === void 0;
|
|
2554
|
+
An(m);
|
|
2555
|
+
const oe = m === void 0 ? null : Cn(m), [ue, Ce] = D(!1), pe = P(!1), le = P(!1), be = P(null), ve = m === void 0 ? void 0 : {
|
|
2556
|
+
...m,
|
|
2557
|
+
onChange: (R) => {
|
|
2558
|
+
pe.current = !0, m.onChange(R);
|
|
2558
2559
|
}
|
|
2559
|
-
},
|
|
2560
|
-
const
|
|
2561
|
-
if (
|
|
2562
|
-
const
|
|
2563
|
-
if (
|
|
2564
|
-
const
|
|
2565
|
-
var
|
|
2566
|
-
return ((
|
|
2567
|
-
},
|
|
2568
|
-
return
|
|
2569
|
-
bar:
|
|
2570
|
-
leading:
|
|
2571
|
-
gap:
|
|
2572
|
-
icon:
|
|
2573
|
-
iconGap:
|
|
2560
|
+
}, we = oe === null ? "" : ` · ${oe.label}`, ne = m !== void 0 && m.options.length >= 2, [ye, y] = D(!1), C = ne && ce && ye, K = JSON.stringify([ne, ce, C, r !== void 0, s !== void 0, t !== void 0, n, we]), G = Ie(() => {
|
|
2561
|
+
const R = j.current, X = Y.current, Ne = ee.current;
|
|
2562
|
+
if (R === null || X === null || Ne === null || !ne) return null;
|
|
2563
|
+
const de = (J) => parseFloat(J) || 0, o = getComputedStyle(R), E = R.getBoundingClientRect().width;
|
|
2564
|
+
if (E === 0) return null;
|
|
2565
|
+
const M = (J) => {
|
|
2566
|
+
var ke;
|
|
2567
|
+
return ((ke = R.querySelector(`.cms-screen__ruler > [data-ruler="${J}"]`)) == null ? void 0 : ke.getBoundingClientRect().width) ?? 0;
|
|
2568
|
+
}, O = R.querySelector(".cms-screen__leading"), se = (r !== void 0 ? 1 : 0) + (C ? 0 : 1) + 1;
|
|
2569
|
+
return Ht({
|
|
2570
|
+
bar: E - de(o.paddingLeft) - de(o.paddingRight),
|
|
2571
|
+
leading: O === null || O.childNodes.length === 0 ? 0 : de(getComputedStyle(O).minWidth),
|
|
2572
|
+
gap: de(o.columnGap),
|
|
2573
|
+
icon: Ne.getBoundingClientRect().width,
|
|
2574
|
+
iconGap: de(getComputedStyle(X).columnGap),
|
|
2574
2575
|
search: r !== void 0,
|
|
2575
2576
|
more: !0,
|
|
2576
|
-
globals: Array.from(
|
|
2577
|
-
name:
|
|
2578
|
-
choice:
|
|
2577
|
+
globals: Array.from(X.children).slice(se).map((J) => J.getBoundingClientRect().width),
|
|
2578
|
+
name: M("name"),
|
|
2579
|
+
choice: M("choice")
|
|
2579
2580
|
});
|
|
2580
|
-
}, [
|
|
2581
|
-
|
|
2582
|
-
const
|
|
2583
|
-
|
|
2584
|
-
}, [
|
|
2585
|
-
if (
|
|
2586
|
-
const
|
|
2587
|
-
const
|
|
2588
|
-
|
|
2581
|
+
}, [K]);
|
|
2582
|
+
$e(() => {
|
|
2583
|
+
const R = G() ?? ye;
|
|
2584
|
+
R !== ye && pe.current && (le.current = !0), pe.current = !1, y(R);
|
|
2585
|
+
}, [G]), Q(() => {
|
|
2586
|
+
if (j.current === null || typeof ResizeObserver > "u") return;
|
|
2587
|
+
const R = new ResizeObserver(() => {
|
|
2588
|
+
const X = G();
|
|
2589
|
+
X !== null && y(X);
|
|
2589
2590
|
});
|
|
2590
|
-
for (const
|
|
2591
|
-
return () =>
|
|
2592
|
-
}, [
|
|
2593
|
-
const
|
|
2594
|
-
|
|
2595
|
-
var
|
|
2596
|
-
if (
|
|
2597
|
-
|
|
2598
|
-
const
|
|
2599
|
-
(
|
|
2600
|
-
}, [
|
|
2601
|
-
const
|
|
2602
|
-
|
|
2603
|
-
}),
|
|
2591
|
+
for (const X of [j.current, Y.current, ...j.current.querySelectorAll(".cms-screen__ruler > span")]) X !== null && R.observe(X);
|
|
2592
|
+
return () => R.disconnect();
|
|
2593
|
+
}, [G]);
|
|
2594
|
+
const p = P(C);
|
|
2595
|
+
$e(() => {
|
|
2596
|
+
var Ne, de, o;
|
|
2597
|
+
if (p.current === C) return;
|
|
2598
|
+
p.current = C, U(null);
|
|
2599
|
+
const R = document.activeElement;
|
|
2600
|
+
(R === document.body && be.current !== null && !be.current.isConnected || le.current && (R === document.body || ((Ne = j.current) == null ? void 0 : Ne.contains(R)) === !0)) && ((o = C ? ee.current : (de = Y.current) == null ? void 0 : de.querySelector(".cms-filter-menu")) == null || o.focus()), le.current = !1;
|
|
2601
|
+
}, [C]);
|
|
2602
|
+
const L = C && oe !== null && m !== void 0 ? `${h}, ${Sn(m)}` : h, me = st(N, i === void 0 ? null : () => {
|
|
2603
|
+
I || (q(!0), i().finally(() => q(!1)));
|
|
2604
|
+
}), ae = i === void 0 ? null : { distance: me, refreshing: I, text: g ?? null }, he = s !== void 0 || me > 0 || I || _e || ue, [Se, We] = Bt(_, f === void 0 && !he), Be = !he && (f ?? Se);
|
|
2604
2605
|
return /* @__PURE__ */ c(
|
|
2605
2606
|
"div",
|
|
2606
2607
|
{
|
|
2607
|
-
ref:
|
|
2608
|
-
className:
|
|
2609
|
-
"data-bar-hidden":
|
|
2610
|
-
onFocus: (
|
|
2611
|
-
|
|
2608
|
+
ref: _,
|
|
2609
|
+
className: F("cms-screen", u !== void 0 && "cms-screen--with-primary"),
|
|
2610
|
+
"data-bar-hidden": Be ? "" : void 0,
|
|
2611
|
+
onFocus: (R) => {
|
|
2612
|
+
be.current = R.target, Be && R.target instanceof Element && R.target.closest(".cms-screen__bar") !== null && We(!1);
|
|
2612
2613
|
},
|
|
2613
2614
|
children: [
|
|
2614
2615
|
s !== void 0 ? /* @__PURE__ */ c("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
|
|
2615
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": s.closeLabel, title: s.closeLabel, onClick: s.onClose, children: /* @__PURE__ */ e(
|
|
2616
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": s.closeLabel, title: s.closeLabel, onClick: s.onClose, children: /* @__PURE__ */ e($, { name: "chevron-left" }) }),
|
|
2616
2617
|
/* @__PURE__ */ e("div", { className: "cms-screen__search", children: s.field })
|
|
2617
|
-
] }) : /* @__PURE__ */ c("header", { ref:
|
|
2618
|
+
] }) : /* @__PURE__ */ c("header", { ref: j, className: "cms-screen__bar", children: [
|
|
2618
2619
|
/* @__PURE__ */ e("div", { className: "cms-screen__leading", children: t !== void 0 ? t.href !== void 0 ? /* @__PURE__ */ c("a", { className: "cms-screen__back", href: t.href, onClick: t.onBack, children: [
|
|
2619
|
-
/* @__PURE__ */ e(
|
|
2620
|
+
/* @__PURE__ */ e($, { name: "chevron-left" }),
|
|
2620
2621
|
/* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: t.label })
|
|
2621
2622
|
] }) : /* @__PURE__ */ c("button", { type: "button", className: "cms-screen__back", onClick: t.onBack, children: [
|
|
2622
|
-
/* @__PURE__ */ e(
|
|
2623
|
+
/* @__PURE__ */ e($, { name: "chevron-left" }),
|
|
2623
2624
|
/* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: t.label })
|
|
2624
2625
|
] }) : l }),
|
|
2625
|
-
|
|
2626
|
+
oe === null ? /* @__PURE__ */ e("h1", { className: "cms-screen__title", title: n, children: n }) : /* @__PURE__ */ c("h1", { className: "cms-screen__title cms-screen__title--filtered", title: n + we, children: [
|
|
2626
2627
|
/* @__PURE__ */ c("span", { className: "cms-screen__title-place", children: [
|
|
2627
2628
|
/* @__PURE__ */ e("span", { className: "cms-screen__title-name", children: n }),
|
|
2628
2629
|
/* @__PURE__ */ e("span", { className: "cms-screen__title-dot", children: " · " })
|
|
2629
2630
|
] }),
|
|
2630
|
-
/* @__PURE__ */ e("span", { className: "cms-screen__title-choice", children:
|
|
2631
|
+
/* @__PURE__ */ e("span", { className: "cms-screen__title-choice", children: oe.label })
|
|
2631
2632
|
] }),
|
|
2632
|
-
|
|
2633
|
+
ne && ce ? /* @__PURE__ */ c("span", { className: "cms-screen__ruler", "aria-hidden": "true", children: [
|
|
2633
2634
|
/* @__PURE__ */ e("span", { "data-ruler": "name", children: n }),
|
|
2634
|
-
|
|
2635
|
+
oe !== null ? /* @__PURE__ */ e("span", { "data-ruler": "choice", children: we }) : null
|
|
2635
2636
|
] }) : null,
|
|
2636
|
-
/* @__PURE__ */ c("div", { ref:
|
|
2637
|
-
r !== void 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": r.label, title: r.label, onClick: r.onOpen, children: /* @__PURE__ */ e(
|
|
2638
|
-
|
|
2639
|
-
|
|
2637
|
+
/* @__PURE__ */ c("div", { ref: Y, className: "cms-screen__trailing", children: [
|
|
2638
|
+
r !== void 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": r.label, title: r.label, onClick: r.onOpen, children: /* @__PURE__ */ e($, { name: "search" }) }) : null,
|
|
2639
|
+
ve !== void 0 && !C ? /* @__PURE__ */ e(Tn, { ...ve, iconOnly: !0, onOpenChange: Ce }) : null,
|
|
2640
|
+
ce ? /* @__PURE__ */ e(
|
|
2640
2641
|
"button",
|
|
2641
2642
|
{
|
|
2642
|
-
ref:
|
|
2643
|
+
ref: ee,
|
|
2643
2644
|
type: "button",
|
|
2644
|
-
className:
|
|
2645
|
+
className: F("cms-icon-button cms-screen__icon", C && oe !== null && "cms-screen__icon--active"),
|
|
2645
2646
|
"data-action": "more",
|
|
2646
2647
|
"aria-haspopup": "menu",
|
|
2647
|
-
"aria-expanded":
|
|
2648
|
-
"aria-label":
|
|
2649
|
-
title:
|
|
2648
|
+
"aria-expanded": _e,
|
|
2649
|
+
"aria-label": L,
|
|
2650
|
+
title: L,
|
|
2650
2651
|
onMouseDown: () => {
|
|
2651
|
-
|
|
2652
|
+
z.current = _e;
|
|
2652
2653
|
},
|
|
2653
|
-
onClick: (
|
|
2654
|
-
const
|
|
2655
|
-
|
|
2654
|
+
onClick: (R) => {
|
|
2655
|
+
const X = R.currentTarget.getBoundingClientRect();
|
|
2656
|
+
U(z.current ? null : { x: X.left, y: X.bottom + 4 }), z.current = !1;
|
|
2656
2657
|
},
|
|
2657
|
-
children: /* @__PURE__ */ e(
|
|
2658
|
+
children: /* @__PURE__ */ e($, { name: "more" })
|
|
2658
2659
|
}
|
|
2659
2660
|
) : null,
|
|
2660
2661
|
d
|
|
2661
2662
|
] })
|
|
2662
2663
|
] }),
|
|
2663
|
-
/* @__PURE__ */ e("div", { ref:
|
|
2664
|
-
|
|
2664
|
+
/* @__PURE__ */ e("div", { ref: N, className: "cms-screen__content", "data-pulling": me > 0 ? "" : void 0, "data-refreshing": I ? "" : void 0, children: /* @__PURE__ */ e(Mn.Provider, { value: ae, children: v }) }),
|
|
2665
|
+
u !== void 0 ? /* @__PURE__ */ c(
|
|
2665
2666
|
"button",
|
|
2666
2667
|
{
|
|
2667
2668
|
type: "button",
|
|
2668
2669
|
className: "cms-button cms-button--primary cms-screen__primary",
|
|
2669
|
-
"aria-label":
|
|
2670
|
-
title:
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2670
|
+
"aria-label": u.label,
|
|
2671
|
+
...w === null ? { title: u.label } : {
|
|
2672
|
+
"aria-disabled": !0,
|
|
2673
|
+
"aria-describedby": S,
|
|
2674
|
+
...A ? { "data-reason-shown": "" } : {},
|
|
2675
|
+
...T.dismissed(Pe) ? { "data-tip-dismissed": "" } : {}
|
|
2676
|
+
},
|
|
2677
|
+
..."menu" in u ? { "aria-haspopup": "menu", "aria-expanded": V !== null } : {},
|
|
2678
|
+
onFocus: () => T.focusIn(Pe),
|
|
2679
|
+
onBlur: () => {
|
|
2680
|
+
x(!1), T.focusOut(Pe);
|
|
2681
|
+
},
|
|
2682
|
+
onMouseEnter: () => T.pointerIn(Pe),
|
|
2683
|
+
onMouseLeave: () => T.pointerOut(Pe),
|
|
2684
|
+
onKeyDown: (R) => {
|
|
2685
|
+
R.key === "Escape" && w !== null && (x(!1), T.dismiss(Pe));
|
|
2686
|
+
},
|
|
2687
|
+
onClick: (R) => {
|
|
2688
|
+
if (w !== null)
|
|
2689
|
+
x(!0), T.show(Pe);
|
|
2690
|
+
else if ("menu" in u) {
|
|
2691
|
+
const X = R.currentTarget.getBoundingClientRect();
|
|
2692
|
+
k(V === null ? { x: X.left, y: X.top } : null);
|
|
2676
2693
|
} else
|
|
2677
|
-
|
|
2694
|
+
u.onPress();
|
|
2678
2695
|
},
|
|
2679
|
-
children:
|
|
2696
|
+
children: [
|
|
2697
|
+
/* @__PURE__ */ e($, { name: u.icon, size: 24 }),
|
|
2698
|
+
w !== null ? /* @__PURE__ */ e("span", { className: "cms-screen__tip", role: "tooltip", id: S, children: w }) : null
|
|
2699
|
+
]
|
|
2680
2700
|
}
|
|
2681
2701
|
) : null,
|
|
2682
2702
|
/* @__PURE__ */ e(
|
|
2683
2703
|
Ke,
|
|
2684
2704
|
{
|
|
2685
|
-
at:
|
|
2686
|
-
items:
|
|
2687
|
-
onClose:
|
|
2688
|
-
label:
|
|
2705
|
+
at: _e ? H : null,
|
|
2706
|
+
items: C && ve !== void 0 ? [...a, ...En(ve, ve.label)] : a,
|
|
2707
|
+
onClose: te,
|
|
2708
|
+
label: h,
|
|
2689
2709
|
focus: "first"
|
|
2690
2710
|
}
|
|
2691
2711
|
),
|
|
2692
|
-
|
|
2712
|
+
u !== void 0 && "menu" in u ? /* @__PURE__ */ e(Ke, { at: V, items: u.menu, onClose: () => k(null), label: u.label }) : null
|
|
2693
2713
|
]
|
|
2694
2714
|
}
|
|
2695
2715
|
);
|
|
2696
2716
|
}
|
|
2697
2717
|
export {
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2718
|
+
tl as AppShell,
|
|
2719
|
+
Ye as Avatar,
|
|
2720
|
+
pn as BOOTSTRAP_ICONS,
|
|
2721
|
+
bt as Badge,
|
|
2722
|
+
De as Button,
|
|
2723
|
+
on as CALL_LABELS,
|
|
2724
|
+
At as CLIENT_UPDATE_REQUIRED,
|
|
2725
|
+
dl as CallBar,
|
|
2726
|
+
ol as CallPanel,
|
|
2727
|
+
al as ChatBubble,
|
|
2728
|
+
Qt as Column,
|
|
2729
|
+
il as Composer,
|
|
2730
|
+
Vt as ConfirmDialog,
|
|
2711
2731
|
Ke as ContextMenu,
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2732
|
+
zn as EmptyState,
|
|
2733
|
+
Un as ErrorBanner,
|
|
2734
|
+
wt as FILTER_MENU_LABELS,
|
|
2735
|
+
Yt as FilePicker,
|
|
2736
|
+
Qn as FilePickerDenied,
|
|
2737
|
+
et as FilePickerRestart,
|
|
2738
|
+
jt as FileViewer,
|
|
2739
|
+
Nt as FilterMenu,
|
|
2740
|
+
Gt as ICON_NAMES,
|
|
2741
|
+
$ as Icon,
|
|
2742
|
+
cl as IncomingCall,
|
|
2743
|
+
Xt as List,
|
|
2744
|
+
hl as ListHead,
|
|
2745
|
+
Pn as Loading,
|
|
2746
|
+
vt as MAIL_ROW_LABELS,
|
|
2747
|
+
On as MODAL_CLOSE_MS,
|
|
2748
|
+
rl as MailRow,
|
|
2749
|
+
kn as Modal,
|
|
2750
|
+
Wn as NamedIcon,
|
|
2751
|
+
pl as Notification,
|
|
2752
|
+
Qe as PULL_AT,
|
|
2753
|
+
el as PageHeader,
|
|
2754
|
+
fl as PaneToolbar,
|
|
2755
|
+
gt as SIGN_IN_LABELS,
|
|
2756
|
+
Je as STATE_DELAY_MS,
|
|
2757
|
+
Nl as ScreenShell,
|
|
2758
|
+
ll as SearchField,
|
|
2759
|
+
Jt as SectionHeader,
|
|
2760
|
+
Kt as Select,
|
|
2761
|
+
ml as SignInForm,
|
|
2762
|
+
ul as SignInLayout,
|
|
2763
|
+
sl as SplitPanes,
|
|
2764
|
+
pt as Splitter,
|
|
2765
|
+
Le as State,
|
|
2766
|
+
nl as TabStrip,
|
|
2767
|
+
Ut as TextArea,
|
|
2768
|
+
zt as TextField,
|
|
2769
|
+
Zt as Toast,
|
|
2770
|
+
qt as ToastRegion,
|
|
2771
|
+
Wt as Toggle,
|
|
2772
|
+
_t as fitPanes,
|
|
2753
2773
|
Ue as iconForName,
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2774
|
+
dt as initialsOf,
|
|
2775
|
+
Ct as isCapability,
|
|
2776
|
+
yl as needsClientUpdate,
|
|
2777
|
+
bl as offerFor,
|
|
2778
|
+
wl as readConflict,
|
|
2779
|
+
_l as readRefusal,
|
|
2780
|
+
Et as refusalText,
|
|
2781
|
+
vl as rereadAll,
|
|
2782
|
+
ut as tintOf,
|
|
2783
|
+
st as usePull,
|
|
2784
|
+
rt as usePullState,
|
|
2785
|
+
gl as useReread,
|
|
2786
|
+
Tt as versionBelow,
|
|
2787
|
+
Hn as writtenOut
|
|
2768
2788
|
};
|