@cobwds/cob-button 1.19.3 → 1.19.4
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/cob-button.js
CHANGED
|
@@ -1,24 +1,1019 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { property as
|
|
3
|
-
import { ifDefined as
|
|
1
|
+
import { unsafeCSS as fe, LitElement as bo, html as R } from "lit";
|
|
2
|
+
import { property as d, state as Mt } from "lit/decorators.js";
|
|
3
|
+
import { ifDefined as P } from "lit/directives/if-defined.js";
|
|
4
4
|
/*!
|
|
5
5
|
* █▄ █ █ █ █▀▀▀█ █▀▀▄ █▀▀▀█
|
|
6
6
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
7
7
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
8
8
|
*
|
|
9
|
-
* Button Component v1.19.
|
|
9
|
+
* Button Component v1.19.4
|
|
10
10
|
* Part of the City of Boston Web Design System
|
|
11
11
|
* Repository: https://github.com/CityOfBoston/nywds-poc
|
|
12
12
|
* License: MIT
|
|
13
13
|
*/
|
|
14
|
-
const _ = ':host{--_cob-button-width: fit-content;--_cob-button-height: var(--cob-size-600, 48px);--_cob-button-border-radius: var(--cob-radius-xl, 12px);--_cob-button-padding--y: calc( var(--cob-space-150, 12px) - var(--cob-border-width-md, 2px) );--_cob-button-cursor: pointer;--_cob-button-padding--x: calc( var(--cob-space-250, 20px) - var(--cob-border-width-md, 2px) );--_cob-button-gap: var(--cob-space-100, 8px);--_cob-button-justify-content: center;--_cob-button-border-style: solid;--_cob-button-border-width: var(--cob-border-width-md, 2px);--_cob-button-outline-width: var(--cob-border-width-md, 2px);--_cob-button-outline-offset: var(--cob-space-2px, 2px);--_cob-button-outline-color: var(--cob-color-focus, #004dd1);--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-theme, #1871bd) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-theme-strong, #125084) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-theme-stronger, #091f2f) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-neutral-10, #f6f6f6 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00);--_cob-button-font-size: var(--cob-font-size-ui-md, 16px);--_cob-button-font-weight: var(--cob-font-weight-semibold, 600);--_cob-button-line-height: var(--cob-font-lineheight-ui-md, 24px);--_cob-button-font-family: var( --cob-font-family-ui, var(--cob-font-family-serif, "Lora", "Georgia", "Times New Roman", serif) );--_cob-button-text-decoration: none;display:inline-flex;width:var(--_cob-button-width);vertical-align:middle}:host([size=sm]){--_cob-button-height: var(--cob-size-500, 40px);--_cob-button-padding--y: calc( var(--cob-space-100, 8px) - var(--cob-border-width-md, 2px) );--_cob-button-padding--x: calc( var(--cob-space-200, 16px) - var(--cob-border-width-md, 2px) )}:host([size=lg]){--_cob-button-height: var(--cob-size-700, 56px);--_cob-button-padding--y: calc( var(--cob-space-200, 16px) - var(--cob-border-width-md, 2px) );--_cob-button-padding--x: calc( var(--cob-space-300, 24px) - var(--cob-border-width-md, 2px) )}:host([fullWidth]){width:100%}:host([fullWidth]) .cob-button__linkwrapper{width:100%}:host([fullWidth]) .cob-button{width:100%}:host([variant=filled]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-theme, #1871bd) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-theme-strong, #125084) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--hover: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-theme-stronger, #091f2f) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-neutral-10, #f6f6f6 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1)}:host([variant=outline]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-surface, #ffffff) );--_cob-button-color: var(--cob-button-color, var(--cob-color-theme, #1871bd));--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-theme, #1871bd) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-theme-weaker, #d0e9fc) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-theme, #1871bd) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-theme, #1871bd) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-theme-weak, #cddde9) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-theme, #1871bd) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-theme, #1871bd) );--_cob-button-background-color--disabled: var(--cob-color-surface, #ffffff);--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-neutral-100, #d0d0ce)}:host([variant=text]){--_cob-button-height: fit-content;--_cob-button-border-radius: var(--cob-radius-md, 4px);--_cob-button-padding--y: var(--cob-space-2px, 2px);--_cob-button-padding--x: 0;--_cob-button-border-width: 0px;--_cob-button-text-decoration: underline;--_cob-button-text-decoration-thickness: var( --cob-font-decoration-thickness-regular, 7% );--_cob-button-text-decoration-thickness--hover: var( --cob-font-decoration-thickness-strong, 14% );--_cob-button-text-decoration-thickness--active: var( --cob-font-decoration-thickness-strong, 14% );--_cob-button-gap: var(--cob-space-50, 4px);--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var(--cob-button-color, var(--cob-color-link, #004dd1));--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-link-strong, #003ba1) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-link-strongest, #002971) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([variant=ghost]){--_cob-button-gap: var(--cob-space-50, 4px);--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var(--cob-button-color, var(--cob-color-text, #1b1b1b));--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-black-transparent-100, #0000001a) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text, #1b1b1b) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-black-transparent-200, #00000033) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text, #1b1b1b) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([variant=filled][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-surface, #ffffff) );--_cob-button-color: var(--cob-button-color, var(--cob-color-text, #1b1b1b));--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00);--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-neutral-100, #d0d0ce) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text, #1b1b1b) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-neutral-300, #a7a9ab) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text, #1b1b1b) );--_cob-button-background-color--disabled: var(--cob-color-text, #1b1b1b);--_cob-button-color--disabled: var(--cob-color-text-disabled, #62666a)}:host([variant=outline][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-surface-reverse, #1b1b1b) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-ink-reverse, #ffffff) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-surface-reverse, #1b1b1b) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse-weak, #d0d0ce) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-neutral-100, #d0d0ce) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-surface-reverse, #1b1b1b) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse-weaker, #bec0c1) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-neutral-300, #a7a9ab) );--_cob-button-background-color--disabled: var( --cob-color-surface-reverse, #1b1b1b );--_cob-button-color--disabled: var( --cob-color-text-reverse-disabled, #62666a );--_cob-button-border-color--disabled: var(--cob-color-neutral-600, #62666a)}:host([variant=text][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var( --cob-button-color, var(--cob-color-link-reverse, #a7a9ab) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-link-reverse-strong, #ededed) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-reverse-strongest, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var( --cob-color-text-reverse-disabled, #62666a );--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([variant=ghost][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-white-transparent-200, #ffffff33) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-white-transparent-300, #ffffff4d) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #62666a);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([inverted]){--_cob-button-outline-color: var(--cob-color-focus-reverse, #7aa5e7)}:host([circle]){--_cob-button-width: var(--_cob-button-height);--_cob-button-border-radius: var(--cob-radius-round, 1776px);--_cob-button-padding--y: 0;--_cob-button-padding--x: 0}:host([circle]) .cob-button{max-width:var(--_cob-button-height);max-height:var(--_cob-button-height)}.cob-button{width:var(--_cob-button-width);min-height:var(--_cob-button-height);border-radius:var(--_cob-button-border-radius);padding:var(--_cob-button-padding--y) var(--_cob-button-padding--x);display:flex;align-items:center;justify-content:var(--_cob-button-justify-content);gap:var(--_cob-button-gap);font-family:var(--_cob-button-font-family);font-size:var(--_cob-button-font-size);font-weight:var(--_cob-button-font-weight);line-height:var(--_cob-button-line-height);text-decoration:var(--_cob-button-text-decoration);box-sizing:border-box;background-color:var(--_cob-button-background-color);color:var(--_cob-button-color);border-color:var(--_cob-button-border-color);border-style:var(--_cob-button-border-style);border-width:var(--_cob-button-border-width);cursor:var(--_cob-button-cursor)}.cob-button:hover{background-color:var(--_cob-button-background-color--hover);color:var(--_cob-button-color--hover);border-color:var(--_cob-button-border-color--hover);text-decoration-thickness:var(--_cob-button-text-decoration-thickness--hover, auto)}.cob-button:active,.cob-button.active{background-color:var(--_cob-button-background-color--active);color:var(--_cob-button-color--active);border-color:var(--_cob-button-border-color--active);text-decoration-thickness:var(--_cob-button-text-decoration-thickness--active, auto)}.cob-button:disabled,a[disabled]{background-color:var(--_cob-button-background-color--disabled);color:var(--_cob-button-color--disabled);border-color:var(--_cob-button-border-color--disabled);--_cob-button-cursor: not-allowed}a[disabled]{pointer-events:none}.cob-button:focus-visible{outline-offset:var(--_cob-button-outline-offset);outline:solid var(--_cob-button-outline-width) var(--_cob-button-outline-color)}.cob-button__text{display:flex;align-items:center;-webkit-user-select:none;user-select:none}';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
/*!
|
|
15
|
+
* █▄ █ █ █ █▀▀▀█ █▀▀▄ █▀▀▀█
|
|
16
|
+
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
17
|
+
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
18
|
+
*
|
|
19
|
+
* Icon Component v1.19.4
|
|
20
|
+
* Part of the City of Boston Web Design System
|
|
21
|
+
* Repository: https://github.com/CityOfBoston/nywds-poc
|
|
22
|
+
* License: MIT
|
|
23
|
+
*/
|
|
24
|
+
const uo = globalThis.__nysIconRegistry ??= /* @__PURE__ */ new Map(), Lt = globalThis.__nysIconWatchers ??= /* @__PURE__ */ new Map();
|
|
25
|
+
let Yo = null, qo = null;
|
|
26
|
+
async function qe() {
|
|
27
|
+
return Yo || (qo ??= import("./cob-icon.library-BR0WCz7Q-CwcFQs-u.js").then(
|
|
28
|
+
(o) => Yo = o.default
|
|
29
|
+
), qo);
|
|
30
|
+
}
|
|
31
|
+
function Ke() {
|
|
32
|
+
if (globalThis.__nysIconDefaultRegistered || uo.has("default")) {
|
|
33
|
+
globalThis.__nysIconDefaultRegistered = !0;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
globalThis.__nysIconDefaultRegistered = !0, uo.set("default", {
|
|
37
|
+
resolver: async (o) => {
|
|
38
|
+
if (!o) return;
|
|
39
|
+
const e = (await qe())[o];
|
|
40
|
+
return e ? { type: "svg", content: e } : void 0;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function Xe(o) {
|
|
45
|
+
return Ke(), uo.get(o);
|
|
46
|
+
}
|
|
47
|
+
function Ko(o, e) {
|
|
48
|
+
Lt.has(o) || Lt.set(o, /* @__PURE__ */ new Set()), Lt.get(o).add(e);
|
|
49
|
+
}
|
|
50
|
+
function Xo(o, e) {
|
|
51
|
+
Lt.get(o)?.delete(e);
|
|
52
|
+
}
|
|
53
|
+
/*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */
|
|
54
|
+
function Vo(o, e) {
|
|
55
|
+
(e == null || e > o.length) && (e = o.length);
|
|
56
|
+
for (var c = 0, i = Array(e); c < e; c++) i[c] = o[c];
|
|
57
|
+
return i;
|
|
58
|
+
}
|
|
59
|
+
function Ve(o) {
|
|
60
|
+
if (Array.isArray(o)) return o;
|
|
61
|
+
}
|
|
62
|
+
function Ze(o, e) {
|
|
63
|
+
var c = o == null ? null : typeof Symbol < "u" && o[Symbol.iterator] || o["@@iterator"];
|
|
64
|
+
if (c != null) {
|
|
65
|
+
var i, l, u, A, ut = [], D = !0, Pt = !1;
|
|
66
|
+
try {
|
|
67
|
+
if (u = (c = c.call(o)).next, e !== 0) for (; !(D = (i = u.call(c)).done) && (ut.push(i.value), ut.length !== e); D = !0) ;
|
|
68
|
+
} catch ($t) {
|
|
69
|
+
Pt = !0, l = $t;
|
|
70
|
+
} finally {
|
|
71
|
+
try {
|
|
72
|
+
if (!D && c.return != null && (A = c.return(), Object(A) !== A)) return;
|
|
73
|
+
} finally {
|
|
74
|
+
if (Pt) throw l;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return ut;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function Je() {
|
|
81
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
82
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
83
|
+
}
|
|
84
|
+
function Qe(o, e) {
|
|
85
|
+
return Ve(o) || Ze(o, e) || tr(o, e) || Je();
|
|
86
|
+
}
|
|
87
|
+
function tr(o, e) {
|
|
88
|
+
if (o) {
|
|
89
|
+
if (typeof o == "string") return Vo(o, e);
|
|
90
|
+
var c = {}.toString.call(o).slice(8, -1);
|
|
91
|
+
return c === "Object" && o.constructor && (c = o.constructor.name), c === "Map" || c === "Set" ? Array.from(o) : c === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c) ? Vo(o, e) : void 0;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const de = Object.entries, Zo = Object.setPrototypeOf, or = Object.isFrozen, er = Object.getPrototypeOf, rr = Object.getOwnPropertyDescriptor;
|
|
95
|
+
let T = Object.freeze, E = Object.seal, bt = Object.create, he = typeof Reflect < "u" && Reflect, fo = he.apply, ho = he.construct;
|
|
96
|
+
T || (T = function(o) {
|
|
97
|
+
return o;
|
|
98
|
+
});
|
|
99
|
+
E || (E = function(o) {
|
|
100
|
+
return o;
|
|
101
|
+
});
|
|
102
|
+
fo || (fo = function(o, e) {
|
|
103
|
+
for (var c = arguments.length, i = new Array(c > 2 ? c - 2 : 0), l = 2; l < c; l++)
|
|
104
|
+
i[l - 2] = arguments[l];
|
|
105
|
+
return o.apply(e, i);
|
|
106
|
+
});
|
|
107
|
+
ho || (ho = function(o) {
|
|
108
|
+
for (var e = arguments.length, c = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
|
|
109
|
+
c[i - 1] = arguments[i];
|
|
110
|
+
return new o(...c);
|
|
111
|
+
});
|
|
112
|
+
const _t = S(Array.prototype.forEach), nr = S(Array.prototype.lastIndexOf), Jo = S(Array.prototype.pop), st = S(Array.prototype.push), cr = S(Array.prototype.splice), K = Array.isArray, kt = S(String.prototype.toLowerCase), no = S(String.prototype.toString), Qo = S(String.prototype.match), yt = S(String.prototype.replace), te = S(String.prototype.indexOf), ar = S(String.prototype.trim), ir = S(Number.prototype.toString), lr = S(Boolean.prototype.toString), oe = typeof BigInt > "u" ? null : S(BigInt.prototype.toString), ee = typeof Symbol > "u" ? null : S(Symbol.prototype.toString), k = S(Object.prototype.hasOwnProperty), xt = S(Object.prototype.toString), w = S(RegExp.prototype.test), et = sr(TypeError);
|
|
113
|
+
function S(o) {
|
|
114
|
+
return function(e) {
|
|
115
|
+
e instanceof RegExp && (e.lastIndex = 0);
|
|
116
|
+
for (var c = arguments.length, i = new Array(c > 1 ? c - 1 : 0), l = 1; l < c; l++)
|
|
117
|
+
i[l - 1] = arguments[l];
|
|
118
|
+
return fo(o, e, i);
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function sr(o) {
|
|
122
|
+
return function() {
|
|
123
|
+
for (var e = arguments.length, c = new Array(e), i = 0; i < e; i++)
|
|
124
|
+
c[i] = arguments[i];
|
|
125
|
+
return ho(o, c);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function b(o, e) {
|
|
129
|
+
let c = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : kt;
|
|
130
|
+
if (Zo && Zo(o, null), !K(e))
|
|
131
|
+
return o;
|
|
132
|
+
let i = e.length;
|
|
133
|
+
for (; i--; ) {
|
|
134
|
+
let l = e[i];
|
|
135
|
+
if (typeof l == "string") {
|
|
136
|
+
const u = c(l);
|
|
137
|
+
u !== l && (or(e) || (e[i] = u), l = u);
|
|
138
|
+
}
|
|
139
|
+
o[l] = !0;
|
|
140
|
+
}
|
|
141
|
+
return o;
|
|
142
|
+
}
|
|
143
|
+
function br(o) {
|
|
144
|
+
for (let e = 0; e < o.length; e++)
|
|
145
|
+
k(o, e) || (o[e] = null);
|
|
146
|
+
return o;
|
|
147
|
+
}
|
|
148
|
+
function C(o) {
|
|
149
|
+
const e = bt(null);
|
|
150
|
+
for (const i of de(o)) {
|
|
151
|
+
var c = Qe(i, 2);
|
|
152
|
+
const l = c[0], u = c[1];
|
|
153
|
+
k(o, l) && (K(u) ? e[l] = br(u) : u && typeof u == "object" && u.constructor === Object ? e[l] = C(u) : e[l] = u);
|
|
154
|
+
}
|
|
155
|
+
return e;
|
|
156
|
+
}
|
|
157
|
+
function ur(o) {
|
|
158
|
+
switch (typeof o) {
|
|
159
|
+
case "string":
|
|
160
|
+
return o;
|
|
161
|
+
case "number":
|
|
162
|
+
return ir(o);
|
|
163
|
+
case "boolean":
|
|
164
|
+
return lr(o);
|
|
165
|
+
case "bigint":
|
|
166
|
+
return oe ? oe(o) : "0";
|
|
167
|
+
case "symbol":
|
|
168
|
+
return ee ? ee(o) : "Symbol()";
|
|
169
|
+
case "undefined":
|
|
170
|
+
return xt(o);
|
|
171
|
+
case "function":
|
|
172
|
+
case "object": {
|
|
173
|
+
if (o === null)
|
|
174
|
+
return xt(o);
|
|
175
|
+
const e = o, c = F(e, "toString");
|
|
176
|
+
if (typeof c == "function") {
|
|
177
|
+
const i = c(e);
|
|
178
|
+
return typeof i == "string" ? i : xt(i);
|
|
179
|
+
}
|
|
180
|
+
return xt(o);
|
|
181
|
+
}
|
|
182
|
+
default:
|
|
183
|
+
return xt(o);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function F(o, e) {
|
|
187
|
+
for (; o !== null; ) {
|
|
188
|
+
const i = rr(o, e);
|
|
189
|
+
if (i) {
|
|
190
|
+
if (i.get)
|
|
191
|
+
return S(i.get);
|
|
192
|
+
if (typeof i.value == "function")
|
|
193
|
+
return S(i.value);
|
|
194
|
+
}
|
|
195
|
+
o = er(o);
|
|
196
|
+
}
|
|
197
|
+
function c() {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
return c;
|
|
201
|
+
}
|
|
202
|
+
function fr(o) {
|
|
203
|
+
try {
|
|
204
|
+
return w(o, ""), !0;
|
|
205
|
+
} catch {
|
|
206
|
+
return !1;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
const re = T(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), co = T(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), ao = T(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), dr = T(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), io = T(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), hr = T(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ne = T(["#text"]), ce = T(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), lo = T(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), ae = T(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), zt = T(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), pr = E(/{{[\w\W]*|^[\w\W]*}}/g), mr = E(/<%[\w\W]*|^[\w\W]*%>/g), vr = E(/\${[\w\W]*/g), gr = E(/^data-[\-\w.\u00B7-\uFFFF]+$/), _r = E(/^aria-[\-\w]+$/), ie = E(
|
|
210
|
+
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
211
|
+
// eslint-disable-line no-useless-escape
|
|
212
|
+
), yr = E(/^(?:\w+script|data):/i), xr = E(
|
|
213
|
+
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
214
|
+
// eslint-disable-line no-control-regex
|
|
215
|
+
), Sr = E(/^html$/i), kr = E(/^[a-z][.\w]*(-[.\w]+)+$/i), le = E(/<[/\w!]/g), wr = E(/<[/\w]/g), Tr = E(/<\/no(script|embed|frames)/i), Er = E(/\/>/i), $ = {
|
|
216
|
+
element: 1,
|
|
217
|
+
attribute: 2,
|
|
218
|
+
text: 3,
|
|
219
|
+
cdataSection: 4,
|
|
220
|
+
entityReference: 5,
|
|
221
|
+
// Deprecated
|
|
222
|
+
entityNode: 6,
|
|
223
|
+
// Deprecated
|
|
224
|
+
processingInstruction: 7,
|
|
225
|
+
comment: 8,
|
|
226
|
+
document: 9,
|
|
227
|
+
documentType: 10,
|
|
228
|
+
documentFragment: 11,
|
|
229
|
+
notation: 12
|
|
230
|
+
// Deprecated
|
|
231
|
+
}, Ar = function() {
|
|
232
|
+
return typeof window > "u" ? null : window;
|
|
233
|
+
}, Nr = function(o, e) {
|
|
234
|
+
if (typeof o != "object" || typeof o.createPolicy != "function")
|
|
235
|
+
return null;
|
|
236
|
+
let c = null;
|
|
237
|
+
const i = "data-tt-policy-suffix";
|
|
238
|
+
e && e.hasAttribute(i) && (c = e.getAttribute(i));
|
|
239
|
+
const l = "dompurify" + (c ? "#" + c : "");
|
|
240
|
+
try {
|
|
241
|
+
return o.createPolicy(l, {
|
|
242
|
+
createHTML(u) {
|
|
243
|
+
return u;
|
|
244
|
+
},
|
|
245
|
+
createScriptURL(u) {
|
|
246
|
+
return u;
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
} catch {
|
|
250
|
+
return console.warn("TrustedTypes policy " + l + " could not be created."), null;
|
|
251
|
+
}
|
|
252
|
+
}, se = function() {
|
|
253
|
+
return {
|
|
254
|
+
afterSanitizeAttributes: [],
|
|
255
|
+
afterSanitizeElements: [],
|
|
256
|
+
afterSanitizeShadowDOM: [],
|
|
257
|
+
beforeSanitizeAttributes: [],
|
|
258
|
+
beforeSanitizeElements: [],
|
|
259
|
+
beforeSanitizeShadowDOM: [],
|
|
260
|
+
uponSanitizeAttribute: [],
|
|
261
|
+
uponSanitizeElement: [],
|
|
262
|
+
uponSanitizeShadowNode: []
|
|
263
|
+
};
|
|
264
|
+
}, q = function(o, e, c, i) {
|
|
265
|
+
return k(o, e) && K(o[e]) ? b(i.base ? C(i.base) : {}, o[e], i.transform) : c;
|
|
266
|
+
};
|
|
267
|
+
function pe() {
|
|
268
|
+
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ar();
|
|
269
|
+
const e = (t) => pe(t);
|
|
270
|
+
if (e.version = "3.4.11", e.removed = [], !o || !o.document || o.document.nodeType !== $.document || !o.Element)
|
|
271
|
+
return e.isSupported = !1, e;
|
|
272
|
+
let c = o.document;
|
|
273
|
+
const i = c, l = i.currentScript;
|
|
274
|
+
o.DocumentFragment;
|
|
275
|
+
const u = o.HTMLTemplateElement, A = o.Node, ut = o.Element, D = o.NodeFilter;
|
|
276
|
+
o.NamedNodeMap === void 0 && (o.NamedNodeMap || o.MozNamedAttrMap), o.HTMLFormElement;
|
|
277
|
+
const $t = o.DOMParser, Tt = o.trustedTypes, V = ut.prototype, ve = F(V, "cloneNode"), po = F(V, "remove"), ge = F(V, "nextSibling"), ft = F(V, "childNodes"), dt = F(V, "parentNode"), mo = F(V, "shadowRoot"), Ft = F(V, "attributes"), z = A && A.prototype ? F(A.prototype, "nodeType") : null, j = A && A.prototype ? F(A.prototype, "nodeName") : null;
|
|
278
|
+
if (typeof u == "function") {
|
|
279
|
+
const t = c.createElement("template");
|
|
280
|
+
t.content && t.content.ownerDocument && (c = t.content.ownerDocument);
|
|
281
|
+
}
|
|
282
|
+
let I, Z = "", Ut, vo = !1, ht = 0;
|
|
283
|
+
const go = function() {
|
|
284
|
+
if (ht > 0)
|
|
285
|
+
throw et('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
|
|
286
|
+
}, rt = function(t) {
|
|
287
|
+
go(), ht++;
|
|
288
|
+
try {
|
|
289
|
+
return I.createHTML(t);
|
|
290
|
+
} finally {
|
|
291
|
+
ht--;
|
|
292
|
+
}
|
|
293
|
+
}, _e = function(t) {
|
|
294
|
+
go(), ht++;
|
|
295
|
+
try {
|
|
296
|
+
return I.createScriptURL(t);
|
|
297
|
+
} finally {
|
|
298
|
+
ht--;
|
|
299
|
+
}
|
|
300
|
+
}, ye = function() {
|
|
301
|
+
return vo || (Ut = Nr(Tt, l), vo = !0), Ut;
|
|
302
|
+
}, Et = c, Ht = Et.implementation, _o = Et.createNodeIterator, xe = Et.createDocumentFragment, Se = Et.getElementsByTagName, ke = i.importNode;
|
|
303
|
+
let x = se();
|
|
304
|
+
e.isSupported = typeof de == "function" && typeof dt == "function" && Ht && Ht.createHTMLDocument !== void 0;
|
|
305
|
+
const we = pr, Te = mr, Ee = vr, Ae = gr, Ne = _r, Ce = yr, yo = xr, Ie = kr;
|
|
306
|
+
let xo = ie, v = null;
|
|
307
|
+
const So = b({}, [...re, ...co, ...ao, ...io, ...ne]);
|
|
308
|
+
let g = null;
|
|
309
|
+
const ko = b({}, [...ce, ...lo, ...ae, ...zt]);
|
|
310
|
+
let _ = Object.seal(bt(null, {
|
|
311
|
+
tagNameCheck: {
|
|
312
|
+
writable: !0,
|
|
313
|
+
configurable: !1,
|
|
314
|
+
enumerable: !0,
|
|
315
|
+
value: null
|
|
316
|
+
},
|
|
317
|
+
attributeNameCheck: {
|
|
318
|
+
writable: !0,
|
|
319
|
+
configurable: !1,
|
|
320
|
+
enumerable: !0,
|
|
321
|
+
value: null
|
|
322
|
+
},
|
|
323
|
+
allowCustomizedBuiltInElements: {
|
|
324
|
+
writable: !0,
|
|
325
|
+
configurable: !1,
|
|
326
|
+
enumerable: !0,
|
|
327
|
+
value: !1
|
|
328
|
+
}
|
|
329
|
+
})), pt = null, wo = null;
|
|
330
|
+
const B = Object.seal(bt(null, {
|
|
331
|
+
tagCheck: {
|
|
332
|
+
writable: !0,
|
|
333
|
+
configurable: !1,
|
|
334
|
+
enumerable: !0,
|
|
335
|
+
value: null
|
|
336
|
+
},
|
|
337
|
+
attributeCheck: {
|
|
338
|
+
writable: !0,
|
|
339
|
+
configurable: !1,
|
|
340
|
+
enumerable: !0,
|
|
341
|
+
value: null
|
|
342
|
+
}
|
|
343
|
+
}));
|
|
344
|
+
let To = !0, jt = !0, Eo = !1, Ao = !0, G = !1, mt = !0, J = !1, Bt = !1, Gt = null, Wt = null, Yt = !1, nt = !1, At = !1, Nt = !1, No = !0, Co = !1;
|
|
345
|
+
const Io = "user-content-";
|
|
346
|
+
let qt = !0, Kt = !1, ct = {}, L = null;
|
|
347
|
+
const Xt = b({}, [
|
|
348
|
+
"annotation-xml",
|
|
349
|
+
"audio",
|
|
350
|
+
"colgroup",
|
|
351
|
+
"desc",
|
|
352
|
+
"foreignobject",
|
|
353
|
+
"head",
|
|
354
|
+
"iframe",
|
|
355
|
+
"math",
|
|
356
|
+
"mi",
|
|
357
|
+
"mn",
|
|
358
|
+
"mo",
|
|
359
|
+
"ms",
|
|
360
|
+
"mtext",
|
|
361
|
+
"noembed",
|
|
362
|
+
"noframes",
|
|
363
|
+
"noscript",
|
|
364
|
+
"plaintext",
|
|
365
|
+
"script",
|
|
366
|
+
// <selectedcontent> mirrors the selected <option>'s subtree, cloned by
|
|
367
|
+
// the UA (customizable <select>) — including any on* handlers — and the
|
|
368
|
+
// engine re-mirrors synchronously whenever a removal changes which
|
|
369
|
+
// option/selectedcontent is current, even inside DOMPurify's inert
|
|
370
|
+
// DOMParser document. Hoisting its children on removal re-inserts a fresh
|
|
371
|
+
// mirror target ahead of the walk, which the engine refills, looping
|
|
372
|
+
// forever (DoS) and amplifying output. Dropping its content on removal
|
|
373
|
+
// (rather than hoisting) breaks that cascade; the content is a duplicate
|
|
374
|
+
// of the option, which is sanitized on its own. See campaign-3 F1/F6.
|
|
375
|
+
"selectedcontent",
|
|
376
|
+
"style",
|
|
377
|
+
"svg",
|
|
378
|
+
"template",
|
|
379
|
+
"thead",
|
|
380
|
+
"title",
|
|
381
|
+
"video",
|
|
382
|
+
"xmp"
|
|
383
|
+
]);
|
|
384
|
+
let Oo = null;
|
|
385
|
+
const Ro = b({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
386
|
+
let Vt = null;
|
|
387
|
+
const Do = b({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Ct = "http://www.w3.org/1998/Math/MathML", It = "http://www.w3.org/2000/svg", M = "http://www.w3.org/1999/xhtml";
|
|
388
|
+
let at = M, Zt = !1, Jt = null;
|
|
389
|
+
const Oe = b({}, [Ct, It, M], no), zo = T(["mi", "mo", "mn", "ms", "mtext"]);
|
|
390
|
+
let Qt = b({}, zo);
|
|
391
|
+
const Lo = T(["annotation-xml"]);
|
|
392
|
+
let to = b({}, Lo);
|
|
393
|
+
const Re = b({}, ["title", "style", "font", "a", "script"]);
|
|
394
|
+
let vt = null;
|
|
395
|
+
const De = ["application/xhtml+xml", "text/html"], ze = "text/html";
|
|
396
|
+
let y = null, it = null;
|
|
397
|
+
const Le = c.createElement("form"), Mo = function(t) {
|
|
398
|
+
return t instanceof RegExp || t instanceof Function;
|
|
399
|
+
}, oo = function() {
|
|
400
|
+
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
401
|
+
if (it && it === t)
|
|
402
|
+
return;
|
|
403
|
+
(!t || typeof t != "object") && (t = {}), t = C(t), vt = // eslint-disable-next-line unicorn/prefer-includes
|
|
404
|
+
De.indexOf(t.PARSER_MEDIA_TYPE) === -1 ? ze : t.PARSER_MEDIA_TYPE, y = vt === "application/xhtml+xml" ? no : kt, v = q(t, "ALLOWED_TAGS", So, {
|
|
405
|
+
transform: y
|
|
406
|
+
}), g = q(t, "ALLOWED_ATTR", ko, {
|
|
407
|
+
transform: y
|
|
408
|
+
}), Jt = q(t, "ALLOWED_NAMESPACES", Oe, {
|
|
409
|
+
transform: no
|
|
410
|
+
}), Vt = q(t, "ADD_URI_SAFE_ATTR", Do, {
|
|
411
|
+
transform: y,
|
|
412
|
+
base: Do
|
|
413
|
+
}), Oo = q(t, "ADD_DATA_URI_TAGS", Ro, {
|
|
414
|
+
transform: y,
|
|
415
|
+
base: Ro
|
|
416
|
+
}), L = q(t, "FORBID_CONTENTS", Xt, {
|
|
417
|
+
transform: y
|
|
418
|
+
}), pt = q(t, "FORBID_TAGS", C({}), {
|
|
419
|
+
transform: y
|
|
420
|
+
}), wo = q(t, "FORBID_ATTR", C({}), {
|
|
421
|
+
transform: y
|
|
422
|
+
}), ct = k(t, "USE_PROFILES") ? t.USE_PROFILES && typeof t.USE_PROFILES == "object" ? C(t.USE_PROFILES) : t.USE_PROFILES : !1, To = t.ALLOW_ARIA_ATTR !== !1, jt = t.ALLOW_DATA_ATTR !== !1, Eo = t.ALLOW_UNKNOWN_PROTOCOLS || !1, Ao = t.ALLOW_SELF_CLOSE_IN_ATTR !== !1, G = t.SAFE_FOR_TEMPLATES || !1, mt = t.SAFE_FOR_XML !== !1, J = t.WHOLE_DOCUMENT || !1, nt = t.RETURN_DOM || !1, At = t.RETURN_DOM_FRAGMENT || !1, Nt = t.RETURN_TRUSTED_TYPE || !1, Yt = t.FORCE_BODY || !1, No = t.SANITIZE_DOM !== !1, Co = t.SANITIZE_NAMED_PROPS || !1, qt = t.KEEP_CONTENT !== !1, Kt = t.IN_PLACE || !1, xo = fr(t.ALLOWED_URI_REGEXP) ? t.ALLOWED_URI_REGEXP : ie, at = typeof t.NAMESPACE == "string" ? t.NAMESPACE : M, Qt = k(t, "MATHML_TEXT_INTEGRATION_POINTS") && t.MATHML_TEXT_INTEGRATION_POINTS && typeof t.MATHML_TEXT_INTEGRATION_POINTS == "object" ? C(t.MATHML_TEXT_INTEGRATION_POINTS) : b({}, zo), to = k(t, "HTML_INTEGRATION_POINTS") && t.HTML_INTEGRATION_POINTS && typeof t.HTML_INTEGRATION_POINTS == "object" ? C(t.HTML_INTEGRATION_POINTS) : b({}, Lo);
|
|
423
|
+
const r = k(t, "CUSTOM_ELEMENT_HANDLING") && t.CUSTOM_ELEMENT_HANDLING && typeof t.CUSTOM_ELEMENT_HANDLING == "object" ? C(t.CUSTOM_ELEMENT_HANDLING) : bt(null);
|
|
424
|
+
if (_ = bt(null), k(r, "tagNameCheck") && Mo(r.tagNameCheck) && (_.tagNameCheck = r.tagNameCheck), k(r, "attributeNameCheck") && Mo(r.attributeNameCheck) && (_.attributeNameCheck = r.attributeNameCheck), k(r, "allowCustomizedBuiltInElements") && typeof r.allowCustomizedBuiltInElements == "boolean" && (_.allowCustomizedBuiltInElements = r.allowCustomizedBuiltInElements), E(_), G && (jt = !1), At && (nt = !0), ct && (v = b({}, ne), g = bt(null), ct.html === !0 && (b(v, re), b(g, ce)), ct.svg === !0 && (b(v, co), b(g, lo), b(g, zt)), ct.svgFilters === !0 && (b(v, ao), b(g, lo), b(g, zt)), ct.mathMl === !0 && (b(v, io), b(g, ae), b(g, zt))), B.tagCheck = null, B.attributeCheck = null, k(t, "ADD_TAGS") && (typeof t.ADD_TAGS == "function" ? B.tagCheck = t.ADD_TAGS : K(t.ADD_TAGS) && (v === So && (v = C(v)), b(v, t.ADD_TAGS, y))), k(t, "ADD_ATTR") && (typeof t.ADD_ATTR == "function" ? B.attributeCheck = t.ADD_ATTR : K(t.ADD_ATTR) && (g === ko && (g = C(g)), b(g, t.ADD_ATTR, y))), k(t, "ADD_URI_SAFE_ATTR") && K(t.ADD_URI_SAFE_ATTR) && b(Vt, t.ADD_URI_SAFE_ATTR, y), k(t, "FORBID_CONTENTS") && K(t.FORBID_CONTENTS) && (L === Xt && (L = C(L)), b(L, t.FORBID_CONTENTS, y)), k(t, "ADD_FORBID_CONTENTS") && K(t.ADD_FORBID_CONTENTS) && (L === Xt && (L = C(L)), b(L, t.ADD_FORBID_CONTENTS, y)), qt && (v["#text"] = !0), J && b(v, ["html", "head", "body"]), v.table && (b(v, ["tbody"]), delete pt.tbody), t.TRUSTED_TYPES_POLICY) {
|
|
425
|
+
if (typeof t.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
426
|
+
throw et('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
427
|
+
if (typeof t.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
428
|
+
throw et('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
429
|
+
const n = I;
|
|
430
|
+
I = t.TRUSTED_TYPES_POLICY;
|
|
431
|
+
try {
|
|
432
|
+
Z = rt("");
|
|
433
|
+
} catch (a) {
|
|
434
|
+
throw I = n, a;
|
|
435
|
+
}
|
|
436
|
+
} else t.TRUSTED_TYPES_POLICY === null ? (I = void 0, Z = "") : (I === void 0 && (I = ye()), I && typeof Z == "string" && (Z = rt("")));
|
|
437
|
+
T && T(t), it = t;
|
|
438
|
+
}, Po = b({}, [...co, ...ao, ...dr]), $o = b({}, [...io, ...hr]), Me = function(t, r, n) {
|
|
439
|
+
return r.namespaceURI === M ? t === "svg" : r.namespaceURI === Ct ? t === "svg" && (n === "annotation-xml" || Qt[n]) : !!Po[t];
|
|
440
|
+
}, Pe = function(t, r, n) {
|
|
441
|
+
return r.namespaceURI === M ? t === "math" : r.namespaceURI === It ? t === "math" && to[n] : !!$o[t];
|
|
442
|
+
}, $e = function(t, r, n) {
|
|
443
|
+
return r.namespaceURI === It && !to[n] || r.namespaceURI === Ct && !Qt[n] ? !1 : !$o[t] && (Re[t] || !Po[t]);
|
|
444
|
+
}, Fe = function(t) {
|
|
445
|
+
let r = dt(t);
|
|
446
|
+
(!r || !r.tagName) && (r = {
|
|
447
|
+
namespaceURI: at,
|
|
448
|
+
tagName: "template"
|
|
449
|
+
});
|
|
450
|
+
const n = kt(t.tagName), a = kt(r.tagName);
|
|
451
|
+
return Jt[t.namespaceURI] ? t.namespaceURI === It ? Me(n, r, a) : t.namespaceURI === Ct ? Pe(n, r, a) : t.namespaceURI === M ? $e(n, r, a) : !!(vt === "application/xhtml+xml" && Jt[t.namespaceURI]) : !1;
|
|
452
|
+
}, Q = function(t) {
|
|
453
|
+
st(e.removed, {
|
|
454
|
+
element: t
|
|
455
|
+
});
|
|
456
|
+
try {
|
|
457
|
+
dt(t).removeChild(t);
|
|
458
|
+
} catch {
|
|
459
|
+
if (po(t), !dt(t))
|
|
460
|
+
throw et("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
461
|
+
}
|
|
462
|
+
}, Fo = function(t) {
|
|
463
|
+
const r = ft(t);
|
|
464
|
+
if (r) {
|
|
465
|
+
const a = [];
|
|
466
|
+
_t(r, (s) => {
|
|
467
|
+
st(a, s);
|
|
468
|
+
}), _t(a, (s) => {
|
|
469
|
+
try {
|
|
470
|
+
po(s);
|
|
471
|
+
} catch {
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
const n = Ft(t);
|
|
476
|
+
if (n)
|
|
477
|
+
for (let a = n.length - 1; a >= 0; --a) {
|
|
478
|
+
const s = n[a], f = s && s.name;
|
|
479
|
+
if (typeof f == "string")
|
|
480
|
+
try {
|
|
481
|
+
t.removeAttribute(f);
|
|
482
|
+
} catch {
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}, tt = function(t, r) {
|
|
486
|
+
try {
|
|
487
|
+
st(e.removed, {
|
|
488
|
+
attribute: r.getAttributeNode(t),
|
|
489
|
+
from: r
|
|
490
|
+
});
|
|
491
|
+
} catch {
|
|
492
|
+
st(e.removed, {
|
|
493
|
+
attribute: null,
|
|
494
|
+
from: r
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
if (r.removeAttribute(t), t === "is")
|
|
498
|
+
if (nt || At)
|
|
499
|
+
try {
|
|
500
|
+
Q(r);
|
|
501
|
+
} catch {
|
|
502
|
+
}
|
|
503
|
+
else
|
|
504
|
+
try {
|
|
505
|
+
r.setAttribute(t, "");
|
|
506
|
+
} catch {
|
|
507
|
+
}
|
|
508
|
+
}, Ue = function(t) {
|
|
509
|
+
const r = Ft(t);
|
|
510
|
+
if (r)
|
|
511
|
+
for (let n = r.length - 1; n >= 0; --n) {
|
|
512
|
+
const a = r[n], s = a && a.name;
|
|
513
|
+
if (!(typeof s != "string" || g[y(s)]))
|
|
514
|
+
try {
|
|
515
|
+
t.removeAttribute(s);
|
|
516
|
+
} catch {
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}, He = function(t) {
|
|
520
|
+
const r = [t];
|
|
521
|
+
for (; r.length > 0; ) {
|
|
522
|
+
const n = r.pop();
|
|
523
|
+
(z ? z(n) : n.nodeType) === $.element && Ue(n);
|
|
524
|
+
const a = ft(n);
|
|
525
|
+
if (a)
|
|
526
|
+
for (let s = a.length - 1; s >= 0; --s)
|
|
527
|
+
r.push(a[s]);
|
|
528
|
+
}
|
|
529
|
+
}, Uo = function(t) {
|
|
530
|
+
let r = null, n = null;
|
|
531
|
+
if (Yt)
|
|
532
|
+
t = "<remove></remove>" + t;
|
|
533
|
+
else {
|
|
534
|
+
const f = Qo(t, /^[\r\n\t ]+/);
|
|
535
|
+
n = f && f[0];
|
|
536
|
+
}
|
|
537
|
+
vt === "application/xhtml+xml" && at === M && (t = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + t + "</body></html>");
|
|
538
|
+
const a = I ? rt(t) : t;
|
|
539
|
+
if (at === M)
|
|
540
|
+
try {
|
|
541
|
+
r = new $t().parseFromString(a, vt);
|
|
542
|
+
} catch {
|
|
543
|
+
}
|
|
544
|
+
if (!r || !r.documentElement) {
|
|
545
|
+
r = Ht.createDocument(at, "template", null);
|
|
546
|
+
try {
|
|
547
|
+
r.documentElement.innerHTML = Zt ? Z : a;
|
|
548
|
+
} catch {
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
const s = r.body || r.documentElement;
|
|
552
|
+
return t && n && s.insertBefore(c.createTextNode(n), s.childNodes[0] || null), at === M ? Se.call(r, J ? "html" : "body")[0] : J ? r.documentElement : s;
|
|
553
|
+
}, Ho = function(t) {
|
|
554
|
+
return _o.call(
|
|
555
|
+
t.ownerDocument || t,
|
|
556
|
+
t,
|
|
557
|
+
// eslint-disable-next-line no-bitwise
|
|
558
|
+
D.SHOW_ELEMENT | D.SHOW_COMMENT | D.SHOW_TEXT | D.SHOW_PROCESSING_INSTRUCTION | D.SHOW_CDATA_SECTION,
|
|
559
|
+
null
|
|
560
|
+
);
|
|
561
|
+
}, Ot = function(t) {
|
|
562
|
+
return t = yt(t, we, " "), t = yt(t, Te, " "), t = yt(t, Ee, " "), t;
|
|
563
|
+
}, eo = function(t) {
|
|
564
|
+
var r;
|
|
565
|
+
t.normalize();
|
|
566
|
+
const n = _o.call(
|
|
567
|
+
t.ownerDocument || t,
|
|
568
|
+
t,
|
|
569
|
+
// eslint-disable-next-line no-bitwise
|
|
570
|
+
D.SHOW_TEXT | D.SHOW_COMMENT | D.SHOW_CDATA_SECTION | D.SHOW_PROCESSING_INSTRUCTION,
|
|
571
|
+
null
|
|
572
|
+
);
|
|
573
|
+
let a = n.nextNode();
|
|
574
|
+
for (; a; )
|
|
575
|
+
a.data = Ot(a.data), a = n.nextNode();
|
|
576
|
+
const s = (r = t.querySelectorAll) === null || r === void 0 ? void 0 : r.call(t, "template");
|
|
577
|
+
s && _t(s, (f) => {
|
|
578
|
+
lt(f.content) && eo(f.content);
|
|
579
|
+
});
|
|
580
|
+
}, Rt = function(t) {
|
|
581
|
+
const r = j ? j(t) : null;
|
|
582
|
+
return typeof r != "string" || y(r) !== "form" ? !1 : typeof t.nodeName != "string" || typeof t.textContent != "string" || typeof t.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
|
|
583
|
+
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
584
|
+
// makes the direct read diverge from the cached read; a clean form
|
|
585
|
+
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
586
|
+
// canonical NamedNodeMap.
|
|
587
|
+
t.attributes !== Ft(t) || typeof t.removeAttribute != "function" || typeof t.setAttribute != "function" || typeof t.namespaceURI != "string" || typeof t.insertBefore != "function" || typeof t.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
588
|
+
// returns the integer 1 for any Element regardless of realm; direct
|
|
589
|
+
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
590
|
+
// the named child element. Cheap addition — nodeType is read from
|
|
591
|
+
// an internal slot, no serialization cost — and removes a residual
|
|
592
|
+
// clobbering surface used by several mXSS / PI / comment branches
|
|
593
|
+
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
594
|
+
t.nodeType !== z(t) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
595
|
+
// "childNodes" shadows the prototype getter. Direct reads of
|
|
596
|
+
// form.childNodes from a clobbered form return the named child
|
|
597
|
+
// instead of the real NodeList, so any walk that reads it directly
|
|
598
|
+
// skips the form's real children. Compare the direct read to the
|
|
599
|
+
// cached Node.prototype getter — when the form's named-property
|
|
600
|
+
// getter intercepts the read, the two values differ and we flag
|
|
601
|
+
// the form. This catches every clobbering child type (input,
|
|
602
|
+
// select, etc.) regardless of whether the named child happens to
|
|
603
|
+
// carry a numeric .length, which a typeof-based probe would miss
|
|
604
|
+
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
605
|
+
t.childNodes !== ft(t);
|
|
606
|
+
}, lt = function(t) {
|
|
607
|
+
if (!z || typeof t != "object" || t === null)
|
|
608
|
+
return !1;
|
|
609
|
+
try {
|
|
610
|
+
return z(t) === $.documentFragment;
|
|
611
|
+
} catch {
|
|
612
|
+
return !1;
|
|
613
|
+
}
|
|
614
|
+
}, gt = function(t) {
|
|
615
|
+
if (!z || typeof t != "object" || t === null)
|
|
616
|
+
return !1;
|
|
617
|
+
try {
|
|
618
|
+
return typeof z(t) == "number";
|
|
619
|
+
} catch {
|
|
620
|
+
return !1;
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
function U(t, r, n) {
|
|
624
|
+
t.length !== 0 && _t(t, (a) => {
|
|
625
|
+
a.call(e, r, n, it);
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
const je = function(t, r) {
|
|
629
|
+
return !!(mt && t.hasChildNodes() && !gt(t.firstElementChild) && w(le, t.textContent) && w(le, t.innerHTML) || mt && t.namespaceURI === M && r === "style" && gt(t.firstElementChild) || t.nodeType === $.processingInstruction || mt && t.nodeType === $.comment && w(wr, t.data));
|
|
630
|
+
}, Be = function(t, r) {
|
|
631
|
+
if (!pt[r] && Go(r) && (_.tagNameCheck instanceof RegExp && w(_.tagNameCheck, r) || _.tagNameCheck instanceof Function && _.tagNameCheck(r)))
|
|
632
|
+
return !1;
|
|
633
|
+
if (qt && !L[r]) {
|
|
634
|
+
const n = dt(t), a = ft(t);
|
|
635
|
+
if (a && n) {
|
|
636
|
+
const s = a.length;
|
|
637
|
+
for (let f = s - 1; f >= 0; --f) {
|
|
638
|
+
const h = Kt ? a[f] : ve(a[f], !0);
|
|
639
|
+
n.insertBefore(h, ge(t));
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
return Q(t), !0;
|
|
644
|
+
}, jo = function(t) {
|
|
645
|
+
if (U(x.beforeSanitizeElements, t, null), Rt(t))
|
|
646
|
+
return Q(t), !0;
|
|
647
|
+
const r = y(j ? j(t) : t.nodeName);
|
|
648
|
+
if (U(x.uponSanitizeElement, t, {
|
|
649
|
+
tagName: r,
|
|
650
|
+
allowedTags: v
|
|
651
|
+
}), je(t, r))
|
|
652
|
+
return Q(t), !0;
|
|
653
|
+
if (pt[r] || !(B.tagCheck instanceof Function && B.tagCheck(r)) && !v[r])
|
|
654
|
+
return Be(t, r);
|
|
655
|
+
if ((z ? z(t) : t.nodeType) === $.element && !Fe(t) || (r === "noscript" || r === "noembed" || r === "noframes") && w(Tr, t.innerHTML))
|
|
656
|
+
return Q(t), !0;
|
|
657
|
+
if (G && t.nodeType === $.text) {
|
|
658
|
+
const n = Ot(t.textContent);
|
|
659
|
+
t.textContent !== n && (st(e.removed, {
|
|
660
|
+
element: t.cloneNode()
|
|
661
|
+
}), t.textContent = n);
|
|
662
|
+
}
|
|
663
|
+
return U(x.afterSanitizeElements, t, null), !1;
|
|
664
|
+
}, Bo = function(t, r, n) {
|
|
665
|
+
if (wo[r] || No && (r === "id" || r === "name") && (n in c || n in Le))
|
|
666
|
+
return !1;
|
|
667
|
+
const a = g[r] || B.attributeCheck instanceof Function && B.attributeCheck(r, t);
|
|
668
|
+
if (!(jt && w(Ae, r)) && !(To && w(Ne, r))) {
|
|
669
|
+
if (a) {
|
|
670
|
+
if (!Vt[r] && !w(xo, yt(n, yo, "")) && !((r === "src" || r === "xlink:href" || r === "href") && t !== "script" && te(n, "data:") === 0 && Oo[t]) && !(Eo && !w(Ce, yt(n, yo, ""))) && n)
|
|
671
|
+
return !1;
|
|
672
|
+
} else if (
|
|
673
|
+
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
674
|
+
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
675
|
+
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
676
|
+
!(Go(t) && (_.tagNameCheck instanceof RegExp && w(_.tagNameCheck, t) || _.tagNameCheck instanceof Function && _.tagNameCheck(t)) && (_.attributeNameCheck instanceof RegExp && w(_.attributeNameCheck, r) || _.attributeNameCheck instanceof Function && _.attributeNameCheck(r, t)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
677
|
+
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
678
|
+
r === "is" && _.allowCustomizedBuiltInElements && (_.tagNameCheck instanceof RegExp && w(_.tagNameCheck, n) || _.tagNameCheck instanceof Function && _.tagNameCheck(n)))
|
|
679
|
+
) return !1;
|
|
680
|
+
}
|
|
681
|
+
return !0;
|
|
682
|
+
}, Ge = b({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Go = function(t) {
|
|
683
|
+
return !Ge[kt(t)] && w(Ie, t);
|
|
684
|
+
}, We = function(t, r, n, a) {
|
|
685
|
+
if (I && typeof Tt == "object" && typeof Tt.getAttributeType == "function" && !n)
|
|
686
|
+
switch (Tt.getAttributeType(t, r)) {
|
|
687
|
+
case "TrustedHTML":
|
|
688
|
+
return rt(a);
|
|
689
|
+
case "TrustedScriptURL":
|
|
690
|
+
return _e(a);
|
|
691
|
+
}
|
|
692
|
+
return a;
|
|
693
|
+
}, Ye = function(t, r, n, a) {
|
|
694
|
+
try {
|
|
695
|
+
n ? t.setAttributeNS(n, r, a) : t.setAttribute(r, a), Rt(t) ? Q(t) : Jo(e.removed);
|
|
696
|
+
} catch {
|
|
697
|
+
tt(r, t);
|
|
698
|
+
}
|
|
699
|
+
}, Wo = function(t) {
|
|
700
|
+
U(x.beforeSanitizeAttributes, t, null);
|
|
701
|
+
const r = t.attributes;
|
|
702
|
+
if (!r || Rt(t))
|
|
703
|
+
return;
|
|
704
|
+
const n = {
|
|
705
|
+
attrName: "",
|
|
706
|
+
attrValue: "",
|
|
707
|
+
keepAttr: !0,
|
|
708
|
+
allowedAttributes: g,
|
|
709
|
+
forceKeepAttr: void 0
|
|
710
|
+
};
|
|
711
|
+
let a = r.length;
|
|
712
|
+
const s = y(t.nodeName);
|
|
713
|
+
for (; a--; ) {
|
|
714
|
+
const f = r[a], h = f.name, ot = f.namespaceURI, W = f.value, O = y(h), Y = W;
|
|
715
|
+
let N = h === "value" ? Y : ar(Y);
|
|
716
|
+
if (n.attrName = O, n.attrValue = N, n.keepAttr = !0, n.forceKeepAttr = void 0, U(x.uponSanitizeAttribute, t, n), N = n.attrValue, Co && (O === "id" || O === "name") && te(N, Io) !== 0 && (tt(h, t), N = Io + N), mt && w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, N)) {
|
|
717
|
+
tt(h, t);
|
|
718
|
+
continue;
|
|
719
|
+
}
|
|
720
|
+
if (O === "attributename" && Qo(N, "href")) {
|
|
721
|
+
tt(h, t);
|
|
722
|
+
continue;
|
|
723
|
+
}
|
|
724
|
+
if (!n.forceKeepAttr) {
|
|
725
|
+
if (!n.keepAttr) {
|
|
726
|
+
tt(h, t);
|
|
727
|
+
continue;
|
|
728
|
+
}
|
|
729
|
+
if (!Ao && w(Er, N)) {
|
|
730
|
+
tt(h, t);
|
|
731
|
+
continue;
|
|
732
|
+
}
|
|
733
|
+
if (G && (N = Ot(N)), !Bo(s, O, N)) {
|
|
734
|
+
tt(h, t);
|
|
735
|
+
continue;
|
|
736
|
+
}
|
|
737
|
+
N = We(s, O, ot, N), N !== Y && Ye(t, h, ot, N);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
U(x.afterSanitizeAttributes, t, null);
|
|
741
|
+
}, Dt = function(t) {
|
|
742
|
+
let r = null;
|
|
743
|
+
const n = Ho(t);
|
|
744
|
+
for (U(x.beforeSanitizeShadowDOM, t, null); r = n.nextNode(); )
|
|
745
|
+
if (U(x.uponSanitizeShadowNode, r, null), jo(r), Wo(r), lt(r.content) && Dt(r.content), (z ? z(r) : r.nodeType) === $.element) {
|
|
746
|
+
const a = mo(r);
|
|
747
|
+
lt(a) && (ro(a), Dt(a));
|
|
748
|
+
}
|
|
749
|
+
U(x.afterSanitizeShadowDOM, t, null);
|
|
750
|
+
}, ro = function(t) {
|
|
751
|
+
const r = [{
|
|
752
|
+
node: t,
|
|
753
|
+
shadow: null
|
|
754
|
+
}];
|
|
755
|
+
for (; r.length > 0; ) {
|
|
756
|
+
const n = r.pop();
|
|
757
|
+
if (n.shadow) {
|
|
758
|
+
Dt(n.shadow);
|
|
759
|
+
continue;
|
|
760
|
+
}
|
|
761
|
+
const a = n.node, s = (z ? z(a) : a.nodeType) === $.element, f = ft(a);
|
|
762
|
+
if (f)
|
|
763
|
+
for (let h = f.length - 1; h >= 0; --h)
|
|
764
|
+
r.push({
|
|
765
|
+
node: f[h],
|
|
766
|
+
shadow: null
|
|
767
|
+
});
|
|
768
|
+
if (s) {
|
|
769
|
+
const h = j ? j(a) : null;
|
|
770
|
+
if (typeof h == "string" && y(h) === "template") {
|
|
771
|
+
const ot = a.content;
|
|
772
|
+
lt(ot) && r.push({
|
|
773
|
+
node: ot,
|
|
774
|
+
shadow: null
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
if (s) {
|
|
779
|
+
const h = mo(a);
|
|
780
|
+
lt(h) && r.push({
|
|
781
|
+
node: null,
|
|
782
|
+
shadow: h
|
|
783
|
+
}, {
|
|
784
|
+
node: h,
|
|
785
|
+
shadow: null
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
};
|
|
790
|
+
return e.sanitize = function(t) {
|
|
791
|
+
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = null, a = null, s = null, f = null;
|
|
792
|
+
if (Zt = !t, Zt && (t = "<!-->"), typeof t != "string" && !gt(t) && (t = ur(t), typeof t != "string"))
|
|
793
|
+
throw et("dirty is not a string, aborting");
|
|
794
|
+
if (!e.isSupported)
|
|
795
|
+
return t;
|
|
796
|
+
Bt ? (v = Gt, g = Wt) : oo(r), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (v = C(v)), x.uponSanitizeAttribute.length > 0 && (g = C(g)), e.removed = [];
|
|
797
|
+
const h = Kt && typeof t != "string" && gt(t);
|
|
798
|
+
if (h) {
|
|
799
|
+
const O = j ? j(t) : t.nodeName;
|
|
800
|
+
if (typeof O == "string") {
|
|
801
|
+
const Y = y(O);
|
|
802
|
+
if (!v[Y] || pt[Y])
|
|
803
|
+
throw et("root node is forbidden and cannot be sanitized in-place");
|
|
804
|
+
}
|
|
805
|
+
if (Rt(t))
|
|
806
|
+
throw et("root node is clobbered and cannot be sanitized in-place");
|
|
807
|
+
try {
|
|
808
|
+
ro(t);
|
|
809
|
+
} catch (Y) {
|
|
810
|
+
throw Fo(t), Y;
|
|
811
|
+
}
|
|
812
|
+
} else if (gt(t))
|
|
813
|
+
n = Uo("<!---->"), a = n.ownerDocument.importNode(t, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? n = a : n.appendChild(a), ro(a);
|
|
814
|
+
else {
|
|
815
|
+
if (!nt && !G && !J && // eslint-disable-next-line unicorn/prefer-includes
|
|
816
|
+
t.indexOf("<") === -1)
|
|
817
|
+
return I && Nt ? rt(t) : t;
|
|
818
|
+
if (n = Uo(t), !n)
|
|
819
|
+
return nt ? null : Nt ? Z : "";
|
|
820
|
+
}
|
|
821
|
+
n && Yt && Q(n.firstChild);
|
|
822
|
+
const ot = Ho(h ? t : n);
|
|
823
|
+
try {
|
|
824
|
+
for (; s = ot.nextNode(); )
|
|
825
|
+
jo(s), Wo(s), lt(s.content) && Dt(s.content);
|
|
826
|
+
} catch (O) {
|
|
827
|
+
throw h && Fo(t), O;
|
|
828
|
+
}
|
|
829
|
+
if (h)
|
|
830
|
+
return _t(e.removed, (O) => {
|
|
831
|
+
O.element && He(O.element);
|
|
832
|
+
}), G && eo(t), t;
|
|
833
|
+
if (nt) {
|
|
834
|
+
if (G && eo(n), At)
|
|
835
|
+
for (f = xe.call(n.ownerDocument); n.firstChild; )
|
|
836
|
+
f.appendChild(n.firstChild);
|
|
837
|
+
else
|
|
838
|
+
f = n;
|
|
839
|
+
return (g.shadowroot || g.shadowrootmode) && (f = ke.call(i, f, !0)), f;
|
|
840
|
+
}
|
|
841
|
+
let W = J ? n.outerHTML : n.innerHTML;
|
|
842
|
+
return J && v["!doctype"] && n.ownerDocument && n.ownerDocument.doctype && n.ownerDocument.doctype.name && w(Sr, n.ownerDocument.doctype.name) && (W = "<!DOCTYPE " + n.ownerDocument.doctype.name + `>
|
|
843
|
+
` + W), G && (W = Ot(W)), I && Nt ? rt(W) : W;
|
|
844
|
+
}, e.setConfig = function() {
|
|
845
|
+
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
846
|
+
oo(t), Bt = !0, Gt = v, Wt = g;
|
|
847
|
+
}, e.clearConfig = function() {
|
|
848
|
+
it = null, Bt = !1, Gt = null, Wt = null, I = Ut, Z = "";
|
|
849
|
+
}, e.isValidAttribute = function(t, r, n) {
|
|
850
|
+
it || oo({});
|
|
851
|
+
const a = y(t), s = y(r);
|
|
852
|
+
return Bo(a, s, n);
|
|
853
|
+
}, e.addHook = function(t, r) {
|
|
854
|
+
typeof r == "function" && k(x, t) && st(x[t], r);
|
|
855
|
+
}, e.removeHook = function(t, r) {
|
|
856
|
+
if (k(x, t)) {
|
|
857
|
+
if (r !== void 0) {
|
|
858
|
+
const n = nr(x[t], r);
|
|
859
|
+
return n === -1 ? void 0 : cr(x[t], n, 1)[0];
|
|
860
|
+
}
|
|
861
|
+
return Jo(x[t]);
|
|
862
|
+
}
|
|
863
|
+
}, e.removeHooks = function(t) {
|
|
864
|
+
k(x, t) && (x[t] = []);
|
|
865
|
+
}, e.removeAllHooks = function() {
|
|
866
|
+
x = se();
|
|
867
|
+
}, e;
|
|
868
|
+
}
|
|
869
|
+
var Cr = pe();
|
|
870
|
+
const so = /* @__PURE__ */ new Map(), be = /* @__PURE__ */ new Map();
|
|
871
|
+
function Ir(o) {
|
|
872
|
+
o.querySelectorAll("g[mask]").forEach((e) => {
|
|
873
|
+
e.removeAttribute("mask");
|
|
874
|
+
}), o.querySelectorAll("mask").forEach((e) => {
|
|
875
|
+
e.remove();
|
|
876
|
+
});
|
|
877
|
+
}
|
|
878
|
+
function me(o, e) {
|
|
879
|
+
const c = Cr.sanitize(o, {
|
|
880
|
+
USE_PROFILES: { svg: !0, svgFilters: !0 },
|
|
881
|
+
FORBID_TAGS: ["script", "use"],
|
|
882
|
+
// <use> can SSRF to external hrefs
|
|
883
|
+
FORBID_ATTR: ["onload", "onerror", "onbegin", "href", "xlink:href"]
|
|
884
|
+
}), i = new DOMParser().parseFromString(c, "image/svg+xml").documentElement;
|
|
885
|
+
if (!(i instanceof SVGElement))
|
|
886
|
+
throw new Error(`Invalid SVG from ${e}`);
|
|
887
|
+
return Ir(i), i;
|
|
888
|
+
}
|
|
889
|
+
async function Or(o) {
|
|
890
|
+
const e = await fetch(o);
|
|
891
|
+
if (!e.ok)
|
|
892
|
+
throw new Error(`Failed to load icon: ${e.status}`);
|
|
893
|
+
return me(await e.text(), o);
|
|
894
|
+
}
|
|
895
|
+
async function ue(o) {
|
|
896
|
+
return so.has(o) || so.set(o, Or(o)), (await so.get(o)).cloneNode(!0);
|
|
897
|
+
}
|
|
898
|
+
function Rr(o) {
|
|
899
|
+
let e = be.get(o);
|
|
900
|
+
return e || (e = me(o, "inline SVG source"), be.set(o, e)), e.cloneNode(!0);
|
|
901
|
+
}
|
|
902
|
+
const Dr = ":host{display:inline-block;width:fit-content;height:fit-content;--_cob-icon-size: var( --cob-icon-size, .7em );box-sizing:content-box!important;vertical-align:middle}@supports (font-size: 1cap){:host{--_cob-icon-size: var(--cob-icon-size, 1cap)}}.cob-icon--svg{width:var(--_cob-icon-size, 1em);height:var(--_cob-icon-size, 1em);display:block;white-space:nowrap}.cob-icon--xs{width:calc(var(--_cob-icon-size) * .75);height:calc(var(--_cob-icon-size) * .75)}.cob-icon--sm{width:calc(var(--_cob-icon-size) * .875);height:calc(var(--_cob-icon-size) * .875)}.cob-icon--md{width:var(--_cob-icon-size);height:var(--_cob-icon-size)}.cob-icon--lg{width:calc(var(--_cob-icon-size) * 1.125);height:calc(var(--_cob-icon-size) * 1.125)}.cob-icon--xl{width:calc(var(--_cob-icon-size) * 1.25);height:calc(var(--_cob-icon-size) * 1.25)}.cob-icon--2xl{width:calc(var(--_cob-icon-size) * 1.5);height:calc(var(--_cob-icon-size) * 1.5)}.cob-icon--3xl{width:calc(var(--_cob-icon-size) * 1.875);height:calc(var(--_cob-icon-size) * 1.875)}.cob-icon--4xl{width:calc(var(--_cob-icon-size) * 2.25);height:calc(var(--_cob-icon-size) * 2.25)}.cob-icon--5xl{width:calc(var(--_cob-icon-size) * 3);height:calc(var(--_cob-icon-size) * 3)}.cob-icon--12{width:.75rem;height:.75rem}.cob-icon--14{width:.875rem;height:.875rem}.cob-icon--16{width:1rem;height:1rem}.cob-icon--18{width:1.125rem;height:1.125rem}.cob-icon--20{width:1.25rem;height:1.25rem}.cob-icon--24{width:1.5rem;height:1.5rem}.cob-icon--32{width:2rem;height:2rem}.cob-icon--40{width:2.5rem;height:2.5rem}.cob-icon--50{width:3.125rem;height:3.125rem}.cob-icon--flip-horizontal{transform:scaleX(-1)}.cob-icon--flip-vertical{transform:scaleY(-1)}.cob-icon--flip-both{transform:scale(-1)}";
|
|
903
|
+
var zr = Object.defineProperty, X = (o, e, c, i) => {
|
|
904
|
+
for (var l = void 0, u = o.length - 1, A; u >= 0; u--)
|
|
905
|
+
(A = o[u]) && (l = A(e, c, l) || l);
|
|
906
|
+
return l && zr(e, c, l), l;
|
|
907
|
+
}, St;
|
|
908
|
+
const H = (St = class extends bo {
|
|
909
|
+
constructor() {
|
|
910
|
+
super(...arguments), this.name = "", this.library = "default", this.ariaLabel = "", this.rotate = "0", this.flip = "", this.color = "", this.size = "md", this._svg = null, this._loadSeq = 0, this._loadPromise = null;
|
|
911
|
+
}
|
|
912
|
+
/** Resolves when the current icon load (if any) is complete. */
|
|
913
|
+
get updateComplete() {
|
|
914
|
+
return (async () => {
|
|
915
|
+
const o = await super.updateComplete;
|
|
916
|
+
return await this._loadPromise, o;
|
|
917
|
+
})();
|
|
918
|
+
}
|
|
919
|
+
connectedCallback() {
|
|
920
|
+
super.connectedCallback(), Ko(this.library, this);
|
|
921
|
+
}
|
|
922
|
+
disconnectedCallback() {
|
|
923
|
+
super.disconnectedCallback(), Xo(this.library, this);
|
|
924
|
+
}
|
|
925
|
+
/** Called by the icon library registry when the current library changes. */
|
|
926
|
+
redraw() {
|
|
927
|
+
this._loadIcon();
|
|
928
|
+
}
|
|
929
|
+
/**
|
|
930
|
+
* Lit calls firstUpdated after the first render, once all reactive
|
|
931
|
+
* properties (including those set from the template) are resolved.
|
|
932
|
+
* This guarantees the initial _loadIcon runs with the correct name
|
|
933
|
+
* and library values, avoiding the race where updated() might not
|
|
934
|
+
* fire for properties that equal their defaults.
|
|
935
|
+
*/
|
|
936
|
+
firstUpdated() {
|
|
937
|
+
this._loadIcon();
|
|
938
|
+
}
|
|
939
|
+
updated(o) {
|
|
940
|
+
if (o.has("name") && !St._validName.test(this.name)) {
|
|
941
|
+
console.warn(`cob-icon: invalid name "${this.name}" — ignored`), this._svg = null;
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
if (o.has("name") || o.has("library")) {
|
|
945
|
+
if (o.has("library")) {
|
|
946
|
+
const e = o.get("library");
|
|
947
|
+
e && Xo(e, this), Ko(this.library, this);
|
|
948
|
+
}
|
|
949
|
+
this._loadIcon();
|
|
950
|
+
}
|
|
951
|
+
this._svg && (o.has("ariaLabel") || o.has("rotate") || o.has("flip") || o.has("color") || o.has("size")) && this._applyAttributes(this._svg);
|
|
952
|
+
}
|
|
953
|
+
_loadIcon() {
|
|
954
|
+
const o = ++this._loadSeq;
|
|
955
|
+
this._loadPromise = (async () => {
|
|
956
|
+
const e = Xe(this.library);
|
|
957
|
+
if (!e || !this.name) {
|
|
958
|
+
this._svg = null;
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
try {
|
|
962
|
+
const c = await e.resolver(this.name);
|
|
963
|
+
if (o !== this._loadSeq) return;
|
|
964
|
+
if (!c) {
|
|
965
|
+
this._svg = null;
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
968
|
+
const i = typeof c == "string" ? await ue(c) : c.type === "url" ? await ue(c.href) : Rr(c.content);
|
|
969
|
+
if (o !== this._loadSeq) return;
|
|
970
|
+
e.mutator?.(i), this._applyAttributes(i), this._svg = i;
|
|
971
|
+
} catch {
|
|
972
|
+
o === this._loadSeq && (this._svg = null);
|
|
973
|
+
}
|
|
974
|
+
})();
|
|
975
|
+
}
|
|
976
|
+
_applyAttributes(o) {
|
|
977
|
+
o.setAttribute("role", "img"), this.ariaLabel ? (o.setAttribute("aria-label", this.ariaLabel), o.removeAttribute("aria-hidden")) : (o.setAttribute("aria-hidden", "true"), o.removeAttribute("aria-label")), this.rotate && this.rotate !== "0" ? o.style.rotate = `${this.rotate}deg` : o.style.removeProperty("rotate"), o.style.color = this.color || "currentcolor", o.classList.add(`cob-icon--${this.size}`), o.classList.add("cob-icon--svg"), this.flip && o.classList.add(`cob-icon--flip-${this.flip}`);
|
|
978
|
+
}
|
|
979
|
+
render() {
|
|
980
|
+
return this._svg ? R`${this._svg}` : null;
|
|
981
|
+
}
|
|
982
|
+
}, St.styles = fe(Dr), St._validName = /^[a-zA-Z0-9_-]+$/, St);
|
|
983
|
+
X([
|
|
984
|
+
d({ type: String, reflect: !0 })
|
|
985
|
+
], H.prototype, "name");
|
|
986
|
+
X([
|
|
987
|
+
d({ type: String, reflect: !0 })
|
|
988
|
+
], H.prototype, "library");
|
|
989
|
+
X([
|
|
990
|
+
d({ type: String })
|
|
991
|
+
], H.prototype, "ariaLabel");
|
|
992
|
+
X([
|
|
993
|
+
d({ type: String })
|
|
994
|
+
], H.prototype, "rotate");
|
|
995
|
+
X([
|
|
996
|
+
d({ type: String })
|
|
997
|
+
], H.prototype, "flip");
|
|
998
|
+
X([
|
|
999
|
+
d({ type: String })
|
|
1000
|
+
], H.prototype, "color");
|
|
1001
|
+
X([
|
|
1002
|
+
d({ type: String })
|
|
1003
|
+
], H.prototype, "size");
|
|
1004
|
+
X([
|
|
1005
|
+
Mt()
|
|
1006
|
+
], H.prototype, "_svg");
|
|
1007
|
+
let Lr = H;
|
|
1008
|
+
customElements.get("cob-icon") || customElements.define("cob-icon", Lr);
|
|
1009
|
+
const Mr = ':host{--_cob-button-width: fit-content;--_cob-button-height: var(--cob-size-600, 48px);--_cob-button-border-radius: var(--cob-radius-xl, 12px);--_cob-button-padding--y: calc( var(--cob-space-150, 12px) - var(--cob-border-width-md, 2px) );--_cob-button-cursor: pointer;--_cob-button-padding--x: calc( var(--cob-space-250, 20px) - var(--cob-border-width-md, 2px) );--_cob-button-gap: var(--cob-space-100, 8px);--_cob-button-justify-content: center;--_cob-button-border-style: solid;--_cob-button-border-width: var(--cob-border-width-md, 2px);--_cob-button-outline-width: var(--cob-border-width-md, 2px);--_cob-button-outline-offset: var(--cob-space-2px, 2px);--_cob-button-outline-color: var(--cob-color-focus, #004dd1);--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-theme, #1871bd) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-theme-strong, #125084) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-theme-stronger, #091f2f) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-neutral-10, #f6f6f6 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00);--_cob-button-font-size: var(--cob-font-size-ui-md, 16px);--_cob-button-font-weight: var(--cob-font-weight-semibold, 600);--_cob-button-line-height: var(--cob-font-lineheight-ui-md, 24px);--_cob-button-font-family: var( --cob-font-family-ui, var(--cob-font-family-serif, "Lora", "Georgia", "Times New Roman", serif) );--_cob-button-text-decoration: none;display:inline-flex;width:var(--_cob-button-width);vertical-align:middle}:host([size=sm]){--_cob-button-height: var(--cob-size-500, 40px);--_cob-button-padding--y: calc( var(--cob-space-100, 8px) - var(--cob-border-width-md, 2px) );--_cob-button-padding--x: calc( var(--cob-space-200, 16px) - var(--cob-border-width-md, 2px) )}:host([size=lg]){--_cob-button-height: var(--cob-size-700, 56px);--_cob-button-padding--y: calc( var(--cob-space-200, 16px) - var(--cob-border-width-md, 2px) );--_cob-button-padding--x: calc( var(--cob-space-300, 24px) - var(--cob-border-width-md, 2px) )}:host([fullWidth]){width:100%}:host([fullWidth]) .cob-button__linkwrapper{width:100%}:host([fullWidth]) .cob-button{width:100%}:host([variant=filled]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-theme, #1871bd) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-theme-strong, #125084) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--hover: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-theme-stronger, #091f2f) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-neutral-10, #f6f6f6 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1)}:host([variant=outline]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-surface, #ffffff) );--_cob-button-color: var(--cob-button-color, var(--cob-color-theme, #1871bd));--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-theme, #1871bd) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-theme-weaker, #d0e9fc) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-theme-strong, #125084) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-theme-strong, #125084) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-theme-weak, #cddde9) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-theme-strong, #125084) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-theme-strong, #125084) );--_cob-button-background-color--disabled: var(--cob-color-surface, #ffffff);--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-neutral-100, #d0d0ce)}:host([variant=text]){--_cob-button-height: fit-content;--_cob-button-border-radius: var(--cob-radius-md, 4px);--_cob-button-padding--y: var(--cob-space-2px, 2px);--_cob-button-padding--x: 0;--_cob-button-border-width: 0px;--_cob-button-text-decoration: underline;--_cob-button-text-decoration-thickness: var( --cob-font-decoration-thickness-regular, 7% );--_cob-button-text-decoration-thickness--hover: var( --cob-font-decoration-thickness-strong, 14% );--_cob-button-text-decoration-thickness--active: var( --cob-font-decoration-thickness-strong, 14% );--_cob-button-gap: var(--cob-space-50, 4px);--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var(--cob-button-color, var(--cob-color-link, #004dd1));--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-link-strong, #003ba1) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-link-strongest, #002971) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([variant=ghost]){--_cob-button-gap: var(--cob-space-50, 4px);--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var(--cob-button-color, var(--cob-color-text, #1b1b1b));--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-black-transparent-100, #0000001a) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text, #1b1b1b) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-black-transparent-200, #00000033) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text, #1b1b1b) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([variant=filled][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-surface, #ffffff) );--_cob-button-color: var(--cob-button-color, var(--cob-color-text, #1b1b1b));--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00);--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-neutral-100, #d0d0ce) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text, #1b1b1b) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-neutral-300, #a7a9ab) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text, #1b1b1b) );--_cob-button-background-color--disabled: var(--cob-color-text, #1b1b1b);--_cob-button-color--disabled: var(--cob-color-text-disabled, #62666a)}:host([variant=outline][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-surface-reverse, #1b1b1b) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-ink-reverse, #ffffff) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-surface-reverse, #1b1b1b) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse-weak, #d0d0ce) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-neutral-100, #d0d0ce) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-surface-reverse, #1b1b1b) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse-weaker, #bec0c1) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-neutral-300, #a7a9ab) );--_cob-button-background-color--disabled: var( --cob-color-surface-reverse, #1b1b1b );--_cob-button-color--disabled: var( --cob-color-text-reverse-disabled, #62666a );--_cob-button-border-color--disabled: var(--cob-color-neutral-600, #62666a)}:host([variant=text][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var( --cob-button-color, var(--cob-color-link-reverse, #a7a9ab) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-link-reverse-strong, #ededed) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-reverse-strongest, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var( --cob-color-text-reverse-disabled, #62666a );--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([variant=ghost][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-white-transparent-200, #ffffff33) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-white-transparent-300, #ffffff4d) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #62666a);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([inverted]){--_cob-button-outline-color: var(--cob-color-focus-reverse, #7aa5e7)}:host([circle]){--_cob-button-width: var(--_cob-button-height);--_cob-button-border-radius: var(--cob-radius-round, 1776px);--_cob-button-padding--y: 0;--_cob-button-padding--x: 0}:host([circle]) .cob-button{max-width:var(--_cob-button-height);max-height:var(--_cob-button-height)}.cob-button{width:var(--_cob-button-width);min-height:var(--_cob-button-height);border-radius:var(--_cob-button-border-radius);padding:var(--_cob-button-padding--y) var(--_cob-button-padding--x);display:flex;align-items:center;justify-content:var(--_cob-button-justify-content);gap:var(--_cob-button-gap);font-family:var(--_cob-button-font-family);font-size:var(--_cob-button-font-size);font-weight:var(--_cob-button-font-weight);line-height:var(--_cob-button-line-height);text-decoration:var(--_cob-button-text-decoration);box-sizing:border-box;background-color:var(--_cob-button-background-color);color:var(--_cob-button-color);border-color:var(--_cob-button-border-color);border-style:var(--_cob-button-border-style);border-width:var(--_cob-button-border-width);cursor:var(--_cob-button-cursor)}.cob-button:hover{background-color:var(--_cob-button-background-color--hover);color:var(--_cob-button-color--hover);border-color:var(--_cob-button-border-color--hover);text-decoration-thickness:var(--_cob-button-text-decoration-thickness--hover, auto)}.cob-button:active,.cob-button.active{background-color:var(--_cob-button-background-color--active);color:var(--_cob-button-color--active);border-color:var(--_cob-button-border-color--active);text-decoration-thickness:var(--_cob-button-text-decoration-thickness--active, auto)}.cob-button:disabled,a[disabled]{background-color:var(--_cob-button-background-color--disabled);color:var(--_cob-button-color--disabled);border-color:var(--_cob-button-border-color--disabled);--_cob-button-cursor: not-allowed}a[disabled]{pointer-events:none}.cob-button:focus-visible{outline-offset:var(--_cob-button-outline-offset);outline:solid var(--_cob-button-outline-width) var(--_cob-button-outline-color)}.cob-button__text{display:flex;align-items:center;-webkit-user-select:none;user-select:none}';
|
|
1010
|
+
var Pr = Object.defineProperty, m = (o, e, c, i) => {
|
|
1011
|
+
for (var l = void 0, u = o.length - 1, A; u >= 0; u--)
|
|
1012
|
+
(A = o[u]) && (l = A(e, c, l) || l);
|
|
1013
|
+
return l && Pr(e, c, l), l;
|
|
19
1014
|
};
|
|
20
|
-
let
|
|
21
|
-
const
|
|
1015
|
+
let $r = 0;
|
|
1016
|
+
const wt = class wt extends bo {
|
|
22
1017
|
// allows use of elementInternals' API
|
|
23
1018
|
constructor() {
|
|
24
1019
|
super(), this.id = "", this.name = "", this.size = "md", this.fullWidth = !1, this.variant = "filled", this.inverted = !1, this.label = "", this.ariaLabel = "", this.ariaControls = "", this.prefixIcon = "", this.suffixIcon = "", this.circle = !1, this.icon = "", this.disabled = !1, this.form = null, this.value = "", this.ariaDescription = "", this.type = "button", this.onClick = null, this.href = "", this.target = "_self", this._hasPrefixSlot = !1, this._hasSuffixSlot = !1, this._hasCircleSlot = !1, this._internals = this.attachInternals();
|
|
@@ -31,30 +1026,30 @@ const l = class l extends v {
|
|
|
31
1026
|
* --------------------------------------------------------------------------
|
|
32
1027
|
*/
|
|
33
1028
|
_generateUniqueId() {
|
|
34
|
-
return `cob-button-${Date.now()}-${
|
|
1029
|
+
return `cob-button-${Date.now()}-${$r++}`;
|
|
35
1030
|
}
|
|
36
|
-
_onPrefixSlotChange(
|
|
37
|
-
const
|
|
38
|
-
this._hasPrefixSlot =
|
|
1031
|
+
_onPrefixSlotChange(e) {
|
|
1032
|
+
const c = e.target;
|
|
1033
|
+
this._hasPrefixSlot = c.assignedElements({ flatten: !0 }).length > 0;
|
|
39
1034
|
}
|
|
40
|
-
_onSuffixSlotChange(
|
|
41
|
-
const
|
|
42
|
-
this._hasSuffixSlot =
|
|
1035
|
+
_onSuffixSlotChange(e) {
|
|
1036
|
+
const c = e.target;
|
|
1037
|
+
this._hasSuffixSlot = c.assignedElements({ flatten: !0 }).length > 0;
|
|
43
1038
|
}
|
|
44
|
-
_onCircleSlotChange(
|
|
45
|
-
const
|
|
46
|
-
this._hasCircleSlot =
|
|
1039
|
+
_onCircleSlotChange(e) {
|
|
1040
|
+
const c = e.target;
|
|
1041
|
+
this._hasCircleSlot = c.assignedElements({ flatten: !0 }).length > 0;
|
|
47
1042
|
}
|
|
48
1043
|
_manageFormAction() {
|
|
49
1044
|
typeof this.onClick == "function" && this.onClick !== null && this.onClick(new Event("click"));
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
1045
|
+
const e = this._internals.form;
|
|
1046
|
+
if (e)
|
|
52
1047
|
switch (this.type) {
|
|
53
1048
|
case "submit":
|
|
54
|
-
|
|
1049
|
+
e.requestSubmit();
|
|
55
1050
|
break;
|
|
56
1051
|
case "reset":
|
|
57
|
-
|
|
1052
|
+
e.reset();
|
|
58
1053
|
break;
|
|
59
1054
|
}
|
|
60
1055
|
}
|
|
@@ -72,31 +1067,31 @@ const l = class l extends v {
|
|
|
72
1067
|
new Event("cob-blur", { bubbles: !0, composed: !0 })
|
|
73
1068
|
);
|
|
74
1069
|
}
|
|
75
|
-
_handleClick(
|
|
1070
|
+
_handleClick(e) {
|
|
76
1071
|
if (this.disabled) {
|
|
77
|
-
|
|
1072
|
+
e.preventDefault();
|
|
78
1073
|
return;
|
|
79
1074
|
}
|
|
80
1075
|
this._manageFormAction(), this.dispatchEvent(
|
|
81
1076
|
new Event("cob-click", { bubbles: !0, composed: !0 })
|
|
82
1077
|
);
|
|
83
1078
|
}
|
|
84
|
-
_handleKeydown(
|
|
85
|
-
if (
|
|
1079
|
+
_handleKeydown(e) {
|
|
1080
|
+
if (e.code === "Space" || e.code === "Enter" || e.key === " " || e.key === "Enter") {
|
|
86
1081
|
if (this.disabled) return;
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
1082
|
+
e.preventDefault();
|
|
1083
|
+
const c = this.renderRoot.querySelector(".cob-button");
|
|
1084
|
+
if (c?.classList.add("active"), setTimeout(() => c?.classList.remove("active"), 150), this.href) {
|
|
90
1085
|
const i = this.renderRoot.querySelector(
|
|
91
1086
|
"a.cob-button"
|
|
92
1087
|
);
|
|
93
1088
|
i && i.click();
|
|
94
1089
|
} else
|
|
95
|
-
this._handleAnyAttributeFunction(), this._handleClick(
|
|
1090
|
+
this._handleAnyAttributeFunction(), this._handleClick(e);
|
|
96
1091
|
}
|
|
97
1092
|
}
|
|
98
|
-
_handleKeyup(
|
|
99
|
-
(
|
|
1093
|
+
_handleKeyup(e) {
|
|
1094
|
+
(e.code === "Space" || e.code === "Enter" || e.key === " " || e.key === "Enter") && this.renderRoot.querySelector(".cob-button")?.classList.remove("active");
|
|
100
1095
|
}
|
|
101
1096
|
/**
|
|
102
1097
|
* Handles inline onclick attributes for keyboard activation.
|
|
@@ -110,22 +1105,22 @@ const l = class l extends v {
|
|
|
110
1105
|
_handleAnyAttributeFunction() {
|
|
111
1106
|
this.click();
|
|
112
1107
|
}
|
|
113
|
-
focus(
|
|
114
|
-
const
|
|
1108
|
+
focus(e) {
|
|
1109
|
+
const c = this.renderRoot.querySelector(
|
|
115
1110
|
this.href ? "a.cob-button" : "button.cob-button"
|
|
116
1111
|
);
|
|
117
|
-
|
|
1112
|
+
c ? c.focus(e) : super.focus(e);
|
|
118
1113
|
}
|
|
119
1114
|
render() {
|
|
120
|
-
return
|
|
121
|
-
${this.href ?
|
|
1115
|
+
return R`
|
|
1116
|
+
${this.href ? R`
|
|
122
1117
|
<div class="cob-button__linkwrapper">
|
|
123
1118
|
<a
|
|
124
1119
|
class="cob-button"
|
|
125
|
-
name=${
|
|
1120
|
+
name=${P(this.name ? this.name : void 0)}
|
|
126
1121
|
?disabled=${this.disabled}
|
|
127
1122
|
aria-disabled="${this.disabled ? "true" : "false"}"
|
|
128
|
-
value=${
|
|
1123
|
+
value=${P(this.value ? this.value : void 0)}
|
|
129
1124
|
href=${this.href}
|
|
130
1125
|
target=${this.target}
|
|
131
1126
|
@click=${this._handleClick}
|
|
@@ -134,28 +1129,28 @@ const l = class l extends v {
|
|
|
134
1129
|
@keydown="${this._handleKeydown}"
|
|
135
1130
|
@keyup="${this._handleKeyup}"
|
|
136
1131
|
tabindex="${this.disabled ? -1 : 0}"
|
|
137
|
-
aria-label=${
|
|
1132
|
+
aria-label=${P(
|
|
138
1133
|
this.ariaLabel || this.label || (this.circle ? this.icon : null) || "button"
|
|
139
1134
|
)}
|
|
140
|
-
aria-description=${
|
|
1135
|
+
aria-description=${P(this.ariaDescription || void 0)}
|
|
141
1136
|
>
|
|
142
1137
|
<slot
|
|
143
1138
|
name="prefix-icon"
|
|
144
1139
|
@slotchange=${this._onPrefixSlotChange}
|
|
145
1140
|
?hidden=${!this.prefixIcon && !this._hasPrefixSlot}
|
|
146
1141
|
>
|
|
147
|
-
${this.prefixIcon ?
|
|
1142
|
+
${this.prefixIcon ? R`<cob-icon
|
|
148
1143
|
size="16"
|
|
149
1144
|
name=${this.prefixIcon}
|
|
150
1145
|
></cob-icon>` : ""}
|
|
151
1146
|
</slot>
|
|
152
|
-
${this.circle ? "" : this.label ?
|
|
1147
|
+
${this.circle ? "" : this.label ? R`<div class="cob-button__text">${this.label}</div>` : R` <slot class="cob-button__default-slot"></slot> `}
|
|
153
1148
|
<slot
|
|
154
1149
|
name="suffix-icon"
|
|
155
1150
|
@slotchange=${this._onSuffixSlotChange}
|
|
156
1151
|
?hidden=${!this.suffixIcon && !this._hasSuffixSlot}
|
|
157
1152
|
>
|
|
158
|
-
${this.suffixIcon ?
|
|
1153
|
+
${this.suffixIcon ? R`<cob-icon
|
|
159
1154
|
size="16"
|
|
160
1155
|
name=${this.suffixIcon}
|
|
161
1156
|
></cob-icon>` : ""}
|
|
@@ -165,33 +1160,33 @@ const l = class l extends v {
|
|
|
165
1160
|
@slotchange=${this._onCircleSlotChange}
|
|
166
1161
|
?hidden=${!this.circle || !this.icon && !this._hasCircleSlot}
|
|
167
1162
|
>
|
|
168
|
-
${this.icon ?
|
|
1163
|
+
${this.icon ? R`<cob-icon
|
|
169
1164
|
size=${this.size === "sm" ? "24" : this.size === "lg" ? "40" : "32"}
|
|
170
1165
|
name=${this.icon}
|
|
171
1166
|
></cob-icon>` : ""}
|
|
172
1167
|
</slot>
|
|
173
1168
|
</a>
|
|
174
1169
|
</div>
|
|
175
|
-
` :
|
|
1170
|
+
` : R`
|
|
176
1171
|
<button
|
|
177
1172
|
class="cob-button"
|
|
178
|
-
name=${
|
|
1173
|
+
name=${P(this.name ? this.name : void 0)}
|
|
179
1174
|
?disabled=${this.disabled}
|
|
180
1175
|
aria-disabled="${this.disabled ? "true" : "false"}"
|
|
181
|
-
form=${
|
|
182
|
-
value=${
|
|
1176
|
+
form=${P(this.form || void 0)}
|
|
1177
|
+
value=${P(this.value ? this.value : void 0)}
|
|
183
1178
|
type=${this.type}
|
|
184
|
-
aria-controls=${
|
|
1179
|
+
aria-controls=${P(this.ariaControls || void 0)}
|
|
185
1180
|
@click=${this._handleClick}
|
|
186
1181
|
@focus="${this._handleFocus}"
|
|
187
1182
|
@blur="${this._handleBlur}"
|
|
188
1183
|
@keydown="${this._handleKeydown}"
|
|
189
1184
|
@keyup="${this._handleKeyup}"
|
|
190
1185
|
tabindex="${this.disabled ? -1 : 0}"
|
|
191
|
-
aria-label=${
|
|
1186
|
+
aria-label=${P(
|
|
192
1187
|
this.ariaLabel || this.label || (this.circle ? this.icon : null) || this.prefixIcon || this.suffixIcon || "button"
|
|
193
1188
|
)}
|
|
194
|
-
aria-description=${
|
|
1189
|
+
aria-description=${P(this.ariaDescription || void 0)}
|
|
195
1190
|
role="button"
|
|
196
1191
|
>
|
|
197
1192
|
<slot
|
|
@@ -199,18 +1194,18 @@ const l = class l extends v {
|
|
|
199
1194
|
@slotchange=${this._onPrefixSlotChange}
|
|
200
1195
|
?hidden=${!this.prefixIcon && !this._hasPrefixSlot}
|
|
201
1196
|
>
|
|
202
|
-
${this.prefixIcon ?
|
|
1197
|
+
${this.prefixIcon ? R`<cob-icon
|
|
203
1198
|
size="16"
|
|
204
1199
|
name=${this.prefixIcon}
|
|
205
1200
|
></cob-icon>` : ""}
|
|
206
1201
|
</slot>
|
|
207
|
-
${this.circle ? "" : this.label ?
|
|
1202
|
+
${this.circle ? "" : this.label ? R`<div class="cob-button__text">${this.label}</div>` : R` <slot class="cob-button__default-slot"></slot> `}
|
|
208
1203
|
<slot
|
|
209
1204
|
name="suffix-icon"
|
|
210
1205
|
@slotchange=${this._onSuffixSlotChange}
|
|
211
1206
|
?hidden=${!this.suffixIcon && !this._hasSuffixSlot}
|
|
212
1207
|
>
|
|
213
|
-
${this.suffixIcon ?
|
|
1208
|
+
${this.suffixIcon ? R`<cob-icon
|
|
214
1209
|
size="16"
|
|
215
1210
|
name=${this.suffixIcon}
|
|
216
1211
|
></cob-icon>` : ""}
|
|
@@ -220,7 +1215,7 @@ const l = class l extends v {
|
|
|
220
1215
|
@slotchange=${this._onCircleSlotChange}
|
|
221
1216
|
?hidden=${!this.circle || !this.icon && !this._hasCircleSlot}
|
|
222
1217
|
>
|
|
223
|
-
${this.icon ?
|
|
1218
|
+
${this.icon ? R`<cob-icon
|
|
224
1219
|
size=${this.size === "sm" ? "24" : this.size === "lg" ? "40" : "32"}
|
|
225
1220
|
name=${this.icon}
|
|
226
1221
|
></cob-icon>` : ""}
|
|
@@ -230,85 +1225,85 @@ const l = class l extends v {
|
|
|
230
1225
|
`;
|
|
231
1226
|
}
|
|
232
1227
|
};
|
|
233
|
-
|
|
234
|
-
...
|
|
1228
|
+
wt.styles = fe(Mr), wt.shadowRootOptions = {
|
|
1229
|
+
...bo.shadowRootOptions,
|
|
235
1230
|
delegatesFocus: !0
|
|
236
|
-
},
|
|
237
|
-
let
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
],
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
],
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
],
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
],
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
],
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
],
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
],
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
],
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
],
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
],
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
],
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
],
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
],
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
],
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
],
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
],
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
],
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
],
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
],
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
],
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
],
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
],
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
],
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
],
|
|
310
|
-
customElements.get("cob-button") || customElements.define("cob-button",
|
|
1231
|
+
}, wt.formAssociated = !0;
|
|
1232
|
+
let p = wt;
|
|
1233
|
+
m([
|
|
1234
|
+
d({ type: String, reflect: !0 })
|
|
1235
|
+
], p.prototype, "id");
|
|
1236
|
+
m([
|
|
1237
|
+
d({ type: String, reflect: !0 })
|
|
1238
|
+
], p.prototype, "name");
|
|
1239
|
+
m([
|
|
1240
|
+
d({ type: String, reflect: !0 })
|
|
1241
|
+
], p.prototype, "size");
|
|
1242
|
+
m([
|
|
1243
|
+
d({ type: Boolean, reflect: !0 })
|
|
1244
|
+
], p.prototype, "fullWidth");
|
|
1245
|
+
m([
|
|
1246
|
+
d({ type: String, reflect: !0 })
|
|
1247
|
+
], p.prototype, "variant");
|
|
1248
|
+
m([
|
|
1249
|
+
d({ type: Boolean, reflect: !0 })
|
|
1250
|
+
], p.prototype, "inverted");
|
|
1251
|
+
m([
|
|
1252
|
+
d({ type: String })
|
|
1253
|
+
], p.prototype, "label");
|
|
1254
|
+
m([
|
|
1255
|
+
d({ type: String })
|
|
1256
|
+
], p.prototype, "ariaLabel");
|
|
1257
|
+
m([
|
|
1258
|
+
d({ type: String })
|
|
1259
|
+
], p.prototype, "ariaControls");
|
|
1260
|
+
m([
|
|
1261
|
+
d({ type: String })
|
|
1262
|
+
], p.prototype, "prefixIcon");
|
|
1263
|
+
m([
|
|
1264
|
+
d({ type: String })
|
|
1265
|
+
], p.prototype, "suffixIcon");
|
|
1266
|
+
m([
|
|
1267
|
+
d({ type: Boolean, reflect: !0 })
|
|
1268
|
+
], p.prototype, "circle");
|
|
1269
|
+
m([
|
|
1270
|
+
d({ type: String })
|
|
1271
|
+
], p.prototype, "icon");
|
|
1272
|
+
m([
|
|
1273
|
+
d({ type: Boolean, reflect: !0 })
|
|
1274
|
+
], p.prototype, "disabled");
|
|
1275
|
+
m([
|
|
1276
|
+
d({ type: String, reflect: !0 })
|
|
1277
|
+
], p.prototype, "form");
|
|
1278
|
+
m([
|
|
1279
|
+
d({ type: String })
|
|
1280
|
+
], p.prototype, "value");
|
|
1281
|
+
m([
|
|
1282
|
+
d({ type: String })
|
|
1283
|
+
], p.prototype, "ariaDescription");
|
|
1284
|
+
m([
|
|
1285
|
+
d({ type: String, reflect: !0 })
|
|
1286
|
+
], p.prototype, "type");
|
|
1287
|
+
m([
|
|
1288
|
+
d({ attribute: !1 })
|
|
1289
|
+
], p.prototype, "onClick");
|
|
1290
|
+
m([
|
|
1291
|
+
d({ type: String })
|
|
1292
|
+
], p.prototype, "href");
|
|
1293
|
+
m([
|
|
1294
|
+
d({ type: String, reflect: !0 })
|
|
1295
|
+
], p.prototype, "target");
|
|
1296
|
+
m([
|
|
1297
|
+
Mt()
|
|
1298
|
+
], p.prototype, "_hasPrefixSlot");
|
|
1299
|
+
m([
|
|
1300
|
+
Mt()
|
|
1301
|
+
], p.prototype, "_hasSuffixSlot");
|
|
1302
|
+
m([
|
|
1303
|
+
Mt()
|
|
1304
|
+
], p.prototype, "_hasCircleSlot");
|
|
1305
|
+
customElements.get("cob-button") || customElements.define("cob-button", p);
|
|
311
1306
|
export {
|
|
312
|
-
|
|
1307
|
+
p as CobButton
|
|
313
1308
|
};
|
|
314
1309
|
//# sourceMappingURL=cob-button.js.map
|