@wsxjs/wsx-base-components 0.0.20 → 0.0.22
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/index.cjs +6 -6
- package/dist/index.js +656 -647
- package/package.json +5 -5
- package/src/Button.wsx +2 -0
- package/src/ButtonGroup.wsx +1 -0
- package/src/CodeBlock.wsx +1 -0
- package/src/ColorPicker.wsx +2 -0
- package/src/Combobox.wsx +1 -0
- package/src/Dropdown.wsx +1 -0
- package/src/LanguageSwitcher.wsx +6 -21
- package/src/ResponsiveNav.wsx +4 -2
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { autoRegister as te, WebComponent as Q, jsx as $, LightComponent as
|
|
1
|
+
import { autoRegister as te, WebComponent as Q, jsx as $, LightComponent as _e } from "@wsxjs/wsx-core";
|
|
2
2
|
const yt = ':host{position:relative;display:inline-flex;padding:.25em .625em;box-sizing:border-box;vertical-align:middle;line-height:1.8;overflow:hidden;align-items:center;justify-content:center;font-size:14px;color:var(--fontColor, #333);border-radius:var(--borderRadius, .25em);background:var(--fontColor, #333);transition:background .3s,box-shadow .3s,border-color .3s,color .3s}:host([size="xxxs"]){padding:.03125em .0625em;font-size:6px;line-height:1;min-width:10px;min-height:8px;border-radius:1px}:host([size="xxs"]){padding:.0625em .125em;font-size:8px;line-height:1.1;min-width:14px;min-height:12px;border-radius:2px}:host([size="xs"]){padding:.125em .25em;font-size:10px;line-height:1.2;min-width:18px;min-height:16px;border-radius:3px}:host([size="sm"]){padding:.25em .5em;font-size:12px;line-height:1.4;min-width:24px;min-height:20px;border-radius:4px}:host([size="md"]){padding:.375em .75em;font-size:14px;line-height:1.5;min-width:32px;min-height:28px;border-radius:6px}:host([size="lg"]){padding:.5em 1em;font-size:14px;line-height:1.6;min-width:40px;min-height:32px;border-radius:6px}:host([size="xl"]){padding:.625em 1.25em;font-size:16px;line-height:1.6;min-width:48px;min-height:40px;border-radius:8px}:host([shape="circle"]){border-radius:50%}:host([disabled]),:host([loading]){pointer-events:none;opacity:.6}:host([block]){display:flex}:host([disabled]:not([variant])){background:#0000001a}:host([disabled]) .btn,:host([loading]) .btn{cursor:not-allowed;pointer-events:all}:host(:not([variant="primary"]):not([variant="danger"]):not([disabled]):hover),:host(:not([variant="primary"]):not([variant="danger"]):focus-within),:host([variant="flat"][focus]){color:var(--themeColor, #42b983);border-color:var(--themeColor, #42b983)}:host(:not([variant="primary"]):not([variant="danger"])) .btn:after{background-image:radial-gradient(circle,var(--themeColor, #42b983) 10%,transparent 10.01%)}:host([variant="primary"]){color:#fff;background:var(--themeBackground, var(--themeColor, #42b983))}:host([variant="danger"]){color:#fff;background:var(--themeBackground, var(--dangerColor, #ff7875))}:host([variant="dashed"]){border-style:dashed}:host([variant="flat"]),:host([variant="primary"]),:host([variant="danger"]){border:0;padding:calc(.25em + 1px) calc(.625em + 1px)}:host([variant="flat"]) .btn:before{content:"";position:absolute;background:var(--themeColor, #42b983);pointer-events:none;left:0;right:0;top:0;bottom:0;opacity:0;transition:.3s}:host([variant="flat"]:not([disabled]):hover) .btn:before{opacity:.1}:host(:not([disabled]):hover){z-index:1}:host([variant="flat"]:focus-within) .btn:before,:host([variant="flat"][focus]) .btn:before{opacity:.2}.btn{background:none;outline:0;border:0;position:absolute;left:0;top:0;width:100%;height:100%;padding:0;-webkit-user-select:none;user-select:none;cursor:unset}.loading{margin-right:.35em}::-moz-focus-inner{border:0}.btn:before{content:"";display:block;position:absolute;width:100%;height:100%;left:0;top:0;transition:.2s;background:#fff;opacity:0}:host(:not([disabled]):active) .btn:before{opacity:.2}.btn:after{content:"";display:block;position:absolute;width:100%;height:100%;left:var(--x, 0);top:var(--y, 0);pointer-events:none;background-image:radial-gradient(circle,#fff 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:translate(-50%,-50%) scale(10);opacity:0;transition:transform .3s,opacity .8s}.btn:not([disabled]):active:after{transform:translate(-50%,-50%) scale(0);opacity:.3;transition:0s}.icon{margin-right:.35em;transition:none}:host(:empty) .icon{margin:auto}:host(:empty){padding:.65em}:host([type="flat"]:empty),:host([type="primary"]:empty){padding:calc(.65em + 1px)}::slotted(.icon){transition:none}:host([href]){cursor:pointer}';
|
|
3
3
|
var Ie;
|
|
4
4
|
let Fe, Le;
|
|
5
5
|
function K(t, e, r) {
|
|
6
6
|
return (e = Re(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
7
7
|
}
|
|
8
|
-
function xt(t, e, r, i,
|
|
9
|
-
function
|
|
8
|
+
function xt(t, e, r, i, S, A) {
|
|
9
|
+
function b(a, s, c) {
|
|
10
10
|
return function(o, n) {
|
|
11
11
|
return c && c(o), a[s].call(o, n);
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function O(a, s) {
|
|
15
15
|
for (var c = 0; c < a.length; c++) a[c].call(s);
|
|
16
16
|
return s;
|
|
17
17
|
}
|
|
@@ -19,22 +19,22 @@ function xt(t, e, r, i, k, O) {
|
|
|
19
19
|
if (typeof a != "function" && (o || a !== void 0)) throw new TypeError(s + " must " + (c || "be") + " a function" + (o ? "" : " or undefined"));
|
|
20
20
|
return a;
|
|
21
21
|
}
|
|
22
|
-
function D(a, s, c, o, n, u, h, p, x,
|
|
22
|
+
function D(a, s, c, o, n, u, h, p, x, k, m, d, v) {
|
|
23
23
|
function T(f) {
|
|
24
24
|
if (!v(f)) throw new TypeError("Attempted to access private element on non-instance");
|
|
25
25
|
}
|
|
26
|
-
var g,
|
|
26
|
+
var g, _ = s[0], I = s[3], M = !p;
|
|
27
27
|
if (!M) {
|
|
28
|
-
c || Array.isArray(
|
|
29
|
-
var l = {}, R = [],
|
|
30
|
-
|
|
28
|
+
c || Array.isArray(_) || (_ = [_]);
|
|
29
|
+
var l = {}, R = [], E = n === 3 ? "get" : n === 4 || d ? "set" : "value";
|
|
30
|
+
k ? (m || d ? l = { get: he(function() {
|
|
31
31
|
return I(this);
|
|
32
32
|
}, o, "get"), set: function(f) {
|
|
33
33
|
s[4](this, f);
|
|
34
|
-
} } : l[
|
|
34
|
+
} } : l[E] = I, m || he(l[E], o, n === 2 ? "" : E)) : m || (l = Object.getOwnPropertyDescriptor(a, o));
|
|
35
35
|
}
|
|
36
|
-
for (var w = a, B =
|
|
37
|
-
var W =
|
|
36
|
+
for (var w = a, B = _.length - 1; B >= 0; B -= c ? 2 : 1) {
|
|
37
|
+
var W = _[B], G = c ? _[B - 1] : void 0, Y = {}, z = { kind: ["field", "accessor", "method", "getter", "setter", "class"][n], name: o, metadata: u, addInitializer: (function(f, N) {
|
|
38
38
|
if (f.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
39
39
|
y(N, "An initializer", "be", !0), h.push(N);
|
|
40
40
|
}).bind(null, Y) };
|
|
@@ -42,58 +42,58 @@ function xt(t, e, r, i, k, O) {
|
|
|
42
42
|
if (M) (g = y(W.call(G, w, z), "class decorators", "return")) && (w = g);
|
|
43
43
|
else {
|
|
44
44
|
var P, U;
|
|
45
|
-
z.static = x, z.private =
|
|
45
|
+
z.static = x, z.private = k, k ? n === 2 ? P = function(f) {
|
|
46
46
|
return T(f), l.value;
|
|
47
|
-
} : (n < 4 && (P =
|
|
47
|
+
} : (n < 4 && (P = b(l, "get", T)), n !== 3 && (U = b(l, "set", T))) : (P = function(f) {
|
|
48
48
|
return f[o];
|
|
49
49
|
}, (n < 2 || n === 4) && (U = function(f, N) {
|
|
50
50
|
f[o] = N;
|
|
51
51
|
}));
|
|
52
|
-
var V = z.access = { has:
|
|
52
|
+
var V = z.access = { has: k ? v.bind() : function(f) {
|
|
53
53
|
return o in f;
|
|
54
54
|
} };
|
|
55
|
-
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[
|
|
55
|
+
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[E], z), d) {
|
|
56
56
|
if (typeof w == "object" && w) (g = y(w.get, "accessor.get")) && (l.get = g), (g = y(w.set, "accessor.set")) && (l.set = g), (g = y(w.init, "accessor.init")) && R.push(g);
|
|
57
57
|
else if (w !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
58
|
-
} else y(w, (
|
|
58
|
+
} else y(w, (m ? "field" : "method") + " decorators", "return") && (m ? R.push(w) : l[E] = w);
|
|
59
59
|
}
|
|
60
60
|
} finally {
|
|
61
61
|
Y.v = !0;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
return (
|
|
64
|
+
return (m || d) && p.push(function(f, N) {
|
|
65
65
|
for (var H = R.length - 1; H >= 0; H--) N = R[H].call(f, N);
|
|
66
66
|
return N;
|
|
67
|
-
}),
|
|
67
|
+
}), m || M || (k ? d ? p.push(b(l, "get"), b(l, "set")) : p.push(n === 2 ? l[E] : b.call.bind(l[E])) : Object.defineProperty(a, o, l)), w;
|
|
68
68
|
}
|
|
69
69
|
function F(a, s) {
|
|
70
70
|
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: s });
|
|
71
71
|
}
|
|
72
|
-
if (arguments.length >= 6) var
|
|
73
|
-
var L = Object.create(
|
|
74
|
-
var n, u, h = [], p = function(
|
|
75
|
-
return kt(
|
|
72
|
+
if (arguments.length >= 6) var C = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
73
|
+
var L = Object.create(C ?? null), j = function(a, s, c, o) {
|
|
74
|
+
var n, u, h = [], p = function(E) {
|
|
75
|
+
return kt(E) === a;
|
|
76
76
|
}, x = /* @__PURE__ */ new Map();
|
|
77
|
-
function E
|
|
78
|
-
|
|
77
|
+
function k(E) {
|
|
78
|
+
E && h.push(O.bind(null, E));
|
|
79
79
|
}
|
|
80
|
-
for (var
|
|
81
|
-
var d = s[
|
|
80
|
+
for (var m = 0; m < s.length; m++) {
|
|
81
|
+
var d = s[m];
|
|
82
82
|
if (Array.isArray(d)) {
|
|
83
|
-
var v = d[1], T = d[2], g = d.length > 3,
|
|
83
|
+
var v = d[1], T = d[2], g = d.length > 3, _ = 16 & v, I = !!(8 & v), M = (v &= 7) == 0, l = T + "/" + I;
|
|
84
84
|
if (!M && !g) {
|
|
85
85
|
var R = x.get(l);
|
|
86
86
|
if (R === !0 || R === 3 && v !== 4 || R === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
87
87
|
x.set(l, !(v > 2) || v);
|
|
88
88
|
}
|
|
89
|
-
D(I ? a : a.prototype, d,
|
|
89
|
+
D(I ? a : a.prototype, d, _, g ? "#" + T : Re(T), v, o, I ? u = u || [] : n = n || [], h, I, g, M, v === 1, I && g ? p : c);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
return
|
|
93
|
-
}(t, e,
|
|
92
|
+
return k(n), k(u), h;
|
|
93
|
+
}(t, e, S, L);
|
|
94
94
|
return r.length || F(t, L), { e: j, get c() {
|
|
95
95
|
var a = [];
|
|
96
|
-
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L),
|
|
96
|
+
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L), O.bind(null, a, t)];
|
|
97
97
|
} };
|
|
98
98
|
}
|
|
99
99
|
function Re(t) {
|
|
@@ -136,8 +136,8 @@ class St extends Q {
|
|
|
136
136
|
...e
|
|
137
137
|
}), K(this, "_autoStyles", yt), K(this, "disabled", !1), K(this, "loading", !1), K(this, "toggle", !1), K(this, "checked", !1), K(this, "icon", null), K(this, "href", null), K(this, "type", null), K(this, "target", "_blank"), K(this, "rel", null), K(this, "download", null), K(this, "variant", "flat"), K(this, "size", "md"), K(this, "btnElement", void 0), K(this, "iconElement", void 0), K(this, "loadingElement", void 0), K(this, "handleMouseDown", (r) => {
|
|
138
138
|
if (this.disabled) return;
|
|
139
|
-
const i = this.getBoundingClientRect(),
|
|
140
|
-
this.style.setProperty("--x", `${
|
|
139
|
+
const i = this.getBoundingClientRect(), S = r.clientX - i.left, A = r.clientY - i.top;
|
|
140
|
+
this.style.setProperty("--x", `${S}px`), this.style.setProperty("--y", `${A}px`);
|
|
141
141
|
}), K(this, "handleKeyDown", (r) => {
|
|
142
142
|
(r.code === "Enter" || r.code === "Space") && r.stopPropagation();
|
|
143
143
|
}), K(this, "handleClick", () => {
|
|
@@ -145,10 +145,10 @@ class St extends Q {
|
|
|
145
145
|
}), this.disabled = e.disabled || !1, this.loading = e.loading || !1, this.toggle = e.toggle || !1, this.checked = e.checked || !1, this.icon = e.icon || null, this.href = e.href || null, this.type = e.type || null, this.target = e.target || "_blank", this.rel = e.rel || null, this.download = e.download || null, this.variant = e.variant || "flat", this.size = e.size || "md";
|
|
146
146
|
}
|
|
147
147
|
render() {
|
|
148
|
-
const e = !!this.href, r = /* @__PURE__ */ $("a", { href: this.disabled || this.loading ? void 0 : this.href, target: this.target, rel: this.rel || void 0, download: this.download || void 0, className: "btn", onMouseDown: this.handleMouseDown, onKeyDown: this.handleKeyDown, ref: (
|
|
149
|
-
this.btnElement =
|
|
150
|
-
} }, this.renderContent()), i = /* @__PURE__ */ $("button", { type: this.type || "button", disabled: this.disabled, className: "btn", onMouseDown: this.handleMouseDown, onKeyDown: this.handleKeyDown, ref: (
|
|
151
|
-
this.btnElement =
|
|
148
|
+
const e = !!this.href, r = /* @__PURE__ */ $("a", { href: this.disabled || this.loading ? void 0 : this.href, target: this.target, rel: this.rel || void 0, download: this.download || void 0, className: "btn", onMouseDown: this.handleMouseDown, onKeyDown: this.handleKeyDown, ref: (S) => {
|
|
149
|
+
this.btnElement = S, S && setTimeout(() => this.updateButtonState(), 0);
|
|
150
|
+
} }, this.renderContent()), i = /* @__PURE__ */ $("button", { type: this.type || "button", disabled: this.disabled, className: "btn", onMouseDown: this.handleMouseDown, onKeyDown: this.handleKeyDown, ref: (S) => {
|
|
151
|
+
this.btnElement = S, S && setTimeout(() => this.updateButtonState(), 0);
|
|
152
152
|
}, "data-wsx-key": "Button-button-text-0" }, this.renderContent());
|
|
153
153
|
return /* @__PURE__ */ $("div", { className: "wsx-button-container" }, e ? r : i);
|
|
154
154
|
}
|
|
@@ -164,13 +164,15 @@ class St extends Q {
|
|
|
164
164
|
* 组件连接到DOM后的初始化
|
|
165
165
|
*/
|
|
166
166
|
onConnected() {
|
|
167
|
-
|
|
167
|
+
var e;
|
|
168
|
+
(e = super.onConnected) == null || e.call(this), this.addEventListener("click", this.handleClick);
|
|
168
169
|
}
|
|
169
170
|
/**
|
|
170
171
|
* 组件从DOM断开时的清理
|
|
171
172
|
*/
|
|
172
173
|
onDisconnected() {
|
|
173
|
-
|
|
174
|
+
var e;
|
|
175
|
+
(e = super.onDisconnected) == null || e.call(this), this.removeEventListener("click", this.handleClick);
|
|
174
176
|
}
|
|
175
177
|
/**
|
|
176
178
|
* 属性变化处理
|
|
@@ -265,13 +267,13 @@ let $e, De;
|
|
|
265
267
|
function ge(t, e, r) {
|
|
266
268
|
return (e = Me(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
267
269
|
}
|
|
268
|
-
function Ot(t, e, r, i,
|
|
269
|
-
function
|
|
270
|
+
function Ot(t, e, r, i, S, A) {
|
|
271
|
+
function b(a, s, c) {
|
|
270
272
|
return function(o, n) {
|
|
271
273
|
return c && c(o), a[s].call(o, n);
|
|
272
274
|
};
|
|
273
275
|
}
|
|
274
|
-
function
|
|
276
|
+
function O(a, s) {
|
|
275
277
|
for (var c = 0; c < a.length; c++) a[c].call(s);
|
|
276
278
|
return s;
|
|
277
279
|
}
|
|
@@ -279,22 +281,22 @@ function Ot(t, e, r, i, k, O) {
|
|
|
279
281
|
if (typeof a != "function" && (o || a !== void 0)) throw new TypeError(s + " must " + (c || "be") + " a function" + (o ? "" : " or undefined"));
|
|
280
282
|
return a;
|
|
281
283
|
}
|
|
282
|
-
function D(a, s, c, o, n, u, h, p, x,
|
|
284
|
+
function D(a, s, c, o, n, u, h, p, x, k, m, d, v) {
|
|
283
285
|
function T(f) {
|
|
284
286
|
if (!v(f)) throw new TypeError("Attempted to access private element on non-instance");
|
|
285
287
|
}
|
|
286
|
-
var g,
|
|
288
|
+
var g, _ = s[0], I = s[3], M = !p;
|
|
287
289
|
if (!M) {
|
|
288
|
-
c || Array.isArray(
|
|
289
|
-
var l = {}, R = [],
|
|
290
|
-
|
|
290
|
+
c || Array.isArray(_) || (_ = [_]);
|
|
291
|
+
var l = {}, R = [], E = n === 3 ? "get" : n === 4 || d ? "set" : "value";
|
|
292
|
+
k ? (m || d ? l = { get: fe(function() {
|
|
291
293
|
return I(this);
|
|
292
294
|
}, o, "get"), set: function(f) {
|
|
293
295
|
s[4](this, f);
|
|
294
|
-
} } : l[
|
|
296
|
+
} } : l[E] = I, m || fe(l[E], o, n === 2 ? "" : E)) : m || (l = Object.getOwnPropertyDescriptor(a, o));
|
|
295
297
|
}
|
|
296
|
-
for (var w = a, B =
|
|
297
|
-
var W =
|
|
298
|
+
for (var w = a, B = _.length - 1; B >= 0; B -= c ? 2 : 1) {
|
|
299
|
+
var W = _[B], G = c ? _[B - 1] : void 0, Y = {}, z = { kind: ["field", "accessor", "method", "getter", "setter", "class"][n], name: o, metadata: u, addInitializer: (function(f, N) {
|
|
298
300
|
if (f.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
299
301
|
y(N, "An initializer", "be", !0), h.push(N);
|
|
300
302
|
}).bind(null, Y) };
|
|
@@ -302,58 +304,58 @@ function Ot(t, e, r, i, k, O) {
|
|
|
302
304
|
if (M) (g = y(W.call(G, w, z), "class decorators", "return")) && (w = g);
|
|
303
305
|
else {
|
|
304
306
|
var P, U;
|
|
305
|
-
z.static = x, z.private =
|
|
307
|
+
z.static = x, z.private = k, k ? n === 2 ? P = function(f) {
|
|
306
308
|
return T(f), l.value;
|
|
307
|
-
} : (n < 4 && (P =
|
|
309
|
+
} : (n < 4 && (P = b(l, "get", T)), n !== 3 && (U = b(l, "set", T))) : (P = function(f) {
|
|
308
310
|
return f[o];
|
|
309
311
|
}, (n < 2 || n === 4) && (U = function(f, N) {
|
|
310
312
|
f[o] = N;
|
|
311
313
|
}));
|
|
312
|
-
var V = z.access = { has:
|
|
314
|
+
var V = z.access = { has: k ? v.bind() : function(f) {
|
|
313
315
|
return o in f;
|
|
314
316
|
} };
|
|
315
|
-
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[
|
|
317
|
+
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[E], z), d) {
|
|
316
318
|
if (typeof w == "object" && w) (g = y(w.get, "accessor.get")) && (l.get = g), (g = y(w.set, "accessor.set")) && (l.set = g), (g = y(w.init, "accessor.init")) && R.push(g);
|
|
317
319
|
else if (w !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
318
|
-
} else y(w, (
|
|
320
|
+
} else y(w, (m ? "field" : "method") + " decorators", "return") && (m ? R.push(w) : l[E] = w);
|
|
319
321
|
}
|
|
320
322
|
} finally {
|
|
321
323
|
Y.v = !0;
|
|
322
324
|
}
|
|
323
325
|
}
|
|
324
|
-
return (
|
|
326
|
+
return (m || d) && p.push(function(f, N) {
|
|
325
327
|
for (var H = R.length - 1; H >= 0; H--) N = R[H].call(f, N);
|
|
326
328
|
return N;
|
|
327
|
-
}),
|
|
329
|
+
}), m || M || (k ? d ? p.push(b(l, "get"), b(l, "set")) : p.push(n === 2 ? l[E] : b.call.bind(l[E])) : Object.defineProperty(a, o, l)), w;
|
|
328
330
|
}
|
|
329
331
|
function F(a, s) {
|
|
330
332
|
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: s });
|
|
331
333
|
}
|
|
332
|
-
if (arguments.length >= 6) var
|
|
333
|
-
var L = Object.create(
|
|
334
|
-
var n, u, h = [], p = function(
|
|
335
|
-
return
|
|
334
|
+
if (arguments.length >= 6) var C = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
335
|
+
var L = Object.create(C ?? null), j = function(a, s, c, o) {
|
|
336
|
+
var n, u, h = [], p = function(E) {
|
|
337
|
+
return Ct(E) === a;
|
|
336
338
|
}, x = /* @__PURE__ */ new Map();
|
|
337
|
-
function E
|
|
338
|
-
|
|
339
|
+
function k(E) {
|
|
340
|
+
E && h.push(O.bind(null, E));
|
|
339
341
|
}
|
|
340
|
-
for (var
|
|
341
|
-
var d = s[
|
|
342
|
+
for (var m = 0; m < s.length; m++) {
|
|
343
|
+
var d = s[m];
|
|
342
344
|
if (Array.isArray(d)) {
|
|
343
|
-
var v = d[1], T = d[2], g = d.length > 3,
|
|
345
|
+
var v = d[1], T = d[2], g = d.length > 3, _ = 16 & v, I = !!(8 & v), M = (v &= 7) == 0, l = T + "/" + I;
|
|
344
346
|
if (!M && !g) {
|
|
345
347
|
var R = x.get(l);
|
|
346
348
|
if (R === !0 || R === 3 && v !== 4 || R === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
347
349
|
x.set(l, !(v > 2) || v);
|
|
348
350
|
}
|
|
349
|
-
D(I ? a : a.prototype, d,
|
|
351
|
+
D(I ? a : a.prototype, d, _, g ? "#" + T : Me(T), v, o, I ? u = u || [] : n = n || [], h, I, g, M, v === 1, I && g ? p : c);
|
|
350
352
|
}
|
|
351
353
|
}
|
|
352
|
-
return
|
|
353
|
-
}(t, e,
|
|
354
|
+
return k(n), k(u), h;
|
|
355
|
+
}(t, e, S, L);
|
|
354
356
|
return r.length || F(t, L), { e: j, get c() {
|
|
355
357
|
var a = [];
|
|
356
|
-
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L),
|
|
358
|
+
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L), O.bind(null, a, t)];
|
|
357
359
|
} };
|
|
358
360
|
}
|
|
359
361
|
function Me(t) {
|
|
@@ -378,14 +380,14 @@ function fe(t, e, r) {
|
|
|
378
380
|
}
|
|
379
381
|
return t;
|
|
380
382
|
}
|
|
381
|
-
function
|
|
383
|
+
function Ct(t) {
|
|
382
384
|
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
383
385
|
return t;
|
|
384
386
|
}
|
|
385
387
|
De = [te({
|
|
386
388
|
tagName: "wsx-button-group"
|
|
387
389
|
})];
|
|
388
|
-
let
|
|
390
|
+
let _t;
|
|
389
391
|
class It extends Q {
|
|
390
392
|
static get observedAttributes() {
|
|
391
393
|
return ["disabled"];
|
|
@@ -415,7 +417,8 @@ class It extends Q {
|
|
|
415
417
|
* 组件连接到DOM后的初始化
|
|
416
418
|
*/
|
|
417
419
|
onConnected() {
|
|
418
|
-
|
|
420
|
+
var e;
|
|
421
|
+
(e = super.onConnected) == null || e.call(this), this.updateChildrenDisabledState();
|
|
419
422
|
}
|
|
420
423
|
/**
|
|
421
424
|
* 更新所有子按钮的disabled状态
|
|
@@ -459,7 +462,7 @@ class It extends Q {
|
|
|
459
462
|
}
|
|
460
463
|
}
|
|
461
464
|
Ne = It;
|
|
462
|
-
[
|
|
465
|
+
[_t, $e] = Ot(Ne, [], De, 0, void 0, Q).c;
|
|
463
466
|
$e();
|
|
464
467
|
var de = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
465
468
|
function ze(t) {
|
|
@@ -471,14 +474,14 @@ var Pe = { exports: {} };
|
|
|
471
474
|
t.exports ? t.exports = r() : e.log = r();
|
|
472
475
|
})(de, function() {
|
|
473
476
|
var e = function() {
|
|
474
|
-
}, r = "undefined", i = typeof window !== r && typeof window.navigator !== r && /Trident\/|MSIE /.test(window.navigator.userAgent),
|
|
477
|
+
}, r = "undefined", i = typeof window !== r && typeof window.navigator !== r && /Trident\/|MSIE /.test(window.navigator.userAgent), S = [
|
|
475
478
|
"trace",
|
|
476
479
|
"debug",
|
|
477
480
|
"info",
|
|
478
481
|
"warn",
|
|
479
482
|
"error"
|
|
480
|
-
],
|
|
481
|
-
function
|
|
483
|
+
], A = {}, b = null;
|
|
484
|
+
function O(s, c) {
|
|
482
485
|
var o = s[c];
|
|
483
486
|
if (typeof o.bind == "function")
|
|
484
487
|
return o.bind(s);
|
|
@@ -494,29 +497,29 @@ var Pe = { exports: {} };
|
|
|
494
497
|
console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
|
|
495
498
|
}
|
|
496
499
|
function D(s) {
|
|
497
|
-
return s === "debug" && (s = "log"), typeof console === r ? !1 : s === "trace" && i ? y : console[s] !== void 0 ?
|
|
500
|
+
return s === "debug" && (s = "log"), typeof console === r ? !1 : s === "trace" && i ? y : console[s] !== void 0 ? O(console, s) : console.log !== void 0 ? O(console, "log") : e;
|
|
498
501
|
}
|
|
499
502
|
function F() {
|
|
500
|
-
for (var s = this.getLevel(), c = 0; c <
|
|
501
|
-
var o =
|
|
503
|
+
for (var s = this.getLevel(), c = 0; c < S.length; c++) {
|
|
504
|
+
var o = S[c];
|
|
502
505
|
this[o] = c < s ? e : this.methodFactory(o, s, this.name);
|
|
503
506
|
}
|
|
504
507
|
if (this.log = this.debug, typeof console === r && s < this.levels.SILENT)
|
|
505
508
|
return "No console available for logging";
|
|
506
509
|
}
|
|
507
|
-
function
|
|
510
|
+
function C(s) {
|
|
508
511
|
return function() {
|
|
509
512
|
typeof console !== r && (F.call(this), this[s].apply(this, arguments));
|
|
510
513
|
};
|
|
511
514
|
}
|
|
512
515
|
function L(s, c, o) {
|
|
513
|
-
return D(s) ||
|
|
516
|
+
return D(s) || C.apply(this, arguments);
|
|
514
517
|
}
|
|
515
518
|
function j(s, c) {
|
|
516
519
|
var o = this, n, u, h, p = "loglevel";
|
|
517
520
|
typeof s == "string" ? p += ":" + s : typeof s == "symbol" && (p = void 0);
|
|
518
521
|
function x(T) {
|
|
519
|
-
var g = (
|
|
522
|
+
var g = (S[T] || "silent").toUpperCase();
|
|
520
523
|
if (!(typeof window === r || !p)) {
|
|
521
524
|
try {
|
|
522
525
|
window.localStorage[p] = g;
|
|
@@ -529,7 +532,7 @@ var Pe = { exports: {} };
|
|
|
529
532
|
}
|
|
530
533
|
}
|
|
531
534
|
}
|
|
532
|
-
function
|
|
535
|
+
function k() {
|
|
533
536
|
var T;
|
|
534
537
|
if (!(typeof window === r || !p)) {
|
|
535
538
|
try {
|
|
@@ -538,16 +541,16 @@ var Pe = { exports: {} };
|
|
|
538
541
|
}
|
|
539
542
|
if (typeof T === r)
|
|
540
543
|
try {
|
|
541
|
-
var g = window.document.cookie,
|
|
544
|
+
var g = window.document.cookie, _ = encodeURIComponent(p), I = g.indexOf(_ + "=");
|
|
542
545
|
I !== -1 && (T = /^([^;]+)/.exec(
|
|
543
|
-
g.slice(I +
|
|
546
|
+
g.slice(I + _.length + 1)
|
|
544
547
|
)[1]);
|
|
545
548
|
} catch {
|
|
546
549
|
}
|
|
547
550
|
return o.levels[T] === void 0 && (T = void 0), T;
|
|
548
551
|
}
|
|
549
552
|
}
|
|
550
|
-
function
|
|
553
|
+
function m() {
|
|
551
554
|
if (!(typeof window === r || !p)) {
|
|
552
555
|
try {
|
|
553
556
|
window.localStorage.removeItem(p);
|
|
@@ -577,38 +580,38 @@ var Pe = { exports: {} };
|
|
|
577
580
|
}, o.setLevel = function(T, g) {
|
|
578
581
|
return h = d(T), g !== !1 && x(h), F.call(o);
|
|
579
582
|
}, o.setDefaultLevel = function(T) {
|
|
580
|
-
u = d(T),
|
|
583
|
+
u = d(T), k() || o.setLevel(T, !1);
|
|
581
584
|
}, o.resetLevel = function() {
|
|
582
|
-
h = null,
|
|
585
|
+
h = null, m(), F.call(o);
|
|
583
586
|
}, o.enableAll = function(T) {
|
|
584
587
|
o.setLevel(o.levels.TRACE, T);
|
|
585
588
|
}, o.disableAll = function(T) {
|
|
586
589
|
o.setLevel(o.levels.SILENT, T);
|
|
587
590
|
}, o.rebuild = function() {
|
|
588
|
-
if (
|
|
589
|
-
for (var T in
|
|
590
|
-
|
|
591
|
+
if (b !== o && (n = d(b.getLevel())), F.call(o), b === o)
|
|
592
|
+
for (var T in A)
|
|
593
|
+
A[T].rebuild();
|
|
591
594
|
}, n = d(
|
|
592
|
-
|
|
595
|
+
b ? b.getLevel() : "WARN"
|
|
593
596
|
);
|
|
594
|
-
var v =
|
|
597
|
+
var v = k();
|
|
595
598
|
v != null && (h = d(v)), F.call(o);
|
|
596
599
|
}
|
|
597
|
-
|
|
600
|
+
b = new j(), b.getLogger = function(c) {
|
|
598
601
|
if (typeof c != "symbol" && typeof c != "string" || c === "")
|
|
599
602
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
600
|
-
var o =
|
|
601
|
-
return o || (o =
|
|
603
|
+
var o = A[c];
|
|
604
|
+
return o || (o = A[c] = new j(
|
|
602
605
|
c,
|
|
603
|
-
|
|
606
|
+
b.methodFactory
|
|
604
607
|
)), o;
|
|
605
608
|
};
|
|
606
609
|
var a = typeof window !== r ? window.log : void 0;
|
|
607
|
-
return
|
|
608
|
-
return typeof window !== r && window.log ===
|
|
609
|
-
},
|
|
610
|
-
return
|
|
611
|
-
},
|
|
610
|
+
return b.noConflict = function() {
|
|
611
|
+
return typeof window !== r && window.log === b && (window.log = a), b;
|
|
612
|
+
}, b.getLoggers = function() {
|
|
613
|
+
return A;
|
|
614
|
+
}, b.default = b, b;
|
|
612
615
|
});
|
|
613
616
|
})(Pe);
|
|
614
617
|
var Ft = Pe.exports;
|
|
@@ -647,8 +650,8 @@ const ie = {
|
|
|
647
650
|
pretty: !pe()
|
|
648
651
|
};
|
|
649
652
|
function Nt(t = {}) {
|
|
650
|
-
const { name: e, level: r } = { ...ie, ...t }, i = e || ie.name,
|
|
651
|
-
return
|
|
653
|
+
const { name: e, level: r } = { ...ie, ...t }, i = e || ie.name, S = Lt.getLogger(i), A = r || ie.level;
|
|
654
|
+
return S.setLevel(je[A]), S;
|
|
652
655
|
}
|
|
653
656
|
function re(t, e) {
|
|
654
657
|
return t ? `[${t}] ${e}` : e;
|
|
@@ -756,7 +759,7 @@ function Bt(t, e) {
|
|
|
756
759
|
}, e));
|
|
757
760
|
};
|
|
758
761
|
}
|
|
759
|
-
function
|
|
762
|
+
function _r(t, e) {
|
|
760
763
|
const r = sessionStorage.getItem(`${le}-${e}`);
|
|
761
764
|
return r ? JSON.parse(r) : t;
|
|
762
765
|
}
|
|
@@ -766,13 +769,13 @@ let Ge, We;
|
|
|
766
769
|
function X(t, e, r) {
|
|
767
770
|
return (e = Ve(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
768
771
|
}
|
|
769
|
-
function Ht(t, e, r, i,
|
|
770
|
-
function
|
|
772
|
+
function Ht(t, e, r, i, S, A) {
|
|
773
|
+
function b(a, s, c) {
|
|
771
774
|
return function(o, n) {
|
|
772
775
|
return c && c(o), a[s].call(o, n);
|
|
773
776
|
};
|
|
774
777
|
}
|
|
775
|
-
function
|
|
778
|
+
function O(a, s) {
|
|
776
779
|
for (var c = 0; c < a.length; c++) a[c].call(s);
|
|
777
780
|
return s;
|
|
778
781
|
}
|
|
@@ -780,22 +783,22 @@ function Ht(t, e, r, i, k, O) {
|
|
|
780
783
|
if (typeof a != "function" && (o || a !== void 0)) throw new TypeError(s + " must " + (c || "be") + " a function" + (o ? "" : " or undefined"));
|
|
781
784
|
return a;
|
|
782
785
|
}
|
|
783
|
-
function D(a, s, c, o, n, u, h, p, x,
|
|
786
|
+
function D(a, s, c, o, n, u, h, p, x, k, m, d, v) {
|
|
784
787
|
function T(f) {
|
|
785
788
|
if (!v(f)) throw new TypeError("Attempted to access private element on non-instance");
|
|
786
789
|
}
|
|
787
|
-
var g,
|
|
790
|
+
var g, _ = s[0], I = s[3], M = !p;
|
|
788
791
|
if (!M) {
|
|
789
|
-
c || Array.isArray(
|
|
790
|
-
var l = {}, R = [],
|
|
791
|
-
|
|
792
|
+
c || Array.isArray(_) || (_ = [_]);
|
|
793
|
+
var l = {}, R = [], E = n === 3 ? "get" : n === 4 || d ? "set" : "value";
|
|
794
|
+
k ? (m || d ? l = { get: be(function() {
|
|
792
795
|
return I(this);
|
|
793
796
|
}, o, "get"), set: function(f) {
|
|
794
797
|
s[4](this, f);
|
|
795
|
-
} } : l[
|
|
798
|
+
} } : l[E] = I, m || be(l[E], o, n === 2 ? "" : E)) : m || (l = Object.getOwnPropertyDescriptor(a, o));
|
|
796
799
|
}
|
|
797
|
-
for (var w = a, B =
|
|
798
|
-
var W =
|
|
800
|
+
for (var w = a, B = _.length - 1; B >= 0; B -= c ? 2 : 1) {
|
|
801
|
+
var W = _[B], G = c ? _[B - 1] : void 0, Y = {}, z = { kind: ["field", "accessor", "method", "getter", "setter", "class"][n], name: o, metadata: u, addInitializer: (function(f, N) {
|
|
799
802
|
if (f.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
800
803
|
y(N, "An initializer", "be", !0), h.push(N);
|
|
801
804
|
}).bind(null, Y) };
|
|
@@ -803,58 +806,58 @@ function Ht(t, e, r, i, k, O) {
|
|
|
803
806
|
if (M) (g = y(W.call(G, w, z), "class decorators", "return")) && (w = g);
|
|
804
807
|
else {
|
|
805
808
|
var P, U;
|
|
806
|
-
z.static = x, z.private =
|
|
809
|
+
z.static = x, z.private = k, k ? n === 2 ? P = function(f) {
|
|
807
810
|
return T(f), l.value;
|
|
808
|
-
} : (n < 4 && (P =
|
|
811
|
+
} : (n < 4 && (P = b(l, "get", T)), n !== 3 && (U = b(l, "set", T))) : (P = function(f) {
|
|
809
812
|
return f[o];
|
|
810
813
|
}, (n < 2 || n === 4) && (U = function(f, N) {
|
|
811
814
|
f[o] = N;
|
|
812
815
|
}));
|
|
813
|
-
var V = z.access = { has:
|
|
816
|
+
var V = z.access = { has: k ? v.bind() : function(f) {
|
|
814
817
|
return o in f;
|
|
815
818
|
} };
|
|
816
|
-
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[
|
|
819
|
+
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[E], z), d) {
|
|
817
820
|
if (typeof w == "object" && w) (g = y(w.get, "accessor.get")) && (l.get = g), (g = y(w.set, "accessor.set")) && (l.set = g), (g = y(w.init, "accessor.init")) && R.push(g);
|
|
818
821
|
else if (w !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
819
|
-
} else y(w, (
|
|
822
|
+
} else y(w, (m ? "field" : "method") + " decorators", "return") && (m ? R.push(w) : l[E] = w);
|
|
820
823
|
}
|
|
821
824
|
} finally {
|
|
822
825
|
Y.v = !0;
|
|
823
826
|
}
|
|
824
827
|
}
|
|
825
|
-
return (
|
|
828
|
+
return (m || d) && p.push(function(f, N) {
|
|
826
829
|
for (var H = R.length - 1; H >= 0; H--) N = R[H].call(f, N);
|
|
827
830
|
return N;
|
|
828
|
-
}),
|
|
831
|
+
}), m || M || (k ? d ? p.push(b(l, "get"), b(l, "set")) : p.push(n === 2 ? l[E] : b.call.bind(l[E])) : Object.defineProperty(a, o, l)), w;
|
|
829
832
|
}
|
|
830
833
|
function F(a, s) {
|
|
831
834
|
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: s });
|
|
832
835
|
}
|
|
833
|
-
if (arguments.length >= 6) var
|
|
834
|
-
var L = Object.create(
|
|
835
|
-
var n, u, h = [], p = function(
|
|
836
|
-
return Wt(
|
|
836
|
+
if (arguments.length >= 6) var C = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
837
|
+
var L = Object.create(C ?? null), j = function(a, s, c, o) {
|
|
838
|
+
var n, u, h = [], p = function(E) {
|
|
839
|
+
return Wt(E) === a;
|
|
837
840
|
}, x = /* @__PURE__ */ new Map();
|
|
838
|
-
function E
|
|
839
|
-
|
|
841
|
+
function k(E) {
|
|
842
|
+
E && h.push(O.bind(null, E));
|
|
840
843
|
}
|
|
841
|
-
for (var
|
|
842
|
-
var d = s[
|
|
844
|
+
for (var m = 0; m < s.length; m++) {
|
|
845
|
+
var d = s[m];
|
|
843
846
|
if (Array.isArray(d)) {
|
|
844
|
-
var v = d[1], T = d[2], g = d.length > 3,
|
|
847
|
+
var v = d[1], T = d[2], g = d.length > 3, _ = 16 & v, I = !!(8 & v), M = (v &= 7) == 0, l = T + "/" + I;
|
|
845
848
|
if (!M && !g) {
|
|
846
849
|
var R = x.get(l);
|
|
847
850
|
if (R === !0 || R === 3 && v !== 4 || R === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
848
851
|
x.set(l, !(v > 2) || v);
|
|
849
852
|
}
|
|
850
|
-
D(I ? a : a.prototype, d,
|
|
853
|
+
D(I ? a : a.prototype, d, _, g ? "#" + T : Ve(T), v, o, I ? u = u || [] : n = n || [], h, I, g, M, v === 1, I && g ? p : c);
|
|
851
854
|
}
|
|
852
855
|
}
|
|
853
|
-
return
|
|
854
|
-
}(t, e,
|
|
856
|
+
return k(n), k(u), h;
|
|
857
|
+
}(t, e, S, L);
|
|
855
858
|
return r.length || F(t, L), { e: j, get c() {
|
|
856
859
|
var a = [];
|
|
857
|
-
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L),
|
|
860
|
+
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L), O.bind(null, a, t)];
|
|
858
861
|
} };
|
|
859
862
|
}
|
|
860
863
|
function Ve(t) {
|
|
@@ -901,9 +904,9 @@ class Kt extends Q {
|
|
|
901
904
|
}), X(this, "handlePanelClick", (r) => {
|
|
902
905
|
r.stopPropagation();
|
|
903
906
|
}), X(this, "handleColorSelect", (r) => {
|
|
904
|
-
var
|
|
907
|
+
var S;
|
|
905
908
|
const i = se(r);
|
|
906
|
-
this.setSelectedColor(i), this.closePanel(), zt(i, this.pluginType), (
|
|
909
|
+
this.setSelectedColor(i), this.closePanel(), zt(i, this.pluginType), (S = this.onColorPicked) == null || S.call(this, i), this.dispatchEvent(new CustomEvent("colorchange", {
|
|
907
910
|
detail: {
|
|
908
911
|
color: i
|
|
909
912
|
},
|
|
@@ -920,17 +923,17 @@ class Kt extends Q {
|
|
|
920
923
|
opacity: 0;
|
|
921
924
|
pointer-events: none;
|
|
922
925
|
`;
|
|
923
|
-
const i = Bt((
|
|
924
|
-
var
|
|
925
|
-
const
|
|
926
|
-
this.setSelectedColor(
|
|
926
|
+
const i = Bt((S) => {
|
|
927
|
+
var O;
|
|
928
|
+
const A = S.target, b = se(A.value);
|
|
929
|
+
this.setSelectedColor(b), this.setCustomColor(b), document.body.removeChild(r), (O = this.onColorPicked) == null || O.call(this, b), this.dispatchEvent(new CustomEvent("colorchange", {
|
|
927
930
|
detail: {
|
|
928
|
-
color:
|
|
931
|
+
color: b
|
|
929
932
|
},
|
|
930
933
|
bubbles: !0,
|
|
931
934
|
composed: !0
|
|
932
935
|
})), oe.debug("Custom color selected", {
|
|
933
|
-
color:
|
|
936
|
+
color: b
|
|
934
937
|
});
|
|
935
938
|
}, 30);
|
|
936
939
|
r.addEventListener("input", i), document.body.appendChild(r), requestAnimationFrame(() => {
|
|
@@ -1021,13 +1024,15 @@ class Kt extends Q {
|
|
|
1021
1024
|
* 组件连接到DOM后的初始化
|
|
1022
1025
|
*/
|
|
1023
1026
|
onConnected() {
|
|
1024
|
-
|
|
1027
|
+
var e;
|
|
1028
|
+
(e = super.onConnected) == null || e.call(this), document.addEventListener("click", this.handleDocumentClick), oe.info("ColorPicker connected to DOM");
|
|
1025
1029
|
}
|
|
1026
1030
|
/**
|
|
1027
1031
|
* 组件从DOM断开时的清理
|
|
1028
1032
|
*/
|
|
1029
1033
|
onDisconnected() {
|
|
1030
|
-
|
|
1034
|
+
var e;
|
|
1035
|
+
(e = super.onDisconnected) == null || e.call(this), document.removeEventListener("click", this.handleDocumentClick), oe.info("ColorPicker disconnected from DOM");
|
|
1031
1036
|
}
|
|
1032
1037
|
/**
|
|
1033
1038
|
* 属性变化处理
|
|
@@ -1074,13 +1079,13 @@ let Ke, Ze;
|
|
|
1074
1079
|
function ue(t, e, r) {
|
|
1075
1080
|
return (e = Xe(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1076
1081
|
}
|
|
1077
|
-
function Xt(t, e, r, i,
|
|
1078
|
-
function
|
|
1082
|
+
function Xt(t, e, r, i, S, A) {
|
|
1083
|
+
function b(a, s, c) {
|
|
1079
1084
|
return function(o, n) {
|
|
1080
1085
|
return c && c(o), a[s].call(o, n);
|
|
1081
1086
|
};
|
|
1082
1087
|
}
|
|
1083
|
-
function
|
|
1088
|
+
function O(a, s) {
|
|
1084
1089
|
for (var c = 0; c < a.length; c++) a[c].call(s);
|
|
1085
1090
|
return s;
|
|
1086
1091
|
}
|
|
@@ -1088,22 +1093,22 @@ function Xt(t, e, r, i, k, O) {
|
|
|
1088
1093
|
if (typeof a != "function" && (o || a !== void 0)) throw new TypeError(s + " must " + (c || "be") + " a function" + (o ? "" : " or undefined"));
|
|
1089
1094
|
return a;
|
|
1090
1095
|
}
|
|
1091
|
-
function D(a, s, c, o, n, u, h, p, x,
|
|
1096
|
+
function D(a, s, c, o, n, u, h, p, x, k, m, d, v) {
|
|
1092
1097
|
function T(f) {
|
|
1093
1098
|
if (!v(f)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1094
1099
|
}
|
|
1095
|
-
var g,
|
|
1100
|
+
var g, _ = s[0], I = s[3], M = !p;
|
|
1096
1101
|
if (!M) {
|
|
1097
|
-
c || Array.isArray(
|
|
1098
|
-
var l = {}, R = [],
|
|
1099
|
-
|
|
1102
|
+
c || Array.isArray(_) || (_ = [_]);
|
|
1103
|
+
var l = {}, R = [], E = n === 3 ? "get" : n === 4 || d ? "set" : "value";
|
|
1104
|
+
k ? (m || d ? l = { get: me(function() {
|
|
1100
1105
|
return I(this);
|
|
1101
1106
|
}, o, "get"), set: function(f) {
|
|
1102
1107
|
s[4](this, f);
|
|
1103
|
-
} } : l[
|
|
1108
|
+
} } : l[E] = I, m || me(l[E], o, n === 2 ? "" : E)) : m || (l = Object.getOwnPropertyDescriptor(a, o));
|
|
1104
1109
|
}
|
|
1105
|
-
for (var w = a, B =
|
|
1106
|
-
var W =
|
|
1110
|
+
for (var w = a, B = _.length - 1; B >= 0; B -= c ? 2 : 1) {
|
|
1111
|
+
var W = _[B], G = c ? _[B - 1] : void 0, Y = {}, z = { kind: ["field", "accessor", "method", "getter", "setter", "class"][n], name: o, metadata: u, addInitializer: (function(f, N) {
|
|
1107
1112
|
if (f.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1108
1113
|
y(N, "An initializer", "be", !0), h.push(N);
|
|
1109
1114
|
}).bind(null, Y) };
|
|
@@ -1111,58 +1116,58 @@ function Xt(t, e, r, i, k, O) {
|
|
|
1111
1116
|
if (M) (g = y(W.call(G, w, z), "class decorators", "return")) && (w = g);
|
|
1112
1117
|
else {
|
|
1113
1118
|
var P, U;
|
|
1114
|
-
z.static = x, z.private =
|
|
1119
|
+
z.static = x, z.private = k, k ? n === 2 ? P = function(f) {
|
|
1115
1120
|
return T(f), l.value;
|
|
1116
|
-
} : (n < 4 && (P =
|
|
1121
|
+
} : (n < 4 && (P = b(l, "get", T)), n !== 3 && (U = b(l, "set", T))) : (P = function(f) {
|
|
1117
1122
|
return f[o];
|
|
1118
1123
|
}, (n < 2 || n === 4) && (U = function(f, N) {
|
|
1119
1124
|
f[o] = N;
|
|
1120
1125
|
}));
|
|
1121
|
-
var V = z.access = { has:
|
|
1126
|
+
var V = z.access = { has: k ? v.bind() : function(f) {
|
|
1122
1127
|
return o in f;
|
|
1123
1128
|
} };
|
|
1124
|
-
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[
|
|
1129
|
+
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[E], z), d) {
|
|
1125
1130
|
if (typeof w == "object" && w) (g = y(w.get, "accessor.get")) && (l.get = g), (g = y(w.set, "accessor.set")) && (l.set = g), (g = y(w.init, "accessor.init")) && R.push(g);
|
|
1126
1131
|
else if (w !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1127
|
-
} else y(w, (
|
|
1132
|
+
} else y(w, (m ? "field" : "method") + " decorators", "return") && (m ? R.push(w) : l[E] = w);
|
|
1128
1133
|
}
|
|
1129
1134
|
} finally {
|
|
1130
1135
|
Y.v = !0;
|
|
1131
1136
|
}
|
|
1132
1137
|
}
|
|
1133
|
-
return (
|
|
1138
|
+
return (m || d) && p.push(function(f, N) {
|
|
1134
1139
|
for (var H = R.length - 1; H >= 0; H--) N = R[H].call(f, N);
|
|
1135
1140
|
return N;
|
|
1136
|
-
}),
|
|
1141
|
+
}), m || M || (k ? d ? p.push(b(l, "get"), b(l, "set")) : p.push(n === 2 ? l[E] : b.call.bind(l[E])) : Object.defineProperty(a, o, l)), w;
|
|
1137
1142
|
}
|
|
1138
1143
|
function F(a, s) {
|
|
1139
1144
|
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: s });
|
|
1140
1145
|
}
|
|
1141
|
-
if (arguments.length >= 6) var
|
|
1142
|
-
var L = Object.create(
|
|
1143
|
-
var n, u, h = [], p = function(
|
|
1144
|
-
return Qt(
|
|
1146
|
+
if (arguments.length >= 6) var C = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1147
|
+
var L = Object.create(C ?? null), j = function(a, s, c, o) {
|
|
1148
|
+
var n, u, h = [], p = function(E) {
|
|
1149
|
+
return Qt(E) === a;
|
|
1145
1150
|
}, x = /* @__PURE__ */ new Map();
|
|
1146
|
-
function E
|
|
1147
|
-
|
|
1151
|
+
function k(E) {
|
|
1152
|
+
E && h.push(O.bind(null, E));
|
|
1148
1153
|
}
|
|
1149
|
-
for (var
|
|
1150
|
-
var d = s[
|
|
1154
|
+
for (var m = 0; m < s.length; m++) {
|
|
1155
|
+
var d = s[m];
|
|
1151
1156
|
if (Array.isArray(d)) {
|
|
1152
|
-
var v = d[1], T = d[2], g = d.length > 3,
|
|
1157
|
+
var v = d[1], T = d[2], g = d.length > 3, _ = 16 & v, I = !!(8 & v), M = (v &= 7) == 0, l = T + "/" + I;
|
|
1153
1158
|
if (!M && !g) {
|
|
1154
1159
|
var R = x.get(l);
|
|
1155
1160
|
if (R === !0 || R === 3 && v !== 4 || R === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
1156
1161
|
x.set(l, !(v > 2) || v);
|
|
1157
1162
|
}
|
|
1158
|
-
D(I ? a : a.prototype, d,
|
|
1163
|
+
D(I ? a : a.prototype, d, _, g ? "#" + T : Xe(T), v, o, I ? u = u || [] : n = n || [], h, I, g, M, v === 1, I && g ? p : c);
|
|
1159
1164
|
}
|
|
1160
1165
|
}
|
|
1161
|
-
return
|
|
1162
|
-
}(t, e,
|
|
1166
|
+
return k(n), k(u), h;
|
|
1167
|
+
}(t, e, S, L);
|
|
1163
1168
|
return r.length || F(t, L), { e: j, get c() {
|
|
1164
1169
|
var a = [];
|
|
1165
|
-
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L),
|
|
1170
|
+
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L), O.bind(null, a, t)];
|
|
1166
1171
|
} };
|
|
1167
1172
|
}
|
|
1168
1173
|
function Xe(t) {
|
|
@@ -1243,13 +1248,13 @@ let Qe, Je;
|
|
|
1243
1248
|
function ee(t, e, r) {
|
|
1244
1249
|
return (e = et(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1245
1250
|
}
|
|
1246
|
-
function tr(t, e, r, i,
|
|
1247
|
-
function
|
|
1251
|
+
function tr(t, e, r, i, S, A) {
|
|
1252
|
+
function b(a, s, c) {
|
|
1248
1253
|
return function(o, n) {
|
|
1249
1254
|
return c && c(o), a[s].call(o, n);
|
|
1250
1255
|
};
|
|
1251
1256
|
}
|
|
1252
|
-
function
|
|
1257
|
+
function O(a, s) {
|
|
1253
1258
|
for (var c = 0; c < a.length; c++) a[c].call(s);
|
|
1254
1259
|
return s;
|
|
1255
1260
|
}
|
|
@@ -1257,22 +1262,22 @@ function tr(t, e, r, i, k, O) {
|
|
|
1257
1262
|
if (typeof a != "function" && (o || a !== void 0)) throw new TypeError(s + " must " + (c || "be") + " a function" + (o ? "" : " or undefined"));
|
|
1258
1263
|
return a;
|
|
1259
1264
|
}
|
|
1260
|
-
function D(a, s, c, o, n, u, h, p, x,
|
|
1265
|
+
function D(a, s, c, o, n, u, h, p, x, k, m, d, v) {
|
|
1261
1266
|
function T(f) {
|
|
1262
1267
|
if (!v(f)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1263
1268
|
}
|
|
1264
|
-
var g,
|
|
1269
|
+
var g, _ = s[0], I = s[3], M = !p;
|
|
1265
1270
|
if (!M) {
|
|
1266
|
-
c || Array.isArray(
|
|
1267
|
-
var l = {}, R = [],
|
|
1268
|
-
|
|
1271
|
+
c || Array.isArray(_) || (_ = [_]);
|
|
1272
|
+
var l = {}, R = [], E = n === 3 ? "get" : n === 4 || d ? "set" : "value";
|
|
1273
|
+
k ? (m || d ? l = { get: ye(function() {
|
|
1269
1274
|
return I(this);
|
|
1270
1275
|
}, o, "get"), set: function(f) {
|
|
1271
1276
|
s[4](this, f);
|
|
1272
|
-
} } : l[
|
|
1277
|
+
} } : l[E] = I, m || ye(l[E], o, n === 2 ? "" : E)) : m || (l = Object.getOwnPropertyDescriptor(a, o));
|
|
1273
1278
|
}
|
|
1274
|
-
for (var w = a, B =
|
|
1275
|
-
var W =
|
|
1279
|
+
for (var w = a, B = _.length - 1; B >= 0; B -= c ? 2 : 1) {
|
|
1280
|
+
var W = _[B], G = c ? _[B - 1] : void 0, Y = {}, z = { kind: ["field", "accessor", "method", "getter", "setter", "class"][n], name: o, metadata: u, addInitializer: (function(f, N) {
|
|
1276
1281
|
if (f.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1277
1282
|
y(N, "An initializer", "be", !0), h.push(N);
|
|
1278
1283
|
}).bind(null, Y) };
|
|
@@ -1280,58 +1285,58 @@ function tr(t, e, r, i, k, O) {
|
|
|
1280
1285
|
if (M) (g = y(W.call(G, w, z), "class decorators", "return")) && (w = g);
|
|
1281
1286
|
else {
|
|
1282
1287
|
var P, U;
|
|
1283
|
-
z.static = x, z.private =
|
|
1288
|
+
z.static = x, z.private = k, k ? n === 2 ? P = function(f) {
|
|
1284
1289
|
return T(f), l.value;
|
|
1285
|
-
} : (n < 4 && (P =
|
|
1290
|
+
} : (n < 4 && (P = b(l, "get", T)), n !== 3 && (U = b(l, "set", T))) : (P = function(f) {
|
|
1286
1291
|
return f[o];
|
|
1287
1292
|
}, (n < 2 || n === 4) && (U = function(f, N) {
|
|
1288
1293
|
f[o] = N;
|
|
1289
1294
|
}));
|
|
1290
|
-
var V = z.access = { has:
|
|
1295
|
+
var V = z.access = { has: k ? v.bind() : function(f) {
|
|
1291
1296
|
return o in f;
|
|
1292
1297
|
} };
|
|
1293
|
-
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[
|
|
1298
|
+
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[E], z), d) {
|
|
1294
1299
|
if (typeof w == "object" && w) (g = y(w.get, "accessor.get")) && (l.get = g), (g = y(w.set, "accessor.set")) && (l.set = g), (g = y(w.init, "accessor.init")) && R.push(g);
|
|
1295
1300
|
else if (w !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1296
|
-
} else y(w, (
|
|
1301
|
+
} else y(w, (m ? "field" : "method") + " decorators", "return") && (m ? R.push(w) : l[E] = w);
|
|
1297
1302
|
}
|
|
1298
1303
|
} finally {
|
|
1299
1304
|
Y.v = !0;
|
|
1300
1305
|
}
|
|
1301
1306
|
}
|
|
1302
|
-
return (
|
|
1307
|
+
return (m || d) && p.push(function(f, N) {
|
|
1303
1308
|
for (var H = R.length - 1; H >= 0; H--) N = R[H].call(f, N);
|
|
1304
1309
|
return N;
|
|
1305
|
-
}),
|
|
1310
|
+
}), m || M || (k ? d ? p.push(b(l, "get"), b(l, "set")) : p.push(n === 2 ? l[E] : b.call.bind(l[E])) : Object.defineProperty(a, o, l)), w;
|
|
1306
1311
|
}
|
|
1307
1312
|
function F(a, s) {
|
|
1308
1313
|
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: s });
|
|
1309
1314
|
}
|
|
1310
|
-
if (arguments.length >= 6) var
|
|
1311
|
-
var L = Object.create(
|
|
1312
|
-
var n, u, h = [], p = function(
|
|
1313
|
-
return nr(
|
|
1315
|
+
if (arguments.length >= 6) var C = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1316
|
+
var L = Object.create(C ?? null), j = function(a, s, c, o) {
|
|
1317
|
+
var n, u, h = [], p = function(E) {
|
|
1318
|
+
return nr(E) === a;
|
|
1314
1319
|
}, x = /* @__PURE__ */ new Map();
|
|
1315
|
-
function E
|
|
1316
|
-
|
|
1320
|
+
function k(E) {
|
|
1321
|
+
E && h.push(O.bind(null, E));
|
|
1317
1322
|
}
|
|
1318
|
-
for (var
|
|
1319
|
-
var d = s[
|
|
1323
|
+
for (var m = 0; m < s.length; m++) {
|
|
1324
|
+
var d = s[m];
|
|
1320
1325
|
if (Array.isArray(d)) {
|
|
1321
|
-
var v = d[1], T = d[2], g = d.length > 3,
|
|
1326
|
+
var v = d[1], T = d[2], g = d.length > 3, _ = 16 & v, I = !!(8 & v), M = (v &= 7) == 0, l = T + "/" + I;
|
|
1322
1327
|
if (!M && !g) {
|
|
1323
1328
|
var R = x.get(l);
|
|
1324
1329
|
if (R === !0 || R === 3 && v !== 4 || R === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
1325
1330
|
x.set(l, !(v > 2) || v);
|
|
1326
1331
|
}
|
|
1327
|
-
D(I ? a : a.prototype, d,
|
|
1332
|
+
D(I ? a : a.prototype, d, _, g ? "#" + T : et(T), v, o, I ? u = u || [] : n = n || [], h, I, g, M, v === 1, I && g ? p : c);
|
|
1328
1333
|
}
|
|
1329
1334
|
}
|
|
1330
|
-
return
|
|
1331
|
-
}(t, e,
|
|
1335
|
+
return k(n), k(u), h;
|
|
1336
|
+
}(t, e, S, L);
|
|
1332
1337
|
return r.length || F(t, L), { e: j, get c() {
|
|
1333
1338
|
var a = [];
|
|
1334
|
-
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L),
|
|
1339
|
+
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L), O.bind(null, a, t)];
|
|
1335
1340
|
} };
|
|
1336
1341
|
}
|
|
1337
1342
|
function et(t) {
|
|
@@ -1377,12 +1382,12 @@ class ir extends Q {
|
|
|
1377
1382
|
this.config.disabled || this.isOpen || (this.isOpen = !0, this.rerender());
|
|
1378
1383
|
}), ee(this, "closeDropdown", () => {
|
|
1379
1384
|
this.isOpen && (this.isOpen = !1, this.rerender(), this.detachOutsideClickHandler());
|
|
1380
|
-
}), ee(this, "selectOption", (
|
|
1381
|
-
this.setValue(
|
|
1385
|
+
}), ee(this, "selectOption", (b) => {
|
|
1386
|
+
this.setValue(b), this.config.trigger === "click" && this.closeDropdown();
|
|
1382
1387
|
}), ee(this, "attachOutsideClickHandler", () => {
|
|
1383
|
-
this.config.trigger !== "hover" && (this.outsideClickHandler = (
|
|
1384
|
-
const
|
|
1385
|
-
this.dropdownElement && this.buttonElement && !this.dropdownElement.contains(
|
|
1388
|
+
this.config.trigger !== "hover" && (this.outsideClickHandler = (b) => {
|
|
1389
|
+
const O = b.target;
|
|
1390
|
+
this.dropdownElement && this.buttonElement && !this.dropdownElement.contains(O) && !this.buttonElement.contains(O) && this.closeDropdown();
|
|
1386
1391
|
}, document.addEventListener("click", this.outsideClickHandler, !0));
|
|
1387
1392
|
}), ee(this, "detachOutsideClickHandler", () => {
|
|
1388
1393
|
this.outsideClickHandler && (document.removeEventListener("click", this.outsideClickHandler, !0), this.outsideClickHandler = void 0);
|
|
@@ -1400,10 +1405,10 @@ class ir extends Q {
|
|
|
1400
1405
|
enumerable: !0,
|
|
1401
1406
|
configurable: !0
|
|
1402
1407
|
});
|
|
1403
|
-
const [
|
|
1408
|
+
const [S, A] = this.useState("isOpen", !1);
|
|
1404
1409
|
Object.defineProperty(this, "isOpen", {
|
|
1405
|
-
get:
|
|
1406
|
-
set:
|
|
1410
|
+
get: S,
|
|
1411
|
+
set: A,
|
|
1407
1412
|
enumerable: !0,
|
|
1408
1413
|
configurable: !0
|
|
1409
1414
|
});
|
|
@@ -1439,7 +1444,8 @@ class ir extends Q {
|
|
|
1439
1444
|
* 组件断开连接时清理
|
|
1440
1445
|
*/
|
|
1441
1446
|
onDisconnected() {
|
|
1442
|
-
|
|
1447
|
+
var e;
|
|
1448
|
+
(e = super.onDisconnected) == null || e.call(this), this.detachOutsideClickHandler();
|
|
1443
1449
|
}
|
|
1444
1450
|
}
|
|
1445
1451
|
qe = ir;
|
|
@@ -1451,13 +1457,13 @@ let rt, nt;
|
|
|
1451
1457
|
function q(t, e, r) {
|
|
1452
1458
|
return (e = ot(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1453
1459
|
}
|
|
1454
|
-
function ar(t, e, r, i,
|
|
1455
|
-
function
|
|
1460
|
+
function ar(t, e, r, i, S, A) {
|
|
1461
|
+
function b(a, s, c) {
|
|
1456
1462
|
return function(o, n) {
|
|
1457
1463
|
return c && c(o), a[s].call(o, n);
|
|
1458
1464
|
};
|
|
1459
1465
|
}
|
|
1460
|
-
function
|
|
1466
|
+
function O(a, s) {
|
|
1461
1467
|
for (var c = 0; c < a.length; c++) a[c].call(s);
|
|
1462
1468
|
return s;
|
|
1463
1469
|
}
|
|
@@ -1465,22 +1471,22 @@ function ar(t, e, r, i, k, O) {
|
|
|
1465
1471
|
if (typeof a != "function" && (o || a !== void 0)) throw new TypeError(s + " must " + (c || "be") + " a function" + (o ? "" : " or undefined"));
|
|
1466
1472
|
return a;
|
|
1467
1473
|
}
|
|
1468
|
-
function D(a, s, c, o, n, u, h, p, x,
|
|
1474
|
+
function D(a, s, c, o, n, u, h, p, x, k, m, d, v) {
|
|
1469
1475
|
function T(f) {
|
|
1470
1476
|
if (!v(f)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1471
1477
|
}
|
|
1472
|
-
var g,
|
|
1478
|
+
var g, _ = s[0], I = s[3], M = !p;
|
|
1473
1479
|
if (!M) {
|
|
1474
|
-
c || Array.isArray(
|
|
1475
|
-
var l = {}, R = [],
|
|
1476
|
-
|
|
1480
|
+
c || Array.isArray(_) || (_ = [_]);
|
|
1481
|
+
var l = {}, R = [], E = n === 3 ? "get" : n === 4 || d ? "set" : "value";
|
|
1482
|
+
k ? (m || d ? l = { get: we(function() {
|
|
1477
1483
|
return I(this);
|
|
1478
1484
|
}, o, "get"), set: function(f) {
|
|
1479
1485
|
s[4](this, f);
|
|
1480
|
-
} } : l[
|
|
1486
|
+
} } : l[E] = I, m || we(l[E], o, n === 2 ? "" : E)) : m || (l = Object.getOwnPropertyDescriptor(a, o));
|
|
1481
1487
|
}
|
|
1482
|
-
for (var w = a, B =
|
|
1483
|
-
var W =
|
|
1488
|
+
for (var w = a, B = _.length - 1; B >= 0; B -= c ? 2 : 1) {
|
|
1489
|
+
var W = _[B], G = c ? _[B - 1] : void 0, Y = {}, z = { kind: ["field", "accessor", "method", "getter", "setter", "class"][n], name: o, metadata: u, addInitializer: (function(f, N) {
|
|
1484
1490
|
if (f.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1485
1491
|
y(N, "An initializer", "be", !0), h.push(N);
|
|
1486
1492
|
}).bind(null, Y) };
|
|
@@ -1488,58 +1494,58 @@ function ar(t, e, r, i, k, O) {
|
|
|
1488
1494
|
if (M) (g = y(W.call(G, w, z), "class decorators", "return")) && (w = g);
|
|
1489
1495
|
else {
|
|
1490
1496
|
var P, U;
|
|
1491
|
-
z.static = x, z.private =
|
|
1497
|
+
z.static = x, z.private = k, k ? n === 2 ? P = function(f) {
|
|
1492
1498
|
return T(f), l.value;
|
|
1493
|
-
} : (n < 4 && (P =
|
|
1499
|
+
} : (n < 4 && (P = b(l, "get", T)), n !== 3 && (U = b(l, "set", T))) : (P = function(f) {
|
|
1494
1500
|
return f[o];
|
|
1495
1501
|
}, (n < 2 || n === 4) && (U = function(f, N) {
|
|
1496
1502
|
f[o] = N;
|
|
1497
1503
|
}));
|
|
1498
|
-
var V = z.access = { has:
|
|
1504
|
+
var V = z.access = { has: k ? v.bind() : function(f) {
|
|
1499
1505
|
return o in f;
|
|
1500
1506
|
} };
|
|
1501
|
-
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[
|
|
1507
|
+
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[E], z), d) {
|
|
1502
1508
|
if (typeof w == "object" && w) (g = y(w.get, "accessor.get")) && (l.get = g), (g = y(w.set, "accessor.set")) && (l.set = g), (g = y(w.init, "accessor.init")) && R.push(g);
|
|
1503
1509
|
else if (w !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1504
|
-
} else y(w, (
|
|
1510
|
+
} else y(w, (m ? "field" : "method") + " decorators", "return") && (m ? R.push(w) : l[E] = w);
|
|
1505
1511
|
}
|
|
1506
1512
|
} finally {
|
|
1507
1513
|
Y.v = !0;
|
|
1508
1514
|
}
|
|
1509
1515
|
}
|
|
1510
|
-
return (
|
|
1516
|
+
return (m || d) && p.push(function(f, N) {
|
|
1511
1517
|
for (var H = R.length - 1; H >= 0; H--) N = R[H].call(f, N);
|
|
1512
1518
|
return N;
|
|
1513
|
-
}),
|
|
1519
|
+
}), m || M || (k ? d ? p.push(b(l, "get"), b(l, "set")) : p.push(n === 2 ? l[E] : b.call.bind(l[E])) : Object.defineProperty(a, o, l)), w;
|
|
1514
1520
|
}
|
|
1515
1521
|
function F(a, s) {
|
|
1516
1522
|
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: s });
|
|
1517
1523
|
}
|
|
1518
|
-
if (arguments.length >= 6) var
|
|
1519
|
-
var L = Object.create(
|
|
1520
|
-
var n, u, h = [], p = function(
|
|
1521
|
-
return lr(
|
|
1524
|
+
if (arguments.length >= 6) var C = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1525
|
+
var L = Object.create(C ?? null), j = function(a, s, c, o) {
|
|
1526
|
+
var n, u, h = [], p = function(E) {
|
|
1527
|
+
return lr(E) === a;
|
|
1522
1528
|
}, x = /* @__PURE__ */ new Map();
|
|
1523
|
-
function E
|
|
1524
|
-
|
|
1529
|
+
function k(E) {
|
|
1530
|
+
E && h.push(O.bind(null, E));
|
|
1525
1531
|
}
|
|
1526
|
-
for (var
|
|
1527
|
-
var d = s[
|
|
1532
|
+
for (var m = 0; m < s.length; m++) {
|
|
1533
|
+
var d = s[m];
|
|
1528
1534
|
if (Array.isArray(d)) {
|
|
1529
|
-
var v = d[1], T = d[2], g = d.length > 3,
|
|
1535
|
+
var v = d[1], T = d[2], g = d.length > 3, _ = 16 & v, I = !!(8 & v), M = (v &= 7) == 0, l = T + "/" + I;
|
|
1530
1536
|
if (!M && !g) {
|
|
1531
1537
|
var R = x.get(l);
|
|
1532
1538
|
if (R === !0 || R === 3 && v !== 4 || R === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
1533
1539
|
x.set(l, !(v > 2) || v);
|
|
1534
1540
|
}
|
|
1535
|
-
D(I ? a : a.prototype, d,
|
|
1541
|
+
D(I ? a : a.prototype, d, _, g ? "#" + T : ot(T), v, o, I ? u = u || [] : n = n || [], h, I, g, M, v === 1, I && g ? p : c);
|
|
1536
1542
|
}
|
|
1537
1543
|
}
|
|
1538
|
-
return
|
|
1539
|
-
}(t, e,
|
|
1544
|
+
return k(n), k(u), h;
|
|
1545
|
+
}(t, e, S, L);
|
|
1540
1546
|
return r.length || F(t, L), { e: j, get c() {
|
|
1541
1547
|
var a = [];
|
|
1542
|
-
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L),
|
|
1548
|
+
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L), O.bind(null, a, t)];
|
|
1543
1549
|
} };
|
|
1544
1550
|
}
|
|
1545
1551
|
function ot(t) {
|
|
@@ -1593,7 +1599,7 @@ class ur extends Q {
|
|
|
1593
1599
|
this.isOpen && (this.isOpen = !1, this.searchQuery = "", this.rerender(), this.detachOutsideClickHandler());
|
|
1594
1600
|
}), q(this, "selectOption", (y) => {
|
|
1595
1601
|
if (this.config.multiple) {
|
|
1596
|
-
const D = Array.isArray(this.selectedValue) ? this.selectedValue : [], F = D.includes(y) ? D.filter((
|
|
1602
|
+
const D = Array.isArray(this.selectedValue) ? this.selectedValue : [], F = D.includes(y) ? D.filter((C) => C !== y) : [...D, y];
|
|
1597
1603
|
this.selectedValue = F;
|
|
1598
1604
|
} else
|
|
1599
1605
|
this.selectedValue = y, this.closeDropdown();
|
|
@@ -1634,17 +1640,17 @@ class ur extends Q {
|
|
|
1634
1640
|
enumerable: !0,
|
|
1635
1641
|
configurable: !0
|
|
1636
1642
|
});
|
|
1637
|
-
const [
|
|
1643
|
+
const [S, A] = this.useState("searchQuery", "");
|
|
1638
1644
|
Object.defineProperty(this, "searchQuery", {
|
|
1639
|
-
get:
|
|
1640
|
-
set:
|
|
1645
|
+
get: S,
|
|
1646
|
+
set: A,
|
|
1641
1647
|
enumerable: !0,
|
|
1642
1648
|
configurable: !0
|
|
1643
1649
|
});
|
|
1644
|
-
const [
|
|
1650
|
+
const [b, O] = this.useState("isOpen", !1);
|
|
1645
1651
|
Object.defineProperty(this, "isOpen", {
|
|
1646
|
-
get:
|
|
1647
|
-
set:
|
|
1652
|
+
get: b,
|
|
1653
|
+
set: O,
|
|
1648
1654
|
enumerable: !0,
|
|
1649
1655
|
configurable: !0
|
|
1650
1656
|
});
|
|
@@ -1687,34 +1693,35 @@ class ur extends Q {
|
|
|
1687
1693
|
}
|
|
1688
1694
|
render() {
|
|
1689
1695
|
const e = this.getFilteredOptions(), r = this.config.multiple, i = Array.isArray(this.selectedValue) ? this.selectedValue : this.selectedValue ? [this.selectedValue] : [];
|
|
1690
|
-
let
|
|
1696
|
+
let S = "";
|
|
1691
1697
|
if (r)
|
|
1692
1698
|
if (i.length === 0)
|
|
1693
|
-
|
|
1699
|
+
S = this.config.placeholder || "Select...";
|
|
1694
1700
|
else if (i.length === 1) {
|
|
1695
|
-
const
|
|
1696
|
-
|
|
1701
|
+
const A = this.options.find((b) => b.value === i[0]);
|
|
1702
|
+
S = (A == null ? void 0 : A.label) || i[0];
|
|
1697
1703
|
} else
|
|
1698
|
-
|
|
1704
|
+
S = `${i.length} selected`;
|
|
1699
1705
|
else {
|
|
1700
|
-
const
|
|
1701
|
-
|
|
1706
|
+
const A = this.options.find((b) => b.value === this.selectedValue);
|
|
1707
|
+
S = (A == null ? void 0 : A.label) || this.config.placeholder || "Select...";
|
|
1702
1708
|
}
|
|
1703
|
-
return /* @__PURE__ */ $("div", { class: "combobox-container" }, /* @__PURE__ */ $("div", { class: "combobox-input-wrapper" }, r && i.length > 0 && /* @__PURE__ */ $("div", { class: "combobox-tags" }, i.slice(0, 2).map((
|
|
1704
|
-
const
|
|
1705
|
-
return /* @__PURE__ */ $("span", { key:
|
|
1706
|
-
|
|
1709
|
+
return /* @__PURE__ */ $("div", { class: "combobox-container" }, /* @__PURE__ */ $("div", { class: "combobox-input-wrapper" }, r && i.length > 0 && /* @__PURE__ */ $("div", { class: "combobox-tags" }, i.slice(0, 2).map((A) => {
|
|
1710
|
+
const b = this.options.find((O) => O.value === A);
|
|
1711
|
+
return /* @__PURE__ */ $("span", { key: A, class: "combobox-tag" }, (b == null ? void 0 : b.label) || A, /* @__PURE__ */ $("button", { class: "combobox-tag-remove", onClick: (O) => {
|
|
1712
|
+
O.stopPropagation(), this.removeValue(A);
|
|
1707
1713
|
}, "data-wsx-key": "Combobox-button-text-3" }, "×"));
|
|
1708
|
-
}), i.length > 2 && /* @__PURE__ */ $("span", { class: "combobox-tag-more" }, "+", i.length - 2)), /* @__PURE__ */ $("input", { ref: (
|
|
1709
|
-
const
|
|
1710
|
-
return /* @__PURE__ */ $("button", { key:
|
|
1714
|
+
}), i.length > 2 && /* @__PURE__ */ $("span", { class: "combobox-tag-more" }, "+", i.length - 2)), /* @__PURE__ */ $("input", { ref: (A) => this.inputElement = A, type: "text", class: "combobox-input", placeholder: S, value: this.config.searchable && this.isOpen ? this.searchQuery : "", onInput: this.handleInput, onFocus: this.openDropdown, onClick: this.openDropdown, disabled: this.config.disabled, readonly: !this.config.searchable, "data-wsx-key": "Combobox-input-text-1-3" }), /* @__PURE__ */ $("button", { class: `combobox-arrow ${this.isOpen ? "open" : ""}`, onClick: this.toggleDropdown, disabled: this.config.disabled, "data-wsx-key": "Combobox-button-text-1-5" }, this.isOpen ? "▲" : "▼")), this.isOpen && /* @__PURE__ */ $("div", { ref: (A) => this.dropdownElement = A, class: `combobox-menu combobox-${this.config.position} combobox-${this.config.align}`, role: "listbox" }, e.length === 0 ? /* @__PURE__ */ $("div", { class: "combobox-empty" }, this.config.searchable && this.searchQuery ? "No results found" : "No options") : e.map((A) => {
|
|
1715
|
+
const b = r ? i.includes(A.value) : A.value === this.selectedValue;
|
|
1716
|
+
return /* @__PURE__ */ $("button", { key: A.value, class: `combobox-option ${b ? "selected" : ""} ${A.disabled ? "disabled" : ""}`, onClick: () => !A.disabled && this.selectOption(A.value), role: "option", "aria-selected": b, disabled: A.disabled, "data-wsx-key": "Combobox-button-text-0" }, r && /* @__PURE__ */ $("span", { class: "combobox-checkbox" }, b ? "✓" : ""), A.render ? A.render() : /* @__PURE__ */ $("span", null, A.label));
|
|
1711
1717
|
})));
|
|
1712
1718
|
}
|
|
1713
1719
|
/**
|
|
1714
1720
|
* 组件断开连接时清理
|
|
1715
1721
|
*/
|
|
1716
1722
|
onDisconnected() {
|
|
1717
|
-
|
|
1723
|
+
var e;
|
|
1724
|
+
(e = super.onDisconnected) == null || e.call(this), this.detachOutsideClickHandler();
|
|
1718
1725
|
}
|
|
1719
1726
|
}
|
|
1720
1727
|
tt = ur;
|
|
@@ -1730,10 +1737,10 @@ class ke {
|
|
|
1730
1737
|
const {
|
|
1731
1738
|
container: r,
|
|
1732
1739
|
items: i,
|
|
1733
|
-
gap:
|
|
1734
|
-
reservedWidth:
|
|
1735
|
-
overflowButtonWidth:
|
|
1736
|
-
padding:
|
|
1740
|
+
gap: S = 16,
|
|
1741
|
+
reservedWidth: A = 0,
|
|
1742
|
+
overflowButtonWidth: b = 0,
|
|
1743
|
+
padding: O = 0,
|
|
1737
1744
|
minVisibleItems: y = 1
|
|
1738
1745
|
} = e;
|
|
1739
1746
|
if (!r || i.length === 0)
|
|
@@ -1742,8 +1749,8 @@ class ke {
|
|
|
1742
1749
|
hiddenIndices: [],
|
|
1743
1750
|
needsOverflow: !1
|
|
1744
1751
|
};
|
|
1745
|
-
const F = r.offsetWidth -
|
|
1746
|
-
let
|
|
1752
|
+
const F = r.offsetWidth - A - O * 2;
|
|
1753
|
+
let C = 0;
|
|
1747
1754
|
const L = [], j = [];
|
|
1748
1755
|
for (let o = 0; o < i.length; o++) {
|
|
1749
1756
|
const n = i[o];
|
|
@@ -1751,8 +1758,8 @@ class ke {
|
|
|
1751
1758
|
L.push(o);
|
|
1752
1759
|
continue;
|
|
1753
1760
|
}
|
|
1754
|
-
const u = n.offsetWidth + (o > 0 ?
|
|
1755
|
-
|
|
1761
|
+
const u = n.offsetWidth + (o > 0 ? S : 0);
|
|
1762
|
+
C + u <= F ? (C += u, L.push(o)) : j.push(o);
|
|
1756
1763
|
}
|
|
1757
1764
|
if (j.length === 0)
|
|
1758
1765
|
return {
|
|
@@ -1760,8 +1767,8 @@ class ke {
|
|
|
1760
1767
|
hiddenIndices: [],
|
|
1761
1768
|
needsOverflow: !1
|
|
1762
1769
|
};
|
|
1763
|
-
const a = F -
|
|
1764
|
-
|
|
1770
|
+
const a = F - b - S;
|
|
1771
|
+
C = 0;
|
|
1765
1772
|
const s = [], c = [];
|
|
1766
1773
|
for (let o = 0; o < i.length; o++) {
|
|
1767
1774
|
const n = i[o];
|
|
@@ -1769,8 +1776,8 @@ class ke {
|
|
|
1769
1776
|
s.length < y ? s.push(o) : c.push(o);
|
|
1770
1777
|
continue;
|
|
1771
1778
|
}
|
|
1772
|
-
const u = n.offsetWidth + (s.length > 0 ?
|
|
1773
|
-
|
|
1779
|
+
const u = n.offsetWidth + (s.length > 0 ? S : 0);
|
|
1780
|
+
C + u <= a ? (C += u, s.push(o)) : c.push(o);
|
|
1774
1781
|
}
|
|
1775
1782
|
if (s.length < y && i.length > 0) {
|
|
1776
1783
|
const o = y - s.length, n = c.splice(0, o);
|
|
@@ -1789,9 +1796,9 @@ class ke {
|
|
|
1789
1796
|
* @returns 总宽度
|
|
1790
1797
|
*/
|
|
1791
1798
|
static calculateTotalWidth(e, r = 16) {
|
|
1792
|
-
return e.length === 0 ? 0 : e.reduce((i,
|
|
1793
|
-
const
|
|
1794
|
-
return i +
|
|
1799
|
+
return e.length === 0 ? 0 : e.reduce((i, S, A) => {
|
|
1800
|
+
const b = S.offsetWidth || 0;
|
|
1801
|
+
return i + b + (A > 0 ? r : 0);
|
|
1795
1802
|
}, 0);
|
|
1796
1803
|
}
|
|
1797
1804
|
/**
|
|
@@ -1801,8 +1808,8 @@ class ke {
|
|
|
1801
1808
|
*/
|
|
1802
1809
|
static getElementTotalWidth(e) {
|
|
1803
1810
|
if (!e) return 0;
|
|
1804
|
-
const r = window.getComputedStyle(e), i = e.offsetWidth,
|
|
1805
|
-
return i +
|
|
1811
|
+
const r = window.getComputedStyle(e), i = e.offsetWidth, S = parseFloat(r.marginLeft) || 0, A = parseFloat(r.marginRight) || 0;
|
|
1812
|
+
return i + S + A;
|
|
1806
1813
|
}
|
|
1807
1814
|
}
|
|
1808
1815
|
const Ee = ':host{display:block}.responsive-nav{position:fixed;top:0;left:0;right:0;z-index:1000;background:var(--nav-bg, var(--bg-primary));-webkit-backdrop-filter:blur(20px) saturate(180%);backdrop-filter:blur(20px) saturate(180%);border-bottom:1px solid var(--nav-border, var(--border-color));transition:all .3s cubic-bezier(.4,0,.2,1);box-shadow:0 1px 3px #0000000d}.responsive-nav.nav-scrolled{background:var(--nav-bg-scrolled, var(--bg-primary));box-shadow:0 4px 24px var(--nav-shadow, var(--card-shadow));border-bottom-color:var(--nav-border, var(--border-color))}.nav-container{max-width:1280px;margin:0 auto;padding:0 2rem;display:flex;align-items:center;justify-content:space-between;height:72px;gap:1.5rem}.nav-brand{display:flex;align-items:center;gap:.75rem;font-weight:800;font-size:1.5rem;color:var(--nav-brand-color, var(--text-primary));flex-shrink:0;transition:transform .2s ease;cursor:pointer}.nav-brand:hover{transform:scale(1.05)}.nav-brand-icon{display:flex;align-items:center;font-size:1.8rem;transition:transform .3s ease}.nav-brand:hover .nav-brand-icon{transform:rotate(5deg) scale(1.1)}.nav-brand-text{background:linear-gradient(135deg,var(--hero-gradient-start, var(--primary-red)),var(--hero-gradient-end, var(--accent-orange)));-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;letter-spacing:-.02em;position:relative}.nav-menu{display:flex;align-items:center;gap:.5rem;flex:1;justify-content:flex-end;overflow:visible;padding-right:.5rem}wsx-link.nav-link{display:inline-flex;align-items:center;flex-shrink:0}wsx-link.nav-link::part(link){color:var(--nav-link-color, var(--text-secondary));text-decoration:none!important;font-weight:500;font-size:.95rem;transition:all .25s cubic-bezier(.4,0,.2,1);position:relative;white-space:nowrap;padding:.5rem .75rem;border-radius:.5rem;display:inline-flex;align-items:center}wsx-link.nav-link::part(link):hover{color:var(--nav-link-hover-color, var(--text-primary));background:var(--nav-link-hover-bg, var(--bg-secondary));text-decoration:none!important;transform:translateY(-1px)}wsx-link.nav-link::part(link):after{content:none!important;display:none!important;width:0!important;height:0!important;background:none!important}wsx-link.nav-link::part(link):hover:after{content:none!important;display:none!important;width:0!important;height:0!important;background:none!important}wsx-link.nav-link::part(link):before{display:none}wsx-link.nav-link[active]::part(link),wsx-link.nav-link.nav-link-active::part(link){color:var(--nav-link-active-color, var(--primary-red))!important;font-weight:600;background:var(--nav-link-active-bg, var(--bg-secondary));text-decoration:none!important}wsx-link.nav-link[active]::part(link):after,wsx-link.nav-link.nav-link-active::part(link):after{content:none!important;display:none!important;width:0!important;height:0!important;background:none!important}wsx-link.nav-link[active]::part(link):before,wsx-link.nav-link.nav-link-active::part(link):before{content:"";display:block;position:absolute;bottom:.125rem;left:50%;transform:translate(-50%);width:calc(100% - 1.5rem);height:3px;background:linear-gradient(135deg,var(--hero-gradient-start, var(--primary-red)),var(--hero-gradient-end, var(--accent-orange)));border-radius:2px;z-index:1}.nav-link{color:var(--nav-link-color, var(--text-secondary));text-decoration:none;font-weight:500;font-size:.95rem;transition:all .25s cubic-bezier(.4,0,.2,1);position:relative;white-space:nowrap;flex-shrink:0;padding:.5rem .75rem;border-radius:.5rem;display:inline-flex;align-items:center}.nav-link:hover{color:var(--nav-link-hover-color, var(--text-primary));background:var(--nav-link-hover-bg, var(--bg-secondary));transform:translateY(-1px)}.nav-link:after{content:"";position:absolute;bottom:.25rem;left:50%;transform:translate(-50%);width:0;height:2px;background:linear-gradient(135deg,var(--hero-gradient-start, var(--primary-red)),var(--hero-gradient-end, var(--accent-orange)));border-radius:2px;transition:width .3s cubic-bezier(.4,0,.2,1)}.nav-link:hover:after{width:calc(100% - 1.5rem)}.nav-link-active{color:var(--nav-link-active-color, var(--primary-red))!important;font-weight:600;background:var(--nav-link-active-bg, var(--bg-secondary))}.nav-link-active:after{width:calc(100% - 1.5rem)!important;height:3px!important;bottom:.125rem!important}.nav-overflow{position:relative;flex-shrink:0}.nav-overflow-button{padding:.5rem .875rem;background:var(--nav-overflow-bg, transparent);border:1px solid var(--nav-overflow-border, var(--border-color));border-radius:.5rem;color:var(--nav-link-color, var(--text-secondary));cursor:pointer;font-size:.875rem;font-weight:500;transition:all .25s cubic-bezier(.4,0,.2,1);display:inline-flex;align-items:center;gap:.25rem}.nav-overflow-button:hover{background:var(--nav-overflow-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));border-color:var(--nav-overflow-hover-border, var(--border-color));transform:translateY(-1px);box-shadow:0 2px 8px var(--card-shadow)}.nav-overflow-menu{position:absolute;top:calc(100% + .75rem);right:0;min-width:180px;background:var(--nav-overflow-menu-bg, var(--bg-primary));border:1px solid var(--nav-overflow-menu-border, var(--border-color));border-radius:.75rem;box-shadow:0 10px 25px -5px #0000001a,0 8px 10px -6px #0000001a;padding:.5rem;z-index:1001;-webkit-backdrop-filter:blur(20px) saturate(180%);backdrop-filter:blur(20px) saturate(180%);animation:slideDown .2s cubic-bezier(.4,0,.2,1)}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}wsx-link.nav-overflow-link::part(link){display:block;padding:.625rem .875rem;color:var(--nav-link-color, var(--text-secondary));text-decoration:none!important;font-weight:500;font-size:.9rem;border-radius:.5rem;transition:all .2s cubic-bezier(.4,0,.2,1);margin-bottom:.25rem;border-left:3px solid transparent}wsx-link.nav-overflow-link::part(link):hover{background:var(--nav-overflow-link-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));text-decoration:none!important;transform:translate(4px)}wsx-link.nav-overflow-link[active]::part(link),wsx-link.nav-overflow-link.nav-link-active::part(link){background:var(--nav-overflow-link-active-bg, var(--bg-secondary));color:var(--nav-link-active-color, var(--primary-red));font-weight:600;border-left-color:var(--primary-red);padding-left:.625rem}.nav-overflow-link{display:block;padding:.625rem .875rem;color:var(--nav-link-color, var(--text-secondary));text-decoration:none;font-weight:500;font-size:.9rem;border-radius:.5rem;transition:all .2s cubic-bezier(.4,0,.2,1);margin-bottom:.25rem;border-left:3px solid transparent}.nav-overflow-link:hover{background:var(--nav-overflow-link-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));transform:translate(4px)}.nav-overflow-link.nav-link-active{background:var(--nav-overflow-link-active-bg, var(--bg-secondary));color:var(--nav-link-active-color, var(--primary-red));font-weight:600;border-left-color:var(--primary-red);padding-left:.625rem}.nav-actions{display:flex;align-items:center;gap:.75rem;flex-shrink:0;margin-left:.5rem;z-index:1002;padding-left:.75rem;border-left:1px solid var(--nav-actions-border, var(--border-color))}.nav-action{display:flex;align-items:center;transition:transform .2s ease}.nav-action:hover{transform:scale(1.05)}.nav-toggle{display:none;flex-direction:column;gap:5px;background:var(--nav-toggle-bg, transparent);border:1px solid var(--nav-toggle-border, var(--border-color));border-radius:.5rem;cursor:pointer;padding:.625rem .5rem;z-index:1001;transition:all .25s ease}.nav-toggle:hover{background:var(--nav-toggle-hover-bg, var(--bg-secondary));border-color:var(--nav-toggle-hover-border, var(--border-color))}.nav-toggle-line{width:24px;height:3px;background:var(--nav-toggle-color, var(--text-primary));border-radius:3px;transition:all .3s cubic-bezier(.4,0,.2,1);transform-origin:center}.nav-toggle-line.open:nth-child(1){transform:rotate(45deg) translate(8px,8px)}.nav-toggle-line.open:nth-child(2){opacity:0}.nav-toggle-line.open:nth-child(3){transform:rotate(-45deg) translate(7px,-7px)}.nav-mobile-menu{position:fixed;top:72px;left:0;right:0;background:var(--nav-mobile-bg, var(--bg-primary));-webkit-backdrop-filter:blur(20px) saturate(180%);backdrop-filter:blur(20px) saturate(180%);flex-direction:column;padding:1.5rem;gap:.5rem;transform:translateY(-100%);opacity:0;visibility:hidden;transition:all .3s cubic-bezier(.4,0,.2,1);border-bottom:1px solid var(--nav-border, var(--border-color));max-height:calc(100vh - 72px);overflow-y:auto;z-index:999;box-shadow:0 4px 24px #0000001a}.nav-mobile-menu.open{transform:translateY(0);opacity:1;visibility:visible}wsx-link.nav-mobile-link::part(link){display:block;padding:.875rem 1.25rem;color:var(--nav-link-color, var(--text-secondary));text-decoration:none!important;font-weight:500;font-size:1rem;border-radius:.625rem;transition:all .25s cubic-bezier(.4,0,.2,1);border-left:3px solid transparent}wsx-link.nav-mobile-link::part(link):hover{background:var(--nav-mobile-link-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));text-decoration:none!important;transform:translate(4px);border-left-color:var(--primary-red)}wsx-link.nav-mobile-link[active]::part(link),wsx-link.nav-mobile-link.nav-link-active::part(link){background:var(--nav-mobile-link-active-bg, var(--bg-secondary));color:var(--nav-link-active-color, var(--primary-red));font-weight:600;border-left-color:var(--primary-red);box-shadow:0 2px 8px var(--card-shadow)}.nav-mobile-link{display:block;padding:.875rem 1.25rem;color:var(--nav-link-color, var(--text-secondary));text-decoration:none;font-weight:500;font-size:1rem;border-radius:.625rem;transition:all .25s cubic-bezier(.4,0,.2,1);border-left:3px solid transparent}.nav-mobile-link:hover{background:var(--nav-mobile-link-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));transform:translate(4px);border-left-color:var(--primary-red)}.nav-mobile-link.nav-link-active{background:var(--nav-mobile-link-active-bg, var(--bg-secondary));color:var(--nav-link-active-color, var(--primary-red));font-weight:600;border-left-color:var(--primary-red);box-shadow:0 2px 8px var(--card-shadow)}@media (max-width: 768px){.nav-container{padding:0 1.25rem;height:68px}.nav-brand{font-size:1.35rem}.nav-menu{display:none}.nav-actions{margin-left:0;gap:.5rem;padding-left:.5rem;border-left:none}.nav-toggle{display:flex;margin-left:.5rem}.nav-mobile-menu{display:flex;top:68px;max-height:calc(100vh - 68px)}}@media (min-width: 769px){.nav-mobile-menu{display:none!important}}@media (prefers-reduced-motion: no-preference){.responsive-nav,.nav-link,.nav-overflow-button,.nav-toggle{transition-duration:.25s}}@media (prefers-reduced-motion: reduce){.responsive-nav,.nav-link,.nav-overflow-button,.nav-toggle,.nav-mobile-menu{transition:none;animation:none}}';
|
|
@@ -1811,13 +1818,13 @@ let at, st;
|
|
|
1811
1818
|
function Z(t, e, r) {
|
|
1812
1819
|
return (e = lt(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1813
1820
|
}
|
|
1814
|
-
function dr(t, e, r, i,
|
|
1815
|
-
function
|
|
1821
|
+
function dr(t, e, r, i, S, A) {
|
|
1822
|
+
function b(a, s, c) {
|
|
1816
1823
|
return function(o, n) {
|
|
1817
1824
|
return c && c(o), a[s].call(o, n);
|
|
1818
1825
|
};
|
|
1819
1826
|
}
|
|
1820
|
-
function
|
|
1827
|
+
function O(a, s) {
|
|
1821
1828
|
for (var c = 0; c < a.length; c++) a[c].call(s);
|
|
1822
1829
|
return s;
|
|
1823
1830
|
}
|
|
@@ -1825,22 +1832,22 @@ function dr(t, e, r, i, k, O) {
|
|
|
1825
1832
|
if (typeof a != "function" && (o || a !== void 0)) throw new TypeError(s + " must " + (c || "be") + " a function" + (o ? "" : " or undefined"));
|
|
1826
1833
|
return a;
|
|
1827
1834
|
}
|
|
1828
|
-
function D(a, s, c, o, n, u, h, p, x,
|
|
1835
|
+
function D(a, s, c, o, n, u, h, p, x, k, m, d, v) {
|
|
1829
1836
|
function T(f) {
|
|
1830
1837
|
if (!v(f)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1831
1838
|
}
|
|
1832
|
-
var g,
|
|
1839
|
+
var g, _ = s[0], I = s[3], M = !p;
|
|
1833
1840
|
if (!M) {
|
|
1834
|
-
c || Array.isArray(
|
|
1835
|
-
var l = {}, R = [],
|
|
1836
|
-
|
|
1841
|
+
c || Array.isArray(_) || (_ = [_]);
|
|
1842
|
+
var l = {}, R = [], E = n === 3 ? "get" : n === 4 || d ? "set" : "value";
|
|
1843
|
+
k ? (m || d ? l = { get: Se(function() {
|
|
1837
1844
|
return I(this);
|
|
1838
1845
|
}, o, "get"), set: function(f) {
|
|
1839
1846
|
s[4](this, f);
|
|
1840
|
-
} } : l[
|
|
1847
|
+
} } : l[E] = I, m || Se(l[E], o, n === 2 ? "" : E)) : m || (l = Object.getOwnPropertyDescriptor(a, o));
|
|
1841
1848
|
}
|
|
1842
|
-
for (var w = a, B =
|
|
1843
|
-
var W =
|
|
1849
|
+
for (var w = a, B = _.length - 1; B >= 0; B -= c ? 2 : 1) {
|
|
1850
|
+
var W = _[B], G = c ? _[B - 1] : void 0, Y = {}, z = { kind: ["field", "accessor", "method", "getter", "setter", "class"][n], name: o, metadata: u, addInitializer: (function(f, N) {
|
|
1844
1851
|
if (f.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1845
1852
|
y(N, "An initializer", "be", !0), h.push(N);
|
|
1846
1853
|
}).bind(null, Y) };
|
|
@@ -1848,58 +1855,58 @@ function dr(t, e, r, i, k, O) {
|
|
|
1848
1855
|
if (M) (g = y(W.call(G, w, z), "class decorators", "return")) && (w = g);
|
|
1849
1856
|
else {
|
|
1850
1857
|
var P, U;
|
|
1851
|
-
z.static = x, z.private =
|
|
1858
|
+
z.static = x, z.private = k, k ? n === 2 ? P = function(f) {
|
|
1852
1859
|
return T(f), l.value;
|
|
1853
|
-
} : (n < 4 && (P =
|
|
1860
|
+
} : (n < 4 && (P = b(l, "get", T)), n !== 3 && (U = b(l, "set", T))) : (P = function(f) {
|
|
1854
1861
|
return f[o];
|
|
1855
1862
|
}, (n < 2 || n === 4) && (U = function(f, N) {
|
|
1856
1863
|
f[o] = N;
|
|
1857
1864
|
}));
|
|
1858
|
-
var V = z.access = { has:
|
|
1865
|
+
var V = z.access = { has: k ? v.bind() : function(f) {
|
|
1859
1866
|
return o in f;
|
|
1860
1867
|
} };
|
|
1861
|
-
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[
|
|
1868
|
+
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[E], z), d) {
|
|
1862
1869
|
if (typeof w == "object" && w) (g = y(w.get, "accessor.get")) && (l.get = g), (g = y(w.set, "accessor.set")) && (l.set = g), (g = y(w.init, "accessor.init")) && R.push(g);
|
|
1863
1870
|
else if (w !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1864
|
-
} else y(w, (
|
|
1871
|
+
} else y(w, (m ? "field" : "method") + " decorators", "return") && (m ? R.push(w) : l[E] = w);
|
|
1865
1872
|
}
|
|
1866
1873
|
} finally {
|
|
1867
1874
|
Y.v = !0;
|
|
1868
1875
|
}
|
|
1869
1876
|
}
|
|
1870
|
-
return (
|
|
1877
|
+
return (m || d) && p.push(function(f, N) {
|
|
1871
1878
|
for (var H = R.length - 1; H >= 0; H--) N = R[H].call(f, N);
|
|
1872
1879
|
return N;
|
|
1873
|
-
}),
|
|
1880
|
+
}), m || M || (k ? d ? p.push(b(l, "get"), b(l, "set")) : p.push(n === 2 ? l[E] : b.call.bind(l[E])) : Object.defineProperty(a, o, l)), w;
|
|
1874
1881
|
}
|
|
1875
1882
|
function F(a, s) {
|
|
1876
1883
|
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: s });
|
|
1877
1884
|
}
|
|
1878
|
-
if (arguments.length >= 6) var
|
|
1879
|
-
var L = Object.create(
|
|
1880
|
-
var n, u, h = [], p = function(
|
|
1881
|
-
return hr(
|
|
1885
|
+
if (arguments.length >= 6) var C = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1886
|
+
var L = Object.create(C ?? null), j = function(a, s, c, o) {
|
|
1887
|
+
var n, u, h = [], p = function(E) {
|
|
1888
|
+
return hr(E) === a;
|
|
1882
1889
|
}, x = /* @__PURE__ */ new Map();
|
|
1883
|
-
function E
|
|
1884
|
-
|
|
1890
|
+
function k(E) {
|
|
1891
|
+
E && h.push(O.bind(null, E));
|
|
1885
1892
|
}
|
|
1886
|
-
for (var
|
|
1887
|
-
var d = s[
|
|
1893
|
+
for (var m = 0; m < s.length; m++) {
|
|
1894
|
+
var d = s[m];
|
|
1888
1895
|
if (Array.isArray(d)) {
|
|
1889
|
-
var v = d[1], T = d[2], g = d.length > 3,
|
|
1896
|
+
var v = d[1], T = d[2], g = d.length > 3, _ = 16 & v, I = !!(8 & v), M = (v &= 7) == 0, l = T + "/" + I;
|
|
1890
1897
|
if (!M && !g) {
|
|
1891
1898
|
var R = x.get(l);
|
|
1892
1899
|
if (R === !0 || R === 3 && v !== 4 || R === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
1893
1900
|
x.set(l, !(v > 2) || v);
|
|
1894
1901
|
}
|
|
1895
|
-
D(I ? a : a.prototype, d,
|
|
1902
|
+
D(I ? a : a.prototype, d, _, g ? "#" + T : lt(T), v, o, I ? u = u || [] : n = n || [], h, I, g, M, v === 1, I && g ? p : c);
|
|
1896
1903
|
}
|
|
1897
1904
|
}
|
|
1898
|
-
return
|
|
1899
|
-
}(t, e,
|
|
1905
|
+
return k(n), k(u), h;
|
|
1906
|
+
}(t, e, S, L);
|
|
1900
1907
|
return r.length || F(t, L), { e: j, get c() {
|
|
1901
1908
|
var a = [];
|
|
1902
|
-
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L),
|
|
1909
|
+
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L), O.bind(null, a, t)];
|
|
1903
1910
|
} };
|
|
1904
1911
|
}
|
|
1905
1912
|
function lt(t) {
|
|
@@ -1947,8 +1954,8 @@ class fr extends Q {
|
|
|
1947
1954
|
}, 0) : document.removeEventListener("click", this.handleOverflowOutsideClick, !0);
|
|
1948
1955
|
}), Z(this, "closeOverflow", () => {
|
|
1949
1956
|
this.isOverflowOpen = !1, this.rerender(), document.removeEventListener("click", this.handleOverflowOutsideClick, !0);
|
|
1950
|
-
}), Z(this, "handleOverflowOutsideClick", (
|
|
1951
|
-
const L =
|
|
1957
|
+
}), Z(this, "handleOverflowOutsideClick", (C) => {
|
|
1958
|
+
const L = C.target, j = this.querySelector(".nav-overflow"), a = j == null ? void 0 : j.querySelector(".nav-overflow-menu"), s = j == null ? void 0 : j.querySelector(".nav-overflow-button");
|
|
1952
1959
|
a && s && !a.contains(L) && !s.contains(L) && this.closeOverflow();
|
|
1953
1960
|
}), Z(this, "updateVisibleItems", () => {
|
|
1954
1961
|
var u;
|
|
@@ -1959,7 +1966,7 @@ class fr extends Q {
|
|
|
1959
1966
|
}
|
|
1960
1967
|
return;
|
|
1961
1968
|
}
|
|
1962
|
-
const
|
|
1969
|
+
const C = [];
|
|
1963
1970
|
for (let h = 0; h < this.navigation.items.length; h++) {
|
|
1964
1971
|
let p = this.navItemsElements[h];
|
|
1965
1972
|
if (!p) {
|
|
@@ -1967,74 +1974,74 @@ class fr extends Q {
|
|
|
1967
1974
|
x[h] && (p = x[h], this.navItemsElements[h] = p);
|
|
1968
1975
|
}
|
|
1969
1976
|
if (p)
|
|
1970
|
-
|
|
1977
|
+
C.push(p);
|
|
1971
1978
|
else {
|
|
1972
1979
|
const x = document.createElement("wsx-link");
|
|
1973
|
-
x.textContent = this.navigation.items[h].label, x.style.visibility = "hidden", x.style.position = "absolute", document.body.appendChild(x),
|
|
1980
|
+
x.textContent = this.navigation.items[h].label, x.style.visibility = "hidden", x.style.position = "absolute", document.body.appendChild(x), C.push(x), setTimeout(() => {
|
|
1974
1981
|
x.parentElement && x.parentElement.removeChild(x);
|
|
1975
1982
|
}, 0);
|
|
1976
1983
|
}
|
|
1977
1984
|
}
|
|
1978
1985
|
const L = (u = this.navMenuElement.parentElement) == null ? void 0 : u.querySelector(".nav-actions"), j = L ? Array.from(L.children).reduce((h, p) => h + ke.getElementTotalWidth(p), 0) + 8 : 0, c = ke.detect({
|
|
1979
1986
|
container: this.navMenuElement,
|
|
1980
|
-
items:
|
|
1987
|
+
items: C,
|
|
1981
1988
|
gap: 16,
|
|
1982
1989
|
reservedWidth: j,
|
|
1983
1990
|
overflowButtonWidth: 90,
|
|
1984
1991
|
padding: 0,
|
|
1985
1992
|
minVisibleItems: 1
|
|
1986
1993
|
}), o = c.visibleIndices, n = c.hiddenIndices;
|
|
1987
|
-
|
|
1994
|
+
C.forEach((h) => {
|
|
1988
1995
|
h.parentElement === document.body && document.body.removeChild(h);
|
|
1989
1996
|
}), (JSON.stringify(o.sort()) !== JSON.stringify(this.visibleItemIndices.sort()) || JSON.stringify(n.sort()) !== JSON.stringify(this.hiddenItemIndices.sort())) && (this.visibleItemIndices = o, this.hiddenItemIndices = n, this.rerender());
|
|
1990
1997
|
}), Z(this, "checkMobile", () => {
|
|
1991
1998
|
var L;
|
|
1992
|
-
const
|
|
1993
|
-
|
|
1999
|
+
const C = window.innerWidth <= (((L = this.navigation) == null ? void 0 : L.mobileBreakpoint) || 768);
|
|
2000
|
+
C !== this.isMobile && (this.isMobile = C, this.rerender());
|
|
1994
2001
|
}), e && (this.navigation = {
|
|
1995
2002
|
mobileBreakpoint: 768,
|
|
1996
2003
|
autoOverflow: !0,
|
|
1997
2004
|
...e
|
|
1998
|
-
}, this.visibleItemIndices = e.items.map((
|
|
2005
|
+
}, this.visibleItemIndices = e.items.map((C, L) => L));
|
|
1999
2006
|
let r = this.reactive({
|
|
2000
2007
|
items: []
|
|
2001
2008
|
});
|
|
2002
2009
|
Object.defineProperty(this, "navigation", {
|
|
2003
2010
|
get: () => r,
|
|
2004
|
-
set: (
|
|
2005
|
-
r =
|
|
2011
|
+
set: (C) => {
|
|
2012
|
+
r = C !== null && typeof C < "u" && (Array.isArray(C) || typeof C == "object") ? this.reactive(C) : C, this.scheduleRerender();
|
|
2006
2013
|
},
|
|
2007
2014
|
enumerable: !0,
|
|
2008
2015
|
configurable: !0
|
|
2009
2016
|
});
|
|
2010
|
-
const [i,
|
|
2017
|
+
const [i, S] = this.useState("isMobileMenuOpen", !1);
|
|
2011
2018
|
Object.defineProperty(this, "isMobileMenuOpen", {
|
|
2012
2019
|
get: i,
|
|
2013
|
-
set:
|
|
2020
|
+
set: S,
|
|
2014
2021
|
enumerable: !0,
|
|
2015
2022
|
configurable: !0
|
|
2016
2023
|
});
|
|
2017
|
-
let
|
|
2024
|
+
let A = this.reactive([]);
|
|
2018
2025
|
Object.defineProperty(this, "visibleItemIndices", {
|
|
2019
|
-
get: () =>
|
|
2020
|
-
set: (
|
|
2021
|
-
|
|
2026
|
+
get: () => A,
|
|
2027
|
+
set: (C) => {
|
|
2028
|
+
A = C !== null && typeof C < "u" && (Array.isArray(C) || typeof C == "object") ? this.reactive(C) : C, this.scheduleRerender();
|
|
2022
2029
|
},
|
|
2023
2030
|
enumerable: !0,
|
|
2024
2031
|
configurable: !0
|
|
2025
2032
|
});
|
|
2026
|
-
let
|
|
2033
|
+
let b = this.reactive([]);
|
|
2027
2034
|
Object.defineProperty(this, "hiddenItemIndices", {
|
|
2028
|
-
get: () =>
|
|
2029
|
-
set: (
|
|
2030
|
-
|
|
2035
|
+
get: () => b,
|
|
2036
|
+
set: (C) => {
|
|
2037
|
+
b = C !== null && typeof C < "u" && (Array.isArray(C) || typeof C == "object") ? this.reactive(C) : C, this.scheduleRerender();
|
|
2031
2038
|
},
|
|
2032
2039
|
enumerable: !0,
|
|
2033
2040
|
configurable: !0
|
|
2034
2041
|
});
|
|
2035
|
-
const [
|
|
2042
|
+
const [O, y] = this.useState("isMobile", !1);
|
|
2036
2043
|
Object.defineProperty(this, "isMobile", {
|
|
2037
|
-
get:
|
|
2044
|
+
get: O,
|
|
2038
2045
|
set: y,
|
|
2039
2046
|
enumerable: !0,
|
|
2040
2047
|
configurable: !0
|
|
@@ -2051,32 +2058,32 @@ class fr extends Q {
|
|
|
2051
2058
|
var r, i;
|
|
2052
2059
|
if (!((r = this.navigation) != null && r.items) || ((i = this.navigation) == null ? void 0 : i.items.length) === 0)
|
|
2053
2060
|
return /* @__PURE__ */ $("nav", { class: "responsive-nav" });
|
|
2054
|
-
const e = this.hiddenItemIndices.map((
|
|
2055
|
-
return /* @__PURE__ */ $("nav", { class: "responsive-nav" }, /* @__PURE__ */ $("div", { class: "nav-container" }, /* @__PURE__ */ $("div", { class: "nav-brand" }, /* @__PURE__ */ $("slot", { name: "brand-icon" }, this.navigation.brandIcon && typeof this.navigation.brandIcon == "string" && /* @__PURE__ */ $("span", { class: "nav-brand-icon" }, this.navigation.brandIcon)), this.navigation.brand && /* @__PURE__ */ $("span", { class: "nav-brand-text" }, this.navigation.brand)), !this.isMobile && /* @__PURE__ */ $("div", { ref: (
|
|
2056
|
-
const
|
|
2057
|
-
return /* @__PURE__ */ $("wsx-link", { key:
|
|
2058
|
-
|
|
2059
|
-
}, to:
|
|
2060
|
-
}), this.navigation.autoOverflow && e.length > 0 && !this.isMobile && /* @__PURE__ */ $("div", { class: "nav-overflow" }, /* @__PURE__ */ $("button", { class: "nav-overflow-button", onClick: this.toggleOverflow, "data-wsx-key": "ResponsiveNav-button-text-1-1" }, "More ▼"), this.isOverflowOpen && /* @__PURE__ */ $("div", { class: "nav-overflow-menu" }, e.map((
|
|
2061
|
-
const
|
|
2062
|
-
return /* @__PURE__ */ $("wsx-link", { key:
|
|
2063
|
-
})))), this.navigation.actionTags && /* @__PURE__ */ $("div", { class: "nav-actions" }, this.navigation.actionTags.map((
|
|
2061
|
+
const e = this.hiddenItemIndices.map((S) => this.navigation.items[S]);
|
|
2062
|
+
return /* @__PURE__ */ $("nav", { class: "responsive-nav" }, /* @__PURE__ */ $("div", { class: "nav-container" }, /* @__PURE__ */ $("div", { class: "nav-brand" }, /* @__PURE__ */ $("slot", { name: "brand-icon" }, this.navigation.brandIcon && typeof this.navigation.brandIcon == "string" && /* @__PURE__ */ $("span", { class: "nav-brand-icon" }, this.navigation.brandIcon)), this.navigation.brand && /* @__PURE__ */ $("span", { class: "nav-brand-text" }, this.navigation.brand)), !this.isMobile && /* @__PURE__ */ $("div", { ref: (S) => this.navMenuElement = S, class: "nav-menu" }, this.navigation.items.map((S, A) => {
|
|
2063
|
+
const b = this.visibleItemIndices.includes(A);
|
|
2064
|
+
return /* @__PURE__ */ $("wsx-link", { key: `nav-${A}`, ref: (O) => {
|
|
2065
|
+
O && (this.navItemsElements[A] = O);
|
|
2066
|
+
}, to: S.to, class: `nav-link ${b ? "" : "hidden-item"}`, "active-class": "nav-link-active", exact: S.exact, style: b ? "" : "position: absolute; visibility: hidden; pointer-events: none;" }, S.label);
|
|
2067
|
+
}), this.navigation.autoOverflow && e.length > 0 && !this.isMobile && /* @__PURE__ */ $("div", { class: "nav-overflow" }, /* @__PURE__ */ $("button", { class: "nav-overflow-button", onClick: this.toggleOverflow, "data-wsx-key": "ResponsiveNav-button-text-1-1" }, "More ▼"), this.isOverflowOpen && /* @__PURE__ */ $("div", { class: "nav-overflow-menu" }, e.map((S, A) => {
|
|
2068
|
+
const b = this.hiddenItemIndices[A];
|
|
2069
|
+
return /* @__PURE__ */ $("wsx-link", { key: `overflow-${b}`, to: S.to, class: "nav-overflow-link", "active-class": "nav-link-active", exact: S.exact, onClick: this.closeOverflow }, S.label);
|
|
2070
|
+
})))), this.navigation.actionTags && /* @__PURE__ */ $("div", { class: "nav-actions" }, this.navigation.actionTags.map((S, A) => /* @__PURE__ */ $("div", { key: A, class: "nav-action" }, /* @__PURE__ */ $(S, null)))), this.isMobile && /* @__PURE__ */ $("button", { class: "nav-toggle", onClick: this.toggleMobileMenu, "data-wsx-key": "ResponsiveNav-button-text-1" }, /* @__PURE__ */ $("span", { class: `nav-toggle-line ${this.isMobileMenuOpen ? "open" : ""}` }), /* @__PURE__ */ $("span", { class: `nav-toggle-line ${this.isMobileMenuOpen ? "open" : ""}` }), /* @__PURE__ */ $("span", { class: `nav-toggle-line ${this.isMobileMenuOpen ? "open" : ""}` }))), this.isMobile && /* @__PURE__ */ $("div", { class: `nav-mobile-menu ${this.isMobileMenuOpen ? "open" : ""}` }, this.navigation.items.filter((S) => !S.hideOnMobile).map((S, A) => /* @__PURE__ */ $("wsx-link", { key: A, to: S.to, class: "nav-mobile-link", "active-class": "nav-link-active", exact: S.exact, onClick: this.closeMobileMenu }, S.label))));
|
|
2064
2071
|
}
|
|
2065
2072
|
/**
|
|
2066
2073
|
* 组件连接时初始化
|
|
2067
2074
|
*/
|
|
2068
2075
|
onConnected() {
|
|
2069
|
-
var r, i;
|
|
2070
|
-
if (!((
|
|
2076
|
+
var r, i, S;
|
|
2077
|
+
if ((r = super.onConnected) == null || r.call(this), !((i = this.navigation) != null && i.items) || ((S = this.navigation) == null ? void 0 : S.items.length) === 0)
|
|
2071
2078
|
try {
|
|
2072
|
-
this.visibleItemIndices = this.navigation.items.map((
|
|
2073
|
-
} catch (
|
|
2074
|
-
console.error("Failed to parse ResponsiveNav config:",
|
|
2079
|
+
this.visibleItemIndices = this.navigation.items.map((A, b) => b), this.rerender();
|
|
2080
|
+
} catch (A) {
|
|
2081
|
+
console.error("Failed to parse ResponsiveNav config:", A);
|
|
2075
2082
|
}
|
|
2076
2083
|
this.checkMobile();
|
|
2077
|
-
const e = (
|
|
2078
|
-
|
|
2079
|
-
this.navMenuElement && (this.navigation.items.every((
|
|
2084
|
+
const e = (A = 0) => {
|
|
2085
|
+
A > 10 || setTimeout(() => {
|
|
2086
|
+
this.navMenuElement && (this.navigation.items.every((O, y) => this.navItemsElements[y]) || A > 5 ? this.updateVisibleItems() : e(A + 1));
|
|
2080
2087
|
}, 50);
|
|
2081
2088
|
};
|
|
2082
2089
|
e(), this.resizeHandler = () => {
|
|
@@ -2095,7 +2102,8 @@ class fr extends Q {
|
|
|
2095
2102
|
* 组件断开连接时清理
|
|
2096
2103
|
*/
|
|
2097
2104
|
onDisconnected() {
|
|
2098
|
-
|
|
2105
|
+
var e;
|
|
2106
|
+
(e = super.onDisconnected) == null || e.call(this), this.resizeHandler && window.removeEventListener("resize", this.resizeHandler), this.resizeObserver && this.resizeObserver.disconnect();
|
|
2099
2107
|
}
|
|
2100
2108
|
}
|
|
2101
2109
|
it = fr;
|
|
@@ -2106,13 +2114,13 @@ let ut, dt;
|
|
|
2106
2114
|
function ne(t, e, r) {
|
|
2107
2115
|
return (e = pt(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
2108
2116
|
}
|
|
2109
|
-
function br(t, e, r, i,
|
|
2110
|
-
function
|
|
2117
|
+
function br(t, e, r, i, S, A) {
|
|
2118
|
+
function b(a, s, c) {
|
|
2111
2119
|
return function(o, n) {
|
|
2112
2120
|
return c && c(o), a[s].call(o, n);
|
|
2113
2121
|
};
|
|
2114
2122
|
}
|
|
2115
|
-
function
|
|
2123
|
+
function O(a, s) {
|
|
2116
2124
|
for (var c = 0; c < a.length; c++) a[c].call(s);
|
|
2117
2125
|
return s;
|
|
2118
2126
|
}
|
|
@@ -2120,22 +2128,22 @@ function br(t, e, r, i, k, O) {
|
|
|
2120
2128
|
if (typeof a != "function" && (o || a !== void 0)) throw new TypeError(s + " must " + (c || "be") + " a function" + (o ? "" : " or undefined"));
|
|
2121
2129
|
return a;
|
|
2122
2130
|
}
|
|
2123
|
-
function D(a, s, c, o, n, u, h, p, x,
|
|
2131
|
+
function D(a, s, c, o, n, u, h, p, x, k, m, d, v) {
|
|
2124
2132
|
function T(f) {
|
|
2125
2133
|
if (!v(f)) throw new TypeError("Attempted to access private element on non-instance");
|
|
2126
2134
|
}
|
|
2127
|
-
var g,
|
|
2135
|
+
var g, _ = s[0], I = s[3], M = !p;
|
|
2128
2136
|
if (!M) {
|
|
2129
|
-
c || Array.isArray(
|
|
2130
|
-
var l = {}, R = [],
|
|
2131
|
-
|
|
2137
|
+
c || Array.isArray(_) || (_ = [_]);
|
|
2138
|
+
var l = {}, R = [], E = n === 3 ? "get" : n === 4 || d ? "set" : "value";
|
|
2139
|
+
k ? (m || d ? l = { get: Ae(function() {
|
|
2132
2140
|
return I(this);
|
|
2133
2141
|
}, o, "get"), set: function(f) {
|
|
2134
2142
|
s[4](this, f);
|
|
2135
|
-
} } : l[
|
|
2143
|
+
} } : l[E] = I, m || Ae(l[E], o, n === 2 ? "" : E)) : m || (l = Object.getOwnPropertyDescriptor(a, o));
|
|
2136
2144
|
}
|
|
2137
|
-
for (var w = a, B =
|
|
2138
|
-
var W =
|
|
2145
|
+
for (var w = a, B = _.length - 1; B >= 0; B -= c ? 2 : 1) {
|
|
2146
|
+
var W = _[B], G = c ? _[B - 1] : void 0, Y = {}, z = { kind: ["field", "accessor", "method", "getter", "setter", "class"][n], name: o, metadata: u, addInitializer: (function(f, N) {
|
|
2139
2147
|
if (f.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
2140
2148
|
y(N, "An initializer", "be", !0), h.push(N);
|
|
2141
2149
|
}).bind(null, Y) };
|
|
@@ -2143,58 +2151,58 @@ function br(t, e, r, i, k, O) {
|
|
|
2143
2151
|
if (M) (g = y(W.call(G, w, z), "class decorators", "return")) && (w = g);
|
|
2144
2152
|
else {
|
|
2145
2153
|
var P, U;
|
|
2146
|
-
z.static = x, z.private =
|
|
2154
|
+
z.static = x, z.private = k, k ? n === 2 ? P = function(f) {
|
|
2147
2155
|
return T(f), l.value;
|
|
2148
|
-
} : (n < 4 && (P =
|
|
2156
|
+
} : (n < 4 && (P = b(l, "get", T)), n !== 3 && (U = b(l, "set", T))) : (P = function(f) {
|
|
2149
2157
|
return f[o];
|
|
2150
2158
|
}, (n < 2 || n === 4) && (U = function(f, N) {
|
|
2151
2159
|
f[o] = N;
|
|
2152
2160
|
}));
|
|
2153
|
-
var V = z.access = { has:
|
|
2161
|
+
var V = z.access = { has: k ? v.bind() : function(f) {
|
|
2154
2162
|
return o in f;
|
|
2155
2163
|
} };
|
|
2156
|
-
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[
|
|
2164
|
+
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[E], z), d) {
|
|
2157
2165
|
if (typeof w == "object" && w) (g = y(w.get, "accessor.get")) && (l.get = g), (g = y(w.set, "accessor.set")) && (l.set = g), (g = y(w.init, "accessor.init")) && R.push(g);
|
|
2158
2166
|
else if (w !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
2159
|
-
} else y(w, (
|
|
2167
|
+
} else y(w, (m ? "field" : "method") + " decorators", "return") && (m ? R.push(w) : l[E] = w);
|
|
2160
2168
|
}
|
|
2161
2169
|
} finally {
|
|
2162
2170
|
Y.v = !0;
|
|
2163
2171
|
}
|
|
2164
2172
|
}
|
|
2165
|
-
return (
|
|
2173
|
+
return (m || d) && p.push(function(f, N) {
|
|
2166
2174
|
for (var H = R.length - 1; H >= 0; H--) N = R[H].call(f, N);
|
|
2167
2175
|
return N;
|
|
2168
|
-
}),
|
|
2176
|
+
}), m || M || (k ? d ? p.push(b(l, "get"), b(l, "set")) : p.push(n === 2 ? l[E] : b.call.bind(l[E])) : Object.defineProperty(a, o, l)), w;
|
|
2169
2177
|
}
|
|
2170
2178
|
function F(a, s) {
|
|
2171
2179
|
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: s });
|
|
2172
2180
|
}
|
|
2173
|
-
if (arguments.length >= 6) var
|
|
2174
|
-
var L = Object.create(
|
|
2175
|
-
var n, u, h = [], p = function(
|
|
2176
|
-
return vr(
|
|
2181
|
+
if (arguments.length >= 6) var C = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
2182
|
+
var L = Object.create(C ?? null), j = function(a, s, c, o) {
|
|
2183
|
+
var n, u, h = [], p = function(E) {
|
|
2184
|
+
return vr(E) === a;
|
|
2177
2185
|
}, x = /* @__PURE__ */ new Map();
|
|
2178
|
-
function E
|
|
2179
|
-
|
|
2186
|
+
function k(E) {
|
|
2187
|
+
E && h.push(O.bind(null, E));
|
|
2180
2188
|
}
|
|
2181
|
-
for (var
|
|
2182
|
-
var d = s[
|
|
2189
|
+
for (var m = 0; m < s.length; m++) {
|
|
2190
|
+
var d = s[m];
|
|
2183
2191
|
if (Array.isArray(d)) {
|
|
2184
|
-
var v = d[1], T = d[2], g = d.length > 3,
|
|
2192
|
+
var v = d[1], T = d[2], g = d.length > 3, _ = 16 & v, I = !!(8 & v), M = (v &= 7) == 0, l = T + "/" + I;
|
|
2185
2193
|
if (!M && !g) {
|
|
2186
2194
|
var R = x.get(l);
|
|
2187
2195
|
if (R === !0 || R === 3 && v !== 4 || R === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
2188
2196
|
x.set(l, !(v > 2) || v);
|
|
2189
2197
|
}
|
|
2190
|
-
D(I ? a : a.prototype, d,
|
|
2198
|
+
D(I ? a : a.prototype, d, _, g ? "#" + T : pt(T), v, o, I ? u = u || [] : n = n || [], h, I, g, M, v === 1, I && g ? p : c);
|
|
2191
2199
|
}
|
|
2192
2200
|
}
|
|
2193
|
-
return
|
|
2194
|
-
}(t, e,
|
|
2201
|
+
return k(n), k(u), h;
|
|
2202
|
+
}(t, e, S, L);
|
|
2195
2203
|
return r.length || F(t, L), { e: j, get c() {
|
|
2196
2204
|
var a = [];
|
|
2197
|
-
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L),
|
|
2205
|
+
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L), O.bind(null, a, t)];
|
|
2198
2206
|
} };
|
|
2199
2207
|
}
|
|
2200
2208
|
function pt(t) {
|
|
@@ -2230,21 +2238,21 @@ dt = [te({
|
|
|
2230
2238
|
let yr;
|
|
2231
2239
|
class xr extends Q {
|
|
2232
2240
|
constructor() {
|
|
2233
|
-
super(), ne(this, "size", void 0), ne(this, "color", void 0), ne(this, "name", void 0), ne(this, "handleClick", (
|
|
2241
|
+
super(), ne(this, "size", void 0), ne(this, "color", void 0), ne(this, "name", void 0), ne(this, "handleClick", (O) => {
|
|
2234
2242
|
Oe.debug("SVG icon clicked", {
|
|
2235
2243
|
name: this.name
|
|
2236
2244
|
}), this.dispatchEvent(new CustomEvent("icon-click", {
|
|
2237
2245
|
detail: {
|
|
2238
2246
|
name: this.name,
|
|
2239
|
-
originalEvent:
|
|
2247
|
+
originalEvent: O
|
|
2240
2248
|
},
|
|
2241
2249
|
bubbles: !0
|
|
2242
2250
|
}));
|
|
2243
|
-
}), ne(this, "handleMouseEnter", (
|
|
2244
|
-
const y =
|
|
2251
|
+
}), ne(this, "handleMouseEnter", (O) => {
|
|
2252
|
+
const y = O.target;
|
|
2245
2253
|
y.style.transform = "scale(1.1)";
|
|
2246
|
-
}), ne(this, "handleMouseLeave", (
|
|
2247
|
-
const y =
|
|
2254
|
+
}), ne(this, "handleMouseLeave", (O) => {
|
|
2255
|
+
const y = O.target;
|
|
2248
2256
|
y.style.transform = "scale(1)";
|
|
2249
2257
|
});
|
|
2250
2258
|
const [e, r] = this.useState("size", 24);
|
|
@@ -2254,23 +2262,23 @@ class xr extends Q {
|
|
|
2254
2262
|
enumerable: !0,
|
|
2255
2263
|
configurable: !0
|
|
2256
2264
|
});
|
|
2257
|
-
const [i,
|
|
2265
|
+
const [i, S] = this.useState("color", "currentColor");
|
|
2258
2266
|
Object.defineProperty(this, "color", {
|
|
2259
2267
|
get: i,
|
|
2260
|
-
set:
|
|
2268
|
+
set: S,
|
|
2261
2269
|
enumerable: !0,
|
|
2262
2270
|
configurable: !0
|
|
2263
2271
|
});
|
|
2264
|
-
const [
|
|
2272
|
+
const [A, b] = this.useState("name", "star");
|
|
2265
2273
|
Object.defineProperty(this, "name", {
|
|
2266
|
-
get:
|
|
2267
|
-
set:
|
|
2274
|
+
get: A,
|
|
2275
|
+
set: b,
|
|
2268
2276
|
enumerable: !0,
|
|
2269
2277
|
configurable: !0
|
|
2270
2278
|
});
|
|
2271
2279
|
}
|
|
2272
2280
|
render() {
|
|
2273
|
-
const e = this.size || "24", r = this.color || "currentColor", i = this.name || "star",
|
|
2281
|
+
const e = this.size || "24", r = this.color || "currentColor", i = this.name || "star", S = {
|
|
2274
2282
|
star: "M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",
|
|
2275
2283
|
heart: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",
|
|
2276
2284
|
check: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z",
|
|
@@ -2278,8 +2286,8 @@ class xr extends Q {
|
|
|
2278
2286
|
github: "M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22",
|
|
2279
2287
|
play: "M8 5v14l11-7z",
|
|
2280
2288
|
settings: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"
|
|
2281
|
-
},
|
|
2282
|
-
return /* @__PURE__ */ $("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: r, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "svg-icon", onClick: this.handleClick, style: "cursor: pointer; transition: transform 0.2s ease; display: inline-block;", onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave }, /* @__PURE__ */ $("path", { d:
|
|
2289
|
+
}, A = S[i] || S.star;
|
|
2290
|
+
return /* @__PURE__ */ $("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: r, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "svg-icon", onClick: this.handleClick, style: "cursor: pointer; transition: transform 0.2s ease; display: inline-block;", onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave }, /* @__PURE__ */ $("path", { d: A, fill: r }));
|
|
2283
2291
|
}
|
|
2284
2292
|
static get observedAttributes() {
|
|
2285
2293
|
return ["name", "size", "color"];
|
|
@@ -2303,7 +2311,7 @@ var ht = { exports: {} };
|
|
|
2303
2311
|
* @public
|
|
2304
2312
|
*/
|
|
2305
2313
|
var r = function(i) {
|
|
2306
|
-
var
|
|
2314
|
+
var S = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, A = 0, b = {}, O = {
|
|
2307
2315
|
/**
|
|
2308
2316
|
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
|
2309
2317
|
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
|
@@ -2387,7 +2395,7 @@ var ht = { exports: {} };
|
|
|
2387
2395
|
* @returns {number}
|
|
2388
2396
|
*/
|
|
2389
2397
|
objId: function(n) {
|
|
2390
|
-
return n.__id || Object.defineProperty(n, "__id", { value: ++
|
|
2398
|
+
return n.__id || Object.defineProperty(n, "__id", { value: ++A }), n.__id;
|
|
2391
2399
|
},
|
|
2392
2400
|
/**
|
|
2393
2401
|
* Creates a deep clone of the given object.
|
|
@@ -2402,23 +2410,23 @@ var ht = { exports: {} };
|
|
|
2402
2410
|
clone: function n(u, h) {
|
|
2403
2411
|
h = h || {};
|
|
2404
2412
|
var p, x;
|
|
2405
|
-
switch (
|
|
2413
|
+
switch (O.util.type(u)) {
|
|
2406
2414
|
case "Object":
|
|
2407
|
-
if (x =
|
|
2415
|
+
if (x = O.util.objId(u), h[x])
|
|
2408
2416
|
return h[x];
|
|
2409
2417
|
p = /** @type {Record<string, any>} */
|
|
2410
2418
|
{}, h[x] = p;
|
|
2411
|
-
for (var
|
|
2412
|
-
u.hasOwnProperty(
|
|
2419
|
+
for (var k in u)
|
|
2420
|
+
u.hasOwnProperty(k) && (p[k] = n(u[k], h));
|
|
2413
2421
|
return (
|
|
2414
2422
|
/** @type {any} */
|
|
2415
2423
|
p
|
|
2416
2424
|
);
|
|
2417
2425
|
case "Array":
|
|
2418
|
-
return x =
|
|
2426
|
+
return x = O.util.objId(u), h[x] ? h[x] : (p = [], h[x] = p, /** @type {Array} */
|
|
2419
2427
|
/** @type {any} */
|
|
2420
|
-
u.forEach(function(
|
|
2421
|
-
p[d] = n(
|
|
2428
|
+
u.forEach(function(m, d) {
|
|
2429
|
+
p[d] = n(m, h);
|
|
2422
2430
|
}), /** @type {any} */
|
|
2423
2431
|
p);
|
|
2424
2432
|
default:
|
|
@@ -2435,7 +2443,7 @@ var ht = { exports: {} };
|
|
|
2435
2443
|
*/
|
|
2436
2444
|
getLanguage: function(n) {
|
|
2437
2445
|
for (; n; ) {
|
|
2438
|
-
var u =
|
|
2446
|
+
var u = S.exec(n.className);
|
|
2439
2447
|
if (u)
|
|
2440
2448
|
return u[1].toLowerCase();
|
|
2441
2449
|
n = n.parentElement;
|
|
@@ -2450,7 +2458,7 @@ var ht = { exports: {} };
|
|
|
2450
2458
|
* @returns {void}
|
|
2451
2459
|
*/
|
|
2452
2460
|
setLanguage: function(n, u) {
|
|
2453
|
-
n.className = n.className.replace(RegExp(
|
|
2461
|
+
n.className = n.className.replace(RegExp(S, "gi"), ""), n.classList.add("language-" + u);
|
|
2454
2462
|
},
|
|
2455
2463
|
/**
|
|
2456
2464
|
* Returns the script element that is currently executing.
|
|
@@ -2522,10 +2530,10 @@ var ht = { exports: {} };
|
|
|
2522
2530
|
/**
|
|
2523
2531
|
* The grammar for plain, unformatted text.
|
|
2524
2532
|
*/
|
|
2525
|
-
plain:
|
|
2526
|
-
plaintext:
|
|
2527
|
-
text:
|
|
2528
|
-
txt:
|
|
2533
|
+
plain: b,
|
|
2534
|
+
plaintext: b,
|
|
2535
|
+
text: b,
|
|
2536
|
+
txt: b,
|
|
2529
2537
|
/**
|
|
2530
2538
|
* Creates a deep copy of the language with the given id and appends the given tokens.
|
|
2531
2539
|
*
|
|
@@ -2555,7 +2563,7 @@ var ht = { exports: {} };
|
|
|
2555
2563
|
* });
|
|
2556
2564
|
*/
|
|
2557
2565
|
extend: function(n, u) {
|
|
2558
|
-
var h =
|
|
2566
|
+
var h = O.util.clone(O.languages[n]);
|
|
2559
2567
|
for (var p in u)
|
|
2560
2568
|
h[p] = u[p];
|
|
2561
2569
|
return h;
|
|
@@ -2637,29 +2645,29 @@ var ht = { exports: {} };
|
|
|
2637
2645
|
*/
|
|
2638
2646
|
insertBefore: function(n, u, h, p) {
|
|
2639
2647
|
p = p || /** @type {any} */
|
|
2640
|
-
|
|
2641
|
-
var x = p[n],
|
|
2642
|
-
for (var
|
|
2643
|
-
if (x.hasOwnProperty(
|
|
2644
|
-
if (
|
|
2648
|
+
O.languages;
|
|
2649
|
+
var x = p[n], k = {};
|
|
2650
|
+
for (var m in x)
|
|
2651
|
+
if (x.hasOwnProperty(m)) {
|
|
2652
|
+
if (m == u)
|
|
2645
2653
|
for (var d in h)
|
|
2646
|
-
h.hasOwnProperty(d) && (
|
|
2647
|
-
h.hasOwnProperty(
|
|
2654
|
+
h.hasOwnProperty(d) && (k[d] = h[d]);
|
|
2655
|
+
h.hasOwnProperty(m) || (k[m] = x[m]);
|
|
2648
2656
|
}
|
|
2649
2657
|
var v = p[n];
|
|
2650
|
-
return p[n] =
|
|
2651
|
-
g === v && T != n && (this[T] =
|
|
2652
|
-
}),
|
|
2658
|
+
return p[n] = k, O.languages.DFS(O.languages, function(T, g) {
|
|
2659
|
+
g === v && T != n && (this[T] = k);
|
|
2660
|
+
}), k;
|
|
2653
2661
|
},
|
|
2654
2662
|
// Traverse a language definition with Depth First Search
|
|
2655
2663
|
DFS: function n(u, h, p, x) {
|
|
2656
2664
|
x = x || {};
|
|
2657
|
-
var
|
|
2658
|
-
for (var
|
|
2659
|
-
if (u.hasOwnProperty(
|
|
2660
|
-
h.call(u,
|
|
2661
|
-
var d = u[
|
|
2662
|
-
v === "Object" && !x[
|
|
2665
|
+
var k = O.util.objId;
|
|
2666
|
+
for (var m in u)
|
|
2667
|
+
if (u.hasOwnProperty(m)) {
|
|
2668
|
+
h.call(u, m, u[m], p || m);
|
|
2669
|
+
var d = u[m], v = O.util.type(d);
|
|
2670
|
+
v === "Object" && !x[k(d)] ? (x[k(d)] = !0, n(d, h, null, x)) : v === "Array" && !x[k(d)] && (x[k(d)] = !0, n(d, h, m, x));
|
|
2663
2671
|
}
|
|
2664
2672
|
}
|
|
2665
2673
|
},
|
|
@@ -2677,7 +2685,7 @@ var ht = { exports: {} };
|
|
|
2677
2685
|
* @public
|
|
2678
2686
|
*/
|
|
2679
2687
|
highlightAll: function(n, u) {
|
|
2680
|
-
|
|
2688
|
+
O.highlightAllUnder(document, n, u);
|
|
2681
2689
|
},
|
|
2682
2690
|
/**
|
|
2683
2691
|
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
|
@@ -2700,9 +2708,9 @@ var ht = { exports: {} };
|
|
|
2700
2708
|
container: n,
|
|
2701
2709
|
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
2702
2710
|
};
|
|
2703
|
-
|
|
2704
|
-
for (var x = 0,
|
|
2705
|
-
|
|
2711
|
+
O.hooks.run("before-highlightall", p), p.elements = Array.prototype.slice.apply(p.container.querySelectorAll(p.selector)), O.hooks.run("before-all-elements-highlight", p);
|
|
2712
|
+
for (var x = 0, k; k = p.elements[x++]; )
|
|
2713
|
+
O.highlightElement(k, u === !0, p.callback);
|
|
2706
2714
|
},
|
|
2707
2715
|
/**
|
|
2708
2716
|
* Highlights the code inside a single element.
|
|
@@ -2733,29 +2741,29 @@ var ht = { exports: {} };
|
|
|
2733
2741
|
* @public
|
|
2734
2742
|
*/
|
|
2735
2743
|
highlightElement: function(n, u, h) {
|
|
2736
|
-
var p =
|
|
2737
|
-
|
|
2738
|
-
var
|
|
2739
|
-
|
|
2740
|
-
var
|
|
2744
|
+
var p = O.util.getLanguage(n), x = O.languages[p];
|
|
2745
|
+
O.util.setLanguage(n, p);
|
|
2746
|
+
var k = n.parentElement;
|
|
2747
|
+
k && k.nodeName.toLowerCase() === "pre" && O.util.setLanguage(k, p);
|
|
2748
|
+
var m = n.textContent, d = {
|
|
2741
2749
|
element: n,
|
|
2742
2750
|
language: p,
|
|
2743
2751
|
grammar: x,
|
|
2744
|
-
code:
|
|
2752
|
+
code: m
|
|
2745
2753
|
};
|
|
2746
2754
|
function v(g) {
|
|
2747
|
-
d.highlightedCode = g,
|
|
2755
|
+
d.highlightedCode = g, O.hooks.run("before-insert", d), d.element.innerHTML = d.highlightedCode, O.hooks.run("after-highlight", d), O.hooks.run("complete", d), h && h.call(d.element);
|
|
2748
2756
|
}
|
|
2749
|
-
if (
|
|
2750
|
-
|
|
2757
|
+
if (O.hooks.run("before-sanity-check", d), k = d.element.parentElement, k && k.nodeName.toLowerCase() === "pre" && !k.hasAttribute("tabindex") && k.setAttribute("tabindex", "0"), !d.code) {
|
|
2758
|
+
O.hooks.run("complete", d), h && h.call(d.element);
|
|
2751
2759
|
return;
|
|
2752
2760
|
}
|
|
2753
|
-
if (
|
|
2754
|
-
v(
|
|
2761
|
+
if (O.hooks.run("before-highlight", d), !d.grammar) {
|
|
2762
|
+
v(O.util.encode(d.code));
|
|
2755
2763
|
return;
|
|
2756
2764
|
}
|
|
2757
2765
|
if (u && i.Worker) {
|
|
2758
|
-
var T = new Worker(
|
|
2766
|
+
var T = new Worker(O.filename);
|
|
2759
2767
|
T.onmessage = function(g) {
|
|
2760
2768
|
v(g.data);
|
|
2761
2769
|
}, T.postMessage(JSON.stringify({
|
|
@@ -2764,7 +2772,7 @@ var ht = { exports: {} };
|
|
|
2764
2772
|
immediateClose: !0
|
|
2765
2773
|
}));
|
|
2766
2774
|
} else
|
|
2767
|
-
v(
|
|
2775
|
+
v(O.highlight(d.code, d.grammar, d.language));
|
|
2768
2776
|
},
|
|
2769
2777
|
/**
|
|
2770
2778
|
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
|
@@ -2792,9 +2800,9 @@ var ht = { exports: {} };
|
|
|
2792
2800
|
grammar: u,
|
|
2793
2801
|
language: h
|
|
2794
2802
|
};
|
|
2795
|
-
if (
|
|
2803
|
+
if (O.hooks.run("before-tokenize", p), !p.grammar)
|
|
2796
2804
|
throw new Error('The language "' + p.language + '" has no grammar.');
|
|
2797
|
-
return p.tokens =
|
|
2805
|
+
return p.tokens = O.tokenize(p.code, p.grammar), O.hooks.run("after-tokenize", p), y.stringify(O.util.encode(p.tokens), p.language);
|
|
2798
2806
|
},
|
|
2799
2807
|
/**
|
|
2800
2808
|
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
|
@@ -2827,7 +2835,7 @@ var ht = { exports: {} };
|
|
|
2827
2835
|
u[p] = h[p];
|
|
2828
2836
|
delete u.rest;
|
|
2829
2837
|
}
|
|
2830
|
-
var x = new
|
|
2838
|
+
var x = new C();
|
|
2831
2839
|
return L(x, x.head, n), F(n, x, u, x.head, 0), a(x);
|
|
2832
2840
|
},
|
|
2833
2841
|
/**
|
|
@@ -2850,7 +2858,7 @@ var ht = { exports: {} };
|
|
|
2850
2858
|
* @public
|
|
2851
2859
|
*/
|
|
2852
2860
|
add: function(n, u) {
|
|
2853
|
-
var h =
|
|
2861
|
+
var h = O.hooks.all;
|
|
2854
2862
|
h[n] = h[n] || [], h[n].push(u);
|
|
2855
2863
|
},
|
|
2856
2864
|
/**
|
|
@@ -2863,7 +2871,7 @@ var ht = { exports: {} };
|
|
|
2863
2871
|
* @public
|
|
2864
2872
|
*/
|
|
2865
2873
|
run: function(n, u) {
|
|
2866
|
-
var h =
|
|
2874
|
+
var h = O.hooks.all[n];
|
|
2867
2875
|
if (!(!h || !h.length))
|
|
2868
2876
|
for (var p = 0, x; x = h[p++]; )
|
|
2869
2877
|
x(u);
|
|
@@ -2871,7 +2879,7 @@ var ht = { exports: {} };
|
|
|
2871
2879
|
},
|
|
2872
2880
|
Token: y
|
|
2873
2881
|
};
|
|
2874
|
-
i.Prism =
|
|
2882
|
+
i.Prism = O;
|
|
2875
2883
|
function y(n, u, h, p) {
|
|
2876
2884
|
this.type = n, this.content = u, this.alias = h, this.length = (p || "").length | 0;
|
|
2877
2885
|
}
|
|
@@ -2891,72 +2899,72 @@ var ht = { exports: {} };
|
|
|
2891
2899
|
classes: ["token", u.type],
|
|
2892
2900
|
attributes: {},
|
|
2893
2901
|
language: h
|
|
2894
|
-
},
|
|
2895
|
-
|
|
2896
|
-
var
|
|
2902
|
+
}, k = u.alias;
|
|
2903
|
+
k && (Array.isArray(k) ? Array.prototype.push.apply(x.classes, k) : x.classes.push(k)), O.hooks.run("wrap", x);
|
|
2904
|
+
var m = "";
|
|
2897
2905
|
for (var d in x.attributes)
|
|
2898
|
-
|
|
2899
|
-
return "<" + x.tag + ' class="' + x.classes.join(" ") + '"' +
|
|
2906
|
+
m += " " + d + '="' + (x.attributes[d] || "").replace(/"/g, """) + '"';
|
|
2907
|
+
return "<" + x.tag + ' class="' + x.classes.join(" ") + '"' + m + ">" + x.content + "</" + x.tag + ">";
|
|
2900
2908
|
};
|
|
2901
2909
|
function D(n, u, h, p) {
|
|
2902
2910
|
n.lastIndex = u;
|
|
2903
2911
|
var x = n.exec(h);
|
|
2904
2912
|
if (x && p && x[1]) {
|
|
2905
|
-
var
|
|
2906
|
-
x.index +=
|
|
2913
|
+
var k = x[1].length;
|
|
2914
|
+
x.index += k, x[0] = x[0].slice(k);
|
|
2907
2915
|
}
|
|
2908
2916
|
return x;
|
|
2909
2917
|
}
|
|
2910
|
-
function F(n, u, h, p, x,
|
|
2911
|
-
for (var
|
|
2912
|
-
if (!(!h.hasOwnProperty(
|
|
2913
|
-
var d = h[
|
|
2918
|
+
function F(n, u, h, p, x, k) {
|
|
2919
|
+
for (var m in h)
|
|
2920
|
+
if (!(!h.hasOwnProperty(m) || !h[m])) {
|
|
2921
|
+
var d = h[m];
|
|
2914
2922
|
d = Array.isArray(d) ? d : [d];
|
|
2915
2923
|
for (var v = 0; v < d.length; ++v) {
|
|
2916
|
-
if (
|
|
2924
|
+
if (k && k.cause == m + "," + v)
|
|
2917
2925
|
return;
|
|
2918
|
-
var T = d[v], g = T.inside,
|
|
2926
|
+
var T = d[v], g = T.inside, _ = !!T.lookbehind, I = !!T.greedy, M = T.alias;
|
|
2919
2927
|
if (I && !T.pattern.global) {
|
|
2920
2928
|
var l = T.pattern.toString().match(/[imsuy]*$/)[0];
|
|
2921
2929
|
T.pattern = RegExp(T.pattern.source, l + "g");
|
|
2922
2930
|
}
|
|
2923
|
-
for (var R = T.pattern || T,
|
|
2924
|
-
var B =
|
|
2931
|
+
for (var R = T.pattern || T, E = p.next, w = x; E !== u.tail && !(k && w >= k.reach); w += E.value.length, E = E.next) {
|
|
2932
|
+
var B = E.value;
|
|
2925
2933
|
if (u.length > n.length)
|
|
2926
2934
|
return;
|
|
2927
2935
|
if (!(B instanceof y)) {
|
|
2928
2936
|
var W = 1, G;
|
|
2929
2937
|
if (I) {
|
|
2930
|
-
if (G = D(R, w, n,
|
|
2938
|
+
if (G = D(R, w, n, _), !G || G.index >= n.length)
|
|
2931
2939
|
break;
|
|
2932
2940
|
var U = G.index, Y = G.index + G[0].length, z = w;
|
|
2933
|
-
for (z +=
|
|
2934
|
-
|
|
2935
|
-
if (z -=
|
|
2941
|
+
for (z += E.value.length; U >= z; )
|
|
2942
|
+
E = E.next, z += E.value.length;
|
|
2943
|
+
if (z -= E.value.length, w = z, E.value instanceof y)
|
|
2936
2944
|
continue;
|
|
2937
|
-
for (var P =
|
|
2945
|
+
for (var P = E; P !== u.tail && (z < Y || typeof P.value == "string"); P = P.next)
|
|
2938
2946
|
W++, z += P.value.length;
|
|
2939
2947
|
W--, B = n.slice(w, z), G.index -= w;
|
|
2940
|
-
} else if (G = D(R, 0, B,
|
|
2948
|
+
} else if (G = D(R, 0, B, _), !G)
|
|
2941
2949
|
continue;
|
|
2942
2950
|
var U = G.index, V = G[0], f = B.slice(0, U), N = B.slice(U + V.length), H = w + B.length;
|
|
2943
|
-
|
|
2944
|
-
var ae =
|
|
2951
|
+
k && H > k.reach && (k.reach = H);
|
|
2952
|
+
var ae = E.prev;
|
|
2945
2953
|
f && (ae = L(u, ae, f), w += f.length), j(u, ae, W);
|
|
2946
|
-
var vt = new y(
|
|
2947
|
-
if (
|
|
2954
|
+
var vt = new y(m, g ? O.tokenize(V, g) : V, M, V);
|
|
2955
|
+
if (E = L(u, ae, vt), N && L(u, E, N), W > 1) {
|
|
2948
2956
|
var ce = {
|
|
2949
|
-
cause:
|
|
2957
|
+
cause: m + "," + v,
|
|
2950
2958
|
reach: H
|
|
2951
2959
|
};
|
|
2952
|
-
F(n, u, h,
|
|
2960
|
+
F(n, u, h, E.prev, w, ce), k && ce.reach > k.reach && (k.reach = ce.reach);
|
|
2953
2961
|
}
|
|
2954
2962
|
}
|
|
2955
2963
|
}
|
|
2956
2964
|
}
|
|
2957
2965
|
}
|
|
2958
2966
|
}
|
|
2959
|
-
function
|
|
2967
|
+
function C() {
|
|
2960
2968
|
var n = { value: null, prev: null, next: null }, u = { value: null, prev: n, next: null };
|
|
2961
2969
|
n.next = u, this.head = n, this.tail = u, this.length = 0;
|
|
2962
2970
|
}
|
|
@@ -2975,20 +2983,20 @@ var ht = { exports: {} };
|
|
|
2975
2983
|
return u;
|
|
2976
2984
|
}
|
|
2977
2985
|
if (!i.document)
|
|
2978
|
-
return i.addEventListener && (
|
|
2986
|
+
return i.addEventListener && (O.disableWorkerMessageHandler || i.addEventListener("message", function(n) {
|
|
2979
2987
|
var u = JSON.parse(n.data), h = u.language, p = u.code, x = u.immediateClose;
|
|
2980
|
-
i.postMessage(
|
|
2981
|
-
}, !1)),
|
|
2982
|
-
var s =
|
|
2983
|
-
s && (
|
|
2988
|
+
i.postMessage(O.highlight(p, O.languages[h], h)), x && i.close();
|
|
2989
|
+
}, !1)), O;
|
|
2990
|
+
var s = O.util.currentScript();
|
|
2991
|
+
s && (O.filename = s.src, s.hasAttribute("data-manual") && (O.manual = !0));
|
|
2984
2992
|
function c() {
|
|
2985
|
-
|
|
2993
|
+
O.manual || O.highlightAll();
|
|
2986
2994
|
}
|
|
2987
|
-
if (!
|
|
2995
|
+
if (!O.manual) {
|
|
2988
2996
|
var o = document.readyState;
|
|
2989
2997
|
o === "loading" || o === "interactive" && s && s.defer ? document.addEventListener("DOMContentLoaded", c) : window.requestAnimationFrame ? window.requestAnimationFrame(c) : window.setTimeout(c, 16);
|
|
2990
2998
|
}
|
|
2991
|
-
return
|
|
2999
|
+
return O;
|
|
2992
3000
|
}(e);
|
|
2993
3001
|
t.exports && (t.exports = r), typeof de < "u" && (de.Prism = r), r.languages.markup = {
|
|
2994
3002
|
comment: {
|
|
@@ -3081,31 +3089,31 @@ var ht = { exports: {} };
|
|
|
3081
3089
|
* @example
|
|
3082
3090
|
* addInlined('style', 'css');
|
|
3083
3091
|
*/
|
|
3084
|
-
value: function(
|
|
3085
|
-
var
|
|
3086
|
-
|
|
3092
|
+
value: function(S, A) {
|
|
3093
|
+
var b = {};
|
|
3094
|
+
b["language-" + A] = {
|
|
3087
3095
|
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
3088
3096
|
lookbehind: !0,
|
|
3089
|
-
inside: r.languages[
|
|
3090
|
-
},
|
|
3091
|
-
var
|
|
3097
|
+
inside: r.languages[A]
|
|
3098
|
+
}, b.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
3099
|
+
var O = {
|
|
3092
3100
|
"included-cdata": {
|
|
3093
3101
|
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
3094
|
-
inside:
|
|
3102
|
+
inside: b
|
|
3095
3103
|
}
|
|
3096
3104
|
};
|
|
3097
|
-
|
|
3105
|
+
O["language-" + A] = {
|
|
3098
3106
|
pattern: /[\s\S]+/,
|
|
3099
|
-
inside: r.languages[
|
|
3107
|
+
inside: r.languages[A]
|
|
3100
3108
|
};
|
|
3101
3109
|
var y = {};
|
|
3102
|
-
y[
|
|
3110
|
+
y[S] = {
|
|
3103
3111
|
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
3104
|
-
return
|
|
3112
|
+
return S;
|
|
3105
3113
|
}), "i"),
|
|
3106
3114
|
lookbehind: !0,
|
|
3107
3115
|
greedy: !0,
|
|
3108
|
-
inside:
|
|
3116
|
+
inside: O
|
|
3109
3117
|
}, r.languages.insertBefore("markup", "cdata", y);
|
|
3110
3118
|
}
|
|
3111
3119
|
}), Object.defineProperty(r.languages.markup.tag, "addAttribute", {
|
|
@@ -3120,7 +3128,7 @@ var ht = { exports: {} };
|
|
|
3120
3128
|
* @example
|
|
3121
3129
|
* addAttribute('style', 'css');
|
|
3122
3130
|
*/
|
|
3123
|
-
value: function(i,
|
|
3131
|
+
value: function(i, S) {
|
|
3124
3132
|
r.languages.markup.tag.inside["special-attr"].push({
|
|
3125
3133
|
pattern: RegExp(
|
|
3126
3134
|
/(^|["'\s])/.source + "(?:" + i + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
|
@@ -3135,8 +3143,8 @@ var ht = { exports: {} };
|
|
|
3135
3143
|
value: {
|
|
3136
3144
|
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
3137
3145
|
lookbehind: !0,
|
|
3138
|
-
alias: [
|
|
3139
|
-
inside: r.languages[
|
|
3146
|
+
alias: [S, "language-" + S],
|
|
3147
|
+
inside: r.languages[S]
|
|
3140
3148
|
},
|
|
3141
3149
|
punctuation: [
|
|
3142
3150
|
{
|
|
@@ -3151,11 +3159,11 @@ var ht = { exports: {} };
|
|
|
3151
3159
|
});
|
|
3152
3160
|
}
|
|
3153
3161
|
}), r.languages.html = r.languages.markup, r.languages.mathml = r.languages.markup, r.languages.svg = r.languages.markup, r.languages.xml = r.languages.extend("markup", {}), r.languages.ssml = r.languages.xml, r.languages.atom = r.languages.xml, r.languages.rss = r.languages.xml, function(i) {
|
|
3154
|
-
var
|
|
3162
|
+
var S = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
3155
3163
|
i.languages.css = {
|
|
3156
3164
|
comment: /\/\*[\s\S]*?\*\//,
|
|
3157
3165
|
atrule: {
|
|
3158
|
-
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" +
|
|
3166
|
+
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + S.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
3159
3167
|
inside: {
|
|
3160
3168
|
rule: /^@[\w-]+/,
|
|
3161
3169
|
"selector-function-argument": {
|
|
@@ -3172,23 +3180,23 @@ var ht = { exports: {} };
|
|
|
3172
3180
|
},
|
|
3173
3181
|
url: {
|
|
3174
3182
|
// https://drafts.csswg.org/css-values-3/#urls
|
|
3175
|
-
pattern: RegExp("\\burl\\((?:" +
|
|
3183
|
+
pattern: RegExp("\\burl\\((?:" + S.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
3176
3184
|
greedy: !0,
|
|
3177
3185
|
inside: {
|
|
3178
3186
|
function: /^url/i,
|
|
3179
3187
|
punctuation: /^\(|\)$/,
|
|
3180
3188
|
string: {
|
|
3181
|
-
pattern: RegExp("^" +
|
|
3189
|
+
pattern: RegExp("^" + S.source + "$"),
|
|
3182
3190
|
alias: "url"
|
|
3183
3191
|
}
|
|
3184
3192
|
}
|
|
3185
3193
|
},
|
|
3186
3194
|
selector: {
|
|
3187
|
-
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` +
|
|
3195
|
+
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + S.source + ")*(?=\\s*\\{)"),
|
|
3188
3196
|
lookbehind: !0
|
|
3189
3197
|
},
|
|
3190
3198
|
string: {
|
|
3191
|
-
pattern:
|
|
3199
|
+
pattern: S,
|
|
3192
3200
|
greedy: !0
|
|
3193
3201
|
},
|
|
3194
3202
|
property: {
|
|
@@ -3202,8 +3210,8 @@ var ht = { exports: {} };
|
|
|
3202
3210
|
},
|
|
3203
3211
|
punctuation: /[(){};:,]/
|
|
3204
3212
|
}, i.languages.css.atrule.inside.rest = i.languages.css;
|
|
3205
|
-
var
|
|
3206
|
-
|
|
3213
|
+
var A = i.languages.markup;
|
|
3214
|
+
A && (A.tag.addInlined("style", "css"), A.tag.addAttribute("style", "css"));
|
|
3207
3215
|
}(r), r.languages.clike = {
|
|
3208
3216
|
comment: [
|
|
3209
3217
|
{
|
|
@@ -3368,9 +3376,9 @@ var ht = { exports: {} };
|
|
|
3368
3376
|
if (typeof r > "u" || typeof document > "u")
|
|
3369
3377
|
return;
|
|
3370
3378
|
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
3371
|
-
var i = "Loading…",
|
|
3379
|
+
var i = "Loading…", S = function(s, c) {
|
|
3372
3380
|
return "✖ Error " + s + " while fetching file: " + c;
|
|
3373
|
-
},
|
|
3381
|
+
}, A = "✖ Error: File does not exist or is empty", b = {
|
|
3374
3382
|
js: "javascript",
|
|
3375
3383
|
py: "python",
|
|
3376
3384
|
rb: "ruby",
|
|
@@ -3380,11 +3388,11 @@ var ht = { exports: {} };
|
|
|
3380
3388
|
bat: "batch",
|
|
3381
3389
|
h: "c",
|
|
3382
3390
|
tex: "latex"
|
|
3383
|
-
},
|
|
3391
|
+
}, O = "data-src-status", y = "loading", D = "loaded", F = "failed", C = "pre[data-src]:not([" + O + '="' + D + '"]):not([' + O + '="' + y + '"])';
|
|
3384
3392
|
function L(s, c, o) {
|
|
3385
3393
|
var n = new XMLHttpRequest();
|
|
3386
3394
|
n.open("GET", s, !0), n.onreadystatechange = function() {
|
|
3387
|
-
n.readyState == 4 && (n.status < 400 && n.responseText ? c(n.responseText) : n.status >= 400 ? o(
|
|
3395
|
+
n.readyState == 4 && (n.status < 400 && n.responseText ? c(n.responseText) : n.status >= 400 ? o(S(n.status, n.statusText)) : o(A));
|
|
3388
3396
|
}, n.send(null);
|
|
3389
3397
|
}
|
|
3390
3398
|
function j(s) {
|
|
@@ -3395,37 +3403,37 @@ var ht = { exports: {} };
|
|
|
3395
3403
|
}
|
|
3396
3404
|
}
|
|
3397
3405
|
r.hooks.add("before-highlightall", function(s) {
|
|
3398
|
-
s.selector += ", " +
|
|
3406
|
+
s.selector += ", " + C;
|
|
3399
3407
|
}), r.hooks.add("before-sanity-check", function(s) {
|
|
3400
3408
|
var c = (
|
|
3401
3409
|
/** @type {HTMLPreElement} */
|
|
3402
3410
|
s.element
|
|
3403
3411
|
);
|
|
3404
|
-
if (c.matches(
|
|
3405
|
-
s.code = "", c.setAttribute(
|
|
3412
|
+
if (c.matches(C)) {
|
|
3413
|
+
s.code = "", c.setAttribute(O, y);
|
|
3406
3414
|
var o = c.appendChild(document.createElement("CODE"));
|
|
3407
3415
|
o.textContent = i;
|
|
3408
3416
|
var n = c.getAttribute("data-src"), u = s.language;
|
|
3409
3417
|
if (u === "none") {
|
|
3410
3418
|
var h = (/\.(\w+)$/.exec(n) || [, "none"])[1];
|
|
3411
|
-
u =
|
|
3419
|
+
u = b[h] || h;
|
|
3412
3420
|
}
|
|
3413
3421
|
r.util.setLanguage(o, u), r.util.setLanguage(c, u);
|
|
3414
3422
|
var p = r.plugins.autoloader;
|
|
3415
3423
|
p && p.loadLanguages(u), L(
|
|
3416
3424
|
n,
|
|
3417
3425
|
function(x) {
|
|
3418
|
-
c.setAttribute(
|
|
3419
|
-
var
|
|
3420
|
-
if (
|
|
3421
|
-
var
|
|
3422
|
-
d < 0 && (d +=
|
|
3426
|
+
c.setAttribute(O, D);
|
|
3427
|
+
var k = j(c.getAttribute("data-range"));
|
|
3428
|
+
if (k) {
|
|
3429
|
+
var m = x.split(/\r\n?|\n/g), d = k[0], v = k[1] == null ? m.length : k[1];
|
|
3430
|
+
d < 0 && (d += m.length), d = Math.max(0, Math.min(d - 1, m.length)), v < 0 && (v += m.length), v = Math.max(0, Math.min(v, m.length)), x = m.slice(d, v).join(`
|
|
3423
3431
|
`), c.hasAttribute("data-start") || c.setAttribute("data-start", String(d + 1));
|
|
3424
3432
|
}
|
|
3425
3433
|
o.textContent = x, r.highlightElement(o);
|
|
3426
3434
|
},
|
|
3427
3435
|
function(x) {
|
|
3428
|
-
c.setAttribute(
|
|
3436
|
+
c.setAttribute(O, F), o.textContent = x;
|
|
3429
3437
|
}
|
|
3430
3438
|
);
|
|
3431
3439
|
}
|
|
@@ -3438,7 +3446,7 @@ var ht = { exports: {} };
|
|
|
3438
3446
|
* @param {ParentNode} [container=document]
|
|
3439
3447
|
*/
|
|
3440
3448
|
highlight: function(c) {
|
|
3441
|
-
for (var o = (c || document).querySelectorAll(
|
|
3449
|
+
for (var o = (c || document).querySelectorAll(C), n = 0, u; u = o[n++]; )
|
|
3442
3450
|
r.highlightElement(u);
|
|
3443
3451
|
}
|
|
3444
3452
|
};
|
|
@@ -3552,25 +3560,25 @@ Object.defineProperty(Prism.languages.markup.tag, "addInlined", {
|
|
|
3552
3560
|
lookbehind: !0,
|
|
3553
3561
|
inside: Prism.languages[r]
|
|
3554
3562
|
}, i.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
3555
|
-
var
|
|
3563
|
+
var S = {
|
|
3556
3564
|
"included-cdata": {
|
|
3557
3565
|
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
3558
3566
|
inside: i
|
|
3559
3567
|
}
|
|
3560
3568
|
};
|
|
3561
|
-
|
|
3569
|
+
S["language-" + r] = {
|
|
3562
3570
|
pattern: /[\s\S]+/,
|
|
3563
3571
|
inside: Prism.languages[r]
|
|
3564
3572
|
};
|
|
3565
|
-
var
|
|
3566
|
-
|
|
3573
|
+
var A = {};
|
|
3574
|
+
A[e] = {
|
|
3567
3575
|
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
3568
3576
|
return e;
|
|
3569
3577
|
}), "i"),
|
|
3570
3578
|
lookbehind: !0,
|
|
3571
3579
|
greedy: !0,
|
|
3572
|
-
inside:
|
|
3573
|
-
}, Prism.languages.insertBefore("markup", "cdata",
|
|
3580
|
+
inside: S
|
|
3581
|
+
}, Prism.languages.insertBefore("markup", "cdata", A);
|
|
3574
3582
|
}
|
|
3575
3583
|
});
|
|
3576
3584
|
Object.defineProperty(Prism.languages.markup.tag, "addAttribute", {
|
|
@@ -4039,7 +4047,7 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
4039
4047
|
lookbehind: !0
|
|
4040
4048
|
}
|
|
4041
4049
|
}, r.inside = t.languages.bash;
|
|
4042
|
-
for (var
|
|
4050
|
+
for (var S = [
|
|
4043
4051
|
"comment",
|
|
4044
4052
|
"function-name",
|
|
4045
4053
|
"for-or-select",
|
|
@@ -4055,8 +4063,8 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
4055
4063
|
"operator",
|
|
4056
4064
|
"punctuation",
|
|
4057
4065
|
"number"
|
|
4058
|
-
],
|
|
4059
|
-
|
|
4066
|
+
], A = i.variable[1].inside, b = 0; b < S.length; b++)
|
|
4067
|
+
A[S[b]] = t.languages.bash[S[b]];
|
|
4060
4068
|
t.languages.sh = t.languages.bash, t.languages.shell = t.languages.bash;
|
|
4061
4069
|
})(Prism);
|
|
4062
4070
|
Prism.languages.sql = {
|
|
@@ -4093,15 +4101,15 @@ Prism.languages.sql = {
|
|
|
4093
4101
|
punctuation: /[;[\]()`,.]/
|
|
4094
4102
|
};
|
|
4095
4103
|
(function(t) {
|
|
4096
|
-
var e = /[*&][^\s[\]{},]+/, r = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/, i = "(?:" + r.source + "(?:[ ]+" + e.source + ")?|" + e.source + "(?:[ ]+" + r.source + ")?)",
|
|
4104
|
+
var e = /[*&][^\s[\]{},]+/, r = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/, i = "(?:" + r.source + "(?:[ ]+" + e.source + ")?|" + e.source + "(?:[ ]+" + r.source + ")?)", S = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g, function() {
|
|
4097
4105
|
return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source;
|
|
4098
|
-
}),
|
|
4099
|
-
function
|
|
4106
|
+
}), A = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
|
|
4107
|
+
function b(O, y) {
|
|
4100
4108
|
y = (y || "").replace(/m/g, "") + "m";
|
|
4101
4109
|
var D = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g, function() {
|
|
4102
4110
|
return i;
|
|
4103
4111
|
}).replace(/<<value>>/g, function() {
|
|
4104
|
-
return
|
|
4112
|
+
return O;
|
|
4105
4113
|
});
|
|
4106
4114
|
return RegExp(D, y);
|
|
4107
4115
|
}
|
|
@@ -4118,7 +4126,7 @@ Prism.languages.sql = {
|
|
|
4118
4126
|
pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g, function() {
|
|
4119
4127
|
return i;
|
|
4120
4128
|
}).replace(/<<key>>/g, function() {
|
|
4121
|
-
return "(?:" +
|
|
4129
|
+
return "(?:" + S + "|" + A + ")";
|
|
4122
4130
|
})),
|
|
4123
4131
|
lookbehind: !0,
|
|
4124
4132
|
greedy: !0,
|
|
@@ -4130,27 +4138,27 @@ Prism.languages.sql = {
|
|
|
4130
4138
|
alias: "important"
|
|
4131
4139
|
},
|
|
4132
4140
|
datetime: {
|
|
4133
|
-
pattern:
|
|
4141
|
+
pattern: b(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),
|
|
4134
4142
|
lookbehind: !0,
|
|
4135
4143
|
alias: "number"
|
|
4136
4144
|
},
|
|
4137
4145
|
boolean: {
|
|
4138
|
-
pattern:
|
|
4146
|
+
pattern: b(/false|true/.source, "i"),
|
|
4139
4147
|
lookbehind: !0,
|
|
4140
4148
|
alias: "important"
|
|
4141
4149
|
},
|
|
4142
4150
|
null: {
|
|
4143
|
-
pattern:
|
|
4151
|
+
pattern: b(/null|~/.source, "i"),
|
|
4144
4152
|
lookbehind: !0,
|
|
4145
4153
|
alias: "important"
|
|
4146
4154
|
},
|
|
4147
4155
|
string: {
|
|
4148
|
-
pattern:
|
|
4156
|
+
pattern: b(A),
|
|
4149
4157
|
lookbehind: !0,
|
|
4150
4158
|
greedy: !0
|
|
4151
4159
|
},
|
|
4152
4160
|
number: {
|
|
4153
|
-
pattern:
|
|
4161
|
+
pattern: b(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, "i"),
|
|
4154
4162
|
lookbehind: !0
|
|
4155
4163
|
},
|
|
4156
4164
|
tag: r,
|
|
@@ -4241,9 +4249,9 @@ delete Prism.languages.c.boolean;
|
|
|
4241
4249
|
return e;
|
|
4242
4250
|
}), RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + F + ")");
|
|
4243
4251
|
}
|
|
4244
|
-
var i = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,
|
|
4252
|
+
var i = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source, S = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g, function() {
|
|
4245
4253
|
return i;
|
|
4246
|
-
}),
|
|
4254
|
+
}), A = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;
|
|
4247
4255
|
t.languages.markdown = t.languages.extend("markup", {}), t.languages.insertBefore("markdown", "prolog", {
|
|
4248
4256
|
"front-matter-block": {
|
|
4249
4257
|
pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,
|
|
@@ -4264,10 +4272,10 @@ delete Prism.languages.c.boolean;
|
|
|
4264
4272
|
alias: "punctuation"
|
|
4265
4273
|
},
|
|
4266
4274
|
table: {
|
|
4267
|
-
pattern: RegExp("^" +
|
|
4275
|
+
pattern: RegExp("^" + S + A + "(?:" + S + ")*", "m"),
|
|
4268
4276
|
inside: {
|
|
4269
4277
|
"table-data-rows": {
|
|
4270
|
-
pattern: RegExp("^(" +
|
|
4278
|
+
pattern: RegExp("^(" + S + A + ")(?:" + S + ")*$"),
|
|
4271
4279
|
lookbehind: !0,
|
|
4272
4280
|
inside: {
|
|
4273
4281
|
"table-data": {
|
|
@@ -4278,14 +4286,14 @@ delete Prism.languages.c.boolean;
|
|
|
4278
4286
|
}
|
|
4279
4287
|
},
|
|
4280
4288
|
"table-line": {
|
|
4281
|
-
pattern: RegExp("^(" +
|
|
4289
|
+
pattern: RegExp("^(" + S + ")" + A + "$"),
|
|
4282
4290
|
lookbehind: !0,
|
|
4283
4291
|
inside: {
|
|
4284
4292
|
punctuation: /\||:?-{3,}:?/
|
|
4285
4293
|
}
|
|
4286
4294
|
},
|
|
4287
4295
|
"table-header-row": {
|
|
4288
|
-
pattern: RegExp("^" +
|
|
4296
|
+
pattern: RegExp("^" + S + "$"),
|
|
4289
4297
|
inside: {
|
|
4290
4298
|
"table-header": {
|
|
4291
4299
|
pattern: RegExp(i),
|
|
@@ -4469,18 +4477,18 @@ delete Prism.languages.c.boolean;
|
|
|
4469
4477
|
}
|
|
4470
4478
|
}
|
|
4471
4479
|
}), ["url", "bold", "italic", "strike"].forEach(function(F) {
|
|
4472
|
-
["url", "bold", "italic", "strike", "code-snippet"].forEach(function(
|
|
4473
|
-
F !==
|
|
4480
|
+
["url", "bold", "italic", "strike", "code-snippet"].forEach(function(C) {
|
|
4481
|
+
F !== C && (t.languages.markdown[F].inside.content.inside[C] = t.languages.markdown[C]);
|
|
4474
4482
|
});
|
|
4475
4483
|
}), t.hooks.add("after-tokenize", function(F) {
|
|
4476
4484
|
if (F.language !== "markdown" && F.language !== "md")
|
|
4477
4485
|
return;
|
|
4478
|
-
function
|
|
4486
|
+
function C(L) {
|
|
4479
4487
|
if (!(!L || typeof L == "string"))
|
|
4480
4488
|
for (var j = 0, a = L.length; j < a; j++) {
|
|
4481
4489
|
var s = L[j];
|
|
4482
4490
|
if (s.type !== "code") {
|
|
4483
|
-
|
|
4491
|
+
C(s.content);
|
|
4484
4492
|
continue;
|
|
4485
4493
|
}
|
|
4486
4494
|
var c = s.content[1], o = s.content[3];
|
|
@@ -4492,45 +4500,45 @@ delete Prism.languages.c.boolean;
|
|
|
4492
4500
|
}
|
|
4493
4501
|
}
|
|
4494
4502
|
}
|
|
4495
|
-
|
|
4503
|
+
C(F.tokens);
|
|
4496
4504
|
}), t.hooks.add("wrap", function(F) {
|
|
4497
4505
|
if (F.type === "code-block") {
|
|
4498
|
-
for (var
|
|
4506
|
+
for (var C = "", L = 0, j = F.classes.length; L < j; L++) {
|
|
4499
4507
|
var a = F.classes[L], s = /language-(.+)/.exec(a);
|
|
4500
4508
|
if (s) {
|
|
4501
|
-
|
|
4509
|
+
C = s[1];
|
|
4502
4510
|
break;
|
|
4503
4511
|
}
|
|
4504
4512
|
}
|
|
4505
|
-
var c = t.languages[
|
|
4513
|
+
var c = t.languages[C];
|
|
4506
4514
|
if (c)
|
|
4507
|
-
F.content = t.highlight(D(F.content), c,
|
|
4508
|
-
else if (
|
|
4515
|
+
F.content = t.highlight(D(F.content), c, C);
|
|
4516
|
+
else if (C && C !== "none" && t.plugins.autoloader) {
|
|
4509
4517
|
var o = "md-" + (/* @__PURE__ */ new Date()).valueOf() + "-" + Math.floor(Math.random() * 1e16);
|
|
4510
|
-
F.attributes.id = o, t.plugins.autoloader.loadLanguages(
|
|
4518
|
+
F.attributes.id = o, t.plugins.autoloader.loadLanguages(C, function() {
|
|
4511
4519
|
var n = document.getElementById(o);
|
|
4512
|
-
n && (n.innerHTML = t.highlight(n.textContent, t.languages[
|
|
4520
|
+
n && (n.innerHTML = t.highlight(n.textContent, t.languages[C], C));
|
|
4513
4521
|
});
|
|
4514
4522
|
}
|
|
4515
4523
|
}
|
|
4516
4524
|
});
|
|
4517
|
-
var
|
|
4525
|
+
var b = RegExp(t.languages.markup.tag.pattern.source, "gi"), O = {
|
|
4518
4526
|
amp: "&",
|
|
4519
4527
|
lt: "<",
|
|
4520
4528
|
gt: ">",
|
|
4521
4529
|
quot: '"'
|
|
4522
4530
|
}, y = String.fromCodePoint || String.fromCharCode;
|
|
4523
4531
|
function D(F) {
|
|
4524
|
-
var
|
|
4525
|
-
return
|
|
4532
|
+
var C = F.replace(b, "");
|
|
4533
|
+
return C = C.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function(L, j) {
|
|
4526
4534
|
if (j = j.toLowerCase(), j[0] === "#") {
|
|
4527
4535
|
var a;
|
|
4528
4536
|
return j[1] === "x" ? a = parseInt(j.slice(2), 16) : a = Number(j.slice(1)), y(a);
|
|
4529
4537
|
} else {
|
|
4530
|
-
var s =
|
|
4538
|
+
var s = O[j];
|
|
4531
4539
|
return s || L;
|
|
4532
4540
|
}
|
|
4533
|
-
}),
|
|
4541
|
+
}), C;
|
|
4534
4542
|
}
|
|
4535
4543
|
t.languages.md = t.languages.markdown;
|
|
4536
4544
|
})(Prism);
|
|
@@ -4899,27 +4907,27 @@ delete Prism.languages.go["class-name"];
|
|
|
4899
4907
|
}), t.languages.ts = t.languages.typescript;
|
|
4900
4908
|
})(Prism);
|
|
4901
4909
|
(function(t) {
|
|
4902
|
-
var e = t.util.clone(t.languages.javascript), r = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source, i = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,
|
|
4903
|
-
function
|
|
4910
|
+
var e = t.util.clone(t.languages.javascript), r = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source, i = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source, S = /(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;
|
|
4911
|
+
function A(y, D) {
|
|
4904
4912
|
return y = y.replace(/<S>/g, function() {
|
|
4905
4913
|
return r;
|
|
4906
4914
|
}).replace(/<BRACES>/g, function() {
|
|
4907
4915
|
return i;
|
|
4908
4916
|
}).replace(/<SPREAD>/g, function() {
|
|
4909
|
-
return
|
|
4917
|
+
return S;
|
|
4910
4918
|
}), RegExp(y, D);
|
|
4911
4919
|
}
|
|
4912
|
-
|
|
4920
|
+
S = A(S).source, t.languages.jsx = t.languages.extend("markup", e), t.languages.jsx.tag.pattern = A(
|
|
4913
4921
|
/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source
|
|
4914
4922
|
), t.languages.jsx.tag.inside.tag.pattern = /^<\/?[^\s>\/]*/, t.languages.jsx.tag.inside["attr-value"].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/, t.languages.jsx.tag.inside.tag.inside["class-name"] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/, t.languages.jsx.tag.inside.comment = e.comment, t.languages.insertBefore("inside", "attr-name", {
|
|
4915
4923
|
spread: {
|
|
4916
|
-
pattern:
|
|
4924
|
+
pattern: A(/<SPREAD>/.source),
|
|
4917
4925
|
inside: t.languages.jsx
|
|
4918
4926
|
}
|
|
4919
4927
|
}, t.languages.jsx.tag), t.languages.insertBefore("inside", "special-attr", {
|
|
4920
4928
|
script: {
|
|
4921
4929
|
// Allow for two levels of nesting
|
|
4922
|
-
pattern:
|
|
4930
|
+
pattern: A(/=<BRACES>/.source),
|
|
4923
4931
|
alias: "language-javascript",
|
|
4924
4932
|
inside: {
|
|
4925
4933
|
"script-punctuation": {
|
|
@@ -4930,23 +4938,23 @@ delete Prism.languages.go["class-name"];
|
|
|
4930
4938
|
}
|
|
4931
4939
|
}
|
|
4932
4940
|
}, t.languages.jsx.tag);
|
|
4933
|
-
var
|
|
4934
|
-
return y ? typeof y == "string" ? y : typeof y.content == "string" ? y.content : y.content.map(
|
|
4935
|
-
},
|
|
4941
|
+
var b = function(y) {
|
|
4942
|
+
return y ? typeof y == "string" ? y : typeof y.content == "string" ? y.content : y.content.map(b).join("") : "";
|
|
4943
|
+
}, O = function(y) {
|
|
4936
4944
|
for (var D = [], F = 0; F < y.length; F++) {
|
|
4937
|
-
var
|
|
4938
|
-
if (typeof
|
|
4939
|
-
tagName:
|
|
4945
|
+
var C = y[F], L = !1;
|
|
4946
|
+
if (typeof C != "string" && (C.type === "tag" && C.content[0] && C.content[0].type === "tag" ? C.content[0].content[0].content === "</" ? D.length > 0 && D[D.length - 1].tagName === b(C.content[0].content[1]) && D.pop() : C.content[C.content.length - 1].content === "/>" || D.push({
|
|
4947
|
+
tagName: b(C.content[0].content[1]),
|
|
4940
4948
|
openedBraces: 0
|
|
4941
|
-
}) : D.length > 0 &&
|
|
4942
|
-
var j =
|
|
4943
|
-
F < y.length - 1 && (typeof y[F + 1] == "string" || y[F + 1].type === "plain-text") && (j +=
|
|
4949
|
+
}) : D.length > 0 && C.type === "punctuation" && C.content === "{" ? D[D.length - 1].openedBraces++ : D.length > 0 && D[D.length - 1].openedBraces > 0 && C.type === "punctuation" && C.content === "}" ? D[D.length - 1].openedBraces-- : L = !0), (L || typeof C == "string") && D.length > 0 && D[D.length - 1].openedBraces === 0) {
|
|
4950
|
+
var j = b(C);
|
|
4951
|
+
F < y.length - 1 && (typeof y[F + 1] == "string" || y[F + 1].type === "plain-text") && (j += b(y[F + 1]), y.splice(F + 1, 1)), F > 0 && (typeof y[F - 1] == "string" || y[F - 1].type === "plain-text") && (j = b(y[F - 1]) + j, y.splice(F - 1, 1), F--), y[F] = new t.Token("plain-text", j, null, j);
|
|
4944
4952
|
}
|
|
4945
|
-
|
|
4953
|
+
C.content && typeof C.content != "string" && O(C.content);
|
|
4946
4954
|
}
|
|
4947
4955
|
};
|
|
4948
4956
|
t.hooks.add("after-tokenize", function(y) {
|
|
4949
|
-
y.language !== "jsx" && y.language !== "tsx" ||
|
|
4957
|
+
y.language !== "jsx" && y.language !== "tsx" || O(y.tokens);
|
|
4950
4958
|
});
|
|
4951
4959
|
})(Prism);
|
|
4952
4960
|
(function(t) {
|
|
@@ -5046,13 +5054,13 @@ let ft, bt;
|
|
|
5046
5054
|
function J(t, e, r) {
|
|
5047
5055
|
return (e = mt(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
5048
5056
|
}
|
|
5049
|
-
function Er(t, e, r, i,
|
|
5050
|
-
function
|
|
5057
|
+
function Er(t, e, r, i, S, A) {
|
|
5058
|
+
function b(a, s, c) {
|
|
5051
5059
|
return function(o, n) {
|
|
5052
5060
|
return c && c(o), a[s].call(o, n);
|
|
5053
5061
|
};
|
|
5054
5062
|
}
|
|
5055
|
-
function
|
|
5063
|
+
function O(a, s) {
|
|
5056
5064
|
for (var c = 0; c < a.length; c++) a[c].call(s);
|
|
5057
5065
|
return s;
|
|
5058
5066
|
}
|
|
@@ -5060,22 +5068,22 @@ function Er(t, e, r, i, k, O) {
|
|
|
5060
5068
|
if (typeof a != "function" && (o || a !== void 0)) throw new TypeError(s + " must " + (c || "be") + " a function" + (o ? "" : " or undefined"));
|
|
5061
5069
|
return a;
|
|
5062
5070
|
}
|
|
5063
|
-
function D(a, s, c, o, n, u, h, p, x,
|
|
5071
|
+
function D(a, s, c, o, n, u, h, p, x, k, m, d, v) {
|
|
5064
5072
|
function T(f) {
|
|
5065
5073
|
if (!v(f)) throw new TypeError("Attempted to access private element on non-instance");
|
|
5066
5074
|
}
|
|
5067
|
-
var g,
|
|
5075
|
+
var g, _ = s[0], I = s[3], M = !p;
|
|
5068
5076
|
if (!M) {
|
|
5069
|
-
c || Array.isArray(
|
|
5070
|
-
var l = {}, R = [],
|
|
5071
|
-
|
|
5077
|
+
c || Array.isArray(_) || (_ = [_]);
|
|
5078
|
+
var l = {}, R = [], E = n === 3 ? "get" : n === 4 || d ? "set" : "value";
|
|
5079
|
+
k ? (m || d ? l = { get: Ce(function() {
|
|
5072
5080
|
return I(this);
|
|
5073
5081
|
}, o, "get"), set: function(f) {
|
|
5074
5082
|
s[4](this, f);
|
|
5075
|
-
} } : l[
|
|
5083
|
+
} } : l[E] = I, m || Ce(l[E], o, n === 2 ? "" : E)) : m || (l = Object.getOwnPropertyDescriptor(a, o));
|
|
5076
5084
|
}
|
|
5077
|
-
for (var w = a, B =
|
|
5078
|
-
var W =
|
|
5085
|
+
for (var w = a, B = _.length - 1; B >= 0; B -= c ? 2 : 1) {
|
|
5086
|
+
var W = _[B], G = c ? _[B - 1] : void 0, Y = {}, z = { kind: ["field", "accessor", "method", "getter", "setter", "class"][n], name: o, metadata: u, addInitializer: (function(f, N) {
|
|
5079
5087
|
if (f.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
5080
5088
|
y(N, "An initializer", "be", !0), h.push(N);
|
|
5081
5089
|
}).bind(null, Y) };
|
|
@@ -5083,58 +5091,58 @@ function Er(t, e, r, i, k, O) {
|
|
|
5083
5091
|
if (M) (g = y(W.call(G, w, z), "class decorators", "return")) && (w = g);
|
|
5084
5092
|
else {
|
|
5085
5093
|
var P, U;
|
|
5086
|
-
z.static = x, z.private =
|
|
5094
|
+
z.static = x, z.private = k, k ? n === 2 ? P = function(f) {
|
|
5087
5095
|
return T(f), l.value;
|
|
5088
|
-
} : (n < 4 && (P =
|
|
5096
|
+
} : (n < 4 && (P = b(l, "get", T)), n !== 3 && (U = b(l, "set", T))) : (P = function(f) {
|
|
5089
5097
|
return f[o];
|
|
5090
5098
|
}, (n < 2 || n === 4) && (U = function(f, N) {
|
|
5091
5099
|
f[o] = N;
|
|
5092
5100
|
}));
|
|
5093
|
-
var V = z.access = { has:
|
|
5101
|
+
var V = z.access = { has: k ? v.bind() : function(f) {
|
|
5094
5102
|
return o in f;
|
|
5095
5103
|
} };
|
|
5096
|
-
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[
|
|
5104
|
+
if (P && (V.get = P), U && (V.set = U), w = W.call(G, d ? { get: l.get, set: l.set } : l[E], z), d) {
|
|
5097
5105
|
if (typeof w == "object" && w) (g = y(w.get, "accessor.get")) && (l.get = g), (g = y(w.set, "accessor.set")) && (l.set = g), (g = y(w.init, "accessor.init")) && R.push(g);
|
|
5098
5106
|
else if (w !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
5099
|
-
} else y(w, (
|
|
5107
|
+
} else y(w, (m ? "field" : "method") + " decorators", "return") && (m ? R.push(w) : l[E] = w);
|
|
5100
5108
|
}
|
|
5101
5109
|
} finally {
|
|
5102
5110
|
Y.v = !0;
|
|
5103
5111
|
}
|
|
5104
5112
|
}
|
|
5105
|
-
return (
|
|
5113
|
+
return (m || d) && p.push(function(f, N) {
|
|
5106
5114
|
for (var H = R.length - 1; H >= 0; H--) N = R[H].call(f, N);
|
|
5107
5115
|
return N;
|
|
5108
|
-
}),
|
|
5116
|
+
}), m || M || (k ? d ? p.push(b(l, "get"), b(l, "set")) : p.push(n === 2 ? l[E] : b.call.bind(l[E])) : Object.defineProperty(a, o, l)), w;
|
|
5109
5117
|
}
|
|
5110
5118
|
function F(a, s) {
|
|
5111
5119
|
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: s });
|
|
5112
5120
|
}
|
|
5113
|
-
if (arguments.length >= 6) var
|
|
5114
|
-
var L = Object.create(
|
|
5115
|
-
var n, u, h = [], p = function(
|
|
5116
|
-
return Ar(
|
|
5121
|
+
if (arguments.length >= 6) var C = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
5122
|
+
var L = Object.create(C ?? null), j = function(a, s, c, o) {
|
|
5123
|
+
var n, u, h = [], p = function(E) {
|
|
5124
|
+
return Ar(E) === a;
|
|
5117
5125
|
}, x = /* @__PURE__ */ new Map();
|
|
5118
|
-
function E
|
|
5119
|
-
|
|
5126
|
+
function k(E) {
|
|
5127
|
+
E && h.push(O.bind(null, E));
|
|
5120
5128
|
}
|
|
5121
|
-
for (var
|
|
5122
|
-
var d = s[
|
|
5129
|
+
for (var m = 0; m < s.length; m++) {
|
|
5130
|
+
var d = s[m];
|
|
5123
5131
|
if (Array.isArray(d)) {
|
|
5124
|
-
var v = d[1], T = d[2], g = d.length > 3,
|
|
5132
|
+
var v = d[1], T = d[2], g = d.length > 3, _ = 16 & v, I = !!(8 & v), M = (v &= 7) == 0, l = T + "/" + I;
|
|
5125
5133
|
if (!M && !g) {
|
|
5126
5134
|
var R = x.get(l);
|
|
5127
5135
|
if (R === !0 || R === 3 && v !== 4 || R === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
5128
5136
|
x.set(l, !(v > 2) || v);
|
|
5129
5137
|
}
|
|
5130
|
-
D(I ? a : a.prototype, d,
|
|
5138
|
+
D(I ? a : a.prototype, d, _, g ? "#" + T : mt(T), v, o, I ? u = u || [] : n = n || [], h, I, g, M, v === 1, I && g ? p : c);
|
|
5131
5139
|
}
|
|
5132
5140
|
}
|
|
5133
|
-
return
|
|
5134
|
-
}(t, e,
|
|
5141
|
+
return k(n), k(u), h;
|
|
5142
|
+
}(t, e, S, L);
|
|
5135
5143
|
return r.length || F(t, L), { e: j, get c() {
|
|
5136
5144
|
var a = [];
|
|
5137
|
-
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L),
|
|
5145
|
+
return r.length && [F(D(t, [r], i, t.name, 5, L, a), L), O.bind(null, a, t)];
|
|
5138
5146
|
} };
|
|
5139
5147
|
}
|
|
5140
5148
|
function mt(t) {
|
|
@@ -5151,7 +5159,7 @@ function Sr(t, e) {
|
|
|
5151
5159
|
}
|
|
5152
5160
|
return String(t);
|
|
5153
5161
|
}
|
|
5154
|
-
function
|
|
5162
|
+
function Ce(t, e, r) {
|
|
5155
5163
|
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
5156
5164
|
try {
|
|
5157
5165
|
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
@@ -5167,7 +5175,7 @@ bt = [te({
|
|
|
5167
5175
|
tagName: "wsx-code-block"
|
|
5168
5176
|
})];
|
|
5169
5177
|
let Or;
|
|
5170
|
-
class Tr extends
|
|
5178
|
+
class Tr extends _e {
|
|
5171
5179
|
constructor() {
|
|
5172
5180
|
super(), J(this, "_autoStyles", kr), J(this, "copied", void 0), J(this, "highlighted", void 0), J(this, "code", void 0), J(this, "segments", void 0), J(this, "codeTitle", void 0), J(this, "language", void 0), J(this, "showCopy", void 0), J(this, "showTryOnline", void 0), J(this, "tryOnlineUrl", void 0), J(this, "onTryOnlineCallback", void 0), J(this, "codeElements", []), J(this, "isHighlighting", !1), J(this, "copyCode", async (n) => {
|
|
5173
5181
|
const u = n || this.code || this.segments.map((h) => h.code).join(`
|
|
@@ -5200,25 +5208,25 @@ class Tr extends Ce {
|
|
|
5200
5208
|
enumerable: !0,
|
|
5201
5209
|
configurable: !0
|
|
5202
5210
|
});
|
|
5203
|
-
const [i,
|
|
5211
|
+
const [i, S] = this.useState("highlighted", !1);
|
|
5204
5212
|
Object.defineProperty(this, "highlighted", {
|
|
5205
5213
|
get: i,
|
|
5206
|
-
set:
|
|
5214
|
+
set: S,
|
|
5207
5215
|
enumerable: !0,
|
|
5208
5216
|
configurable: !0
|
|
5209
5217
|
});
|
|
5210
|
-
const [
|
|
5218
|
+
const [A, b] = this.useState("code", "");
|
|
5211
5219
|
Object.defineProperty(this, "code", {
|
|
5212
|
-
get:
|
|
5213
|
-
set:
|
|
5220
|
+
get: A,
|
|
5221
|
+
set: b,
|
|
5214
5222
|
enumerable: !0,
|
|
5215
5223
|
configurable: !0
|
|
5216
5224
|
});
|
|
5217
|
-
let
|
|
5225
|
+
let O = this.reactive([]);
|
|
5218
5226
|
Object.defineProperty(this, "segments", {
|
|
5219
|
-
get: () =>
|
|
5227
|
+
get: () => O,
|
|
5220
5228
|
set: (n) => {
|
|
5221
|
-
|
|
5229
|
+
O = n !== null && typeof n < "u" && (Array.isArray(n) || typeof n == "object") ? this.reactive(n) : n, this.scheduleRerender();
|
|
5222
5230
|
},
|
|
5223
5231
|
enumerable: !0,
|
|
5224
5232
|
configurable: !0
|
|
@@ -5230,10 +5238,10 @@ class Tr extends Ce {
|
|
|
5230
5238
|
enumerable: !0,
|
|
5231
5239
|
configurable: !0
|
|
5232
5240
|
});
|
|
5233
|
-
const [F,
|
|
5241
|
+
const [F, C] = this.useState("language", "typescript");
|
|
5234
5242
|
Object.defineProperty(this, "language", {
|
|
5235
5243
|
get: F,
|
|
5236
|
-
set:
|
|
5244
|
+
set: C,
|
|
5237
5245
|
enumerable: !0,
|
|
5238
5246
|
configurable: !0
|
|
5239
5247
|
});
|
|
@@ -5264,7 +5272,8 @@ class Tr extends Ce {
|
|
|
5264
5272
|
}
|
|
5265
5273
|
// 防止重复高亮
|
|
5266
5274
|
onRendered() {
|
|
5267
|
-
|
|
5275
|
+
var e;
|
|
5276
|
+
(e = super.onRendered) == null || e.call(this), this.isHighlighting || this.highlightCode();
|
|
5268
5277
|
}
|
|
5269
5278
|
/**
|
|
5270
5279
|
* 通过方法设置配置(用于编程式使用)
|
|
@@ -5284,8 +5293,8 @@ class Tr extends Ce {
|
|
|
5284
5293
|
const r = e.map((i) => i.code).join(`
|
|
5285
5294
|
|
|
5286
5295
|
`);
|
|
5287
|
-
return /* @__PURE__ */ $("div", { class: "code-block" }, (this.codeTitle || this.showCopy || this.showTryOnline) && /* @__PURE__ */ $("div", { class: "code-header" }, this.codeTitle && /* @__PURE__ */ $("span", { class: "code-title" }, this.codeTitle), /* @__PURE__ */ $("div", { class: "code-actions" }, this.showCopy && /* @__PURE__ */ $("button", { onClick: () => this.copyCode(r), class: `btn-copy ${this.copied ? "copied" : ""}`, "data-wsx-key": "CodeBlock-button-text-3" }, this.copied ? "✓ Copied!" : "Copy"), this.showTryOnline && /* @__PURE__ */ $("button", { onClick: this.openPlayground, class: "btn-try", "data-wsx-key": "CodeBlock-button-text-3" }, "Try Online"))), /* @__PURE__ */ $("div", { class: "code-content" }, e.map((i,
|
|
5288
|
-
|
|
5296
|
+
return /* @__PURE__ */ $("div", { class: "code-block" }, (this.codeTitle || this.showCopy || this.showTryOnline) && /* @__PURE__ */ $("div", { class: "code-header" }, this.codeTitle && /* @__PURE__ */ $("span", { class: "code-title" }, this.codeTitle), /* @__PURE__ */ $("div", { class: "code-actions" }, this.showCopy && /* @__PURE__ */ $("button", { onClick: () => this.copyCode(r), class: `btn-copy ${this.copied ? "copied" : ""}`, "data-wsx-key": "CodeBlock-button-text-3" }, this.copied ? "✓ Copied!" : "Copy"), this.showTryOnline && /* @__PURE__ */ $("button", { onClick: this.openPlayground, class: "btn-try", "data-wsx-key": "CodeBlock-button-text-3" }, "Try Online"))), /* @__PURE__ */ $("div", { class: "code-content" }, e.map((i, S) => /* @__PURE__ */ $("pre", { key: S, class: "code-segment" }, /* @__PURE__ */ $("code", { class: `language-${i.language}`, ref: (A) => {
|
|
5297
|
+
A && (this.codeElements[S] = A);
|
|
5289
5298
|
} }, i.code)))));
|
|
5290
5299
|
}
|
|
5291
5300
|
/**
|
|
@@ -5301,8 +5310,8 @@ class Tr extends Ce {
|
|
|
5301
5310
|
this.segments.forEach((e, r) => {
|
|
5302
5311
|
const i = this.codeElements[r] || this.querySelectorAll("code")[r];
|
|
5303
5312
|
if (i && !i.hasAttribute("data-prism-highlighted")) {
|
|
5304
|
-
const
|
|
5305
|
-
i.className = `language-${
|
|
5313
|
+
const S = e.language.toLowerCase();
|
|
5314
|
+
i.className = `language-${S}`, Te.highlightElement(i), i.setAttribute("data-prism-highlighted", "true");
|
|
5306
5315
|
}
|
|
5307
5316
|
});
|
|
5308
5317
|
else if (this.code) {
|
|
@@ -5326,11 +5335,11 @@ class Tr extends Ce {
|
|
|
5326
5335
|
}
|
|
5327
5336
|
}
|
|
5328
5337
|
gt = Tr;
|
|
5329
|
-
[Or, ft] = Er(gt, [], bt, 0, void 0,
|
|
5338
|
+
[Or, ft] = Er(gt, [], bt, 0, void 0, _e).c;
|
|
5330
5339
|
ft();
|
|
5331
5340
|
export {
|
|
5332
5341
|
Et as Button,
|
|
5333
|
-
|
|
5342
|
+
_t as ButtonGroup,
|
|
5334
5343
|
Ir as CONVERTER_BTN,
|
|
5335
5344
|
Fr as CONVERTER_PANEL,
|
|
5336
5345
|
Or as CodeBlock,
|
|
@@ -5342,7 +5351,7 @@ export {
|
|
|
5342
5351
|
yr as SvgIcon,
|
|
5343
5352
|
Jt as ThemeSwitcher,
|
|
5344
5353
|
jt as getCustomColorCache,
|
|
5345
|
-
|
|
5354
|
+
_r as getDefaultColorCache,
|
|
5346
5355
|
se as handleCSSVariables,
|
|
5347
5356
|
Pt as setCustomColorCache,
|
|
5348
5357
|
zt as setDefaultColorCache,
|