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