@dataesr/dsfr-plus 0.5.5 → 0.6.2
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/dist/components/Autocomplete/autocomplete.d.ts +2 -3
- package/dist/components/Autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +2 -2
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/dsfr-plus.js +8315 -6635
- package/dist/hooks/useDSFRConfig.d.ts.map +1 -1
- package/dist/style.css +1 -5
- package/package.json +10 -3
- package/dist/dsfr-4e49221c.js +0 -7
- package/dist/dsfr.module.min-23ae5258.js +0 -3367
- package/dist/utility-251e9615.js +0 -7
|
@@ -1,3367 +0,0 @@
|
|
|
1
|
-
/*! DSFR v1.11.0 | SPDX-License-Identifier: MIT | License-Filename: LICENSE.md | restricted use (see terms and conditions) */
|
|
2
|
-
const h = new class {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.modules = {};
|
|
5
|
-
}
|
|
6
|
-
create(i) {
|
|
7
|
-
const t = new i();
|
|
8
|
-
this.modules[t.type] = t;
|
|
9
|
-
}
|
|
10
|
-
getModule(i) {
|
|
11
|
-
return this.modules[i];
|
|
12
|
-
}
|
|
13
|
-
add(i, t) {
|
|
14
|
-
this.modules[i].add(t);
|
|
15
|
-
}
|
|
16
|
-
remove(i, t) {
|
|
17
|
-
this.modules[i].remove(t);
|
|
18
|
-
}
|
|
19
|
-
get isActive() {
|
|
20
|
-
return this._isActive;
|
|
21
|
-
}
|
|
22
|
-
set isActive(i) {
|
|
23
|
-
if (i === this._isActive)
|
|
24
|
-
return;
|
|
25
|
-
this._isActive = i;
|
|
26
|
-
const t = Object.keys(this.modules).map((e) => this.modules[e]);
|
|
27
|
-
if (i)
|
|
28
|
-
for (const e of t)
|
|
29
|
-
e.activate();
|
|
30
|
-
else
|
|
31
|
-
for (const e of t)
|
|
32
|
-
e.deactivate();
|
|
33
|
-
}
|
|
34
|
-
get isLegacy() {
|
|
35
|
-
return this._isLegacy;
|
|
36
|
-
}
|
|
37
|
-
set isLegacy(i) {
|
|
38
|
-
i !== this._isLegacy && (this._isLegacy = i);
|
|
39
|
-
}
|
|
40
|
-
}(), zt = "fr", V = "dsfr", pe = "@gouvfr", ct = "1.11.0";
|
|
41
|
-
class W {
|
|
42
|
-
constructor(t, e, n, r) {
|
|
43
|
-
switch (this.level = t, this.light = e, this.dark = n, r) {
|
|
44
|
-
case "warn":
|
|
45
|
-
this.logger = console.warn;
|
|
46
|
-
break;
|
|
47
|
-
case "error":
|
|
48
|
-
this.logger = console.error;
|
|
49
|
-
break;
|
|
50
|
-
default:
|
|
51
|
-
this.logger = console.log;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
log(...t) {
|
|
55
|
-
const e = new lt(V);
|
|
56
|
-
for (const n of t)
|
|
57
|
-
e.add(n);
|
|
58
|
-
this.print(e);
|
|
59
|
-
}
|
|
60
|
-
print(t) {
|
|
61
|
-
t.setColor(this.color), this.logger.apply(console, t.getMessage());
|
|
62
|
-
}
|
|
63
|
-
get color() {
|
|
64
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? this.dark : this.light;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
class lt {
|
|
68
|
-
constructor(t) {
|
|
69
|
-
this.inputs = ["%c"], this.styles = ["font-family:Marianne", "line-height: 1.5"], this.objects = [], t && this.add(`${t} :`);
|
|
70
|
-
}
|
|
71
|
-
add(t) {
|
|
72
|
-
switch (typeof t) {
|
|
73
|
-
case "object":
|
|
74
|
-
case "function":
|
|
75
|
-
this.inputs.push("%o "), this.objects.push(t);
|
|
76
|
-
break;
|
|
77
|
-
default:
|
|
78
|
-
this.inputs.push(`${t} `);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
setColor(t) {
|
|
82
|
-
this.styles.push(`color:${t}`);
|
|
83
|
-
}
|
|
84
|
-
getMessage() {
|
|
85
|
-
return [this.inputs.join(""), this.styles.join(";"), ...this.objects];
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
const Dt = { log: new W(0, "#616161", "#989898"), debug: new W(1, "#000091", "#8B8BFF"), info: new W(2, "#007c3b", "#00ed70"), warn: new W(3, "#ba4500", "#fa5c00", "warn"), error: new W(4, "#D80600", "#FF4641", "error") }, g = new class {
|
|
89
|
-
constructor() {
|
|
90
|
-
this.level = 2;
|
|
91
|
-
for (const i in Dt) {
|
|
92
|
-
const t = Dt[i];
|
|
93
|
-
this[i] = (...e) => {
|
|
94
|
-
this.level <= t.level && t.log.apply(t, e);
|
|
95
|
-
}, this[i].print = t.print.bind(t);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
state() {
|
|
99
|
-
const i = new lt();
|
|
100
|
-
i.add(h), this.log.print(i);
|
|
101
|
-
}
|
|
102
|
-
tree() {
|
|
103
|
-
const i = h.getModule("stage");
|
|
104
|
-
if (!i)
|
|
105
|
-
return;
|
|
106
|
-
const t = new lt();
|
|
107
|
-
this._branch(i.root, 0, t), this.log.print(t);
|
|
108
|
-
}
|
|
109
|
-
_branch(i, t, e) {
|
|
110
|
-
let n = "";
|
|
111
|
-
if (t > 0) {
|
|
112
|
-
let r = "";
|
|
113
|
-
for (let a = 0; a < t; a++)
|
|
114
|
-
r += " ";
|
|
115
|
-
n += r + "└─ ";
|
|
116
|
-
}
|
|
117
|
-
n += `[${i.id}] ${i.html}`, e.add(n), e.add({ "@": i }), e.add(`
|
|
118
|
-
`);
|
|
119
|
-
for (const r of i.children)
|
|
120
|
-
n += this._branch(r, t + 1, e);
|
|
121
|
-
}
|
|
122
|
-
}(), wt = (i) => {
|
|
123
|
-
document.readyState !== "loading" ? window.requestAnimationFrame(i) : document.addEventListener("DOMContentLoaded", i);
|
|
124
|
-
}, v = { AUTO: "auto", MANUAL: "manual", RUNTIME: "runtime", LOADED: "loaded", VUE: "vue", ANGULAR: "angular", REACT: "react" }, Z = new class {
|
|
125
|
-
constructor() {
|
|
126
|
-
this._mode = v.AUTO, this.isStarted = !1, this.starting = this.start.bind(this), this.preventManipulation = !1;
|
|
127
|
-
}
|
|
128
|
-
configure(i = {}, t, e) {
|
|
129
|
-
this.startCallback = t;
|
|
130
|
-
const n = i.production && (!e || e.production !== "false");
|
|
131
|
-
switch (!0) {
|
|
132
|
-
case (e && !isNaN(e.level)):
|
|
133
|
-
g.level = Number(e.level);
|
|
134
|
-
break;
|
|
135
|
-
case (e && e.verbose && (e.verbose === "true" || e.verbose === 1)):
|
|
136
|
-
g.level = 0;
|
|
137
|
-
break;
|
|
138
|
-
case n:
|
|
139
|
-
g.level = 999;
|
|
140
|
-
break;
|
|
141
|
-
case i.verbose:
|
|
142
|
-
g.level = 0;
|
|
143
|
-
}
|
|
144
|
-
g.info(`version ${ct}`), this.mode = i.mode || v.AUTO;
|
|
145
|
-
}
|
|
146
|
-
set mode(i) {
|
|
147
|
-
switch (i) {
|
|
148
|
-
case v.AUTO:
|
|
149
|
-
this.preventManipulation = !1, t = this.starting, wt(t);
|
|
150
|
-
break;
|
|
151
|
-
case v.LOADED:
|
|
152
|
-
this.preventManipulation = !1, wt(this.starting);
|
|
153
|
-
break;
|
|
154
|
-
case v.RUNTIME:
|
|
155
|
-
this.preventManipulation = !1, this.start();
|
|
156
|
-
break;
|
|
157
|
-
case v.MANUAL:
|
|
158
|
-
this.preventManipulation = !1;
|
|
159
|
-
break;
|
|
160
|
-
case v.VUE:
|
|
161
|
-
case v.ANGULAR:
|
|
162
|
-
case v.REACT:
|
|
163
|
-
this.preventManipulation = !0;
|
|
164
|
-
break;
|
|
165
|
-
default:
|
|
166
|
-
return void g.error("Illegal mode");
|
|
167
|
-
}
|
|
168
|
-
var t;
|
|
169
|
-
this._mode = i, g.info(`mode set to ${i}`);
|
|
170
|
-
}
|
|
171
|
-
get mode() {
|
|
172
|
-
return this._mode;
|
|
173
|
-
}
|
|
174
|
-
start() {
|
|
175
|
-
g.info("start"), this.startCallback();
|
|
176
|
-
}
|
|
177
|
-
}();
|
|
178
|
-
class K {
|
|
179
|
-
constructor() {
|
|
180
|
-
this._collection = [];
|
|
181
|
-
}
|
|
182
|
-
forEach(t) {
|
|
183
|
-
this._collection.forEach(t);
|
|
184
|
-
}
|
|
185
|
-
map(t) {
|
|
186
|
-
return this._collection.map(t);
|
|
187
|
-
}
|
|
188
|
-
get length() {
|
|
189
|
-
return this._collection.length;
|
|
190
|
-
}
|
|
191
|
-
add(t) {
|
|
192
|
-
return !(this._collection.indexOf(t) > -1) && (this._collection.push(t), this.onAdd && this.onAdd(), this.onPopulate && this._collection.length === 1 && this.onPopulate(), !0);
|
|
193
|
-
}
|
|
194
|
-
remove(t) {
|
|
195
|
-
const e = this._collection.indexOf(t);
|
|
196
|
-
if (e === -1)
|
|
197
|
-
return !1;
|
|
198
|
-
this._collection.splice(e, 1), this.onRemove && this.onRemove(), this.onEmpty && this._collection.length === 0 && this.onEmpty();
|
|
199
|
-
}
|
|
200
|
-
execute(...t) {
|
|
201
|
-
for (const e of this._collection)
|
|
202
|
-
e && e.apply(null, t);
|
|
203
|
-
}
|
|
204
|
-
clear() {
|
|
205
|
-
this._collection.length = 0;
|
|
206
|
-
}
|
|
207
|
-
clone() {
|
|
208
|
-
const t = new K();
|
|
209
|
-
return t._collection = this._collection.slice(), t;
|
|
210
|
-
}
|
|
211
|
-
get collection() {
|
|
212
|
-
return this._collection;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
class w extends K {
|
|
216
|
-
constructor(t) {
|
|
217
|
-
super(), this.type = t, this.isActive = !1;
|
|
218
|
-
}
|
|
219
|
-
activate() {
|
|
220
|
-
}
|
|
221
|
-
deactivate() {
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
const o = (i) => `${zt}-${i}`;
|
|
225
|
-
o.selector = (i, t) => (t === void 0 && (t = "."), `${t}${o(i)}`), (o.attr = (i) => `data-${o(i)}`).selector = (i, t) => {
|
|
226
|
-
let e = o.attr(i);
|
|
227
|
-
return t !== void 0 && (e += `="${t}"`), `[${e}]`;
|
|
228
|
-
}, o.event = (i) => `${V}.${i}`, o.emission = (i, t) => `emission:${i}.${t}`;
|
|
229
|
-
const vt = (i, t) => Array.prototype.slice.call(i.querySelectorAll(t)), yt = (i, t) => {
|
|
230
|
-
const e = i.parentElement;
|
|
231
|
-
return e.matches(t) ? e : e === document.documentElement ? null : yt(e, t);
|
|
232
|
-
};
|
|
233
|
-
class _e {
|
|
234
|
-
constructor(t, e, n) {
|
|
235
|
-
this.selector = t, this.InstanceClass = e, this.creator = n, this.instances = new K(), this.isIntroduced = !1, this._instanceClassName = this.InstanceClass.instanceClassName, this._instanceClassNames = this.getInstanceClassNames(this.InstanceClass), this._property = this._instanceClassName.substring(0, 1).toLowerCase() + this._instanceClassName.substring(1);
|
|
236
|
-
const r = this._instanceClassName.replace(/[^a-zA-Z0-9]+/g, "-").replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/([0-9])([^0-9])/g, "$1-$2").replace(/([^0-9])([0-9])/g, "$1-$2").toLowerCase();
|
|
237
|
-
this._attribute = o.attr(`js-${r}`);
|
|
238
|
-
}
|
|
239
|
-
getInstanceClassNames(t) {
|
|
240
|
-
const e = Object.getPrototypeOf(t);
|
|
241
|
-
return e && e.instanceClassName !== "Instance" ? [...this.getInstanceClassNames(e), t.instanceClassName] : [t.instanceClassName];
|
|
242
|
-
}
|
|
243
|
-
hasInstanceClassName(t) {
|
|
244
|
-
return this._instanceClassNames.indexOf(t) > -1;
|
|
245
|
-
}
|
|
246
|
-
introduce() {
|
|
247
|
-
this.isIntroduced || (this.isIntroduced = !0, h.getModule("stage").parse(document.documentElement, this));
|
|
248
|
-
}
|
|
249
|
-
parse(t, e) {
|
|
250
|
-
const n = [];
|
|
251
|
-
return t.matches && t.matches(this.selector) && n.push(t), !e && t.querySelectorAll && t.querySelector(this.selector) && n.push.apply(n, vt(t, this.selector)), n;
|
|
252
|
-
}
|
|
253
|
-
create(t) {
|
|
254
|
-
if (!t.node.matches(this.selector))
|
|
255
|
-
return;
|
|
256
|
-
const e = new this.InstanceClass();
|
|
257
|
-
return this.instances.add(e), e;
|
|
258
|
-
}
|
|
259
|
-
remove(t) {
|
|
260
|
-
this.instances.remove(t);
|
|
261
|
-
}
|
|
262
|
-
dispose() {
|
|
263
|
-
const t = this.instances.collection;
|
|
264
|
-
for (let e = t.length - 1; e > -1; e--)
|
|
265
|
-
t[e]._dispose();
|
|
266
|
-
this.creator = null;
|
|
267
|
-
}
|
|
268
|
-
get instanceClassName() {
|
|
269
|
-
return this._instanceClassName;
|
|
270
|
-
}
|
|
271
|
-
get instanceClassNames() {
|
|
272
|
-
return this._instanceClassNames;
|
|
273
|
-
}
|
|
274
|
-
get property() {
|
|
275
|
-
return this._property;
|
|
276
|
-
}
|
|
277
|
-
get attribute() {
|
|
278
|
-
return this._attribute;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
class be extends w {
|
|
282
|
-
constructor() {
|
|
283
|
-
super("register");
|
|
284
|
-
}
|
|
285
|
-
register(t, e, n) {
|
|
286
|
-
const r = new _e(t, e, n);
|
|
287
|
-
return this.add(r), h.isActive && r.introduce(), r;
|
|
288
|
-
}
|
|
289
|
-
activate() {
|
|
290
|
-
for (const t of this.collection)
|
|
291
|
-
t.introduce();
|
|
292
|
-
}
|
|
293
|
-
remove(t) {
|
|
294
|
-
t.dispose(), super.remove(t);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
let Lt = 0;
|
|
298
|
-
class jt {
|
|
299
|
-
constructor(t, e) {
|
|
300
|
-
e ? this.id = e : (Lt++, this.id = Lt), this.node = t, this.attributeNames = [], this.instances = [], this._children = [], this._parent = null, this._projects = [];
|
|
301
|
-
}
|
|
302
|
-
get proxy() {
|
|
303
|
-
const t = this;
|
|
304
|
-
if (!this._proxy) {
|
|
305
|
-
this._proxy = { id: this.id, get parent() {
|
|
306
|
-
return t.parent ? t.parent.proxy : null;
|
|
307
|
-
}, get children() {
|
|
308
|
-
return t.children.map((e) => e.proxy);
|
|
309
|
-
} };
|
|
310
|
-
for (const e of this.instances)
|
|
311
|
-
this._proxy[e.registration.property] = e.proxy;
|
|
312
|
-
}
|
|
313
|
-
return this._proxy;
|
|
314
|
-
}
|
|
315
|
-
get html() {
|
|
316
|
-
if (!this.node || !this.node.outerHTML)
|
|
317
|
-
return "";
|
|
318
|
-
const t = this.node.outerHTML.indexOf(">");
|
|
319
|
-
return this.node.outerHTML.substring(0, t + 1);
|
|
320
|
-
}
|
|
321
|
-
project(t) {
|
|
322
|
-
this._projects.indexOf(t) === -1 && this._projects.push(t);
|
|
323
|
-
}
|
|
324
|
-
populate() {
|
|
325
|
-
const t = this._projects.slice();
|
|
326
|
-
this._projects.length = 0;
|
|
327
|
-
for (const e of t)
|
|
328
|
-
this.create(e);
|
|
329
|
-
}
|
|
330
|
-
create(t) {
|
|
331
|
-
if (this.hasInstance(t.instanceClassName))
|
|
332
|
-
return;
|
|
333
|
-
g.debug(`create instance of ${t.instanceClassName} on element [${this.id}]`);
|
|
334
|
-
const e = t.create(this);
|
|
335
|
-
this.instances.push(e), e._config(this, t), this._proxy && (this._proxy[t.property] = e.proxy);
|
|
336
|
-
}
|
|
337
|
-
remove(t) {
|
|
338
|
-
const e = this.instances.indexOf(t);
|
|
339
|
-
e > -1 && this.instances.splice(e, 1), this._proxy && delete this._proxy[t.registration.property];
|
|
340
|
-
}
|
|
341
|
-
get parent() {
|
|
342
|
-
return this._parent;
|
|
343
|
-
}
|
|
344
|
-
get ascendants() {
|
|
345
|
-
return [this.parent, ...this.parent.ascendants];
|
|
346
|
-
}
|
|
347
|
-
get children() {
|
|
348
|
-
return this._children;
|
|
349
|
-
}
|
|
350
|
-
get descendants() {
|
|
351
|
-
const t = [...this._children];
|
|
352
|
-
return this._children.forEach((e) => t.push(...e.descendants)), t;
|
|
353
|
-
}
|
|
354
|
-
addChild(t, e) {
|
|
355
|
-
return this._children.indexOf(t) > -1 ? null : (t._parent = this, !isNaN(e) && e > -1 && e < this._children.length ? this._children.splice(e, 0, t) : this._children.push(t), t);
|
|
356
|
-
}
|
|
357
|
-
removeChild(t) {
|
|
358
|
-
const e = this._children.indexOf(t);
|
|
359
|
-
if (e === -1)
|
|
360
|
-
return null;
|
|
361
|
-
t._parent = null, this._children.splice(e, 1);
|
|
362
|
-
}
|
|
363
|
-
emit(t, e) {
|
|
364
|
-
const n = h.getModule("stage").collection, r = [];
|
|
365
|
-
for (const a of n)
|
|
366
|
-
r.push(...a._emit(t, e));
|
|
367
|
-
return r;
|
|
368
|
-
}
|
|
369
|
-
_emit(t, e) {
|
|
370
|
-
const n = [];
|
|
371
|
-
for (const r of this.instances)
|
|
372
|
-
n.push(...r._emitter.emit(t, e));
|
|
373
|
-
return n;
|
|
374
|
-
}
|
|
375
|
-
ascend(t, e) {
|
|
376
|
-
return this._parent ? this._parent._ascend(t, e) : [];
|
|
377
|
-
}
|
|
378
|
-
_ascend(t, e) {
|
|
379
|
-
const n = [];
|
|
380
|
-
for (const r of this.instances)
|
|
381
|
-
n.push(...r._ascent.emit(t, e));
|
|
382
|
-
return this._parent && n.push(...this._parent._ascend(t, e)), n;
|
|
383
|
-
}
|
|
384
|
-
descend(t, e) {
|
|
385
|
-
const n = [];
|
|
386
|
-
for (const r of this._children)
|
|
387
|
-
n.push(...r._descend(t, e));
|
|
388
|
-
return n;
|
|
389
|
-
}
|
|
390
|
-
_descend(t, e) {
|
|
391
|
-
const n = [];
|
|
392
|
-
for (const r of this.instances)
|
|
393
|
-
n.push(...r._descent.emit(t, e));
|
|
394
|
-
for (const r of this._children)
|
|
395
|
-
n.push(...r._descend(t, e));
|
|
396
|
-
return n;
|
|
397
|
-
}
|
|
398
|
-
getInstance(t) {
|
|
399
|
-
for (const e of this.instances)
|
|
400
|
-
if (e.registration.hasInstanceClassName(t))
|
|
401
|
-
return e;
|
|
402
|
-
return null;
|
|
403
|
-
}
|
|
404
|
-
hasInstance(t) {
|
|
405
|
-
return this.getInstance(t) !== null;
|
|
406
|
-
}
|
|
407
|
-
getDescendantInstances(t, e, n) {
|
|
408
|
-
if (!t)
|
|
409
|
-
return [];
|
|
410
|
-
const r = [];
|
|
411
|
-
for (const a of this._children) {
|
|
412
|
-
const c = a.getInstance(t);
|
|
413
|
-
c && (r.push(c), n) || e && a.hasInstance(e) || !a.children.length || r.push.apply(r, a.getDescendantInstances(t, e, n));
|
|
414
|
-
}
|
|
415
|
-
return r;
|
|
416
|
-
}
|
|
417
|
-
getAscendantInstance(t, e) {
|
|
418
|
-
return !t || !this._parent ? null : this._parent.getInstance(t) || (e && this._parent.hasInstance(e) ? null : this._parent.getAscendantInstance(t, e));
|
|
419
|
-
}
|
|
420
|
-
dispose() {
|
|
421
|
-
for (let t = this.instances.length - 1; t >= 0; t--) {
|
|
422
|
-
const e = this.instances[t];
|
|
423
|
-
e && e._dispose();
|
|
424
|
-
}
|
|
425
|
-
this.instances.length = 0, h.remove("stage", this), this.parent.removeChild(this), this._children.length = 0, g.debug(`remove element [${this.id}] ${this.html}`);
|
|
426
|
-
}
|
|
427
|
-
prepare(t) {
|
|
428
|
-
this.attributeNames.indexOf(t) === -1 && this.attributeNames.push(t);
|
|
429
|
-
}
|
|
430
|
-
examine() {
|
|
431
|
-
const t = this.attributeNames.slice();
|
|
432
|
-
this.attributeNames.length = 0;
|
|
433
|
-
for (let e = this.instances.length - 1; e > -1; e--)
|
|
434
|
-
this.instances[e].examine(t);
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
const Q = { CLICK: o.emission("root", "click"), KEYDOWN: o.emission("root", "keydown"), KEYUP: o.emission("root", "keyup") }, Vt = { TAB: { id: "tab", value: 9 }, ESCAPE: { id: "escape", value: 27 }, END: { id: "end", value: 35 }, HOME: { id: "home", value: 36 }, LEFT: { id: "left", value: 37 }, UP: { id: "up", value: 38 }, RIGHT: { id: "right", value: 39 }, DOWN: { id: "down", value: 40 } }, Rt = (i) => Object.values(Vt).filter((t) => t.value === i)[0];
|
|
438
|
-
class Ee extends jt {
|
|
439
|
-
constructor() {
|
|
440
|
-
super(document.documentElement, "root"), this.node.setAttribute(o.attr("js"), !0), this.listen();
|
|
441
|
-
}
|
|
442
|
-
listen() {
|
|
443
|
-
document.documentElement.addEventListener("click", this.click.bind(this), { capture: !0 }), document.documentElement.addEventListener("keydown", this.keydown.bind(this), { capture: !0 }), document.documentElement.addEventListener("keyup", this.keyup.bind(this), { capture: !0 });
|
|
444
|
-
}
|
|
445
|
-
click(t) {
|
|
446
|
-
this.emit(Q.CLICK, t.target);
|
|
447
|
-
}
|
|
448
|
-
keydown(t) {
|
|
449
|
-
this.emit(Q.KEYDOWN, Rt(t.keyCode));
|
|
450
|
-
}
|
|
451
|
-
keyup(t) {
|
|
452
|
-
this.emit(Q.KEYUP, Rt(t.keyCode));
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
class fe extends w {
|
|
456
|
-
constructor() {
|
|
457
|
-
super("stage"), this.root = new Ee(), super.add(this.root), this.observer = new MutationObserver(this.mutate.bind(this)), this.modifications = [], this.willModify = !1, this.modifying = this.modify.bind(this);
|
|
458
|
-
}
|
|
459
|
-
hasElement(t) {
|
|
460
|
-
for (const e of this.collection)
|
|
461
|
-
if (e.node === t)
|
|
462
|
-
return !0;
|
|
463
|
-
return !1;
|
|
464
|
-
}
|
|
465
|
-
getElement(t) {
|
|
466
|
-
for (const n of this.collection)
|
|
467
|
-
if (n.node === t)
|
|
468
|
-
return n;
|
|
469
|
-
const e = new jt(t);
|
|
470
|
-
return this.add(e), g.debug(`add element [${e.id}] ${e.html}`), e;
|
|
471
|
-
}
|
|
472
|
-
getProxy(t) {
|
|
473
|
-
return this.hasElement(t) ? this.getElement(t).proxy : null;
|
|
474
|
-
}
|
|
475
|
-
add(t) {
|
|
476
|
-
super.add(t), this.put(t, this.root);
|
|
477
|
-
}
|
|
478
|
-
put(t, e) {
|
|
479
|
-
let n = 0;
|
|
480
|
-
for (let r = e.children.length - 1; r > -1; r--) {
|
|
481
|
-
const a = e.children[r], c = t.node.compareDocumentPosition(a.node);
|
|
482
|
-
if (c & Node.DOCUMENT_POSITION_CONTAINS)
|
|
483
|
-
return void this.put(t, a);
|
|
484
|
-
if (c & Node.DOCUMENT_POSITION_CONTAINED_BY)
|
|
485
|
-
e.removeChild(a), t.addChild(a, 0);
|
|
486
|
-
else if (c & Node.DOCUMENT_POSITION_PRECEDING) {
|
|
487
|
-
n = r + 1;
|
|
488
|
-
break;
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
e.addChild(t, n);
|
|
492
|
-
}
|
|
493
|
-
activate() {
|
|
494
|
-
this.observer.observe(document.documentElement, { childList: !0, subtree: !0, attributes: !0 });
|
|
495
|
-
}
|
|
496
|
-
deactivate() {
|
|
497
|
-
this.observer.disconnect();
|
|
498
|
-
}
|
|
499
|
-
mutate(t) {
|
|
500
|
-
const e = [];
|
|
501
|
-
t.forEach((n) => {
|
|
502
|
-
switch (n.type) {
|
|
503
|
-
case "childList":
|
|
504
|
-
n.removedNodes.forEach((r) => this.dispose(r)), n.addedNodes.forEach((r) => this.parse(r));
|
|
505
|
-
break;
|
|
506
|
-
case "attributes":
|
|
507
|
-
if (this.hasElement(n.target)) {
|
|
508
|
-
const r = this.getElement(n.target);
|
|
509
|
-
r.prepare(n.attributeName), e.indexOf(r) === -1 && e.push(r);
|
|
510
|
-
for (const a of r.descendants)
|
|
511
|
-
e.indexOf(a) === -1 && e.push(a);
|
|
512
|
-
}
|
|
513
|
-
this.modifications.indexOf(n.target) === -1 && this.modifications.push(n.target);
|
|
514
|
-
}
|
|
515
|
-
}), e.forEach((n) => n.examine()), this.modifications.length && !this.willModify && (this.willModify = !0, window.requestAnimationFrame(this.modifying));
|
|
516
|
-
}
|
|
517
|
-
modify() {
|
|
518
|
-
this.willModify = !1;
|
|
519
|
-
const t = this.modifications.slice();
|
|
520
|
-
this.modifications.length = 0;
|
|
521
|
-
for (const e of t)
|
|
522
|
-
document.documentElement.contains(e) && this.parse(e);
|
|
523
|
-
}
|
|
524
|
-
dispose(t) {
|
|
525
|
-
const e = [];
|
|
526
|
-
this.forEach((n) => {
|
|
527
|
-
t.contains(n.node) && e.push(n);
|
|
528
|
-
});
|
|
529
|
-
for (const n of e)
|
|
530
|
-
n.dispose(), this.remove(n);
|
|
531
|
-
}
|
|
532
|
-
parse(t, e, n) {
|
|
533
|
-
const r = e ? [e] : h.getModule("register").collection, a = [];
|
|
534
|
-
for (const c of r) {
|
|
535
|
-
const T = c.parse(t, n);
|
|
536
|
-
for (const me of T) {
|
|
537
|
-
const it = this.getElement(me);
|
|
538
|
-
it.project(c), a.indexOf(it) === -1 && a.push(it);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
for (const c of a)
|
|
542
|
-
c.populate();
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
class Ae extends w {
|
|
546
|
-
constructor() {
|
|
547
|
-
super("render"), this.rendering = this.render.bind(this), this.nexts = new K();
|
|
548
|
-
}
|
|
549
|
-
activate() {
|
|
550
|
-
window.requestAnimationFrame(this.rendering);
|
|
551
|
-
}
|
|
552
|
-
request(t) {
|
|
553
|
-
this.nexts.add(t);
|
|
554
|
-
}
|
|
555
|
-
render() {
|
|
556
|
-
if (!h.isActive || (window.requestAnimationFrame(this.rendering), this.forEach((e) => e.render()), !this.nexts.length))
|
|
557
|
-
return;
|
|
558
|
-
const t = this.nexts.clone();
|
|
559
|
-
this.nexts.clear(), t.forEach((e) => e.next());
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
class Te extends w {
|
|
563
|
-
constructor() {
|
|
564
|
-
super("resize"), this.requireResize = !1, this.resizing = this.resize.bind(this);
|
|
565
|
-
const t = this.request.bind(this);
|
|
566
|
-
document.fonts && document.fonts.ready.then(t), window.addEventListener("resize", t), window.addEventListener("orientationchange", t);
|
|
567
|
-
}
|
|
568
|
-
activate() {
|
|
569
|
-
this.request();
|
|
570
|
-
}
|
|
571
|
-
request() {
|
|
572
|
-
this.requireResize || (this.requireResize = !0, window.requestAnimationFrame(this.resizing));
|
|
573
|
-
}
|
|
574
|
-
resize() {
|
|
575
|
-
this.requireResize && (this.forEach((t) => t.resize()), this.requireResize = !1);
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
class Se extends w {
|
|
579
|
-
constructor() {
|
|
580
|
-
super("lock"), this._isLocked = !1, this._scrollY = 0, this.onPopulate = this.lock.bind(this), this.onEmpty = this.unlock.bind(this);
|
|
581
|
-
}
|
|
582
|
-
get isLocked() {
|
|
583
|
-
return this._isLocked;
|
|
584
|
-
}
|
|
585
|
-
lock() {
|
|
586
|
-
if (!this._isLocked) {
|
|
587
|
-
this._isLocked = !0, this._scrollY = window.scrollY;
|
|
588
|
-
const t = window.innerWidth - document.documentElement.clientWidth;
|
|
589
|
-
document.documentElement.setAttribute(o.attr("scrolling"), "false"), document.body.style.top = -this._scrollY + "px", this.behavior = getComputedStyle(document.documentElement).getPropertyValue("scroll-behavior"), this.behavior === "smooth" && (document.documentElement.style.scrollBehavior = "auto"), t > 0 && document.documentElement.style.setProperty("--scrollbar-width", `${t}px`);
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
unlock() {
|
|
593
|
-
this._isLocked && (this._isLocked = !1, document.documentElement.removeAttribute(o.attr("scrolling")), document.body.style.top = "", window.scrollTo(0, this._scrollY), this.behavior === "smooth" && document.documentElement.style.removeProperty("scroll-behavior"), document.documentElement.style.removeProperty("--scrollbar-width"));
|
|
594
|
-
}
|
|
595
|
-
move(t) {
|
|
596
|
-
this._isLocked ? (this._scrollY += t, document.body.style.top = -this._scrollY + "px") : window.scrollTo(0, window.scrollY + t);
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
class ve extends w {
|
|
600
|
-
constructor() {
|
|
601
|
-
super("load"), this.loading = this.load.bind(this);
|
|
602
|
-
}
|
|
603
|
-
activate() {
|
|
604
|
-
window.addEventListener("load", this.loading);
|
|
605
|
-
}
|
|
606
|
-
load() {
|
|
607
|
-
this.forEach((t) => t.load());
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
const ye = ["Marianne", "Spectral"];
|
|
611
|
-
class Ce extends w {
|
|
612
|
-
constructor() {
|
|
613
|
-
super("font-swap"), this.swapping = this.swap.bind(this);
|
|
614
|
-
}
|
|
615
|
-
activate() {
|
|
616
|
-
document.fonts && document.fonts.addEventListener("loadingdone", this.swapping);
|
|
617
|
-
}
|
|
618
|
-
swap() {
|
|
619
|
-
const t = ye.filter((e) => document.fonts.check(`16px ${e}`));
|
|
620
|
-
this.forEach((e) => e.swapFont(t));
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
class Ne extends w {
|
|
624
|
-
constructor() {
|
|
625
|
-
super("mouse-move"), this.requireMove = !1, this._isMoving = !1, this.moving = this.move.bind(this), this.requesting = this.request.bind(this), this.onPopulate = this.listen.bind(this), this.onEmpty = this.unlisten.bind(this);
|
|
626
|
-
}
|
|
627
|
-
listen() {
|
|
628
|
-
this._isMoving || (this._isMoving = !0, this.requireMove = !1, document.documentElement.addEventListener("mousemove", this.requesting));
|
|
629
|
-
}
|
|
630
|
-
unlisten() {
|
|
631
|
-
this._isMoving && (this._isMoving = !1, this.requireMove = !1, document.documentElement.removeEventListener("mousemove", this.requesting));
|
|
632
|
-
}
|
|
633
|
-
request(t) {
|
|
634
|
-
this._isMoving && (this.point = { x: t.clientX, y: t.clientY }, this.requireMove || (this.requireMove = !0, window.requestAnimationFrame(this.moving)));
|
|
635
|
-
}
|
|
636
|
-
move() {
|
|
637
|
-
this.requireMove && (this.forEach((t) => t.mouseMove(this.point)), this.requireMove = !1);
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
class De extends w {
|
|
641
|
-
constructor() {
|
|
642
|
-
super("hash"), this.handling = this.handle.bind(this), this.getLocationHash();
|
|
643
|
-
}
|
|
644
|
-
activate() {
|
|
645
|
-
window.addEventListener("hashchange", this.handling);
|
|
646
|
-
}
|
|
647
|
-
deactivate() {
|
|
648
|
-
window.removeEventListener("hashchange", this.handling);
|
|
649
|
-
}
|
|
650
|
-
_sanitize(t) {
|
|
651
|
-
return t.charAt(0) === "#" ? t.substring(1) : t;
|
|
652
|
-
}
|
|
653
|
-
set hash(t) {
|
|
654
|
-
const e = this._sanitize(t);
|
|
655
|
-
this._hash !== e && (window.location.hash = e);
|
|
656
|
-
}
|
|
657
|
-
get hash() {
|
|
658
|
-
return this._hash;
|
|
659
|
-
}
|
|
660
|
-
getLocationHash() {
|
|
661
|
-
const t = window.location.hash;
|
|
662
|
-
this._hash = this._sanitize(t);
|
|
663
|
-
}
|
|
664
|
-
handle(t) {
|
|
665
|
-
this.getLocationHash(), this.forEach((e) => e.handleHash(this._hash, t));
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
const dt = new class {
|
|
669
|
-
constructor() {
|
|
670
|
-
h.create(be), h.create(fe), h.create(Ae), h.create(Te), h.create(Se), h.create(ve), h.create(Ce), h.create(Ne), h.create(De);
|
|
671
|
-
const i = h.getModule("register");
|
|
672
|
-
this.register = i.register.bind(i);
|
|
673
|
-
}
|
|
674
|
-
get isActive() {
|
|
675
|
-
return h.isActive;
|
|
676
|
-
}
|
|
677
|
-
start() {
|
|
678
|
-
g.debug("START"), h.isActive = !0;
|
|
679
|
-
}
|
|
680
|
-
stop() {
|
|
681
|
-
g.debug("STOP"), h.isActive = !1;
|
|
682
|
-
}
|
|
683
|
-
}(), we = (i) => {
|
|
684
|
-
switch (!0) {
|
|
685
|
-
case i.hover:
|
|
686
|
-
return "-hover";
|
|
687
|
-
case i.active:
|
|
688
|
-
return "-active";
|
|
689
|
-
default:
|
|
690
|
-
return "";
|
|
691
|
-
}
|
|
692
|
-
}, Le = new class {
|
|
693
|
-
getColor(i, t, e, n = {}) {
|
|
694
|
-
const r = `--${i}-${t}-${e}${we(n)}`;
|
|
695
|
-
return getComputedStyle(document.documentElement).getPropertyValue(r).trim() || null;
|
|
696
|
-
}
|
|
697
|
-
}(), Kt = (i) => i.charAt(0) === "." ? i.substr(1) : i, Ct = (i) => {
|
|
698
|
-
switch (!0) {
|
|
699
|
-
case !i.className:
|
|
700
|
-
return [];
|
|
701
|
-
case typeof i.className == "string":
|
|
702
|
-
return i.className.split(" ");
|
|
703
|
-
case typeof i.className.baseVal == "string":
|
|
704
|
-
return i.className.baseVal.split(" ");
|
|
705
|
-
}
|
|
706
|
-
return [];
|
|
707
|
-
}, Yt = (i, t, e) => {
|
|
708
|
-
t = Kt(t);
|
|
709
|
-
const n = Ct(i), r = n.indexOf(t);
|
|
710
|
-
e === !0 ? r > -1 && n.splice(r, 1) : r === -1 && n.push(t), i.className = n.join(" ");
|
|
711
|
-
}, Xt = (i, t) => Yt(i, t), Qt = (i, t) => Yt(i, t, !0), Jt = (i, t) => Ct(i).indexOf(Kt(t)) > -1, Re = ['[tabindex]:not([tabindex="-1"])', "a[href]", "button:not([disabled])", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details", "iframe"].join(), Zt = (i) => i.querySelectorAll(Re);
|
|
712
|
-
let It = 0;
|
|
713
|
-
const te = (i) => {
|
|
714
|
-
if (!document.getElementById(i))
|
|
715
|
-
return i;
|
|
716
|
-
let t = !0;
|
|
717
|
-
const e = i;
|
|
718
|
-
for (; t; )
|
|
719
|
-
It++, i = `${e}-${It}`, t = document.getElementById(i);
|
|
720
|
-
return i;
|
|
721
|
-
}, Ie = { addClass: Xt, hasClass: Jt, removeClass: Qt, queryParentSelector: yt, querySelectorAllArray: vt, queryActions: Zt, uniqueId: te }, xe = { DataURISVG: class {
|
|
722
|
-
constructor(i = 0, t = 0) {
|
|
723
|
-
this._width = i, this._height = t, this._content = "";
|
|
724
|
-
}
|
|
725
|
-
get width() {
|
|
726
|
-
return this._width;
|
|
727
|
-
}
|
|
728
|
-
set width(i) {
|
|
729
|
-
this._width = i;
|
|
730
|
-
}
|
|
731
|
-
get height() {
|
|
732
|
-
return this._height;
|
|
733
|
-
}
|
|
734
|
-
set height(i) {
|
|
735
|
-
this._height = i;
|
|
736
|
-
}
|
|
737
|
-
get content() {
|
|
738
|
-
return this._content;
|
|
739
|
-
}
|
|
740
|
-
set content(i) {
|
|
741
|
-
this._content = i;
|
|
742
|
-
}
|
|
743
|
-
getDataURI(i = !1) {
|
|
744
|
-
let t = `<svg xmlns='http://www.w3.org/2000/svg' viewbox='0 0 ${this._width} ${this._height}' width='${this._width}px' height='${this._height}px'>${this._content}</svg>`;
|
|
745
|
-
return t = t.replace(/#/gi, "%23"), i && (t = t.replace(/</gi, "%3C"), t = t.replace(/>/gi, "%3E"), t = t.replace(/"/gi, "'"), t = t.replace(/{/gi, "%7B"), t = t.replace(/}/gi, "%7D")), `data:image/svg+xml;charset=utf8,${t}`;
|
|
746
|
-
}
|
|
747
|
-
} }, Oe = { supportLocalStorage: () => {
|
|
748
|
-
try {
|
|
749
|
-
return "localStorage" in window && window.localStorage !== null;
|
|
750
|
-
} catch {
|
|
751
|
-
return !1;
|
|
752
|
-
}
|
|
753
|
-
}, supportAspectRatio: () => !!window.CSS && CSS.supports("aspect-ratio: 16 / 9") }, Pe = { TransitionSelector: { NONE: o.selector("transition-none") } }, F = (i, ...t) => (t.forEach((e) => {
|
|
754
|
-
const n = Object.keys(e).reduce((r, a) => (r[a] = Object.getOwnPropertyDescriptor(e, a), r), {});
|
|
755
|
-
Object.getOwnPropertySymbols(e).forEach((r) => {
|
|
756
|
-
const a = Object.getOwnPropertyDescriptor(e, r);
|
|
757
|
-
a.enumerable && (n[r] = a);
|
|
758
|
-
}), Object.defineProperties(i, n);
|
|
759
|
-
}), i), ke = { completeAssign: F }, f = {}, nt = {};
|
|
760
|
-
Object.defineProperty(nt, "isLegacy", { get: () => h.isLegacy }), nt.setLegacy = () => {
|
|
761
|
-
h.isLegacy = !0;
|
|
762
|
-
}, f.legacy = nt, f.dom = Ie, f.image = xe, f.support = Oe, f.motion = Pe, f.property = ke, f.ns = o, f.register = dt.register, f.state = h, f.query = ((i) => {
|
|
763
|
-
if (i && i.search) {
|
|
764
|
-
const t = new URLSearchParams(window.location.search).entries();
|
|
765
|
-
return Object.fromEntries(t);
|
|
766
|
-
}
|
|
767
|
-
return null;
|
|
768
|
-
})(window.location), Object.defineProperty(f, "preventManipulation", { get: () => Z.preventManipulation }), Object.defineProperty(f, "stage", { get: () => h.getModule("stage") });
|
|
769
|
-
const d = (i) => h.getModule("stage").getProxy(i);
|
|
770
|
-
d.version = ct, d.prefix = zt, d.organisation = pe, d.Modes = v, Object.defineProperty(d, "mode", { set: (i) => {
|
|
771
|
-
Z.mode = i;
|
|
772
|
-
}, get: () => Z.mode }), d.internals = f, d.version = ct, d.start = dt.start, d.stop = dt.stop, d.inspector = g, d.colors = Le;
|
|
773
|
-
const xt = window[V];
|
|
774
|
-
d.internals.configuration = xt, Z.configure(xt, d.start, d.internals.query), window[V] = d;
|
|
775
|
-
class rt {
|
|
776
|
-
constructor() {
|
|
777
|
-
this.emissions = {};
|
|
778
|
-
}
|
|
779
|
-
add(t, e) {
|
|
780
|
-
if (typeof e != "function")
|
|
781
|
-
throw new Error("closure must be a function");
|
|
782
|
-
this.emissions[t] || (this.emissions[t] = []), this.emissions[t].push(e);
|
|
783
|
-
}
|
|
784
|
-
remove(t, e) {
|
|
785
|
-
if (this.emissions[t])
|
|
786
|
-
if (e) {
|
|
787
|
-
const n = this.emissions[t].indexOf(e);
|
|
788
|
-
n > -1 && this.emissions[t].splice(n);
|
|
789
|
-
} else
|
|
790
|
-
delete this.emissions[t];
|
|
791
|
-
}
|
|
792
|
-
emit(t, e) {
|
|
793
|
-
if (!this.emissions[t])
|
|
794
|
-
return [];
|
|
795
|
-
const n = [];
|
|
796
|
-
for (const r of this.emissions[t])
|
|
797
|
-
r && n.push(r(e));
|
|
798
|
-
return n;
|
|
799
|
-
}
|
|
800
|
-
dispose() {
|
|
801
|
-
this.emissions = null;
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
class q {
|
|
805
|
-
constructor(t, e) {
|
|
806
|
-
this.id = t, this.minWidth = e;
|
|
807
|
-
}
|
|
808
|
-
test() {
|
|
809
|
-
return window.matchMedia(`(min-width: ${this.minWidth}em)`).matches;
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
const ee = { XS: new q("xs", 0), SM: new q("sm", 36), MD: new q("md", 48), LG: new q("lg", 62), XL: new q("xl", 78) };
|
|
813
|
-
class b {
|
|
814
|
-
constructor(t = !0) {
|
|
815
|
-
this.jsAttribute = t, this._isRendering = !1, this._isResizing = !1, this._isScrollLocked = !1, this._isLoading = !1, this._isSwappingFont = !1, this._isEnabled = !0, this._isDisposed = !1, this._listeners = {}, this.handlingClick = this.handleClick.bind(this), this._hashes = [], this._hash = "", this._keyListenerTypes = [], this._keys = [], this.handlingKey = this.handleKey.bind(this), this._emitter = new rt(), this._ascent = new rt(), this._descent = new rt(), this._registrations = [], this._nexts = [];
|
|
816
|
-
}
|
|
817
|
-
static get instanceClassName() {
|
|
818
|
-
return "Instance";
|
|
819
|
-
}
|
|
820
|
-
_config(t, e) {
|
|
821
|
-
this.element = t, this.registration = e, this.node = t.node, this.id = t.node.id, this.jsAttribute && this.setAttribute(e.attribute, !0), this.init();
|
|
822
|
-
}
|
|
823
|
-
init() {
|
|
824
|
-
}
|
|
825
|
-
get proxy() {
|
|
826
|
-
const t = this;
|
|
827
|
-
return F({ render: () => t.render(), resize: () => t.resize() }, { get node() {
|
|
828
|
-
return this.node;
|
|
829
|
-
}, get isEnabled() {
|
|
830
|
-
return t.isEnabled;
|
|
831
|
-
}, set isEnabled(e) {
|
|
832
|
-
t.isEnabled = e;
|
|
833
|
-
} });
|
|
834
|
-
}
|
|
835
|
-
log(...t) {
|
|
836
|
-
t.unshift(`${this.registration.instanceClassName} #${this.id} - `), g.log.apply(g, t);
|
|
837
|
-
}
|
|
838
|
-
debug(...t) {
|
|
839
|
-
t.unshift(`${this.registration.instanceClassName} #${this.id} - `), g.debug.apply(g, t);
|
|
840
|
-
}
|
|
841
|
-
info(...t) {
|
|
842
|
-
t.unshift(`${this.registration.instanceClassName} #${this.id} - `), g.info.apply(g, t);
|
|
843
|
-
}
|
|
844
|
-
warn(...t) {
|
|
845
|
-
t.unshift(`${this.registration.instanceClassName} #${this.id} - `), g.warn.apply(g, t);
|
|
846
|
-
}
|
|
847
|
-
error(...t) {
|
|
848
|
-
t.unshift(`${this.registration.instanceClassName} #${this.id} - `), g.error.apply(g, t);
|
|
849
|
-
}
|
|
850
|
-
register(t, e) {
|
|
851
|
-
const n = h.getModule("register").register(t, e, this);
|
|
852
|
-
this._registrations.push(n);
|
|
853
|
-
}
|
|
854
|
-
getRegisteredInstances(t) {
|
|
855
|
-
for (const e of this._registrations)
|
|
856
|
-
if (e.hasInstanceClassName(t))
|
|
857
|
-
return e.instances.collection;
|
|
858
|
-
return [];
|
|
859
|
-
}
|
|
860
|
-
dispatch(t, e, n, r) {
|
|
861
|
-
const a = new CustomEvent(t, { detail: e, bubble: n === !0, cancelable: r === !0 });
|
|
862
|
-
this.node.dispatchEvent(a);
|
|
863
|
-
}
|
|
864
|
-
listen(t, e, n) {
|
|
865
|
-
this._listeners[t] || (this._listeners[t] = []);
|
|
866
|
-
const r = this._listeners[t], a = new $e(this.node, t, e, n);
|
|
867
|
-
r.push(a), a.listen();
|
|
868
|
-
}
|
|
869
|
-
unlisten(t, e, n) {
|
|
870
|
-
if (!t) {
|
|
871
|
-
for (const c in this._listeners)
|
|
872
|
-
this.unlisten(c);
|
|
873
|
-
return;
|
|
874
|
-
}
|
|
875
|
-
const r = this._listeners[t];
|
|
876
|
-
if (!r)
|
|
877
|
-
return;
|
|
878
|
-
if (!e)
|
|
879
|
-
return void r.forEach((c) => this.unlisten(t, c.closure));
|
|
880
|
-
const a = r.filter((c) => c.closure === e && c.matchOptions(n));
|
|
881
|
-
a.forEach((c) => c.unlisten()), this._listeners[t] = r.filter((c) => a.indexOf(c) === -1);
|
|
882
|
-
}
|
|
883
|
-
listenClick(t) {
|
|
884
|
-
this.listen("click", this.handlingClick, t);
|
|
885
|
-
}
|
|
886
|
-
unlistenClick(t) {
|
|
887
|
-
this.unlisten("click", this.handlingClick, t);
|
|
888
|
-
}
|
|
889
|
-
handleClick(t) {
|
|
890
|
-
}
|
|
891
|
-
set hash(t) {
|
|
892
|
-
h.getModule("hash").hash = t;
|
|
893
|
-
}
|
|
894
|
-
get hash() {
|
|
895
|
-
return h.getModule("hash").hash;
|
|
896
|
-
}
|
|
897
|
-
listenHash(t, e) {
|
|
898
|
-
if (!this._hashes)
|
|
899
|
-
return;
|
|
900
|
-
this._hashes.length === 0 && h.add("hash", this);
|
|
901
|
-
const n = new He(t, e);
|
|
902
|
-
this._hashes = this._hashes.filter((r) => r.hash !== t), this._hashes.push(n);
|
|
903
|
-
}
|
|
904
|
-
unlistenHash(t) {
|
|
905
|
-
this._hashes && (this._hashes = this._hashes.filter((e) => e.hash !== t), this._hashes.length === 0 && h.remove("hash", this));
|
|
906
|
-
}
|
|
907
|
-
handleHash(t, e) {
|
|
908
|
-
if (this._hashes)
|
|
909
|
-
for (const n of this._hashes)
|
|
910
|
-
n.handle(t, e);
|
|
911
|
-
}
|
|
912
|
-
listenKey(t, e, n = !1, r = !1, a = "down") {
|
|
913
|
-
this._keyListenerTypes.indexOf(a) === -1 && (this.listen(`key${a}`, this.handlingKey), this._keyListenerTypes.push(a)), this._keys.push(new Me(a, t, e, n, r));
|
|
914
|
-
}
|
|
915
|
-
unlistenKey(t, e) {
|
|
916
|
-
this._keys = this._keys.filter((n) => n.code !== t || n.closure !== e), this._keyListenerTypes.forEach((n) => {
|
|
917
|
-
this._keys.some((r) => r.type === n) || this.unlisten(`key${n}`, this.handlingKey);
|
|
918
|
-
});
|
|
919
|
-
}
|
|
920
|
-
handleKey(t) {
|
|
921
|
-
for (const e of this._keys)
|
|
922
|
-
e.handle(t);
|
|
923
|
-
}
|
|
924
|
-
get isEnabled() {
|
|
925
|
-
return this._isEnabled;
|
|
926
|
-
}
|
|
927
|
-
set isEnabled(t) {
|
|
928
|
-
this._isEnabled = t;
|
|
929
|
-
}
|
|
930
|
-
get isRendering() {
|
|
931
|
-
return this._isRendering;
|
|
932
|
-
}
|
|
933
|
-
set isRendering(t) {
|
|
934
|
-
this._isRendering !== t && (t ? h.add("render", this) : h.remove("render", this), this._isRendering = t);
|
|
935
|
-
}
|
|
936
|
-
render() {
|
|
937
|
-
}
|
|
938
|
-
request(t) {
|
|
939
|
-
this._nexts.push(t), h.getModule("render").request(this);
|
|
940
|
-
}
|
|
941
|
-
next() {
|
|
942
|
-
const t = this._nexts.slice();
|
|
943
|
-
this._nexts.length = 0;
|
|
944
|
-
for (const e of t)
|
|
945
|
-
e && e();
|
|
946
|
-
}
|
|
947
|
-
get isResizing() {
|
|
948
|
-
return this._isResizing;
|
|
949
|
-
}
|
|
950
|
-
set isResizing(t) {
|
|
951
|
-
this._isResizing !== t && (t ? (h.add("resize", this), this.resize()) : h.remove("resize", this), this._isResizing = t);
|
|
952
|
-
}
|
|
953
|
-
resize() {
|
|
954
|
-
}
|
|
955
|
-
isBreakpoint(t) {
|
|
956
|
-
return typeof t == "string" ? ee[t.toUpperCase()].test() : t.test();
|
|
957
|
-
}
|
|
958
|
-
get isScrollLocked() {
|
|
959
|
-
return this._isScrollLocked;
|
|
960
|
-
}
|
|
961
|
-
set isScrollLocked(t) {
|
|
962
|
-
this._isScrollLocked !== t && (t ? h.add("lock", this) : h.remove("lock", this), this._isScrollLocked = t);
|
|
963
|
-
}
|
|
964
|
-
get isLoading() {
|
|
965
|
-
return this._isLoading;
|
|
966
|
-
}
|
|
967
|
-
set isLoading(t) {
|
|
968
|
-
this._isLoading !== t && (t ? h.add("load", this) : h.remove("load", this), this._isLoading = t);
|
|
969
|
-
}
|
|
970
|
-
load() {
|
|
971
|
-
}
|
|
972
|
-
get isSwappingFont() {
|
|
973
|
-
return this._isSwappingFont;
|
|
974
|
-
}
|
|
975
|
-
set isSwappingFont(t) {
|
|
976
|
-
this._isSwappingFont !== t && (t ? h.add("font-swap", this) : h.remove("font-swap", this), this._isSwappingFont = t);
|
|
977
|
-
}
|
|
978
|
-
swapFont() {
|
|
979
|
-
}
|
|
980
|
-
get isMouseMoving() {
|
|
981
|
-
return this._isMouseMoving;
|
|
982
|
-
}
|
|
983
|
-
set isMouseMoving(t) {
|
|
984
|
-
this._isMouseMoving !== t && (t ? h.add("mouse-move", this) : h.remove("mouse-move", this), this._isMouseMoving = t);
|
|
985
|
-
}
|
|
986
|
-
mouseMove(t) {
|
|
987
|
-
}
|
|
988
|
-
examine(t) {
|
|
989
|
-
this.node.matches(this.registration.selector) ? this.mutate(t) : this._dispose();
|
|
990
|
-
}
|
|
991
|
-
mutate(t) {
|
|
992
|
-
}
|
|
993
|
-
retrieveNodeId(t, e) {
|
|
994
|
-
if (t.id)
|
|
995
|
-
return t.id;
|
|
996
|
-
const n = te(`${this.id}-${e}`);
|
|
997
|
-
return this.warn(`add id '${n}' to ${e}`), t.setAttribute("id", n), n;
|
|
998
|
-
}
|
|
999
|
-
get isDisposed() {
|
|
1000
|
-
return this._isDisposed;
|
|
1001
|
-
}
|
|
1002
|
-
_dispose() {
|
|
1003
|
-
this.debug(`dispose instance of ${this.registration.instanceClassName} on element [${this.element.id}]`), this.removeAttribute(this.registration.attribute), this.unlisten(), h.remove("hash", this), this._hashes = null, this._keys = null, this.isRendering = !1, this.isResizing = !1, this._nexts = null, h.getModule("render").nexts.remove(this), this.isScrollLocked = !1, this.isLoading = !1, this.isSwappingFont = !1, this.isMouseMoving = !1, this._emitter.dispose(), this._emitter = null, this._ascent.dispose(), this._ascent = null, this._descent.dispose(), this._descent = null, this.element.remove(this);
|
|
1004
|
-
for (const t of this._registrations)
|
|
1005
|
-
h.remove("register", t);
|
|
1006
|
-
this._registrations = null, this.registration.remove(this), this._isDisposed = !0, this.dispose();
|
|
1007
|
-
}
|
|
1008
|
-
dispose() {
|
|
1009
|
-
}
|
|
1010
|
-
emit(t, e) {
|
|
1011
|
-
return this.element.emit(t, e);
|
|
1012
|
-
}
|
|
1013
|
-
addEmission(t, e) {
|
|
1014
|
-
this._emitter.add(t, e);
|
|
1015
|
-
}
|
|
1016
|
-
removeEmission(t, e) {
|
|
1017
|
-
this._emitter.remove(t, e);
|
|
1018
|
-
}
|
|
1019
|
-
ascend(t, e) {
|
|
1020
|
-
return this.element.ascend(t, e);
|
|
1021
|
-
}
|
|
1022
|
-
addAscent(t, e) {
|
|
1023
|
-
this._ascent.add(t, e);
|
|
1024
|
-
}
|
|
1025
|
-
removeAscent(t, e) {
|
|
1026
|
-
this._ascent.remove(t, e);
|
|
1027
|
-
}
|
|
1028
|
-
descend(t, e) {
|
|
1029
|
-
return this.element.descend(t, e);
|
|
1030
|
-
}
|
|
1031
|
-
addDescent(t, e) {
|
|
1032
|
-
this._descent.add(t, e);
|
|
1033
|
-
}
|
|
1034
|
-
removeDescent(t, e) {
|
|
1035
|
-
this._descent.remove(t, e);
|
|
1036
|
-
}
|
|
1037
|
-
get style() {
|
|
1038
|
-
return this.node.style;
|
|
1039
|
-
}
|
|
1040
|
-
addClass(t) {
|
|
1041
|
-
Xt(this.node, t);
|
|
1042
|
-
}
|
|
1043
|
-
removeClass(t) {
|
|
1044
|
-
Qt(this.node, t);
|
|
1045
|
-
}
|
|
1046
|
-
hasClass(t) {
|
|
1047
|
-
return Jt(this.node, t);
|
|
1048
|
-
}
|
|
1049
|
-
get classNames() {
|
|
1050
|
-
return Ct(this.node);
|
|
1051
|
-
}
|
|
1052
|
-
remove() {
|
|
1053
|
-
this.node.parentNode.removeChild(this.node);
|
|
1054
|
-
}
|
|
1055
|
-
setAttribute(t, e) {
|
|
1056
|
-
this.node.setAttribute(t, e);
|
|
1057
|
-
}
|
|
1058
|
-
getAttribute(t) {
|
|
1059
|
-
return this.node.getAttribute(t);
|
|
1060
|
-
}
|
|
1061
|
-
hasAttribute(t) {
|
|
1062
|
-
return this.node.hasAttribute(t);
|
|
1063
|
-
}
|
|
1064
|
-
removeAttribute(t) {
|
|
1065
|
-
this.node.removeAttribute(t);
|
|
1066
|
-
}
|
|
1067
|
-
setProperty(t, e) {
|
|
1068
|
-
this.node.style.setProperty(t, e);
|
|
1069
|
-
}
|
|
1070
|
-
removeProperty(t) {
|
|
1071
|
-
this.node.style.removeProperty(t);
|
|
1072
|
-
}
|
|
1073
|
-
focus() {
|
|
1074
|
-
this.node.focus();
|
|
1075
|
-
}
|
|
1076
|
-
blur() {
|
|
1077
|
-
this.node.blur();
|
|
1078
|
-
}
|
|
1079
|
-
focusClosest() {
|
|
1080
|
-
const t = this._focusClosest(this.node.parentNode);
|
|
1081
|
-
t && t.focus();
|
|
1082
|
-
}
|
|
1083
|
-
_focusClosest(t) {
|
|
1084
|
-
if (!t)
|
|
1085
|
-
return null;
|
|
1086
|
-
const e = [...Zt(t)];
|
|
1087
|
-
if (e.length <= 1)
|
|
1088
|
-
return this._focusClosest(t.parentNode);
|
|
1089
|
-
{
|
|
1090
|
-
const n = e.indexOf(this.node);
|
|
1091
|
-
return e[n + (n < e.length - 1 ? 1 : -1)];
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
get hasFocus() {
|
|
1095
|
-
return this.node === document.activeElement;
|
|
1096
|
-
}
|
|
1097
|
-
scrollIntoView() {
|
|
1098
|
-
const t = this.getRect(), e = h.getModule("lock");
|
|
1099
|
-
t.top < 0 && e.move(t.top - 50), t.bottom > window.innerHeight && e.move(t.bottom - window.innerHeight + 50);
|
|
1100
|
-
}
|
|
1101
|
-
matches(t) {
|
|
1102
|
-
return this.node.matches(t);
|
|
1103
|
-
}
|
|
1104
|
-
querySelector(t) {
|
|
1105
|
-
return this.node.querySelector(t);
|
|
1106
|
-
}
|
|
1107
|
-
querySelectorAll(t) {
|
|
1108
|
-
return vt(this.node, t);
|
|
1109
|
-
}
|
|
1110
|
-
queryParentSelector(t) {
|
|
1111
|
-
return yt(this.node, t);
|
|
1112
|
-
}
|
|
1113
|
-
getRect() {
|
|
1114
|
-
const t = this.node.getBoundingClientRect();
|
|
1115
|
-
return t.center = t.left + 0.5 * t.width, t.middle = t.top + 0.5 * t.height, t;
|
|
1116
|
-
}
|
|
1117
|
-
get isLegacy() {
|
|
1118
|
-
return h.isLegacy;
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
class Me {
|
|
1122
|
-
constructor(t, e, n, r, a) {
|
|
1123
|
-
this.type = t, this.eventType = `key${t}`, this.keyCode = e, this.closure = n, this.preventDefault = r === !0, this.stopPropagation = a === !0;
|
|
1124
|
-
}
|
|
1125
|
-
handle(t) {
|
|
1126
|
-
t.type === this.eventType && t.keyCode === this.keyCode.value && (this.closure(t), this.preventDefault && t.preventDefault(), this.stopPropagation && t.stopPropagation());
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
class $e {
|
|
1130
|
-
constructor(t, e, n, r) {
|
|
1131
|
-
this._node = t, this._type = e, this._closure = n, this._options = r;
|
|
1132
|
-
}
|
|
1133
|
-
get closure() {
|
|
1134
|
-
return this._closure;
|
|
1135
|
-
}
|
|
1136
|
-
listen() {
|
|
1137
|
-
this._node.addEventListener(this._type, this._closure, this._options);
|
|
1138
|
-
}
|
|
1139
|
-
matchOptions(t = null) {
|
|
1140
|
-
switch (!0) {
|
|
1141
|
-
case t === null:
|
|
1142
|
-
case (typeof this._options == "boolean" && typeof t == "boolean" && this._options === t):
|
|
1143
|
-
return !0;
|
|
1144
|
-
case Object.keys(this._options).length !== Object.keys(t).length:
|
|
1145
|
-
return !1;
|
|
1146
|
-
case Object.keys(t).every((e) => this._options[e] === t[e]):
|
|
1147
|
-
return !0;
|
|
1148
|
-
}
|
|
1149
|
-
return !1;
|
|
1150
|
-
}
|
|
1151
|
-
unlisten() {
|
|
1152
|
-
this._node.removeEventListener(this._type, this._closure, this._options);
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
class He {
|
|
1156
|
-
constructor(t, e) {
|
|
1157
|
-
this.hash = t, this.add = e;
|
|
1158
|
-
}
|
|
1159
|
-
handle(t, e) {
|
|
1160
|
-
this.hash === t && this.add(e);
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
const ut = { DISCLOSE: o.event("disclose"), CONCEAL: o.event("conceal") }, p = { RESET: o.emission("disclosure", "reset"), ADDED: o.emission("disclosure", "added"), RETRIEVE: o.emission("disclosure", "retrieve"), REMOVED: o.emission("disclosure", "removed"), GROUP: o.emission("disclosure", "group"), UNGROUP: o.emission("disclosure", "ungroup"), SPOTLIGHT: o.emission("disclosure", "spotlight") };
|
|
1164
|
-
class Ot extends b {
|
|
1165
|
-
constructor(t, e, n, r) {
|
|
1166
|
-
super(), this.type = t, this._selector = e, this.DisclosureButtonInstanceClass = n, this.disclosuresGroupInstanceClassName = r, this.modifier = this._selector + "--" + this.type.id, this._isPristine = !0, this._isRetrievingPrimaries = !1, this._hasRetrieved = !1, this._primaryButtons = [];
|
|
1167
|
-
}
|
|
1168
|
-
static get instanceClassName() {
|
|
1169
|
-
return "Disclosure";
|
|
1170
|
-
}
|
|
1171
|
-
init() {
|
|
1172
|
-
this.addDescent(p.RESET, this.reset.bind(this)), this.addDescent(p.GROUP, this.update.bind(this)), this.addDescent(p.UNGROUP, this.update.bind(this)), this.addAscent(p.SPOTLIGHT, this.disclose.bind(this)), this.register(`[aria-controls="${this.id}"]`, this.DisclosureButtonInstanceClass), this.ascend(p.ADDED), this.listenHash(this.id, this._spotlight.bind(this)), this.update();
|
|
1173
|
-
}
|
|
1174
|
-
get isEnabled() {
|
|
1175
|
-
return super.isEnabled;
|
|
1176
|
-
}
|
|
1177
|
-
set isEnabled(t) {
|
|
1178
|
-
this.isEnabled !== t && (super.isEnabled = t, t ? this.ascend(p.ADDED) : this.ascend(p.REMOVED));
|
|
1179
|
-
}
|
|
1180
|
-
get isPristine() {
|
|
1181
|
-
return this._isPristine;
|
|
1182
|
-
}
|
|
1183
|
-
get proxy() {
|
|
1184
|
-
const t = this, e = Object.assign(super.proxy, { disclose: t.disclose.bind(t), focus: t.focus.bind(t) });
|
|
1185
|
-
return this.type.canConceal && (e.conceal = t.conceal.bind(t)), F(e, { get buttons() {
|
|
1186
|
-
return t.buttons.map((n) => n.proxy);
|
|
1187
|
-
}, get group() {
|
|
1188
|
-
const n = t.group;
|
|
1189
|
-
return n ? n.proxy : null;
|
|
1190
|
-
}, get isDisclosed() {
|
|
1191
|
-
return t.isDisclosed;
|
|
1192
|
-
} });
|
|
1193
|
-
}
|
|
1194
|
-
get buttons() {
|
|
1195
|
-
return this.getRegisteredInstances(this.DisclosureButtonInstanceClass.instanceClassName);
|
|
1196
|
-
}
|
|
1197
|
-
update() {
|
|
1198
|
-
this.getGroup(), this.retrievePrimaries();
|
|
1199
|
-
}
|
|
1200
|
-
getGroup() {
|
|
1201
|
-
if (!this.disclosuresGroupInstanceClassName)
|
|
1202
|
-
return void (this._group = null);
|
|
1203
|
-
const t = this.element.getAscendantInstance(this.disclosuresGroupInstanceClassName, this.constructor.instanceClassName);
|
|
1204
|
-
t && t.validate(this) ? this._group = t : this._group = null;
|
|
1205
|
-
}
|
|
1206
|
-
get group() {
|
|
1207
|
-
return this._group;
|
|
1208
|
-
}
|
|
1209
|
-
disclose(t) {
|
|
1210
|
-
return !(this.isDisclosed === !0 || !this.isEnabled) && (this._isPristine = !1, this.isDisclosed = !0, !t && this.group && (this.group.current = this), !0);
|
|
1211
|
-
}
|
|
1212
|
-
conceal(t, e = !0) {
|
|
1213
|
-
return this.isDisclosed !== !1 && !(!this.type.canConceal && this.group && this.group.current === this) && (this.isDisclosed = !1, !t && this.group && this.group.current === this && (this.group.current = null), e || this.focus(), this._isPristine || this.descend(p.RESET), !0);
|
|
1214
|
-
}
|
|
1215
|
-
get isDisclosed() {
|
|
1216
|
-
return this._isDisclosed;
|
|
1217
|
-
}
|
|
1218
|
-
set isDisclosed(t) {
|
|
1219
|
-
if (this._isDisclosed !== t && (this.isEnabled || t !== !0)) {
|
|
1220
|
-
this.dispatch(t ? ut.DISCLOSE : ut.CONCEAL, this.type), this._isDisclosed = t, t ? this.addClass(this.modifier) : this.removeClass(this.modifier);
|
|
1221
|
-
for (let e = 0; e < this.buttons.length; e++)
|
|
1222
|
-
this.buttons[e].apply(t);
|
|
1223
|
-
}
|
|
1224
|
-
}
|
|
1225
|
-
get isInitiallyDisclosed() {
|
|
1226
|
-
return this.primaryButtons.some((t) => t.isInitiallyDisclosed);
|
|
1227
|
-
}
|
|
1228
|
-
hasRetrieved() {
|
|
1229
|
-
return this._hasRetrieved;
|
|
1230
|
-
}
|
|
1231
|
-
reset() {
|
|
1232
|
-
}
|
|
1233
|
-
toggle(t) {
|
|
1234
|
-
if (this.type.canConceal)
|
|
1235
|
-
switch (!0) {
|
|
1236
|
-
case !t:
|
|
1237
|
-
case this.isDisclosed:
|
|
1238
|
-
this.conceal(!1, !1);
|
|
1239
|
-
break;
|
|
1240
|
-
default:
|
|
1241
|
-
this.disclose();
|
|
1242
|
-
}
|
|
1243
|
-
else
|
|
1244
|
-
this.disclose();
|
|
1245
|
-
}
|
|
1246
|
-
get buttonHasFocus() {
|
|
1247
|
-
return this.buttons.some((t) => t.hasFocus);
|
|
1248
|
-
}
|
|
1249
|
-
get hasFocus() {
|
|
1250
|
-
return !!super.hasFocus || !!this.buttonHasFocus || this.querySelectorAll(":focus").length > 0;
|
|
1251
|
-
}
|
|
1252
|
-
focus() {
|
|
1253
|
-
this._primaryButtons.length > 0 && this._primaryButtons[0].focus();
|
|
1254
|
-
}
|
|
1255
|
-
get primaryButtons() {
|
|
1256
|
-
return this._primaryButtons;
|
|
1257
|
-
}
|
|
1258
|
-
retrievePrimaries() {
|
|
1259
|
-
this._isRetrievingPrimaries || (this._isRetrievingPrimaries = !0, this.request(this._retrievePrimaries.bind(this)));
|
|
1260
|
-
}
|
|
1261
|
-
_retrievePrimaries() {
|
|
1262
|
-
if (this._isRetrievingPrimaries = !1, this._primaryButtons = this._electPrimaries(this.buttons), !this._hasRetrieved && this._primaryButtons.length !== 0) {
|
|
1263
|
-
if (this.retrieved(), this._hasRetrieved = !0, this.applyAbility(!0), this.group)
|
|
1264
|
-
this.group.retrieve();
|
|
1265
|
-
else if (this._isPristine && this.isEnabled && !this.group)
|
|
1266
|
-
switch (!0) {
|
|
1267
|
-
case this.hash === this.id:
|
|
1268
|
-
this._spotlight();
|
|
1269
|
-
break;
|
|
1270
|
-
case this.isInitiallyDisclosed:
|
|
1271
|
-
this.disclose();
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
retrieved() {
|
|
1276
|
-
}
|
|
1277
|
-
_spotlight() {
|
|
1278
|
-
this.disclose(), this.request(() => {
|
|
1279
|
-
this.ascend(p.SPOTLIGHT);
|
|
1280
|
-
});
|
|
1281
|
-
}
|
|
1282
|
-
_electPrimaries(t) {
|
|
1283
|
-
return t.filter((e) => e.canDisclose && !this.node.contains(e.node));
|
|
1284
|
-
}
|
|
1285
|
-
applyAbility(t = !1) {
|
|
1286
|
-
const e = !this._primaryButtons.every((n) => n.isDisabled);
|
|
1287
|
-
this.isEnabled !== e && (this.isEnabled = e, t || (!this.isEnabled && this.isDisclosed && (this.group ? this.ascend(p.REMOVED) : this.type.canConceal && this.conceal()), this.isEnabled && (this.group && this.ascend(p.ADDED), this.hash === this.id && this._spotlight())));
|
|
1288
|
-
}
|
|
1289
|
-
dispose() {
|
|
1290
|
-
this._group = null, this._primaryButtons = null, super.dispose(), this.ascend(p.REMOVED);
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
class se extends b {
|
|
1294
|
-
constructor(t) {
|
|
1295
|
-
super(), this.type = t, this.attributeName = t.ariaState ? "aria-" + t.id : o.attr(t.id), this._canDisclose = !1;
|
|
1296
|
-
}
|
|
1297
|
-
static get instanceClassName() {
|
|
1298
|
-
return "DisclosureButton";
|
|
1299
|
-
}
|
|
1300
|
-
get isPrimary() {
|
|
1301
|
-
return this.registration.creator.primaryButtons.includes(this);
|
|
1302
|
-
}
|
|
1303
|
-
get canDisclose() {
|
|
1304
|
-
return this._canDisclose;
|
|
1305
|
-
}
|
|
1306
|
-
get isDisabled() {
|
|
1307
|
-
return this.type.canDisable && this.hasAttribute("disabled");
|
|
1308
|
-
}
|
|
1309
|
-
init() {
|
|
1310
|
-
this._canDisclose = this.hasAttribute(this.attributeName), this._isInitiallyDisclosed = this.isDisclosed, this._isContained = this.registration.creator.node.contains(this.node), this.controlsId = this.getAttribute("aria-controls"), this.registration.creator.retrievePrimaries(), this.listenClick();
|
|
1311
|
-
}
|
|
1312
|
-
get proxy() {
|
|
1313
|
-
return Object.assign(super.proxy, { focus: this.focus.bind(this) });
|
|
1314
|
-
}
|
|
1315
|
-
handleClick(t) {
|
|
1316
|
-
this.registration.creator && this.registration.creator.toggle(this.canDisclose);
|
|
1317
|
-
}
|
|
1318
|
-
mutate(t) {
|
|
1319
|
-
this._canDisclose = this.hasAttribute(this.attributeName), this.registration.creator.applyAbility(), !this._isApplying && this.isPrimary && t.indexOf(this.attributeName) > -1 && this.registration.creator && (this.isDisclosed ? this.registration.creator.disclose() : this.type.canConceal && this.registration.creator.conceal());
|
|
1320
|
-
}
|
|
1321
|
-
apply(t) {
|
|
1322
|
-
this.canDisclose && (this._isApplying = !0, this.setAttribute(this.attributeName, t), this.request(() => {
|
|
1323
|
-
this._isApplying = !1;
|
|
1324
|
-
}));
|
|
1325
|
-
}
|
|
1326
|
-
get isDisclosed() {
|
|
1327
|
-
return this.getAttribute(this.attributeName) === "true";
|
|
1328
|
-
}
|
|
1329
|
-
get isInitiallyDisclosed() {
|
|
1330
|
-
return this._isInitiallyDisclosed;
|
|
1331
|
-
}
|
|
1332
|
-
focus() {
|
|
1333
|
-
super.focus(), this.scrollIntoView();
|
|
1334
|
-
}
|
|
1335
|
-
measure(t) {
|
|
1336
|
-
const e = this.rect;
|
|
1337
|
-
this._dx = t.x - e.x, this._dy = t.y - e.y;
|
|
1338
|
-
}
|
|
1339
|
-
get dx() {
|
|
1340
|
-
return this._dx;
|
|
1341
|
-
}
|
|
1342
|
-
get dy() {
|
|
1343
|
-
return this._dy;
|
|
1344
|
-
}
|
|
1345
|
-
}
|
|
1346
|
-
class Pt extends b {
|
|
1347
|
-
constructor(t, e) {
|
|
1348
|
-
super(e), this.disclosureInstanceClassName = t, this._members = [], this._index = -1, this._isRetrieving = !1, this._hasRetrieved = !1;
|
|
1349
|
-
}
|
|
1350
|
-
static get instanceClassName() {
|
|
1351
|
-
return "DisclosuresGroup";
|
|
1352
|
-
}
|
|
1353
|
-
init() {
|
|
1354
|
-
this.addAscent(p.ADDED, this.update.bind(this)), this.addAscent(p.RETRIEVE, this.retrieve.bind(this)), this.addAscent(p.REMOVED, this.update.bind(this)), this.descend(p.GROUP), this.update();
|
|
1355
|
-
}
|
|
1356
|
-
get proxy() {
|
|
1357
|
-
const t = this, e = { set index(n) {
|
|
1358
|
-
t.index = n;
|
|
1359
|
-
}, get index() {
|
|
1360
|
-
return t.index;
|
|
1361
|
-
}, get length() {
|
|
1362
|
-
return t.length;
|
|
1363
|
-
}, get current() {
|
|
1364
|
-
const n = t.current;
|
|
1365
|
-
return n ? n.proxy : null;
|
|
1366
|
-
}, get members() {
|
|
1367
|
-
return t.members.map((n) => n.proxy);
|
|
1368
|
-
}, get hasFocus() {
|
|
1369
|
-
return t.hasFocus;
|
|
1370
|
-
} };
|
|
1371
|
-
return F(super.proxy, e);
|
|
1372
|
-
}
|
|
1373
|
-
validate(t) {
|
|
1374
|
-
return !0;
|
|
1375
|
-
}
|
|
1376
|
-
getMembers() {
|
|
1377
|
-
const t = this.element.getDescendantInstances(this.disclosureInstanceClassName, this.constructor.instanceClassName, !0);
|
|
1378
|
-
this._members = t.filter(this.validate.bind(this)).filter((e) => e.isEnabled), t.filter((e) => !this._members.includes(e)).forEach((e) => e.conceal());
|
|
1379
|
-
}
|
|
1380
|
-
retrieve(t = !1) {
|
|
1381
|
-
this._isRetrieving || this._hasRetrieved && !t || (this._isRetrieving = !0, this.request(this._retrieve.bind(this)));
|
|
1382
|
-
}
|
|
1383
|
-
_retrieve() {
|
|
1384
|
-
if (this.getMembers(), this._isRetrieving = !1, this._hasRetrieved = !0, this.hash)
|
|
1385
|
-
for (let t = 0; t < this.length; t++) {
|
|
1386
|
-
const e = this.members[t];
|
|
1387
|
-
if (this.hash === e.id)
|
|
1388
|
-
return this.index = t, this.request(() => {
|
|
1389
|
-
this.ascend(p.SPOTLIGHT);
|
|
1390
|
-
}), t;
|
|
1391
|
-
}
|
|
1392
|
-
for (let t = 0; t < this.length; t++)
|
|
1393
|
-
if (this.members[t].isInitiallyDisclosed)
|
|
1394
|
-
return this.index = t, t;
|
|
1395
|
-
return this.getIndex();
|
|
1396
|
-
}
|
|
1397
|
-
update() {
|
|
1398
|
-
this.getMembers(), this._hasRetrieved && this.getIndex();
|
|
1399
|
-
}
|
|
1400
|
-
get members() {
|
|
1401
|
-
return this._members;
|
|
1402
|
-
}
|
|
1403
|
-
get length() {
|
|
1404
|
-
return this.members ? this.members.length : 0;
|
|
1405
|
-
}
|
|
1406
|
-
getIndex(t = -1) {
|
|
1407
|
-
this._index = void 0;
|
|
1408
|
-
let e = t;
|
|
1409
|
-
for (let n = 0; n < this.length; n++)
|
|
1410
|
-
if (this.members[n].isDisclosed) {
|
|
1411
|
-
e = n;
|
|
1412
|
-
break;
|
|
1413
|
-
}
|
|
1414
|
-
return this.index = e, e;
|
|
1415
|
-
}
|
|
1416
|
-
get index() {
|
|
1417
|
-
return this._index;
|
|
1418
|
-
}
|
|
1419
|
-
set index(t) {
|
|
1420
|
-
if (!(t < -1 || t >= this.length || t === this._index)) {
|
|
1421
|
-
this._index = t;
|
|
1422
|
-
for (let e = 0; e < this.length; e++) {
|
|
1423
|
-
const n = this.members[e];
|
|
1424
|
-
t === e ? n.isDisclosed || n.disclose(!0) : n.isDisclosed && n.conceal(!0);
|
|
1425
|
-
}
|
|
1426
|
-
this.apply();
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
get current() {
|
|
1430
|
-
return this._index === -1 || isNaN(this._index) ? null : this._members[this._index] || null;
|
|
1431
|
-
}
|
|
1432
|
-
set current(t) {
|
|
1433
|
-
this.index = this.members.indexOf(t);
|
|
1434
|
-
}
|
|
1435
|
-
get hasFocus() {
|
|
1436
|
-
const t = this.current;
|
|
1437
|
-
return !!t && t.hasFocus;
|
|
1438
|
-
}
|
|
1439
|
-
apply() {
|
|
1440
|
-
}
|
|
1441
|
-
dispose() {
|
|
1442
|
-
super.dispose(), this.descend(p.UNGROUP), this._members = null;
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
const gt = { EXPAND: { id: "expanded", ariaState: !0, ariaControls: !0, canConceal: !0, canDisable: !0 }, SELECT: { id: "selected", ariaState: !0, ariaControls: !0, canConceal: !1, canDisable: !0 }, OPENED: { id: "opened", ariaState: !1, ariaControls: !0, canConceal: !0, canDisable: !1 } }, Ge = { PREVENT_CONCEAL: o.attr.selector("prevent-conceal") };
|
|
1446
|
-
class kt extends se {
|
|
1447
|
-
constructor() {
|
|
1448
|
-
super(gt.EXPAND);
|
|
1449
|
-
}
|
|
1450
|
-
static get instanceClassName() {
|
|
1451
|
-
return "CollapseButton";
|
|
1452
|
-
}
|
|
1453
|
-
}
|
|
1454
|
-
const z = { COLLAPSE: o.selector("collapse"), COLLAPSING: o.selector("collapsing") }, Y = { CHANGE: o("equisized") }, Ue = { TOGGLE: o.event("toggle") }, Be = { INJECT_SVG: `[${o.attr("inject-svg")}]` }, Fe = { ARTWORK_USE: `${o.selector("artwork")} use` }, We = { ASSESS_FILE: `${o.attr.selector("assess-file")}`, DETAIL: `${o.attr.selector("assess-file")} [class$="__detail"], ${o.attr.selector("assess-file")} [class*="__detail "]` }, O = { UPDATE: o.emission("assess", "update"), ADDED: o.emission("assess", "added") }, ie = ["32x9", "16x9", "3x2", "4x3", "1x1", "3x4", "2x3"], mt = (i, t) => t.map((e) => o.selector(`${i}--${e}`)).join(","), qe = `${o.selector("responsive-img")}, ${mt("responsive-img", ie)}, ${o.selector("responsive-vid")}, ${mt("responsive-vid", ["16x9", "4x3", "1x1"])}`, ze = { RATIO: `${o.selector("ratio")}, ${mt("ratio", ie)}, ${qe}` }, s = window[V], L = { TOP: o.selector("placement--top"), RIGHT: o.selector("placement--right"), BOTTOM: o.selector("placement--bottom"), LEFT: o.selector("placement--left") }, H = { START: o.selector("placement--start"), CENTER: o.selector("placement--center"), END: o.selector("placement--end") }, l = { TOP: "place_top", RIGHT: "place_right", BOTTOM: "place_bottom", LEFT: "place_left" }, u = { START: "align_start", CENTER: "align_center", END: "align_end" }, at = { AUTO: "placement_auto", MANUAL: "placement_manual" };
|
|
1455
|
-
d.core = { Instance: b, Breakpoints: ee, KeyCodes: Vt, Disclosure: Ot, DisclosureButton: se, DisclosuresGroup: Pt, DisclosureType: gt, DisclosureEvent: ut, DisclosureSelector: Ge, DisclosureEmission: p, Collapse: class extends Ot {
|
|
1456
|
-
constructor() {
|
|
1457
|
-
super(gt.EXPAND, z.COLLAPSE, kt, "CollapsesGroup");
|
|
1458
|
-
}
|
|
1459
|
-
static get instanceClassName() {
|
|
1460
|
-
return "Collapse";
|
|
1461
|
-
}
|
|
1462
|
-
init() {
|
|
1463
|
-
super.init(), this.listen("transitionend", this.transitionend.bind(this));
|
|
1464
|
-
}
|
|
1465
|
-
transitionend(i) {
|
|
1466
|
-
this.removeClass(z.COLLAPSING), this.isDisclosed || (this.isLegacy ? this.style.maxHeight = "" : this.style.removeProperty("--collapse-max-height"));
|
|
1467
|
-
}
|
|
1468
|
-
unbound() {
|
|
1469
|
-
this.isLegacy ? this.style.maxHeight = "none" : this.style.setProperty("--collapse-max-height", "none");
|
|
1470
|
-
}
|
|
1471
|
-
disclose(i) {
|
|
1472
|
-
if (this.isDisclosed === !0 || !this.isEnabled)
|
|
1473
|
-
return !1;
|
|
1474
|
-
this.unbound(), this.request(() => {
|
|
1475
|
-
this.addClass(z.COLLAPSING), this.adjust(), this.request(() => {
|
|
1476
|
-
super.disclose(i);
|
|
1477
|
-
});
|
|
1478
|
-
});
|
|
1479
|
-
}
|
|
1480
|
-
conceal(i, t) {
|
|
1481
|
-
if (this.isDisclosed === !1)
|
|
1482
|
-
return !1;
|
|
1483
|
-
this.request(() => {
|
|
1484
|
-
this.addClass(z.COLLAPSING), this.adjust(), this.request(() => {
|
|
1485
|
-
super.conceal(i, t);
|
|
1486
|
-
});
|
|
1487
|
-
});
|
|
1488
|
-
}
|
|
1489
|
-
adjust() {
|
|
1490
|
-
this.setProperty("--collapser", "none");
|
|
1491
|
-
const i = this.node.offsetHeight;
|
|
1492
|
-
this.setProperty("--collapse", -i + "px"), this.setProperty("--collapser", "");
|
|
1493
|
-
}
|
|
1494
|
-
reset() {
|
|
1495
|
-
this.isPristine || (this.isDisclosed = !1);
|
|
1496
|
-
}
|
|
1497
|
-
_electPrimaries(i) {
|
|
1498
|
-
const t = this.element.parent.instances.map((a) => a.collapsePrimary).filter((a) => a !== void 0 && i.indexOf(a) > -1);
|
|
1499
|
-
if (t.length === 1)
|
|
1500
|
-
return t;
|
|
1501
|
-
if ((i = super._electPrimaries(i)).length === 1)
|
|
1502
|
-
return i;
|
|
1503
|
-
const e = i.filter((a) => a.dy >= 0);
|
|
1504
|
-
if (e.length > 0 && (i = e), i.length === 1)
|
|
1505
|
-
return i;
|
|
1506
|
-
const n = Math.min(...i.map((a) => a.dy)), r = i.filter((a) => a.dy === n);
|
|
1507
|
-
return r.length > 0 && (i = r), i.length === 1 || i.sort((a, c) => Math.abs(c.dx) - Math.abs(a.dx)), i;
|
|
1508
|
-
}
|
|
1509
|
-
}, CollapseButton: kt, CollapsesGroup: class extends Pt {
|
|
1510
|
-
constructor() {
|
|
1511
|
-
super("Collapse");
|
|
1512
|
-
}
|
|
1513
|
-
static get instanceClassName() {
|
|
1514
|
-
return "CollapsesGroup";
|
|
1515
|
-
}
|
|
1516
|
-
}, CollapseSelector: z, RootSelector: { ROOT: ":root" }, RootEmission: Q, Equisized: class extends b {
|
|
1517
|
-
static get instanceClassName() {
|
|
1518
|
-
return "Equisized";
|
|
1519
|
-
}
|
|
1520
|
-
init() {
|
|
1521
|
-
this.ascend(Y.CHANGE);
|
|
1522
|
-
}
|
|
1523
|
-
measure() {
|
|
1524
|
-
return this.isLegacy && (this.style.width = "auto"), this.getRect().width;
|
|
1525
|
-
}
|
|
1526
|
-
adjust(i) {
|
|
1527
|
-
this.isLegacy && (this.style.width = `${i}px`);
|
|
1528
|
-
}
|
|
1529
|
-
dispose() {
|
|
1530
|
-
this.ascend(Y.CHANGE);
|
|
1531
|
-
}
|
|
1532
|
-
}, EquisizedEmission: Y, Toggle: class extends b {
|
|
1533
|
-
static get instanceClassName() {
|
|
1534
|
-
return "Toggle";
|
|
1535
|
-
}
|
|
1536
|
-
init() {
|
|
1537
|
-
this.pressed = this.pressed === "true", this.listenClick();
|
|
1538
|
-
}
|
|
1539
|
-
handleClick() {
|
|
1540
|
-
this.toggle();
|
|
1541
|
-
}
|
|
1542
|
-
toggle() {
|
|
1543
|
-
this.pressed = this.pressed !== "true";
|
|
1544
|
-
}
|
|
1545
|
-
get pressed() {
|
|
1546
|
-
return this.getAttribute("aria-pressed");
|
|
1547
|
-
}
|
|
1548
|
-
set pressed(i) {
|
|
1549
|
-
this.setAttribute("aria-pressed", i ? "true" : "false"), this.dispatch(Ue.TOGGLE, i);
|
|
1550
|
-
}
|
|
1551
|
-
get proxy() {
|
|
1552
|
-
const i = this, t = Object.assign(super.proxy, { toggle: i.toggle.bind(i) });
|
|
1553
|
-
return F(t, { get pressed() {
|
|
1554
|
-
return i.pressed;
|
|
1555
|
-
}, set pressed(e) {
|
|
1556
|
-
i.pressed = e;
|
|
1557
|
-
} });
|
|
1558
|
-
}
|
|
1559
|
-
}, EquisizedsGroup: class extends b {
|
|
1560
|
-
static get instanceClassName() {
|
|
1561
|
-
return "EquisizedsGroup";
|
|
1562
|
-
}
|
|
1563
|
-
init() {
|
|
1564
|
-
this.isResizing = !0, this.isLoading = !0, this.addAscent(Y.CHANGE, this.resize.bind(this));
|
|
1565
|
-
}
|
|
1566
|
-
load() {
|
|
1567
|
-
this.resize();
|
|
1568
|
-
}
|
|
1569
|
-
resize() {
|
|
1570
|
-
const i = this.element.getDescendantInstances("Equisized");
|
|
1571
|
-
this.isLegacy || this.style.setProperty("--equisized-width", "auto");
|
|
1572
|
-
const t = Math.max(...i.map((e) => e.measure()));
|
|
1573
|
-
this.isLegacy ? i.forEach((e) => e.adjust(t)) : this.style.setProperty("--equisized-width", `${t}px`);
|
|
1574
|
-
}
|
|
1575
|
-
}, InjectSvg: class extends b {
|
|
1576
|
-
static get instanceClassName() {
|
|
1577
|
-
return "InjectSvg";
|
|
1578
|
-
}
|
|
1579
|
-
init() {
|
|
1580
|
-
this.node && (this.img = this.node.querySelector("img")), this.isLegacy || this.replace();
|
|
1581
|
-
}
|
|
1582
|
-
get proxy() {
|
|
1583
|
-
const i = this;
|
|
1584
|
-
return Object.assign(super.proxy, { replace: i.replace.bind(i), restore: i.restore.bind(i) });
|
|
1585
|
-
}
|
|
1586
|
-
fetch() {
|
|
1587
|
-
this.img && (this.imgID = this.img.getAttribute("id"), this.imgClass = this.img.getAttribute("class"), this.imgURL = this.img.getAttribute("src"), fetch(this.imgURL).then((i) => i.text()).then((i) => {
|
|
1588
|
-
const t = new DOMParser().parseFromString(i, "text/html");
|
|
1589
|
-
this.svg = t.querySelector("svg"), this.svg && this.replace();
|
|
1590
|
-
}));
|
|
1591
|
-
}
|
|
1592
|
-
replace() {
|
|
1593
|
-
if (!this.svg)
|
|
1594
|
-
return void this.fetch();
|
|
1595
|
-
this.imgID && this.imgID !== void 0 && this.svg.setAttribute("id", this.imgID);
|
|
1596
|
-
let i = this.imgURL.match(/[ \w-]+\./)[0];
|
|
1597
|
-
i && (i = i.slice(0, -1), ["dark", "light", "system"].includes(i) && (this.svg.innerHTML = this.svg.innerHTML.replaceAll('id="artwork-', `id="${i}-artwork-`), this.svg.innerHTML = this.svg.innerHTML.replaceAll('"#artwork-', `"#${i}-artwork-`))), this.imgClass && this.imgClass !== void 0 && this.svg.setAttribute("class", this.imgClass), this.svg.hasAttribute("xmlns:a") && this.svg.removeAttribute("xmlns:a"), this.node.setAttribute("data-fr-inject-svg", !0);
|
|
1598
|
-
var t, e;
|
|
1599
|
-
t = this.svg, e = { "aria-hidden": !0, focusable: !1 }, Object.keys(e).forEach((n) => t.setAttribute(n, e[n])), this.node.replaceChild(this.svg, this.img);
|
|
1600
|
-
}
|
|
1601
|
-
restore() {
|
|
1602
|
-
this.img && this.svg && (this.node.setAttribute("data-fr-inject-svg", !1), this.node.replaceChild(this.img, this.svg));
|
|
1603
|
-
}
|
|
1604
|
-
}, InjectSvgSelector: Be, Artwork: class extends b {
|
|
1605
|
-
static get instanceClassName() {
|
|
1606
|
-
return "Artwork";
|
|
1607
|
-
}
|
|
1608
|
-
init() {
|
|
1609
|
-
this.isLegacy && this.replace();
|
|
1610
|
-
}
|
|
1611
|
-
get proxy() {
|
|
1612
|
-
return Object.assign(super.proxy, { replace: this.replace.bind(this) });
|
|
1613
|
-
}
|
|
1614
|
-
fetch() {
|
|
1615
|
-
this.xlink = this.node.getAttribute("href");
|
|
1616
|
-
const i = this.xlink.split("#");
|
|
1617
|
-
this.svgUrl = i[0], this.svgName = i[1];
|
|
1618
|
-
const t = new XMLHttpRequest();
|
|
1619
|
-
t.onload = () => {
|
|
1620
|
-
const e = new DOMParser().parseFromString(t.responseText, "text/html");
|
|
1621
|
-
this.realSvgContent = e.getElementById(this.svgName), this.realSvgContent && (this.realSvgContent.classList.add(this.node.classList), this.replace());
|
|
1622
|
-
}, t.open("GET", this.svgUrl), t.send();
|
|
1623
|
-
}
|
|
1624
|
-
replace() {
|
|
1625
|
-
this.realSvgContent ? this.node.parentNode.replaceChild(this.realSvgContent, this.node) : this.fetch();
|
|
1626
|
-
}
|
|
1627
|
-
}, ArtworkSelector: Fe, AssessFile: class extends b {
|
|
1628
|
-
static get instanceClassName() {
|
|
1629
|
-
return "AssessFile";
|
|
1630
|
-
}
|
|
1631
|
-
init() {
|
|
1632
|
-
this.lang = this.getLang(this.node), this.href = this.getAttribute("href"), this.hreflang = this.getAttribute("hreflang"), this.file = {}, this.gather(), this.addAscent(O.ADDED, this.update.bind(this)), this.addDescent(O.ADDED, this.update.bind(this));
|
|
1633
|
-
}
|
|
1634
|
-
getFileLength() {
|
|
1635
|
-
this.href !== void 0 ? fetch(this.href, { method: "HEAD", mode: "cors" }).then((i) => {
|
|
1636
|
-
this.length = i.headers.get("content-length") || -1, this.length === -1 && g.warn("File size unknown: " + this.href + `
|
|
1637
|
-
Unable to get HTTP header: "content-length"`), this.gather();
|
|
1638
|
-
}) : this.length = -1;
|
|
1639
|
-
}
|
|
1640
|
-
mutate(i) {
|
|
1641
|
-
i.indexOf("href") !== -1 && (this.href = this.getAttribute("href"), this.getFileLength()), i.indexOf("hreflang") !== -1 && (this.hreflang = this.getAttribute("hreflang"), this.gather());
|
|
1642
|
-
}
|
|
1643
|
-
gather() {
|
|
1644
|
-
if (this.isLegacy && (this.length = -1), this.length) {
|
|
1645
|
-
if (this.details = [], this.href) {
|
|
1646
|
-
const i = this.parseExtension(this.href);
|
|
1647
|
-
i && this.details.push(i.toUpperCase());
|
|
1648
|
-
}
|
|
1649
|
-
this.length !== -1 && this.details.push(this.bytesToSize(this.length)), this.hreflang && this.details.push(this.getLangDisplayName(this.hreflang)), this.update();
|
|
1650
|
-
} else
|
|
1651
|
-
this.getFileLength();
|
|
1652
|
-
}
|
|
1653
|
-
update() {
|
|
1654
|
-
this.details && (this.descend(O.UPDATE, this.details), this.ascend(O.UPDATE, this.details));
|
|
1655
|
-
}
|
|
1656
|
-
getLang(i) {
|
|
1657
|
-
return i.lang ? i.lang : document.documentElement === i ? window.navigator.language : this.getLang(i.parentElement);
|
|
1658
|
-
}
|
|
1659
|
-
parseExtension(i) {
|
|
1660
|
-
return i.match(/\.(\w{1,9})(?:$|[?#])/)[0].replace(".", "");
|
|
1661
|
-
}
|
|
1662
|
-
getLangDisplayName(i) {
|
|
1663
|
-
if (this.isLegacy)
|
|
1664
|
-
return i;
|
|
1665
|
-
const t = new Intl.DisplayNames([this.lang], { type: "language" }).of(i);
|
|
1666
|
-
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
1667
|
-
}
|
|
1668
|
-
bytesToSize(i) {
|
|
1669
|
-
if (i === -1)
|
|
1670
|
-
return null;
|
|
1671
|
-
let t = ["octets", "ko", "Mo", "Go", "To"];
|
|
1672
|
-
this.getAttribute(o.attr("assess-file")) === "bytes" && (t = ["bytes", "KB", "MB", "GB", "TB"]);
|
|
1673
|
-
const e = parseInt(Math.floor(Math.log(i) / Math.log(1e3)), 10);
|
|
1674
|
-
if (e === 0)
|
|
1675
|
-
return `${i} ${t[e]}`;
|
|
1676
|
-
const n = i / 1e3 ** e, r = Math.round(100 * (n + Number.EPSILON)) / 100;
|
|
1677
|
-
return `${String(r).replace(".", ",")} ${t[e]}`;
|
|
1678
|
-
}
|
|
1679
|
-
}, AssessDetail: class extends b {
|
|
1680
|
-
static get instanceClassName() {
|
|
1681
|
-
return "AssessDetail";
|
|
1682
|
-
}
|
|
1683
|
-
init() {
|
|
1684
|
-
this.addDescent(O.UPDATE, this.update.bind(this)), this.ascend(O.ADDED);
|
|
1685
|
-
}
|
|
1686
|
-
update(i) {
|
|
1687
|
-
this.node.innerHTML = i.join(" - ");
|
|
1688
|
-
}
|
|
1689
|
-
}, AssessEmission: O, AssessSelector: We, Ratio: class extends b {
|
|
1690
|
-
static get instanceClassName() {
|
|
1691
|
-
return "Ratio";
|
|
1692
|
-
}
|
|
1693
|
-
init() {
|
|
1694
|
-
if (!s.internals.support.supportAspectRatio()) {
|
|
1695
|
-
this.ratio = 16 / 9;
|
|
1696
|
-
for (const i in this.classNames)
|
|
1697
|
-
if (this.registration.selector.indexOf(this.classNames[i]) > 0) {
|
|
1698
|
-
const t = this.classNames[i].split("ratio-");
|
|
1699
|
-
t[1] && (this.ratio = t[1].split("x")[0] / t[1].split("x")[1]);
|
|
1700
|
-
}
|
|
1701
|
-
this.isRendering = !0, this.update();
|
|
1702
|
-
}
|
|
1703
|
-
}
|
|
1704
|
-
render() {
|
|
1705
|
-
this.getRect().width !== this.currentWidth && this.update();
|
|
1706
|
-
}
|
|
1707
|
-
update() {
|
|
1708
|
-
this.currentWidth = this.getRect().width, this.style.height = this.currentWidth / this.ratio + "px";
|
|
1709
|
-
}
|
|
1710
|
-
}, RatioSelector: ze, Placement: class extends b {
|
|
1711
|
-
constructor(i = at.AUTO, t = [l.BOTTOM, l.TOP, l.LEFT, l.RIGHT], e = [u.CENTER, u.START, u.END], n = 16) {
|
|
1712
|
-
super(), this._mode = i, this._places = t, this._aligns = e, this._safeAreaMargin = n, this._isShown = !1;
|
|
1713
|
-
}
|
|
1714
|
-
static get instanceClassName() {
|
|
1715
|
-
return "Placement";
|
|
1716
|
-
}
|
|
1717
|
-
init() {
|
|
1718
|
-
this.isResizing = !0;
|
|
1719
|
-
}
|
|
1720
|
-
get proxy() {
|
|
1721
|
-
const i = this, t = Object.assign(super.proxy, { show: i.show.bind(i), hide: i.hide.bind(i) });
|
|
1722
|
-
return F(t, { get mode() {
|
|
1723
|
-
return i.mode;
|
|
1724
|
-
}, set mode(e) {
|
|
1725
|
-
i.mode = e;
|
|
1726
|
-
}, get place() {
|
|
1727
|
-
return i.place;
|
|
1728
|
-
}, set place(e) {
|
|
1729
|
-
i.place = e;
|
|
1730
|
-
}, get align() {
|
|
1731
|
-
return i.align;
|
|
1732
|
-
}, set align(e) {
|
|
1733
|
-
i.align = e;
|
|
1734
|
-
}, get isShown() {
|
|
1735
|
-
return i.isShown;
|
|
1736
|
-
}, set isShown(e) {
|
|
1737
|
-
i.isShown = e;
|
|
1738
|
-
} });
|
|
1739
|
-
}
|
|
1740
|
-
get mode() {
|
|
1741
|
-
return this._mode;
|
|
1742
|
-
}
|
|
1743
|
-
set mode(i) {
|
|
1744
|
-
this._mode = i;
|
|
1745
|
-
}
|
|
1746
|
-
get place() {
|
|
1747
|
-
return this._place;
|
|
1748
|
-
}
|
|
1749
|
-
set place(i) {
|
|
1750
|
-
if (this._place !== i) {
|
|
1751
|
-
switch (this._place) {
|
|
1752
|
-
case l.TOP:
|
|
1753
|
-
this.removeClass(L.TOP);
|
|
1754
|
-
break;
|
|
1755
|
-
case l.RIGHT:
|
|
1756
|
-
this.removeClass(L.RIGHT);
|
|
1757
|
-
break;
|
|
1758
|
-
case l.BOTTOM:
|
|
1759
|
-
this.removeClass(L.BOTTOM);
|
|
1760
|
-
break;
|
|
1761
|
-
case l.LEFT:
|
|
1762
|
-
this.removeClass(L.LEFT);
|
|
1763
|
-
}
|
|
1764
|
-
switch (this._place = i, this._place) {
|
|
1765
|
-
case l.TOP:
|
|
1766
|
-
this.addClass(L.TOP);
|
|
1767
|
-
break;
|
|
1768
|
-
case l.RIGHT:
|
|
1769
|
-
this.addClass(L.RIGHT);
|
|
1770
|
-
break;
|
|
1771
|
-
case l.BOTTOM:
|
|
1772
|
-
this.addClass(L.BOTTOM);
|
|
1773
|
-
break;
|
|
1774
|
-
case l.LEFT:
|
|
1775
|
-
this.addClass(L.LEFT);
|
|
1776
|
-
}
|
|
1777
|
-
}
|
|
1778
|
-
}
|
|
1779
|
-
get align() {
|
|
1780
|
-
return this._align;
|
|
1781
|
-
}
|
|
1782
|
-
set align(i) {
|
|
1783
|
-
if (this._align !== i) {
|
|
1784
|
-
switch (this._align) {
|
|
1785
|
-
case u.START:
|
|
1786
|
-
this.removeClass(H.START);
|
|
1787
|
-
break;
|
|
1788
|
-
case u.CENTER:
|
|
1789
|
-
this.removeClass(H.CENTER);
|
|
1790
|
-
break;
|
|
1791
|
-
case u.END:
|
|
1792
|
-
this.removeClass(H.END);
|
|
1793
|
-
}
|
|
1794
|
-
switch (this._align = i, this._align) {
|
|
1795
|
-
case u.START:
|
|
1796
|
-
this.addClass(H.START);
|
|
1797
|
-
break;
|
|
1798
|
-
case u.CENTER:
|
|
1799
|
-
this.addClass(H.CENTER);
|
|
1800
|
-
break;
|
|
1801
|
-
case u.END:
|
|
1802
|
-
this.addClass(H.END);
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
}
|
|
1806
|
-
show() {
|
|
1807
|
-
this.isShown = !0;
|
|
1808
|
-
}
|
|
1809
|
-
hide() {
|
|
1810
|
-
this.isShown = !1;
|
|
1811
|
-
}
|
|
1812
|
-
get isShown() {
|
|
1813
|
-
return this._isShown;
|
|
1814
|
-
}
|
|
1815
|
-
set isShown(i) {
|
|
1816
|
-
this._isShown !== i && this.isEnabled && (this.isRendering = i, this._isShown = i);
|
|
1817
|
-
}
|
|
1818
|
-
setReferent(i) {
|
|
1819
|
-
this._referent = i;
|
|
1820
|
-
}
|
|
1821
|
-
resize() {
|
|
1822
|
-
this.safeArea = { top: this._safeAreaMargin, right: window.innerWidth - this._safeAreaMargin, bottom: window.innerHeight - this._safeAreaMargin, left: this._safeAreaMargin, center: 0.5 * window.innerWidth, middle: 0.5 * window.innerHeight };
|
|
1823
|
-
}
|
|
1824
|
-
render() {
|
|
1825
|
-
if (!this._referent)
|
|
1826
|
-
return;
|
|
1827
|
-
if (this.rect = this.getRect(), this.referentRect = this._referent.getRect(), this.mode === at.AUTO)
|
|
1828
|
-
switch (this.place = this.getPlace(), this.place) {
|
|
1829
|
-
case l.TOP:
|
|
1830
|
-
case l.BOTTOM:
|
|
1831
|
-
this.align = this.getHorizontalAlign();
|
|
1832
|
-
break;
|
|
1833
|
-
case l.LEFT:
|
|
1834
|
-
case l.RIGHT:
|
|
1835
|
-
this.align = this.getVerticalAlign();
|
|
1836
|
-
}
|
|
1837
|
-
let i, t;
|
|
1838
|
-
switch (this.place) {
|
|
1839
|
-
case l.TOP:
|
|
1840
|
-
t = this.referentRect.top - this.rect.height;
|
|
1841
|
-
break;
|
|
1842
|
-
case l.RIGHT:
|
|
1843
|
-
i = this.referentRect.right;
|
|
1844
|
-
break;
|
|
1845
|
-
case l.BOTTOM:
|
|
1846
|
-
t = this.referentRect.bottom;
|
|
1847
|
-
break;
|
|
1848
|
-
case l.LEFT:
|
|
1849
|
-
i = this.referentRect.left - this.rect.width;
|
|
1850
|
-
}
|
|
1851
|
-
switch (this.place) {
|
|
1852
|
-
case l.TOP:
|
|
1853
|
-
case l.BOTTOM:
|
|
1854
|
-
switch (this.align) {
|
|
1855
|
-
case u.CENTER:
|
|
1856
|
-
i = this.referentRect.center - 0.5 * this.rect.width;
|
|
1857
|
-
break;
|
|
1858
|
-
case u.START:
|
|
1859
|
-
i = this.referentRect.left;
|
|
1860
|
-
break;
|
|
1861
|
-
case u.END:
|
|
1862
|
-
i = this.referentRect.right - this.rect.width;
|
|
1863
|
-
}
|
|
1864
|
-
break;
|
|
1865
|
-
case l.RIGHT:
|
|
1866
|
-
case l.LEFT:
|
|
1867
|
-
switch (this.align) {
|
|
1868
|
-
case u.CENTER:
|
|
1869
|
-
t = this.referentRect.middle - 0.5 * this.rect.height;
|
|
1870
|
-
break;
|
|
1871
|
-
case u.START:
|
|
1872
|
-
t = this.referentRect.top;
|
|
1873
|
-
break;
|
|
1874
|
-
case u.END:
|
|
1875
|
-
t = this.referentRect.bottom - this.rect.height;
|
|
1876
|
-
}
|
|
1877
|
-
}
|
|
1878
|
-
this._x === i && this._y === t || (this._x = i + 0.5 | 0, this._y = t + 0.5 | 0, this.node.style.transform = `translate(${this._x}px,${this._y}px)`);
|
|
1879
|
-
}
|
|
1880
|
-
getPlace() {
|
|
1881
|
-
for (const i of this._places)
|
|
1882
|
-
switch (i) {
|
|
1883
|
-
case l.TOP:
|
|
1884
|
-
if (this.referentRect.top - this.rect.height > this.safeArea.top)
|
|
1885
|
-
return l.TOP;
|
|
1886
|
-
break;
|
|
1887
|
-
case l.RIGHT:
|
|
1888
|
-
if (this.referentRect.right + this.rect.width < this.safeArea.right)
|
|
1889
|
-
return l.RIGHT;
|
|
1890
|
-
break;
|
|
1891
|
-
case l.BOTTOM:
|
|
1892
|
-
if (this.referentRect.bottom + this.rect.height < this.safeArea.bottom)
|
|
1893
|
-
return l.BOTTOM;
|
|
1894
|
-
break;
|
|
1895
|
-
case l.LEFT:
|
|
1896
|
-
if (this.referentRect.left - this.rect.width > this.safeArea.left)
|
|
1897
|
-
return l.LEFT;
|
|
1898
|
-
}
|
|
1899
|
-
return this._places[0];
|
|
1900
|
-
}
|
|
1901
|
-
getHorizontalAlign() {
|
|
1902
|
-
for (const i of this._aligns)
|
|
1903
|
-
switch (i) {
|
|
1904
|
-
case u.CENTER:
|
|
1905
|
-
if (this.referentRect.center - 0.5 * this.rect.width > this.safeArea.left && this.referentRect.center + 0.5 * this.rect.width < this.safeArea.right)
|
|
1906
|
-
return u.CENTER;
|
|
1907
|
-
break;
|
|
1908
|
-
case u.START:
|
|
1909
|
-
if (this.referentRect.left + this.rect.width < this.safeArea.right)
|
|
1910
|
-
return u.START;
|
|
1911
|
-
break;
|
|
1912
|
-
case u.END:
|
|
1913
|
-
if (this.referentRect.right - this.rect.width > this.safeArea.left)
|
|
1914
|
-
return u.END;
|
|
1915
|
-
}
|
|
1916
|
-
return this._aligns[0];
|
|
1917
|
-
}
|
|
1918
|
-
getVerticalAlign() {
|
|
1919
|
-
for (const i of this._aligns)
|
|
1920
|
-
switch (i) {
|
|
1921
|
-
case u.CENTER:
|
|
1922
|
-
if (this.referentRect.middle - 0.5 * this.rect.height > this.safeArea.top && this.referentRect.middle + 0.5 * this.rect.height < this.safeArea.bottom)
|
|
1923
|
-
return u.CENTER;
|
|
1924
|
-
break;
|
|
1925
|
-
case u.START:
|
|
1926
|
-
if (this.referentRect.top + this.rect.height < this.safeArea.bottom)
|
|
1927
|
-
return u.START;
|
|
1928
|
-
break;
|
|
1929
|
-
case u.END:
|
|
1930
|
-
if (this.referentRect.bottom - this.rect.height > this.safeArea.top)
|
|
1931
|
-
return u.END;
|
|
1932
|
-
}
|
|
1933
|
-
return this._aligns[0];
|
|
1934
|
-
}
|
|
1935
|
-
dispose() {
|
|
1936
|
-
this._referent = null, super.dispose();
|
|
1937
|
-
}
|
|
1938
|
-
}, PlacementReferent: class extends b {
|
|
1939
|
-
constructor() {
|
|
1940
|
-
super(), this._isShown = !1;
|
|
1941
|
-
}
|
|
1942
|
-
static get instanceClassName() {
|
|
1943
|
-
return "PlacementReferent";
|
|
1944
|
-
}
|
|
1945
|
-
init() {
|
|
1946
|
-
this.registration.creator.setReferent(this), this._placement = this.registration.creator;
|
|
1947
|
-
}
|
|
1948
|
-
get placement() {
|
|
1949
|
-
return this._placement;
|
|
1950
|
-
}
|
|
1951
|
-
get isShown() {
|
|
1952
|
-
return this._isShown;
|
|
1953
|
-
}
|
|
1954
|
-
set isShown(i) {
|
|
1955
|
-
this._isShown !== i && this.isEnabled && (this._isShown = i, i ? this.registration.creator.show() : this.registration.creator.hide());
|
|
1956
|
-
}
|
|
1957
|
-
show() {
|
|
1958
|
-
this.isShown = !0;
|
|
1959
|
-
}
|
|
1960
|
-
hide() {
|
|
1961
|
-
this.isShown = !1;
|
|
1962
|
-
}
|
|
1963
|
-
}, PlacementAlign: u, PlacementPosition: l, PlacementMode: at }, d.internals.register(d.core.CollapseSelector.COLLAPSE, d.core.Collapse), d.internals.register(d.core.InjectSvgSelector.INJECT_SVG, d.core.InjectSvg), d.internals.register(d.core.RatioSelector.RATIO, d.core.Ratio), d.internals.register(d.core.AssessSelector.ASSESS_FILE, d.core.AssessFile), d.internals.register(d.core.AssessSelector.DETAIL, d.core.AssessDetail);
|
|
1964
|
-
const A = { SYSTEM: "system", LIGHT: "light", DARK: "dark" }, S = { THEME: s.internals.ns.attr("theme"), SCHEME: s.internals.ns.attr("scheme"), TRANSITION: s.internals.ns.attr("transition") }, R = { LIGHT: "light", DARK: "dark" }, G = { SCHEME: s.internals.ns.emission("scheme", "scheme"), THEME: s.internals.ns.emission("scheme", "theme"), ASK: s.internals.ns.emission("scheme", "ask") }, pt = { SCHEME: s.internals.ns.event("scheme"), THEME: s.internals.ns.event("theme") };
|
|
1965
|
-
class je extends s.core.Instance {
|
|
1966
|
-
constructor() {
|
|
1967
|
-
super(!1);
|
|
1968
|
-
}
|
|
1969
|
-
static get instanceClassName() {
|
|
1970
|
-
return "Scheme";
|
|
1971
|
-
}
|
|
1972
|
-
init() {
|
|
1973
|
-
this.changing = this.change.bind(this), this.hasAttribute(S.TRANSITION) && (this.removeAttribute(S.TRANSITION), this.request(this.restoreTransition.bind(this)));
|
|
1974
|
-
const t = s.internals.support.supportLocalStorage() ? localStorage.getItem("scheme") : "", e = this.getAttribute(S.SCHEME);
|
|
1975
|
-
switch (t) {
|
|
1976
|
-
case A.DARK:
|
|
1977
|
-
case A.LIGHT:
|
|
1978
|
-
case A.SYSTEM:
|
|
1979
|
-
this.scheme = t;
|
|
1980
|
-
break;
|
|
1981
|
-
default:
|
|
1982
|
-
switch (e) {
|
|
1983
|
-
case A.DARK:
|
|
1984
|
-
this.scheme = A.DARK;
|
|
1985
|
-
break;
|
|
1986
|
-
case A.LIGHT:
|
|
1987
|
-
this.scheme = A.LIGHT;
|
|
1988
|
-
break;
|
|
1989
|
-
default:
|
|
1990
|
-
this.scheme = A.SYSTEM;
|
|
1991
|
-
}
|
|
1992
|
-
}
|
|
1993
|
-
this.addAscent(G.ASK, this.ask.bind(this)), this.addAscent(G.SCHEME, this.apply.bind(this));
|
|
1994
|
-
}
|
|
1995
|
-
get proxy() {
|
|
1996
|
-
const t = this, e = { get scheme() {
|
|
1997
|
-
return t.scheme;
|
|
1998
|
-
}, set scheme(n) {
|
|
1999
|
-
t.scheme = n;
|
|
2000
|
-
} };
|
|
2001
|
-
return s.internals.property.completeAssign(super.proxy, e);
|
|
2002
|
-
}
|
|
2003
|
-
restoreTransition() {
|
|
2004
|
-
this.setAttribute(S.TRANSITION, "");
|
|
2005
|
-
}
|
|
2006
|
-
ask() {
|
|
2007
|
-
this.descend(G.SCHEME, this.scheme);
|
|
2008
|
-
}
|
|
2009
|
-
apply(t) {
|
|
2010
|
-
this.scheme = t;
|
|
2011
|
-
}
|
|
2012
|
-
get scheme() {
|
|
2013
|
-
return this._scheme;
|
|
2014
|
-
}
|
|
2015
|
-
set scheme(t) {
|
|
2016
|
-
if (this._scheme !== t) {
|
|
2017
|
-
switch (this._scheme = t, t) {
|
|
2018
|
-
case A.SYSTEM:
|
|
2019
|
-
this.listenPreferences();
|
|
2020
|
-
break;
|
|
2021
|
-
case A.DARK:
|
|
2022
|
-
this.unlistenPreferences(), this.theme = R.DARK;
|
|
2023
|
-
break;
|
|
2024
|
-
case A.LIGHT:
|
|
2025
|
-
this.unlistenPreferences(), this.theme = R.LIGHT;
|
|
2026
|
-
break;
|
|
2027
|
-
default:
|
|
2028
|
-
return void (this.scheme = A.SYSTEM);
|
|
2029
|
-
}
|
|
2030
|
-
this.descend(G.SCHEME, t), s.internals.support.supportLocalStorage() && localStorage.setItem("scheme", t), this.setAttribute(S.SCHEME, t), this.dispatch(pt.SCHEME, { scheme: this._scheme });
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
get theme() {
|
|
2034
|
-
return this._theme;
|
|
2035
|
-
}
|
|
2036
|
-
set theme(t) {
|
|
2037
|
-
if (this._theme !== t)
|
|
2038
|
-
switch (t) {
|
|
2039
|
-
case R.LIGHT:
|
|
2040
|
-
case R.DARK:
|
|
2041
|
-
this._theme = t, this.setAttribute(S.THEME, t), this.descend(G.THEME, t), this.dispatch(pt.THEME, { theme: this._theme }), document.documentElement.style.colorScheme = t === R.DARK ? "dark" : "";
|
|
2042
|
-
}
|
|
2043
|
-
}
|
|
2044
|
-
listenPreferences() {
|
|
2045
|
-
this.isListening || (this.isListening = !0, this.mediaQuery = window.matchMedia("(prefers-color-scheme: dark)"), this.mediaQuery.addEventListener && this.mediaQuery.addEventListener("change", this.changing), this.change());
|
|
2046
|
-
}
|
|
2047
|
-
unlistenPreferences() {
|
|
2048
|
-
this.isListening && (this.isListening = !1, this.mediaQuery.removeEventListener("change", this.changing), this.mediaQuery = null);
|
|
2049
|
-
}
|
|
2050
|
-
change() {
|
|
2051
|
-
this.isListening && (this.theme = this.mediaQuery.matches ? R.DARK : R.LIGHT);
|
|
2052
|
-
}
|
|
2053
|
-
mutate(t) {
|
|
2054
|
-
t.indexOf(S.SCHEME) > -1 && (this.scheme = this.getAttribute(S.SCHEME)), t.indexOf(S.THEME) > -1 && (this.theme = this.getAttribute(S.THEME));
|
|
2055
|
-
}
|
|
2056
|
-
dispose() {
|
|
2057
|
-
this.unlistenPreferences();
|
|
2058
|
-
}
|
|
2059
|
-
}
|
|
2060
|
-
const Ve = { SCHEME: `:root${s.internals.ns.attr.selector("theme")}, :root${s.internals.ns.attr.selector("scheme")}`, SWITCH_THEME: s.internals.ns.selector("switch-theme"), RADIO_BUTTONS: `input[name="${s.internals.ns("radios-theme")}"]` };
|
|
2061
|
-
s.scheme = { Scheme: je, SchemeValue: A, SchemeSelector: Ve, SchemeEmission: G, SchemeTheme: R, SchemeEvent: pt }, s.internals.register(s.scheme.SchemeSelector.SCHEME, s.scheme.Scheme);
|
|
2062
|
-
const y = s.internals.ns.selector("accordion"), P = s.internals.ns.selector("collapse"), tt = { GROUP: s.internals.ns.selector("accordions-group"), ACCORDION: y, COLLAPSE: `${y} > ${P}, ${y} > *:not(${y}):not(${P}) > ${P}, ${y} > *:not(${y}):not(${P}) > *:not(${y}):not(${P}) > ${P}`, COLLAPSE_LEGACY: `${y} ${P}`, BUTTON: `${y}__btn` };
|
|
2063
|
-
class Ke extends s.core.Instance {
|
|
2064
|
-
static get instanceClassName() {
|
|
2065
|
-
return "Accordion";
|
|
2066
|
-
}
|
|
2067
|
-
get collapsePrimary() {
|
|
2068
|
-
return this.element.children.map((t) => t.getInstance("CollapseButton")).filter((t) => t !== null && t.hasClass(tt.BUTTON))[0];
|
|
2069
|
-
}
|
|
2070
|
-
}
|
|
2071
|
-
class Ye extends s.core.CollapsesGroup {
|
|
2072
|
-
static get instanceClassName() {
|
|
2073
|
-
return "AccordionsGroup";
|
|
2074
|
-
}
|
|
2075
|
-
validate(t) {
|
|
2076
|
-
const e = t.node.matches(s.internals.legacy.isLegacy ? tt.COLLAPSE_LEGACY : tt.COLLAPSE);
|
|
2077
|
-
return super.validate(t) && e;
|
|
2078
|
-
}
|
|
2079
|
-
}
|
|
2080
|
-
s.accordion = { Accordion: Ke, AccordionSelector: tt, AccordionsGroup: Ye }, s.internals.register(s.accordion.AccordionSelector.GROUP, s.accordion.AccordionsGroup), s.internals.register(s.accordion.AccordionSelector.ACCORDION, s.accordion.Accordion);
|
|
2081
|
-
const Xe = { EQUISIZED_BUTTON: `${s.internals.ns.selector("btns-group--equisized")} ${s.internals.ns.selector("btn")}`, EQUISIZED_GROUP: s.internals.ns.selector("btns-group--equisized") };
|
|
2082
|
-
s.button = { ButtonSelector: Xe }, s.internals.register(s.button.ButtonSelector.EQUISIZED_BUTTON, s.core.Equisized), s.internals.register(s.button.ButtonSelector.EQUISIZED_GROUP, s.core.EquisizedsGroup);
|
|
2083
|
-
class Qe extends s.core.Instance {
|
|
2084
|
-
static get instanceClassName() {
|
|
2085
|
-
return "CardDownload";
|
|
2086
|
-
}
|
|
2087
|
-
init() {
|
|
2088
|
-
this.addAscent(s.core.AssessEmission.UPDATE, (t) => {
|
|
2089
|
-
this.descend(s.core.AssessEmission.UPDATE, t);
|
|
2090
|
-
}), this.addAscent(s.core.AssessEmission.ADDED, () => {
|
|
2091
|
-
this.descend(s.core.AssessEmission.ADDED);
|
|
2092
|
-
});
|
|
2093
|
-
}
|
|
2094
|
-
}
|
|
2095
|
-
const Je = { DOWNLOAD: s.internals.ns.selector("card--download"), DOWNLOAD_DETAIL: `${s.internals.ns.selector("card--download")} ${s.internals.ns.selector("card__end")} ${s.internals.ns.selector("card__detail")}` };
|
|
2096
|
-
s.card = { CardSelector: Je, CardDownload: Qe }, s.internals.register(s.card.CardSelector.DOWNLOAD, s.card.CardDownload), s.internals.register(s.card.CardSelector.DOWNLOAD_DETAIL, s.core.AssessDetail);
|
|
2097
|
-
const _t = { SEGMENTED: s.internals.ns.selector("segmented"), SEGMENTED_ELEMENTS: s.internals.ns.selector("segmented__elements"), SEGMENTED_ELEMENT: s.internals.ns.selector("segmented__element input"), SEGMENTED_LEGEND: s.internals.ns.selector("segmented__legend") }, j = { ADDED: s.internals.ns.emission("segmented", "added"), REMOVED: s.internals.ns.emission("segmented", "removed") };
|
|
2098
|
-
class Ze extends s.core.Instance {
|
|
2099
|
-
static get instanceClassName() {
|
|
2100
|
-
return "Segmented";
|
|
2101
|
-
}
|
|
2102
|
-
init() {
|
|
2103
|
-
this.elements = this.node.querySelector(_t.SEGMENTED_ELEMENTS), this.legend = this.node.querySelector(_t.SEGMENTED_LEGEND), this.addAscent(j.ADDED, this.resize.bind(this)), this.addAscent(j.REMOVED, this.resize.bind(this)), this._isLegendInline = this.legend && this.legend.classList.contains(`${s.prefix}-segmented__legend--inline`), this.isResizing = !0;
|
|
2104
|
-
}
|
|
2105
|
-
resize() {
|
|
2106
|
-
const t = `${s.prefix}-segmented--vertical`, e = `${s.prefix}-segmented__legend--inline`;
|
|
2107
|
-
this.removeClass(t), this._isLegendInline && (this.legend.classList.add(e), (this.node.offsetWidth > this.node.parentNode.offsetWidth || this.elements.scrollWidth + this.legend.offsetWidth + 16 > this.node.parentNode.offsetWidth) && this.legend.classList.remove(e)), this.elements.offsetWidth > this.node.parentNode.offsetWidth || this.elements.scrollWidth > this.node.parentNode.offsetWidth ? this.addClass(t) : this.removeClass(t);
|
|
2108
|
-
}
|
|
2109
|
-
}
|
|
2110
|
-
class ts extends s.core.Instance {
|
|
2111
|
-
static get instanceClassName() {
|
|
2112
|
-
return "SegmentedElement";
|
|
2113
|
-
}
|
|
2114
|
-
init() {
|
|
2115
|
-
this.ascend(j.ADDED);
|
|
2116
|
-
}
|
|
2117
|
-
dispose() {
|
|
2118
|
-
this.ascend(j.REMOVED);
|
|
2119
|
-
}
|
|
2120
|
-
}
|
|
2121
|
-
s.segmented = { SegmentedSelector: _t, SegmentedEmission: j, SegmentedElement: ts, Segmented: Ze }, s.internals.register(s.segmented.SegmentedSelector.SEGMENTED, s.segmented.Segmented), s.internals.register(s.segmented.SegmentedSelector.SEGMENTED_ELEMENT, s.segmented.SegmentedElement);
|
|
2122
|
-
const ne = { BREADCRUMB: s.internals.ns.selector("breadcrumb"), BUTTON: s.internals.ns.selector("breadcrumb__button") };
|
|
2123
|
-
class es extends s.core.Instance {
|
|
2124
|
-
constructor() {
|
|
2125
|
-
super(), this.count = 0, this.focusing = this.focus.bind(this);
|
|
2126
|
-
}
|
|
2127
|
-
static get instanceClassName() {
|
|
2128
|
-
return "Breadcrumb";
|
|
2129
|
-
}
|
|
2130
|
-
init() {
|
|
2131
|
-
this.getCollapse(), this.isResizing = !0;
|
|
2132
|
-
}
|
|
2133
|
-
get proxy() {
|
|
2134
|
-
const t = this;
|
|
2135
|
-
return Object.assign(super.proxy, { focus: t.focus.bind(t), disclose: t.collapse.disclose.bind(t.collapse) });
|
|
2136
|
-
}
|
|
2137
|
-
getCollapse() {
|
|
2138
|
-
const t = this.collapse;
|
|
2139
|
-
t ? t.listen(s.core.DisclosureEvent.DISCLOSE, this.focusing) : this.addAscent(s.core.DisclosureEmission.ADDED, this.getCollapse.bind(this));
|
|
2140
|
-
}
|
|
2141
|
-
resize() {
|
|
2142
|
-
const t = this.collapse, e = this.links;
|
|
2143
|
-
t && e.length && (this.isBreakpoint(s.core.Breakpoints.MD) ? t.buttonHasFocus && e[0].focus() : e.indexOf(document.activeElement) > -1 && t.focus());
|
|
2144
|
-
}
|
|
2145
|
-
get links() {
|
|
2146
|
-
return [...this.querySelectorAll("a[href]")];
|
|
2147
|
-
}
|
|
2148
|
-
get collapse() {
|
|
2149
|
-
return this.element.getDescendantInstances(s.core.Collapse.instanceClassName, null, !0)[0];
|
|
2150
|
-
}
|
|
2151
|
-
focus() {
|
|
2152
|
-
this.count = 0, this._focus();
|
|
2153
|
-
}
|
|
2154
|
-
_focus() {
|
|
2155
|
-
const t = this.links[0];
|
|
2156
|
-
t && (t.focus(), this.request(this.verify.bind(this)));
|
|
2157
|
-
}
|
|
2158
|
-
verify() {
|
|
2159
|
-
if (this.count++, this.count > 100)
|
|
2160
|
-
return;
|
|
2161
|
-
const t = this.links[0];
|
|
2162
|
-
t && document.activeElement !== t && this._focus();
|
|
2163
|
-
}
|
|
2164
|
-
get collapsePrimary() {
|
|
2165
|
-
return this.element.children.map((t) => t.getInstance("CollapseButton")).filter((t) => t !== null && t.hasClass(ne.BUTTON))[0];
|
|
2166
|
-
}
|
|
2167
|
-
}
|
|
2168
|
-
s.breadcrumb = { BreadcrumbSelector: ne, Breadcrumb: es }, s.internals.register(s.breadcrumb.BreadcrumbSelector.BREADCRUMB, s.breadcrumb.Breadcrumb);
|
|
2169
|
-
const et = { TOOLTIP: s.internals.ns.selector("tooltip"), SHOWN: s.internals.ns.selector("tooltip--shown"), BUTTON: s.internals.ns.selector("btn--tooltip") }, Mt = 1, $t = 2;
|
|
2170
|
-
class ss extends s.core.PlacementReferent {
|
|
2171
|
-
constructor() {
|
|
2172
|
-
super(), this._state = 0;
|
|
2173
|
-
}
|
|
2174
|
-
static get instanceClassName() {
|
|
2175
|
-
return "TooltipReferent";
|
|
2176
|
-
}
|
|
2177
|
-
init() {
|
|
2178
|
-
if (super.init(), this.listen("focusin", this.focusIn.bind(this)), this.listen("focusout", this.focusOut.bind(this)), !this.matches(et.BUTTON)) {
|
|
2179
|
-
const t = this.mouseover.bind(this);
|
|
2180
|
-
this.listen("mouseover", t), this.placement.listen("mouseover", t);
|
|
2181
|
-
const e = this.mouseout.bind(this);
|
|
2182
|
-
this.listen("mouseout", e), this.placement.listen("mouseout", e);
|
|
2183
|
-
}
|
|
2184
|
-
this.addEmission(s.core.RootEmission.KEYDOWN, this._keydown.bind(this)), this.listen("click", this._click.bind(this)), this.addEmission(s.core.RootEmission.CLICK, this._clickOut.bind(this));
|
|
2185
|
-
}
|
|
2186
|
-
_click() {
|
|
2187
|
-
this.focus();
|
|
2188
|
-
}
|
|
2189
|
-
_clickOut(t) {
|
|
2190
|
-
this.node.contains(t) || this.blur();
|
|
2191
|
-
}
|
|
2192
|
-
_keydown(t) {
|
|
2193
|
-
t === s.core.KeyCodes.ESCAPE && (this.blur(), this.close());
|
|
2194
|
-
}
|
|
2195
|
-
close() {
|
|
2196
|
-
this.state = 0;
|
|
2197
|
-
}
|
|
2198
|
-
get state() {
|
|
2199
|
-
return this._state;
|
|
2200
|
-
}
|
|
2201
|
-
set state(t) {
|
|
2202
|
-
this._state !== t && (this.isShown = t > 0, this._state = t);
|
|
2203
|
-
}
|
|
2204
|
-
focusIn() {
|
|
2205
|
-
this.state |= Mt;
|
|
2206
|
-
}
|
|
2207
|
-
focusOut() {
|
|
2208
|
-
this.state &= ~Mt;
|
|
2209
|
-
}
|
|
2210
|
-
mouseover() {
|
|
2211
|
-
this.state |= $t;
|
|
2212
|
-
}
|
|
2213
|
-
mouseout() {
|
|
2214
|
-
this.state &= ~$t;
|
|
2215
|
-
}
|
|
2216
|
-
}
|
|
2217
|
-
const bt = { SHOW: o.event("show"), HIDE: o.event("hide") }, ot = "hidden", Ht = "shown", Gt = "hiding";
|
|
2218
|
-
class is extends s.core.Placement {
|
|
2219
|
-
constructor() {
|
|
2220
|
-
super(s.core.PlacementMode.AUTO, [s.core.PlacementPosition.TOP, s.core.PlacementPosition.BOTTOM], [s.core.PlacementAlign.CENTER, s.core.PlacementAlign.START, s.core.PlacementAlign.END]), this.modifier = "", this._state = ot;
|
|
2221
|
-
}
|
|
2222
|
-
static get instanceClassName() {
|
|
2223
|
-
return "Tooltip";
|
|
2224
|
-
}
|
|
2225
|
-
init() {
|
|
2226
|
-
super.init(), this.register(`[aria-describedby="${this.id}"]`, ss), this.listen("transitionend", this.transitionEnd.bind(this));
|
|
2227
|
-
}
|
|
2228
|
-
transitionEnd() {
|
|
2229
|
-
this._state === Gt && (this._state = ot, this.isShown = !1);
|
|
2230
|
-
}
|
|
2231
|
-
get isShown() {
|
|
2232
|
-
return super.isShown;
|
|
2233
|
-
}
|
|
2234
|
-
set isShown(t) {
|
|
2235
|
-
if (this.isEnabled)
|
|
2236
|
-
switch (!0) {
|
|
2237
|
-
case t:
|
|
2238
|
-
this._state = Ht, this.addClass(et.SHOWN), this.dispatch(bt.SHOW), super.isShown = !0;
|
|
2239
|
-
break;
|
|
2240
|
-
case (this.isShown && !t && this._state === Ht):
|
|
2241
|
-
this._state = Gt, this.removeClass(et.SHOWN);
|
|
2242
|
-
break;
|
|
2243
|
-
case (this.isShown && !t && this._state === ot):
|
|
2244
|
-
this.dispatch(bt.HIDE), super.isShown = !1;
|
|
2245
|
-
}
|
|
2246
|
-
}
|
|
2247
|
-
render() {
|
|
2248
|
-
super.render();
|
|
2249
|
-
let t = this.referentRect.center - this.rect.center;
|
|
2250
|
-
const e = 0.5 * this.rect.width - 8;
|
|
2251
|
-
t < -e && (t = -e), t > e && (t = e), this.setProperty("--arrow-x", `${t.toFixed(2)}px`);
|
|
2252
|
-
}
|
|
2253
|
-
}
|
|
2254
|
-
s.tooltip = { Tooltip: is, TooltipSelector: et, TooltipEvent: bt }, s.internals.register(s.tooltip.TooltipSelector.TOOLTIP, s.tooltip.Tooltip);
|
|
2255
|
-
class ns extends s.core.Instance {
|
|
2256
|
-
static get instanceClassName() {
|
|
2257
|
-
return "ToggleInput";
|
|
2258
|
-
}
|
|
2259
|
-
get isChecked() {
|
|
2260
|
-
return this.node.checked;
|
|
2261
|
-
}
|
|
2262
|
-
}
|
|
2263
|
-
class rs extends s.core.Instance {
|
|
2264
|
-
static get instanceClassName() {
|
|
2265
|
-
return "ToggleStatusLabel";
|
|
2266
|
-
}
|
|
2267
|
-
init() {
|
|
2268
|
-
this.register(`input[id="${this.getAttribute("for")}"]`, ns), this.update(), this.isSwappingFont = !0;
|
|
2269
|
-
}
|
|
2270
|
-
get proxy() {
|
|
2271
|
-
return Object.assign(super.proxy, { update: this.update.bind(this) });
|
|
2272
|
-
}
|
|
2273
|
-
get input() {
|
|
2274
|
-
return this.getRegisteredInstances("ToggleInput")[0];
|
|
2275
|
-
}
|
|
2276
|
-
update() {
|
|
2277
|
-
this.node.style.removeProperty("--toggle-status-width");
|
|
2278
|
-
const t = this.input.isChecked, e = getComputedStyle(this.node, ":before");
|
|
2279
|
-
let n = parseFloat(e.width);
|
|
2280
|
-
this.input.node.checked = !t;
|
|
2281
|
-
const r = getComputedStyle(this.node, ":before"), a = parseFloat(r.width);
|
|
2282
|
-
a > n && (n = a), this.input.node.checked = t, this.node.style.setProperty("--toggle-status-width", n / 16 + "rem");
|
|
2283
|
-
}
|
|
2284
|
-
swapFont(t) {
|
|
2285
|
-
this.update();
|
|
2286
|
-
}
|
|
2287
|
-
}
|
|
2288
|
-
const as = { STATUS_LABEL: `${s.internals.ns.selector("toggle__label")}${s.internals.ns.attr.selector("checked-label")}${s.internals.ns.attr.selector("unchecked-label")}` };
|
|
2289
|
-
s.toggle = { ToggleStatusLabel: rs, ToggleSelector: as }, s.internals.register(s.toggle.ToggleSelector.STATUS_LABEL, s.toggle.ToggleStatusLabel);
|
|
2290
|
-
const k = s.internals.ns.selector("sidemenu__item"), M = s.internals.ns.selector("collapse"), st = { LIST: s.internals.ns.selector("sidemenu__list"), COLLAPSE: `${k} > ${M}, ${k} > *:not(${k}):not(${M}) > ${M}, ${k} > *:not(${k}):not(${M}) > *:not(${k}):not(${M}) > ${M}`, COLLAPSE_LEGACY: `${k} ${M}`, ITEM: s.internals.ns.selector("sidemenu__item"), BUTTON: s.internals.ns.selector("sidemenu__btn") };
|
|
2291
|
-
class os extends s.core.CollapsesGroup {
|
|
2292
|
-
static get instanceClassName() {
|
|
2293
|
-
return "SidemenuList";
|
|
2294
|
-
}
|
|
2295
|
-
validate(t) {
|
|
2296
|
-
return super.validate(t) && t.node.matches(s.internals.legacy.isLegacy ? st.COLLAPSE_LEGACY : st.COLLAPSE);
|
|
2297
|
-
}
|
|
2298
|
-
}
|
|
2299
|
-
class hs extends s.core.Instance {
|
|
2300
|
-
static get instanceClassName() {
|
|
2301
|
-
return "SidemenuItem";
|
|
2302
|
-
}
|
|
2303
|
-
get collapsePrimary() {
|
|
2304
|
-
return this.element.children.map((t) => t.getInstance("CollapseButton")).filter((t) => t !== null && t.hasClass(st.BUTTON))[0];
|
|
2305
|
-
}
|
|
2306
|
-
}
|
|
2307
|
-
s.sidemenu = { SidemenuList: os, SidemenuItem: hs, SidemenuSelector: st }, s.internals.register(s.sidemenu.SidemenuSelector.LIST, s.sidemenu.SidemenuList), s.internals.register(s.sidemenu.SidemenuSelector.ITEM, s.sidemenu.SidemenuItem);
|
|
2308
|
-
const B = { MODAL: s.internals.ns.selector("modal"), SCROLL_DIVIDER: s.internals.ns.selector("scroll-divider"), BODY: s.internals.ns.selector("modal__body"), TITLE: s.internals.ns.selector("modal__title") };
|
|
2309
|
-
class re extends s.core.DisclosureButton {
|
|
2310
|
-
constructor() {
|
|
2311
|
-
super(s.core.DisclosureType.OPENED);
|
|
2312
|
-
}
|
|
2313
|
-
static get instanceClassName() {
|
|
2314
|
-
return "ModalButton";
|
|
2315
|
-
}
|
|
2316
|
-
}
|
|
2317
|
-
const cs = { CONCEALING_BACKDROP: s.internals.ns.attr("concealing-backdrop") };
|
|
2318
|
-
class ls extends s.core.Disclosure {
|
|
2319
|
-
constructor() {
|
|
2320
|
-
super(s.core.DisclosureType.OPENED, B.MODAL, re, "ModalsGroup"), this._isActive = !1, this.scrolling = this.resize.bind(this, !1), this.resizing = this.resize.bind(this, !0);
|
|
2321
|
-
}
|
|
2322
|
-
static get instanceClassName() {
|
|
2323
|
-
return "Modal";
|
|
2324
|
-
}
|
|
2325
|
-
init() {
|
|
2326
|
-
super.init(), this._isDialog = this.node.tagName === "DIALOG", this.isScrolling = !1, this.listenClick(), this.addEmission(s.core.RootEmission.KEYDOWN, this._keydown.bind(this));
|
|
2327
|
-
}
|
|
2328
|
-
_keydown(t) {
|
|
2329
|
-
t === s.core.KeyCodes.ESCAPE && this._escape();
|
|
2330
|
-
}
|
|
2331
|
-
_escape() {
|
|
2332
|
-
switch (document.activeElement ? document.activeElement.tagName : void 0) {
|
|
2333
|
-
case "INPUT":
|
|
2334
|
-
case "LABEL":
|
|
2335
|
-
case "TEXTAREA":
|
|
2336
|
-
case "SELECT":
|
|
2337
|
-
case "AUDIO":
|
|
2338
|
-
case "VIDEO":
|
|
2339
|
-
break;
|
|
2340
|
-
default:
|
|
2341
|
-
this.isDisclosed && (this.conceal(), this.focus());
|
|
2342
|
-
}
|
|
2343
|
-
}
|
|
2344
|
-
retrieved() {
|
|
2345
|
-
this._ensureAccessibleName();
|
|
2346
|
-
}
|
|
2347
|
-
get body() {
|
|
2348
|
-
return this.element.getDescendantInstances("ModalBody", "Modal")[0];
|
|
2349
|
-
}
|
|
2350
|
-
handleClick(t) {
|
|
2351
|
-
t.target === this.node && this.getAttribute(cs.CONCEALING_BACKDROP) !== "false" && this.conceal();
|
|
2352
|
-
}
|
|
2353
|
-
disclose(t) {
|
|
2354
|
-
return !!super.disclose(t) && (this.body && this.body.activate(), this.isScrollLocked = !0, this.setAttribute("aria-modal", "true"), this.setAttribute("open", "true"), this._isDialog || this.activateModal(), !0);
|
|
2355
|
-
}
|
|
2356
|
-
conceal(t, e) {
|
|
2357
|
-
return !!super.conceal(t, e) && (this.isScrollLocked = !1, this.removeAttribute("aria-modal"), this.removeAttribute("open"), this.body && this.body.deactivate(), this._isDialog || this.deactivateModal(), !0);
|
|
2358
|
-
}
|
|
2359
|
-
get isDialog() {
|
|
2360
|
-
return this._isDialog;
|
|
2361
|
-
}
|
|
2362
|
-
set isDialog(t) {
|
|
2363
|
-
this._isDialog = t;
|
|
2364
|
-
}
|
|
2365
|
-
activateModal() {
|
|
2366
|
-
this._isActive || (this._isActive = !0, this._hasDialogRole = this.getAttribute("role") === "dialog", this._hasDialogRole || this.setAttribute("role", "dialog"));
|
|
2367
|
-
}
|
|
2368
|
-
deactivateModal() {
|
|
2369
|
-
this._isActive && (this._isActive = !1, this._hasDialogRole || this.removeAttribute("role"));
|
|
2370
|
-
}
|
|
2371
|
-
_setAccessibleName(t, e) {
|
|
2372
|
-
const n = this.retrieveNodeId(t, e);
|
|
2373
|
-
this.warn(`add reference to ${e} for accessible name (aria-labelledby)`), this.setAttribute("aria-labelledby", n);
|
|
2374
|
-
}
|
|
2375
|
-
_ensureAccessibleName() {
|
|
2376
|
-
if (this.hasAttribute("aria-labelledby") || this.hasAttribute("aria-label"))
|
|
2377
|
-
return;
|
|
2378
|
-
this.warn("missing accessible name");
|
|
2379
|
-
const t = this.node.querySelector(B.TITLE), e = this.primaryButtons[0];
|
|
2380
|
-
switch (!0) {
|
|
2381
|
-
case t !== null:
|
|
2382
|
-
this._setAccessibleName(t, "title");
|
|
2383
|
-
break;
|
|
2384
|
-
case e !== void 0:
|
|
2385
|
-
this.warn("missing required title, fallback to primary button"), this._setAccessibleName(e, "primary");
|
|
2386
|
-
}
|
|
2387
|
-
}
|
|
2388
|
-
}
|
|
2389
|
-
const ds = ['[tabindex="0"]', "a[href]", "button:not([disabled])", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details", "iframe"].join(), us = ['[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'].join(), Ut = (i, t) => {
|
|
2390
|
-
if (!(i instanceof Element))
|
|
2391
|
-
return !1;
|
|
2392
|
-
const e = window.getComputedStyle(i);
|
|
2393
|
-
if (!e || e.visibility === "hidden")
|
|
2394
|
-
return !1;
|
|
2395
|
-
for (t === void 0 && (t = i); t.contains(i); ) {
|
|
2396
|
-
if (e.display === "none")
|
|
2397
|
-
return !1;
|
|
2398
|
-
i = i.parentElement;
|
|
2399
|
-
}
|
|
2400
|
-
return !0;
|
|
2401
|
-
};
|
|
2402
|
-
class gs {
|
|
2403
|
-
constructor(t, e) {
|
|
2404
|
-
this.element = null, this.activeElement = null, this.onTrap = t, this.onUntrap = e, this.waiting = this.wait.bind(this), this.handling = this.handle.bind(this), this.focusing = this.maintainFocus.bind(this), this.current = null;
|
|
2405
|
-
}
|
|
2406
|
-
get trapped() {
|
|
2407
|
-
return this.element !== null;
|
|
2408
|
-
}
|
|
2409
|
-
trap(t) {
|
|
2410
|
-
this.trapped && this.untrap(), this.element = t, this.isTrapping = !0, this.wait(), this.onTrap && this.onTrap();
|
|
2411
|
-
}
|
|
2412
|
-
wait() {
|
|
2413
|
-
Ut(this.element) ? this.trapping() : window.requestAnimationFrame(this.waiting);
|
|
2414
|
-
}
|
|
2415
|
-
trapping() {
|
|
2416
|
-
if (!this.isTrapping)
|
|
2417
|
-
return;
|
|
2418
|
-
this.isTrapping = !1;
|
|
2419
|
-
const t = this.focusables;
|
|
2420
|
-
t.length && t.indexOf(document.activeElement) === -1 && t[0].focus(), this.element.setAttribute("aria-modal", !0), window.addEventListener("keydown", this.handling), document.body.addEventListener("focus", this.focusing, !0);
|
|
2421
|
-
}
|
|
2422
|
-
stun(t) {
|
|
2423
|
-
for (const e of t.children)
|
|
2424
|
-
e !== this.element && (e.contains(this.element) ? this.stun(e) : this.stunneds.push(new ms(e)));
|
|
2425
|
-
}
|
|
2426
|
-
maintainFocus(t) {
|
|
2427
|
-
if (!this.element.contains(t.target)) {
|
|
2428
|
-
const e = this.focusables;
|
|
2429
|
-
if (e.length === 0)
|
|
2430
|
-
return;
|
|
2431
|
-
const n = e[0];
|
|
2432
|
-
t.preventDefault(), n.focus();
|
|
2433
|
-
}
|
|
2434
|
-
}
|
|
2435
|
-
handle(t) {
|
|
2436
|
-
if (t.keyCode !== 9)
|
|
2437
|
-
return;
|
|
2438
|
-
const e = this.focusables;
|
|
2439
|
-
if (e.length === 0)
|
|
2440
|
-
return;
|
|
2441
|
-
const n = e[0], r = e[e.length - 1], a = e.indexOf(document.activeElement);
|
|
2442
|
-
t.shiftKey ? !this.element.contains(document.activeElement) || a < 1 ? (t.preventDefault(), r.focus()) : (document.activeElement.tabIndex > 0 || e[a - 1].tabIndex > 0) && (t.preventDefault(), e[a - 1].focus()) : this.element.contains(document.activeElement) && a !== e.length - 1 && a !== -1 ? document.activeElement.tabIndex > 0 && (t.preventDefault(), e[a + 1].focus()) : (t.preventDefault(), n.focus());
|
|
2443
|
-
}
|
|
2444
|
-
get focusables() {
|
|
2445
|
-
let t = s.internals.dom.querySelectorAllArray(this.element, ds);
|
|
2446
|
-
const e = s.internals.dom.querySelectorAllArray(document.documentElement, 'input[type="radio"]');
|
|
2447
|
-
if (e.length) {
|
|
2448
|
-
const a = {};
|
|
2449
|
-
for (const c of e) {
|
|
2450
|
-
const T = c.getAttribute("name");
|
|
2451
|
-
a[T] === void 0 && (a[T] = new ps(T)), a[T].push(c);
|
|
2452
|
-
}
|
|
2453
|
-
t = t.filter((c) => {
|
|
2454
|
-
if (c.tagName.toLowerCase() !== "input" || c.getAttribute("type").toLowerCase() !== "radio")
|
|
2455
|
-
return !0;
|
|
2456
|
-
const T = c.getAttribute("name");
|
|
2457
|
-
return a[T].keep(c);
|
|
2458
|
-
});
|
|
2459
|
-
}
|
|
2460
|
-
const n = s.internals.dom.querySelectorAllArray(this.element, us);
|
|
2461
|
-
n.sort((a, c) => a.tabIndex - c.tabIndex);
|
|
2462
|
-
const r = t.filter((a) => n.indexOf(a) === -1);
|
|
2463
|
-
return n.concat(r).filter((a) => a.tabIndex !== "-1" && Ut(a, this.element));
|
|
2464
|
-
}
|
|
2465
|
-
untrap() {
|
|
2466
|
-
this.trapped && (this.isTrapping = !1, this.element.removeAttribute("aria-modal"), window.removeEventListener("keydown", this.handling), document.body.removeEventListener("focus", this.focusing, !0), this.element = null, this.onUntrap && this.onUntrap());
|
|
2467
|
-
}
|
|
2468
|
-
dispose() {
|
|
2469
|
-
this.untrap();
|
|
2470
|
-
}
|
|
2471
|
-
}
|
|
2472
|
-
class ms {
|
|
2473
|
-
constructor(t) {
|
|
2474
|
-
this.element = t, this.inert = t.getAttribute("inert"), this.element.setAttribute("inert", "");
|
|
2475
|
-
}
|
|
2476
|
-
unstun() {
|
|
2477
|
-
this.inert === null ? this.element.removeAttribute("inert") : this.element.setAttribute("inert", this.inert);
|
|
2478
|
-
}
|
|
2479
|
-
}
|
|
2480
|
-
class ps {
|
|
2481
|
-
constructor(t) {
|
|
2482
|
-
this.name = t, this.buttons = [];
|
|
2483
|
-
}
|
|
2484
|
-
push(t) {
|
|
2485
|
-
this.buttons.push(t), (t === document.activeElement || t.checked || this.selected === void 0) && (this.selected = t);
|
|
2486
|
-
}
|
|
2487
|
-
keep(t) {
|
|
2488
|
-
return this.selected === t;
|
|
2489
|
-
}
|
|
2490
|
-
}
|
|
2491
|
-
class _s extends s.core.DisclosuresGroup {
|
|
2492
|
-
constructor() {
|
|
2493
|
-
super("Modal", !1), this.focusTrap = new gs();
|
|
2494
|
-
}
|
|
2495
|
-
static get instanceClassName() {
|
|
2496
|
-
return "ModalsGroup";
|
|
2497
|
-
}
|
|
2498
|
-
apply(t, e) {
|
|
2499
|
-
super.apply(t, e), this.current === null ? this.focusTrap.untrap() : this.focusTrap.trap(this.current.node);
|
|
2500
|
-
}
|
|
2501
|
-
}
|
|
2502
|
-
class bs extends s.core.Instance {
|
|
2503
|
-
static get instanceClassName() {
|
|
2504
|
-
return "ModalBody";
|
|
2505
|
-
}
|
|
2506
|
-
init() {
|
|
2507
|
-
this.listen("scroll", this.divide.bind(this));
|
|
2508
|
-
}
|
|
2509
|
-
activate() {
|
|
2510
|
-
this.isResizing = !0, this.resize();
|
|
2511
|
-
}
|
|
2512
|
-
deactivate() {
|
|
2513
|
-
this.isResizing = !1;
|
|
2514
|
-
}
|
|
2515
|
-
divide() {
|
|
2516
|
-
this.node.scrollHeight > this.node.clientHeight ? this.node.offsetHeight + this.node.scrollTop >= this.node.scrollHeight ? this.removeClass(B.SCROLL_DIVIDER) : this.addClass(B.SCROLL_DIVIDER) : this.removeClass(B.SCROLL_DIVIDER);
|
|
2517
|
-
}
|
|
2518
|
-
resize() {
|
|
2519
|
-
this.adjust(), this.request(this.adjust.bind(this));
|
|
2520
|
-
}
|
|
2521
|
-
adjust() {
|
|
2522
|
-
const t = 32 * (this.isBreakpoint(s.core.Breakpoints.MD) ? 2 : 1);
|
|
2523
|
-
this.isLegacy ? this.style.maxHeight = window.innerHeight - t + "px" : this.style.setProperty("--modal-max-height", window.innerHeight - t + "px"), this.divide();
|
|
2524
|
-
}
|
|
2525
|
-
}
|
|
2526
|
-
s.modal = { Modal: ls, ModalButton: re, ModalBody: bs, ModalsGroup: _s, ModalSelector: B }, s.internals.register(s.modal.ModalSelector.MODAL, s.modal.Modal), s.internals.register(s.modal.ModalSelector.BODY, s.modal.ModalBody), s.internals.register(s.core.RootSelector.ROOT, s.modal.ModalsGroup);
|
|
2527
|
-
const D = { TOGGLE: s.internals.ns.emission("password", "toggle"), ADJUST: s.internals.ns.emission("password", "adjust") };
|
|
2528
|
-
class Es extends s.core.Instance {
|
|
2529
|
-
static get instanceClassName() {
|
|
2530
|
-
return "PasswordToggle";
|
|
2531
|
-
}
|
|
2532
|
-
init() {
|
|
2533
|
-
this.listenClick(), this.ascend(D.ADJUST, this.width), this.isSwappingFont = !0, this._isChecked = this.isChecked;
|
|
2534
|
-
}
|
|
2535
|
-
get width() {
|
|
2536
|
-
const t = getComputedStyle(this.node.parentNode);
|
|
2537
|
-
return parseInt(t.width);
|
|
2538
|
-
}
|
|
2539
|
-
get isChecked() {
|
|
2540
|
-
return this.node.checked;
|
|
2541
|
-
}
|
|
2542
|
-
set isChecked(t) {
|
|
2543
|
-
this._isChecked = t, this.ascend(D.TOGGLE, t);
|
|
2544
|
-
}
|
|
2545
|
-
handleClick() {
|
|
2546
|
-
this.isChecked = !this._isChecked;
|
|
2547
|
-
}
|
|
2548
|
-
swapFont(t) {
|
|
2549
|
-
this.ascend(D.ADJUST, this.width);
|
|
2550
|
-
}
|
|
2551
|
-
}
|
|
2552
|
-
class fs extends s.core.Instance {
|
|
2553
|
-
static get instanceClassName() {
|
|
2554
|
-
return "Password";
|
|
2555
|
-
}
|
|
2556
|
-
init() {
|
|
2557
|
-
this.addAscent(D.TOGGLE, this.toggle.bind(this)), this.addAscent(D.ADJUST, this.adjust.bind(this));
|
|
2558
|
-
}
|
|
2559
|
-
toggle(t) {
|
|
2560
|
-
this.descend(D.TOGGLE, t);
|
|
2561
|
-
}
|
|
2562
|
-
adjust(t) {
|
|
2563
|
-
this.descend(D.ADJUST, t);
|
|
2564
|
-
}
|
|
2565
|
-
}
|
|
2566
|
-
const As = { PASSWORD: s.internals.ns.selector("password"), INPUT: s.internals.ns.selector("password__input"), LABEL: s.internals.ns.selector("password__label"), TOOGLE: `${s.internals.ns.selector("password__checkbox")} input[type="checkbox"]` };
|
|
2567
|
-
class Ts extends s.core.Instance {
|
|
2568
|
-
static get instanceClassName() {
|
|
2569
|
-
return "PasswordInput";
|
|
2570
|
-
}
|
|
2571
|
-
init() {
|
|
2572
|
-
this.addDescent(D.TOGGLE, this.toggle.bind(this)), this._isRevealed = this.hasAttribute("type") === "password", this.listen("keydown", this.capslock.bind(this)), this.listen("keyup", this.capslock.bind(this));
|
|
2573
|
-
}
|
|
2574
|
-
toggle(t) {
|
|
2575
|
-
this.isRevealed = t, this.setAttribute("type", t ? "text" : "password");
|
|
2576
|
-
}
|
|
2577
|
-
get isRevealed() {
|
|
2578
|
-
return this._isRevealed;
|
|
2579
|
-
}
|
|
2580
|
-
capslock(t) {
|
|
2581
|
-
t && typeof t.getModifierState != "function" || (t.getModifierState("CapsLock") ? this.node.parentNode.setAttribute(s.internals.ns.attr("capslock"), "") : this.node.parentNode.removeAttribute(s.internals.ns.attr("capslock")));
|
|
2582
|
-
}
|
|
2583
|
-
set isRevealed(t) {
|
|
2584
|
-
this._isRevealed = t, this.setAttribute("type", t ? "text" : "password");
|
|
2585
|
-
}
|
|
2586
|
-
}
|
|
2587
|
-
class Ss extends s.core.Instance {
|
|
2588
|
-
static get instanceClassName() {
|
|
2589
|
-
return "PasswordLabel";
|
|
2590
|
-
}
|
|
2591
|
-
init() {
|
|
2592
|
-
this.addDescent(D.ADJUST, this.adjust.bind(this));
|
|
2593
|
-
}
|
|
2594
|
-
adjust(t) {
|
|
2595
|
-
const e = Math.ceil(t / 16);
|
|
2596
|
-
this.node.style.paddingRight = e + "rem";
|
|
2597
|
-
}
|
|
2598
|
-
}
|
|
2599
|
-
s.password = { Password: fs, PasswordToggle: Es, PasswordSelector: As, PasswordInput: Ts, PasswordLabel: Ss }, s.internals.register(s.password.PasswordSelector.INPUT, s.password.PasswordInput), s.internals.register(s.password.PasswordSelector.PASSWORD, s.password.Password), s.internals.register(s.password.PasswordSelector.TOOGLE, s.password.PasswordToggle), s.internals.register(s.password.PasswordSelector.LABEL, s.password.PasswordLabel);
|
|
2600
|
-
const C = s.internals.ns.selector("nav__item"), $ = s.internals.ns.selector("collapse"), I = { NAVIGATION: s.internals.ns.selector("nav"), COLLAPSE: `${C} > ${$}, ${C} > *:not(${C}):not(${$}) > ${$}, ${C} > *:not(${C}):not(${$}) > *:not(${C}):not(${$}) > ${$}`, COLLAPSE_LEGACY: `${C} ${$}`, ITEM: C, ITEM_RIGHT: `${C}--align-right`, MENU: s.internals.ns.selector("menu"), BUTTON: s.internals.ns.selector("nav__btn"), TRANSLATE_BUTTON: s.internals.ns.selector("translate__btn") };
|
|
2601
|
-
class vs extends s.core.Instance {
|
|
2602
|
-
constructor() {
|
|
2603
|
-
super(), this._isRightAligned = !1;
|
|
2604
|
-
}
|
|
2605
|
-
static get instanceClassName() {
|
|
2606
|
-
return "NavigationItem";
|
|
2607
|
-
}
|
|
2608
|
-
init() {
|
|
2609
|
-
this.addAscent(s.core.DisclosureEmission.ADDED, this.calculate.bind(this)), this.addAscent(s.core.DisclosureEmission.REMOVED, this.calculate.bind(this)), this.isResizing = !0, this.calculate();
|
|
2610
|
-
}
|
|
2611
|
-
resize() {
|
|
2612
|
-
this.calculate();
|
|
2613
|
-
}
|
|
2614
|
-
calculate() {
|
|
2615
|
-
const t = this.element.getDescendantInstances(s.core.Collapse.instanceClassName, null, !0)[0];
|
|
2616
|
-
if (t && this.isBreakpoint(s.core.Breakpoints.LG) && t.element.node.matches(I.MENU)) {
|
|
2617
|
-
const e = this.element.node.parentElement.getBoundingClientRect().right, n = t.element.node.getBoundingClientRect().width, r = this.element.node.getBoundingClientRect().left;
|
|
2618
|
-
this.isRightAligned = r + n > e;
|
|
2619
|
-
} else
|
|
2620
|
-
this.isRightAligned = !1;
|
|
2621
|
-
}
|
|
2622
|
-
get isRightAligned() {
|
|
2623
|
-
return this._isRightAligned;
|
|
2624
|
-
}
|
|
2625
|
-
set isRightAligned(t) {
|
|
2626
|
-
this._isRightAligned !== t && (this._isRightAligned = t, t ? s.internals.dom.addClass(this.element.node, I.ITEM_RIGHT) : s.internals.dom.removeClass(this.element.node, I.ITEM_RIGHT));
|
|
2627
|
-
}
|
|
2628
|
-
get collapsePrimary() {
|
|
2629
|
-
return this.element.children.map((t) => t.getInstance("CollapseButton")).filter((t) => t !== null && (t.hasClass(I.BUTTON) || t.hasClass(I.TRANSLATE_BUTTON)))[0];
|
|
2630
|
-
}
|
|
2631
|
-
}
|
|
2632
|
-
const U = { NONE: -1, INSIDE: 0, OUTSIDE: 1 };
|
|
2633
|
-
class ys extends s.core.CollapsesGroup {
|
|
2634
|
-
static get instanceClassName() {
|
|
2635
|
-
return "Navigation";
|
|
2636
|
-
}
|
|
2637
|
-
init() {
|
|
2638
|
-
super.init(), this.clicked = !1, this.out = !1, this.listen("focusout", this.focusOutHandler.bind(this)), this.listen("mousedown", this.mouseDownHandler.bind(this)), this.listenClick({ capture: !0 });
|
|
2639
|
-
}
|
|
2640
|
-
validate(t) {
|
|
2641
|
-
return super.validate(t) && t.element.node.matches(s.internals.legacy.isLegacy ? I.COLLAPSE_LEGACY : I.COLLAPSE);
|
|
2642
|
-
}
|
|
2643
|
-
mouseDownHandler(t) {
|
|
2644
|
-
this.isBreakpoint(s.core.Breakpoints.LG) && this.index !== -1 && this.current && (this.position = this.current.node.contains(t.target) ? U.INSIDE : U.OUTSIDE, this.requestPosition());
|
|
2645
|
-
}
|
|
2646
|
-
clickHandler(t) {
|
|
2647
|
-
!t.target.matches("a, button") || t.target.matches("[aria-controls]") || t.target.matches(s.core.DisclosureSelector.PREVENT_CONCEAL) || (this.index = -1);
|
|
2648
|
-
}
|
|
2649
|
-
focusOutHandler(t) {
|
|
2650
|
-
this.isBreakpoint(s.core.Breakpoints.LG) && (this.out = !0, this.requestPosition());
|
|
2651
|
-
}
|
|
2652
|
-
requestPosition() {
|
|
2653
|
-
this.isRequesting || (this.isRequesting = !0, this.request(this.getPosition.bind(this)));
|
|
2654
|
-
}
|
|
2655
|
-
getPosition() {
|
|
2656
|
-
if (this.out)
|
|
2657
|
-
switch (this.position) {
|
|
2658
|
-
case U.OUTSIDE:
|
|
2659
|
-
this.index = -1;
|
|
2660
|
-
break;
|
|
2661
|
-
case U.INSIDE:
|
|
2662
|
-
this.current && !this.current.node.contains(document.activeElement) && this.current.focus();
|
|
2663
|
-
break;
|
|
2664
|
-
default:
|
|
2665
|
-
this.index > -1 && !this.current.hasFocus && (this.index = -1);
|
|
2666
|
-
}
|
|
2667
|
-
this.request(this.requested.bind(this));
|
|
2668
|
-
}
|
|
2669
|
-
requested() {
|
|
2670
|
-
this.position = U.NONE, this.out = !1, this.isRequesting = !1;
|
|
2671
|
-
}
|
|
2672
|
-
get index() {
|
|
2673
|
-
return super.index;
|
|
2674
|
-
}
|
|
2675
|
-
set index(t) {
|
|
2676
|
-
t === -1 && this.current && this.current.hasFocus && this.current.focus(), super.index = t;
|
|
2677
|
-
}
|
|
2678
|
-
}
|
|
2679
|
-
s.navigation = { Navigation: ys, NavigationItem: vs, NavigationMousePosition: U, NavigationSelector: I }, s.internals.register(s.navigation.NavigationSelector.NAVIGATION, s.navigation.Navigation), s.internals.register(s.navigation.NavigationSelector.ITEM, s.navigation.NavigationItem);
|
|
2680
|
-
class ae extends s.core.DisclosureButton {
|
|
2681
|
-
constructor() {
|
|
2682
|
-
super(s.core.DisclosureType.SELECT);
|
|
2683
|
-
}
|
|
2684
|
-
static get instanceClassName() {
|
|
2685
|
-
return "TabButton";
|
|
2686
|
-
}
|
|
2687
|
-
handleClick(t) {
|
|
2688
|
-
super.handleClick(t), this.focus();
|
|
2689
|
-
}
|
|
2690
|
-
apply(t) {
|
|
2691
|
-
super.apply(t), this.isPrimary && (this.setAttribute("tabindex", t ? "0" : "-1"), t && this.list && this.list.focalize(this));
|
|
2692
|
-
}
|
|
2693
|
-
get list() {
|
|
2694
|
-
return this.element.getAscendantInstance("TabsList", "TabsGroup");
|
|
2695
|
-
}
|
|
2696
|
-
}
|
|
2697
|
-
const E = { TAB: s.internals.ns.selector("tabs__tab"), GROUP: s.internals.ns.selector("tabs"), PANEL: s.internals.ns.selector("tabs__panel"), LIST: s.internals.ns.selector("tabs__list"), SHADOW: s.internals.ns.selector("tabs__shadow"), SHADOW_LEFT: s.internals.ns.selector("tabs__shadow--left"), SHADOW_RIGHT: s.internals.ns.selector("tabs__shadow--right"), PANEL_START: s.internals.ns.selector("tabs__panel--direction-start"), PANEL_END: s.internals.ns.selector("tabs__panel--direction-end") }, Et = "direction-start", ft = "direction-end", At = "none";
|
|
2698
|
-
class Cs extends s.core.Disclosure {
|
|
2699
|
-
constructor() {
|
|
2700
|
-
super(s.core.DisclosureType.SELECT, E.PANEL, ae, "TabsGroup"), this._direction = At, this._isPreventingTransition = !1;
|
|
2701
|
-
}
|
|
2702
|
-
static get instanceClassName() {
|
|
2703
|
-
return "TabPanel";
|
|
2704
|
-
}
|
|
2705
|
-
get direction() {
|
|
2706
|
-
return this._direction;
|
|
2707
|
-
}
|
|
2708
|
-
set direction(t) {
|
|
2709
|
-
if (t !== this._direction) {
|
|
2710
|
-
switch (this._direction) {
|
|
2711
|
-
case Et:
|
|
2712
|
-
this.removeClass(E.PANEL_START);
|
|
2713
|
-
break;
|
|
2714
|
-
case ft:
|
|
2715
|
-
this.removeClass(E.PANEL_END);
|
|
2716
|
-
break;
|
|
2717
|
-
case At:
|
|
2718
|
-
break;
|
|
2719
|
-
default:
|
|
2720
|
-
return;
|
|
2721
|
-
}
|
|
2722
|
-
switch (this._direction = t, this._direction) {
|
|
2723
|
-
case Et:
|
|
2724
|
-
this.addClass(E.PANEL_START);
|
|
2725
|
-
break;
|
|
2726
|
-
case ft:
|
|
2727
|
-
this.addClass(E.PANEL_END);
|
|
2728
|
-
}
|
|
2729
|
-
}
|
|
2730
|
-
}
|
|
2731
|
-
get isPreventingTransition() {
|
|
2732
|
-
return this._isPreventingTransition;
|
|
2733
|
-
}
|
|
2734
|
-
set isPreventingTransition(t) {
|
|
2735
|
-
this._isPreventingTransition !== t && (t ? this.addClass(s.internals.motion.TransitionSelector.NONE) : this.removeClass(s.internals.motion.TransitionSelector.NONE), this._isPreventingTransition = t === !0);
|
|
2736
|
-
}
|
|
2737
|
-
translate(t, e) {
|
|
2738
|
-
this.isPreventingTransition = e, this.direction = t;
|
|
2739
|
-
}
|
|
2740
|
-
reset() {
|
|
2741
|
-
this.group && this.group.retrieve(!0);
|
|
2742
|
-
}
|
|
2743
|
-
_electPrimaries(t) {
|
|
2744
|
-
return this.group && this.group.list ? super._electPrimaries(t).filter((e) => this.group.list.node.contains(e.node)) : [];
|
|
2745
|
-
}
|
|
2746
|
-
}
|
|
2747
|
-
const oe = "tab_keys_left", he = "tab_keys_right", ce = "tab_keys_home", le = "tab_keys_end", x = { PRESS_KEY: s.internals.ns.emission("tab", "press_key"), LIST_HEIGHT: s.internals.ns.emission("tab", "list_height") };
|
|
2748
|
-
class Ns extends s.core.DisclosuresGroup {
|
|
2749
|
-
constructor() {
|
|
2750
|
-
super("TabPanel");
|
|
2751
|
-
}
|
|
2752
|
-
static get instanceClassName() {
|
|
2753
|
-
return "TabsGroup";
|
|
2754
|
-
}
|
|
2755
|
-
init() {
|
|
2756
|
-
super.init(), this.listen("transitionend", this.transitionend.bind(this)), this.addAscent(x.PRESS_KEY, this.pressKey.bind(this)), this.addAscent(x.LIST_HEIGHT, this.setListHeight.bind(this)), this.isRendering = !0;
|
|
2757
|
-
}
|
|
2758
|
-
getIndex(t = 0) {
|
|
2759
|
-
super.getIndex(t);
|
|
2760
|
-
}
|
|
2761
|
-
get list() {
|
|
2762
|
-
return this.element.getDescendantInstances("TabsList", "TabsGroup", !0)[0];
|
|
2763
|
-
}
|
|
2764
|
-
setListHeight(t) {
|
|
2765
|
-
this.listHeight = t;
|
|
2766
|
-
}
|
|
2767
|
-
transitionend(t) {
|
|
2768
|
-
this.isPreventingTransition = !0;
|
|
2769
|
-
}
|
|
2770
|
-
get buttonHasFocus() {
|
|
2771
|
-
return this.members.some((t) => t.buttonHasFocus);
|
|
2772
|
-
}
|
|
2773
|
-
pressKey(t) {
|
|
2774
|
-
switch (t) {
|
|
2775
|
-
case oe:
|
|
2776
|
-
this.pressLeft();
|
|
2777
|
-
break;
|
|
2778
|
-
case he:
|
|
2779
|
-
this.pressRight();
|
|
2780
|
-
break;
|
|
2781
|
-
case ce:
|
|
2782
|
-
this.pressHome();
|
|
2783
|
-
break;
|
|
2784
|
-
case le:
|
|
2785
|
-
this.pressEnd();
|
|
2786
|
-
}
|
|
2787
|
-
}
|
|
2788
|
-
pressRight() {
|
|
2789
|
-
this.buttonHasFocus && (this.index < this.length - 1 ? this.index++ : this.index = 0, this.focus());
|
|
2790
|
-
}
|
|
2791
|
-
pressLeft() {
|
|
2792
|
-
this.buttonHasFocus && (this.index > 0 ? this.index-- : this.index = this.length - 1, this.focus());
|
|
2793
|
-
}
|
|
2794
|
-
pressHome() {
|
|
2795
|
-
this.buttonHasFocus && (this.index = 0, this.focus());
|
|
2796
|
-
}
|
|
2797
|
-
pressEnd() {
|
|
2798
|
-
this.buttonHasFocus && (this.index = this.length - 1, this.focus());
|
|
2799
|
-
}
|
|
2800
|
-
focus() {
|
|
2801
|
-
this.current && this.current.focus();
|
|
2802
|
-
}
|
|
2803
|
-
apply() {
|
|
2804
|
-
for (let t = 0; t < this._index; t++)
|
|
2805
|
-
this.members[t].translate(Et);
|
|
2806
|
-
this.current && this.current.translate(At);
|
|
2807
|
-
for (let t = this._index + 1; t < this.length; t++)
|
|
2808
|
-
this.members[t].translate(ft);
|
|
2809
|
-
this.isPreventingTransition = !1;
|
|
2810
|
-
}
|
|
2811
|
-
get isPreventingTransition() {
|
|
2812
|
-
return this._isPreventingTransition;
|
|
2813
|
-
}
|
|
2814
|
-
set isPreventingTransition(t) {
|
|
2815
|
-
this._isPreventingTransition !== t && (t ? this.addClass(s.internals.motion.TransitionSelector.NONE) : this.removeClass(s.internals.motion.TransitionSelector.NONE), this._isPreventingTransition = t === !0);
|
|
2816
|
-
}
|
|
2817
|
-
render() {
|
|
2818
|
-
if (this.current === null)
|
|
2819
|
-
return;
|
|
2820
|
-
this.node.scrollTop = 0, this.node.scrollLeft = 0;
|
|
2821
|
-
const t = Math.round(this.current.node.offsetHeight);
|
|
2822
|
-
this.panelHeight !== t && (this.panelHeight = t, this.style.setProperty("--tabs-height", this.panelHeight + this.listHeight + "px"));
|
|
2823
|
-
}
|
|
2824
|
-
}
|
|
2825
|
-
class Ds extends s.core.Instance {
|
|
2826
|
-
static get instanceClassName() {
|
|
2827
|
-
return "TabsList";
|
|
2828
|
-
}
|
|
2829
|
-
init() {
|
|
2830
|
-
this.listen("scroll", this.scroll.bind(this)), this.listenKey(s.core.KeyCodes.RIGHT, this.ascend.bind(this, x.PRESS_KEY, he), !0, !0), this.listenKey(s.core.KeyCodes.LEFT, this.ascend.bind(this, x.PRESS_KEY, oe), !0, !0), this.listenKey(s.core.KeyCodes.HOME, this.ascend.bind(this, x.PRESS_KEY, ce), !0, !0), this.listenKey(s.core.KeyCodes.END, this.ascend.bind(this, x.PRESS_KEY, le), !0, !0), this.isResizing = !0;
|
|
2831
|
-
}
|
|
2832
|
-
focalize(t) {
|
|
2833
|
-
const e = t.getRect(), n = this.getRect(), r = this.node.scrollLeft;
|
|
2834
|
-
e.left < n.left ? this.node.scrollTo(r - n.left + e.left - 16, 0) : e.right > n.right && this.node.scrollTo(r - n.right + e.right + 16, 0);
|
|
2835
|
-
}
|
|
2836
|
-
get isScrolling() {
|
|
2837
|
-
return this._isScrolling;
|
|
2838
|
-
}
|
|
2839
|
-
set isScrolling(t) {
|
|
2840
|
-
this._isScrolling !== t && (this._isScrolling = t, this.apply());
|
|
2841
|
-
}
|
|
2842
|
-
apply() {
|
|
2843
|
-
this._isScrolling ? (this.addClass(E.SHADOW), this.scroll()) : (this.removeClass(E.SHADOW_RIGHT), this.removeClass(E.SHADOW_LEFT), this.removeClass(E.SHADOW));
|
|
2844
|
-
}
|
|
2845
|
-
scroll() {
|
|
2846
|
-
const t = this.node.scrollLeft, e = t <= 16, n = this.node.scrollWidth - this.node.clientWidth - 16, r = Math.abs(t) >= n, a = document.documentElement.getAttribute("dir") === "rtl", c = a ? E.SHADOW_RIGHT : E.SHADOW_LEFT, T = a ? E.SHADOW_LEFT : E.SHADOW_RIGHT;
|
|
2847
|
-
e ? this.removeClass(c) : this.addClass(c), r ? this.removeClass(T) : this.addClass(T);
|
|
2848
|
-
}
|
|
2849
|
-
resize() {
|
|
2850
|
-
this.isScrolling = this.node.scrollWidth > this.node.clientWidth + 16;
|
|
2851
|
-
const t = this.getRect().height;
|
|
2852
|
-
this.setProperty("--tabs-list-height", `${t}px`), this.ascend(x.LIST_HEIGHT, t);
|
|
2853
|
-
}
|
|
2854
|
-
dispose() {
|
|
2855
|
-
this.isScrolling = !1;
|
|
2856
|
-
}
|
|
2857
|
-
}
|
|
2858
|
-
s.tab = { TabPanel: Cs, TabButton: ae, TabsGroup: Ns, TabsList: Ds, TabSelector: E, TabEmission: x }, s.internals.register(s.tab.TabSelector.PANEL, s.tab.TabPanel), s.internals.register(s.tab.TabSelector.GROUP, s.tab.TabsGroup), s.internals.register(s.tab.TabSelector.LIST, s.tab.TabsList);
|
|
2859
|
-
const de = { SCROLLABLE: s.internals.ns.emission("table", "scrollable"), CHANGE: s.internals.ns.emission("table", "change"), CAPTION_HEIGHT: s.internals.ns.emission("table", "captionheight") };
|
|
2860
|
-
class ws extends s.core.Instance {
|
|
2861
|
-
static get instanceClassName() {
|
|
2862
|
-
return "Table";
|
|
2863
|
-
}
|
|
2864
|
-
init() {
|
|
2865
|
-
this.addAscent(de.CAPTION_HEIGHT, this.setCaptionHeight.bind(this));
|
|
2866
|
-
}
|
|
2867
|
-
setCaptionHeight(t) {
|
|
2868
|
-
this.setProperty("--table-offset", `calc(${t}px + 1rem)`);
|
|
2869
|
-
}
|
|
2870
|
-
}
|
|
2871
|
-
const N = { TABLE: s.internals.ns.selector("table"), SHADOW: s.internals.ns.selector("table__shadow"), SHADOW_LEFT: s.internals.ns.selector("table__shadow--left"), SHADOW_RIGHT: s.internals.ns.selector("table__shadow--right"), ELEMENT: `${s.internals.ns.selector("table")}:not(${s.internals.ns.selector("table--no-scroll")}) table`, CAPTION: `${s.internals.ns.selector("table")} table caption` };
|
|
2872
|
-
class Ls extends s.core.Instance {
|
|
2873
|
-
static get instanceClassName() {
|
|
2874
|
-
return "TableElement";
|
|
2875
|
-
}
|
|
2876
|
-
init() {
|
|
2877
|
-
this.listen("scroll", this.scroll.bind(this)), this.content = this.querySelector("tbody"), this.isResizing = !0;
|
|
2878
|
-
}
|
|
2879
|
-
get isScrolling() {
|
|
2880
|
-
return this._isScrolling;
|
|
2881
|
-
}
|
|
2882
|
-
set isScrolling(t) {
|
|
2883
|
-
this._isScrolling !== t && (this._isScrolling = t, t ? (this.addClass(N.SHADOW), this.scroll()) : (this.removeClass(N.SHADOW), this.removeClass(N.SHADOW_LEFT), this.removeClass(N.SHADOW_RIGHT)));
|
|
2884
|
-
}
|
|
2885
|
-
scroll() {
|
|
2886
|
-
const t = this.node.scrollLeft <= 8, e = this.content.offsetWidth - this.node.offsetWidth - 8, n = Math.abs(this.node.scrollLeft) >= e, r = document.documentElement.getAttribute("dir") === "rtl", a = r ? N.SHADOW_RIGHT : N.SHADOW_LEFT, c = r ? N.SHADOW_LEFT : N.SHADOW_RIGHT;
|
|
2887
|
-
t ? this.removeClass(a) : this.addClass(a), n ? this.removeClass(c) : this.addClass(c);
|
|
2888
|
-
}
|
|
2889
|
-
resize() {
|
|
2890
|
-
this.isScrolling = this.content.offsetWidth > this.node.offsetWidth;
|
|
2891
|
-
}
|
|
2892
|
-
dispose() {
|
|
2893
|
-
this.isScrolling = !1;
|
|
2894
|
-
}
|
|
2895
|
-
}
|
|
2896
|
-
class Rs extends s.core.Instance {
|
|
2897
|
-
static get instanceClassName() {
|
|
2898
|
-
return "TableCaption";
|
|
2899
|
-
}
|
|
2900
|
-
init() {
|
|
2901
|
-
this.height = 0, this.isResizing = !0;
|
|
2902
|
-
}
|
|
2903
|
-
resize() {
|
|
2904
|
-
const t = this.getRect().height;
|
|
2905
|
-
this.height !== t && (this.height = t, this.ascend(de.CAPTION_HEIGHT, t));
|
|
2906
|
-
}
|
|
2907
|
-
}
|
|
2908
|
-
s.table = { Table: ws, TableElement: Ls, TableCaption: Rs, TableSelector: N }, s.internals.register(s.table.TableSelector.TABLE, s.table.Table), s.internals.register(s.table.TableSelector.ELEMENT, s.table.TableElement), s.internals.register(s.table.TableSelector.CAPTION, s.table.TableCaption);
|
|
2909
|
-
const Tt = { DISMISS: s.internals.ns.event("dismiss") };
|
|
2910
|
-
class Is extends s.core.Instance {
|
|
2911
|
-
static get instanceClassName() {
|
|
2912
|
-
return "TagDismissible";
|
|
2913
|
-
}
|
|
2914
|
-
init() {
|
|
2915
|
-
this.listenClick();
|
|
2916
|
-
}
|
|
2917
|
-
handleClick() {
|
|
2918
|
-
switch (this.focusClosest(), s.mode) {
|
|
2919
|
-
case s.Modes.ANGULAR:
|
|
2920
|
-
case s.Modes.REACT:
|
|
2921
|
-
case s.Modes.VUE:
|
|
2922
|
-
this.request(this.verify.bind(this));
|
|
2923
|
-
break;
|
|
2924
|
-
default:
|
|
2925
|
-
this.remove();
|
|
2926
|
-
}
|
|
2927
|
-
this.dispatch(Tt.DISMISS);
|
|
2928
|
-
}
|
|
2929
|
-
verify() {
|
|
2930
|
-
document.body.contains(this.node) && this.warn(`a TagDismissible has just been dismissed and should be removed from the dom. In ${s.mode} mode, the api doesn't handle dom modification. An event ${Tt.DISMISS} is dispatched by the element to trigger the removal`);
|
|
2931
|
-
}
|
|
2932
|
-
}
|
|
2933
|
-
const xs = { PRESSABLE: `${s.internals.ns.selector("tag")}[aria-pressed]`, DISMISSIBLE: `${s.internals.ns.selector("tag--dismiss")}` };
|
|
2934
|
-
s.tag = { TagDismissible: Is, TagSelector: xs, TagEvent: Tt }, s.internals.register(s.tag.TagSelector.PRESSABLE, s.core.Toggle), s.internals.register(s.tag.TagSelector.DISMISSIBLE, s.tag.TagDismissible);
|
|
2935
|
-
const Bt = s.internals.ns.selector("transcription"), ue = { TRANSCRIPTION: Bt, BUTTON: `${Bt}__btn` };
|
|
2936
|
-
class Os extends s.core.Instance {
|
|
2937
|
-
static get instanceClassName() {
|
|
2938
|
-
return "Transcription";
|
|
2939
|
-
}
|
|
2940
|
-
get collapsePrimary() {
|
|
2941
|
-
return this.element.children.map((t) => t.getInstance("CollapseButton")).filter((t) => t !== null && t.hasClass(ue.BUTTON))[0];
|
|
2942
|
-
}
|
|
2943
|
-
}
|
|
2944
|
-
s.transcription = { Transcription: Os, TranscriptionSelector: ue }, s.internals.register(s.transcription.TranscriptionSelector.TRANSCRIPTION, s.transcription.Transcription);
|
|
2945
|
-
class Ps extends s.core.Instance {
|
|
2946
|
-
static get instanceClassName() {
|
|
2947
|
-
return "TileDownload";
|
|
2948
|
-
}
|
|
2949
|
-
init() {
|
|
2950
|
-
this.addAscent(s.core.AssessEmission.UPDATE, (t) => {
|
|
2951
|
-
this.descend(s.core.AssessEmission.UPDATE, t);
|
|
2952
|
-
}), this.addAscent(s.core.AssessEmission.ADDED, () => {
|
|
2953
|
-
this.descend(s.core.AssessEmission.ADDED);
|
|
2954
|
-
});
|
|
2955
|
-
}
|
|
2956
|
-
}
|
|
2957
|
-
const ks = { DOWNLOAD: s.internals.ns.selector("tile--download"), DOWNLOAD_DETAIL: `${s.internals.ns.selector("tile--download")} ${s.internals.ns.selector("tile__detail")}` };
|
|
2958
|
-
s.tile = { TileSelector: ks, TileDownload: Ps }, s.internals.register(s.tile.TileSelector.DOWNLOAD, s.tile.TileDownload), s.internals.register(s.tile.TileSelector.DOWNLOAD_DETAIL, s.core.AssessDetail);
|
|
2959
|
-
const _ = { RANGE: s.internals.ns.selector("range"), RANGE_SM: s.internals.ns.selector("range--sm"), RANGE_STEP: s.internals.ns.selector("range--step"), RANGE_DOUBLE: s.internals.ns.selector("range--double"), RANGE_DOUBLE_STEP: s.internals.ns.selector("range--double") + s.internals.ns.selector("range--step"), RANGE_INPUT: s.internals.ns.selector("range input[type=range]:nth-of-type(1)"), RANGE_INPUT2: `${s.internals.ns.selector("range--double")} input[type=range]:nth-of-type(2)`, RANGE_OUTPUT: s.internals.ns.selector("range__output"), RANGE_MIN: s.internals.ns.selector("range__min"), RANGE_MAX: s.internals.ns.selector("range__max"), RANGE_PREFIX: s.internals.ns.attr("prefix"), RANGE_SUFFIX: s.internals.ns.attr("suffix") }, m = { VALUE: s.internals.ns.emission("range", "value"), VALUE2: s.internals.ns.emission("range", "value2"), OUTPUT: s.internals.ns.emission("range", "output"), CONSTRAINTS: s.internals.ns.emission("range", "constraints"), MIN: s.internals.ns.emission("range", "min"), MAX: s.internals.ns.emission("range", "max"), STEP: s.internals.ns.emission("range", "step"), PREFIX: s.internals.ns.emission("range", "prefix"), SUFFIX: s.internals.ns.emission("range", "suffix"), DISABLED: s.internals.ns.emission("range", "disabled"), ENABLE_POINTER: s.internals.ns.emission("range", "enable_pointer") };
|
|
2960
|
-
class Nt {
|
|
2961
|
-
constructor() {
|
|
2962
|
-
this._width = 0, this._min = 0, this._max = 0, this._value = 0, this._thumbSize = 24, this._innerWidth = 0, this._prefix = "", this._suffix = "", this._background = {};
|
|
2963
|
-
}
|
|
2964
|
-
configure(t) {
|
|
2965
|
-
t && (this._prefix = t._prefix, this._suffix = t._suffix, this._width = t.width, this.setConstraints(t._constraints), this.value = t.value, this.update());
|
|
2966
|
-
}
|
|
2967
|
-
setPrefix(t) {
|
|
2968
|
-
this._prefix = t !== null ? t : "";
|
|
2969
|
-
}
|
|
2970
|
-
setSuffix(t) {
|
|
2971
|
-
this._suffix = t !== null ? t : "";
|
|
2972
|
-
}
|
|
2973
|
-
_decorate(t) {
|
|
2974
|
-
return `${this._prefix}${t}${this._suffix}`;
|
|
2975
|
-
}
|
|
2976
|
-
get width() {
|
|
2977
|
-
return this._width;
|
|
2978
|
-
}
|
|
2979
|
-
set width(t) {
|
|
2980
|
-
this._width = t;
|
|
2981
|
-
}
|
|
2982
|
-
get isSm() {
|
|
2983
|
-
return this._isSm;
|
|
2984
|
-
}
|
|
2985
|
-
set isSm(t) {
|
|
2986
|
-
this._isSm !== t && (this._isSm = t, this.setThumbSize(t ? 16 : 24), this.update());
|
|
2987
|
-
}
|
|
2988
|
-
setThumbSize(t, e = 1) {
|
|
2989
|
-
this._thumbSize = t, this._innerPadding = t * e;
|
|
2990
|
-
}
|
|
2991
|
-
get textValue() {
|
|
2992
|
-
return this._decorate(this._value);
|
|
2993
|
-
}
|
|
2994
|
-
get value() {
|
|
2995
|
-
return this._value;
|
|
2996
|
-
}
|
|
2997
|
-
set value(t) {
|
|
2998
|
-
this._value = t;
|
|
2999
|
-
}
|
|
3000
|
-
get outputX() {
|
|
3001
|
-
return this._outputX;
|
|
3002
|
-
}
|
|
3003
|
-
setConstraints(t) {
|
|
3004
|
-
this._constraints = t, this._min = t.min, this._max = t.max, this._step = t.step, this._rangeWidth = t.rangeWidth;
|
|
3005
|
-
}
|
|
3006
|
-
get min() {
|
|
3007
|
-
return this._min;
|
|
3008
|
-
}
|
|
3009
|
-
get textMin() {
|
|
3010
|
-
return this._decorate(this._min);
|
|
3011
|
-
}
|
|
3012
|
-
get max() {
|
|
3013
|
-
return this._max;
|
|
3014
|
-
}
|
|
3015
|
-
get textMax() {
|
|
3016
|
-
return this._decorate(this._max);
|
|
3017
|
-
}
|
|
3018
|
-
get step() {
|
|
3019
|
-
return this._step;
|
|
3020
|
-
}
|
|
3021
|
-
get output() {
|
|
3022
|
-
return { text: this.textValue, transform: `translateX(${this._translateX}px) translateX(-${this._centerPercent}%)` };
|
|
3023
|
-
}
|
|
3024
|
-
_getRatio(t) {
|
|
3025
|
-
return (t - this._min) / this._rangeWidth;
|
|
3026
|
-
}
|
|
3027
|
-
get progress() {
|
|
3028
|
-
return this._progress;
|
|
3029
|
-
}
|
|
3030
|
-
update() {
|
|
3031
|
-
this._update();
|
|
3032
|
-
}
|
|
3033
|
-
_update() {
|
|
3034
|
-
this._innerWidth = this._width - this._innerPadding;
|
|
3035
|
-
const t = this._getRatio(this._value);
|
|
3036
|
-
this._translateX = t * this._width, this._centerPercent = 100 * t, this._progress = { right: `${(this._innerWidth * t + 0.5 * this._innerPadding).toFixed(2)}px` };
|
|
3037
|
-
}
|
|
3038
|
-
}
|
|
3039
|
-
class Ms extends Nt {
|
|
3040
|
-
get stepWidth() {
|
|
3041
|
-
return `${this._stepWidth.toFixed(3)}px`;
|
|
3042
|
-
}
|
|
3043
|
-
_update() {
|
|
3044
|
-
super._update();
|
|
3045
|
-
const t = this._rangeWidth / this._step;
|
|
3046
|
-
for (this._stepWidth = this._innerWidth / t; this._stepWidth < 4; )
|
|
3047
|
-
this._stepWidth *= 2;
|
|
3048
|
-
}
|
|
3049
|
-
}
|
|
3050
|
-
class ge extends Nt {
|
|
3051
|
-
get value2() {
|
|
3052
|
-
return this._value;
|
|
3053
|
-
}
|
|
3054
|
-
set value2(t) {
|
|
3055
|
-
this._value2 !== t && (this._value2 = t, this.update());
|
|
3056
|
-
}
|
|
3057
|
-
get textValue() {
|
|
3058
|
-
return `${this._decorate(this._value)} - ${this._decorate(this._value2)}`;
|
|
3059
|
-
}
|
|
3060
|
-
setThumbSize(t) {
|
|
3061
|
-
super.setThumbSize(t, 2);
|
|
3062
|
-
}
|
|
3063
|
-
_update() {
|
|
3064
|
-
super._update();
|
|
3065
|
-
const t = this._getRatio(0.5 * (this._value + this._value2));
|
|
3066
|
-
this._translateX = t * this._width, this._centerPercent = 100 * t;
|
|
3067
|
-
const e = this._getRatio(this._value), n = this._getRatio(this._value2);
|
|
3068
|
-
this._progress = { left: `${(this._innerWidth * e + 0.25 * this._innerPadding).toFixed(2)}px`, right: `${(this._innerWidth * n + 0.75 * this._innerPadding).toFixed(2)}px` };
|
|
3069
|
-
}
|
|
3070
|
-
}
|
|
3071
|
-
class $s extends ge {
|
|
3072
|
-
get stepWidth() {
|
|
3073
|
-
return `${this._stepWidth.toFixed(3)}px`;
|
|
3074
|
-
}
|
|
3075
|
-
_update() {
|
|
3076
|
-
super._update();
|
|
3077
|
-
const t = this._rangeWidth / this._step;
|
|
3078
|
-
this._stepWidth = this._innerWidth / t, this._stepWidth < 4 && (this._stepWidth *= Math.ceil(4 / this._stepWidth));
|
|
3079
|
-
}
|
|
3080
|
-
}
|
|
3081
|
-
const Ft = "step", X = "double", ht = "double-step", Hs = "default";
|
|
3082
|
-
class Gs extends s.core.Instance {
|
|
3083
|
-
static get instanceClassName() {
|
|
3084
|
-
return "Range";
|
|
3085
|
-
}
|
|
3086
|
-
init() {
|
|
3087
|
-
this._retrieveType(), this._retrieveSize(), this.isLegacy ? (this.isResizing = !0, this.isMouseMoving = !0) : (this._observer = new ResizeObserver(this.resize.bind(this)), this._observer.observe(this.node)), this.addAscent(m.CONSTRAINTS, this.setConstraints.bind(this)), this.addAscent(m.VALUE, this.setValue.bind(this)), this.addAscent(m.VALUE2, this.setValue2.bind(this)), this.getAttribute(_.RANGE_PREFIX) && this.setPrefix(this.getAttribute(_.RANGE_PREFIX)), this.getAttribute(_.RANGE_SUFFIX) && this.setSuffix(this.getAttribute(_.RANGE_SUFFIX)), this.update();
|
|
3088
|
-
}
|
|
3089
|
-
_retrieveType() {
|
|
3090
|
-
switch (!0) {
|
|
3091
|
-
case this.matches(_.RANGE_DOUBLE_STEP):
|
|
3092
|
-
case this.matches(_.RANGE_DOUBLE):
|
|
3093
|
-
this.type = X;
|
|
3094
|
-
break;
|
|
3095
|
-
case this.matches(_.RANGE_STEP):
|
|
3096
|
-
this.type = Ft;
|
|
3097
|
-
break;
|
|
3098
|
-
default:
|
|
3099
|
-
this.type = Hs;
|
|
3100
|
-
}
|
|
3101
|
-
}
|
|
3102
|
-
set type(t) {
|
|
3103
|
-
if (this._type === t)
|
|
3104
|
-
return;
|
|
3105
|
-
this._type = t;
|
|
3106
|
-
const e = this._model;
|
|
3107
|
-
switch (this._type) {
|
|
3108
|
-
case ht:
|
|
3109
|
-
this._model = new $s();
|
|
3110
|
-
break;
|
|
3111
|
-
case X:
|
|
3112
|
-
this._model = new ge();
|
|
3113
|
-
break;
|
|
3114
|
-
case Ft:
|
|
3115
|
-
this._model = new Ms();
|
|
3116
|
-
break;
|
|
3117
|
-
default:
|
|
3118
|
-
this._model = new Nt();
|
|
3119
|
-
}
|
|
3120
|
-
this._model.configure(e);
|
|
3121
|
-
}
|
|
3122
|
-
get type() {
|
|
3123
|
-
return this._type;
|
|
3124
|
-
}
|
|
3125
|
-
_retrieveSize() {
|
|
3126
|
-
this._model.isSm = this.matches(_.RANGE_SM);
|
|
3127
|
-
}
|
|
3128
|
-
resize() {
|
|
3129
|
-
this._retrieveWidth(), this.update();
|
|
3130
|
-
}
|
|
3131
|
-
_retrieveWidth() {
|
|
3132
|
-
this._model.width = this.getRect().width;
|
|
3133
|
-
}
|
|
3134
|
-
setValue(t) {
|
|
3135
|
-
switch (this._model.value = t, this._type) {
|
|
3136
|
-
case ht:
|
|
3137
|
-
case X:
|
|
3138
|
-
this.descend(m.VALUE, t);
|
|
3139
|
-
}
|
|
3140
|
-
this.update();
|
|
3141
|
-
}
|
|
3142
|
-
setValue2(t) {
|
|
3143
|
-
this._model.value2 = t, this.descend(m.VALUE2, t), this.update();
|
|
3144
|
-
}
|
|
3145
|
-
setConstraints(t) {
|
|
3146
|
-
this._model.setConstraints(t), this.update(), this.descend(m.CONSTRAINTS, t);
|
|
3147
|
-
}
|
|
3148
|
-
setPrefix(t) {
|
|
3149
|
-
this._model.setPrefix(t), this.update();
|
|
3150
|
-
}
|
|
3151
|
-
setSuffix(t) {
|
|
3152
|
-
this._model.setSuffix(t), this.update();
|
|
3153
|
-
}
|
|
3154
|
-
mutate(t) {
|
|
3155
|
-
switch (!0) {
|
|
3156
|
-
case t.includes("class"):
|
|
3157
|
-
this._retrieveType(), this._retrieveSize();
|
|
3158
|
-
break;
|
|
3159
|
-
case t.includes(_.RANGE_PREFIX):
|
|
3160
|
-
case t.includes(_.RANGE_SUFFIX):
|
|
3161
|
-
this._model.setPrefix(this.getAttribute(_.RANGE_PREFIX)), this._model.setSuffix(this.getAttribute(_.RANGE_SUFFIX)), this.update();
|
|
3162
|
-
}
|
|
3163
|
-
}
|
|
3164
|
-
update() {
|
|
3165
|
-
this._model.update(), this.descend(m.OUTPUT, this._model.output), this.descend(m.MIN, this._model.textMin), this.descend(m.MAX, this._model.textMax);
|
|
3166
|
-
const t = this._model.progress;
|
|
3167
|
-
t.left ? this.style.setProperty("--progress-left", t.left) : this.style.removeProperty("--progress-left"), t.right ? (this.style.setProperty("--progress-right", t.right), this.isLegacy && t.left && (this.style.setProperty("background-position-x", t.left), this.style.setProperty("background-size", `${parseFloat(t.right) - parseFloat(t.left)}px ${this._model.isSm ? "8px" : "12px"}`))) : (this.style.removeProperty("--progress-right"), this.isLegacy && (this.style.removeProperty("background-size"), this.style.removeProperty("background-position-x"))), this._model.stepWidth ? this.style.setProperty("--step-width", this._model.stepWidth) : this.style.removeProperty("--step-width");
|
|
3168
|
-
}
|
|
3169
|
-
mouseMove(t) {
|
|
3170
|
-
if (this._type !== X && this._type !== ht)
|
|
3171
|
-
return;
|
|
3172
|
-
const e = t.x - this.getRect().left;
|
|
3173
|
-
this.descend(m.ENABLE_POINTER, (parseFloat(this._model.progress.right) - parseFloat(this._model.progress.left)) / 2 + parseFloat(this._model.progress.left) < e ? 2 : 1);
|
|
3174
|
-
}
|
|
3175
|
-
dispose() {
|
|
3176
|
-
this._observer.disconnect();
|
|
3177
|
-
}
|
|
3178
|
-
}
|
|
3179
|
-
class Wt {
|
|
3180
|
-
constructor(t) {
|
|
3181
|
-
this._min = isNaN(t.min) ? 0 : t.min, this._max = isNaN(t.max) ? 100 : t.max, this._step = isNaN(t.step) ? 1 : t.step, this._rangeWidth = this._max - this._min;
|
|
3182
|
-
}
|
|
3183
|
-
get min() {
|
|
3184
|
-
return this._min;
|
|
3185
|
-
}
|
|
3186
|
-
get max() {
|
|
3187
|
-
return this._max;
|
|
3188
|
-
}
|
|
3189
|
-
get step() {
|
|
3190
|
-
return this._step;
|
|
3191
|
-
}
|
|
3192
|
-
get rangeWidth() {
|
|
3193
|
-
return this._rangeWidth;
|
|
3194
|
-
}
|
|
3195
|
-
test(t, e, n) {
|
|
3196
|
-
return this._min === t && this._max === e && this._step === n;
|
|
3197
|
-
}
|
|
3198
|
-
}
|
|
3199
|
-
class qt extends s.core.Instance {
|
|
3200
|
-
static get instanceClassName() {
|
|
3201
|
-
return "RangeInput";
|
|
3202
|
-
}
|
|
3203
|
-
init() {
|
|
3204
|
-
this._init(), this.node.value = this.getAttribute("value"), this.changing = this.change.bind(this), this.node.addEventListener(this.isLegacy ? "change" : "input", this.changing), this.isLegacy && this.addDescent(m.ENABLE_POINTER, this._enablePointer.bind(this)), this.change();
|
|
3205
|
-
}
|
|
3206
|
-
_init() {
|
|
3207
|
-
this._pointerId = 1, this.request(() => {
|
|
3208
|
-
this.hasAttribute("min") || this.setAttribute("min", 0), this.ascend(m.CONSTRAINTS, new Wt(this.node)), this.ascend(m.DISABLED, this.node.disabled);
|
|
3209
|
-
}), this.addDescent(m.VALUE2, this.setValue.bind(this));
|
|
3210
|
-
}
|
|
3211
|
-
_enablePointer(t) {
|
|
3212
|
-
const e = t === this._pointerId;
|
|
3213
|
-
this._isPointerEnabled !== e && (this._isPointerEnabled = e, e ? this.style.removeProperty("pointer-events") : this.style.setProperty("pointer-events", "none"));
|
|
3214
|
-
}
|
|
3215
|
-
setValue(t) {
|
|
3216
|
-
parseFloat(this.node.value) > t && (this.node.value = t, this.change());
|
|
3217
|
-
}
|
|
3218
|
-
change() {
|
|
3219
|
-
this.ascend(m.VALUE, parseFloat(this.node.value));
|
|
3220
|
-
}
|
|
3221
|
-
mutate(t) {
|
|
3222
|
-
t.includes("disabled") && this.ascend(m.DISABLED, this.node.disabled), (t.includes("min") || t.includes("max") || t.includes("step")) && (this.ascend(m.CONSTRAINTS, new Wt(this.node)), this.change());
|
|
3223
|
-
}
|
|
3224
|
-
dispose() {
|
|
3225
|
-
this.removeEventListener("input", this.changing);
|
|
3226
|
-
}
|
|
3227
|
-
}
|
|
3228
|
-
class Us extends s.core.Instance {
|
|
3229
|
-
static get instanceClassName() {
|
|
3230
|
-
return "RangeOutput";
|
|
3231
|
-
}
|
|
3232
|
-
init() {
|
|
3233
|
-
this.addDescent(m.OUTPUT, this.change.bind(this));
|
|
3234
|
-
}
|
|
3235
|
-
change(t) {
|
|
3236
|
-
this.node.innerText = t.text, this.node.style.transform = t.transform;
|
|
3237
|
-
}
|
|
3238
|
-
}
|
|
3239
|
-
class Bs extends s.core.Instance {
|
|
3240
|
-
static get instanceClassName() {
|
|
3241
|
-
return "RangeLimit";
|
|
3242
|
-
}
|
|
3243
|
-
init() {
|
|
3244
|
-
switch (!0) {
|
|
3245
|
-
case this.matches(_.RANGE_MIN):
|
|
3246
|
-
this.addDescent(m.MIN, this.change.bind(this));
|
|
3247
|
-
break;
|
|
3248
|
-
case this.matches(_.RANGE_MAX):
|
|
3249
|
-
this.addDescent(m.MAX, this.change.bind(this));
|
|
3250
|
-
}
|
|
3251
|
-
}
|
|
3252
|
-
change(t) {
|
|
3253
|
-
this.node.innerText = t;
|
|
3254
|
-
}
|
|
3255
|
-
}
|
|
3256
|
-
s.range = { Range: Gs, RangeInput: qt, RangeInput2: class extends qt {
|
|
3257
|
-
static get instanceClassName() {
|
|
3258
|
-
return "RangeInput2";
|
|
3259
|
-
}
|
|
3260
|
-
_init() {
|
|
3261
|
-
this._pointerId = 2, this.addDescent(m.CONSTRAINTS, this.setConstraints.bind(this)), this.addDescent(m.VALUE, this.setValue.bind(this));
|
|
3262
|
-
}
|
|
3263
|
-
setValue(i) {
|
|
3264
|
-
parseFloat(this.node.value) < i && (this.node.value = i, this.change());
|
|
3265
|
-
}
|
|
3266
|
-
change() {
|
|
3267
|
-
this.ascend(m.VALUE2, parseFloat(this.node.value));
|
|
3268
|
-
}
|
|
3269
|
-
setConstraints(i) {
|
|
3270
|
-
this.node.min = i.min, this.node.max = i.max, this.node.step = i.step, this.change();
|
|
3271
|
-
}
|
|
3272
|
-
mutate(i) {
|
|
3273
|
-
}
|
|
3274
|
-
}, RangeOutput: Us, RangeLimit: Bs, RangeEmission: m, RangeSelector: _ }, s.internals.register(s.range.RangeSelector.RANGE, s.range.Range), s.internals.register(s.range.RangeSelector.RANGE_INPUT, s.range.RangeInput), s.internals.register(s.range.RangeSelector.RANGE_INPUT2, s.range.RangeInput2), s.internals.register(s.range.RangeSelector.RANGE_OUTPUT, s.range.RangeOutput), s.internals.register(s.range.RangeSelector.RANGE_MIN, s.range.RangeLimit), s.internals.register(s.range.RangeSelector.RANGE_MAX, s.range.RangeLimit);
|
|
3275
|
-
const J = { HEADER: s.internals.ns.selector("header"), TOOLS_LINKS: s.internals.ns.selector("header__tools-links"), MENU_LINKS: s.internals.ns.selector("header__menu-links"), BUTTONS: `${s.internals.ns.selector("header__tools-links")} ${s.internals.ns.selector("btns-group")}, ${s.internals.ns.selector("header__tools-links")} ${s.internals.ns.selector("links-group")}`, MODALS: `${s.internals.ns.selector("header__search")}${s.internals.ns.selector("modal")}, ${s.internals.ns.selector("header__menu")}${s.internals.ns.selector("modal")}` };
|
|
3276
|
-
class Fs extends s.core.Instance {
|
|
3277
|
-
static get instanceClassName() {
|
|
3278
|
-
return "HeaderLinks";
|
|
3279
|
-
}
|
|
3280
|
-
init() {
|
|
3281
|
-
const t = this.queryParentSelector(J.HEADER);
|
|
3282
|
-
this.toolsLinks = t.querySelector(J.TOOLS_LINKS), this.menuLinks = t.querySelector(J.MENU_LINKS);
|
|
3283
|
-
const e = "-mobile", n = this.toolsLinks.innerHTML.replace(/ +/g, " "), r = this.menuLinks.innerHTML.replace(/ +/g, " ");
|
|
3284
|
-
let a = n.replace(/id="(.*?)"/gm, 'id="$1' + e + '"');
|
|
3285
|
-
if (a = a.replace(/(<nav[.\s\S]*-translate [.\s\S]*) aria-controls="(.*?)"([.\s\S]*<\/nav>)/gm, '$1 aria-controls="$2' + e + '"$3'), a !== r)
|
|
3286
|
-
switch (s.mode) {
|
|
3287
|
-
case s.Modes.ANGULAR:
|
|
3288
|
-
case s.Modes.REACT:
|
|
3289
|
-
case s.Modes.VUE:
|
|
3290
|
-
this.warn(`header__tools-links content is different from header__menu-links content.
|
|
3291
|
-
As you're using a dynamic framework, you should handle duplication of this content yourself, please refer to documentation:
|
|
3292
|
-
${s.header.doc}`);
|
|
3293
|
-
break;
|
|
3294
|
-
default:
|
|
3295
|
-
this.menuLinks.innerHTML = a;
|
|
3296
|
-
}
|
|
3297
|
-
}
|
|
3298
|
-
}
|
|
3299
|
-
class Ws extends s.core.Instance {
|
|
3300
|
-
constructor() {
|
|
3301
|
-
super(), this._clickHandling = this.clickHandler.bind(this);
|
|
3302
|
-
}
|
|
3303
|
-
static get instanceClassName() {
|
|
3304
|
-
return "HeaderModal";
|
|
3305
|
-
}
|
|
3306
|
-
init() {
|
|
3307
|
-
this.isResizing = !0;
|
|
3308
|
-
}
|
|
3309
|
-
resize() {
|
|
3310
|
-
this.isBreakpoint(s.core.Breakpoints.LG) ? this.deactivateModal() : this.activateModal();
|
|
3311
|
-
}
|
|
3312
|
-
activateModal() {
|
|
3313
|
-
const t = this.element.getInstance("Modal");
|
|
3314
|
-
t && (t.isEnabled = !0, this.listen("click", this._clickHandling, { capture: !0 }));
|
|
3315
|
-
}
|
|
3316
|
-
deactivateModal() {
|
|
3317
|
-
const t = this.element.getInstance("Modal");
|
|
3318
|
-
t && (t.conceal(), t.isEnabled = !1, this.unlisten("click", this._clickHandling, { capture: !0 }));
|
|
3319
|
-
}
|
|
3320
|
-
clickHandler(t) {
|
|
3321
|
-
t.target.matches("a, button") && !t.target.matches("[aria-controls]") && !t.target.matches(s.core.DisclosureSelector.PREVENT_CONCEAL) && this.element.getInstance("Modal").conceal();
|
|
3322
|
-
}
|
|
3323
|
-
}
|
|
3324
|
-
s.header = { HeaderLinks: Fs, HeaderModal: Ws, HeaderSelector: J, doc: "https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/en-tete" }, s.internals.register(s.header.HeaderSelector.TOOLS_LINKS, s.header.HeaderLinks), s.internals.register(s.header.HeaderSelector.MODALS, s.header.HeaderModal);
|
|
3325
|
-
const St = { DISPLAY: s.internals.ns.selector("display"), RADIO_BUTTONS: `input[name="${s.internals.ns("radios-theme")}"]`, FIELDSET: s.internals.ns.selector("fieldset") };
|
|
3326
|
-
class qs extends s.core.Instance {
|
|
3327
|
-
static get instanceClassName() {
|
|
3328
|
-
return "Display";
|
|
3329
|
-
}
|
|
3330
|
-
init() {
|
|
3331
|
-
if (this.radios = this.querySelectorAll(St.RADIO_BUTTONS), s.scheme) {
|
|
3332
|
-
this.changing = this.change.bind(this);
|
|
3333
|
-
for (const t of this.radios)
|
|
3334
|
-
t.addEventListener("change", this.changing);
|
|
3335
|
-
this.addDescent(s.scheme.SchemeEmission.SCHEME, this.apply.bind(this)), this.ascend(s.scheme.SchemeEmission.ASK);
|
|
3336
|
-
} else
|
|
3337
|
-
this.querySelector(St.FIELDSET).setAttribute("disabled", "");
|
|
3338
|
-
}
|
|
3339
|
-
get scheme() {
|
|
3340
|
-
return this._scheme;
|
|
3341
|
-
}
|
|
3342
|
-
set scheme(t) {
|
|
3343
|
-
if (this._scheme !== t && s.scheme)
|
|
3344
|
-
switch (t) {
|
|
3345
|
-
case s.scheme.SchemeValue.SYSTEM:
|
|
3346
|
-
case s.scheme.SchemeValue.LIGHT:
|
|
3347
|
-
case s.scheme.SchemeValue.DARK:
|
|
3348
|
-
this._scheme = t;
|
|
3349
|
-
for (const e of this.radios)
|
|
3350
|
-
e.checked = e.value === t;
|
|
3351
|
-
this.ascend(s.scheme.SchemeEmission.SCHEME, t);
|
|
3352
|
-
}
|
|
3353
|
-
}
|
|
3354
|
-
change() {
|
|
3355
|
-
for (const t of this.radios)
|
|
3356
|
-
if (t.checked)
|
|
3357
|
-
return void (this.scheme = t.value);
|
|
3358
|
-
}
|
|
3359
|
-
apply(t) {
|
|
3360
|
-
this.scheme = t;
|
|
3361
|
-
}
|
|
3362
|
-
dispose() {
|
|
3363
|
-
for (const t of this.radios)
|
|
3364
|
-
t.removeEventListener("change", this.changing);
|
|
3365
|
-
}
|
|
3366
|
-
}
|
|
3367
|
-
s.display = { Display: qs, DisplaySelector: St }, s.internals.register(s.display.DisplaySelector.DISPLAY, s.display.Display);
|