@coolms/ui-react 0.1.0-alpha.2 → 0.1.0-alpha.3
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 +24 -0
- package/design-tokens.lock.json +23 -3
- package/dist/components/Call.d.ts +41 -0
- package/dist/components/Icon.d.ts +12 -0
- package/dist/components/SignIn.d.ts +30 -0
- package/dist/components/Structure.d.ts +2 -0
- package/dist/components/Workspace.d.ts +129 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +784 -349
- package/package.json +7 -4
- package/src/fonts/OFL.txt +92 -0
- package/src/fonts/inter-cyrillic.woff2 +0 -0
- package/src/fonts/inter-latin-ext.woff2 +0 -0
- package/src/fonts/inter-latin.woff2 +0 -0
- package/src/fonts/inter.css +27 -0
- package/src/kit.css +261 -0
- package/src/tokens/coolms-tokens.css +77 -3
package/dist/index.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useId as A, useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
function
|
|
5
|
-
return
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { useId as A, useState as M, useRef as x, useEffect as D, useLayoutEffect as F, useCallback as H } from "react";
|
|
3
|
+
import { createPortal as Z } from "react-dom";
|
|
4
|
+
function g(...l) {
|
|
5
|
+
return l.filter(Boolean).join(" ");
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function k({ name: l }) {
|
|
8
8
|
const n = { width: 16, height: 16, viewBox: "0 0 16 16", "aria-hidden": !0, focusable: !1 };
|
|
9
|
-
switch (
|
|
9
|
+
switch (l) {
|
|
10
10
|
case "lock":
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ e("svg", { ...n, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M5 7V5a3 3 0 1 1 6 0v2h.5A1.5 1.5 0 0 1 13 8.5v5A1.5 1.5 0 0 1 11.5 15h-7A1.5 1.5 0 0 1 3 13.5v-5A1.5 1.5 0 0 1 4.5 7H5Zm1.5 0h3V5a1.5 1.5 0 0 0-3 0v2Z" }) });
|
|
12
12
|
case "spinner":
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ e("svg", { ...n, className: "cms-glyph cms-spinner", children: /* @__PURE__ */ e("circle", { cx: "8", cy: "8", r: "6", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeDasharray: "28", strokeDashoffset: "10" }) });
|
|
14
14
|
case "back":
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ e("svg", { ...n, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M10.7 2.3a1 1 0 0 1 0 1.4L6.4 8l4.3 4.3a1 1 0 0 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 0Z" }) });
|
|
16
16
|
case "close":
|
|
17
|
-
return /* @__PURE__ */
|
|
17
|
+
return /* @__PURE__ */ e("svg", { ...n, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M3.3 3.3a1 1 0 0 1 1.4 0L8 6.6l3.3-3.3a1 1 0 1 1 1.4 1.4L9.4 8l3.3 3.3a1 1 0 0 1-1.4 1.4L8 9.4l-3.3 3.3a1 1 0 0 1-1.4-1.4L6.6 8 3.3 4.7a1 1 0 0 1 0-1.4Z" }) });
|
|
18
18
|
case "warning":
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ e("svg", { ...n, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M8.9 1.5a1 1 0 0 0-1.8 0l-6 11A1 1 0 0 0 2 14h12a1 1 0 0 0 .9-1.5l-6-11ZM8 5a1 1 0 0 1 1 1v3a1 1 0 0 1-2 0V6a1 1 0 0 1 1-1Zm0 7.5A1 1 0 1 1 8 10.5a1 1 0 0 1 0 2Z" }) });
|
|
20
20
|
case "check":
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ e("svg", { ...n, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M13.7 4.3a1 1 0 0 1 0 1.4l-6 6a1 1 0 0 1-1.4 0l-3-3a1 1 0 1 1 1.4-1.4L7 9.6l5.3-5.3a1 1 0 0 1 1.4 0Z" }) });
|
|
22
22
|
case "info":
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ e("svg", { ...n, 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" }) });
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
function E({
|
|
27
|
-
variant:
|
|
27
|
+
variant: l = "secondary",
|
|
28
28
|
busy: n = !1,
|
|
29
|
-
busyLabel:
|
|
30
|
-
locked:
|
|
29
|
+
busyLabel: a,
|
|
30
|
+
locked: c = !1,
|
|
31
31
|
lockedReason: s,
|
|
32
32
|
icon: m,
|
|
33
|
-
disabled:
|
|
33
|
+
disabled: t,
|
|
34
34
|
className: u,
|
|
35
|
-
children:
|
|
36
|
-
type:
|
|
37
|
-
title:
|
|
38
|
-
...
|
|
35
|
+
children: h,
|
|
36
|
+
type: o = "button",
|
|
37
|
+
title: i,
|
|
38
|
+
...f
|
|
39
39
|
}) {
|
|
40
|
-
const
|
|
41
|
-
return /* @__PURE__ */
|
|
40
|
+
const d = !!t || n;
|
|
41
|
+
return /* @__PURE__ */ r(
|
|
42
42
|
"button",
|
|
43
43
|
{
|
|
44
|
-
...
|
|
45
|
-
type:
|
|
46
|
-
className:
|
|
47
|
-
disabled:
|
|
44
|
+
...f,
|
|
45
|
+
type: o,
|
|
46
|
+
className: g("cms-button", `cms-button--${l}`, n && "is-busy", c && "is-locked", u),
|
|
47
|
+
disabled: d,
|
|
48
48
|
"aria-busy": n || void 0,
|
|
49
|
-
title:
|
|
49
|
+
title: c ? s ?? i : i,
|
|
50
50
|
children: [
|
|
51
|
-
n ? /* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
51
|
+
n ? /* @__PURE__ */ e(k, { name: "spinner" }) : c ? /* @__PURE__ */ e(k, { name: "lock" }) : m,
|
|
52
|
+
/* @__PURE__ */ e("span", { className: "cms-button__label", children: n && a !== void 0 ? a : h }),
|
|
53
|
+
c && s ? /* @__PURE__ */ r("span", { className: "cms-visually-hidden", children: [
|
|
54
54
|
", ",
|
|
55
55
|
s
|
|
56
56
|
] }) : null
|
|
@@ -58,388 +58,807 @@ function E({
|
|
|
58
58
|
}
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
61
|
+
function I({ id: l, label: n, help: a, error: c, pinned: s, children: m }) {
|
|
62
|
+
return /* @__PURE__ */ r("div", { className: g("cms-field", c != null && "is-invalid"), children: [
|
|
63
|
+
/* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: l, children: n }),
|
|
64
64
|
m,
|
|
65
|
-
s != null ? /* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
65
|
+
s != null ? /* @__PURE__ */ r("p", { className: "cms-field__pinned", id: `${l}-pinned`, children: [
|
|
66
|
+
/* @__PURE__ */ e(k, { name: "lock" }),
|
|
67
67
|
" ",
|
|
68
68
|
s
|
|
69
69
|
] }) : null,
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
c != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${l}-error`, role: "alert", children: c }) : null,
|
|
71
|
+
a != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${l}-help`, children: a }) : null
|
|
72
72
|
] });
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const
|
|
76
|
-
return
|
|
74
|
+
function B(l, n) {
|
|
75
|
+
const a = [n.error != null && `${l}-error`, n.pinned != null && `${l}-pinned`, n.help != null && `${l}-help`].filter(Boolean).join(" ");
|
|
76
|
+
return a === "" ? void 0 : a;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
const
|
|
80
|
-
return /* @__PURE__ */
|
|
78
|
+
function ne({ label: l, help: n, error: a, disabled: c, readOnly: s, pinned: m, value: t, onChange: u, placeholder: h, type: o = "text", name: i }) {
|
|
79
|
+
const f = A();
|
|
80
|
+
return /* @__PURE__ */ e(I, { id: f, label: l, help: n, error: a, pinned: m, children: /* @__PURE__ */ e(
|
|
81
81
|
"input",
|
|
82
82
|
{
|
|
83
|
-
id:
|
|
84
|
-
name:
|
|
85
|
-
type:
|
|
83
|
+
id: f,
|
|
84
|
+
name: i,
|
|
85
|
+
type: o,
|
|
86
86
|
className: "cms-input",
|
|
87
|
-
value:
|
|
88
|
-
placeholder:
|
|
89
|
-
disabled:
|
|
87
|
+
value: t,
|
|
88
|
+
placeholder: h,
|
|
89
|
+
disabled: c,
|
|
90
90
|
readOnly: s || m != null,
|
|
91
|
-
"aria-invalid":
|
|
92
|
-
"aria-describedby":
|
|
93
|
-
onChange: (
|
|
91
|
+
"aria-invalid": a != null || void 0,
|
|
92
|
+
"aria-describedby": B(f, { help: n, error: a, pinned: m }),
|
|
93
|
+
onChange: (d) => u == null ? void 0 : u(d.target.value)
|
|
94
94
|
}
|
|
95
95
|
) });
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
const
|
|
99
|
-
return /* @__PURE__ */
|
|
97
|
+
function ae({ label: l, help: n, error: a, disabled: c, readOnly: s, value: m, options: t, onChange: u, emptyText: h = "Nothing to choose from yet.", name: o }) {
|
|
98
|
+
const i = A(), f = t.length === 0;
|
|
99
|
+
return /* @__PURE__ */ e(I, { id: i, label: l, help: f ? h : n, error: a, children: /* @__PURE__ */ e(
|
|
100
100
|
"select",
|
|
101
101
|
{
|
|
102
|
-
id:
|
|
103
|
-
name:
|
|
102
|
+
id: i,
|
|
103
|
+
name: o,
|
|
104
104
|
className: "cms-input cms-select",
|
|
105
105
|
value: m,
|
|
106
|
-
disabled:
|
|
106
|
+
disabled: c || f,
|
|
107
107
|
"aria-readonly": s || void 0,
|
|
108
|
-
"aria-invalid":
|
|
109
|
-
"aria-describedby":
|
|
110
|
-
onChange: (
|
|
111
|
-
s || u == null || u(
|
|
108
|
+
"aria-invalid": a != null || void 0,
|
|
109
|
+
"aria-describedby": B(i, { help: f ? h : n, error: a }),
|
|
110
|
+
onChange: (d) => {
|
|
111
|
+
s || u == null || u(d.target.value);
|
|
112
112
|
},
|
|
113
|
-
children:
|
|
113
|
+
children: t.map((d) => /* @__PURE__ */ e("option", { value: d.value, disabled: s && d.value !== m, children: d.label }, d.value))
|
|
114
114
|
}
|
|
115
115
|
) });
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
const
|
|
119
|
-
return /* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */
|
|
117
|
+
function se({ label: l, checked: n, onChange: a, disabled: c, readOnly: s, help: m }) {
|
|
118
|
+
const t = A();
|
|
119
|
+
return /* @__PURE__ */ r("div", { className: "cms-toggle-row", children: [
|
|
120
|
+
/* @__PURE__ */ e(
|
|
121
121
|
"button",
|
|
122
122
|
{
|
|
123
|
-
id:
|
|
123
|
+
id: t,
|
|
124
124
|
type: "button",
|
|
125
125
|
role: "switch",
|
|
126
|
-
className:
|
|
126
|
+
className: g("cms-toggle", n && "is-on"),
|
|
127
127
|
"aria-checked": n,
|
|
128
128
|
"aria-readonly": s || void 0,
|
|
129
|
-
"aria-describedby": m != null ? `${
|
|
130
|
-
disabled:
|
|
129
|
+
"aria-describedby": m != null ? `${t}-help` : void 0,
|
|
130
|
+
disabled: c,
|
|
131
131
|
onClick: () => {
|
|
132
|
-
s ||
|
|
132
|
+
s || a == null || a(!n);
|
|
133
133
|
},
|
|
134
|
-
children: /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ e("span", { className: "cms-toggle__thumb" })
|
|
135
135
|
}
|
|
136
136
|
),
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
m != null ? /* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor: t, children: l }),
|
|
138
|
+
m != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${t}-help`, children: m }) : null
|
|
139
139
|
] });
|
|
140
140
|
}
|
|
141
|
-
const
|
|
142
|
-
function
|
|
143
|
-
const [u,
|
|
144
|
-
if (
|
|
145
|
-
if (
|
|
146
|
-
|
|
141
|
+
const R = 150;
|
|
142
|
+
function z({ open: l, title: n, onClose: a, dirty: c = !1, onDirtyClose: s, children: m, footer: t }) {
|
|
143
|
+
const [u, h] = M(l), [o, i] = M(!1), f = x(null), d = x(null), v = A();
|
|
144
|
+
if (D(() => {
|
|
145
|
+
if (l) {
|
|
146
|
+
d.current = document.activeElement, h(!0), i(!1);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
if (!u) return;
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
var
|
|
153
|
-
|
|
154
|
-
},
|
|
155
|
-
return () => window.clearTimeout(
|
|
156
|
-
}, [
|
|
157
|
-
var
|
|
158
|
-
if (
|
|
159
|
-
const
|
|
160
|
-
(
|
|
150
|
+
i(!0);
|
|
151
|
+
const p = window.setTimeout(() => {
|
|
152
|
+
var N, w;
|
|
153
|
+
h(!1), i(!1), (w = (N = d.current) == null ? void 0 : N.focus) == null || w.call(N);
|
|
154
|
+
}, R);
|
|
155
|
+
return () => window.clearTimeout(p);
|
|
156
|
+
}, [l, u]), D(() => {
|
|
157
|
+
var p, N;
|
|
158
|
+
if (l && u) {
|
|
159
|
+
const w = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
|
|
160
|
+
(N = ((p = f.current) == null ? void 0 : p.querySelector(`.cms-modal__body :is(${w}), .cms-modal__foot :is(${w})`)) ?? f.current) == null || N.focus();
|
|
161
161
|
}
|
|
162
|
-
}, [
|
|
163
|
-
const
|
|
164
|
-
|
|
162
|
+
}, [l, u]), !u) return null;
|
|
163
|
+
const _ = () => {
|
|
164
|
+
c ? s == null || s() : a();
|
|
165
165
|
};
|
|
166
|
-
return
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
|
|
169
|
-
}, children: /* @__PURE__ */
|
|
166
|
+
return Z(
|
|
167
|
+
/* @__PURE__ */ e("div", { className: g("cms-modal-scrim", o && "is-closing"), onMouseDown: (p) => {
|
|
168
|
+
p.target === p.currentTarget && _();
|
|
169
|
+
}, children: /* @__PURE__ */ r(
|
|
170
170
|
"div",
|
|
171
171
|
{
|
|
172
|
-
ref:
|
|
173
|
-
className:
|
|
172
|
+
ref: f,
|
|
173
|
+
className: g("cms-modal", o && "is-closing", c && "is-dirty"),
|
|
174
174
|
role: "dialog",
|
|
175
175
|
"aria-modal": "true",
|
|
176
|
-
"aria-labelledby":
|
|
176
|
+
"aria-labelledby": v,
|
|
177
177
|
tabIndex: -1,
|
|
178
|
-
onKeyDown: (
|
|
179
|
-
var
|
|
180
|
-
if (
|
|
181
|
-
|
|
182
|
-
else if (
|
|
183
|
-
const
|
|
184
|
-
if (!
|
|
185
|
-
const
|
|
186
|
-
|
|
178
|
+
onKeyDown: (p) => {
|
|
179
|
+
var N;
|
|
180
|
+
if (p.key === "Escape")
|
|
181
|
+
p.stopPropagation(), _();
|
|
182
|
+
else if (p.key === "Tab") {
|
|
183
|
+
const w = (N = f.current) == null ? void 0 : N.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
|
|
184
|
+
if (!w || w.length === 0) return;
|
|
185
|
+
const L = w[0], T = w[w.length - 1];
|
|
186
|
+
p.shiftKey && document.activeElement === L ? (p.preventDefault(), T.focus()) : !p.shiftKey && document.activeElement === T && (p.preventDefault(), L.focus());
|
|
187
187
|
}
|
|
188
188
|
},
|
|
189
189
|
children: [
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ r("header", { className: "cms-modal__head", children: [
|
|
191
|
+
/* @__PURE__ */ e("h2", { className: "cms-modal__title", id: v, children: n }),
|
|
192
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": "Close", onClick: _, children: /* @__PURE__ */ e(k, { name: "close" }) })
|
|
193
193
|
] }),
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
|
|
194
|
+
/* @__PURE__ */ e("div", { className: "cms-modal__body", children: m }),
|
|
195
|
+
t != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: t }) : null
|
|
196
196
|
]
|
|
197
197
|
}
|
|
198
198
|
) }),
|
|
199
199
|
document.body
|
|
200
200
|
);
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
const
|
|
204
|
-
return /* @__PURE__ */
|
|
205
|
-
|
|
202
|
+
function ce({ open: l, title: n, message: a, kind: c = "default", confirmLabel: s, cancelLabel: m, onConfirm: t, onCancel: u }) {
|
|
203
|
+
const h = c === "discard-changes";
|
|
204
|
+
return /* @__PURE__ */ e(
|
|
205
|
+
z,
|
|
206
206
|
{
|
|
207
|
-
open:
|
|
207
|
+
open: l,
|
|
208
208
|
title: n,
|
|
209
209
|
onClose: u,
|
|
210
|
-
footer: /* @__PURE__ */
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
/* @__PURE__ */
|
|
210
|
+
footer: /* @__PURE__ */ r(b, { children: [
|
|
211
|
+
/* @__PURE__ */ e(E, { onClick: u, children: m ?? (h ? "Keep editing" : "Cancel") }),
|
|
212
|
+
/* @__PURE__ */ e(E, { variant: c === "default" ? "primary" : "danger", onClick: t, children: s ?? (h ? "Discard changes" : "Confirm") })
|
|
213
213
|
] }),
|
|
214
|
-
children:
|
|
215
|
-
/* @__PURE__ */
|
|
214
|
+
children: c !== "default" ? /* @__PURE__ */ r("p", { className: "cms-confirm__warning", children: [
|
|
215
|
+
/* @__PURE__ */ e(k, { name: "warning" }),
|
|
216
216
|
" ",
|
|
217
|
-
|
|
218
|
-
] }) : /* @__PURE__ */
|
|
217
|
+
a
|
|
218
|
+
] }) : /* @__PURE__ */ e("p", { children: a })
|
|
219
219
|
}
|
|
220
220
|
);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
return /* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
|
|
227
|
-
|
|
222
|
+
function te({ kind: l, message: n, action: a, onDismiss: c }) {
|
|
223
|
+
return /* @__PURE__ */ r("div", { className: g("cms-toast", `cms-toast--${l}`), role: l === "error" ? "alert" : "status", children: [
|
|
224
|
+
/* @__PURE__ */ e(k, { name: l === "success" ? "check" : l === "error" ? "warning" : "info" }),
|
|
225
|
+
/* @__PURE__ */ e("span", { className: "cms-toast__message", children: n }),
|
|
226
|
+
a ? /* @__PURE__ */ e(E, { className: "cms-toast__action", onClick: a.onAction, children: a.label }) : null,
|
|
227
|
+
c ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": "Dismiss", onClick: c, children: /* @__PURE__ */ e(k, { name: "close" }) }) : null
|
|
228
228
|
] });
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
return /* @__PURE__ */
|
|
230
|
+
function re({ children: l }) {
|
|
231
|
+
return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: l });
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
return /* @__PURE__ */
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */
|
|
233
|
+
function P({ what: l, layout: n = "inline" }) {
|
|
234
|
+
return /* @__PURE__ */ r("div", { className: g("cms-loading", `cms-loading--${n}`), role: "status", "aria-live": "polite", children: [
|
|
235
|
+
/* @__PURE__ */ e(k, { name: "spinner" }),
|
|
236
|
+
/* @__PURE__ */ e("span", { children: l })
|
|
237
237
|
] });
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
return /* @__PURE__ */
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
n != null ? /* @__PURE__ */
|
|
243
|
-
|
|
239
|
+
function V({ title: l, hint: n, action: a }) {
|
|
240
|
+
return /* @__PURE__ */ r("div", { className: "cms-empty", children: [
|
|
241
|
+
/* @__PURE__ */ e("p", { className: "cms-empty__title", children: l }),
|
|
242
|
+
n != null ? /* @__PURE__ */ e("p", { className: "cms-empty__hint", children: n }) : null,
|
|
243
|
+
a != null ? /* @__PURE__ */ e("div", { className: "cms-empty__action", children: a }) : null
|
|
244
244
|
] });
|
|
245
245
|
}
|
|
246
|
-
function
|
|
247
|
-
return /* @__PURE__ */
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
n ? /* @__PURE__ */
|
|
246
|
+
function j({ message: l, onRetry: n }) {
|
|
247
|
+
return /* @__PURE__ */ r("div", { className: "cms-error-banner", role: "alert", children: [
|
|
248
|
+
/* @__PURE__ */ e(k, { name: "warning" }),
|
|
249
|
+
/* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: l }),
|
|
250
|
+
n ? /* @__PURE__ */ e(E, { onClick: n, children: "Try again" }) : null
|
|
251
251
|
] });
|
|
252
252
|
}
|
|
253
|
-
function
|
|
254
|
-
return /* @__PURE__ */
|
|
255
|
-
|
|
253
|
+
function ie({ title: l, scope: n, actions: a, backLink: c }) {
|
|
254
|
+
return /* @__PURE__ */ r("header", { className: "cms-page-header", children: [
|
|
255
|
+
c ? /* @__PURE__ */ r(
|
|
256
256
|
"a",
|
|
257
257
|
{
|
|
258
258
|
className: "cms-page-header__back",
|
|
259
|
-
href:
|
|
259
|
+
href: c.href ?? "#",
|
|
260
260
|
onClick: (s) => {
|
|
261
|
-
|
|
261
|
+
c.onBack && (s.preventDefault(), c.onBack());
|
|
262
262
|
},
|
|
263
263
|
children: [
|
|
264
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ e(k, { name: "back" }),
|
|
265
265
|
" ",
|
|
266
|
-
|
|
266
|
+
c.label
|
|
267
267
|
]
|
|
268
268
|
}
|
|
269
269
|
) : null,
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
n != null ? /* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ r("div", { className: "cms-page-header__row", children: [
|
|
271
|
+
/* @__PURE__ */ r("div", { className: "cms-page-header__titles", children: [
|
|
272
|
+
/* @__PURE__ */ e("h1", { className: "cms-page-header__title", children: l }),
|
|
273
|
+
n != null ? /* @__PURE__ */ e("p", { className: "cms-page-header__scope", children: n }) : null
|
|
274
274
|
] }),
|
|
275
|
-
|
|
275
|
+
a != null ? /* @__PURE__ */ e("div", { className: "cms-page-header__actions", children: a }) : null
|
|
276
276
|
] })
|
|
277
277
|
] });
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
const s =
|
|
281
|
-
var
|
|
282
|
-
const
|
|
283
|
-
if (
|
|
284
|
-
|
|
285
|
-
const
|
|
286
|
-
|
|
279
|
+
function oe({ tabs: l, active: n, onSelect: a, label: c }) {
|
|
280
|
+
const s = x([]), m = (t, u) => {
|
|
281
|
+
var f;
|
|
282
|
+
const h = l.length - 1, o = t.key === "ArrowRight" ? u === h ? 0 : u + 1 : t.key === "ArrowLeft" ? u === 0 ? h : u - 1 : t.key === "Home" ? 0 : t.key === "End" ? h : null;
|
|
283
|
+
if (o === null) return;
|
|
284
|
+
t.preventDefault();
|
|
285
|
+
const i = l[o];
|
|
286
|
+
i && (a(i.id), (f = s.current[o]) == null || f.focus());
|
|
287
287
|
};
|
|
288
|
-
return /* @__PURE__ */
|
|
289
|
-
const
|
|
290
|
-
return /* @__PURE__ */
|
|
288
|
+
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": c, children: l.map((t, u) => {
|
|
289
|
+
const h = t.id === n;
|
|
290
|
+
return /* @__PURE__ */ r(
|
|
291
291
|
"button",
|
|
292
292
|
{
|
|
293
|
-
ref: (
|
|
294
|
-
s.current[u] =
|
|
293
|
+
ref: (o) => {
|
|
294
|
+
s.current[u] = o;
|
|
295
295
|
},
|
|
296
296
|
type: "button",
|
|
297
297
|
role: "tab",
|
|
298
|
-
className:
|
|
299
|
-
"aria-selected":
|
|
300
|
-
tabIndex:
|
|
301
|
-
onClick: () =>
|
|
302
|
-
onKeyDown: (
|
|
298
|
+
className: g("cms-tab", h && "is-active"),
|
|
299
|
+
"aria-selected": h,
|
|
300
|
+
tabIndex: h ? 0 : -1,
|
|
301
|
+
onClick: () => a(t.id),
|
|
302
|
+
onKeyDown: (o) => m(o, u),
|
|
303
303
|
children: [
|
|
304
|
-
|
|
305
|
-
|
|
304
|
+
t.label,
|
|
305
|
+
t.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: t.count }) : null
|
|
306
306
|
]
|
|
307
307
|
},
|
|
308
|
-
|
|
308
|
+
t.id
|
|
309
309
|
);
|
|
310
310
|
}) });
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
var
|
|
314
|
-
const n =
|
|
315
|
-
return (n.length > 1 ? [n[0][0], n[n.length - 1][0]] : [(
|
|
312
|
+
function q(l) {
|
|
313
|
+
var c;
|
|
314
|
+
const n = l.trim().split(/\s+/).filter(Boolean);
|
|
315
|
+
return (n.length > 1 ? [n[0][0], n[n.length - 1][0]] : [(c = n[0]) == null ? void 0 : c[0]]).filter(Boolean).join("").toUpperCase();
|
|
316
|
+
}
|
|
317
|
+
function U(l) {
|
|
318
|
+
let n = 0;
|
|
319
|
+
for (const a of l.trim().toLowerCase())
|
|
320
|
+
n = n * 31 + (a.codePointAt(0) ?? 0) >>> 0;
|
|
321
|
+
return n % 6 + 1;
|
|
316
322
|
}
|
|
317
|
-
function
|
|
318
|
-
return /* @__PURE__ */
|
|
323
|
+
function $({ name: l, pictureUrl: n, presence: a, size: c = 32 }) {
|
|
324
|
+
return /* @__PURE__ */ r(
|
|
319
325
|
"span",
|
|
320
326
|
{
|
|
321
|
-
className:
|
|
322
|
-
style: { width:
|
|
327
|
+
className: `cms-avatar cms-avatar--tint-${U(l)}`,
|
|
328
|
+
style: { width: c, height: c, fontSize: Math.round(c * 0.4) },
|
|
323
329
|
role: "img",
|
|
324
|
-
"aria-label":
|
|
330
|
+
"aria-label": a ? `${l}, ${a}` : l,
|
|
325
331
|
children: [
|
|
326
|
-
n ? /* @__PURE__ */
|
|
327
|
-
|
|
332
|
+
n ? /* @__PURE__ */ e("img", { src: n, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: q(l) }),
|
|
333
|
+
a ? /* @__PURE__ */ e("span", { className: g("cms-avatar__presence", `is-${a}`), "aria-hidden": "true" }) : null
|
|
328
334
|
]
|
|
329
335
|
}
|
|
330
336
|
);
|
|
331
337
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
338
|
+
const K = {
|
|
339
|
+
mail: /* @__PURE__ */ r(b, { children: [
|
|
340
|
+
/* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
341
|
+
/* @__PURE__ */ e("path", { d: "m3 7 9 6 9-6" })
|
|
342
|
+
] }),
|
|
343
|
+
chat: /* @__PURE__ */ e("path", { d: "M4 12a8 8 0 1 1 4 6.9L4 20l1.1-4A8 8 0 0 1 4 12Z" }),
|
|
344
|
+
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" }),
|
|
345
|
+
calendar: /* @__PURE__ */ r(b, { children: [
|
|
346
|
+
/* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "16", rx: "2" }),
|
|
347
|
+
/* @__PURE__ */ e("path", { d: "M3 10h18M8 3v4M16 3v4" })
|
|
348
|
+
] }),
|
|
349
|
+
file: /* @__PURE__ */ r(b, { children: [
|
|
350
|
+
/* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
|
|
351
|
+
/* @__PURE__ */ e("path", { d: "M14 3v6h6M8 13h8M8 17h6" })
|
|
352
|
+
] }),
|
|
353
|
+
image: /* @__PURE__ */ r(b, { children: [
|
|
354
|
+
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
|
|
355
|
+
/* @__PURE__ */ e("circle", { cx: "9", cy: "10", r: "2" }),
|
|
356
|
+
/* @__PURE__ */ e("path", { d: "m21 17-5-5-9 8" })
|
|
357
|
+
] }),
|
|
358
|
+
search: /* @__PURE__ */ r(b, { children: [
|
|
359
|
+
/* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "7" }),
|
|
360
|
+
/* @__PURE__ */ e("path", { d: "m20 20-4-4" })
|
|
361
|
+
] }),
|
|
362
|
+
bell: /* @__PURE__ */ r(b, { children: [
|
|
363
|
+
/* @__PURE__ */ e("path", { d: "M6 9a6 6 0 1 1 12 0c0 6 2 8 2 8H4s2-2 2-8Z" }),
|
|
364
|
+
/* @__PURE__ */ e("path", { d: "M10 20a2 2 0 0 0 4 0" })
|
|
365
|
+
] }),
|
|
366
|
+
pencil: /* @__PURE__ */ r(b, { children: [
|
|
367
|
+
/* @__PURE__ */ e("path", { d: "M4 20h4L19 9l-4-4L4 16Z" }),
|
|
368
|
+
/* @__PURE__ */ e("path", { d: "m13 7 4 4" })
|
|
369
|
+
] }),
|
|
370
|
+
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" }),
|
|
371
|
+
send: /* @__PURE__ */ r(b, { children: [
|
|
372
|
+
/* @__PURE__ */ e("path", { d: "M21 3 10 14" }),
|
|
373
|
+
/* @__PURE__ */ e("path", { d: "M21 3 14 21l-4-7-7-4Z" })
|
|
374
|
+
] }),
|
|
375
|
+
inbox: /* @__PURE__ */ r(b, { children: [
|
|
376
|
+
/* @__PURE__ */ e("path", { d: "M3 13h5l1 3h6l1-3h5" }),
|
|
377
|
+
/* @__PURE__ */ e("path", { d: "M5 5h14l2 8v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" })
|
|
378
|
+
] }),
|
|
379
|
+
archive: /* @__PURE__ */ r(b, { children: [
|
|
380
|
+
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "5", rx: "1" }),
|
|
381
|
+
/* @__PURE__ */ e("path", { d: "M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4" })
|
|
382
|
+
] }),
|
|
383
|
+
trash: /* @__PURE__ */ r(b, { children: [
|
|
384
|
+
/* @__PURE__ */ e("path", { d: "M4 7h16M10 11v6M14 11v6" }),
|
|
385
|
+
/* @__PURE__ */ e("path", { d: "M6 7l1 13a2 2 0 0 0 2 1h6a2 2 0 0 0 2-1l1-13M9 7V4h6v3" })
|
|
386
|
+
] }),
|
|
387
|
+
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" }),
|
|
388
|
+
mic: /* @__PURE__ */ r(b, { children: [
|
|
389
|
+
/* @__PURE__ */ e("rect", { x: "9", y: "3", width: "6", height: "11", rx: "3" }),
|
|
390
|
+
/* @__PURE__ */ e("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v3" })
|
|
391
|
+
] }),
|
|
392
|
+
speaker: /* @__PURE__ */ r(b, { children: [
|
|
393
|
+
/* @__PURE__ */ e("path", { d: "M4 9h4l5-4v14l-5-4H4Z" }),
|
|
394
|
+
/* @__PURE__ */ e("path", { d: "M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12" })
|
|
395
|
+
] }),
|
|
396
|
+
"user-plus": /* @__PURE__ */ r(b, { children: [
|
|
397
|
+
/* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
|
|
398
|
+
/* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M19 8v6M16 11h6" })
|
|
399
|
+
] }),
|
|
400
|
+
"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" }),
|
|
401
|
+
video: /* @__PURE__ */ r(b, { children: [
|
|
402
|
+
/* @__PURE__ */ e("rect", { x: "3", y: "6", width: "13", height: "12", rx: "2" }),
|
|
403
|
+
/* @__PURE__ */ e("path", { d: "m16 10 5-3v10l-5-3" })
|
|
404
|
+
] }),
|
|
405
|
+
info: /* @__PURE__ */ r(b, { children: [
|
|
406
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
|
|
407
|
+
/* @__PURE__ */ e("path", { d: "M12 11v6M12 7.5v.5" })
|
|
408
|
+
] }),
|
|
409
|
+
"chevron-down": /* @__PURE__ */ e("path", { d: "m6 9 6 6 6-6" }),
|
|
410
|
+
"chevron-left": /* @__PURE__ */ e("path", { d: "m15 18-6-6 6-6" }),
|
|
411
|
+
plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
|
|
412
|
+
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" }),
|
|
413
|
+
check: /* @__PURE__ */ e("path", { d: "m5 12 5 5 9-10" }),
|
|
414
|
+
server: /* @__PURE__ */ r(b, { children: [
|
|
415
|
+
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "7", rx: "2" }),
|
|
416
|
+
/* @__PURE__ */ e("rect", { x: "3", y: "13", width: "18", height: "7", rx: "2" }),
|
|
417
|
+
/* @__PURE__ */ e("path", { d: "M7 7.5h.5M7 16.5h.5" })
|
|
418
|
+
] }),
|
|
419
|
+
reply: /* @__PURE__ */ e("path", { d: "M10 8 4 13l6 5M4 13h11a5 5 0 0 1 5 5" }),
|
|
420
|
+
more: /* @__PURE__ */ e("path", { d: "M5 12h.5M12 12h.5M19 12h.5" })
|
|
421
|
+
};
|
|
422
|
+
function y({ name: l, size: n = 20, label: a }) {
|
|
423
|
+
return /* @__PURE__ */ e(
|
|
424
|
+
"svg",
|
|
425
|
+
{
|
|
426
|
+
className: "cms-icon",
|
|
427
|
+
width: n,
|
|
428
|
+
height: n,
|
|
429
|
+
viewBox: "0 0 24 24",
|
|
430
|
+
fill: "none",
|
|
431
|
+
stroke: "currentColor",
|
|
432
|
+
strokeWidth: l === "more" ? 3 : 1.75,
|
|
433
|
+
strokeLinecap: "round",
|
|
434
|
+
strokeLinejoin: "round",
|
|
435
|
+
focusable: !1,
|
|
436
|
+
...a ? { role: "img", "aria-label": a } : { "aria-hidden": !0 },
|
|
437
|
+
children: K[l]
|
|
347
438
|
}
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
const de = Object.keys(K);
|
|
442
|
+
function W({ count: l, label: n, max: a = 99 }) {
|
|
443
|
+
return l <= 0 ? null : /* @__PURE__ */ r("span", { className: "cms-badge", children: [
|
|
444
|
+
/* @__PURE__ */ e("span", { "aria-hidden": "true", children: l > a ? `${a}+` : l }),
|
|
445
|
+
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: n })
|
|
446
|
+
] });
|
|
447
|
+
}
|
|
448
|
+
function me({ product: l, mark: n, rail: a, active: c, onNavigate: s, server: m, search: t, account: u, children: h }) {
|
|
449
|
+
return /* @__PURE__ */ r("div", { className: "cms-shell", children: [
|
|
450
|
+
/* @__PURE__ */ r("nav", { className: "cms-shell__rail", "aria-label": "Sections", children: [
|
|
451
|
+
/* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: n }),
|
|
452
|
+
/* @__PURE__ */ e("ul", { className: "cms-shell__items", children: a.map((o) => {
|
|
453
|
+
const i = o.id === c;
|
|
454
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ r(
|
|
455
|
+
"a",
|
|
456
|
+
{
|
|
457
|
+
href: o.href,
|
|
458
|
+
className: g("cms-shell__item", i && "is-active"),
|
|
459
|
+
"aria-current": i ? "page" : void 0,
|
|
460
|
+
title: o.label,
|
|
461
|
+
onClick: (f) => {
|
|
462
|
+
s && (f.preventDefault(), s(o.id));
|
|
463
|
+
},
|
|
464
|
+
children: [
|
|
465
|
+
/* @__PURE__ */ r("span", { className: "cms-shell__icon", children: [
|
|
466
|
+
/* @__PURE__ */ e(y, { name: o.icon, size: 22 }),
|
|
467
|
+
o.badge ? /* @__PURE__ */ e(W, { count: o.badge.count, label: o.badge.label }) : null
|
|
468
|
+
] }),
|
|
469
|
+
/* @__PURE__ */ e("span", { className: "cms-shell__label", children: o.label })
|
|
470
|
+
]
|
|
471
|
+
}
|
|
472
|
+
) }, o.id);
|
|
473
|
+
}) })
|
|
474
|
+
] }),
|
|
475
|
+
/* @__PURE__ */ r("header", { className: "cms-shell__top", children: [
|
|
476
|
+
/* @__PURE__ */ e("span", { className: "cms-shell__product", children: l }),
|
|
477
|
+
m != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: m }) : null,
|
|
478
|
+
t != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: t }) : null,
|
|
479
|
+
u != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: u }) : null
|
|
480
|
+
] }),
|
|
481
|
+
/* @__PURE__ */ e("main", { className: "cms-shell__main", children: h })
|
|
482
|
+
] });
|
|
483
|
+
}
|
|
484
|
+
function ue({ label: l, placeholder: n, value: a, onChange: c, onSearch: s }) {
|
|
485
|
+
return /* @__PURE__ */ r(
|
|
486
|
+
"form",
|
|
487
|
+
{
|
|
488
|
+
role: "search",
|
|
489
|
+
className: "cms-search",
|
|
490
|
+
onSubmit: (m) => {
|
|
491
|
+
m.preventDefault(), s == null || s(a);
|
|
492
|
+
},
|
|
493
|
+
children: [
|
|
494
|
+
/* @__PURE__ */ e(y, { name: "search", size: 18 }),
|
|
495
|
+
/* @__PURE__ */ e(
|
|
496
|
+
"input",
|
|
497
|
+
{
|
|
498
|
+
className: "cms-search__input",
|
|
499
|
+
type: "search",
|
|
500
|
+
"aria-label": l,
|
|
501
|
+
placeholder: n,
|
|
502
|
+
value: a,
|
|
503
|
+
onChange: (m) => c(m.target.value)
|
|
504
|
+
}
|
|
505
|
+
)
|
|
506
|
+
]
|
|
507
|
+
}
|
|
508
|
+
);
|
|
509
|
+
}
|
|
510
|
+
function he({ options: l, value: n, onChange: a, label: c }) {
|
|
511
|
+
const s = x([]), m = (t, u) => {
|
|
512
|
+
var f;
|
|
513
|
+
const h = l.length - 1, o = t.key === "ArrowRight" || t.key === "ArrowDown" ? u === h ? 0 : u + 1 : t.key === "ArrowLeft" || t.key === "ArrowUp" ? u === 0 ? h : u - 1 : null;
|
|
514
|
+
if (o === null) return;
|
|
515
|
+
t.preventDefault();
|
|
516
|
+
const i = l[o];
|
|
517
|
+
i && (a(i.id), (f = s.current[o]) == null || f.focus());
|
|
348
518
|
};
|
|
349
|
-
return /* @__PURE__ */
|
|
350
|
-
const
|
|
351
|
-
return /* @__PURE__ */
|
|
519
|
+
return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": c, children: l.map((t, u) => {
|
|
520
|
+
const h = t.id === n;
|
|
521
|
+
return /* @__PURE__ */ r(
|
|
522
|
+
"button",
|
|
523
|
+
{
|
|
524
|
+
ref: (o) => {
|
|
525
|
+
s.current[u] = o;
|
|
526
|
+
},
|
|
527
|
+
type: "button",
|
|
528
|
+
role: "radio",
|
|
529
|
+
"aria-checked": h,
|
|
530
|
+
tabIndex: h ? 0 : -1,
|
|
531
|
+
className: g("cms-chip", h && "is-on"),
|
|
532
|
+
onClick: () => a(t.id),
|
|
533
|
+
onKeyDown: (o) => m(o, u),
|
|
534
|
+
children: [
|
|
535
|
+
h ? /* @__PURE__ */ e(y, { name: "check", size: 16 }) : null,
|
|
536
|
+
t.label
|
|
537
|
+
]
|
|
538
|
+
},
|
|
539
|
+
t.id
|
|
540
|
+
);
|
|
541
|
+
}) });
|
|
542
|
+
}
|
|
543
|
+
function fe({ panes: l, active: n, back: a }) {
|
|
544
|
+
const c = Math.min(Math.max(n ?? l.length - 1, 0), l.length - 1);
|
|
545
|
+
return /* @__PURE__ */ e("div", { className: g("cms-panes", l.length === 3 ? "cms-panes--three" : "cms-panes--two"), "data-active": c, children: l.map((s, m) => /* @__PURE__ */ r("section", { className: "cms-panes__pane", "aria-label": s.label, "data-offset": c - m, children: [
|
|
546
|
+
m === c && a ? /* @__PURE__ */ r("a", { className: "cms-panes__back", href: a.href, children: [
|
|
547
|
+
/* @__PURE__ */ e(y, { name: "chevron-left", size: 18 }),
|
|
548
|
+
a.label
|
|
549
|
+
] }) : null,
|
|
550
|
+
s.content
|
|
551
|
+
] }, s.label)) });
|
|
552
|
+
}
|
|
553
|
+
function pe({ from: l, subject: n, preview: a, time: c, unread: s, hasAttachment: m, selected: t, onOpen: u }) {
|
|
554
|
+
return /* @__PURE__ */ r(
|
|
555
|
+
"button",
|
|
556
|
+
{
|
|
557
|
+
type: "button",
|
|
558
|
+
className: g("cms-mail-row", s && "is-unread", t && "is-selected"),
|
|
559
|
+
"aria-current": t ? "true" : void 0,
|
|
560
|
+
onClick: u,
|
|
561
|
+
children: [
|
|
562
|
+
/* @__PURE__ */ e($, { name: l, size: 40 }),
|
|
563
|
+
/* @__PURE__ */ r("span", { className: "cms-mail-row__body", children: [
|
|
564
|
+
/* @__PURE__ */ r("span", { className: "cms-mail-row__line", children: [
|
|
565
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: l }),
|
|
566
|
+
m ? /* @__PURE__ */ e(y, { name: "paperclip", size: 16, label: "Has an attachment" }) : null,
|
|
567
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: c })
|
|
568
|
+
] }),
|
|
569
|
+
/* @__PURE__ */ r("span", { className: "cms-mail-row__line", children: [
|
|
570
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: n }),
|
|
571
|
+
s ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": "Unread" }) : null
|
|
572
|
+
] }),
|
|
573
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: a })
|
|
574
|
+
] })
|
|
575
|
+
]
|
|
576
|
+
}
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
function _e({ direction: l, children: n, time: a, read: c }) {
|
|
580
|
+
return /* @__PURE__ */ r("div", { className: g("cms-bubble", `cms-bubble--${l}`), children: [
|
|
581
|
+
/* @__PURE__ */ e("div", { className: "cms-bubble__text", children: n }),
|
|
582
|
+
/* @__PURE__ */ r("div", { className: "cms-bubble__meta", children: [
|
|
583
|
+
a,
|
|
584
|
+
l === "out" && c ? /* @__PURE__ */ e(b, { children: " · Read" }) : null
|
|
585
|
+
] })
|
|
586
|
+
] });
|
|
587
|
+
}
|
|
588
|
+
function be({ label: l, value: n, onChange: a, onSend: c, onAttach: s, placeholder: m, variant: t = "chat", sendLabel: u = "Send" }) {
|
|
589
|
+
const h = A(), o = n.trim() === "", i = (d) => {
|
|
590
|
+
d.preventDefault(), o || c();
|
|
591
|
+
}, f = s ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": "Attach a file", onClick: s, children: /* @__PURE__ */ e(y, { name: "paperclip" }) }) : null;
|
|
592
|
+
return /* @__PURE__ */ r("form", { className: g("cms-composer", `cms-composer--${t}`), onSubmit: i, children: [
|
|
593
|
+
/* @__PURE__ */ e("label", { htmlFor: h, className: t === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: l }),
|
|
594
|
+
t === "chat" ? f : null,
|
|
595
|
+
/* @__PURE__ */ e(
|
|
596
|
+
"textarea",
|
|
597
|
+
{
|
|
598
|
+
id: h,
|
|
599
|
+
className: "cms-composer__input",
|
|
600
|
+
rows: t === "reply" ? 3 : 1,
|
|
601
|
+
placeholder: m,
|
|
602
|
+
value: n,
|
|
603
|
+
onChange: (d) => a(d.target.value),
|
|
604
|
+
onKeyDown: (d) => {
|
|
605
|
+
t === "chat" && d.key === "Enter" && !d.shiftKey && (d.preventDefault(), o || c());
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
),
|
|
609
|
+
t === "reply" ? f : null,
|
|
610
|
+
t === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": u, disabled: o, children: /* @__PURE__ */ e(y, { name: "send" }) }) : /* @__PURE__ */ r("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: o, children: [
|
|
611
|
+
u,
|
|
612
|
+
" ",
|
|
613
|
+
/* @__PURE__ */ e(y, { name: "send", size: 18 })
|
|
614
|
+
] })
|
|
615
|
+
] });
|
|
616
|
+
}
|
|
617
|
+
function ve({ name: l, media: n, onAccept: a, onDecline: c }) {
|
|
618
|
+
const s = n === "video" ? "Incoming video call" : "Incoming audio call";
|
|
619
|
+
return /* @__PURE__ */ r("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": `${s} from ${l}`, children: [
|
|
620
|
+
/* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e($, { name: l, size: 112 }) }),
|
|
621
|
+
/* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: l }),
|
|
622
|
+
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: s }),
|
|
623
|
+
/* @__PURE__ */ r("div", { className: "cms-call-incoming__actions", children: [
|
|
624
|
+
/* @__PURE__ */ e(C, { icon: "phone-off", label: "Decline", tone: "hang-up", onClick: c }),
|
|
625
|
+
/* @__PURE__ */ e(C, { icon: "phone", label: "Accept", tone: "accept", onClick: a })
|
|
626
|
+
] })
|
|
627
|
+
] });
|
|
628
|
+
}
|
|
629
|
+
function C({ icon: l, label: n, onClick: a, tone: c = "plain", pressed: s }) {
|
|
630
|
+
return /* @__PURE__ */ r(
|
|
631
|
+
"button",
|
|
632
|
+
{
|
|
633
|
+
type: "button",
|
|
634
|
+
className: g("cms-call-button", `cms-call-button--${c}`, s && "is-pressed"),
|
|
635
|
+
"aria-pressed": s,
|
|
636
|
+
onClick: a,
|
|
637
|
+
children: [
|
|
638
|
+
/* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(y, { name: l, size: 24 }) }),
|
|
639
|
+
/* @__PURE__ */ e("span", { className: "cms-call-button__label", children: n })
|
|
640
|
+
]
|
|
641
|
+
}
|
|
642
|
+
);
|
|
643
|
+
}
|
|
644
|
+
function ge({ name: l, duration: n, connection: a, you: c, muted: s, speaker: m, onToggleMute: t, onToggleSpeaker: u, onAddPerson: h, onChat: o, onHangUp: i }) {
|
|
645
|
+
return /* @__PURE__ */ r("section", { className: "cms-call-panel", "aria-label": `Call with ${l}`, children: [
|
|
646
|
+
/* @__PURE__ */ r("div", { className: "cms-call-panel__head", children: [
|
|
647
|
+
/* @__PURE__ */ e($, { name: l, size: 64 }),
|
|
648
|
+
/* @__PURE__ */ r("div", { className: "cms-call-panel__who", children: [
|
|
649
|
+
/* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: l }),
|
|
650
|
+
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": `Call time ${n}`, children: n })
|
|
651
|
+
] }),
|
|
652
|
+
/* @__PURE__ */ e("span", { className: g("cms-pill", a === "good" ? "cms-pill--success" : "cms-pill--warning"), children: a === "good" ? "Good connection" : "Poor connection" })
|
|
653
|
+
] }),
|
|
654
|
+
/* @__PURE__ */ r("div", { className: "cms-call-panel__you", children: [
|
|
655
|
+
/* @__PURE__ */ e($, { name: c.name, size: 36 }),
|
|
656
|
+
/* @__PURE__ */ e("span", { children: "You" }),
|
|
657
|
+
c.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": "Speaking" }) : null
|
|
658
|
+
] }),
|
|
659
|
+
/* @__PURE__ */ r("div", { className: "cms-call-panel__controls", children: [
|
|
660
|
+
/* @__PURE__ */ e(C, { icon: "mic", label: s ? "Unmute" : "Mute", pressed: s, onClick: t }),
|
|
661
|
+
/* @__PURE__ */ e(C, { icon: "speaker", label: "Speaker", pressed: m, onClick: u }),
|
|
662
|
+
h ? /* @__PURE__ */ e(C, { icon: "user-plus", label: "Add person", onClick: h }) : null,
|
|
663
|
+
o ? /* @__PURE__ */ e(C, { icon: "chat", label: "Chat", onClick: o }) : null,
|
|
664
|
+
/* @__PURE__ */ e(C, { icon: "phone-off", label: "Hang up", tone: "hang-up", onClick: i })
|
|
665
|
+
] })
|
|
666
|
+
] });
|
|
667
|
+
}
|
|
668
|
+
function Ne({ name: l, duration: n, muted: a, onToggleMute: c, onReturn: s, onHangUp: m }) {
|
|
669
|
+
return /* @__PURE__ */ r("section", { className: "cms-call-bar", "aria-label": `Call with ${l}`, children: [
|
|
670
|
+
/* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
|
|
671
|
+
/* @__PURE__ */ r("span", { className: "cms-call-bar__name", children: [
|
|
672
|
+
"On a call with ",
|
|
673
|
+
l
|
|
674
|
+
] }),
|
|
675
|
+
/* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: n }),
|
|
676
|
+
/* @__PURE__ */ r("span", { className: "cms-call-bar__actions", children: [
|
|
677
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": a ? "Unmute" : "Mute", "aria-pressed": a, onClick: c, children: /* @__PURE__ */ e(y, { name: "mic" }) }),
|
|
678
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: s, children: "Return to call" }),
|
|
679
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": "Hang up", onClick: m, children: /* @__PURE__ */ e(y, { name: "phone-off" }) })
|
|
680
|
+
] })
|
|
681
|
+
] });
|
|
682
|
+
}
|
|
683
|
+
function ye({ mark: l, product: n, headline: a, lead: c, features: s = [], children: m }) {
|
|
684
|
+
return /* @__PURE__ */ r("div", { className: "cms-signin", children: [
|
|
685
|
+
/* @__PURE__ */ r("aside", { className: "cms-signin__brand", children: [
|
|
686
|
+
/* @__PURE__ */ r("p", { className: "cms-signin__logo", children: [
|
|
687
|
+
/* @__PURE__ */ e("span", { className: "cms-signin__mark", "aria-hidden": "true", children: l }),
|
|
688
|
+
n
|
|
689
|
+
] }),
|
|
690
|
+
/* @__PURE__ */ r("div", { className: "cms-signin__pitch", children: [
|
|
691
|
+
/* @__PURE__ */ e("p", { className: "cms-signin__headline", children: a }),
|
|
692
|
+
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children: c }),
|
|
693
|
+
s.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: s.map((t) => /* @__PURE__ */ r("li", { children: [
|
|
694
|
+
/* @__PURE__ */ e(y, { name: t.icon, size: 18 }),
|
|
695
|
+
t.label
|
|
696
|
+
] }, t.label)) }) : null
|
|
697
|
+
] })
|
|
698
|
+
] }),
|
|
699
|
+
/* @__PURE__ */ e("main", { className: "cms-signin__form", children: m })
|
|
700
|
+
] });
|
|
701
|
+
}
|
|
702
|
+
function we({ server: l, onSubmit: n, forgotHref: a, createHref: c, error: s, busy: m }) {
|
|
703
|
+
const t = A(), [u, h] = M(""), [o, i] = M(""), [f, d] = M(!1);
|
|
704
|
+
return /* @__PURE__ */ r("form", { className: "cms-signin-form", onSubmit: (_) => {
|
|
705
|
+
_.preventDefault(), n(u, o);
|
|
706
|
+
}, "aria-describedby": s ? `${t}-error` : void 0, children: [
|
|
707
|
+
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: "Sign in" }),
|
|
708
|
+
/* @__PURE__ */ r("p", { className: "cms-signin-form__server", children: [
|
|
709
|
+
/* @__PURE__ */ e(y, { name: "server", size: 18 }),
|
|
710
|
+
l
|
|
711
|
+
] }),
|
|
712
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${t}-identifier`, children: "Email or username" }),
|
|
713
|
+
/* @__PURE__ */ e(
|
|
714
|
+
"input",
|
|
715
|
+
{
|
|
716
|
+
id: `${t}-identifier`,
|
|
717
|
+
className: "cms-field",
|
|
718
|
+
type: "text",
|
|
719
|
+
autoComplete: "username",
|
|
720
|
+
placeholder: "name@example.com",
|
|
721
|
+
value: u,
|
|
722
|
+
onChange: (_) => h(_.target.value),
|
|
723
|
+
required: !0
|
|
724
|
+
}
|
|
725
|
+
),
|
|
726
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${t}-password`, children: "Password" }),
|
|
727
|
+
/* @__PURE__ */ r("span", { className: "cms-signin-form__password", children: [
|
|
728
|
+
/* @__PURE__ */ e(
|
|
729
|
+
"input",
|
|
730
|
+
{
|
|
731
|
+
id: `${t}-password`,
|
|
732
|
+
className: "cms-field",
|
|
733
|
+
type: f ? "text" : "password",
|
|
734
|
+
autoComplete: "current-password",
|
|
735
|
+
value: o,
|
|
736
|
+
onChange: (_) => i(_.target.value),
|
|
737
|
+
required: !0
|
|
738
|
+
}
|
|
739
|
+
),
|
|
740
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": f, onClick: () => d((_) => !_), children: f ? "Hide" : "Show" })
|
|
741
|
+
] }),
|
|
742
|
+
a ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: a, children: "Forgot password?" }) : null,
|
|
743
|
+
s ? /* @__PURE__ */ e("p", { id: `${t}-error`, className: "cms-signin-form__error", role: "alert", children: s }) : null,
|
|
744
|
+
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: m, "aria-busy": m || void 0, children: "Sign in" }),
|
|
745
|
+
c ? /* @__PURE__ */ r(b, { children: [
|
|
746
|
+
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: "New here?" }) }),
|
|
747
|
+
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: c, children: "Create an account" })
|
|
748
|
+
] }) : null
|
|
749
|
+
] });
|
|
750
|
+
}
|
|
751
|
+
function ke({ label: l, rows: n, error: a, onRetry: c, loadingText: s = "Loading", emptyTitle: m = "Nothing here yet", emptyHint: t, selected: u, onOpen: h, onRowMenu: o }) {
|
|
752
|
+
const i = x([]);
|
|
753
|
+
if (a != null) return /* @__PURE__ */ e(j, { message: a, onRetry: c });
|
|
754
|
+
if (n === null) return /* @__PURE__ */ e(P, { what: s, layout: "block" });
|
|
755
|
+
if (n.length === 0) return /* @__PURE__ */ e(V, { title: m, hint: t });
|
|
756
|
+
const f = (d, v, _) => {
|
|
757
|
+
var p;
|
|
758
|
+
if (d.key === "ArrowDown" || d.key === "ArrowUp")
|
|
759
|
+
d.preventDefault(), (p = i.current[Math.min(n.length - 1, Math.max(0, v + (d.key === "ArrowDown" ? 1 : -1)))]) == null || p.focus();
|
|
760
|
+
else if (d.key === "Enter")
|
|
761
|
+
h == null || h(_);
|
|
762
|
+
else if ((d.key === "ContextMenu" || d.shiftKey && d.key === "F10") && o) {
|
|
763
|
+
d.preventDefault();
|
|
764
|
+
const N = d.currentTarget.getBoundingClientRect();
|
|
765
|
+
o(_, { x: N.left + 16, y: N.bottom });
|
|
766
|
+
}
|
|
767
|
+
};
|
|
768
|
+
return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": l, children: n.map((d, v) => {
|
|
769
|
+
const _ = d.id === u;
|
|
770
|
+
return /* @__PURE__ */ r(
|
|
352
771
|
"li",
|
|
353
772
|
{
|
|
354
|
-
ref: (
|
|
355
|
-
|
|
773
|
+
ref: (p) => {
|
|
774
|
+
i.current[v] = p;
|
|
356
775
|
},
|
|
357
776
|
role: "option",
|
|
358
|
-
"aria-selected":
|
|
359
|
-
tabIndex:
|
|
360
|
-
className:
|
|
361
|
-
onClick: () =>
|
|
362
|
-
onKeyDown: (
|
|
363
|
-
onContextMenu:
|
|
364
|
-
|
|
777
|
+
"aria-selected": _,
|
|
778
|
+
tabIndex: _ || u == null && v === 0 ? 0 : -1,
|
|
779
|
+
className: g("cms-list__row", _ && "is-selected"),
|
|
780
|
+
onClick: () => h == null ? void 0 : h(d.id),
|
|
781
|
+
onKeyDown: (p) => f(p, v, d.id),
|
|
782
|
+
onContextMenu: o ? (p) => {
|
|
783
|
+
p.preventDefault(), o(d.id, { x: p.clientX, y: p.clientY });
|
|
365
784
|
} : void 0,
|
|
366
785
|
children: [
|
|
367
|
-
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
|
|
786
|
+
d.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: d.lead }) : null,
|
|
787
|
+
/* @__PURE__ */ r("span", { className: "cms-list__text", children: [
|
|
788
|
+
/* @__PURE__ */ e("span", { className: "cms-list__primary", children: d.primary }),
|
|
789
|
+
d.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: d.secondary }) : null
|
|
371
790
|
] }),
|
|
372
|
-
|
|
791
|
+
d.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: d.meta }) : null
|
|
373
792
|
]
|
|
374
793
|
},
|
|
375
|
-
|
|
794
|
+
d.id
|
|
376
795
|
);
|
|
377
796
|
}) });
|
|
378
797
|
}
|
|
379
|
-
function
|
|
380
|
-
const s =
|
|
381
|
-
if (
|
|
382
|
-
if (!
|
|
383
|
-
const
|
|
384
|
-
u({ x: Math.max(0, Math.min(
|
|
385
|
-
}, [
|
|
386
|
-
var
|
|
387
|
-
if (!
|
|
388
|
-
m.current = document.activeElement, (
|
|
389
|
-
const
|
|
390
|
-
var
|
|
391
|
-
(
|
|
798
|
+
function Me({ at: l, items: n, onClose: a, label: c = "Actions" }) {
|
|
799
|
+
const s = x(null), m = x(null), [t, u] = M(l), h = n.filter((i) => i.offer.offered);
|
|
800
|
+
if (F(() => {
|
|
801
|
+
if (!l) return;
|
|
802
|
+
const i = s.current, f = (i == null ? void 0 : i.offsetWidth) ?? 0, d = (i == null ? void 0 : i.offsetHeight) ?? 0;
|
|
803
|
+
u({ x: Math.max(0, Math.min(l.x, window.innerWidth - f)), y: Math.max(0, Math.min(l.y, window.innerHeight - d)) });
|
|
804
|
+
}, [l]), D(() => {
|
|
805
|
+
var f, d;
|
|
806
|
+
if (!l) return;
|
|
807
|
+
m.current = document.activeElement, (d = (f = s.current) == null ? void 0 : f.querySelector('[role="menuitem"]:not([aria-disabled="true"])')) == null || d.focus();
|
|
808
|
+
const i = (v) => {
|
|
809
|
+
var _;
|
|
810
|
+
(_ = s.current) != null && _.contains(v.target) || a();
|
|
392
811
|
};
|
|
393
|
-
return document.addEventListener("mousedown",
|
|
394
|
-
var
|
|
395
|
-
document.removeEventListener("mousedown",
|
|
812
|
+
return document.addEventListener("mousedown", i), () => {
|
|
813
|
+
var v, _;
|
|
814
|
+
document.removeEventListener("mousedown", i), (_ = (v = m.current) == null ? void 0 : v.focus) == null || _.call(v);
|
|
396
815
|
};
|
|
397
|
-
}, [
|
|
398
|
-
const
|
|
399
|
-
var
|
|
400
|
-
const
|
|
401
|
-
if (
|
|
402
|
-
|
|
403
|
-
else if (
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
(
|
|
816
|
+
}, [l, a]), !l || h.length === 0) return null;
|
|
817
|
+
const o = (i) => {
|
|
818
|
+
var v, _;
|
|
819
|
+
const f = Array.from(((v = s.current) == null ? void 0 : v.querySelectorAll('[role="menuitem"]')) ?? []), d = f.indexOf(document.activeElement);
|
|
820
|
+
if (i.key === "Escape" || i.key === "Tab")
|
|
821
|
+
i.preventDefault(), a();
|
|
822
|
+
else if (i.key === "ArrowDown" || i.key === "ArrowUp") {
|
|
823
|
+
i.preventDefault();
|
|
824
|
+
const p = i.key === "ArrowDown" ? 1 : -1;
|
|
825
|
+
(_ = f[(d + p + f.length) % f.length]) == null || _.focus();
|
|
407
826
|
}
|
|
408
827
|
};
|
|
409
|
-
return
|
|
410
|
-
/* @__PURE__ */
|
|
828
|
+
return Z(
|
|
829
|
+
/* @__PURE__ */ e(
|
|
411
830
|
"div",
|
|
412
831
|
{
|
|
413
832
|
ref: s,
|
|
414
833
|
className: "cms-menu",
|
|
415
834
|
role: "menu",
|
|
416
|
-
"aria-label":
|
|
417
|
-
style: { left: (
|
|
418
|
-
onKeyDown:
|
|
419
|
-
onContextMenu: (
|
|
420
|
-
children:
|
|
421
|
-
const
|
|
422
|
-
return /* @__PURE__ */
|
|
835
|
+
"aria-label": c,
|
|
836
|
+
style: { left: (t ?? l).x, top: (t ?? l).y },
|
|
837
|
+
onKeyDown: o,
|
|
838
|
+
onContextMenu: (i) => i.preventDefault(),
|
|
839
|
+
children: h.map((i) => {
|
|
840
|
+
const f = i.offer.refusal !== void 0;
|
|
841
|
+
return /* @__PURE__ */ r(
|
|
423
842
|
"div",
|
|
424
843
|
{
|
|
425
844
|
role: "menuitem",
|
|
426
845
|
tabIndex: -1,
|
|
427
|
-
"aria-disabled":
|
|
428
|
-
title:
|
|
429
|
-
className:
|
|
846
|
+
"aria-disabled": f || void 0,
|
|
847
|
+
title: f ? i.offer.refusal : void 0,
|
|
848
|
+
className: g("cms-menu__item", i.danger && "is-danger", i.offer.locked && "is-locked", f && "is-refused"),
|
|
430
849
|
onClick: () => {
|
|
431
|
-
|
|
850
|
+
f || (a(), i.onSelect());
|
|
432
851
|
},
|
|
433
|
-
onKeyDown: (
|
|
434
|
-
(
|
|
852
|
+
onKeyDown: (d) => {
|
|
853
|
+
(d.key === "Enter" || d.key === " ") && !f && (d.preventDefault(), a(), i.onSelect());
|
|
435
854
|
},
|
|
436
855
|
children: [
|
|
437
|
-
|
|
438
|
-
/* @__PURE__ */
|
|
439
|
-
|
|
856
|
+
i.offer.locked ? /* @__PURE__ */ e(k, { name: "lock" }) : null,
|
|
857
|
+
/* @__PURE__ */ e("span", { className: "cms-menu__label", children: i.label }),
|
|
858
|
+
f ? /* @__PURE__ */ e("span", { className: "cms-menu__refusal", children: i.offer.refusal }) : null
|
|
440
859
|
]
|
|
441
860
|
},
|
|
442
|
-
|
|
861
|
+
i.id
|
|
443
862
|
);
|
|
444
863
|
})
|
|
445
864
|
}
|
|
@@ -447,13 +866,13 @@ function se({ at: e, items: n, onClose: l, label: a = "Actions" }) {
|
|
|
447
866
|
document.body
|
|
448
867
|
);
|
|
449
868
|
}
|
|
450
|
-
function
|
|
451
|
-
return
|
|
869
|
+
function G(l) {
|
|
870
|
+
return l === "allowed" || l === "elevate" || l === "denied";
|
|
452
871
|
}
|
|
453
|
-
function
|
|
454
|
-
if (!
|
|
872
|
+
function xe(l, n) {
|
|
873
|
+
if (!G(l))
|
|
455
874
|
return n.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 };
|
|
456
|
-
switch (
|
|
875
|
+
switch (l) {
|
|
457
876
|
case "allowed":
|
|
458
877
|
return { offered: !0, locked: !1 };
|
|
459
878
|
case "elevate":
|
|
@@ -462,92 +881,108 @@ function ce(e, n) {
|
|
|
462
881
|
return n.showRefused ? { offered: !0, locked: !1, refusal: n.refusal ?? "not allowed" } : { offered: !1, locked: !1 };
|
|
463
882
|
}
|
|
464
883
|
}
|
|
465
|
-
function
|
|
466
|
-
if (!
|
|
467
|
-
if (typeof
|
|
468
|
-
const
|
|
469
|
-
return
|
|
884
|
+
function X(l, n) {
|
|
885
|
+
if (!l) return;
|
|
886
|
+
if (typeof l.get == "function") return l.get(n) ?? void 0;
|
|
887
|
+
const a = l, c = Object.keys(a).find((s) => s.toLowerCase() === n.toLowerCase());
|
|
888
|
+
return c === void 0 ? void 0 : a[c];
|
|
470
889
|
}
|
|
471
|
-
function
|
|
472
|
-
if (
|
|
473
|
-
const n =
|
|
890
|
+
function Y(l) {
|
|
891
|
+
if (l && typeof l == "object") {
|
|
892
|
+
const n = l;
|
|
474
893
|
if (typeof n.detail == "string" && n.detail !== "") return n.detail;
|
|
475
894
|
if (typeof n.title == "string" && n.title !== "") return n.title;
|
|
476
895
|
}
|
|
477
896
|
}
|
|
478
|
-
function
|
|
479
|
-
if (
|
|
480
|
-
const s =
|
|
481
|
-
return
|
|
482
|
-
}
|
|
483
|
-
const
|
|
484
|
-
function
|
|
485
|
-
window.dispatchEvent(new Event(
|
|
486
|
-
}
|
|
487
|
-
function
|
|
488
|
-
const [n,
|
|
489
|
-
u.current =
|
|
490
|
-
const
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
(
|
|
494
|
-
|
|
897
|
+
function Ce(l, n, a, c) {
|
|
898
|
+
if (l !== 403) return { kind: "none" };
|
|
899
|
+
const s = Y(a);
|
|
900
|
+
return X(n, "X-Elevation-Required") !== void 0 ? c.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." };
|
|
901
|
+
}
|
|
902
|
+
const S = "coolms-kit:reread";
|
|
903
|
+
function Ae() {
|
|
904
|
+
window.dispatchEvent(new Event(S));
|
|
905
|
+
}
|
|
906
|
+
function De(l) {
|
|
907
|
+
const [n, a] = M(void 0), [c, s] = M(void 0), [m, t] = M(!0), u = x(l);
|
|
908
|
+
u.current = l;
|
|
909
|
+
const h = x(0), o = H(() => {
|
|
910
|
+
const i = ++h.current;
|
|
911
|
+
t(!0), u.current().then(
|
|
912
|
+
(f) => {
|
|
913
|
+
i === h.current && (a(f), s(void 0), t(!1));
|
|
495
914
|
},
|
|
496
|
-
(
|
|
497
|
-
|
|
915
|
+
(f) => {
|
|
916
|
+
i === h.current && (s(f), t(!1));
|
|
498
917
|
}
|
|
499
918
|
);
|
|
500
919
|
}, []);
|
|
501
|
-
return
|
|
502
|
-
|
|
503
|
-
const
|
|
504
|
-
return window.addEventListener("focus",
|
|
505
|
-
window.removeEventListener("focus",
|
|
920
|
+
return D(() => {
|
|
921
|
+
o();
|
|
922
|
+
const i = () => o();
|
|
923
|
+
return window.addEventListener("focus", i), window.addEventListener(S, i), () => {
|
|
924
|
+
window.removeEventListener("focus", i), window.removeEventListener(S, i);
|
|
506
925
|
};
|
|
507
|
-
}, [
|
|
926
|
+
}, [o]), { value: n, error: c, loading: m, reread: o };
|
|
508
927
|
}
|
|
509
|
-
function
|
|
510
|
-
return
|
|
928
|
+
function Ee(l) {
|
|
929
|
+
return l === 412 ? { conflict: !0, message: "Someone changed this since you opened it. Nothing was saved; read it again to see the change." } : { conflict: !1 };
|
|
511
930
|
}
|
|
512
|
-
const
|
|
513
|
-
function
|
|
514
|
-
const
|
|
515
|
-
for (let s = 0; s < Math.max(
|
|
516
|
-
const m =
|
|
517
|
-
if (m !==
|
|
931
|
+
const Q = "/errors/client-update-required";
|
|
932
|
+
function J(l, n) {
|
|
933
|
+
const a = l.split(".").map((s) => Number.parseInt(s, 10) || 0), c = n.split(".").map((s) => Number.parseInt(s, 10) || 0);
|
|
934
|
+
for (let s = 0; s < Math.max(a.length, c.length); s++) {
|
|
935
|
+
const m = a[s] ?? 0, t = c[s] ?? 0;
|
|
936
|
+
if (m !== t) return m < t;
|
|
518
937
|
}
|
|
519
938
|
return !1;
|
|
520
939
|
}
|
|
521
|
-
function
|
|
522
|
-
return
|
|
940
|
+
function $e(l) {
|
|
941
|
+
return l.problemType !== void 0 && l.problemType.endsWith(Q) ? !0 : l.minimumVersion !== void 0 && J(l.version, l.minimumVersion);
|
|
523
942
|
}
|
|
524
943
|
export {
|
|
525
|
-
|
|
944
|
+
me as AppShell,
|
|
945
|
+
$ as Avatar,
|
|
946
|
+
W as Badge,
|
|
526
947
|
E as Button,
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
948
|
+
Q as CLIENT_UPDATE_REQUIRED,
|
|
949
|
+
Ne as CallBar,
|
|
950
|
+
ge as CallPanel,
|
|
951
|
+
_e as ChatBubble,
|
|
952
|
+
be as Composer,
|
|
953
|
+
ce as ConfirmDialog,
|
|
954
|
+
Me as ContextMenu,
|
|
955
|
+
V as EmptyState,
|
|
956
|
+
j as ErrorBanner,
|
|
957
|
+
he as FilterChips,
|
|
958
|
+
de as ICON_NAMES,
|
|
959
|
+
y as Icon,
|
|
960
|
+
ve as IncomingCall,
|
|
961
|
+
ke as List,
|
|
962
|
+
P as Loading,
|
|
963
|
+
R as MODAL_CLOSE_MS,
|
|
964
|
+
pe as MailRow,
|
|
965
|
+
z as Modal,
|
|
966
|
+
ie as PageHeader,
|
|
967
|
+
ue as SearchField,
|
|
968
|
+
ae as Select,
|
|
969
|
+
we as SignInForm,
|
|
970
|
+
ye as SignInLayout,
|
|
971
|
+
fe as SplitPanes,
|
|
972
|
+
oe as TabStrip,
|
|
973
|
+
ne as TextField,
|
|
974
|
+
te as Toast,
|
|
975
|
+
re as ToastRegion,
|
|
976
|
+
se as Toggle,
|
|
977
|
+
q as initialsOf,
|
|
978
|
+
G as isCapability,
|
|
979
|
+
$e as needsClientUpdate,
|
|
980
|
+
xe as offerFor,
|
|
981
|
+
Ee as readConflict,
|
|
982
|
+
Ce as readRefusal,
|
|
983
|
+
Y as refusalText,
|
|
984
|
+
Ae as rereadAll,
|
|
985
|
+
U as tintOf,
|
|
986
|
+
De as useReread,
|
|
987
|
+
J as versionBelow
|
|
553
988
|
};
|