@mantou/gem 1.7.12 → 2.0.0-alpha.0
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/LICENSE +21 -0
- package/README.md +1 -1
- package/dist/gem.es.js +2010 -1765
- package/dist/gem.umd.js +52 -53
- package/elements/base/dialog.d.ts +0 -11
- package/elements/base/dialog.d.ts.map +1 -1
- package/elements/base/dialog.js +93 -66
- package/elements/base/dialog.js.map +1 -1
- package/elements/base/gesture.d.ts +1 -2
- package/elements/base/gesture.d.ts.map +1 -1
- package/elements/base/gesture.js +157 -96
- package/elements/base/gesture.js.map +1 -1
- package/elements/base/link.d.ts +5 -5
- package/elements/base/link.d.ts.map +1 -1
- package/elements/base/link.js +249 -145
- package/elements/base/link.js.map +1 -1
- package/elements/base/modal-factory.d.ts +145 -139
- package/elements/base/modal-factory.d.ts.map +1 -1
- package/elements/base/modal-factory.js +84 -25
- package/elements/base/modal-factory.js.map +1 -1
- package/elements/base/reflect.d.ts +0 -1
- package/elements/base/reflect.d.ts.map +1 -1
- package/elements/base/reflect.js +83 -38
- package/elements/base/reflect.js.map +1 -1
- package/elements/base/route.d.ts +12 -24
- package/elements/base/route.d.ts.map +1 -1
- package/elements/base/route.js +263 -164
- package/elements/base/route.js.map +1 -1
- package/elements/base/title.d.ts +3 -11
- package/elements/base/title.d.ts.map +1 -1
- package/elements/base/title.js +110 -59
- package/elements/base/title.js.map +1 -1
- package/elements/base/unsafe.d.ts +0 -1
- package/elements/base/unsafe.d.ts.map +1 -1
- package/elements/base/unsafe.js +82 -33
- package/elements/base/unsafe.js.map +1 -1
- package/elements/base/use.d.ts.map +1 -1
- package/elements/base/use.js +95 -47
- package/elements/base/use.js.map +1 -1
- package/helper/i18n.d.ts +4 -9
- package/helper/i18n.d.ts.map +1 -1
- package/helper/i18n.js +69 -65
- package/helper/i18n.js.map +1 -1
- package/helper/logger.js +10 -9
- package/helper/logger.js.map +1 -1
- package/helper/react-shim.d.ts +15 -0
- package/helper/react-shim.d.ts.map +1 -0
- package/helper/react-shim.js +56 -0
- package/helper/react-shim.js.map +1 -0
- package/helper/react-utils.d.ts +15 -0
- package/helper/react-utils.d.ts.map +1 -0
- package/helper/react-utils.js +50 -0
- package/helper/react-utils.js.map +1 -0
- package/helper/request.d.ts +4 -4
- package/helper/request.d.ts.map +1 -1
- package/helper/request.js +1 -1
- package/helper/request.js.map +1 -1
- package/helper/ssr-shim.d.ts.map +1 -1
- package/helper/ssr-shim.js +8 -1
- package/helper/ssr-shim.js.map +1 -1
- package/helper/theme.d.ts +14 -21
- package/helper/theme.d.ts.map +1 -1
- package/helper/theme.js +55 -38
- package/helper/theme.js.map +1 -1
- package/index.d.ts +4 -3
- package/index.d.ts.map +1 -1
- package/index.js +5 -3
- package/index.js.map +1 -1
- package/lib/decorators.d.ts +74 -42
- package/lib/decorators.d.ts.map +1 -1
- package/lib/decorators.js +324 -84
- package/lib/decorators.js.map +1 -1
- package/lib/directives.d.ts +4 -0
- package/lib/directives.d.ts.map +1 -0
- package/lib/directives.js +5 -0
- package/lib/directives.js.map +1 -0
- package/lib/element.d.ts +112 -110
- package/lib/element.d.ts.map +1 -1
- package/lib/element.js +431 -468
- package/lib/element.js.map +1 -1
- package/lib/history.d.ts +4 -0
- package/lib/history.d.ts.map +1 -1
- package/lib/history.js +12 -13
- package/lib/history.js.map +1 -1
- package/lib/store.d.ts +1 -1
- package/lib/store.d.ts.map +1 -1
- package/lib/store.js +4 -5
- package/lib/store.js.map +1 -1
- package/lib/utils.d.ts +3 -43
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +61 -235
- package/lib/utils.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.d.ts.map +1 -1
- package/lib/version.js +2 -1
- package/lib/version.js.map +1 -1
- package/package.json +12 -11
- package/src/dist.ts +3 -2
- package/src/elements/base/dialog.ts +10 -20
- package/src/elements/base/gesture.ts +16 -14
- package/src/elements/base/link.ts +65 -44
- package/src/elements/base/modal-factory.ts +14 -14
- package/src/elements/base/reflect.ts +24 -32
- package/src/elements/base/route.ts +55 -68
- package/src/elements/base/title.ts +25 -42
- package/src/elements/base/unsafe.ts +12 -21
- package/src/elements/base/use.ts +17 -13
- package/src/helper/i18n.ts +20 -14
- package/src/helper/react-utils.ts +66 -0
- package/src/helper/ssr-shim.ts +8 -1
- package/src/helper/theme.ts +72 -45
- package/src/index.ts +6 -4
- package/src/lib/decorators.ts +394 -93
- package/src/lib/directives.ts +6 -0
- package/src/lib/element.ts +473 -500
- package/src/lib/history.ts +4 -3
- package/src/lib/store.ts +2 -1
- package/src/lib/utils.ts +12 -191
- package/src/lib/version.ts +2 -1
- package/src/test/elements/link.test.ts +1 -1
- package/src/test/elements/title.test.ts +1 -0
- package/src/test/gem-element/advance.test.ts +72 -49
- package/src/test/gem-element/basic.test.ts +37 -50
- package/src/test/gem-element/decorators.test.ts +22 -21
- package/src/test/gem-element/multi.test.ts +5 -5
- package/src/test/utils.test.ts +15 -45
package/dist/gem.es.js
CHANGED
|
@@ -1,59 +1,77 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var xa = Object.defineProperty;
|
|
2
|
+
var wi = (e) => {
|
|
3
|
+
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, F = (s, t, e, n) => (be(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e);
|
|
10
|
-
var xe = (s, t, e) => (be(s, t, "access private method"), e);
|
|
11
|
-
const Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5
|
+
var Ta = (e, t, n) => t in e ? xa(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
6
|
+
var T = (e, t, n) => Ta(e, typeof t != "symbol" ? t + "" : t, n), Wn = (e, t, n) => t.has(e) || wi("Cannot " + n);
|
|
7
|
+
var p = (e, t, n) => (Wn(e, t, "read from private field"), n ? n.call(e) : t.get(e)), b = (e, t, n) => t.has(e) ? wi("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), x = (e, t, n, s) => (Wn(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n), zn = (e, t, n) => (Wn(e, t, "access private method"), n);
|
|
8
|
+
const Oa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12
9
|
__proto__: null,
|
|
13
|
-
get
|
|
14
|
-
return
|
|
10
|
+
get adoptedStyle() {
|
|
11
|
+
return Hs;
|
|
15
12
|
},
|
|
16
|
-
get
|
|
17
|
-
return
|
|
13
|
+
get aria() {
|
|
14
|
+
return An;
|
|
18
15
|
},
|
|
19
|
-
get
|
|
20
|
-
return
|
|
16
|
+
get async() {
|
|
17
|
+
return pc;
|
|
21
18
|
},
|
|
22
|
-
get
|
|
23
|
-
return
|
|
19
|
+
get attribute() {
|
|
20
|
+
return G;
|
|
24
21
|
},
|
|
25
|
-
get
|
|
26
|
-
return
|
|
22
|
+
get boolattribute() {
|
|
23
|
+
return On;
|
|
27
24
|
},
|
|
28
|
-
get
|
|
29
|
-
return
|
|
25
|
+
get connectStore() {
|
|
26
|
+
return Nn;
|
|
30
27
|
},
|
|
31
|
-
get
|
|
32
|
-
return
|
|
28
|
+
get customElement() {
|
|
29
|
+
return fc;
|
|
33
30
|
},
|
|
34
|
-
get
|
|
35
|
-
return
|
|
31
|
+
get effect() {
|
|
32
|
+
return $t;
|
|
36
33
|
},
|
|
37
|
-
get
|
|
38
|
-
return
|
|
34
|
+
get emitter() {
|
|
35
|
+
return ye;
|
|
39
36
|
},
|
|
40
|
-
get
|
|
41
|
-
return
|
|
37
|
+
get fallback() {
|
|
38
|
+
return lc;
|
|
42
39
|
},
|
|
43
|
-
get
|
|
44
|
-
return
|
|
40
|
+
get globalemitter() {
|
|
41
|
+
return dc;
|
|
45
42
|
},
|
|
46
|
-
get
|
|
47
|
-
return
|
|
43
|
+
get memo() {
|
|
44
|
+
return kr;
|
|
48
45
|
},
|
|
49
|
-
get
|
|
50
|
-
return
|
|
46
|
+
get mounted() {
|
|
47
|
+
return qe;
|
|
51
48
|
},
|
|
52
|
-
get
|
|
53
|
-
return
|
|
49
|
+
get numattribute() {
|
|
50
|
+
return ac;
|
|
54
51
|
},
|
|
55
|
-
get
|
|
56
|
-
return
|
|
52
|
+
get part() {
|
|
53
|
+
return Or;
|
|
54
|
+
},
|
|
55
|
+
get property() {
|
|
56
|
+
return U;
|
|
57
|
+
},
|
|
58
|
+
get shadow() {
|
|
59
|
+
return Ht;
|
|
60
|
+
},
|
|
61
|
+
get slot() {
|
|
62
|
+
return uc;
|
|
63
|
+
},
|
|
64
|
+
get state() {
|
|
65
|
+
return Ln;
|
|
66
|
+
},
|
|
67
|
+
get template() {
|
|
68
|
+
return xr;
|
|
69
|
+
},
|
|
70
|
+
get unmounted() {
|
|
71
|
+
return cc;
|
|
72
|
+
},
|
|
73
|
+
get willMount() {
|
|
74
|
+
return Mn;
|
|
57
75
|
}
|
|
58
76
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
59
77
|
/**
|
|
@@ -69,10 +87,10 @@ const Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
69
87
|
* subject to an additional IP rights grant found at
|
|
70
88
|
* http://polymer.github.io/PATENTS.txt
|
|
71
89
|
*/
|
|
72
|
-
const
|
|
73
|
-
const
|
|
74
|
-
return
|
|
75
|
-
},
|
|
90
|
+
const ur = /* @__PURE__ */ new WeakMap(), Sn = (e) => (...t) => {
|
|
91
|
+
const n = e(...t);
|
|
92
|
+
return ur.set(n, !0), n;
|
|
93
|
+
}, Ge = (e) => typeof e == "function" && ur.has(e);
|
|
76
94
|
/**
|
|
77
95
|
* @license
|
|
78
96
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -86,15 +104,15 @@ const Is = /* @__PURE__ */ new WeakMap(), we = (s) => (...t) => {
|
|
|
86
104
|
* subject to an additional IP rights grant found at
|
|
87
105
|
* http://polymer.github.io/PATENTS.txt
|
|
88
106
|
*/
|
|
89
|
-
const
|
|
90
|
-
for (; t !==
|
|
91
|
-
const
|
|
92
|
-
|
|
107
|
+
const yi = typeof window < "u" && window.customElements != null && window.customElements.polyfillWrapFlushCallback !== void 0, dr = (e, t, n = null, s = null) => {
|
|
108
|
+
for (; t !== n; ) {
|
|
109
|
+
const i = t.nextSibling;
|
|
110
|
+
e.insertBefore(t, s), t = i;
|
|
93
111
|
}
|
|
94
|
-
},
|
|
95
|
-
for (; t !==
|
|
96
|
-
const
|
|
97
|
-
|
|
112
|
+
}, bs = (e, t, n = null) => {
|
|
113
|
+
for (; t !== n; ) {
|
|
114
|
+
const s = t.nextSibling;
|
|
115
|
+
e.removeChild(t), t = s;
|
|
98
116
|
}
|
|
99
117
|
};
|
|
100
118
|
/**
|
|
@@ -110,7 +128,7 @@ const ms = typeof window < "u" && window.customElements != null && window.custom
|
|
|
110
128
|
* subject to an additional IP rights grant found at
|
|
111
129
|
* http://polymer.github.io/PATENTS.txt
|
|
112
130
|
*/
|
|
113
|
-
const
|
|
131
|
+
const it = {}, Si = {};
|
|
114
132
|
/**
|
|
115
133
|
* @license
|
|
116
134
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -124,67 +142,67 @@ const V = {}, ys = {};
|
|
|
124
142
|
* subject to an additional IP rights grant found at
|
|
125
143
|
* http://polymer.github.io/PATENTS.txt
|
|
126
144
|
*/
|
|
127
|
-
const
|
|
128
|
-
class
|
|
129
|
-
constructor(t,
|
|
130
|
-
this.parts = [], this.element =
|
|
131
|
-
const
|
|
132
|
-
let
|
|
133
|
-
const { strings:
|
|
134
|
-
for (;
|
|
135
|
-
const
|
|
136
|
-
if (
|
|
137
|
-
|
|
145
|
+
const St = `{{lit-${String(Math.random()).slice(2)}}}`, pr = `<!--${St}-->`, $i = new RegExp(`${St}|${pr}`), we = "$lit$";
|
|
146
|
+
class Ma {
|
|
147
|
+
constructor(t, n) {
|
|
148
|
+
this.parts = [], this.element = n;
|
|
149
|
+
const s = [], i = [], o = document.createTreeWalker(n.content, 133, null, !1);
|
|
150
|
+
let c = 0, a = -1, f = 0;
|
|
151
|
+
const { strings: h, values: { length: m } } = t;
|
|
152
|
+
for (; f < m; ) {
|
|
153
|
+
const r = o.nextNode();
|
|
154
|
+
if (r === null) {
|
|
155
|
+
o.currentNode = i.pop();
|
|
138
156
|
continue;
|
|
139
157
|
}
|
|
140
|
-
if (a++,
|
|
141
|
-
if (
|
|
142
|
-
const
|
|
143
|
-
let
|
|
144
|
-
for (let
|
|
145
|
-
|
|
146
|
-
for (;
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
this.parts.push({ type: "attribute", index: a, name:
|
|
158
|
+
if (a++, r.nodeType === 1) {
|
|
159
|
+
if (r.hasAttributes()) {
|
|
160
|
+
const _ = r.attributes, { length: l } = _;
|
|
161
|
+
let g = 0;
|
|
162
|
+
for (let v = 0; v < l; v++)
|
|
163
|
+
Ei(_[v].name, we) && g++;
|
|
164
|
+
for (; g-- > 0; ) {
|
|
165
|
+
const v = h[f], y = Qn.exec(v)[2], $ = y.toLowerCase() + we, d = r.getAttribute($);
|
|
166
|
+
r.removeAttribute($);
|
|
167
|
+
const S = d.split($i);
|
|
168
|
+
this.parts.push({ type: "attribute", index: a, name: y, strings: S }), f += S.length - 1;
|
|
151
169
|
}
|
|
152
170
|
}
|
|
153
|
-
|
|
154
|
-
} else if (
|
|
155
|
-
const
|
|
156
|
-
if (
|
|
157
|
-
const
|
|
158
|
-
for (let
|
|
159
|
-
let
|
|
160
|
-
if (
|
|
161
|
-
|
|
171
|
+
r.tagName === "TEMPLATE" && (i.push(r), o.currentNode = r.content);
|
|
172
|
+
} else if (r.nodeType === 3) {
|
|
173
|
+
const _ = r.data;
|
|
174
|
+
if (_.indexOf(St) >= 0) {
|
|
175
|
+
const l = r.parentNode, g = _.split($i), v = g.length - 1;
|
|
176
|
+
for (let y = 0; y < v; y++) {
|
|
177
|
+
let $, d = g[y];
|
|
178
|
+
if (d === "")
|
|
179
|
+
$ = ot();
|
|
162
180
|
else {
|
|
163
|
-
const
|
|
164
|
-
|
|
181
|
+
const S = Qn.exec(d);
|
|
182
|
+
S !== null && Ei(S[2], we) && (d = d.slice(0, S.index) + S[1] + S[2].slice(0, -we.length) + S[3]), $ = document.createTextNode(d);
|
|
165
183
|
}
|
|
166
|
-
|
|
184
|
+
l.insertBefore($, r), this.parts.push({ type: "node", index: ++a });
|
|
167
185
|
}
|
|
168
|
-
|
|
186
|
+
g[v] === "" ? (l.insertBefore(ot(), r), s.push(r)) : r.data = g[v], f += v;
|
|
169
187
|
}
|
|
170
|
-
} else if (
|
|
171
|
-
if (
|
|
172
|
-
const
|
|
173
|
-
(
|
|
188
|
+
} else if (r.nodeType === 8)
|
|
189
|
+
if (r.data === St) {
|
|
190
|
+
const _ = r.parentNode;
|
|
191
|
+
(r.previousSibling === null || a === c) && (a++, _.insertBefore(ot(), r)), c = a, this.parts.push({ type: "node", index: a }), r.nextSibling === null ? r.data = "" : (s.push(r), a--), f++;
|
|
174
192
|
} else {
|
|
175
|
-
let
|
|
176
|
-
for (; (
|
|
177
|
-
this.parts.push({ type: "node", index: -1 }),
|
|
193
|
+
let _ = -1;
|
|
194
|
+
for (; (_ = r.data.indexOf(St, _ + 1)) !== -1; )
|
|
195
|
+
this.parts.push({ type: "node", index: -1 }), f++;
|
|
178
196
|
}
|
|
179
197
|
}
|
|
180
|
-
for (const
|
|
181
|
-
|
|
198
|
+
for (const r of s)
|
|
199
|
+
r.parentNode.removeChild(r);
|
|
182
200
|
}
|
|
183
201
|
}
|
|
184
|
-
const
|
|
185
|
-
const
|
|
186
|
-
return
|
|
187
|
-
},
|
|
202
|
+
const Ei = (e, t) => {
|
|
203
|
+
const n = e.length - t.length;
|
|
204
|
+
return n >= 0 && e.slice(n) === t;
|
|
205
|
+
}, La = (e) => e.index !== -1, ot = () => document.createComment(""), Qn = (
|
|
188
206
|
// eslint-disable-next-line no-control-regex
|
|
189
207
|
/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/
|
|
190
208
|
);
|
|
@@ -201,35 +219,35 @@ const _s = (s, t) => {
|
|
|
201
219
|
* subject to an additional IP rights grant found at
|
|
202
220
|
* http://polymer.github.io/PATENTS.txt
|
|
203
221
|
*/
|
|
204
|
-
class
|
|
205
|
-
constructor(t,
|
|
206
|
-
this.__parts = [], this.template = t, this.processor =
|
|
222
|
+
class bi {
|
|
223
|
+
constructor(t, n, s) {
|
|
224
|
+
this.__parts = [], this.template = t, this.processor = n, this.options = s;
|
|
207
225
|
}
|
|
208
226
|
update(t) {
|
|
209
|
-
let
|
|
210
|
-
for (const
|
|
211
|
-
|
|
212
|
-
for (const
|
|
213
|
-
|
|
227
|
+
let n = 0;
|
|
228
|
+
for (const s of this.__parts)
|
|
229
|
+
s !== void 0 && s.setValue(t[n]), n++;
|
|
230
|
+
for (const s of this.__parts)
|
|
231
|
+
s !== void 0 && s.commit();
|
|
214
232
|
}
|
|
215
233
|
_clone() {
|
|
216
|
-
const t =
|
|
217
|
-
let
|
|
218
|
-
for (;
|
|
219
|
-
if (a =
|
|
220
|
-
this.__parts.push(void 0),
|
|
234
|
+
const t = yi ? this.template.element.content.cloneNode(!0) : document.importNode(this.template.element.content, !0), n = [], s = this.template.parts, i = document.createTreeWalker(t, 133, null, !1);
|
|
235
|
+
let o = 0, c = 0, a, f = i.nextNode();
|
|
236
|
+
for (; o < s.length; ) {
|
|
237
|
+
if (a = s[o], !La(a)) {
|
|
238
|
+
this.__parts.push(void 0), o++;
|
|
221
239
|
continue;
|
|
222
240
|
}
|
|
223
|
-
for (;
|
|
224
|
-
|
|
241
|
+
for (; c < a.index; )
|
|
242
|
+
c++, f.nodeName === "TEMPLATE" && (n.push(f), i.currentNode = f.content), (f = i.nextNode()) === null && (i.currentNode = n.pop(), f = i.nextNode());
|
|
225
243
|
if (a.type === "node") {
|
|
226
|
-
const
|
|
227
|
-
|
|
244
|
+
const h = this.processor.handleTextExpression(this.options);
|
|
245
|
+
h.insertAfterNode(f.previousSibling), this.__parts.push(h);
|
|
228
246
|
} else
|
|
229
|
-
this.__parts.push(...this.processor.handleAttributeExpressions(
|
|
230
|
-
|
|
247
|
+
this.__parts.push(...this.processor.handleAttributeExpressions(f, a.name, a.strings, this.options));
|
|
248
|
+
o++;
|
|
231
249
|
}
|
|
232
|
-
return
|
|
250
|
+
return yi && (document.adoptNode(t), customElements.upgrade(t)), t;
|
|
233
251
|
}
|
|
234
252
|
}
|
|
235
253
|
/**
|
|
@@ -245,38 +263,38 @@ class vs {
|
|
|
245
263
|
* subject to an additional IP rights grant found at
|
|
246
264
|
* http://polymer.github.io/PATENTS.txt
|
|
247
265
|
*/
|
|
248
|
-
const
|
|
249
|
-
class
|
|
250
|
-
constructor(t,
|
|
251
|
-
this.strings = t, this.values =
|
|
266
|
+
const Ci = window.trustedTypes && trustedTypes.createPolicy("lit-html", { createHTML: (e) => e }), Na = ` ${St} `;
|
|
267
|
+
class $n {
|
|
268
|
+
constructor(t, n, s, i) {
|
|
269
|
+
this.strings = t, this.values = n, this.type = s, this.processor = i;
|
|
252
270
|
}
|
|
253
271
|
/**
|
|
254
272
|
* Returns a string of HTML used to create a `<template>` element.
|
|
255
273
|
*/
|
|
256
274
|
getHTML() {
|
|
257
275
|
const t = this.strings.length - 1;
|
|
258
|
-
let
|
|
259
|
-
for (let
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
const a =
|
|
263
|
-
a === null ?
|
|
276
|
+
let n = "", s = !1;
|
|
277
|
+
for (let i = 0; i < t; i++) {
|
|
278
|
+
const o = this.strings[i], c = o.lastIndexOf("<!--");
|
|
279
|
+
s = (c > -1 || s) && o.indexOf("-->", c + 1) === -1;
|
|
280
|
+
const a = Qn.exec(o);
|
|
281
|
+
a === null ? n += o + (s ? Na : pr) : n += o.substr(0, a.index) + a[1] + a[2] + we + a[3] + St;
|
|
264
282
|
}
|
|
265
|
-
return
|
|
283
|
+
return n += this.strings[t], n;
|
|
266
284
|
}
|
|
267
285
|
getTemplateElement() {
|
|
268
286
|
const t = document.createElement("template");
|
|
269
|
-
let
|
|
270
|
-
return
|
|
287
|
+
let n = this.getHTML();
|
|
288
|
+
return Ci !== void 0 && (n = Ci.createHTML(n)), t.innerHTML = n, t;
|
|
271
289
|
}
|
|
272
290
|
}
|
|
273
|
-
class
|
|
291
|
+
class fr extends $n {
|
|
274
292
|
getHTML() {
|
|
275
293
|
return `<svg>${super.getHTML()}</svg>`;
|
|
276
294
|
}
|
|
277
295
|
getTemplateElement() {
|
|
278
|
-
const t = super.getTemplateElement(),
|
|
279
|
-
return
|
|
296
|
+
const t = super.getTemplateElement(), n = t.content, s = n.firstChild;
|
|
297
|
+
return n.removeChild(s), dr(n, s.firstChild), t;
|
|
280
298
|
}
|
|
281
299
|
}
|
|
282
300
|
/**
|
|
@@ -292,64 +310,64 @@ class qs extends _e {
|
|
|
292
310
|
* subject to an additional IP rights grant found at
|
|
293
311
|
* http://polymer.github.io/PATENTS.txt
|
|
294
312
|
*/
|
|
295
|
-
const
|
|
296
|
-
!!(
|
|
297
|
-
class
|
|
298
|
-
constructor(t,
|
|
299
|
-
this.dirty = !0, this.element = t, this.name =
|
|
300
|
-
for (let
|
|
301
|
-
this.parts[
|
|
313
|
+
const Cs = (e) => e === null || !(typeof e == "object" || typeof e == "function"), Xn = (e) => Array.isArray(e) || // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
314
|
+
!!(e && e[Symbol.iterator]);
|
|
315
|
+
class _r {
|
|
316
|
+
constructor(t, n, s) {
|
|
317
|
+
this.dirty = !0, this.element = t, this.name = n, this.strings = s, this.parts = [];
|
|
318
|
+
for (let i = 0; i < s.length - 1; i++)
|
|
319
|
+
this.parts[i] = this._createPart();
|
|
302
320
|
}
|
|
303
321
|
/**
|
|
304
322
|
* Creates a single part. Override this to create a differnt type of part.
|
|
305
323
|
*/
|
|
306
324
|
_createPart() {
|
|
307
|
-
return new
|
|
325
|
+
return new Ps(this);
|
|
308
326
|
}
|
|
309
327
|
_getValue() {
|
|
310
|
-
const t = this.strings,
|
|
311
|
-
if (
|
|
312
|
-
const
|
|
313
|
-
if (typeof
|
|
314
|
-
return String(
|
|
315
|
-
if (typeof
|
|
316
|
-
return
|
|
328
|
+
const t = this.strings, n = t.length - 1, s = this.parts;
|
|
329
|
+
if (n === 1 && t[0] === "" && t[1] === "") {
|
|
330
|
+
const o = s[0].value;
|
|
331
|
+
if (typeof o == "symbol")
|
|
332
|
+
return String(o);
|
|
333
|
+
if (typeof o == "string" || !Xn(o))
|
|
334
|
+
return o;
|
|
317
335
|
}
|
|
318
|
-
let
|
|
319
|
-
for (let
|
|
320
|
-
|
|
321
|
-
const
|
|
322
|
-
if (
|
|
323
|
-
const a =
|
|
324
|
-
if (
|
|
325
|
-
|
|
336
|
+
let i = "";
|
|
337
|
+
for (let o = 0; o < n; o++) {
|
|
338
|
+
i += t[o];
|
|
339
|
+
const c = s[o];
|
|
340
|
+
if (c !== void 0) {
|
|
341
|
+
const a = c.value;
|
|
342
|
+
if (Cs(a) || !Xn(a))
|
|
343
|
+
i += typeof a == "string" ? a : String(a);
|
|
326
344
|
else
|
|
327
|
-
for (const
|
|
328
|
-
|
|
345
|
+
for (const f of a)
|
|
346
|
+
i += typeof f == "string" ? f : String(f);
|
|
329
347
|
}
|
|
330
348
|
}
|
|
331
|
-
return
|
|
349
|
+
return i += t[n], i;
|
|
332
350
|
}
|
|
333
351
|
commit() {
|
|
334
352
|
this.dirty && (this.dirty = !1, this.element.setAttribute(this.name, this._getValue()));
|
|
335
353
|
}
|
|
336
354
|
}
|
|
337
|
-
class
|
|
355
|
+
class Ps {
|
|
338
356
|
constructor(t) {
|
|
339
357
|
this.value = void 0, this.committer = t;
|
|
340
358
|
}
|
|
341
359
|
setValue(t) {
|
|
342
|
-
t !==
|
|
360
|
+
t !== it && (!Cs(t) || t !== this.value) && (this.value = t, Ge(t) || (this.committer.dirty = !0));
|
|
343
361
|
}
|
|
344
362
|
commit() {
|
|
345
|
-
for (;
|
|
363
|
+
for (; Ge(this.value); ) {
|
|
346
364
|
const t = this.value;
|
|
347
|
-
this.value =
|
|
365
|
+
this.value = it, t(this);
|
|
348
366
|
}
|
|
349
|
-
this.value !==
|
|
367
|
+
this.value !== it && this.committer.commit();
|
|
350
368
|
}
|
|
351
369
|
}
|
|
352
|
-
class
|
|
370
|
+
class re {
|
|
353
371
|
constructor(t) {
|
|
354
372
|
this.value = void 0, this.__pendingValue = void 0, this.options = t;
|
|
355
373
|
}
|
|
@@ -359,7 +377,7 @@ class wt {
|
|
|
359
377
|
* This part must be empty, as its contents are not automatically moved.
|
|
360
378
|
*/
|
|
361
379
|
appendInto(t) {
|
|
362
|
-
this.startNode = t.appendChild(
|
|
380
|
+
this.startNode = t.appendChild(ot()), this.endNode = t.appendChild(ot());
|
|
363
381
|
}
|
|
364
382
|
/**
|
|
365
383
|
* Inserts this part after the `ref` node (between `ref` and `ref`'s next
|
|
@@ -377,7 +395,7 @@ class wt {
|
|
|
377
395
|
* This part must be empty, as its contents are not automatically moved.
|
|
378
396
|
*/
|
|
379
397
|
appendIntoPart(t) {
|
|
380
|
-
t.__insert(this.startNode =
|
|
398
|
+
t.__insert(this.startNode = ot()), t.__insert(this.endNode = ot());
|
|
381
399
|
}
|
|
382
400
|
/**
|
|
383
401
|
* Inserts this part after the `ref` part.
|
|
@@ -385,7 +403,7 @@ class wt {
|
|
|
385
403
|
* This part must be empty, as its contents are not automatically moved.
|
|
386
404
|
*/
|
|
387
405
|
insertAfterPart(t) {
|
|
388
|
-
t.__insert(this.startNode =
|
|
406
|
+
t.__insert(this.startNode = ot()), this.endNode = t.endNode, t.endNode = this.startNode;
|
|
389
407
|
}
|
|
390
408
|
setValue(t) {
|
|
391
409
|
this.__pendingValue = t;
|
|
@@ -393,12 +411,12 @@ class wt {
|
|
|
393
411
|
commit() {
|
|
394
412
|
if (this.startNode.parentNode === null)
|
|
395
413
|
return;
|
|
396
|
-
for (;
|
|
397
|
-
const
|
|
398
|
-
this.__pendingValue =
|
|
414
|
+
for (; Ge(this.__pendingValue); ) {
|
|
415
|
+
const n = this.__pendingValue;
|
|
416
|
+
this.__pendingValue = it, n(this);
|
|
399
417
|
}
|
|
400
418
|
const t = this.__pendingValue;
|
|
401
|
-
t !==
|
|
419
|
+
t !== it && (Cs(t) ? t !== this.value && this.__commitText(t) : t instanceof $n ? this.__commitTemplateResult(t) : t instanceof Node ? this.__commitNode(t) : Xn(t) ? this.__commitIterable(t) : t === Si ? (this.value = Si, this.clear()) : this.__commitText(t));
|
|
402
420
|
}
|
|
403
421
|
__insert(t) {
|
|
404
422
|
this.endNode.parentNode.insertBefore(t, this.endNode);
|
|
@@ -407,58 +425,58 @@ class wt {
|
|
|
407
425
|
this.value !== t && (this.clear(), this.__insert(t), this.value = t);
|
|
408
426
|
}
|
|
409
427
|
__commitText(t) {
|
|
410
|
-
const
|
|
428
|
+
const n = this.startNode.nextSibling;
|
|
411
429
|
t = t ?? "";
|
|
412
|
-
const
|
|
413
|
-
|
|
430
|
+
const s = typeof t == "string" ? t : String(t);
|
|
431
|
+
n === this.endNode.previousSibling && n.nodeType === 3 ? n.data = s : this.__commitNode(document.createTextNode(s)), this.value = t;
|
|
414
432
|
}
|
|
415
433
|
__commitTemplateResult(t) {
|
|
416
|
-
const
|
|
417
|
-
if (this.value instanceof
|
|
434
|
+
const n = this.options.templateFactory(t);
|
|
435
|
+
if (this.value instanceof bi && this.value.template === n)
|
|
418
436
|
this.value.update(t.values);
|
|
419
437
|
else {
|
|
420
|
-
const
|
|
421
|
-
|
|
438
|
+
const s = new bi(n, t.processor, this.options), i = s._clone();
|
|
439
|
+
s.update(t.values), this.__commitNode(i), this.value = s;
|
|
422
440
|
}
|
|
423
441
|
}
|
|
424
442
|
__commitIterable(t) {
|
|
425
443
|
Array.isArray(this.value) || (this.value = [], this.clear());
|
|
426
|
-
const
|
|
427
|
-
let
|
|
428
|
-
for (const
|
|
429
|
-
|
|
430
|
-
|
|
444
|
+
const n = this.value;
|
|
445
|
+
let s = 0, i;
|
|
446
|
+
for (const o of t)
|
|
447
|
+
i = n[s], i === void 0 && (i = new re(this.options), n.push(i), s === 0 ? i.appendIntoPart(this) : i.insertAfterPart(n[s - 1])), i.setValue(o), i.commit(), s++;
|
|
448
|
+
s < n.length && (n.length = s, this.clear(i && i.endNode));
|
|
431
449
|
}
|
|
432
450
|
clear(t = this.startNode) {
|
|
433
|
-
|
|
451
|
+
bs(this.startNode.parentNode, t.nextSibling, this.endNode);
|
|
434
452
|
}
|
|
435
453
|
}
|
|
436
|
-
class
|
|
437
|
-
constructor(t,
|
|
438
|
-
if (this.value = void 0, this.__pendingValue = void 0,
|
|
454
|
+
class Aa {
|
|
455
|
+
constructor(t, n, s) {
|
|
456
|
+
if (this.value = void 0, this.__pendingValue = void 0, s.length !== 2 || s[0] !== "" || s[1] !== "")
|
|
439
457
|
throw new Error("Boolean attributes can only contain a single expression");
|
|
440
|
-
this.element = t, this.name =
|
|
458
|
+
this.element = t, this.name = n, this.strings = s;
|
|
441
459
|
}
|
|
442
460
|
setValue(t) {
|
|
443
461
|
this.__pendingValue = t;
|
|
444
462
|
}
|
|
445
463
|
commit() {
|
|
446
|
-
for (;
|
|
447
|
-
const
|
|
448
|
-
this.__pendingValue =
|
|
464
|
+
for (; Ge(this.__pendingValue); ) {
|
|
465
|
+
const n = this.__pendingValue;
|
|
466
|
+
this.__pendingValue = it, n(this);
|
|
449
467
|
}
|
|
450
|
-
if (this.__pendingValue ===
|
|
468
|
+
if (this.__pendingValue === it)
|
|
451
469
|
return;
|
|
452
470
|
const t = !!this.__pendingValue;
|
|
453
|
-
this.value !== t && (t ? this.element.setAttribute(this.name, "") : this.element.removeAttribute(this.name), this.value = t), this.__pendingValue =
|
|
471
|
+
this.value !== t && (t ? this.element.setAttribute(this.name, "") : this.element.removeAttribute(this.name), this.value = t), this.__pendingValue = it;
|
|
454
472
|
}
|
|
455
473
|
}
|
|
456
|
-
class
|
|
457
|
-
constructor(t,
|
|
458
|
-
super(t,
|
|
474
|
+
class Ia extends _r {
|
|
475
|
+
constructor(t, n, s) {
|
|
476
|
+
super(t, n, s), this.single = s.length === 2 && s[0] === "" && s[1] === "";
|
|
459
477
|
}
|
|
460
478
|
_createPart() {
|
|
461
|
-
return new
|
|
479
|
+
return new Ra(this);
|
|
462
480
|
}
|
|
463
481
|
_getValue() {
|
|
464
482
|
return this.single ? this.parts[0].value : super._getValue();
|
|
@@ -467,42 +485,42 @@ class kn extends Us {
|
|
|
467
485
|
this.dirty && (this.dirty = !1, this.element[this.name] = this._getValue());
|
|
468
486
|
}
|
|
469
487
|
}
|
|
470
|
-
class
|
|
488
|
+
class Ra extends Ps {
|
|
471
489
|
}
|
|
472
|
-
let
|
|
490
|
+
let gr = !1;
|
|
473
491
|
(() => {
|
|
474
492
|
try {
|
|
475
|
-
const
|
|
493
|
+
const e = {
|
|
476
494
|
get capture() {
|
|
477
|
-
return
|
|
495
|
+
return gr = !0, !1;
|
|
478
496
|
}
|
|
479
497
|
};
|
|
480
|
-
window.addEventListener("test",
|
|
498
|
+
window.addEventListener("test", e, e), window.removeEventListener("test", e, e);
|
|
481
499
|
} catch {
|
|
482
500
|
}
|
|
483
501
|
})();
|
|
484
|
-
class
|
|
485
|
-
constructor(t,
|
|
486
|
-
this.value = void 0, this.__pendingValue = void 0, this.element = t, this.eventName =
|
|
502
|
+
class Ha {
|
|
503
|
+
constructor(t, n, s) {
|
|
504
|
+
this.value = void 0, this.__pendingValue = void 0, this.element = t, this.eventName = n, this.eventContext = s, this.__boundHandleEvent = (i) => this.handleEvent(i);
|
|
487
505
|
}
|
|
488
506
|
setValue(t) {
|
|
489
507
|
this.__pendingValue = t;
|
|
490
508
|
}
|
|
491
509
|
commit() {
|
|
492
|
-
for (;
|
|
493
|
-
const
|
|
494
|
-
this.__pendingValue =
|
|
510
|
+
for (; Ge(this.__pendingValue); ) {
|
|
511
|
+
const o = this.__pendingValue;
|
|
512
|
+
this.__pendingValue = it, o(this);
|
|
495
513
|
}
|
|
496
|
-
if (this.__pendingValue ===
|
|
514
|
+
if (this.__pendingValue === it)
|
|
497
515
|
return;
|
|
498
|
-
const t = this.__pendingValue,
|
|
499
|
-
|
|
516
|
+
const t = this.__pendingValue, n = this.value, s = t == null || n != null && (t.capture !== n.capture || t.once !== n.once || t.passive !== n.passive), i = t != null && (n == null || s);
|
|
517
|
+
s && this.element.removeEventListener(this.eventName, this.__boundHandleEvent, this.__options), i && (this.__options = Wa(t), this.element.addEventListener(this.eventName, this.__boundHandleEvent, this.__options)), this.value = t, this.__pendingValue = it;
|
|
500
518
|
}
|
|
501
519
|
handleEvent(t) {
|
|
502
520
|
typeof this.value == "function" ? this.value.call(this.eventContext || this.element, t) : this.value.handleEvent(t);
|
|
503
521
|
}
|
|
504
522
|
}
|
|
505
|
-
const
|
|
523
|
+
const Wa = (e) => e && (gr ? { capture: e.capture, passive: e.passive, once: e.once } : e.capture);
|
|
506
524
|
/**
|
|
507
525
|
* @license
|
|
508
526
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -516,7 +534,7 @@ const Mn = (s) => s && (js ? { capture: s.capture, passive: s.passive, once: s.o
|
|
|
516
534
|
* subject to an additional IP rights grant found at
|
|
517
535
|
* http://polymer.github.io/PATENTS.txt
|
|
518
536
|
*/
|
|
519
|
-
class
|
|
537
|
+
class za {
|
|
520
538
|
/**
|
|
521
539
|
* Create parts for an attribute-position binding, given the event, attribute
|
|
522
540
|
* name, and string literals.
|
|
@@ -526,19 +544,19 @@ class An {
|
|
|
526
544
|
* @param strings The string literals. There are always at least two strings,
|
|
527
545
|
* event for fully-controlled bindings with a single expression.
|
|
528
546
|
*/
|
|
529
|
-
handleAttributeExpressions(t,
|
|
530
|
-
const
|
|
531
|
-
return
|
|
547
|
+
handleAttributeExpressions(t, n, s, i) {
|
|
548
|
+
const o = n[0];
|
|
549
|
+
return o === "." ? new Ia(t, n.slice(1), s).parts : o === "@" ? [new Ha(t, n.slice(1), i.eventContext)] : o === "?" ? [new Aa(t, n.slice(1), s)] : new _r(t, n, s).parts;
|
|
532
550
|
}
|
|
533
551
|
/**
|
|
534
552
|
* Create parts for a text-position binding.
|
|
535
553
|
* @param templateFactory
|
|
536
554
|
*/
|
|
537
555
|
handleTextExpression(t) {
|
|
538
|
-
return new
|
|
556
|
+
return new re(t);
|
|
539
557
|
}
|
|
540
558
|
}
|
|
541
|
-
const
|
|
559
|
+
const mr = new za();
|
|
542
560
|
/**
|
|
543
561
|
* @license
|
|
544
562
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -552,19 +570,19 @@ const Gs = new An();
|
|
|
552
570
|
* subject to an additional IP rights grant found at
|
|
553
571
|
* http://polymer.github.io/PATENTS.txt
|
|
554
572
|
*/
|
|
555
|
-
function
|
|
556
|
-
let t =
|
|
573
|
+
function Va(e) {
|
|
574
|
+
let t = Pi.get(e.type);
|
|
557
575
|
t === void 0 && (t = {
|
|
558
576
|
stringsArray: /* @__PURE__ */ new WeakMap(),
|
|
559
577
|
keyString: /* @__PURE__ */ new Map()
|
|
560
|
-
},
|
|
561
|
-
let
|
|
562
|
-
if (
|
|
563
|
-
return
|
|
564
|
-
const
|
|
565
|
-
return
|
|
566
|
-
}
|
|
567
|
-
const
|
|
578
|
+
}, Pi.set(e.type, t));
|
|
579
|
+
let n = t.stringsArray.get(e.strings);
|
|
580
|
+
if (n !== void 0)
|
|
581
|
+
return n;
|
|
582
|
+
const s = e.strings.join(St);
|
|
583
|
+
return n = t.keyString.get(s), n === void 0 && (n = new Ma(e, e.getTemplateElement()), t.keyString.set(s, n)), t.stringsArray.set(e.strings, n), n;
|
|
584
|
+
}
|
|
585
|
+
const Pi = /* @__PURE__ */ new Map();
|
|
568
586
|
/**
|
|
569
587
|
* @license
|
|
570
588
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -578,9 +596,9 @@ const Es = /* @__PURE__ */ new Map();
|
|
|
578
596
|
* subject to an additional IP rights grant found at
|
|
579
597
|
* http://polymer.github.io/PATENTS.txt
|
|
580
598
|
*/
|
|
581
|
-
const
|
|
582
|
-
let
|
|
583
|
-
|
|
599
|
+
const ki = /* @__PURE__ */ new WeakMap(), ks = (e, t, n) => {
|
|
600
|
+
let s = ki.get(t);
|
|
601
|
+
s === void 0 && (bs(t, t.firstChild), ki.set(t, s = new re(Object.assign({ templateFactory: Va }, n))), s.appendInto(t)), s.setValue(e), s.commit();
|
|
584
602
|
};
|
|
585
603
|
/**
|
|
586
604
|
* @license
|
|
@@ -596,531 +614,507 @@ const bs = /* @__PURE__ */ new WeakMap(), Fs = (s, t, e) => {
|
|
|
596
614
|
* http://polymer.github.io/PATENTS.txt
|
|
597
615
|
*/
|
|
598
616
|
typeof window < "u" && (window.litHtmlVersions || (window.litHtmlVersions = [])).push("1.4.1");
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
}
|
|
611
|
-
function
|
|
612
|
-
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
return e + n + decodeURIComponent(r);
|
|
617
|
-
}
|
|
618
|
-
function Ks(s, t, e, n) {
|
|
619
|
-
return s.addEventListener(t, e, n), () => s.removeEventListener(t, e, n);
|
|
620
|
-
}
|
|
621
|
-
var Z, z, tt, jt, Re;
|
|
622
|
-
class In extends EventTarget {
|
|
617
|
+
const at = (e, ...t) => new $n(e, t, "html", mr), Ga = (e, ...t) => new fr(e, t, "svg", mr);
|
|
618
|
+
let _e = /* @__PURE__ */ new Set();
|
|
619
|
+
function Ot(e) {
|
|
620
|
+
typeof e == "function" && (_e.size || globalThis.queueMicrotask(() => {
|
|
621
|
+
const t = _e;
|
|
622
|
+
_e = /* @__PURE__ */ new Set(), t.forEach((n) => n());
|
|
623
|
+
}), _e.delete(e), _e.add(e));
|
|
624
|
+
}
|
|
625
|
+
function vr(e = "", t = "") {
|
|
626
|
+
const { pathname: n, search: s, hash: i } = new URL(t, location.origin + e);
|
|
627
|
+
return n + s + decodeURIComponent(i);
|
|
628
|
+
}
|
|
629
|
+
function wr(e, t, n, s) {
|
|
630
|
+
return e.addEventListener(t, n, s), () => e.removeEventListener(t, n, s);
|
|
631
|
+
}
|
|
632
|
+
var mt, lt, vt, Ke, Zn;
|
|
633
|
+
class Da extends EventTarget {
|
|
623
634
|
constructor() {
|
|
624
635
|
super(...arguments);
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
636
|
+
b(this, Ke);
|
|
637
|
+
b(this, mt, /* @__PURE__ */ new Map());
|
|
638
|
+
b(this, lt);
|
|
639
|
+
b(this, vt);
|
|
629
640
|
}
|
|
630
641
|
get size() {
|
|
631
|
-
return
|
|
642
|
+
return p(this, mt).size;
|
|
632
643
|
}
|
|
633
644
|
get first() {
|
|
634
|
-
return
|
|
645
|
+
return p(this, lt);
|
|
635
646
|
}
|
|
636
647
|
get last() {
|
|
637
|
-
return
|
|
638
|
-
}
|
|
639
|
-
isSuperLinkOf(
|
|
640
|
-
let
|
|
641
|
-
if (!
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
return !0;
|
|
647
|
-
r = r.next;
|
|
648
|
+
return p(this, vt);
|
|
649
|
+
}
|
|
650
|
+
isSuperLinkOf(n) {
|
|
651
|
+
let s = n.first;
|
|
652
|
+
if (!s) return !0;
|
|
653
|
+
let i = this.find(s.value);
|
|
654
|
+
for (; i && i.value === s.value; ) {
|
|
655
|
+
if (s = s.next, !s) return !0;
|
|
656
|
+
i = i.next;
|
|
648
657
|
}
|
|
649
658
|
return !1;
|
|
650
659
|
}
|
|
651
|
-
find(
|
|
652
|
-
return
|
|
660
|
+
find(n) {
|
|
661
|
+
return p(this, mt).get(n);
|
|
653
662
|
}
|
|
654
663
|
// 添加到尾部,已存在时会删除老的项目
|
|
655
664
|
// 如果是添加第一个,start 事件会在添加前触发,避免处理事件重复的逻辑
|
|
656
|
-
add(
|
|
657
|
-
|
|
658
|
-
const
|
|
659
|
-
|
|
665
|
+
add(n) {
|
|
666
|
+
p(this, vt) || this.dispatchEvent(new CustomEvent("start"));
|
|
667
|
+
const s = zn(this, Ke, Zn).call(this, n) || { value: n };
|
|
668
|
+
s.prev = p(this, vt), s.prev && (s.prev.next = s), s.next = void 0, x(this, vt, s), p(this, lt) || x(this, lt, s), p(this, mt).set(n, s);
|
|
660
669
|
}
|
|
661
670
|
// 删除这个元素后没有其他元素时立即出发 end 事件
|
|
662
|
-
delete(
|
|
663
|
-
const
|
|
664
|
-
return
|
|
671
|
+
delete(n) {
|
|
672
|
+
const s = zn(this, Ke, Zn).call(this, n);
|
|
673
|
+
return p(this, lt) || this.dispatchEvent(new CustomEvent("end")), s;
|
|
665
674
|
}
|
|
666
675
|
// 获取头部元素
|
|
667
676
|
// 会从链表删除
|
|
668
677
|
get() {
|
|
669
|
-
const
|
|
670
|
-
if (
|
|
671
|
-
return this.delete(
|
|
678
|
+
const n = p(this, lt);
|
|
679
|
+
if (n)
|
|
680
|
+
return this.delete(n.value), n.value;
|
|
672
681
|
}
|
|
673
682
|
}
|
|
674
|
-
|
|
675
|
-
const
|
|
676
|
-
return
|
|
683
|
+
mt = new WeakMap(), lt = new WeakMap(), vt = new WeakMap(), Ke = new WeakSet(), Zn = function(n) {
|
|
684
|
+
const s = p(this, mt).get(n);
|
|
685
|
+
return s && (s.prev ? s.prev.next = s.next : x(this, lt, s.next), s.next ? s.next.prev = s.prev : x(this, vt, s.prev), p(this, mt).delete(n)), s;
|
|
677
686
|
};
|
|
678
|
-
class
|
|
687
|
+
class Fa extends WeakMap {
|
|
679
688
|
get(t) {
|
|
680
|
-
let
|
|
681
|
-
return
|
|
689
|
+
let n = super.get(t);
|
|
690
|
+
return n || (n = {}, this.set(t, n)), n;
|
|
682
691
|
}
|
|
683
692
|
}
|
|
684
|
-
var
|
|
685
|
-
class
|
|
686
|
-
constructor(
|
|
687
|
-
super(
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
if (!
|
|
691
|
-
return null;
|
|
693
|
+
var Bt, _n;
|
|
694
|
+
class De extends URLSearchParams {
|
|
695
|
+
constructor(n) {
|
|
696
|
+
super(n);
|
|
697
|
+
b(this, Bt, (n) => typeof n == "string" ? n : JSON.stringify(n));
|
|
698
|
+
b(this, _n, (n) => {
|
|
699
|
+
if (!n) return null;
|
|
692
700
|
try {
|
|
693
|
-
return JSON.parse(
|
|
701
|
+
return JSON.parse(n);
|
|
694
702
|
} catch {
|
|
695
703
|
return null;
|
|
696
704
|
}
|
|
697
705
|
});
|
|
698
706
|
}
|
|
699
707
|
// support `{ key: ObjectValue }`
|
|
700
|
-
concat(
|
|
701
|
-
let
|
|
702
|
-
typeof
|
|
703
|
-
this.append(
|
|
708
|
+
concat(n) {
|
|
709
|
+
let s;
|
|
710
|
+
typeof n == "string" ? s = Object.fromEntries(new URLSearchParams(n).entries()) : s = n, Object.entries(s).forEach(([i, o]) => {
|
|
711
|
+
this.append(i, p(this, Bt).call(this, o));
|
|
704
712
|
});
|
|
705
713
|
}
|
|
706
|
-
setAny(
|
|
707
|
-
if (Array.isArray(
|
|
708
|
-
this.delete(
|
|
714
|
+
setAny(n, s) {
|
|
715
|
+
if (Array.isArray(s))
|
|
716
|
+
this.delete(n), s.forEach((i) => this.append(n, p(this, Bt).call(this, i)));
|
|
709
717
|
else {
|
|
710
|
-
const
|
|
711
|
-
|
|
718
|
+
const i = p(this, Bt).call(this, s);
|
|
719
|
+
i ? this.set(n, i) : this.delete(n);
|
|
712
720
|
}
|
|
713
721
|
}
|
|
714
|
-
getAny(
|
|
715
|
-
return this.getAnyAll(
|
|
722
|
+
getAny(n) {
|
|
723
|
+
return this.getAnyAll(n)[0];
|
|
716
724
|
}
|
|
717
|
-
getAnyAll(
|
|
718
|
-
return this.getAll(
|
|
725
|
+
getAnyAll(n) {
|
|
726
|
+
return this.getAll(n).filter((s) => s !== "").map((s) => p(this, _n).call(this, s));
|
|
719
727
|
}
|
|
720
728
|
toString() {
|
|
721
|
-
const
|
|
722
|
-
return
|
|
729
|
+
const n = super.toString();
|
|
730
|
+
return n ? `?${n}` : "";
|
|
723
731
|
}
|
|
724
732
|
toJSON() {
|
|
725
733
|
return this.toString();
|
|
726
734
|
}
|
|
727
735
|
}
|
|
728
|
-
|
|
729
|
-
function
|
|
730
|
-
return
|
|
731
|
-
}
|
|
732
|
-
function Wr(s, ...t) {
|
|
733
|
-
return Jt(s, ...t);
|
|
734
|
-
}
|
|
735
|
-
const zs = Symbol.for("gem@sheetToken");
|
|
736
|
-
function Ir(s, t) {
|
|
737
|
-
const e = new CSSStyleSheet({ media: t }), n = {};
|
|
738
|
-
let r = "";
|
|
739
|
-
return typeof s == "string" ? r = s : Object.keys(s).forEach((i) => {
|
|
740
|
-
switch (n[i] = `${i}-${ve()}`, s[i].type) {
|
|
741
|
-
case "class":
|
|
742
|
-
r += `.${n[i]} {${s[i].styledContent}}`;
|
|
743
|
-
break;
|
|
744
|
-
case "id":
|
|
745
|
-
r += `#${n[i]} {${s[i].styledContent}}`;
|
|
746
|
-
break;
|
|
747
|
-
default:
|
|
748
|
-
r += `@keyframes ${i} {${s[i].styledContent}}`;
|
|
749
|
-
}
|
|
750
|
-
}), e.replaceSync(r), n[zs] = e, n;
|
|
736
|
+
Bt = new WeakMap(), _n = new WeakMap();
|
|
737
|
+
function xs(e, ...t) {
|
|
738
|
+
return e.reduce((n, s, i) => n + (t[i - 1] ?? "") + s);
|
|
751
739
|
}
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
740
|
+
const yr = xs;
|
|
741
|
+
function En(e = 5) {
|
|
742
|
+
const t = Math.random().toString(36).slice(2, 2 + e);
|
|
743
|
+
return t.length < e ? t + En(e - t.length) : t;
|
|
755
744
|
}
|
|
756
|
-
const
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
keyframes: (s, ...t) => ({ styledContent: Jt(s, ...t), type: "keyframes" })
|
|
760
|
-
};
|
|
761
|
-
function G(s) {
|
|
762
|
-
return s.replace(/[A-Z]/g, (t) => "-" + t.toLowerCase());
|
|
745
|
+
const Wl = { class: xs };
|
|
746
|
+
function oe(e) {
|
|
747
|
+
return e.replace(/[A-Z]/g, (t) => "-" + t.toLowerCase());
|
|
763
748
|
}
|
|
764
|
-
function
|
|
765
|
-
return
|
|
749
|
+
function zl(e) {
|
|
750
|
+
return e.replace(/-(.)/g, (t, n) => n.toUpperCase());
|
|
766
751
|
}
|
|
767
|
-
function
|
|
768
|
-
return Object.keys(
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
}), s;
|
|
752
|
+
function Ts(e) {
|
|
753
|
+
return Object.keys(e).forEach((t) => {
|
|
754
|
+
delete e[t];
|
|
755
|
+
}), e;
|
|
772
756
|
}
|
|
773
|
-
class
|
|
757
|
+
class yt extends Error {
|
|
774
758
|
constructor(t) {
|
|
775
759
|
super(t), this.message = `gem: ${this.message}`;
|
|
776
760
|
}
|
|
777
761
|
}
|
|
778
|
-
function
|
|
779
|
-
const
|
|
780
|
-
if (t.length !==
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
if (s[n] !== t[n])
|
|
784
|
-
return !0;
|
|
762
|
+
function qa(e, t) {
|
|
763
|
+
const n = e.length;
|
|
764
|
+
if (t.length !== n) return !0;
|
|
765
|
+
for (let s = 0; s < n; s++)
|
|
766
|
+
if (e[s] !== t[s]) return !0;
|
|
785
767
|
return !1;
|
|
786
768
|
}
|
|
787
|
-
function
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
let n = t;
|
|
793
|
-
for (const r in s) {
|
|
794
|
-
const i = e(r, s[r]);
|
|
795
|
-
n += i ? i + t : "";
|
|
769
|
+
function Os(e, t, n) {
|
|
770
|
+
let s = t;
|
|
771
|
+
for (const i in e) {
|
|
772
|
+
const o = n(i, e[i]);
|
|
773
|
+
s += o ? o + t : "";
|
|
796
774
|
}
|
|
797
|
-
return
|
|
775
|
+
return s;
|
|
798
776
|
}
|
|
799
|
-
function
|
|
800
|
-
return
|
|
801
|
-
|
|
777
|
+
function Vl(e) {
|
|
778
|
+
return Os(
|
|
779
|
+
e,
|
|
802
780
|
";",
|
|
803
|
-
(t,
|
|
781
|
+
(t, n) => n || n === 0 ? `${oe(t)}:${n}` : ""
|
|
804
782
|
);
|
|
805
783
|
}
|
|
806
|
-
function
|
|
807
|
-
return
|
|
784
|
+
function Ua(e) {
|
|
785
|
+
return Os(e, " ", (t, n) => n ? t : "");
|
|
808
786
|
}
|
|
809
|
-
const
|
|
810
|
-
function
|
|
811
|
-
return
|
|
812
|
-
|
|
787
|
+
const Gl = Ua;
|
|
788
|
+
function Dl(e) {
|
|
789
|
+
return Os(
|
|
790
|
+
e,
|
|
813
791
|
",",
|
|
814
|
-
(t,
|
|
792
|
+
(t, n) => n === !0 || t === n ? t : n ? `${t}:${n}` : ""
|
|
815
793
|
);
|
|
816
794
|
}
|
|
817
|
-
const
|
|
818
|
-
function
|
|
819
|
-
if (
|
|
820
|
-
throw new
|
|
821
|
-
return
|
|
795
|
+
const ne = /* @__PURE__ */ new WeakMap();
|
|
796
|
+
function bn(e) {
|
|
797
|
+
if (ne.has(e))
|
|
798
|
+
throw new yt("argument error");
|
|
799
|
+
return ne.set(e, /* @__PURE__ */ new Set()), e;
|
|
822
800
|
}
|
|
823
|
-
function
|
|
824
|
-
var
|
|
825
|
-
Object.assign(
|
|
826
|
-
|
|
801
|
+
function It(e, t) {
|
|
802
|
+
var n;
|
|
803
|
+
Object.assign(e, t), (n = ne.get(e)) == null || n.forEach((s) => {
|
|
804
|
+
Ot(s);
|
|
827
805
|
});
|
|
828
806
|
}
|
|
829
|
-
function
|
|
830
|
-
const t =
|
|
831
|
-
return [t, (
|
|
807
|
+
function Xe(e) {
|
|
808
|
+
const t = bn(e);
|
|
809
|
+
return [t, (n) => It(t, n)];
|
|
832
810
|
}
|
|
833
|
-
function
|
|
834
|
-
const
|
|
835
|
-
return
|
|
836
|
-
|
|
811
|
+
function pt(e, t) {
|
|
812
|
+
const n = ne.get(e);
|
|
813
|
+
return n == null || n.add(t), () => {
|
|
814
|
+
n == null || n.delete(t);
|
|
837
815
|
};
|
|
838
816
|
}
|
|
839
|
-
function
|
|
840
|
-
const
|
|
841
|
-
|
|
817
|
+
function Ba(e, t) {
|
|
818
|
+
const n = ne.get(e);
|
|
819
|
+
n == null || n.delete(t);
|
|
842
820
|
}
|
|
843
|
-
const
|
|
821
|
+
const Ka = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
844
822
|
__proto__: null,
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
const n = s.startNode.parentNode, r = e ? e.startNode : s.endNode, i = t.endNode.nextSibling;
|
|
867
|
-
i !== r && Vs(n, t.startNode, i, r);
|
|
868
|
-
}, Pe = (s) => {
|
|
869
|
-
Je(s.startNode.parentNode, s.startNode, s.endNode.nextSibling);
|
|
870
|
-
}, Cs = (s, t, e) => {
|
|
871
|
-
const n = /* @__PURE__ */ new Map();
|
|
872
|
-
for (let r = t; r <= e; r++)
|
|
873
|
-
n.set(s[r], r);
|
|
874
|
-
return n;
|
|
875
|
-
}, Ps = /* @__PURE__ */ new WeakMap(), $s = /* @__PURE__ */ new WeakMap(), Fn = we((s, t, e) => {
|
|
876
|
-
let n;
|
|
877
|
-
return e === void 0 ? e = t : t !== void 0 && (n = t), (r) => {
|
|
878
|
-
if (!(r instanceof wt))
|
|
879
|
-
throw new Error("repeat can only be used in text bindings");
|
|
880
|
-
const i = Ps.get(r) || [], o = $s.get(r) || [], a = [], c = [], l = [];
|
|
881
|
-
let f = 0;
|
|
882
|
-
for (const w of s)
|
|
883
|
-
l[f] = n ? n(w, f) : f, c[f] = e(w, f), f++;
|
|
884
|
-
let h, g, u = 0, p = i.length - 1, m = 0, _ = c.length - 1;
|
|
885
|
-
for (; u <= p && m <= _; )
|
|
886
|
-
if (i[u] === null)
|
|
887
|
-
u++;
|
|
888
|
-
else if (i[p] === null)
|
|
889
|
-
p--;
|
|
890
|
-
else if (o[u] === l[m])
|
|
891
|
-
a[m] = nt(i[u], c[m]), u++, m++;
|
|
892
|
-
else if (o[p] === l[_])
|
|
893
|
-
a[_] = nt(i[p], c[_]), p--, _--;
|
|
894
|
-
else if (o[u] === l[_])
|
|
895
|
-
a[_] = nt(i[u], c[_]), Ce(r, i[u], a[_ + 1]), u++, _--;
|
|
896
|
-
else if (o[p] === l[m])
|
|
897
|
-
a[m] = nt(i[p], c[m]), Ce(r, i[p], i[u]), p--, m++;
|
|
898
|
-
else if (h === void 0 && (h = Cs(l, m, _), g = Cs(o, u, p)), !h.has(o[u]))
|
|
899
|
-
Pe(i[u]), u++;
|
|
900
|
-
else if (!h.has(o[p]))
|
|
901
|
-
Pe(i[p]), p--;
|
|
902
|
-
else {
|
|
903
|
-
const w = g.get(l[m]), H = w !== void 0 ? i[w] : null;
|
|
904
|
-
if (H === null) {
|
|
905
|
-
const O = xs(r, i[u]);
|
|
906
|
-
nt(O, c[m]), a[m] = O;
|
|
907
|
-
} else
|
|
908
|
-
a[m] = nt(H, c[m]), Ce(r, H, i[u]), i[w] = null;
|
|
909
|
-
m++;
|
|
910
|
-
}
|
|
911
|
-
for (; m <= _; ) {
|
|
912
|
-
const w = xs(r, a[_ + 1]);
|
|
913
|
-
nt(w, c[m]), a[m++] = w;
|
|
823
|
+
StoreListenerMap: ne,
|
|
824
|
+
connect: pt,
|
|
825
|
+
createStore: bn,
|
|
826
|
+
disconnect: Ba,
|
|
827
|
+
updateStore: It,
|
|
828
|
+
useStore: Xe
|
|
829
|
+
}, Symbol.toStringTag, { value: "Module" })), { assign: Vn, defineProperty: ja, setPrototypeOf: Ja } = Object;
|
|
830
|
+
ja(Symbol, "metadata", { value: Symbol.for("Symbol.metadata") });
|
|
831
|
+
const Ms = (e) => typeof e == "function" && e(), Rt = Symbol.for("gem@sheetToken"), Cn = Symbol.for("gem@update"), Pn = "gem-style-boundary", Ls = "gem@render-error", Ya = Cn, Gn = /* @__PURE__ */ new WeakMap(), Sr = /* @__PURE__ */ new WeakMap(), xi = (e) => [...e.querySelectorAll("[data-gem-reflect]")].map((t) => t.target);
|
|
832
|
+
class Qa {
|
|
833
|
+
constructor(t) {
|
|
834
|
+
T(this, "refSelector");
|
|
835
|
+
T(this, "ele");
|
|
836
|
+
T(this, "ref");
|
|
837
|
+
const n = `ref-${En()}`;
|
|
838
|
+
this.refSelector = `[ref=${n}]`, this.ele = t.internals.shadowRoot || t, this.ref = n;
|
|
839
|
+
}
|
|
840
|
+
get element() {
|
|
841
|
+
for (const t of [this.ele, ...xi(this.ele)]) {
|
|
842
|
+
const n = t.querySelector(this.refSelector);
|
|
843
|
+
if (n) return n;
|
|
914
844
|
}
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
845
|
+
}
|
|
846
|
+
get elements() {
|
|
847
|
+
return [this.ele, ...xi(this.ele)].map((t) => [...t.querySelectorAll(this.refSelector)]).flat();
|
|
848
|
+
}
|
|
849
|
+
toString() {
|
|
850
|
+
return this.ref;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
let $r;
|
|
854
|
+
var rt;
|
|
855
|
+
class Xa extends CSSStyleSheet {
|
|
856
|
+
constructor() {
|
|
857
|
+
super(...arguments);
|
|
858
|
+
b(this, rt);
|
|
859
|
+
T(this, "cssText", "");
|
|
860
|
+
}
|
|
861
|
+
get element() {
|
|
862
|
+
return p(this, rt) || (x(this, rt, document.createElement("style")), p(this, rt).textContent = this.cssText, p(this, rt).dataset.gemStyle = ""), p(this, rt);
|
|
863
|
+
}
|
|
864
|
+
replaceSync(n) {
|
|
865
|
+
this.cssText = n, p(this, rt) && (p(this, rt).textContent = n), super.replaceSync(n);
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
rt = new WeakMap();
|
|
869
|
+
var Mt, je, Kt, jt;
|
|
870
|
+
class Za {
|
|
871
|
+
constructor(t = "") {
|
|
872
|
+
b(this, Mt, "");
|
|
873
|
+
b(this, je, "");
|
|
874
|
+
// 不需要 GC
|
|
875
|
+
b(this, Kt, /* @__PURE__ */ new Map());
|
|
876
|
+
b(this, jt, /* @__PURE__ */ new Map());
|
|
877
|
+
x(this, je, t);
|
|
878
|
+
}
|
|
879
|
+
setContent(t) {
|
|
880
|
+
x(this, Mt, t);
|
|
881
|
+
}
|
|
882
|
+
getStyle(t) {
|
|
883
|
+
var o;
|
|
884
|
+
const n = t && !((o = t.internals) != null && o.shadowRoot), s = n ? t.constructor : this;
|
|
885
|
+
if (!p(this, Kt).has(s)) {
|
|
886
|
+
const c = new Xa({ media: p(this, je) });
|
|
887
|
+
p(this, Kt).set(s, c);
|
|
918
888
|
}
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
* @license
|
|
924
|
-
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
925
|
-
* This code may only be used under the BSD style license found at
|
|
926
|
-
* http://polymer.github.io/LICENSE.txt
|
|
927
|
-
* The complete set of authors may be found at
|
|
928
|
-
* http://polymer.github.io/AUTHORS.txt
|
|
929
|
-
* The complete set of contributors may be found at
|
|
930
|
-
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
931
|
-
* Code distributed by Google as part of the polymer project is also
|
|
932
|
-
* subject to an additional IP rights grant found at
|
|
933
|
-
* http://polymer.github.io/PATENTS.txt
|
|
934
|
-
*/
|
|
935
|
-
const $e = /* @__PURE__ */ new WeakMap(), Bn = we((s, t) => (e) => {
|
|
936
|
-
const n = $e.get(e);
|
|
937
|
-
if (Array.isArray(s)) {
|
|
938
|
-
if (Array.isArray(n) && n.length === s.length && s.every((r, i) => r === n[i]))
|
|
939
|
-
return;
|
|
940
|
-
} else if (n === s && (s !== void 0 || $e.has(e)))
|
|
941
|
-
return;
|
|
942
|
-
e.setValue(t()), $e.set(e, Array.isArray(s) ? Array.from(s) : s);
|
|
943
|
-
});
|
|
944
|
-
/**
|
|
945
|
-
* @license
|
|
946
|
-
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
947
|
-
* This code may only be used under the BSD style license found at
|
|
948
|
-
* http://polymer.github.io/LICENSE.txt
|
|
949
|
-
* The complete set of authors may be found at
|
|
950
|
-
* http://polymer.github.io/AUTHORS.txt
|
|
951
|
-
* The complete set of contributors may be found at
|
|
952
|
-
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
953
|
-
* Code distributed by Google as part of the polymer project is also
|
|
954
|
-
* subject to an additional IP rights grant found at
|
|
955
|
-
* http://polymer.github.io/PATENTS.txt
|
|
956
|
-
*/
|
|
957
|
-
const Te = /* @__PURE__ */ new WeakMap(), Js = we((s) => (t) => {
|
|
958
|
-
const e = Te.get(t);
|
|
959
|
-
if (s === void 0 && t instanceof Qe) {
|
|
960
|
-
if (e !== void 0 || !Te.has(t)) {
|
|
961
|
-
const n = t.committer.name;
|
|
962
|
-
t.committer.element.removeAttribute(n);
|
|
889
|
+
const i = p(this, Kt).get(s);
|
|
890
|
+
if (!p(this, jt).has(i)) {
|
|
891
|
+
let c = p(this, Mt), a = "";
|
|
892
|
+
n && (a = `@scope (${t.tagName}) to (:state(${Pn}) > *)`, c = `${a}{ ${c} }`), i.replaceSync(c), p(this, jt).set(i, a);
|
|
963
893
|
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
894
|
+
return i;
|
|
895
|
+
}
|
|
896
|
+
// 一般用于主题更新,不支持 layer
|
|
897
|
+
updateStyle() {
|
|
898
|
+
p(this, jt).forEach((t, n) => {
|
|
899
|
+
n.replaceSync(t ? `${t}{${p(this, Mt)}}` : p(this, Mt));
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
Mt = new WeakMap(), je = new WeakMap(), Kt = new WeakMap(), jt = new WeakMap();
|
|
904
|
+
function kn(e, t) {
|
|
905
|
+
const n = t ? e : "", s = t || e, i = new Za(n), o = { [Rt]: i };
|
|
906
|
+
let c = "";
|
|
907
|
+
return typeof s == "string" ? c = s : Object.keys(s).forEach((a) => {
|
|
908
|
+
const f = a === "$";
|
|
909
|
+
o[a] = f || a.includes("-") ? a : `${a}-${En()}`, c += `${f ? ":scope,:host" : `.${o[a]}`} {${s[a]}}`;
|
|
910
|
+
}), i.setContent(c), o;
|
|
911
|
+
}
|
|
912
|
+
const Ti = (e, t, n) => {
|
|
913
|
+
let s = !1;
|
|
914
|
+
t.forEach((i) => {
|
|
915
|
+
const o = e.get(i) || 0;
|
|
916
|
+
s || (s = n === 1 && o === 0 || n === -1 && o === 1), e.set(i, o + n);
|
|
917
|
+
}), s && Ot(Sr.get(e));
|
|
918
|
+
}, tc = (e, t) => {
|
|
919
|
+
const n = e.getRootNode();
|
|
920
|
+
if (!Gn.has(n)) {
|
|
921
|
+
const i = /* @__PURE__ */ new Map();
|
|
922
|
+
Gn.set(n, i), Sr.set(i, () => {
|
|
923
|
+
const o = n.adoptedStyleSheets.filter((c) => !i.has(c));
|
|
924
|
+
i.forEach((c, a) => c && o.push(a)), n.adoptedStyleSheets = o.reverse();
|
|
925
|
+
});
|
|
926
|
+
}
|
|
927
|
+
const s = Gn.get(n);
|
|
928
|
+
return Ti(s, t, 1), () => Ti(s, t, -1);
|
|
986
929
|
};
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
930
|
+
let Ns;
|
|
931
|
+
function Oi(e) {
|
|
932
|
+
e == null || e.forEach((t) => {
|
|
933
|
+
const { callback: n, getDep: s, values: i, preCallback: o } = t, c = s == null ? void 0 : s();
|
|
934
|
+
(!s || !i || qa(i, c)) && (Ms(o), t.preCallback = n(c, i), t.values = c, t.initialized = !0);
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
function Mi(e) {
|
|
938
|
+
return e.filter((t) => (Ms(t.preCallback), t.initialized = !1, t.values = void 0, t.fixed));
|
|
939
|
+
}
|
|
940
|
+
let As;
|
|
941
|
+
const Ft = new Da(), ts = (e = performance.now()) => {
|
|
942
|
+
if (performance.now() > e + 16) return requestAnimationFrame(ts);
|
|
943
|
+
const t = Ft.get();
|
|
944
|
+
t && (t(), ts(e));
|
|
945
|
+
};
|
|
946
|
+
Ft.addEventListener("start", () => Ot(ts));
|
|
947
|
+
let Dn;
|
|
948
|
+
var Jt, Yt, J, ht, Lt, wt, Qt, ut, Xt, Zt, Je, st, Vt, es, gn, mn, Ye, te, Nt, vn, wn, yn, Qe, ee;
|
|
949
|
+
const qt = class qt extends HTMLElement {
|
|
950
|
+
constructor() {
|
|
951
|
+
super();
|
|
952
|
+
b(this, st);
|
|
953
|
+
b(this, Yt);
|
|
954
|
+
b(this, J);
|
|
955
|
+
b(this, ht, []);
|
|
956
|
+
b(this, Lt, []);
|
|
957
|
+
b(this, wt, []);
|
|
958
|
+
b(this, Qt);
|
|
959
|
+
b(this, ut);
|
|
960
|
+
// not in constructor 的近似值
|
|
961
|
+
b(this, Xt);
|
|
962
|
+
b(this, Zt);
|
|
963
|
+
b(this, Je);
|
|
964
|
+
/**
|
|
965
|
+
* 每次更新完检查依赖,执行对应的副作用回调
|
|
966
|
+
* */
|
|
967
|
+
b(this, gn, () => {
|
|
968
|
+
Oi(p(this, ht));
|
|
969
|
+
});
|
|
970
|
+
b(this, mn, () => {
|
|
971
|
+
Oi(p(this, Lt));
|
|
972
|
+
});
|
|
973
|
+
/**
|
|
974
|
+
* - 条件渲染
|
|
975
|
+
* - 不提供 `render` 时显示子内容
|
|
976
|
+
* - 返回 `null` 时渲染空的子内容
|
|
977
|
+
* - 返回 `undefined` 时不会更新现有内容
|
|
978
|
+
* */
|
|
979
|
+
b(this, Ye, (n) => {
|
|
980
|
+
try {
|
|
981
|
+
x(this, Zt, !0), p(this, mn).call(this);
|
|
982
|
+
const s = p(this, Yt) === this, i = n ? n.render() : s ? void 0 : at`<slot></slot>`;
|
|
983
|
+
if (x(this, Zt, !1), i === void 0) return;
|
|
984
|
+
ks(i, p(this, Yt));
|
|
985
|
+
} catch (s) {
|
|
986
|
+
this.dispatchEvent(new CustomEvent(Ls, { bubbles: !0, composed: !0, detail: s }));
|
|
987
|
+
}
|
|
988
|
+
});
|
|
989
|
+
b(this, te, () => {
|
|
990
|
+
const n = p(this, st, es);
|
|
991
|
+
p(this, ut) && // 当有渲染函数,但是没一个符合条件时跳过
|
|
992
|
+
(n || !p(this, wt).length) && (p(this, Ye).call(this, n), Ot(p(this, gn)));
|
|
993
|
+
});
|
|
994
|
+
b(this, Nt, () => {
|
|
995
|
+
p(this, st, Vt).noBlocking ? Ft.add(p(this, te)) : p(this, te).call(this);
|
|
996
|
+
});
|
|
997
|
+
b(this, vn, () => {
|
|
998
|
+
const { adoptedStyleSheets: n = [] } = p(this, st, Vt), { shadowRoot: s, sheets: i } = p(this, J), o = n.map((c) => c[Rt].getStyle(this));
|
|
999
|
+
if (s)
|
|
1000
|
+
s.adoptedStyleSheets = o.concat(i);
|
|
1001
|
+
else
|
|
1002
|
+
return this.prepend(...i.map((c) => c.element)), tc(this, o);
|
|
1003
|
+
});
|
|
1004
|
+
/**
|
|
1005
|
+
* 元素挂载后执行还未初始化的副作用
|
|
1006
|
+
* */
|
|
1007
|
+
b(this, wn, () => {
|
|
1008
|
+
var n;
|
|
1009
|
+
(n = p(this, ht)) == null || n.forEach((s) => {
|
|
1010
|
+
const { callback: i, getDep: o, initialized: c } = s;
|
|
1011
|
+
c || (s.values = o == null ? void 0 : o(), s.preCallback = i(s.values), s.initialized = !0);
|
|
1023
1012
|
});
|
|
1024
|
-
})
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
(r = this.updated) == null || r.call(this);
|
|
1037
|
-
}), S(this, te, void 0), S(this, ee, () => {
|
|
1038
|
-
var o, a, c;
|
|
1039
|
-
if (d(this, Pt)) {
|
|
1040
|
-
L(this, Pt, !1);
|
|
1013
|
+
});
|
|
1014
|
+
b(this, yn, () => {
|
|
1015
|
+
var n;
|
|
1016
|
+
this.willMount && this.memo(this.willMount.bind(this), () => []), this.mounted && this.effect(this.mounted.bind(this), () => []), this.updated && this.effect((s, i) => i && this.updated.apply(this)), this.unmounted && this.effect(
|
|
1017
|
+
() => this.unmounted.bind(this),
|
|
1018
|
+
() => []
|
|
1019
|
+
), !p(this, wt).length && this.render && p(this, wt).push({ render: this.render.bind(this), condition: (n = this.shouldUpdate) == null ? void 0 : n.bind(this) });
|
|
1020
|
+
});
|
|
1021
|
+
b(this, Qe);
|
|
1022
|
+
b(this, ee, async () => {
|
|
1023
|
+
if (p(this, Qt)) {
|
|
1024
|
+
x(this, Qt, !1);
|
|
1041
1025
|
return;
|
|
1042
1026
|
}
|
|
1043
|
-
|
|
1044
|
-
const { observedStores:
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1027
|
+
p(this, yn).call(this);
|
|
1028
|
+
const { observedStores: n } = p(this, st, Vt);
|
|
1029
|
+
x(this, Xt, !0), x(this, Qe, n == null ? void 0 : n.map((s) => pt(s, p(this, Nt)))), p(this, Ye).call(this, p(this, st, es)), x(this, ut, !0), x(this, Je, p(this, vn).call(this)), await Promise.resolve(), p(this, wn).call(this);
|
|
1030
|
+
});
|
|
1031
|
+
/**
|
|
1032
|
+
* @helper
|
|
1033
|
+
* 记录副作用回调和值;
|
|
1034
|
+
* 回调到返回值如果是函数将再卸载时执行;
|
|
1035
|
+
* 第一次执行时 `oldDeps` 为空;
|
|
1036
|
+
*
|
|
1037
|
+
* ```js
|
|
1038
|
+
* class App extends GemElement {
|
|
1039
|
+
* mounted() {
|
|
1040
|
+
* this.effect(callback, () => [this.attrName]);
|
|
1041
|
+
* }
|
|
1042
|
+
* }
|
|
1043
|
+
* ```
|
|
1044
|
+
* */
|
|
1045
|
+
T(this, "effect", (n, s) => {
|
|
1046
|
+
const i = {
|
|
1047
|
+
callback: n,
|
|
1048
|
+
getDep: s,
|
|
1049
|
+
initialized: p(this, ut),
|
|
1050
|
+
fixed: !p(this, Xt)
|
|
1051
|
+
};
|
|
1052
|
+
p(this, ut) && (i.values = s == null ? void 0 : s(), i.preCallback = n(i.values)), p(this, ht).push(i);
|
|
1053
|
+
});
|
|
1054
|
+
/**
|
|
1055
|
+
* @helper
|
|
1056
|
+
* 在 `render` 前执行回调;
|
|
1057
|
+
* 和 `effect` 一样接受依赖数组参数,在 `constructor` 中使用;
|
|
1058
|
+
* 第一次执行时 `oldDeps` 为空;
|
|
1059
|
+
*
|
|
1060
|
+
* ```js
|
|
1061
|
+
* class App extends GemElement {
|
|
1062
|
+
* constructor() {
|
|
1063
|
+
* super();
|
|
1064
|
+
* this.memo(() => {
|
|
1065
|
+
* this.a = exec(this.attrName);
|
|
1066
|
+
* }), () => [this.attrName]);
|
|
1067
|
+
* }
|
|
1068
|
+
* }
|
|
1069
|
+
* ```
|
|
1070
|
+
* */
|
|
1071
|
+
T(this, "memo", (n, s) => {
|
|
1072
|
+
p(this, Lt).push({
|
|
1073
|
+
callback: n,
|
|
1074
|
+
getDep: s,
|
|
1075
|
+
fixed: !p(this, Xt)
|
|
1076
|
+
});
|
|
1077
|
+
});
|
|
1078
|
+
/**
|
|
1079
|
+
* @helper
|
|
1080
|
+
* async
|
|
1081
|
+
*/
|
|
1082
|
+
T(this, "update", () => Ot(p(this, Nt)));
|
|
1083
|
+
Dn = this;
|
|
1084
|
+
const { mode: n, serializable: s, delegatesFocus: i, slotAssignment: o, aria: c } = p(this, st, Vt), { focusable: a, ...f } = c || {};
|
|
1085
|
+
x(this, Yt, n ? this.attachShadow({ mode: n, serializable: s, delegatesFocus: i, slotAssignment: o }) : this), x(this, J, this.attachInternals()), p(this, J).stateList = [], p(this, J).sheets = [], Vn(p(this, J), f), n || p(this, J).states.add(Pn);
|
|
1086
|
+
let h;
|
|
1087
|
+
p(this, ht).push({
|
|
1088
|
+
fixed: !0,
|
|
1089
|
+
getDep: () => [this.disabled],
|
|
1090
|
+
callback: ([m = !1]) => {
|
|
1091
|
+
if (h === void 0 && (h = this.hasAttribute("tabindex")), p(this, J).ariaDisabled = String(m), a && !h && (this.tabIndex = -Number(m)), (a || i) && m)
|
|
1092
|
+
return wr(this, "click", (r) => r.isTrusted && r.stopImmediatePropagation(), {
|
|
1059
1093
|
capture: !0
|
|
1060
1094
|
});
|
|
1061
|
-
},
|
|
1062
|
-
() => [Reflect.get(this, "disabled")]
|
|
1063
|
-
);
|
|
1064
|
-
const { adoptedStyleSheets: n } = new.target;
|
|
1065
|
-
if (n) {
|
|
1066
|
-
const r = n.map((i) => i[zs] || i);
|
|
1067
|
-
this.shadowRoot ? this.shadowRoot.adoptedStyleSheets = r : this.effect(
|
|
1068
|
-
() => {
|
|
1069
|
-
const i = this.getRootNode();
|
|
1070
|
-
return i.adoptedStyleSheets = [...i.adoptedStyleSheets, ...r], () => {
|
|
1071
|
-
i.adoptedStyleSheets = qn(i.adoptedStyleSheets, r);
|
|
1072
|
-
};
|
|
1073
|
-
},
|
|
1074
|
-
() => []
|
|
1075
|
-
);
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
get internals() {
|
|
1079
|
-
if (!d(this, Q)) {
|
|
1080
|
-
L(this, Q, this.attachInternals());
|
|
1081
|
-
try {
|
|
1082
|
-
d(this, Q).states.add("foo"), d(this, Q).states.delete("foo");
|
|
1083
|
-
} catch {
|
|
1084
|
-
Reflect.defineProperty(d(this, Q), "states", {
|
|
1085
|
-
value: {
|
|
1086
|
-
has: (t) => ot(t) in this.dataset,
|
|
1087
|
-
add: (t) => this.dataset[ot(t)] = "",
|
|
1088
|
-
delete: (t) => delete this.dataset[ot(t)]
|
|
1089
|
-
}
|
|
1090
|
-
});
|
|
1091
1095
|
}
|
|
1092
|
-
}
|
|
1093
|
-
return d(this, Q);
|
|
1096
|
+
});
|
|
1094
1097
|
}
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
attributeChangedCallback() {
|
|
1101
|
-
return d(this, B) && I(d(this, rt)), d(Tt, ft);
|
|
1102
|
-
}
|
|
1103
|
-
closestElement(t) {
|
|
1104
|
-
const e = typeof t == "function", n = typeof t == "string" && t.toUpperCase(), r = (o) => e ? o.constructor === t : o.tagName === n;
|
|
1105
|
-
let i = this;
|
|
1106
|
-
for (; i && !r(i); )
|
|
1107
|
-
i = i.parentElement || i.getRootNode().host;
|
|
1108
|
-
return i;
|
|
1098
|
+
[Ya]() {
|
|
1099
|
+
p(this, ut) && Ot(p(this, Nt));
|
|
1100
|
+
}
|
|
1101
|
+
get internals() {
|
|
1102
|
+
return p(this, J);
|
|
1109
1103
|
}
|
|
1110
1104
|
/**
|
|
1111
1105
|
* @private
|
|
1112
1106
|
* @final
|
|
1113
|
-
* use `mounted
|
|
1107
|
+
* use `mounted`
|
|
1114
1108
|
*/
|
|
1115
1109
|
connectedCallback() {
|
|
1116
|
-
return
|
|
1110
|
+
return p(this, st, Vt).noBlocking ? Ft.add(p(this, ee)) : p(this, ee).call(this), p(qt, Jt);
|
|
1117
1111
|
}
|
|
1118
1112
|
/**
|
|
1119
1113
|
* @private
|
|
1120
1114
|
* @final
|
|
1121
1115
|
*/
|
|
1122
1116
|
adoptedCallback() {
|
|
1123
|
-
return
|
|
1117
|
+
return p(qt, Jt);
|
|
1124
1118
|
}
|
|
1125
1119
|
/**
|
|
1126
1120
|
* @private
|
|
@@ -1128,657 +1122,856 @@ const Kt = Symbol("constructor"), he = Symbol("init"), Qs = Symbol("update"), Xs
|
|
|
1128
1122
|
* use `unmounted`
|
|
1129
1123
|
*/
|
|
1130
1124
|
disconnectedCallback() {
|
|
1131
|
-
var
|
|
1125
|
+
var n;
|
|
1132
1126
|
if (this.isConnected) {
|
|
1133
|
-
|
|
1127
|
+
x(this, Qt, !0);
|
|
1134
1128
|
return;
|
|
1135
1129
|
}
|
|
1136
|
-
return
|
|
1130
|
+
return Ft.delete(p(this, ee)), Ft.delete(p(this, te)), x(this, ut, !1), (n = p(this, Qe)) == null || n.forEach((s) => s()), x(this, ht, Mi(p(this, ht))), x(this, Lt, Mi(p(this, Lt))), Ms(p(this, Je)), p(qt, Jt);
|
|
1137
1131
|
}
|
|
1138
1132
|
};
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1133
|
+
Jt = new WeakMap(), Yt = new WeakMap(), J = new WeakMap(), ht = new WeakMap(), Lt = new WeakMap(), wt = new WeakMap(), Qt = new WeakMap(), ut = new WeakMap(), Xt = new WeakMap(), Zt = new WeakMap(), Je = new WeakMap(), st = new WeakSet(), Vt = function() {
|
|
1134
|
+
return this.constructor[Symbol.metadata];
|
|
1135
|
+
}, es = function() {
|
|
1136
|
+
return p(this, wt).find((n) => !n.condition || n.condition());
|
|
1137
|
+
}, gn = new WeakMap(), mn = new WeakMap(), Ye = new WeakMap(), te = new WeakMap(), Nt = new WeakMap(), vn = new WeakMap(), wn = new WeakMap(), yn = new WeakMap(), Qe = new WeakMap(), ee = new WeakMap(), // 禁止覆盖自定义元素原生生命周期方法
|
|
1138
|
+
// https://github.com/microsoft/TypeScript/issues/21388#issuecomment-934345226
|
|
1139
|
+
b(qt, Jt, Symbol()), Ns = (n) => {
|
|
1140
|
+
const s = Dn, i = (o) => {
|
|
1141
|
+
Vn(i, o), p(s, Zt) || Ot(p(s, Nt));
|
|
1142
|
+
};
|
|
1143
|
+
return Ja(i, null), delete i.name, delete i.length, p(s, J).stateList.push(i), Vn(i, n), i;
|
|
1144
|
+
}, $r = () => new Qa(Dn), As = (n, s) => p(n, wt).push(s);
|
|
1145
|
+
let B = qt;
|
|
1146
|
+
const ec = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1147
|
+
__proto__: null,
|
|
1148
|
+
BoundaryCSSState: Pn,
|
|
1149
|
+
GemElement: B,
|
|
1150
|
+
RenderErrorEvent: Ls,
|
|
1151
|
+
SVGTemplateResult: fr,
|
|
1152
|
+
SheetToken: Rt,
|
|
1153
|
+
TemplateResult: $n,
|
|
1154
|
+
UpdateToken: Cn,
|
|
1155
|
+
createCSSSheet: kn,
|
|
1156
|
+
get createRef() {
|
|
1157
|
+
return $r;
|
|
1158
|
+
},
|
|
1159
|
+
get createState() {
|
|
1160
|
+
return Ns;
|
|
1161
|
+
},
|
|
1162
|
+
get createTemplate() {
|
|
1163
|
+
return As;
|
|
1164
|
+
},
|
|
1165
|
+
directive: Sn,
|
|
1166
|
+
html: at,
|
|
1167
|
+
render: ks,
|
|
1168
|
+
svg: Ga
|
|
1169
|
+
}, Symbol.toStringTag, { value: "Module" })), nc = "0.0.0", sc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1170
|
+
__proto__: null,
|
|
1171
|
+
version: nc
|
|
1172
|
+
}, Symbol.toStringTag, { value: "Module" })), { deleteProperty: ic, getOwnPropertyDescriptor: Er, defineProperty: xn } = Reflect, { getPrototypeOf: Pt, assign: br } = Object, Li = new Fa();
|
|
1173
|
+
function Et(e, t, n) {
|
|
1174
|
+
const s = e.metadata;
|
|
1175
|
+
if (!Er(s, t)) {
|
|
1176
|
+
const i = new Set(s[t]);
|
|
1177
|
+
i.delete(n), xn(s, t, {
|
|
1178
|
+
value: [...i]
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
s[t].push(n);
|
|
1182
|
+
}
|
|
1183
|
+
function Tn(e, t) {
|
|
1184
|
+
const { value: n } = Er(e, t);
|
|
1185
|
+
ic(e, t), e[t] = n;
|
|
1186
|
+
}
|
|
1187
|
+
const Fe = /* @__PURE__ */ new WeakMap(), { setAttribute: Cr, toggleAttribute: rc, removeAttribute: Pr } = Element.prototype;
|
|
1188
|
+
B.prototype.setAttribute = function(e, t) {
|
|
1189
|
+
var s;
|
|
1190
|
+
const n = (s = Fe.get(Pt(this))) == null ? void 0 : s.get(e);
|
|
1191
|
+
if (!n) return Cr.call(this, e, t);
|
|
1192
|
+
this[n] = t;
|
|
1193
|
+
};
|
|
1194
|
+
B.prototype.removeAttribute = function(e) {
|
|
1195
|
+
var n;
|
|
1196
|
+
const t = (n = Fe.get(Pt(this))) == null ? void 0 : n.get(e);
|
|
1197
|
+
if (!t) return Pr.call(this, e);
|
|
1198
|
+
this[t] = null;
|
|
1199
|
+
};
|
|
1200
|
+
B.prototype.toggleAttribute = function(e, t) {
|
|
1201
|
+
var s;
|
|
1202
|
+
const n = (s = Fe.get(Pt(this))) == null ? void 0 : s.get(e);
|
|
1203
|
+
return n ? this[n] = t ?? !this.hasAttribute(e) : rc.call(this, e, t);
|
|
1204
|
+
};
|
|
1205
|
+
function oc() {
|
|
1206
|
+
}
|
|
1207
|
+
const Ni = Symbol("event handle");
|
|
1208
|
+
function Is(e, t, { attr: n, attrType: s, event: i, eventOptions: o } = {}) {
|
|
1209
|
+
xn(e, t, {
|
|
1166
1210
|
configurable: !0,
|
|
1167
1211
|
get() {
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
const o = this.getAttribute(e);
|
|
1171
|
-
return n != null && n.has(e) ? o !== null : r != null && r.has(e) ? Number(o) : o || "";
|
|
1212
|
+
const c = Li.get(this)[t];
|
|
1213
|
+
return i && !c ? (this[t] = oc, this[t]) : c;
|
|
1172
1214
|
},
|
|
1173
|
-
set(
|
|
1174
|
-
const
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
i == null ? o.removeAttribute(e) : f ? o.toggleAttribute(e, !!i) : l !== String(i) && o.setAttribute(e, String(i));
|
|
1215
|
+
set(c) {
|
|
1216
|
+
const a = this, f = Li.get(a);
|
|
1217
|
+
n && (c = s === Boolean && c === "" ? !0 : s(c || ""), c ? Cr.call(this, n, s === Boolean ? "" : c) : Pr.call(this, n)), c !== f[t] && (i ? (f[t] = c != null && c[Ni] ? c : (h, m) => {
|
|
1218
|
+
const r = new CustomEvent(i, { ...m, ...o, detail: h });
|
|
1219
|
+
a.dispatchEvent(r), c(h, m);
|
|
1220
|
+
}, f[t][Ni] = !0) : (f[t] = c, this[Cn]()));
|
|
1180
1221
|
}
|
|
1181
1222
|
});
|
|
1182
1223
|
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
set(r) {
|
|
1192
|
-
const i = this, o = le.get(i);
|
|
1193
|
-
r !== o[t] && (e ? (o[t] = r != null && r[Ts] ? r : (a, c) => {
|
|
1194
|
-
const l = new CustomEvent(e, { ...c, ...n, detail: a });
|
|
1195
|
-
i.dispatchEvent(l), r(a, c);
|
|
1196
|
-
}, Reflect.set(o[t], Ts, !0)) : (o[t] = r, this[Qs]()));
|
|
1224
|
+
function Rs(e, t) {
|
|
1225
|
+
const n = e.name, s = oe(n);
|
|
1226
|
+
return e.addInitializer(function() {
|
|
1227
|
+
const i = Pt(this);
|
|
1228
|
+
if (!i.hasOwnProperty(n)) {
|
|
1229
|
+
Et(e, "observedAttributes", s), Is(i, n, { attr: s, attrType: t });
|
|
1230
|
+
const o = Fe.get(i) || /* @__PURE__ */ new Map();
|
|
1231
|
+
o.set(s, n), Fe.set(i, o);
|
|
1197
1232
|
}
|
|
1198
|
-
|
|
1233
|
+
Tn(this, n);
|
|
1234
|
+
}), function(i) {
|
|
1235
|
+
return this.getAttribute(s) ?? i;
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
function G(e, t) {
|
|
1239
|
+
return Rs(t, String);
|
|
1240
|
+
}
|
|
1241
|
+
function On(e, t) {
|
|
1242
|
+
return Rs(t, Boolean);
|
|
1243
|
+
}
|
|
1244
|
+
function ac(e, t) {
|
|
1245
|
+
return Rs(t, Number);
|
|
1246
|
+
}
|
|
1247
|
+
function U(e, t) {
|
|
1248
|
+
const n = t.name;
|
|
1249
|
+
return t.addInitializer(function() {
|
|
1250
|
+
const s = Pt(this);
|
|
1251
|
+
s.hasOwnProperty(n) || (Et(t, "observedProperties", n), Is(s, n)), Tn(this, n);
|
|
1252
|
+
}), function(s) {
|
|
1253
|
+
return this[n] ?? s;
|
|
1254
|
+
};
|
|
1255
|
+
}
|
|
1256
|
+
function kr(e) {
|
|
1257
|
+
return function(t, n) {
|
|
1258
|
+
const { addInitializer: s, name: i, access: o, kind: c } = n;
|
|
1259
|
+
s(function() {
|
|
1260
|
+
const a = e && (() => e(this));
|
|
1261
|
+
if (c === "getter") {
|
|
1262
|
+
if (n.private) throw new yt("not support");
|
|
1263
|
+
this.memo(() => xn(this, i, { configurable: !0, value: o.get(this) }), a);
|
|
1264
|
+
} else
|
|
1265
|
+
this.memo(o.get(this).bind(this), a);
|
|
1266
|
+
});
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
function $t(e) {
|
|
1270
|
+
return function(t, { addInitializer: n, access: s }) {
|
|
1271
|
+
n(function() {
|
|
1272
|
+
this.effect(s.get(this).bind(this), e && (() => e(this)));
|
|
1273
|
+
});
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
function cc() {
|
|
1277
|
+
return function(e, { addInitializer: t, access: n }) {
|
|
1278
|
+
t(function() {
|
|
1279
|
+
this.effect(
|
|
1280
|
+
() => n.get(this).bind(this),
|
|
1281
|
+
() => []
|
|
1282
|
+
);
|
|
1283
|
+
});
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
function Mn() {
|
|
1287
|
+
return kr(() => []);
|
|
1288
|
+
}
|
|
1289
|
+
function qe() {
|
|
1290
|
+
return $t(() => []);
|
|
1291
|
+
}
|
|
1292
|
+
function xr(e) {
|
|
1293
|
+
return function(t, { addInitializer: n, access: s }) {
|
|
1294
|
+
n(function() {
|
|
1295
|
+
As(this, {
|
|
1296
|
+
render: s.get(this).bind(this),
|
|
1297
|
+
condition: e && (() => e(this))
|
|
1298
|
+
});
|
|
1299
|
+
});
|
|
1300
|
+
};
|
|
1199
1301
|
}
|
|
1200
|
-
|
|
1201
|
-
function
|
|
1202
|
-
|
|
1203
|
-
|
|
1302
|
+
function lc() {
|
|
1303
|
+
return function(e, { addInitializer: t, access: n }) {
|
|
1304
|
+
t(function() {
|
|
1305
|
+
this.addEventListener(Ls, ({ detail: s }) => {
|
|
1306
|
+
ks(n.get(this).apply(this, [s]), this.internals.shadowRoot || this);
|
|
1307
|
+
});
|
|
1308
|
+
});
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
function hc(e, t, n) {
|
|
1312
|
+
xn(e, t, {
|
|
1204
1313
|
configurable: !0,
|
|
1205
1314
|
get() {
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
return e;
|
|
1213
|
-
},
|
|
1214
|
-
get element() {
|
|
1215
|
-
for (const c of [a, ...Ls(a)]) {
|
|
1216
|
-
const l = c.querySelector(n);
|
|
1217
|
-
if (l)
|
|
1218
|
-
return l;
|
|
1219
|
-
}
|
|
1220
|
-
},
|
|
1221
|
-
get elements() {
|
|
1222
|
-
return [a, ...Ls(a)].map((c) => [...c.querySelectorAll(n)]).flat();
|
|
1223
|
-
}
|
|
1224
|
-
}, r[t] = i;
|
|
1225
|
-
}
|
|
1226
|
-
return i;
|
|
1315
|
+
const s = this, { states: i } = s.internals;
|
|
1316
|
+
return i == null ? void 0 : i.has(n);
|
|
1317
|
+
},
|
|
1318
|
+
set(s) {
|
|
1319
|
+
const i = this, { states: o } = i.internals;
|
|
1320
|
+
s ? o == null || o.add(n) : o == null || o.delete(n);
|
|
1227
1321
|
}
|
|
1228
1322
|
});
|
|
1229
1323
|
}
|
|
1230
|
-
function
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
const
|
|
1235
|
-
|
|
1236
|
-
},
|
|
1237
|
-
set(n) {
|
|
1238
|
-
const r = this, { states: i } = r.internals;
|
|
1239
|
-
n ? i == null || i.add(e) : i == null || i.delete(e);
|
|
1324
|
+
function Ln(e, t) {
|
|
1325
|
+
t.addInitializer(function() {
|
|
1326
|
+
const n = Pt(this), s = t.name;
|
|
1327
|
+
if (!n.hasOwnProperty(s)) {
|
|
1328
|
+
const i = oe(s);
|
|
1329
|
+
Et(t, "definedCSSStates", i), hc(n, s, i);
|
|
1240
1330
|
}
|
|
1331
|
+
Tn(this, s);
|
|
1241
1332
|
});
|
|
1242
1333
|
}
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
if (
|
|
1246
|
-
|
|
1247
|
-
|
|
1334
|
+
function Tr(e, t, n, s) {
|
|
1335
|
+
const i = e.name, o = oe(i);
|
|
1336
|
+
if (e.static)
|
|
1337
|
+
Et(e, n, o);
|
|
1338
|
+
else {
|
|
1339
|
+
const c = Pt(t);
|
|
1340
|
+
c[i] || (c[i] = o, Et(e, n, o));
|
|
1248
1341
|
}
|
|
1249
|
-
|
|
1250
|
-
};
|
|
1251
|
-
window.__GEM_DEVTOOLS__HOOK__ && Object.assign(window.__GEM_DEVTOOLS__HOOK__, { ...Cn, ...Gn });
|
|
1252
|
-
function D(s, t, e, n = !1) {
|
|
1253
|
-
const r = s.constructor, i = r[t];
|
|
1254
|
-
r.hasOwnProperty(t) || Object.defineProperty(r, t, {
|
|
1255
|
-
value: n ? new Set(i) : i ? Array.from(i) : []
|
|
1256
|
-
}), r[t][n ? "add" : "push"](e);
|
|
1257
|
-
}
|
|
1258
|
-
function Gr(s, t) {
|
|
1259
|
-
const e = `${G(t)}-${ve()}`;
|
|
1260
|
-
D(s, "defineRefs", e), ss(s, t, e);
|
|
1261
|
-
}
|
|
1262
|
-
function is(s, t, e) {
|
|
1263
|
-
D(s, "observedAttributes", e), es(s, t, e);
|
|
1264
|
-
}
|
|
1265
|
-
function C(s, t) {
|
|
1266
|
-
is(s, t, G(t));
|
|
1342
|
+
return s || o;
|
|
1267
1343
|
}
|
|
1268
|
-
function
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
}
|
|
1272
|
-
function Fr(s, t) {
|
|
1273
|
-
const e = G(t);
|
|
1274
|
-
D(s, "numberAttributes", e, !0), is(s, t, e);
|
|
1275
|
-
}
|
|
1276
|
-
function N(s, t) {
|
|
1277
|
-
D(s, "observedProperties", t), Dt(s, t);
|
|
1344
|
+
function uc(e, t) {
|
|
1345
|
+
return function(n) {
|
|
1346
|
+
return Tr(t, this, "definedSlots", n);
|
|
1347
|
+
};
|
|
1278
1348
|
}
|
|
1279
|
-
function
|
|
1280
|
-
|
|
1281
|
-
|
|
1349
|
+
function Or(e, t) {
|
|
1350
|
+
return function(n) {
|
|
1351
|
+
return Tr(t, this, "definedParts", n);
|
|
1352
|
+
};
|
|
1282
1353
|
}
|
|
1283
|
-
function
|
|
1284
|
-
|
|
1285
|
-
|
|
1354
|
+
function ye(e, t) {
|
|
1355
|
+
t.addInitializer(function() {
|
|
1356
|
+
Mr(t, this, t.name);
|
|
1357
|
+
});
|
|
1286
1358
|
}
|
|
1287
|
-
function
|
|
1288
|
-
|
|
1289
|
-
|
|
1359
|
+
function dc(e, t) {
|
|
1360
|
+
t.addInitializer(function() {
|
|
1361
|
+
Mr(t, this, t.name, { bubbles: !0, composed: !0 });
|
|
1362
|
+
});
|
|
1290
1363
|
}
|
|
1291
|
-
function
|
|
1292
|
-
|
|
1364
|
+
function Mr(e, t, n, s) {
|
|
1365
|
+
const i = Pt(t);
|
|
1366
|
+
if (!i.hasOwnProperty(n)) {
|
|
1367
|
+
const o = oe(n);
|
|
1368
|
+
Et(e, "definedEvents", o), Is(i, n, { event: o, eventOptions: s });
|
|
1369
|
+
}
|
|
1370
|
+
Tn(t, n);
|
|
1293
1371
|
}
|
|
1294
|
-
function
|
|
1295
|
-
|
|
1372
|
+
function Hs(e) {
|
|
1373
|
+
return function(t, n) {
|
|
1374
|
+
Et(n, "adoptedStyleSheets", e);
|
|
1375
|
+
};
|
|
1296
1376
|
}
|
|
1297
|
-
function
|
|
1298
|
-
|
|
1299
|
-
|
|
1377
|
+
function Nn(e) {
|
|
1378
|
+
return function(t, n) {
|
|
1379
|
+
Et(n, "observedStores", e);
|
|
1380
|
+
};
|
|
1300
1381
|
}
|
|
1301
|
-
function
|
|
1302
|
-
|
|
1303
|
-
|
|
1382
|
+
function Ht({
|
|
1383
|
+
mode: e = "open",
|
|
1384
|
+
serializable: t = !0,
|
|
1385
|
+
delegatesFocus: n,
|
|
1386
|
+
slotAssignment: s
|
|
1387
|
+
} = {}) {
|
|
1388
|
+
return function(i, o) {
|
|
1389
|
+
const c = o.metadata;
|
|
1390
|
+
br(c, { mode: e, serializable: t, delegatesFocus: n, slotAssignment: s });
|
|
1304
1391
|
};
|
|
1305
1392
|
}
|
|
1306
|
-
function
|
|
1307
|
-
return function(t) {
|
|
1308
|
-
|
|
1393
|
+
function pc() {
|
|
1394
|
+
return function(e, t) {
|
|
1395
|
+
const n = t.metadata;
|
|
1396
|
+
n.noBlocking = !0;
|
|
1309
1397
|
};
|
|
1310
1398
|
}
|
|
1311
|
-
function
|
|
1312
|
-
return function(t) {
|
|
1313
|
-
const
|
|
1314
|
-
|
|
1399
|
+
function An(e) {
|
|
1400
|
+
return function(t, n) {
|
|
1401
|
+
const s = n.metadata;
|
|
1402
|
+
s.aria = { ...s.aria, ...e };
|
|
1315
1403
|
};
|
|
1316
1404
|
}
|
|
1317
|
-
function
|
|
1318
|
-
return function(t) {
|
|
1319
|
-
|
|
1405
|
+
function fc(e) {
|
|
1406
|
+
return function(t, { addInitializer: n }) {
|
|
1407
|
+
n(function() {
|
|
1408
|
+
customElements.define(e, t);
|
|
1409
|
+
});
|
|
1320
1410
|
};
|
|
1321
1411
|
}
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1412
|
+
window.__GEM_DEVTOOLS__HOOK__ && !window.__GEM_DEVTOOLS__HOOK__.GemElement && br(window.__GEM_DEVTOOLS__HOOK__, {
|
|
1413
|
+
...ec,
|
|
1414
|
+
...Oa,
|
|
1415
|
+
...Ka,
|
|
1416
|
+
...sc
|
|
1417
|
+
});
|
|
1418
|
+
const Y = window.history, Lr = Y.pushState.bind(Y), Nr = Y.replaceState.bind(Y);
|
|
1419
|
+
let _c = 0;
|
|
1420
|
+
const Ws = () => `${performance.now()}-${++_c}`, [I, Ut] = Xe({
|
|
1325
1421
|
$hasCloseHandle: !1,
|
|
1326
1422
|
$hasOpenHandle: !1,
|
|
1327
1423
|
$hasShouldCloseHandle: !1,
|
|
1328
1424
|
$key: ""
|
|
1329
|
-
}),
|
|
1330
|
-
function
|
|
1331
|
-
const { $key: t, $hasCloseHandle:
|
|
1332
|
-
if (
|
|
1333
|
-
if (t)
|
|
1334
|
-
|
|
1335
|
-
if (
|
|
1336
|
-
|
|
1337
|
-
if (n)
|
|
1338
|
-
throw new J("`$hasOpenHandle` is not allowed");
|
|
1339
|
-
if (r)
|
|
1340
|
-
throw new J("`$hasShouldCloseHandle` is not allowed");
|
|
1425
|
+
}), q = /* @__PURE__ */ new Map();
|
|
1426
|
+
function Ar(e) {
|
|
1427
|
+
const { $key: t, $hasCloseHandle: n, $hasOpenHandle: s, $hasShouldCloseHandle: i } = e || {};
|
|
1428
|
+
if (I.$key !== t) {
|
|
1429
|
+
if (t) throw new yt("`$key` is not allowed");
|
|
1430
|
+
if (n) throw new yt("`$hasCloseHandle` is not allowed");
|
|
1431
|
+
if (s) throw new yt("`$hasOpenHandle` is not allowed");
|
|
1432
|
+
if (i) throw new yt("`$hasShouldCloseHandle` is not allowed");
|
|
1341
1433
|
}
|
|
1342
1434
|
}
|
|
1343
|
-
function
|
|
1344
|
-
return
|
|
1435
|
+
function Ir(e) {
|
|
1436
|
+
return Q.basePath ? Q.basePath + e : e;
|
|
1345
1437
|
}
|
|
1346
|
-
function
|
|
1347
|
-
return
|
|
1438
|
+
function ns(e) {
|
|
1439
|
+
return e === Q.basePath ? "/" : e.replace(new RegExp(`^${Q.basePath}/`), "/");
|
|
1348
1440
|
}
|
|
1349
|
-
function
|
|
1350
|
-
|
|
1441
|
+
function zs() {
|
|
1442
|
+
Q.dispatchEvent(new CustomEvent("beforechange"));
|
|
1351
1443
|
}
|
|
1352
|
-
function
|
|
1353
|
-
const t =
|
|
1354
|
-
return { ...
|
|
1444
|
+
function dn(e) {
|
|
1445
|
+
const t = q.get(I.$key) || { path: ns(location.pathname), query: new De() }, n = e.path ? vr(t.path, e.path) : ns(location.pathname), s = new De(e.query ?? (e.path ? "" : location.search)), i = String(s) !== String(t.query), o = i ? s : t.query, c = n !== t.path || i, a = e.title || (c ? "" : document.title), f = e.close || e.data || e.open || e.shouldClose, h = decodeURIComponent(e.hash ?? (!c && f ? location.hash : ""));
|
|
1446
|
+
return { ...e, title: a, path: n, query: o, hash: h };
|
|
1355
1447
|
}
|
|
1356
|
-
function
|
|
1357
|
-
|
|
1358
|
-
const
|
|
1448
|
+
function Ai(e, t) {
|
|
1449
|
+
Ar(e.data);
|
|
1450
|
+
const n = dn(e), { title: s, path: i, query: o, hash: c, close: a, open: f, shouldClose: h, data: m } = n, r = {
|
|
1359
1451
|
$hasCloseHandle: !!a,
|
|
1360
|
-
$hasOpenHandle: !!
|
|
1361
|
-
$hasShouldCloseHandle: !!
|
|
1362
|
-
$key:
|
|
1363
|
-
$title:
|
|
1364
|
-
...
|
|
1452
|
+
$hasOpenHandle: !!f,
|
|
1453
|
+
$hasShouldCloseHandle: !!h,
|
|
1454
|
+
$key: Ws(),
|
|
1455
|
+
$title: s,
|
|
1456
|
+
...m
|
|
1365
1457
|
};
|
|
1366
|
-
|
|
1367
|
-
const
|
|
1368
|
-
t(
|
|
1369
|
-
}
|
|
1370
|
-
function
|
|
1371
|
-
|
|
1372
|
-
const
|
|
1373
|
-
$key:
|
|
1458
|
+
q.set(r.$key, n), zs(), Ts(I), Ut(r);
|
|
1459
|
+
const _ = Ir(i) + new De(o) + c, l = decodeURIComponent(location.hash);
|
|
1460
|
+
t(r, s, _), l !== c && window.dispatchEvent(new CustomEvent("hashchange"));
|
|
1461
|
+
}
|
|
1462
|
+
function Ii(e, t, n, s) {
|
|
1463
|
+
Ar(e);
|
|
1464
|
+
const i = {
|
|
1465
|
+
$key: Ws(),
|
|
1374
1466
|
$title: t,
|
|
1375
|
-
...
|
|
1376
|
-
}, { pathname:
|
|
1377
|
-
|
|
1378
|
-
const
|
|
1379
|
-
|
|
1467
|
+
...e || {}
|
|
1468
|
+
}, { pathname: o, search: c, hash: a } = new URL(n, location.origin + location.pathname), f = dn({ path: o, query: new De(c), hash: a, title: t, data: e });
|
|
1469
|
+
q.set(i.$key, f), zs(), Ts(I), Ut(i);
|
|
1470
|
+
const h = Ir(o) + f.query + a, m = location.hash;
|
|
1471
|
+
s(i, t, h), m !== a && window.dispatchEvent(new CustomEvent("hashchange"));
|
|
1380
1472
|
}
|
|
1381
|
-
const [
|
|
1473
|
+
const [Rr, gc] = Xe({
|
|
1382
1474
|
basePath: ""
|
|
1383
1475
|
});
|
|
1384
|
-
class
|
|
1476
|
+
class mc extends EventTarget {
|
|
1385
1477
|
get store() {
|
|
1386
|
-
return
|
|
1478
|
+
return I;
|
|
1387
1479
|
}
|
|
1388
1480
|
get currentKey() {
|
|
1389
|
-
return
|
|
1481
|
+
return I.$key;
|
|
1390
1482
|
}
|
|
1391
1483
|
get basePath() {
|
|
1392
|
-
return
|
|
1484
|
+
return Rr.basePath;
|
|
1393
1485
|
}
|
|
1394
1486
|
set basePath(t) {
|
|
1395
|
-
|
|
1487
|
+
gc({ basePath: t }), Object.assign(q.get(I.$key), { path: ns(location.pathname) });
|
|
1396
1488
|
}
|
|
1397
1489
|
getParams() {
|
|
1398
|
-
return
|
|
1490
|
+
return q.get(I.$key);
|
|
1399
1491
|
}
|
|
1400
1492
|
updateParams(t) {
|
|
1401
|
-
Object.assign(
|
|
1493
|
+
Object.assign(q.get(I.$key), t), Ut();
|
|
1402
1494
|
}
|
|
1403
1495
|
push(t) {
|
|
1404
|
-
|
|
1496
|
+
Ai(t, Lr);
|
|
1405
1497
|
}
|
|
1406
1498
|
replace(t) {
|
|
1407
|
-
|
|
1499
|
+
Ai(t, Nr);
|
|
1408
1500
|
}
|
|
1409
1501
|
pushIgnoreCloseHandle(t) {
|
|
1410
|
-
var
|
|
1411
|
-
|
|
1502
|
+
var n, s;
|
|
1503
|
+
I.$hasCloseHandle ? ((s = (n = q.get(I.$key)) == null ? void 0 : n.close) == null || s.call(n), this.replace(t)) : this.push(t);
|
|
1412
1504
|
}
|
|
1413
1505
|
forward() {
|
|
1414
|
-
|
|
1506
|
+
Y.forward();
|
|
1415
1507
|
}
|
|
1416
1508
|
back() {
|
|
1417
|
-
|
|
1509
|
+
Y.back();
|
|
1418
1510
|
}
|
|
1419
1511
|
}
|
|
1420
|
-
const
|
|
1512
|
+
const Q = new mc(), [rn, vc] = Xe({ defaultTitle: document.title, url: "", title: "" }), wc = { history: Q, titleStore: rn, basePathStore: Rr };
|
|
1421
1513
|
if (!window._GEMHISTORY) {
|
|
1422
|
-
if (window._GEMHISTORY =
|
|
1423
|
-
|
|
1424
|
-
},
|
|
1425
|
-
|
|
1514
|
+
if (window._GEMHISTORY = wc, Y.pushState = function(t, n, s) {
|
|
1515
|
+
Ii(t, n, s, Lr);
|
|
1516
|
+
}, Y.replaceState = function(t, n, s) {
|
|
1517
|
+
Ii(t, n, s, Nr);
|
|
1426
1518
|
}, window.addEventListener("hashchange", ({ isTrusted: t }) => {
|
|
1427
|
-
t &&
|
|
1428
|
-
}),
|
|
1429
|
-
if (
|
|
1430
|
-
|
|
1431
|
-
const t =
|
|
1432
|
-
|
|
1519
|
+
t && Q.replace({ hash: location.hash });
|
|
1520
|
+
}), Y.state)
|
|
1521
|
+
if (Y.state.$hasCloseHandle) {
|
|
1522
|
+
Ut(Y.state);
|
|
1523
|
+
const t = dn({ title: document.title });
|
|
1524
|
+
q.set(I.$key, t), Q.back();
|
|
1433
1525
|
} else {
|
|
1434
|
-
const t =
|
|
1435
|
-
|
|
1436
|
-
$key:
|
|
1437
|
-
...
|
|
1438
|
-
}),
|
|
1526
|
+
const t = dn({ title: document.title, hash: location.hash });
|
|
1527
|
+
Ut({
|
|
1528
|
+
$key: Ws(),
|
|
1529
|
+
...Y.state || {}
|
|
1530
|
+
}), q.set(I.$key, t);
|
|
1439
1531
|
}
|
|
1440
1532
|
else {
|
|
1441
|
-
const {
|
|
1442
|
-
|
|
1443
|
-
}
|
|
1444
|
-
|
|
1445
|
-
const t =
|
|
1446
|
-
t && (t.title =
|
|
1447
|
-
}),
|
|
1448
|
-
const { title: t } =
|
|
1449
|
-
t !==
|
|
1533
|
+
const { protocol: t, pathname: n, search: s, hash: i } = location;
|
|
1534
|
+
t.startsWith("http") && Q.replace({ path: n, query: s, hash: i });
|
|
1535
|
+
}
|
|
1536
|
+
pt(rn, () => {
|
|
1537
|
+
const t = q.get(I.$key);
|
|
1538
|
+
t && (t.title = rn.title);
|
|
1539
|
+
}), pt(I, () => {
|
|
1540
|
+
const { title: t } = Q.getParams();
|
|
1541
|
+
t !== rn.title && vc({ title: t });
|
|
1450
1542
|
});
|
|
1451
|
-
let
|
|
1543
|
+
let e = !1;
|
|
1452
1544
|
window.addEventListener("popstate", (t) => {
|
|
1453
|
-
var
|
|
1454
|
-
const
|
|
1455
|
-
if (!(
|
|
1545
|
+
var o, c;
|
|
1546
|
+
const n = t.state;
|
|
1547
|
+
if (!(n != null && n.$key))
|
|
1456
1548
|
return;
|
|
1457
|
-
if (
|
|
1458
|
-
|
|
1549
|
+
if (e) {
|
|
1550
|
+
e = !1;
|
|
1459
1551
|
return;
|
|
1460
1552
|
}
|
|
1461
|
-
if (
|
|
1462
|
-
const { pathname: a, search:
|
|
1463
|
-
|
|
1553
|
+
if (!q.has(n.$key)) {
|
|
1554
|
+
const { pathname: a, search: f, hash: h } = location;
|
|
1555
|
+
q.set(n.$key, {
|
|
1464
1556
|
path: a,
|
|
1465
|
-
query: new
|
|
1466
|
-
hash: decodeURIComponent(
|
|
1467
|
-
title:
|
|
1557
|
+
query: new De(f),
|
|
1558
|
+
hash: decodeURIComponent(h),
|
|
1559
|
+
title: n.$title,
|
|
1468
1560
|
// document.title 是导航前的
|
|
1469
|
-
data:
|
|
1561
|
+
data: n
|
|
1470
1562
|
});
|
|
1471
1563
|
}
|
|
1472
|
-
const
|
|
1473
|
-
if (parseFloat(
|
|
1474
|
-
(
|
|
1475
|
-
else if (
|
|
1476
|
-
const a =
|
|
1477
|
-
if (
|
|
1478
|
-
|
|
1564
|
+
const s = I;
|
|
1565
|
+
if (parseFloat(n.$key) > parseFloat(s.$key) && n.$hasOpenHandle)
|
|
1566
|
+
(c = (o = q.get(n.$key)) == null ? void 0 : o.open) == null || c.call(o);
|
|
1567
|
+
else if (s.$hasCloseHandle) {
|
|
1568
|
+
const a = q.get(s.$key), f = a == null ? void 0 : a.close, h = a == null ? void 0 : a.shouldClose;
|
|
1569
|
+
if (h && !h()) {
|
|
1570
|
+
e = !0, Q.forward();
|
|
1479
1571
|
return;
|
|
1480
1572
|
} else
|
|
1481
|
-
|
|
1573
|
+
f ? f() : n.$hasCloseHandle && (e = !0, Q.back());
|
|
1482
1574
|
}
|
|
1483
|
-
|
|
1575
|
+
zs(), Ts(I), Ut(n);
|
|
1484
1576
|
});
|
|
1485
1577
|
}
|
|
1486
|
-
const { history:
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1578
|
+
const { history: O, titleStore: At, basePathStore: yc } = window._GEMHISTORY;
|
|
1579
|
+
/**
|
|
1580
|
+
* @license
|
|
1581
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
1582
|
+
* This code may only be used under the BSD style license found at
|
|
1583
|
+
* http://polymer.github.io/LICENSE.txt
|
|
1584
|
+
* The complete set of authors may be found at
|
|
1585
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
1586
|
+
* The complete set of contributors may be found at
|
|
1587
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
1588
|
+
* Code distributed by Google as part of the polymer project is also
|
|
1589
|
+
* subject to an additional IP rights grant found at
|
|
1590
|
+
* http://polymer.github.io/PATENTS.txt
|
|
1591
|
+
*/
|
|
1592
|
+
const Ri = (e, t) => {
|
|
1593
|
+
const n = e.startNode.parentNode, s = t === void 0 ? e.endNode : t.startNode, i = n.insertBefore(ot(), s);
|
|
1594
|
+
n.insertBefore(ot(), s);
|
|
1595
|
+
const o = new re(e.options);
|
|
1596
|
+
return o.insertAfterNode(i), o;
|
|
1597
|
+
}, kt = (e, t) => (e.setValue(t), e.commit(), e), Fn = (e, t, n) => {
|
|
1598
|
+
const s = e.startNode.parentNode, i = n ? n.startNode : e.endNode, o = t.endNode.nextSibling;
|
|
1599
|
+
o !== i && dr(s, t.startNode, o, i);
|
|
1600
|
+
}, qn = (e) => {
|
|
1601
|
+
bs(e.startNode.parentNode, e.startNode, e.endNode.nextSibling);
|
|
1602
|
+
}, Hi = (e, t, n) => {
|
|
1603
|
+
const s = /* @__PURE__ */ new Map();
|
|
1604
|
+
for (let i = t; i <= n; i++)
|
|
1605
|
+
s.set(e[i], i);
|
|
1606
|
+
return s;
|
|
1607
|
+
}, Wi = /* @__PURE__ */ new WeakMap(), zi = /* @__PURE__ */ new WeakMap(), Fl = Sn((e, t, n) => {
|
|
1608
|
+
let s;
|
|
1609
|
+
return n === void 0 ? n = t : t !== void 0 && (s = t), (i) => {
|
|
1610
|
+
if (!(i instanceof re))
|
|
1611
|
+
throw new Error("repeat can only be used in text bindings");
|
|
1612
|
+
const o = Wi.get(i) || [], c = zi.get(i) || [], a = [], f = [], h = [];
|
|
1613
|
+
let m = 0;
|
|
1614
|
+
for (const $ of e)
|
|
1615
|
+
h[m] = s ? s($, m) : m, f[m] = n($, m), m++;
|
|
1616
|
+
let r, _, l = 0, g = o.length - 1, v = 0, y = f.length - 1;
|
|
1617
|
+
for (; l <= g && v <= y; )
|
|
1618
|
+
if (o[l] === null)
|
|
1619
|
+
l++;
|
|
1620
|
+
else if (o[g] === null)
|
|
1621
|
+
g--;
|
|
1622
|
+
else if (c[l] === h[v])
|
|
1623
|
+
a[v] = kt(o[l], f[v]), l++, v++;
|
|
1624
|
+
else if (c[g] === h[y])
|
|
1625
|
+
a[y] = kt(o[g], f[y]), g--, y--;
|
|
1626
|
+
else if (c[l] === h[y])
|
|
1627
|
+
a[y] = kt(o[l], f[y]), Fn(i, o[l], a[y + 1]), l++, y--;
|
|
1628
|
+
else if (c[g] === h[v])
|
|
1629
|
+
a[v] = kt(o[g], f[v]), Fn(i, o[g], o[l]), g--, v++;
|
|
1630
|
+
else if (r === void 0 && (r = Hi(h, v, y), _ = Hi(c, l, g)), !r.has(c[l]))
|
|
1631
|
+
qn(o[l]), l++;
|
|
1632
|
+
else if (!r.has(c[g]))
|
|
1633
|
+
qn(o[g]), g--;
|
|
1634
|
+
else {
|
|
1635
|
+
const $ = _.get(h[v]), d = $ !== void 0 ? o[$] : null;
|
|
1636
|
+
if (d === null) {
|
|
1637
|
+
const S = Ri(i, o[l]);
|
|
1638
|
+
kt(S, f[v]), a[v] = S;
|
|
1639
|
+
} else
|
|
1640
|
+
a[v] = kt(d, f[v]), Fn(i, d, o[l]), o[$] = null;
|
|
1641
|
+
v++;
|
|
1642
|
+
}
|
|
1643
|
+
for (; v <= y; ) {
|
|
1644
|
+
const $ = Ri(i, a[y + 1]);
|
|
1645
|
+
kt($, f[v]), a[v++] = $;
|
|
1646
|
+
}
|
|
1647
|
+
for (; l <= g; ) {
|
|
1648
|
+
const $ = o[l++];
|
|
1649
|
+
$ !== null && qn($);
|
|
1650
|
+
}
|
|
1651
|
+
Wi.set(i, a), zi.set(i, h);
|
|
1652
|
+
};
|
|
1653
|
+
});
|
|
1654
|
+
/**
|
|
1655
|
+
* @license
|
|
1656
|
+
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
1657
|
+
* This code may only be used under the BSD style license found at
|
|
1658
|
+
* http://polymer.github.io/LICENSE.txt
|
|
1659
|
+
* The complete set of authors may be found at
|
|
1660
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
1661
|
+
* The complete set of contributors may be found at
|
|
1662
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
1663
|
+
* Code distributed by Google as part of the polymer project is also
|
|
1664
|
+
* subject to an additional IP rights grant found at
|
|
1665
|
+
* http://polymer.github.io/PATENTS.txt
|
|
1666
|
+
*/
|
|
1667
|
+
const Un = /* @__PURE__ */ new WeakMap(), ql = Sn((e, t) => (n) => {
|
|
1668
|
+
const s = Un.get(n);
|
|
1669
|
+
if (Array.isArray(e)) {
|
|
1670
|
+
if (Array.isArray(s) && s.length === e.length && e.every((i, o) => i === s[o]))
|
|
1671
|
+
return;
|
|
1672
|
+
} else if (s === e && (e !== void 0 || Un.has(n)))
|
|
1673
|
+
return;
|
|
1674
|
+
n.setValue(t()), Un.set(n, Array.isArray(e) ? Array.from(e) : e);
|
|
1675
|
+
});
|
|
1676
|
+
/**
|
|
1677
|
+
* @license
|
|
1678
|
+
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
1679
|
+
* This code may only be used under the BSD style license found at
|
|
1680
|
+
* http://polymer.github.io/LICENSE.txt
|
|
1681
|
+
* The complete set of authors may be found at
|
|
1682
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
1683
|
+
* The complete set of contributors may be found at
|
|
1684
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
1685
|
+
* Code distributed by Google as part of the polymer project is also
|
|
1686
|
+
* subject to an additional IP rights grant found at
|
|
1687
|
+
* http://polymer.github.io/PATENTS.txt
|
|
1688
|
+
*/
|
|
1689
|
+
const Bn = /* @__PURE__ */ new WeakMap(), Sc = Sn((e) => (t) => {
|
|
1690
|
+
const n = Bn.get(t);
|
|
1691
|
+
if (e === void 0 && t instanceof Ps) {
|
|
1692
|
+
if (n !== void 0 || !Bn.has(t)) {
|
|
1693
|
+
const s = t.committer.name;
|
|
1694
|
+
t.committer.element.removeAttribute(s);
|
|
1695
|
+
}
|
|
1696
|
+
} else e !== n && t.setValue(e);
|
|
1697
|
+
Bn.set(t, e);
|
|
1698
|
+
});
|
|
1699
|
+
var $c = Object.create, Vs = Object.defineProperty, Ec = Object.getOwnPropertyDescriptor, Hr = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), ae = (e) => {
|
|
1700
|
+
throw TypeError(e);
|
|
1701
|
+
}, Wr = (e, t, n) => t in e ? Vs(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Vi = (e, t) => Vs(e, "name", { value: t, configurable: !0 }), zr = (e) => [, , , $c((e == null ? void 0 : e[Hr("metadata")]) ?? null)], Vr = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Se = (e) => e !== void 0 && typeof e != "function" ? ae("Function expected") : e, bc = (e, t, n, s, i) => ({ kind: Vr[e], name: t, metadata: s, addInitializer: (o) => n._ ? ae("Already initialized") : i.push(Se(o || null)) }), Gr = (e, t) => Wr(t, Hr("metadata"), e[3]), C = (e, t, n, s) => {
|
|
1702
|
+
for (var i = 0, o = e[t >> 1], c = o && o.length; i < c; i++) t & 1 ? o[i].call(n) : s = o[i].call(n, s);
|
|
1703
|
+
return s;
|
|
1704
|
+
}, H = (e, t, n, s, i, o) => {
|
|
1705
|
+
var c, a, f, h, m, r = t & 7, _ = !!(t & 8), l = !!(t & 16), g = r > 3 ? e.length + 1 : r ? _ ? 1 : 2 : 0, v = Vr[r + 5], y = r > 3 && (e[g - 1] = []), $ = e[g] || (e[g] = []), d = r && (!l && !_ && (i = i.prototype), r < 5 && (r > 3 || !l) && Ec(r < 4 ? i : { get [n]() {
|
|
1706
|
+
return A(this, o);
|
|
1707
|
+
}, set [n](u) {
|
|
1708
|
+
return pn(this, o, u);
|
|
1709
|
+
} }, n));
|
|
1710
|
+
r ? l && r < 4 && Vi(o, (r > 2 ? "set " : r > 1 ? "get " : "") + n) : Vi(i, n);
|
|
1711
|
+
for (var S = s.length - 1; S >= 0; S--)
|
|
1712
|
+
h = bc(r, n, f = {}, e[3], $), r && (h.static = _, h.private = l, m = h.access = { has: l ? (u) => Cc(i, u) : (u) => n in u }, r ^ 3 && (m.get = l ? (u) => (r ^ 1 ? A : Pc)(u, i, r ^ 4 ? o : d.get) : (u) => u[n]), r > 2 && (m.set = l ? (u, k) => pn(u, i, k, r ^ 4 ? o : d.set) : (u, k) => u[n] = k)), a = (0, s[S])(r ? r < 4 ? l ? o : d[v] : r > 4 ? void 0 : { get: d.get, set: d.set } : i, h), f._ = 1, r ^ 4 || a === void 0 ? Se(a) && (r > 4 ? y.unshift(a) : r ? l ? o = a : d[v] = a : i = a) : typeof a != "object" || a === null ? ae("Object expected") : (Se(c = a.get) && (d.get = c), Se(c = a.set) && (d.set = c), Se(c = a.init) && y.unshift(c));
|
|
1713
|
+
return r || Gr(e, i), d && Vs(i, n, d), l ? r ^ 4 ? o : d : i;
|
|
1714
|
+
}, W = (e, t, n) => Wr(e, typeof t != "symbol" ? t + "" : t, n), Gs = (e, t, n) => t.has(e) || ae("Cannot " + n), Cc = (e, t) => Object(t) !== t ? ae('Cannot use the "in" operator on this value') : e.has(t), A = (e, t, n) => (Gs(e, t, "read from private field"), n ? n.call(e) : t.get(e)), j = (e, t, n) => t.has(e) ? ae("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), pn = (e, t, n, s) => (Gs(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n), Pc = (e, t, n) => (Gs(e, t, "access private method"), n), Dr, Fr, qr, Ur, Br, Kr, jr, Jr, Yr, Qr, Xr, Zr, to, eo, no, so, ss, w, xt, Gt, $e, on, is, Ee, an, Ds, Fs, qs, rs, Us, Bs, io, Ks, ro;
|
|
1715
|
+
const oo = "_";
|
|
1716
|
+
class kc extends RegExp {
|
|
1501
1717
|
constructor(t) {
|
|
1502
|
-
let
|
|
1718
|
+
let n = 0;
|
|
1503
1719
|
super(
|
|
1504
|
-
`^${t.replace(/((:[^/$]+)|(\*))/g, (
|
|
1720
|
+
`^${t.replace(/((:[^/$]+)|(\*))/g, (s, i) => i === "*" ? `(?<${oo}${n++}>.*)` : `(?<${i.slice(1)}>[^/]+)`)}$`
|
|
1505
1721
|
);
|
|
1506
1722
|
}
|
|
1507
1723
|
}
|
|
1508
|
-
function
|
|
1724
|
+
function ao(e, t) {
|
|
1509
1725
|
if (window.URLPattern) {
|
|
1510
|
-
const
|
|
1511
|
-
return
|
|
1512
|
-
}
|
|
1513
|
-
const
|
|
1514
|
-
if (!
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
function rr(s, t) {
|
|
1726
|
+
const o = new window.URLPattern({ pathname: e }), c = o.exec({ pathname: t }) || o.exec({ pathname: `${t}/` });
|
|
1727
|
+
return c ? c.pathname.groups : null;
|
|
1728
|
+
}
|
|
1729
|
+
const n = new kc(e), s = t.match(n) || `${t}/`.match(n);
|
|
1730
|
+
if (!s) return null;
|
|
1731
|
+
const i = {};
|
|
1732
|
+
return s.groups && Object.entries(s.groups).forEach(([o, c]) => {
|
|
1733
|
+
i[o.startsWith(oo) ? o.slice(1) : o] = c;
|
|
1734
|
+
}), i;
|
|
1735
|
+
}
|
|
1736
|
+
function js(e, t) {
|
|
1737
|
+
let n = 0, s = e.pattern.replaceAll("*", () => `:${n++}`);
|
|
1738
|
+
const i = t == null ? void 0 : t.params;
|
|
1739
|
+
return i && Object.keys(i).forEach((o) => {
|
|
1740
|
+
s = s.replace(new RegExp(`:${o}`, "g"), i[o]);
|
|
1741
|
+
}), s;
|
|
1742
|
+
}
|
|
1743
|
+
function xc(e, t) {
|
|
1529
1744
|
return {
|
|
1530
|
-
path:
|
|
1745
|
+
path: js(e, t),
|
|
1531
1746
|
...t
|
|
1532
1747
|
};
|
|
1533
1748
|
}
|
|
1534
|
-
const
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1749
|
+
const Kn = at``, Gi = /* @__PURE__ */ new Map();
|
|
1750
|
+
class z extends (ss = B, so = [On], no = [U], eo = [U], to = [U], Zr = [ye], Xr = [ye], Qr = [ye], Yr = [ye], Jr = [U], jr = [U], Kr = [U], Br = [Mn()], Ur = [$t((t) => [t.scrollContainer])], qr = [$t((t) => [t.scrollContainer])], Fr = [$t((t) => {
|
|
1751
|
+
var n;
|
|
1752
|
+
return A(n = t, rs).call(n);
|
|
1753
|
+
})], Dr = [xr((t) => !t.inert)], ss) {
|
|
1754
|
+
constructor() {
|
|
1755
|
+
super(...arguments), j(this, xt), W(this, "transition", C(w, 8, this)), C(w, 11, this), W(this, "routes", C(w, 12, this)), C(w, 15, this), W(this, "locationStore", C(w, 16, this)), C(w, 19, this), W(this, "key", C(w, 20, this)), C(w, 23, this), W(this, "loading", C(w, 24, this)), C(w, 27, this), W(this, "beforeroutechange", C(w, 28, this)), C(w, 31, this), W(this, "routechange", C(w, 32, this)), C(w, 35, this), W(this, "error", C(w, 36, this)), C(w, 39, this), W(this, "scrollContainer", C(w, 40, this)), C(w, 43, this), W(this, "scrollIgnoreHash", C(w, 44, this)), C(w, 47, this), W(this, "trigger", C(w, 48, this, O)), C(w, 51, this), W(this, "currentRoute"), W(this, "currentParams", {}), j(this, $e, Ns({ content: Kn })), j(this, on, () => {
|
|
1756
|
+
if (!this.locationStore) return;
|
|
1757
|
+
const { path: t, query: n, hash: s, data: i } = O.getParams();
|
|
1758
|
+
It(this.locationStore, {
|
|
1759
|
+
path: t,
|
|
1544
1760
|
params: this.currentParams,
|
|
1545
|
-
query:
|
|
1546
|
-
hash:
|
|
1547
|
-
data:
|
|
1761
|
+
query: n,
|
|
1762
|
+
hash: s,
|
|
1763
|
+
data: i
|
|
1548
1764
|
});
|
|
1549
|
-
}),
|
|
1550
|
-
if (!
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
this.setState({ content: i }), W(this, re).call(this), await Promise.resolve(), W(this, je).call(this), this.routechange(this.currentRoute);
|
|
1765
|
+
}), j(this, is, () => {
|
|
1766
|
+
if (!A(this, xt, Gt)) return;
|
|
1767
|
+
const t = Gi.get(O.currentKey);
|
|
1768
|
+
t ? A(this, xt, Gt).scroll(0, t) : (this.scrollIgnoreHash || !O.getParams().hash) && A(this, xt, Gt).scroll(0, 0);
|
|
1769
|
+
}), j(this, Ee), j(this, an, (t, n, s) => {
|
|
1770
|
+
this.beforeroutechange(t), pn(this, Ee, void 0), this.currentRoute = t, this.currentParams = n;
|
|
1771
|
+
const i = async () => {
|
|
1772
|
+
A(this, $e).call(this, { content: s }), A(this, on).call(this), await Promise.resolve(), A(this, is).call(this), this.routechange(this.currentRoute);
|
|
1558
1773
|
};
|
|
1559
|
-
this.transition && "startViewTransition" in document ? document.startViewTransition(() =>
|
|
1560
|
-
}), this.
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
Os(this, Lt, h);
|
|
1574
|
-
const g = () => W(this, Lt) === h;
|
|
1575
|
-
h.then((u) => {
|
|
1576
|
-
g() && W(this, ie).call(this, o, a, u);
|
|
1577
|
-
}).catch((u) => {
|
|
1578
|
-
g() && this.error(u);
|
|
1579
|
-
});
|
|
1774
|
+
this.transition && "startViewTransition" in document ? document.startViewTransition(() => i()) : i();
|
|
1775
|
+
}), j(this, Ds, C(w, 52, this, () => this.internals.states.delete(Pn))), C(w, 55, this), j(this, Fs, C(w, 56, this, () => {
|
|
1776
|
+
if (A(this, xt, Gt))
|
|
1777
|
+
return wr(
|
|
1778
|
+
O,
|
|
1779
|
+
"beforechange",
|
|
1780
|
+
() => Gi.set(O.currentKey, A(this, xt, Gt).scrollTop)
|
|
1781
|
+
);
|
|
1782
|
+
})), C(w, 59, this), j(this, qs, C(w, 60, this, () => pt(this.trigger.store, () => A(this, $e).call(this, {})))), C(w, 63, this), j(this, rs, () => {
|
|
1783
|
+
const { path: t, query: n, hash: s } = this.trigger.getParams();
|
|
1784
|
+
return [this.key, t, n, s];
|
|
1785
|
+
}), j(this, Us, C(w, 64, this, ([t, n], s) => {
|
|
1786
|
+
if (s && t === s[0] && n === s[1]) {
|
|
1787
|
+
A(this, on).call(this);
|
|
1580
1788
|
return;
|
|
1581
1789
|
}
|
|
1582
|
-
|
|
1583
|
-
}, this
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
() => {
|
|
1588
|
-
if (W(this, it, ut))
|
|
1589
|
-
return Ks(
|
|
1590
|
-
v,
|
|
1591
|
-
"beforechange",
|
|
1592
|
-
() => Ms.set(v.currentKey, W(this, it, ut).scrollTop)
|
|
1593
|
-
);
|
|
1594
|
-
},
|
|
1595
|
-
() => [this.scrollContainer]
|
|
1596
|
-
), this.effect(
|
|
1597
|
-
// 触发 this.#update
|
|
1598
|
-
() => ct(this.trigger.store, () => this.setState({})),
|
|
1599
|
-
() => [this.trigger]
|
|
1600
|
-
), this.effect(
|
|
1601
|
-
([t, e], n) => {
|
|
1602
|
-
if (n && t === n[0] && e === n[1]) {
|
|
1603
|
-
W(this, re).call(this);
|
|
1604
|
-
return;
|
|
1605
|
-
}
|
|
1606
|
-
this.update();
|
|
1607
|
-
},
|
|
1608
|
-
() => {
|
|
1609
|
-
const { path: t, query: e, hash: n } = this.trigger.getParams();
|
|
1610
|
-
return [this.key, t, e, n];
|
|
1611
|
-
}
|
|
1612
|
-
);
|
|
1613
|
-
}
|
|
1614
|
-
shouldUpdate() {
|
|
1615
|
-
return !this.inert;
|
|
1616
|
-
}
|
|
1617
|
-
render() {
|
|
1618
|
-
const { content: t } = this.state;
|
|
1619
|
-
if (t !== void 0)
|
|
1620
|
-
return this.shadowRoot ? j`
|
|
1790
|
+
this.update();
|
|
1791
|
+
})), C(w, 67, this), j(this, Bs, C(w, 68, this, () => {
|
|
1792
|
+
const { content: t } = A(this, $e);
|
|
1793
|
+
if (t !== void 0)
|
|
1794
|
+
return this.shadowRoot ? at`
|
|
1621
1795
|
<style>
|
|
1622
1796
|
:host(:where(:not([hidden]))),
|
|
1623
1797
|
:not(:defined) {
|
|
1624
1798
|
display: contents;
|
|
1625
1799
|
}
|
|
1626
1800
|
</style>
|
|
1627
|
-
${t ===
|
|
1628
|
-
` : t ===
|
|
1801
|
+
${t === Kn ? at`<slot></slot>` : t}
|
|
1802
|
+
` : t === Kn ? void 0 : at`${t}`;
|
|
1803
|
+
})), C(w, 71, this), W(this, "update", () => {
|
|
1804
|
+
const { path: t, hash: n, query: s } = this.trigger.getParams(), { route: i, params: o = {} } = Ue.findRoute(this.routes, t), { redirect: c, content: a, getContent: f } = i || {};
|
|
1805
|
+
if (c) {
|
|
1806
|
+
this.trigger.replace({
|
|
1807
|
+
path: js({ pattern: c }, { params: o }),
|
|
1808
|
+
query: s,
|
|
1809
|
+
hash: n
|
|
1810
|
+
});
|
|
1811
|
+
return;
|
|
1812
|
+
}
|
|
1813
|
+
this.trigger === O && (location.href !== At.url || i != null && i.title) && It(At, { url: location.href, title: i == null ? void 0 : i.title });
|
|
1814
|
+
const h = a || (f == null ? void 0 : f(o, this.shadowRoot || this));
|
|
1815
|
+
if (this.loading(i), h instanceof Promise) {
|
|
1816
|
+
pn(this, Ee, h);
|
|
1817
|
+
const m = () => A(this, Ee) === h;
|
|
1818
|
+
h.then((r) => {
|
|
1819
|
+
m() && A(this, an).call(this, i, o, r);
|
|
1820
|
+
}).catch((r) => {
|
|
1821
|
+
m() && this.error(r);
|
|
1822
|
+
});
|
|
1823
|
+
return;
|
|
1824
|
+
}
|
|
1825
|
+
A(this, an).call(this, i, o, h);
|
|
1826
|
+
});
|
|
1629
1827
|
}
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1828
|
+
}
|
|
1829
|
+
w = zr(ss);
|
|
1830
|
+
xt = /* @__PURE__ */ new WeakSet();
|
|
1831
|
+
Gt = function() {
|
|
1634
1832
|
return typeof this.scrollContainer == "function" ? this.scrollContainer() : this.scrollContainer;
|
|
1635
1833
|
};
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1834
|
+
$e = /* @__PURE__ */ new WeakMap();
|
|
1835
|
+
on = /* @__PURE__ */ new WeakMap();
|
|
1836
|
+
is = /* @__PURE__ */ new WeakMap();
|
|
1837
|
+
Ee = /* @__PURE__ */ new WeakMap();
|
|
1838
|
+
an = /* @__PURE__ */ new WeakMap();
|
|
1839
|
+
Ds = /* @__PURE__ */ new WeakMap();
|
|
1840
|
+
Fs = /* @__PURE__ */ new WeakMap();
|
|
1841
|
+
qs = /* @__PURE__ */ new WeakMap();
|
|
1842
|
+
rs = /* @__PURE__ */ new WeakMap();
|
|
1843
|
+
Us = /* @__PURE__ */ new WeakMap();
|
|
1844
|
+
Bs = /* @__PURE__ */ new WeakMap();
|
|
1845
|
+
H(w, 5, "transition", so, z);
|
|
1846
|
+
H(w, 5, "routes", no, z);
|
|
1847
|
+
H(w, 5, "locationStore", eo, z);
|
|
1848
|
+
H(w, 5, "key", to, z);
|
|
1849
|
+
H(w, 5, "loading", Zr, z);
|
|
1850
|
+
H(w, 5, "beforeroutechange", Xr, z);
|
|
1851
|
+
H(w, 5, "routechange", Qr, z);
|
|
1852
|
+
H(w, 5, "error", Yr, z);
|
|
1853
|
+
H(w, 5, "scrollContainer", Jr, z);
|
|
1854
|
+
H(w, 5, "scrollIgnoreHash", jr, z);
|
|
1855
|
+
H(w, 5, "trigger", Kr, z);
|
|
1856
|
+
H(w, 21, "#unBoundary", Br, Ds);
|
|
1857
|
+
H(w, 21, "#rememberScrollPosition", Ur, Fs);
|
|
1858
|
+
H(w, 21, "#connectTriggerStore", qr, qs);
|
|
1859
|
+
H(w, 21, "#updateContent", Fr, Us);
|
|
1860
|
+
H(w, 21, "#content", Dr, Bs);
|
|
1861
|
+
Gr(w, z);
|
|
1862
|
+
W(z, "createLocationStore", () => {
|
|
1863
|
+
const { path: e, query: t, hash: n, data: s } = O.getParams();
|
|
1864
|
+
return bn({ path: e, query: t, hash: n, data: s, params: {} });
|
|
1865
|
+
});
|
|
1866
|
+
W(z, "findRoute", (e = [], t) => {
|
|
1867
|
+
let n = null, s;
|
|
1868
|
+
e instanceof Array ? s = e : s = Object.values(e);
|
|
1869
|
+
for (const i of s)
|
|
1870
|
+
if (i.pattern === "*")
|
|
1871
|
+
n = i;
|
|
1649
1872
|
else {
|
|
1650
|
-
const
|
|
1651
|
-
if (
|
|
1652
|
-
return { route:
|
|
1873
|
+
const o = ao(i.pattern, t);
|
|
1874
|
+
if (o)
|
|
1875
|
+
return { route: i, params: o };
|
|
1653
1876
|
}
|
|
1654
|
-
return { route:
|
|
1655
|
-
};
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
],
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
return n && r && or(t, e, r), r;
|
|
1699
|
-
}, cr = (s, t, e) => {
|
|
1700
|
-
if (!t.has(s))
|
|
1701
|
-
throw TypeError("Cannot " + e);
|
|
1702
|
-
}, Y = (s, t, e) => (cr(s, t, "read from private field"), e ? e.call(s) : t.get(s)), St = (s, t, e) => {
|
|
1703
|
-
if (t.has(s))
|
|
1704
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
1705
|
-
t instanceof WeakSet ? t.add(s) : t.set(s, e);
|
|
1706
|
-
}, dt, kt, Ge, dn, Fe, Be, Ke;
|
|
1707
|
-
function As(s) {
|
|
1708
|
-
return !s.startsWith("/");
|
|
1709
|
-
}
|
|
1710
|
-
let b = class extends R {
|
|
1877
|
+
return { route: n };
|
|
1878
|
+
});
|
|
1879
|
+
io = [Ht()];
|
|
1880
|
+
class Ue extends (ro = z) {
|
|
1881
|
+
}
|
|
1882
|
+
Ks = zr(ro);
|
|
1883
|
+
Ue = H(Ks, 0, "GemRouteElement", io, Ue);
|
|
1884
|
+
C(Ks, 1, Ue);
|
|
1885
|
+
var Tc = Object.create, Js = Object.defineProperty, Oc = Object.getOwnPropertyDescriptor, co = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), ce = (e) => {
|
|
1886
|
+
throw TypeError(e);
|
|
1887
|
+
}, lo = (e, t, n) => t in e ? Js(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Di = (e, t) => Js(e, "name", { value: t, configurable: !0 }), ho = (e) => [, , , Tc((e == null ? void 0 : e[co("metadata")]) ?? null)], uo = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], be = (e) => e !== void 0 && typeof e != "function" ? ce("Function expected") : e, Mc = (e, t, n, s, i) => ({ kind: uo[e], name: t, metadata: s, addInitializer: (o) => n._ ? ce("Already initialized") : i.push(be(o || null)) }), Lc = (e, t) => lo(t, co("metadata"), e[3]), P = (e, t, n, s) => {
|
|
1888
|
+
for (var i = 0, o = e[t >> 1], c = o && o.length; i < c; i++) t & 1 ? o[i].call(n) : s = o[i].call(n, s);
|
|
1889
|
+
return s;
|
|
1890
|
+
}, N = (e, t, n, s, i, o) => {
|
|
1891
|
+
var c, a, f, h, m, r = t & 7, _ = !!(t & 8), l = !!(t & 16), g = r > 3 ? e.length + 1 : r ? _ ? 1 : 2 : 0, v = uo[r + 5], y = r > 3 && (e[g - 1] = []), $ = e[g] || (e[g] = []), d = r && (!l && !_ && (i = i.prototype), r < 5 && (r > 3 || !l) && Oc(r < 4 ? i : { get [n]() {
|
|
1892
|
+
return nt(this, o);
|
|
1893
|
+
}, set [n](u) {
|
|
1894
|
+
return Fi(this, o, u);
|
|
1895
|
+
} }, n));
|
|
1896
|
+
r ? l && r < 4 && Di(o, (r > 2 ? "set " : r > 1 ? "get " : "") + n) : Di(i, n);
|
|
1897
|
+
for (var S = s.length - 1; S >= 0; S--)
|
|
1898
|
+
h = Mc(r, n, f = {}, e[3], $), r && (h.static = _, h.private = l, m = h.access = { has: l ? (u) => Nc(i, u) : (u) => n in u }, r ^ 3 && (m.get = l ? (u) => (r ^ 1 ? nt : Ac)(u, i, r ^ 4 ? o : d.get) : (u) => u[n]), r > 2 && (m.set = l ? (u, k) => Fi(u, i, k, r ^ 4 ? o : d.set) : (u, k) => u[n] = k)), a = (0, s[S])(r ? r < 4 ? l ? o : d[v] : r > 4 ? void 0 : { get: d.get, set: d.set } : i, h), f._ = 1, r ^ 4 || a === void 0 ? be(a) && (r > 4 ? y.unshift(a) : r ? l ? o = a : d[v] = a : i = a) : typeof a != "object" || a === null ? ce("Object expected") : (be(c = a.get) && (d.get = c), be(c = a.set) && (d.set = c), be(c = a.init) && y.unshift(c));
|
|
1899
|
+
return r || Lc(e, i), d && Js(i, n, d), l ? r ^ 4 ? o : d : i;
|
|
1900
|
+
}, D = (e, t, n) => lo(e, typeof t != "symbol" ? t + "" : t, n), Ys = (e, t, n) => t.has(e) || ce("Cannot " + n), Nc = (e, t) => Object(t) !== t ? ce('Cannot use the "in" operator on this value') : e.has(t), nt = (e, t, n) => (Ys(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Dt = (e, t, n) => t.has(e) ? ce("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Fi = (e, t, n, s) => (Ys(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n), Ac = (e, t, n) => (Ys(e, t, "access private method"), n), po, fo, _o, go, mo, vo, wo, yo, So, $o, Eo, bo, Co, os, Po, E, _t, Ce, ko, Qs, as, cs, Xs, ls, xo, To, Oo, hs, Mo, X, Zs;
|
|
1901
|
+
function qi(e) {
|
|
1902
|
+
return !e.startsWith("/");
|
|
1903
|
+
}
|
|
1904
|
+
const Ic = kn(yr`
|
|
1905
|
+
:host {
|
|
1906
|
+
/* link default style */
|
|
1907
|
+
cursor: pointer;
|
|
1908
|
+
color: blue;
|
|
1909
|
+
text-decoration: underline;
|
|
1910
|
+
}
|
|
1911
|
+
a {
|
|
1912
|
+
all: unset;
|
|
1913
|
+
display: contents;
|
|
1914
|
+
}
|
|
1915
|
+
a:visited {
|
|
1916
|
+
color: unset;
|
|
1917
|
+
}
|
|
1918
|
+
`);
|
|
1919
|
+
Po = [Nn(yc), Hs(Ic), Ht(), An({ focusable: !0 })];
|
|
1920
|
+
class R extends (os = B, Co = [G], bo = [G], Eo = [G], $o = [G], So = [G], yo = [G], wo = [On], vo = [U], mo = [U], go = [U], _o = [U], fo = [Or], po = [qe()], os) {
|
|
1711
1921
|
constructor() {
|
|
1712
|
-
super(
|
|
1713
|
-
var
|
|
1714
|
-
const
|
|
1715
|
-
if (!
|
|
1716
|
-
|
|
1717
|
-
if (As(s))
|
|
1922
|
+
super(...arguments), P(E, 5, this), Dt(this, _t), D(this, "href", P(E, 8, this)), P(E, 11, this), D(this, "target", P(E, 12, this)), P(E, 15, this), D(this, "path", P(E, 16, this)), P(E, 19, this), D(this, "query", P(E, 20, this)), P(E, 23, this), D(this, "hash", P(E, 24, this)), P(E, 27, this), D(this, "hint", P(E, 28, this)), P(E, 31, this), D(this, "preload", P(E, 32, this)), P(E, 35, this), D(this, "route", P(E, 36, this)), P(E, 39, this), D(this, "options", P(E, 40, this)), P(E, 43, this), D(this, "routeOptions", P(E, 44, this)), P(E, 47, this), D(this, "prepare", P(E, 48, this)), P(E, 51, this), D(this, "link", P(E, 52, this)), P(E, 55, this), Dt(this, Qs, async () => {
|
|
1923
|
+
var o;
|
|
1924
|
+
const t = this.getLocationString();
|
|
1925
|
+
if (!t) return;
|
|
1926
|
+
if (qi(t))
|
|
1718
1927
|
switch (this.target) {
|
|
1719
1928
|
case "_self":
|
|
1720
|
-
window.location.href =
|
|
1929
|
+
window.location.href = t;
|
|
1721
1930
|
return;
|
|
1722
1931
|
case "_parent":
|
|
1723
|
-
window.parent.location.href =
|
|
1932
|
+
window.parent.location.href = t;
|
|
1724
1933
|
return;
|
|
1725
1934
|
case "_top":
|
|
1726
|
-
window.top.location.href =
|
|
1935
|
+
window.top.location.href = t;
|
|
1727
1936
|
return;
|
|
1728
1937
|
default:
|
|
1729
|
-
window.open(
|
|
1938
|
+
window.open(t);
|
|
1730
1939
|
return;
|
|
1731
1940
|
}
|
|
1732
|
-
const { path:
|
|
1733
|
-
if (
|
|
1734
|
-
if (await ((
|
|
1735
|
-
|
|
1736
|
-
...rr(this.route, Y(this, dt, kt)),
|
|
1737
|
-
title: this.route.title || this.docTitle
|
|
1738
|
-
});
|
|
1941
|
+
const { path: n, query: s, hash: i } = O.getParams();
|
|
1942
|
+
if (n + s + i !== t)
|
|
1943
|
+
if (await ((o = this.prepare) == null ? void 0 : o.call(this)), this.route)
|
|
1944
|
+
O.pushIgnoreCloseHandle(xc(this.route, nt(this, _t, Ce)));
|
|
1739
1945
|
else if (this.href) {
|
|
1740
|
-
const
|
|
1741
|
-
|
|
1742
|
-
path:
|
|
1743
|
-
query:
|
|
1744
|
-
hash:
|
|
1745
|
-
title: this.docTitle
|
|
1946
|
+
const c = new URL(t, location.origin);
|
|
1947
|
+
O.pushIgnoreCloseHandle({
|
|
1948
|
+
path: c.pathname,
|
|
1949
|
+
query: c.search,
|
|
1950
|
+
hash: c.hash
|
|
1746
1951
|
});
|
|
1747
1952
|
} else
|
|
1748
|
-
|
|
1953
|
+
O.pushIgnoreCloseHandle({
|
|
1749
1954
|
path: this.path,
|
|
1750
1955
|
query: this.query,
|
|
1751
|
-
hash: this.hash
|
|
1752
|
-
title: this.docTitle
|
|
1956
|
+
hash: this.hash
|
|
1753
1957
|
});
|
|
1754
|
-
}),
|
|
1755
|
-
|
|
1756
|
-
}),
|
|
1757
|
-
const
|
|
1758
|
-
return
|
|
1759
|
-
}), this
|
|
1958
|
+
}), Dt(this, as, (t) => {
|
|
1959
|
+
t.preventDefault();
|
|
1960
|
+
}), Dt(this, cs, () => {
|
|
1961
|
+
const t = this.getLocationString();
|
|
1962
|
+
return qi(t) ? t : new URL(O.basePath + t, location.origin).toString();
|
|
1963
|
+
}), Dt(this, Xs, () => {
|
|
1964
|
+
var t, n, s;
|
|
1965
|
+
(t = this.route) == null || t.content, (s = (n = this.route) == null ? void 0 : n.getContent) == null || s.call(n, {}, this.shadowRoot);
|
|
1966
|
+
});
|
|
1760
1967
|
}
|
|
1761
1968
|
render() {
|
|
1762
|
-
return
|
|
1763
|
-
<style>
|
|
1764
|
-
:host {
|
|
1765
|
-
/* link default style */
|
|
1766
|
-
cursor: pointer;
|
|
1767
|
-
color: blue;
|
|
1768
|
-
text-decoration: underline;
|
|
1769
|
-
}
|
|
1770
|
-
a {
|
|
1771
|
-
all: unset;
|
|
1772
|
-
display: contents;
|
|
1773
|
-
}
|
|
1774
|
-
a:visited {
|
|
1775
|
-
color: unset;
|
|
1776
|
-
}
|
|
1777
|
-
</style>
|
|
1969
|
+
return at`
|
|
1778
1970
|
<a
|
|
1779
1971
|
part=${this.link}
|
|
1780
|
-
@click=${
|
|
1781
|
-
href=${
|
|
1972
|
+
@click=${nt(this, as)}
|
|
1973
|
+
href=${Sc(nt(this, _t, ko) === "off" ? void 0 : nt(this, cs).call(this))}
|
|
1974
|
+
tabindex="-1"
|
|
1782
1975
|
>
|
|
1783
1976
|
<slot></slot>
|
|
1784
1977
|
</a>
|
|
@@ -1788,313 +1981,323 @@ let b = class extends R {
|
|
|
1788
1981
|
* 如果该元素是外部链接返回 URL,否则返回路径(不包含 basePath)
|
|
1789
1982
|
*/
|
|
1790
1983
|
getLocationString() {
|
|
1791
|
-
var
|
|
1984
|
+
var t, n;
|
|
1792
1985
|
if (this.route) {
|
|
1793
|
-
const
|
|
1794
|
-
return
|
|
1986
|
+
const s = ((t = nt(this, _t, Ce)) == null ? void 0 : t.query) || "", i = ((n = nt(this, _t, Ce)) == null ? void 0 : n.hash) || "";
|
|
1987
|
+
return js(this.route, nt(this, _t, Ce)) + s + i;
|
|
1795
1988
|
} else {
|
|
1796
|
-
const
|
|
1797
|
-
return
|
|
1989
|
+
const s = this.href || this.path + this.query + this.hash, { path: i, query: o } = O.getParams();
|
|
1990
|
+
return s.startsWith("#") ? `${i}${o}${s}` : s.startsWith("?") ? `${i}${s}` : s.startsWith(".") ? vr(i, s) : s;
|
|
1798
1991
|
}
|
|
1799
1992
|
}
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
|
|
1993
|
+
}
|
|
1994
|
+
E = ho(os);
|
|
1995
|
+
_t = /* @__PURE__ */ new WeakSet();
|
|
1996
|
+
Ce = function() {
|
|
1803
1997
|
return this.routeOptions || this.options;
|
|
1804
1998
|
};
|
|
1805
|
-
|
|
1806
|
-
dn = function() {
|
|
1999
|
+
ko = function() {
|
|
1807
2000
|
return this.hint || "on";
|
|
1808
2001
|
};
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
x([
|
|
1816
|
-
C
|
|
1817
|
-
], b.prototype, "target", 2);
|
|
1818
|
-
x([
|
|
1819
|
-
C
|
|
1820
|
-
], b.prototype, "path", 2);
|
|
1821
|
-
x([
|
|
1822
|
-
C
|
|
1823
|
-
], b.prototype, "query", 2);
|
|
1824
|
-
x([
|
|
1825
|
-
C
|
|
1826
|
-
], b.prototype, "hash", 2);
|
|
1827
|
-
x([
|
|
1828
|
-
C
|
|
1829
|
-
], b.prototype, "docTitle", 2);
|
|
1830
|
-
x([
|
|
1831
|
-
C
|
|
1832
|
-
], b.prototype, "hint", 2);
|
|
1833
|
-
x([
|
|
1834
|
-
N
|
|
1835
|
-
], b.prototype, "route", 2);
|
|
1836
|
-
x([
|
|
1837
|
-
N
|
|
1838
|
-
], b.prototype, "options", 2);
|
|
1839
|
-
x([
|
|
1840
|
-
N
|
|
1841
|
-
], b.prototype, "routeOptions", 2);
|
|
1842
|
-
x([
|
|
1843
|
-
N
|
|
1844
|
-
], b.prototype, "prepare", 2);
|
|
1845
|
-
x([
|
|
1846
|
-
zn
|
|
1847
|
-
], b.prototype, "link", 2);
|
|
1848
|
-
b = x([
|
|
1849
|
-
as(tr)
|
|
1850
|
-
], b);
|
|
1851
|
-
let Ut = class extends b {
|
|
1852
|
-
constructor() {
|
|
1853
|
-
super(), this.effect(() => {
|
|
1854
|
-
const { path: s, query: t, hash: e } = v.getParams(), n = this.pattern && hn(this.pattern, s);
|
|
1855
|
-
this.active = !!n || s + t + e === this.getLocationString();
|
|
1856
|
-
});
|
|
1857
|
-
}
|
|
2002
|
+
Qs = /* @__PURE__ */ new WeakMap();
|
|
2003
|
+
as = /* @__PURE__ */ new WeakMap();
|
|
2004
|
+
cs = /* @__PURE__ */ new WeakMap();
|
|
2005
|
+
Xs = /* @__PURE__ */ new WeakMap();
|
|
2006
|
+
ls = function() {
|
|
2007
|
+
this.addEventListener("click", nt(this, Qs)), this.addEventListener("pointerenter", nt(this, Xs));
|
|
1858
2008
|
};
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
2009
|
+
ls = N(E, 17, "#init", po, _t, ls);
|
|
2010
|
+
N(E, 5, "href", Co, R);
|
|
2011
|
+
N(E, 5, "target", bo, R);
|
|
2012
|
+
N(E, 5, "path", Eo, R);
|
|
2013
|
+
N(E, 5, "query", $o, R);
|
|
2014
|
+
N(E, 5, "hash", So, R);
|
|
2015
|
+
N(E, 5, "hint", yo, R);
|
|
2016
|
+
N(E, 5, "preload", wo, R);
|
|
2017
|
+
N(E, 5, "route", vo, R);
|
|
2018
|
+
N(E, 5, "options", mo, R);
|
|
2019
|
+
N(E, 5, "routeOptions", go, R);
|
|
2020
|
+
N(E, 5, "prepare", _o, R);
|
|
2021
|
+
N(E, 5, "link", fo, R);
|
|
2022
|
+
R = N(E, 0, "GemLinkElement", Po, R);
|
|
2023
|
+
P(E, 1, R);
|
|
2024
|
+
Mo = [Nn(O.store)];
|
|
2025
|
+
class se extends (hs = R, Oo = [G], To = [Ln], xo = [$t()], hs) {
|
|
2026
|
+
constructor() {
|
|
2027
|
+
super(...arguments), D(this, "pattern", P(X, 8, this)), P(X, 11, this), D(this, "active", P(X, 12, this)), P(X, 15, this), Dt(this, Zs, P(X, 16, this, () => {
|
|
2028
|
+
const { path: t, query: n, hash: s } = O.getParams(), i = this.pattern && ao(this.pattern, t);
|
|
2029
|
+
this.active = !!i || t + n + s === this.getLocationString();
|
|
2030
|
+
})), P(X, 19, this);
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
X = ho(hs);
|
|
2034
|
+
Zs = /* @__PURE__ */ new WeakMap();
|
|
2035
|
+
N(X, 5, "pattern", Oo, se);
|
|
2036
|
+
N(X, 5, "active", To, se);
|
|
2037
|
+
N(X, 21, "#updateState", xo, Zs);
|
|
2038
|
+
se = N(X, 0, "GemActiveLinkElement", Mo, se);
|
|
2039
|
+
P(X, 1, se);
|
|
2040
|
+
customElements.define("gem-link", R);
|
|
2041
|
+
customElements.define("gem-active-link", se);
|
|
2042
|
+
customElements.define("gem-route", Ue);
|
|
2043
|
+
customElements.define("gem-light-route", z);
|
|
2044
|
+
var Rc = Object.create, ti = Object.defineProperty, Hc = Object.getOwnPropertyDescriptor, Lo = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), le = (e) => {
|
|
2045
|
+
throw TypeError(e);
|
|
2046
|
+
}, No = (e, t, n) => t in e ? ti(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ui = (e, t) => ti(e, "name", { value: t, configurable: !0 }), Wc = (e) => [, , , Rc((e == null ? void 0 : e[Lo("metadata")]) ?? null)], Ao = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Pe = (e) => e !== void 0 && typeof e != "function" ? le("Function expected") : e, zc = (e, t, n, s, i) => ({ kind: Ao[e], name: t, metadata: s, addInitializer: (o) => n._ ? le("Already initialized") : i.push(Pe(o || null)) }), Vc = (e, t) => No(t, Lo("metadata"), e[3]), tt = (e, t, n, s) => {
|
|
2047
|
+
for (var i = 0, o = e[t >> 1], c = o && o.length; i < c; i++) t & 1 ? o[i].call(n) : s = o[i].call(n, s);
|
|
2048
|
+
return s;
|
|
2049
|
+
}, he = (e, t, n, s, i, o) => {
|
|
2050
|
+
var c, a, f, h, m, r = t & 7, _ = !!(t & 8), l = !!(t & 16), g = r > 3 ? e.length + 1 : r ? _ ? 1 : 2 : 0, v = Ao[r + 5], y = r > 3 && (e[g - 1] = []), $ = e[g] || (e[g] = []), d = r && (!l && !_ && (i = i.prototype), r < 5 && (r > 3 || !l) && Hc(r < 4 ? i : { get [n]() {
|
|
2051
|
+
return us(this, o);
|
|
2052
|
+
}, set [n](u) {
|
|
2053
|
+
return Bi(this, o, u);
|
|
2054
|
+
} }, n));
|
|
2055
|
+
r ? l && r < 4 && Ui(o, (r > 2 ? "set " : r > 1 ? "get " : "") + n) : Ui(i, n);
|
|
2056
|
+
for (var S = s.length - 1; S >= 0; S--)
|
|
2057
|
+
h = zc(r, n, f = {}, e[3], $), r && (h.static = _, h.private = l, m = h.access = { has: l ? (u) => Gc(i, u) : (u) => n in u }, r ^ 3 && (m.get = l ? (u) => (r ^ 1 ? us : Dc)(u, i, r ^ 4 ? o : d.get) : (u) => u[n]), r > 2 && (m.set = l ? (u, k) => Bi(u, i, k, r ^ 4 ? o : d.set) : (u, k) => u[n] = k)), a = (0, s[S])(r ? r < 4 ? l ? o : d[v] : r > 4 ? void 0 : { get: d.get, set: d.set } : i, h), f._ = 1, r ^ 4 || a === void 0 ? Pe(a) && (r > 4 ? y.unshift(a) : r ? l ? o = a : d[v] = a : i = a) : typeof a != "object" || a === null ? le("Object expected") : (Pe(c = a.get) && (d.get = c), Pe(c = a.set) && (d.set = c), Pe(c = a.init) && y.unshift(c));
|
|
2058
|
+
return r || Vc(e, i), d && ti(i, n, d), l ? r ^ 4 ? o : d : i;
|
|
2059
|
+
}, ke = (e, t, n) => No(e, typeof t != "symbol" ? t + "" : t, n), ei = (e, t, n) => t.has(e) || le("Cannot " + n), Gc = (e, t) => Object(t) !== t ? le('Cannot use the "in" operator on this value') : e.has(t), us = (e, t, n) => (ei(e, t, "read from private field"), n ? n.call(e) : t.get(e)), jn = (e, t, n) => t.has(e) ? le("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Bi = (e, t, n, s) => (ei(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n), Dc = (e, t, n) => (ei(e, t, "access private method"), n), Io, Ro, Ho, Wo, zo, ds, Vo, L, ni, ps, si;
|
|
2060
|
+
let Ki = 0;
|
|
2061
|
+
const ji = (e) => {
|
|
2062
|
+
clearTimeout(Ki), Ki = window.setTimeout(() => document.title = e);
|
|
1876
2063
|
};
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
}
|
|
1884
|
-
ct(qt, fn);
|
|
1885
|
-
const dr = `${de} | `, fr = ` - ${de}`, ht = class pn extends R {
|
|
2064
|
+
function Fc(e, t = "", n = "") {
|
|
2065
|
+
const s = At.title || e;
|
|
2066
|
+
s && s !== At.defaultTitle ? (xe.title = s, ji(t + xe.title + n)) : (xe.title = At.defaultTitle, ji(xe.title));
|
|
2067
|
+
}
|
|
2068
|
+
Vo = [Ht()];
|
|
2069
|
+
let bt = class Go extends (ds = B, zo = [G], Wo = [G], Ho = [On], Ro = [$t((t) => [t.inert])], Io = [qe()], ds) {
|
|
1886
2070
|
constructor() {
|
|
1887
|
-
super(), this.
|
|
1888
|
-
this.
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
)
|
|
1892
|
-
}, new MutationObserver(() => this.update()).observe(this, {
|
|
1893
|
-
characterData: !0,
|
|
1894
|
-
childList: !0,
|
|
1895
|
-
subtree: !0
|
|
2071
|
+
super(...arguments), ke(this, "prefix", tt(L, 8, this)), tt(L, 11, this), ke(this, "suffix", tt(L, 12, this)), tt(L, 15, this), ke(this, "inert", tt(L, 16, this)), tt(L, 19, this), jn(this, ni, tt(L, 20, this, () => !this.inert && pt(At, this.update))), tt(L, 23, this), jn(this, ps, new MutationObserver(() => this.update())), jn(this, si, tt(L, 24, this, () => {
|
|
2072
|
+
us(this, ps).observe(this, { characterData: !0, childList: !0, subtree: !0 });
|
|
2073
|
+
})), tt(L, 27, this), ke(this, "render", () => {
|
|
2074
|
+
var t;
|
|
2075
|
+
return Fc((t = this.textContent) == null ? void 0 : t.trim(), this.prefix, this.suffix), at`${Go.title}`;
|
|
1896
2076
|
});
|
|
1897
2077
|
}
|
|
1898
2078
|
static setTitle(t) {
|
|
1899
|
-
|
|
1900
|
-
}
|
|
1901
|
-
render() {
|
|
1902
|
-
var t;
|
|
1903
|
-
return fn((t = this.textContent) == null ? void 0 : t.trim(), this.prefix, this.suffix), j`${pn.title}`;
|
|
2079
|
+
It(At, { title: t });
|
|
1904
2080
|
}
|
|
1905
2081
|
};
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
let
|
|
1919
|
-
customElements.define("gem-title",
|
|
1920
|
-
var
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
var
|
|
1927
|
-
|
|
2082
|
+
L = Wc(ds);
|
|
2083
|
+
ni = /* @__PURE__ */ new WeakMap();
|
|
2084
|
+
ps = /* @__PURE__ */ new WeakMap();
|
|
2085
|
+
si = /* @__PURE__ */ new WeakMap();
|
|
2086
|
+
he(L, 5, "prefix", zo, bt);
|
|
2087
|
+
he(L, 5, "suffix", Wo, bt);
|
|
2088
|
+
he(L, 5, "inert", Ho, bt);
|
|
2089
|
+
he(L, 21, "#connectStore", Ro, ni);
|
|
2090
|
+
he(L, 21, "#obTextContent", Io, si);
|
|
2091
|
+
bt = he(L, 0, "GemTitleElement", Vo, bt);
|
|
2092
|
+
ke(bt, "title", document.title);
|
|
2093
|
+
tt(L, 1, bt);
|
|
2094
|
+
let xe = bt;
|
|
2095
|
+
customElements.define("gem-title", xe);
|
|
2096
|
+
var qc = Object.create, ii = Object.defineProperty, Uc = Object.getOwnPropertyDescriptor, Do = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), ue = (e) => {
|
|
2097
|
+
throw TypeError(e);
|
|
2098
|
+
}, Fo = (e, t, n) => t in e ? ii(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ji = (e, t) => ii(e, "name", { value: t, configurable: !0 }), Bc = (e) => [, , , qc((e == null ? void 0 : e[Do("metadata")]) ?? null)], qo = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Te = (e) => e !== void 0 && typeof e != "function" ? ue("Function expected") : e, Kc = (e, t, n, s, i) => ({ kind: qo[e], name: t, metadata: s, addInitializer: (o) => n._ ? ue("Already initialized") : i.push(Te(o || null)) }), jc = (e, t) => Fo(t, Do("metadata"), e[3]), ct = (e, t, n, s) => {
|
|
2099
|
+
for (var i = 0, o = e[t >> 1], c = o && o.length; i < c; i++) t & 1 ? o[i].call(n) : s = o[i].call(n, s);
|
|
2100
|
+
return s;
|
|
2101
|
+
}, Ze = (e, t, n, s, i, o) => {
|
|
2102
|
+
var c, a, f, h, m, r = t & 7, _ = !!(t & 8), l = !!(t & 16), g = r > 3 ? e.length + 1 : r ? _ ? 1 : 2 : 0, v = qo[r + 5], y = r > 3 && (e[g - 1] = []), $ = e[g] || (e[g] = []), d = r && (!l && !_ && (i = i.prototype), r < 5 && (r > 3 || !l) && Uc(r < 4 ? i : { get [n]() {
|
|
2103
|
+
return fs(this, o);
|
|
2104
|
+
}, set [n](u) {
|
|
2105
|
+
return Yi(this, o, u);
|
|
2106
|
+
} }, n));
|
|
2107
|
+
r ? l && r < 4 && Ji(o, (r > 2 ? "set " : r > 1 ? "get " : "") + n) : Ji(i, n);
|
|
2108
|
+
for (var S = s.length - 1; S >= 0; S--)
|
|
2109
|
+
h = Kc(r, n, f = {}, e[3], $), r && (h.static = _, h.private = l, m = h.access = { has: l ? (u) => Jc(i, u) : (u) => n in u }, r ^ 3 && (m.get = l ? (u) => (r ^ 1 ? fs : Qc)(u, i, r ^ 4 ? o : d.get) : (u) => u[n]), r > 2 && (m.set = l ? (u, k) => Yi(u, i, k, r ^ 4 ? o : d.set) : (u, k) => u[n] = k)), a = (0, s[S])(r ? r < 4 ? l ? o : d[v] : r > 4 ? void 0 : { get: d.get, set: d.set } : i, h), f._ = 1, r ^ 4 || a === void 0 ? Te(a) && (r > 4 ? y.unshift(a) : r ? l ? o = a : d[v] = a : i = a) : typeof a != "object" || a === null ? ue("Object expected") : (Te(c = a.get) && (d.get = c), Te(c = a.set) && (d.set = c), Te(c = a.init) && y.unshift(c));
|
|
2110
|
+
return r || jc(e, i), d && ii(i, n, d), l ? r ^ 4 ? o : d : i;
|
|
2111
|
+
}, en = (e, t, n) => Fo(e, typeof t != "symbol" ? t + "" : t, n), ri = (e, t, n) => t.has(e) || ue("Cannot " + n), Jc = (e, t) => Object(t) !== t ? ue('Cannot use the "in" operator on this value') : e.has(t), fs = (e, t, n) => (ri(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Yc = (e, t, n) => t.has(e) ? ue("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Yi = (e, t, n, s) => (ri(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n), Qc = (e, t, n) => (ri(e, t, "access private method"), n), Uo, Bo, Ko, jo, _s, Jo, V, gs;
|
|
2112
|
+
const Xc = kn(yr`
|
|
2113
|
+
:host(:where(:not([hidden]))) {
|
|
2114
|
+
position: relative;
|
|
2115
|
+
display: inline-flex;
|
|
2116
|
+
align-items: center;
|
|
2117
|
+
}
|
|
2118
|
+
svg {
|
|
2119
|
+
width: 100%;
|
|
2120
|
+
height: 100%;
|
|
2121
|
+
}
|
|
2122
|
+
`), Qi = /* @__PURE__ */ new Map();
|
|
2123
|
+
Jo = [Ht(), Hs(Xc)];
|
|
2124
|
+
class Ct extends (_s = B, jo = [G], Ko = [U], Bo = [U], Uo = [Ln], _s) {
|
|
1928
2125
|
constructor() {
|
|
1929
|
-
super(...arguments)
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
return n || (n = document.createElement("template"), n.innerHTML = e, Rs.set(e, n)), n.content.cloneNode(!0);
|
|
1936
|
-
} else
|
|
1937
|
-
return e instanceof HTMLTemplateElement ? e.content.cloneNode(!0) : e == null ? void 0 : e.cloneNode(!0);
|
|
2126
|
+
super(...arguments), en(this, "selector", ct(V, 8, this)), ct(V, 11, this), en(this, "root", ct(V, 12, this)), ct(V, 15, this), en(this, "element", ct(V, 16, this)), ct(V, 19, this), en(this, "active", ct(V, 20, this)), ct(V, 23, this), Yc(this, gs, () => {
|
|
2127
|
+
const t = this.element || (this.selector ? (this.root || document).querySelector(this.selector) : null);
|
|
2128
|
+
if (typeof t == "string") {
|
|
2129
|
+
let n = Qi.get(t);
|
|
2130
|
+
return n || (n = document.createElement("template"), n.innerHTML = t, Qi.set(t, n)), n.content.cloneNode(!0);
|
|
2131
|
+
} else return t instanceof HTMLTemplateElement ? t.content.cloneNode(!0) : t == null ? void 0 : t.cloneNode(!0);
|
|
1938
2132
|
});
|
|
1939
2133
|
}
|
|
1940
2134
|
render() {
|
|
1941
|
-
return
|
|
1942
|
-
|
|
1943
|
-
:host(:where(:not([hidden]))) {
|
|
1944
|
-
position: relative;
|
|
1945
|
-
display: inline-flex;
|
|
1946
|
-
align-items: center;
|
|
1947
|
-
}
|
|
1948
|
-
svg {
|
|
1949
|
-
width: 100%;
|
|
1950
|
-
height: 100%;
|
|
1951
|
-
}
|
|
1952
|
-
</style>
|
|
1953
|
-
${y(this, Gt).call(this)}
|
|
2135
|
+
return at`
|
|
2136
|
+
${fs(this, gs).call(this)}
|
|
1954
2137
|
<slot></slot>
|
|
1955
2138
|
`;
|
|
1956
2139
|
}
|
|
1957
2140
|
}
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
],
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
2141
|
+
V = Bc(_s);
|
|
2142
|
+
gs = /* @__PURE__ */ new WeakMap();
|
|
2143
|
+
Ze(V, 5, "selector", jo, Ct);
|
|
2144
|
+
Ze(V, 5, "root", Ko, Ct);
|
|
2145
|
+
Ze(V, 5, "element", Bo, Ct);
|
|
2146
|
+
Ze(V, 5, "active", Uo, Ct);
|
|
2147
|
+
Ct = Ze(V, 0, "GemUseElement", Jo, Ct);
|
|
2148
|
+
ct(V, 1, Ct);
|
|
2149
|
+
customElements.define("gem-use", Ct);
|
|
2150
|
+
var Zc = Object.create, oi = Object.defineProperty, tl = Object.getOwnPropertyDescriptor, Yo = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), tn = (e) => {
|
|
2151
|
+
throw TypeError(e);
|
|
2152
|
+
}, Qo = (e, t, n) => t in e ? oi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Xi = (e, t) => oi(e, "name", { value: t, configurable: !0 }), el = (e) => [, , , Zc((e == null ? void 0 : e[Yo("metadata")]) ?? null)], Xo = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Oe = (e) => e !== void 0 && typeof e != "function" ? tn("Function expected") : e, nl = (e, t, n, s, i) => ({ kind: Xo[e], name: t, metadata: s, addInitializer: (o) => n._ ? tn("Already initialized") : i.push(Oe(o || null)) }), sl = (e, t) => Qo(t, Yo("metadata"), e[3]), Me = (e, t, n, s) => {
|
|
2153
|
+
for (var i = 0, o = e[t >> 1], c = o && o.length; i < c; i++) t & 1 ? o[i].call(n) : s = o[i].call(n, s);
|
|
2154
|
+
return s;
|
|
2155
|
+
}, ai = (e, t, n, s, i, o) => {
|
|
2156
|
+
var c, a, f, h, m, r = t & 7, _ = !!(t & 8), l = !!(t & 16), g = r > 3 ? e.length + 1 : r ? _ ? 1 : 2 : 0, v = Xo[r + 5], y = r > 3 && (e[g - 1] = []), $ = e[g] || (e[g] = []), d = r && (!l && !_ && (i = i.prototype), r < 5 && (r > 3 || !l) && tl(r < 4 ? i : { get [n]() {
|
|
2157
|
+
return tr(this, o);
|
|
2158
|
+
}, set [n](u) {
|
|
2159
|
+
return er(this, o, u);
|
|
2160
|
+
} }, n));
|
|
2161
|
+
r ? l && r < 4 && Xi(o, (r > 2 ? "set " : r > 1 ? "get " : "") + n) : Xi(i, n);
|
|
2162
|
+
for (var S = s.length - 1; S >= 0; S--)
|
|
2163
|
+
h = nl(r, n, f = {}, e[3], $), r && (h.static = _, h.private = l, m = h.access = { has: l ? (u) => il(i, u) : (u) => n in u }, r ^ 3 && (m.get = l ? (u) => (r ^ 1 ? tr : rl)(u, i, r ^ 4 ? o : d.get) : (u) => u[n]), r > 2 && (m.set = l ? (u, k) => er(u, i, k, r ^ 4 ? o : d.set) : (u, k) => u[n] = k)), a = (0, s[S])(r ? r < 4 ? l ? o : d[v] : r > 4 ? void 0 : { get: d.get, set: d.set } : i, h), f._ = 1, r ^ 4 || a === void 0 ? Oe(a) && (r > 4 ? y.unshift(a) : r ? l ? o = a : d[v] = a : i = a) : typeof a != "object" || a === null ? tn("Object expected") : (Oe(c = a.get) && (d.get = c), Oe(c = a.set) && (d.set = c), Oe(c = a.init) && y.unshift(c));
|
|
2164
|
+
return r || sl(e, i), d && oi(i, n, d), l ? r ^ 4 ? o : d : i;
|
|
2165
|
+
}, Zi = (e, t, n) => Qo(e, typeof t != "symbol" ? t + "" : t, n), ci = (e, t, n) => t.has(e) || tn("Cannot " + n), il = (e, t) => Object(t) !== t ? tn('Cannot use the "in" operator on this value') : e.has(t), tr = (e, t, n) => (ci(e, t, "read from private field"), n ? n.call(e) : t.get(e)), er = (e, t, n, s) => (ci(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n), rl = (e, t, n) => (ci(e, t, "access private method"), n), Zo, ta, ms, ea, dt;
|
|
2166
|
+
ea = [Ht()];
|
|
2167
|
+
class ie extends (ms = B, ta = [G], Zo = [G], ms) {
|
|
1978
2168
|
constructor() {
|
|
1979
|
-
super(), this
|
|
1980
|
-
() => {
|
|
1981
|
-
this.shadowRoot && (this.shadowRoot.innerHTML = `
|
|
1982
|
-
<style>
|
|
1983
|
-
:host(:where(:not([hidden]))) {
|
|
1984
|
-
display: contents;
|
|
1985
|
-
}
|
|
1986
|
-
${this.contentcss}
|
|
1987
|
-
</style>
|
|
1988
|
-
${this.content}
|
|
1989
|
-
`);
|
|
1990
|
-
},
|
|
1991
|
-
() => [this.content, this.contentcss]
|
|
1992
|
-
);
|
|
2169
|
+
super(...arguments), Zi(this, "content", Me(dt, 8, this)), Me(dt, 11, this), Zi(this, "contentcss", Me(dt, 12, this)), Me(dt, 15, this);
|
|
1993
2170
|
}
|
|
1994
2171
|
render() {
|
|
2172
|
+
this.shadowRoot.innerHTML = xs`
|
|
2173
|
+
<style>
|
|
2174
|
+
:host(:where(:not([hidden]))) {
|
|
2175
|
+
display: contents;
|
|
2176
|
+
}
|
|
2177
|
+
${this.contentcss}
|
|
2178
|
+
</style>
|
|
2179
|
+
${this.content}
|
|
2180
|
+
`;
|
|
1995
2181
|
}
|
|
1996
2182
|
}
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
return
|
|
2008
|
-
}
|
|
2009
|
-
|
|
2183
|
+
dt = el(ms);
|
|
2184
|
+
ai(dt, 5, "content", ta, ie);
|
|
2185
|
+
ai(dt, 5, "contentcss", Zo, ie);
|
|
2186
|
+
ie = ai(dt, 0, "GemUnsafeElement", ea, ie);
|
|
2187
|
+
Me(dt, 1, ie);
|
|
2188
|
+
customElements.define("gem-unsafe", ie);
|
|
2189
|
+
var ol = Object.create, li = Object.defineProperty, al = Object.getOwnPropertyDescriptor, na = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), de = (e) => {
|
|
2190
|
+
throw TypeError(e);
|
|
2191
|
+
}, sa = (e, t, n) => t in e ? li(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, nr = (e, t) => li(e, "name", { value: t, configurable: !0 }), cl = (e) => [, , , ol((e == null ? void 0 : e[na("metadata")]) ?? null)], ia = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Le = (e) => e !== void 0 && typeof e != "function" ? de("Function expected") : e, ll = (e, t, n, s, i) => ({ kind: ia[e], name: t, metadata: s, addInitializer: (o) => n._ ? de("Already initialized") : i.push(Le(o || null)) }), ra = (e, t) => sa(t, na("metadata"), e[3]), ft = (e, t, n, s) => {
|
|
2192
|
+
for (var i = 0, o = e[t >> 1], c = o && o.length; i < c; i++) t & 1 ? o[i].call(n) : s = o[i].call(n, s);
|
|
2193
|
+
return s;
|
|
2194
|
+
}, In = (e, t, n, s, i, o) => {
|
|
2195
|
+
var c, a, f, h, m, r = t & 7, _ = !!(t & 8), l = !!(t & 16), g = r > 3 ? e.length + 1 : r ? _ ? 1 : 2 : 0, v = ia[r + 5], y = r > 3 && (e[g - 1] = []), $ = e[g] || (e[g] = []), d = r && (!l && !_ && (i = i.prototype), r < 5 && (r > 3 || !l) && al(r < 4 ? i : { get [n]() {
|
|
2196
|
+
return gt(this, o);
|
|
2197
|
+
}, set [n](u) {
|
|
2198
|
+
return vs(this, o, u);
|
|
2199
|
+
} }, n));
|
|
2200
|
+
r ? l && r < 4 && nr(o, (r > 2 ? "set " : r > 1 ? "get " : "") + n) : nr(i, n);
|
|
2201
|
+
for (var S = s.length - 1; S >= 0; S--)
|
|
2202
|
+
h = ll(r, n, f = {}, e[3], $), r && (h.static = _, h.private = l, m = h.access = { has: l ? (u) => hl(i, u) : (u) => n in u }, r ^ 3 && (m.get = l ? (u) => (r ^ 1 ? gt : ul)(u, i, r ^ 4 ? o : d.get) : (u) => u[n]), r > 2 && (m.set = l ? (u, k) => vs(u, i, k, r ^ 4 ? o : d.set) : (u, k) => u[n] = k)), a = (0, s[S])(r ? r < 4 ? l ? o : d[v] : r > 4 ? void 0 : { get: d.get, set: d.set } : i, h), f._ = 1, r ^ 4 || a === void 0 ? Le(a) && (r > 4 ? y.unshift(a) : r ? l ? o = a : d[v] = a : i = a) : typeof a != "object" || a === null ? de("Object expected") : (Le(c = a.get) && (d.get = c), Le(c = a.set) && (d.set = c), Le(c = a.init) && y.unshift(c));
|
|
2203
|
+
return r || ra(e, i), d && li(i, n, d), l ? r ^ 4 ? o : d : i;
|
|
2204
|
+
}, sr = (e, t, n) => sa(e, typeof t != "symbol" ? t + "" : t, n), hi = (e, t, n) => t.has(e) || de("Cannot " + n), hl = (e, t) => Object(t) !== t ? de('Cannot use the "in" operator on this value') : e.has(t), gt = (e, t, n) => (hi(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Wt = (e, t, n) => t.has(e) ? de("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), vs = (e, t, n, s) => (hi(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n), ul = (e, t, n) => (hi(e, t, "access private method"), n), oa, aa, ca, la, ws, F, ys, ha, ui, cn, Ss, Ne, di;
|
|
2205
|
+
const dl = "gem-reflect-start", ua = "gem-reflect-end", ir = (e) => new Comment(e), pl = (e) => {
|
|
2010
2206
|
const t = [];
|
|
2011
|
-
let
|
|
2012
|
-
for (;
|
|
2013
|
-
|
|
2207
|
+
let n = e;
|
|
2208
|
+
for (; n && (t.push(n), n.nodeValue !== ua); )
|
|
2209
|
+
n = n.nextSibling;
|
|
2014
2210
|
return t;
|
|
2015
2211
|
};
|
|
2016
|
-
|
|
2017
|
-
class fs extends R {
|
|
2212
|
+
class Rn extends (ws = B, la = [G], ca = [U], aa = [Mn()], oa = [$t((t) => [t.target])], ws) {
|
|
2018
2213
|
constructor() {
|
|
2019
|
-
super(
|
|
2020
|
-
|
|
2021
|
-
this
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
() =>
|
|
2026
|
-
);
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
c ? c.after(i) : this.target[y(this, ge, wn)](i);
|
|
2033
|
-
}), () => {
|
|
2034
|
-
r = Sr(e), r.forEach((i) => i.remove());
|
|
2035
|
-
}),
|
|
2036
|
-
() => [this.target]
|
|
2037
|
-
);
|
|
2038
|
-
}
|
|
2039
|
-
}
|
|
2040
|
-
ge = new WeakSet(), wn = function() {
|
|
2214
|
+
super(...arguments), Wt(this, ys), sr(this, "method", ft(F, 8, this)), ft(F, 11, this), sr(this, "target", ft(F, 12, this, document.head)), ft(F, 15, this), Wt(this, ui, ft(F, 16, this, () => {
|
|
2215
|
+
this.hidden = !0, this.dataset.gemReflect = "";
|
|
2216
|
+
})), ft(F, 19, this), Wt(this, cn, ir(dl)), Wt(this, Ss, ir(ua)), Wt(this, Ne), Wt(this, di, ft(F, 20, this, () => ((gt(this, Ne) || [gt(this, cn), ...this.childNodes, gt(this, Ss)]).forEach((t, n, s) => {
|
|
2217
|
+
const i = s[n - 1];
|
|
2218
|
+
i ? i.after(t) : this.target[gt(this, ys, ha)](t);
|
|
2219
|
+
}), () => {
|
|
2220
|
+
vs(this, Ne, pl(gt(this, cn))), gt(this, Ne).forEach((t) => t.remove());
|
|
2221
|
+
}))), ft(F, 23, this);
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
F = cl(ws);
|
|
2225
|
+
ys = /* @__PURE__ */ new WeakSet();
|
|
2226
|
+
ha = function() {
|
|
2041
2227
|
return this.method || "append";
|
|
2042
2228
|
};
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2229
|
+
ui = /* @__PURE__ */ new WeakMap();
|
|
2230
|
+
cn = /* @__PURE__ */ new WeakMap();
|
|
2231
|
+
Ss = /* @__PURE__ */ new WeakMap();
|
|
2232
|
+
Ne = /* @__PURE__ */ new WeakMap();
|
|
2233
|
+
di = /* @__PURE__ */ new WeakMap();
|
|
2234
|
+
In(F, 5, "method", la, Rn);
|
|
2235
|
+
In(F, 5, "target", ca, Rn);
|
|
2236
|
+
In(F, 21, "#init", aa, ui);
|
|
2237
|
+
In(F, 21, "#changeTarget", oa, di);
|
|
2238
|
+
ra(F, Rn);
|
|
2239
|
+
customElements.define("gem-reflect", Rn);
|
|
2240
|
+
var fl = Object.create, pi = Object.defineProperty, _l = Object.getOwnPropertyDescriptor, da = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), pe = (e) => {
|
|
2241
|
+
throw TypeError(e);
|
|
2242
|
+
}, pa = (e, t, n) => t in e ? pi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, rr = (e, t) => pi(e, "name", { value: t, configurable: !0 }), gl = (e) => [, , , fl((e == null ? void 0 : e[da("metadata")]) ?? null)], fa = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Ae = (e) => e !== void 0 && typeof e != "function" ? pe("Function expected") : e, ml = (e, t, n, s, i) => ({ kind: fa[e], name: t, metadata: s, addInitializer: (o) => n._ ? pe("Already initialized") : i.push(Ae(o || null)) }), vl = (e, t) => pa(t, da("metadata"), e[3]), ge = (e, t, n, s) => {
|
|
2243
|
+
for (var i = 0, o = e[t >> 1], c = o && o.length; i < c; i++) t & 1 ? o[i].call(n) : s = o[i].call(n, s);
|
|
2244
|
+
return s;
|
|
2245
|
+
}, Jn = (e, t, n, s, i, o) => {
|
|
2246
|
+
var c, a, f, h, m, r = t & 7, _ = !!(t & 8), l = !!(t & 16), g = r > 3 ? e.length + 1 : r ? _ ? 1 : 2 : 0, v = fa[r + 5], y = r > 3 && (e[g - 1] = []), $ = e[g] || (e[g] = []), d = r && (!l && !_ && (i = i.prototype), r < 5 && (r > 3 || !l) && _l(r < 4 ? i : { get [n]() {
|
|
2247
|
+
return or(this, o);
|
|
2248
|
+
}, set [n](u) {
|
|
2249
|
+
return cr(this, o, u);
|
|
2250
|
+
} }, n));
|
|
2251
|
+
r ? l && r < 4 && rr(o, (r > 2 ? "set " : r > 1 ? "get " : "") + n) : rr(i, n);
|
|
2252
|
+
for (var S = s.length - 1; S >= 0; S--)
|
|
2253
|
+
h = ml(r, n, f = {}, e[3], $), r && (h.static = _, h.private = l, m = h.access = { has: l ? (u) => wl(i, u) : (u) => n in u }, r ^ 3 && (m.get = l ? (u) => (r ^ 1 ? or : yl)(u, i, r ^ 4 ? o : d.get) : (u) => u[n]), r > 2 && (m.set = l ? (u, k) => cr(u, i, k, r ^ 4 ? o : d.set) : (u, k) => u[n] = k)), a = (0, s[S])(r ? r < 4 ? l ? o : d[v] : r > 4 ? void 0 : { get: d.get, set: d.set } : i, h), f._ = 1, r ^ 4 || a === void 0 ? Ae(a) && (r > 4 ? y.unshift(a) : r ? l ? o = a : d[v] = a : i = a) : typeof a != "object" || a === null ? pe("Object expected") : (Ae(c = a.get) && (d.get = c), Ae(c = a.set) && (d.set = c), Ae(c = a.init) && y.unshift(c));
|
|
2254
|
+
return r || vl(e, i), d && pi(i, n, d), l ? r ^ 4 ? o : d : i;
|
|
2255
|
+
}, nn = (e, t, n) => pa(e, typeof t != "symbol" ? t + "" : t, n), fi = (e, t, n) => t.has(e) || pe("Cannot " + n), wl = (e, t) => Object(t) !== t ? pe('Cannot use the "in" operator on this value') : e.has(t), or = (e, t, n) => (fi(e, t, "read from private field"), n ? n.call(e) : t.get(e)), ar = (e, t, n) => t.has(e) ? pe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), cr = (e, t, n, s) => (fi(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n), yl = (e, t, n) => (fi(e, t, "access private method"), n);
|
|
2256
|
+
const sn = Symbol("open mark");
|
|
2257
|
+
function Ul(e) {
|
|
2258
|
+
var t, n, s, i, o, c, a;
|
|
2259
|
+
const f = Symbol();
|
|
2260
|
+
i = [Ht(), An({ role: "alertdialog", ariaModal: "true" })];
|
|
2261
|
+
let h = class _a extends (s = B, n = [qe()], t = [qe()], s) {
|
|
2055
2262
|
constructor() {
|
|
2056
|
-
super(), this
|
|
2263
|
+
super(...arguments), nn(this, "label", ""), ar(this, c, ge(o, 8, this, () => pt(O.store, this.update))), ge(o, 11, this), ar(this, a, ge(o, 12, this, () => pt(_a.store, this.update))), ge(o, 15, this);
|
|
2057
2264
|
}
|
|
2058
2265
|
/**@final */
|
|
2059
2266
|
static get isOpen() {
|
|
2060
|
-
return this.store[
|
|
2061
|
-
}
|
|
2062
|
-
/**@final */
|
|
2063
|
-
static get observedStores() {
|
|
2064
|
-
return [v.store, this.store];
|
|
2267
|
+
return this.store[sn];
|
|
2065
2268
|
}
|
|
2066
2269
|
/**
|
|
2067
2270
|
* @final
|
|
2068
2271
|
* 自带 100ms 延迟,以允许在其他 Dialog 的 `shouldClose` 中调用此方法;
|
|
2069
2272
|
* 浏览器 history 为异步 API,需要设置较长延迟;
|
|
2070
2273
|
*/
|
|
2071
|
-
static open(
|
|
2072
|
-
const
|
|
2073
|
-
this.instance =
|
|
2074
|
-
const
|
|
2274
|
+
static open(_) {
|
|
2275
|
+
const l = new this();
|
|
2276
|
+
this.instance = l, this.inertStore = [...document.body.children].filter((v) => !v.inert), this.inertStore.forEach((v) => v.inert = !0), document.body.append(l);
|
|
2277
|
+
const g = () => It(this.store, { [sn]: !0, ..._ });
|
|
2075
2278
|
return setTimeout(() => {
|
|
2076
|
-
|
|
2077
|
-
title:
|
|
2078
|
-
open:
|
|
2279
|
+
g(), O.push({
|
|
2280
|
+
title: l.label,
|
|
2281
|
+
open: g,
|
|
2079
2282
|
close: this.closeHandle.bind(this),
|
|
2080
2283
|
shouldClose: this.shouldClose.bind(this)
|
|
2081
2284
|
});
|
|
2082
|
-
}, 100),
|
|
2285
|
+
}, 100), f;
|
|
2083
2286
|
}
|
|
2084
2287
|
/**
|
|
2085
2288
|
* @final
|
|
2086
2289
|
* UI 中执行关闭
|
|
2087
2290
|
*/
|
|
2088
2291
|
static close() {
|
|
2089
|
-
return
|
|
2292
|
+
return O.back(), f;
|
|
2090
2293
|
}
|
|
2091
2294
|
/**
|
|
2092
2295
|
* @final
|
|
2093
2296
|
* history 中自动调用
|
|
2094
2297
|
*/
|
|
2095
2298
|
static closeHandle() {
|
|
2096
|
-
var
|
|
2097
|
-
return this.inertStore.forEach((
|
|
2299
|
+
var _;
|
|
2300
|
+
return this.inertStore.forEach((l) => l.inert = !1), (_ = this.instance) == null || _.remove(), It(this.store, { [sn]: !1, ...e }), f;
|
|
2098
2301
|
}
|
|
2099
2302
|
/**
|
|
2100
2303
|
* 由于要操作浏览器历史记录,所以没有设计为 Promise;
|
|
@@ -2102,194 +2305,184 @@ function Qr(s) {
|
|
|
2102
2305
|
static shouldClose() {
|
|
2103
2306
|
return !0;
|
|
2104
2307
|
}
|
|
2105
|
-
}
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
}
|
|
2114
|
-
var
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
}
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2308
|
+
};
|
|
2309
|
+
return o = gl(s), c = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), Jn(o, 21, "#connectHistory", n, c), Jn(o, 21, "#connectStore", t, a), h = Jn(o, 0, "ModalElement", i, h), nn(h, "inertStore", []), nn(h, "instance", null), nn(h, "store", bn({
|
|
2310
|
+
[sn]: !1,
|
|
2311
|
+
...e
|
|
2312
|
+
})), ge(o, 1, h), h;
|
|
2313
|
+
}
|
|
2314
|
+
var Sl = Object.create, _i = Object.defineProperty, $l = Object.getOwnPropertyDescriptor, ga = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), fe = (e) => {
|
|
2315
|
+
throw TypeError(e);
|
|
2316
|
+
}, ma = (e, t, n) => t in e ? _i(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, lr = (e, t) => _i(e, "name", { value: t, configurable: !0 }), El = (e) => [, , , Sl((e == null ? void 0 : e[ga("metadata")]) ?? null)], va = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Ie = (e) => e !== void 0 && typeof e != "function" ? fe("Function expected") : e, bl = (e, t, n, s, i) => ({ kind: va[e], name: t, metadata: s, addInitializer: (o) => n._ ? fe("Already initialized") : i.push(Ie(o || null)) }), Cl = (e, t) => ma(t, ga("metadata"), e[3]), Tt = (e, t, n, s) => {
|
|
2317
|
+
for (var i = 0, o = e[t >> 1], c = o && o.length; i < c; i++) t & 1 ? o[i].call(n) : s = o[i].call(n, s);
|
|
2318
|
+
return s;
|
|
2319
|
+
}, Hn = (e, t, n, s, i, o) => {
|
|
2320
|
+
var c, a, f, h, m, r = t & 7, _ = !!(t & 8), l = !!(t & 16), g = r > 3 ? e.length + 1 : r ? _ ? 1 : 2 : 0, v = va[r + 5], y = r > 3 && (e[g - 1] = []), $ = e[g] || (e[g] = []), d = r && (!l && !_ && (i = i.prototype), r < 5 && (r > 3 || !l) && $l(r < 4 ? i : { get [n]() {
|
|
2321
|
+
return et(this, o);
|
|
2322
|
+
}, set [n](u) {
|
|
2323
|
+
return Ve(this, o, u);
|
|
2324
|
+
} }, n));
|
|
2325
|
+
r ? l && r < 4 && lr(o, (r > 2 ? "set " : r > 1 ? "get " : "") + n) : lr(i, n);
|
|
2326
|
+
for (var S = s.length - 1; S >= 0; S--)
|
|
2327
|
+
h = bl(r, n, f = {}, e[3], $), r && (h.static = _, h.private = l, m = h.access = { has: l ? (u) => Pl(i, u) : (u) => n in u }, r ^ 3 && (m.get = l ? (u) => (r ^ 1 ? et : kl)(u, i, r ^ 4 ? o : d.get) : (u) => u[n]), r > 2 && (m.set = l ? (u, k) => Ve(u, i, k, r ^ 4 ? o : d.set) : (u, k) => u[n] = k)), a = (0, s[S])(r ? r < 4 ? l ? o : d[v] : r > 4 ? void 0 : { get: d.get, set: d.set } : i, h), f._ = 1, r ^ 4 || a === void 0 ? Ie(a) && (r > 4 ? y.unshift(a) : r ? l ? o = a : d[v] = a : i = a) : typeof a != "object" || a === null ? fe("Object expected") : (Ie(c = a.get) && (d.get = c), Ie(c = a.set) && (d.set = c), Ie(c = a.init) && y.unshift(c));
|
|
2328
|
+
return r || Cl(e, i), d && _i(i, n, d), l ? r ^ 4 ? o : d : i;
|
|
2329
|
+
}, me = (e, t, n) => ma(e, typeof t != "symbol" ? t + "" : t, n), gi = (e, t, n) => t.has(e) || fe("Cannot " + n), Pl = (e, t) => Object(t) !== t ? fe('Cannot use the "in" operator on this value') : e.has(t), et = (e, t, n) => (gi(e, t, "read from private field"), n ? n.call(e) : t.get(e)), zt = (e, t, n) => t.has(e) ? fe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Ve = (e, t, n, s) => (gi(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n), kl = (e, t, n) => (gi(e, t, "access private method"), n), wa, ya, Sa, $s, $a, Z, Re, He, We, Es, ln, mi;
|
|
2330
|
+
const Yn = Symbol();
|
|
2331
|
+
$a = [Nn(O.store), An({ role: "dialog", ariaModal: "true" })];
|
|
2332
|
+
class Be extends ($s = B, Sa = [G], ya = [Ln], wa = [Mn()], $s) {
|
|
2128
2333
|
constructor() {
|
|
2129
|
-
super(),
|
|
2130
|
-
var
|
|
2131
|
-
|
|
2132
|
-
}
|
|
2334
|
+
super(...arguments), me(this, "label", Tt(Z, 8, this)), Tt(Z, 11, this), me(this, "opened", Tt(Z, 12, this)), Tt(Z, 15, this), zt(this, Re), zt(this, He), zt(this, We, []), zt(this, Es, () => {
|
|
2335
|
+
var t;
|
|
2336
|
+
this.inert = !0, et(this, We).forEach((n) => n.inert = !1), et(this, Re) ? et(this, Re).before(this) : et(this, He) && ((t = et(this, He)) == null || t.appendChild(this)), this.dispatchEvent(new CustomEvent("close")), this.opened = !1;
|
|
2337
|
+
}), zt(this, ln, () => {
|
|
2338
|
+
this.hidden = !1, this.inert = !1, Ve(this, Re, this.nextSibling), Ve(this, He, this.parentElement || this.getRootNode()), Ve(this, We, [...document.body.children].filter((t) => !t.inert)), et(this, We).forEach((t) => t.inert = !0), document.body.append(this), this.dispatchEvent(new CustomEvent("open")), this.opened = !0;
|
|
2339
|
+
}), zt(this, mi, Tt(Z, 16, this, () => this.inert = !0)), Tt(Z, 19, this), me(this, "open", () => {
|
|
2133
2340
|
if (!this.opened)
|
|
2134
|
-
return this.
|
|
2341
|
+
return et(this, ln).call(this), O.push({
|
|
2135
2342
|
title: this.label,
|
|
2136
|
-
open: this
|
|
2137
|
-
close: this
|
|
2343
|
+
open: et(this, ln),
|
|
2344
|
+
close: et(this, Es),
|
|
2138
2345
|
shouldClose: this.shouldClose
|
|
2139
|
-
}),
|
|
2140
|
-
}, this
|
|
2141
|
-
() => this.inert = !0,
|
|
2142
|
-
() => []
|
|
2143
|
-
), this.internals.role = "dialog", this.internals.ariaModal = "true";
|
|
2346
|
+
}), Yn;
|
|
2347
|
+
}), me(this, "close", () => (O.back(), Yn)), me(this, "forceClose", () => (this.opened = !1, setTimeout(this.close, 100), Yn));
|
|
2144
2348
|
}
|
|
2145
2349
|
shouldClose() {
|
|
2146
2350
|
return !0;
|
|
2147
2351
|
}
|
|
2148
|
-
};
|
|
2149
|
-
Ot = /* @__PURE__ */ new WeakMap();
|
|
2150
|
-
Mt = /* @__PURE__ */ new WeakMap();
|
|
2151
|
-
At = /* @__PURE__ */ new WeakMap();
|
|
2152
|
-
ps([
|
|
2153
|
-
C
|
|
2154
|
-
], fe.prototype, "label", 2);
|
|
2155
|
-
ps([
|
|
2156
|
-
os
|
|
2157
|
-
], fe.prototype, "opened", 2);
|
|
2158
|
-
fe = ps([
|
|
2159
|
-
as(v.store)
|
|
2160
|
-
], fe);
|
|
2161
|
-
const vn = /* @__PURE__ */ new WeakMap();
|
|
2162
|
-
function xr(s) {
|
|
2163
|
-
return vn.get(s);
|
|
2164
|
-
}
|
|
2165
|
-
const Sn = /* @__PURE__ */ new WeakMap();
|
|
2166
|
-
function Xr(s) {
|
|
2167
|
-
return Sn.get(s);
|
|
2168
|
-
}
|
|
2169
|
-
const En = /* @__PURE__ */ new WeakMap();
|
|
2170
|
-
function Cr(s) {
|
|
2171
|
-
const t = ve(), e = document.createElement("style"), n = Ft(s), r = {}, i = {};
|
|
2172
|
-
Sn.set(r, i), vn.set(r, n);
|
|
2173
|
-
const o = () => Object.keys(n).forEach((l) => {
|
|
2174
|
-
i[l] || (i[l] = `--${G(l)}-${t}`, r[l] = `var(${i[l]})`);
|
|
2175
|
-
});
|
|
2176
|
-
En.set(r, o), o();
|
|
2177
|
-
const a = () => `:root, :host {${Object.keys(n).reduce((l, f) => l + `${i[f]}:${n[f]};`, "")}}`, c = () => e.textContent = a();
|
|
2178
|
-
return ct(n, c), c(), (document.head || document.documentElement).append(e), r;
|
|
2179
2352
|
}
|
|
2180
|
-
|
|
2181
|
-
|
|
2353
|
+
Z = El($s);
|
|
2354
|
+
Re = /* @__PURE__ */ new WeakMap();
|
|
2355
|
+
He = /* @__PURE__ */ new WeakMap();
|
|
2356
|
+
We = /* @__PURE__ */ new WeakMap();
|
|
2357
|
+
Es = /* @__PURE__ */ new WeakMap();
|
|
2358
|
+
ln = /* @__PURE__ */ new WeakMap();
|
|
2359
|
+
mi = /* @__PURE__ */ new WeakMap();
|
|
2360
|
+
Hn(Z, 5, "label", Sa, Be);
|
|
2361
|
+
Hn(Z, 5, "opened", ya, Be);
|
|
2362
|
+
Hn(Z, 21, "#init", wa, mi);
|
|
2363
|
+
Be = Hn(Z, 0, "GemDialogBaseElement", $a, Be);
|
|
2364
|
+
Tt(Z, 1, Be);
|
|
2365
|
+
class xl {
|
|
2366
|
+
constructor(t) {
|
|
2367
|
+
T(this, "_type");
|
|
2368
|
+
T(this, "info", (...t) => {
|
|
2369
|
+
console.log(`[${this._type}]:`, ...t);
|
|
2370
|
+
});
|
|
2371
|
+
T(this, "warn", (...t) => {
|
|
2372
|
+
console.warn(`[${this._type}]:`, ...t);
|
|
2373
|
+
});
|
|
2374
|
+
T(this, "error", (...t) => {
|
|
2375
|
+
console.error(`[${this._type}]:`, ...t);
|
|
2376
|
+
});
|
|
2377
|
+
this._type = t;
|
|
2378
|
+
}
|
|
2182
2379
|
}
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2380
|
+
const Tl = new xl("GEM"), Ol = /\$\d(?:<[^>]*>)?/, Ml = /\$(\d)(<([^>]*)>)?/g, Ll = 3;
|
|
2381
|
+
function Nl(e, ...t) {
|
|
2382
|
+
const n = e.split(Ol), s = [];
|
|
2383
|
+
let i;
|
|
2384
|
+
for (; i = Ml.exec(e); ) {
|
|
2385
|
+
const o = i[Ll], c = Number(i[1]) - 1, a = t[c];
|
|
2386
|
+
s.push(typeof a == "function" ? a(o) : a);
|
|
2387
|
+
}
|
|
2388
|
+
return at(n, ...s);
|
|
2186
2389
|
}
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
console.log(`[${this._type}]:`, ...e);
|
|
2191
|
-
}, this.warn = (...e) => {
|
|
2192
|
-
console.warn(`[${this._type}]:`, ...e);
|
|
2193
|
-
}, this.error = (...e) => {
|
|
2194
|
-
console.error(`[${this._type}]:`, ...e);
|
|
2195
|
-
}, this._type = t;
|
|
2196
|
-
}
|
|
2197
|
-
}
|
|
2198
|
-
const Tr = new $r("GEM"), Lr = /\$\d(?:<[^>]*>)?/, kr = /\$(\d)(<([^>]*)>)?/g, Nr = 3;
|
|
2199
|
-
function Or(s, ...t) {
|
|
2200
|
-
const e = s.split(Lr), n = [];
|
|
2201
|
-
let r;
|
|
2202
|
-
for (; r = kr.exec(s); ) {
|
|
2203
|
-
const i = r[Nr], o = Number(r[1]) - 1, a = t[o];
|
|
2204
|
-
n.push(typeof a == "function" ? a(i) : a);
|
|
2205
|
-
}
|
|
2206
|
-
return j(e, ...n);
|
|
2207
|
-
}
|
|
2208
|
-
const bt = /* @__PURE__ */ new Set();
|
|
2209
|
-
var mt, oe, me, bn, ye, xn, at, Rt, yt, ae;
|
|
2210
|
-
const gs = class gs {
|
|
2390
|
+
const ve = /* @__PURE__ */ new Set();
|
|
2391
|
+
var M, hn, Ea, ba, ze, un;
|
|
2392
|
+
const vi = class vi {
|
|
2211
2393
|
constructor(t) {
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2394
|
+
b(this, M);
|
|
2395
|
+
T(this, "resources");
|
|
2396
|
+
T(this, "fallbackLanguage");
|
|
2397
|
+
T(this, "currentLanguage");
|
|
2398
|
+
T(this, "cache");
|
|
2399
|
+
T(this, "cachePrefix", "gem-i18n");
|
|
2400
|
+
T(this, "urlParamsType");
|
|
2401
|
+
T(this, "urlParamsName");
|
|
2402
|
+
T(this, "onChange");
|
|
2403
|
+
// 兼容 `<gem-route>`
|
|
2404
|
+
T(this, "replace", ({ path: t }) => this.setLanguage(t));
|
|
2405
|
+
T(this, "getParams", () => ({ path: this.currentLanguage }));
|
|
2406
|
+
if (!t.resources[t.fallbackLanguage])
|
|
2407
|
+
throw new yt("i18n: fallbackLanguage invalid");
|
|
2408
|
+
Object.assign(this, t);
|
|
2409
|
+
let n = p(this, M, Ea) || this.currentLanguage || p(this, M, ba);
|
|
2410
|
+
const s = document.querySelector(`[type*=${this.cachePrefix}]`);
|
|
2411
|
+
if (s)
|
|
2223
2412
|
try {
|
|
2224
|
-
const
|
|
2225
|
-
|
|
2413
|
+
const i = JSON.parse(s.textContent || "");
|
|
2414
|
+
n = i.currentLanguage, this.resources[i.currentLanguage] = i.currentLanguagePack;
|
|
2226
2415
|
} catch {
|
|
2227
2416
|
}
|
|
2228
|
-
|
|
2417
|
+
n ? (x(this, M, n, un), this.setLanguage(n)) : this.resetLanguage();
|
|
2229
2418
|
}
|
|
2230
|
-
get(t, ...
|
|
2231
|
-
const
|
|
2232
|
-
return
|
|
2419
|
+
get(t, ...n) {
|
|
2420
|
+
const s = this.resources[this.currentLanguage], i = this.resources[this.fallbackLanguage], o = s[t] || i[t], c = (o == null ? void 0 : o.message) || o || `[${t}]`;
|
|
2421
|
+
return n.length ? Nl(c, ...n) : c;
|
|
2233
2422
|
}
|
|
2234
2423
|
detectLanguage() {
|
|
2235
|
-
const t = Object.keys(this.resources),
|
|
2236
|
-
for (const
|
|
2237
|
-
const
|
|
2238
|
-
if (
|
|
2239
|
-
return r;
|
|
2424
|
+
const t = Object.keys(this.resources), n = navigator.languages.map((s) => s.replace(/-(.*)/, (i) => i.toUpperCase()));
|
|
2425
|
+
for (const s of n) {
|
|
2426
|
+
const i = t.find((o) => o === s || s.startsWith(`${o}-`));
|
|
2427
|
+
if (i) return i;
|
|
2240
2428
|
}
|
|
2241
2429
|
return this.fallbackLanguage;
|
|
2242
2430
|
}
|
|
2243
2431
|
async setLanguage(t) {
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2432
|
+
var o, c;
|
|
2433
|
+
p(this, M, ze) && ve.forEach(async (a) => await a.setLanguage(t));
|
|
2434
|
+
let n;
|
|
2435
|
+
const s = this.resources[t];
|
|
2436
|
+
if (!s)
|
|
2437
|
+
return Tl.warn(`${this.cachePrefix}: not found \`${t}\``), this.resetLanguage();
|
|
2438
|
+
if (typeof s == "string") {
|
|
2439
|
+
const a = `${this.cachePrefix}:`, f = `${a}${s}`, h = localStorage.getItem(f), m = async () => {
|
|
2440
|
+
const r = await (await fetch(s)).json();
|
|
2252
2441
|
if (this.cache) {
|
|
2253
|
-
for (let
|
|
2254
|
-
const
|
|
2255
|
-
|
|
2442
|
+
for (let _ = 0; _ < localStorage.length; _++) {
|
|
2443
|
+
const l = localStorage.key(_);
|
|
2444
|
+
l.startsWith(a) && localStorage.removeItem(l);
|
|
2256
2445
|
}
|
|
2257
|
-
localStorage.setItem(
|
|
2446
|
+
localStorage.setItem(f, JSON.stringify(r));
|
|
2258
2447
|
}
|
|
2259
|
-
return
|
|
2448
|
+
return r;
|
|
2260
2449
|
};
|
|
2261
|
-
if (
|
|
2450
|
+
if (h)
|
|
2262
2451
|
try {
|
|
2263
|
-
|
|
2452
|
+
n = JSON.parse(h);
|
|
2264
2453
|
} catch {
|
|
2265
|
-
|
|
2454
|
+
n = await m();
|
|
2266
2455
|
}
|
|
2267
2456
|
else
|
|
2268
|
-
|
|
2457
|
+
n = await m();
|
|
2269
2458
|
} else
|
|
2270
|
-
|
|
2271
|
-
|
|
2459
|
+
n = s;
|
|
2460
|
+
this.resources[t] = n;
|
|
2461
|
+
const i = [document.documentElement];
|
|
2462
|
+
for (; i.length; ) {
|
|
2463
|
+
const a = i.pop();
|
|
2464
|
+
(o = a[Cn]) == null || o.call(a), (c = a.shadowRoot) != null && c.firstElementChild && i.push(a.shadowRoot.firstElementChild), a.firstElementChild && i.push(a.firstElementChild), a.nextElementSibling && i.push(a.nextElementSibling);
|
|
2465
|
+
}
|
|
2466
|
+
return t !== this.currentLanguage && x(this, M, t, un), this.cache === !0 && this.setCache(), t;
|
|
2272
2467
|
}
|
|
2273
2468
|
resetLanguage() {
|
|
2274
|
-
return
|
|
2469
|
+
return p(this, M, ze) && ve.forEach((t) => t.resetLanguage()), x(this, M, this.fallbackLanguage, un), this.cache && localStorage.removeItem(p(this, M, hn)), this.setLanguage(this.detectLanguage());
|
|
2275
2470
|
}
|
|
2276
2471
|
// 一般用在 `onChange` 中
|
|
2277
2472
|
setCache() {
|
|
2278
|
-
|
|
2473
|
+
p(this, M, ze) && ve.forEach((t) => t.setCache()), localStorage.setItem(p(this, M, hn), this.currentLanguage);
|
|
2279
2474
|
}
|
|
2280
|
-
createSubModule(t,
|
|
2281
|
-
const
|
|
2282
|
-
resources:
|
|
2475
|
+
createSubModule(t, n) {
|
|
2476
|
+
const s = new vi({
|
|
2477
|
+
resources: n,
|
|
2283
2478
|
cachePrefix: `${this.cachePrefix}-${t}`,
|
|
2284
2479
|
currentLanguage: this.currentLanguage,
|
|
2285
2480
|
fallbackLanguage: this.fallbackLanguage,
|
|
2286
2481
|
cache: this.cache
|
|
2287
2482
|
});
|
|
2288
|
-
return
|
|
2483
|
+
return ve.add(s), s;
|
|
2289
2484
|
}
|
|
2290
2485
|
/**
|
|
2291
|
-
* prepare: @connectStore(i18n.store)
|
|
2292
|
-
*
|
|
2293
2486
|
* @example
|
|
2294
2487
|
*
|
|
2295
2488
|
* html`
|
|
@@ -2305,261 +2498,313 @@ const gs = class gs {
|
|
|
2305
2498
|
};
|
|
2306
2499
|
}
|
|
2307
2500
|
};
|
|
2308
|
-
|
|
2501
|
+
M = new WeakSet(), hn = function() {
|
|
2309
2502
|
return `${this.cachePrefix}:current`;
|
|
2310
|
-
},
|
|
2311
|
-
const { hostname: t, pathname:
|
|
2503
|
+
}, Ea = function() {
|
|
2504
|
+
const { hostname: t, pathname: n, search: s } = location, i = t.split(".");
|
|
2312
2505
|
switch (this.urlParamsType) {
|
|
2313
2506
|
case "ccTLD":
|
|
2314
|
-
return
|
|
2507
|
+
return i.pop();
|
|
2315
2508
|
case "gTLD":
|
|
2316
|
-
return
|
|
2509
|
+
return i.shift();
|
|
2317
2510
|
case "path":
|
|
2318
|
-
return
|
|
2511
|
+
return n.split("/")[1];
|
|
2319
2512
|
default:
|
|
2320
|
-
const
|
|
2321
|
-
return
|
|
2322
|
-
}
|
|
2323
|
-
},
|
|
2324
|
-
return this.cache && localStorage.getItem(
|
|
2325
|
-
},
|
|
2326
|
-
return !
|
|
2327
|
-
},
|
|
2328
|
-
var
|
|
2329
|
-
|
|
2513
|
+
const o = this.urlParamsName && new URLSearchParams(s).get(this.urlParamsName) || "";
|
|
2514
|
+
return o in this.resources ? o : "";
|
|
2515
|
+
}
|
|
2516
|
+
}, ba = function() {
|
|
2517
|
+
return this.cache && localStorage.getItem(p(this, M, hn)) || "";
|
|
2518
|
+
}, ze = function() {
|
|
2519
|
+
return !ve.has(this);
|
|
2520
|
+
}, un = function(t) {
|
|
2521
|
+
var n;
|
|
2522
|
+
p(this, M, ze) && (document.documentElement.lang = t), this.currentLanguage = t, (n = this.onChange) == null || n.call(this, t);
|
|
2330
2523
|
};
|
|
2331
|
-
let
|
|
2332
|
-
const
|
|
2333
|
-
function Ar(s = {}) {
|
|
2334
|
-
const {
|
|
2335
|
-
origin: t = location.origin,
|
|
2336
|
-
base: e = "",
|
|
2337
|
-
appendHeaders: n = () => ({}),
|
|
2338
|
-
transformInput: r = (h) => h,
|
|
2339
|
-
transformOutput: i = (h) => h,
|
|
2340
|
-
...o
|
|
2341
|
-
} = s, a = (h) => h instanceof FormData || h instanceof Blob || h instanceof Mr || h instanceof URLSearchParams || h instanceof ReadableStream || h instanceof ArrayBuffer ? h : typeof h == "object" ? JSON.stringify(h) : h, c = (h, g) => {
|
|
2342
|
-
if (new URL(h, location.origin).pathname !== h)
|
|
2343
|
-
throw new J("`path` format is incorrect");
|
|
2344
|
-
const u = new URLSearchParams(g).toString();
|
|
2345
|
-
return `${t}${e}${h}${u ? "?" : ""}${u}`;
|
|
2346
|
-
}, l = (h) => {
|
|
2347
|
-
if (!h)
|
|
2348
|
-
return {};
|
|
2349
|
-
if (h instanceof Headers)
|
|
2350
|
-
return Object.fromEntries(h);
|
|
2351
|
-
const g = Array.isArray(h) ? h : Object.entries(h);
|
|
2352
|
-
return Object.fromEntries(g.map(([u, p]) => [u.toLowerCase(), p]));
|
|
2353
|
-
}, f = async (h, g = {}) => {
|
|
2354
|
-
const u = new Request(h, {
|
|
2355
|
-
...o,
|
|
2356
|
-
...g,
|
|
2357
|
-
headers: new Headers({
|
|
2358
|
-
"content-type": "application/json",
|
|
2359
|
-
...l(o.headers),
|
|
2360
|
-
...l(g.headers)
|
|
2361
|
-
})
|
|
2362
|
-
}), p = await fetch(u);
|
|
2363
|
-
if (p.status === 0)
|
|
2364
|
-
throw new Error("Request fail");
|
|
2365
|
-
if (p.status >= 500)
|
|
2366
|
-
throw new Error(p.statusText);
|
|
2367
|
-
const m = u.headers.get("content-type"), _ = p.status >= 400;
|
|
2368
|
-
try {
|
|
2369
|
-
let w;
|
|
2370
|
-
if (m.includes("json") ? w = await p.json() : m.includes("octet-stream") ? w = await p.arrayBuffer() : w = await p.text(), _)
|
|
2371
|
-
throw new Error(p.statusText, { cause: w });
|
|
2372
|
-
return i(w, u);
|
|
2373
|
-
} catch {
|
|
2374
|
-
throw new Error("Parse error");
|
|
2375
|
-
}
|
|
2376
|
-
};
|
|
2377
|
-
return {
|
|
2378
|
-
request: f,
|
|
2379
|
-
get(h, g) {
|
|
2380
|
-
const u = r(g);
|
|
2381
|
-
return f(c(h, u), {
|
|
2382
|
-
method: "GET",
|
|
2383
|
-
headers: n(u)
|
|
2384
|
-
});
|
|
2385
|
-
},
|
|
2386
|
-
del(h, g) {
|
|
2387
|
-
const u = r(g);
|
|
2388
|
-
return f(c(h, u), {
|
|
2389
|
-
method: "DELETE",
|
|
2390
|
-
headers: n(u)
|
|
2391
|
-
});
|
|
2392
|
-
},
|
|
2393
|
-
put(h, g) {
|
|
2394
|
-
const u = r(g);
|
|
2395
|
-
return f(c(h), {
|
|
2396
|
-
method: "PUT",
|
|
2397
|
-
headers: n(u),
|
|
2398
|
-
body: a(u)
|
|
2399
|
-
});
|
|
2400
|
-
},
|
|
2401
|
-
post(h, g) {
|
|
2402
|
-
const u = r(g);
|
|
2403
|
-
return f(c(h), {
|
|
2404
|
-
method: "POST",
|
|
2405
|
-
headers: n(u),
|
|
2406
|
-
body: a(u)
|
|
2407
|
-
});
|
|
2408
|
-
}
|
|
2409
|
-
};
|
|
2410
|
-
}
|
|
2411
|
-
const { request: ti, del: ei, get: si, post: ni, put: ri } = Ar(), k = (s) => window.matchMedia(s).matches, ii = {
|
|
2524
|
+
let hr = vi;
|
|
2525
|
+
const K = (e) => window.matchMedia(e).matches, Bl = {
|
|
2412
2526
|
PRINT: "print",
|
|
2413
2527
|
get isPrint() {
|
|
2414
|
-
return
|
|
2528
|
+
return K(this.PRINT);
|
|
2415
2529
|
},
|
|
2416
2530
|
HOVER: "(hover: hover)",
|
|
2417
2531
|
get isHover() {
|
|
2418
|
-
return
|
|
2532
|
+
return K(this.HOVER);
|
|
2419
2533
|
},
|
|
2420
2534
|
PWA: "(display-mode: standalone)",
|
|
2421
2535
|
// PWA: '(display-mode: browser)', // debugging
|
|
2422
2536
|
get isPWA() {
|
|
2423
|
-
return
|
|
2537
|
+
return K(this.PWA);
|
|
2424
2538
|
},
|
|
2425
2539
|
MOTION_REDUCE: "(prefers-reduced-motion: reduce)",
|
|
2426
2540
|
get isMotionReduce() {
|
|
2427
|
-
return
|
|
2541
|
+
return K(this.MOTION_REDUCE);
|
|
2428
2542
|
},
|
|
2429
2543
|
DATA_REDUCE: "(prefers-reduced-data: reduce)",
|
|
2430
2544
|
get isDataReduce() {
|
|
2431
|
-
return
|
|
2545
|
+
return K(this.DATA_REDUCE);
|
|
2432
2546
|
},
|
|
2433
2547
|
WATCH: "(width < 320px)",
|
|
2434
2548
|
get isWatch() {
|
|
2435
|
-
return
|
|
2549
|
+
return K(this.WATCH);
|
|
2436
2550
|
},
|
|
2437
2551
|
SMALL_PHONE: "(320px <= width <= 480px) and (height <= 640px)",
|
|
2438
2552
|
get isSmallPhone() {
|
|
2439
|
-
return
|
|
2553
|
+
return K(this.SMALL_PHONE);
|
|
2440
2554
|
},
|
|
2441
2555
|
PHONE: "(320px <= width <= 480px)",
|
|
2442
2556
|
get isPhone() {
|
|
2443
|
-
return
|
|
2557
|
+
return K(this.PHONE);
|
|
2444
2558
|
},
|
|
2445
2559
|
PHONE_LANDSCAPE: "(480px < width < 960px) and (orientation: landscape)",
|
|
2446
2560
|
// PHONE_LANDSCAPE: '(480px < width < 960px)',
|
|
2447
2561
|
get isPhoneLandscape() {
|
|
2448
|
-
return
|
|
2562
|
+
return K(this.PHONE_LANDSCAPE);
|
|
2449
2563
|
},
|
|
2450
2564
|
// Widget
|
|
2451
2565
|
SHORT: "(width >= 480px) and (height <= 320px)",
|
|
2452
2566
|
get isShort() {
|
|
2453
|
-
return
|
|
2567
|
+
return K(this.SHORT);
|
|
2454
2568
|
},
|
|
2455
2569
|
// 1280 x 850
|
|
2456
2570
|
// 1024 x 768
|
|
2457
2571
|
TABLET: "(480px < width <= 1280px)",
|
|
2458
2572
|
get isTablet() {
|
|
2459
|
-
return
|
|
2573
|
+
return K(this.TABLET);
|
|
2460
2574
|
},
|
|
2461
2575
|
// 1366x768
|
|
2462
2576
|
DESKTOP: "(width > 1280px) and (orientation: landscape)",
|
|
2463
2577
|
get isDesktop() {
|
|
2464
|
-
return
|
|
2578
|
+
return K(this.DESKTOP);
|
|
2465
2579
|
},
|
|
2466
2580
|
// 1920x1080
|
|
2467
2581
|
WIDTHSCREEN: "(width >= 1920px) and (orientation: landscape)",
|
|
2468
2582
|
get isWidthScreen() {
|
|
2469
|
-
return
|
|
2583
|
+
return K(this.WIDTHSCREEN);
|
|
2470
2584
|
}
|
|
2471
|
-
};
|
|
2585
|
+
}, Al = Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array())).constructor;
|
|
2586
|
+
function Il(e = {}) {
|
|
2587
|
+
const {
|
|
2588
|
+
origin: t = location.origin,
|
|
2589
|
+
base: n = "",
|
|
2590
|
+
appendHeaders: s = () => ({}),
|
|
2591
|
+
transformInput: i = (r) => r,
|
|
2592
|
+
transformOutput: o = (r) => r,
|
|
2593
|
+
...c
|
|
2594
|
+
} = e, a = (r) => r instanceof FormData || r instanceof Blob || r instanceof Al || r instanceof URLSearchParams || r instanceof ReadableStream || r instanceof ArrayBuffer ? r : typeof r == "object" ? JSON.stringify(r) : r, f = (r, _) => {
|
|
2595
|
+
if (new URL(r, location.origin).pathname !== r)
|
|
2596
|
+
throw new yt("`path` format is incorrect");
|
|
2597
|
+
const l = new URLSearchParams(_).toString();
|
|
2598
|
+
return `${t}${n}${r}${l ? "?" : ""}${l}`;
|
|
2599
|
+
}, h = (r) => {
|
|
2600
|
+
if (!r) return {};
|
|
2601
|
+
if (r instanceof Headers) return Object.fromEntries(r);
|
|
2602
|
+
const _ = Array.isArray(r) ? r : Object.entries(r);
|
|
2603
|
+
return Object.fromEntries(_.map(([l, g]) => [l.toLowerCase(), g]));
|
|
2604
|
+
}, m = async (r, _ = {}) => {
|
|
2605
|
+
const l = new Request(r, {
|
|
2606
|
+
...c,
|
|
2607
|
+
..._,
|
|
2608
|
+
headers: new Headers({
|
|
2609
|
+
"content-type": "application/json",
|
|
2610
|
+
...h(c.headers),
|
|
2611
|
+
...h(_.headers)
|
|
2612
|
+
})
|
|
2613
|
+
}), g = await fetch(l);
|
|
2614
|
+
if (g.status === 0) throw new Error("Request fail");
|
|
2615
|
+
if (g.status >= 500) throw new Error(g.statusText);
|
|
2616
|
+
const v = l.headers.get("content-type"), y = g.status >= 400;
|
|
2617
|
+
try {
|
|
2618
|
+
let $;
|
|
2619
|
+
if (v.includes("json") ? $ = await g.json() : v.includes("octet-stream") ? $ = await g.arrayBuffer() : $ = await g.text(), y) throw new Error(g.statusText, { cause: $ });
|
|
2620
|
+
return o($, l);
|
|
2621
|
+
} catch {
|
|
2622
|
+
throw new Error("Parse error");
|
|
2623
|
+
}
|
|
2624
|
+
};
|
|
2625
|
+
return {
|
|
2626
|
+
request: m,
|
|
2627
|
+
get(r, _) {
|
|
2628
|
+
const l = i(_);
|
|
2629
|
+
return m(f(r, l), {
|
|
2630
|
+
method: "GET",
|
|
2631
|
+
headers: s(l)
|
|
2632
|
+
});
|
|
2633
|
+
},
|
|
2634
|
+
del(r, _) {
|
|
2635
|
+
const l = i(_);
|
|
2636
|
+
return m(f(r, l), {
|
|
2637
|
+
method: "DELETE",
|
|
2638
|
+
headers: s(l)
|
|
2639
|
+
});
|
|
2640
|
+
},
|
|
2641
|
+
put(r, _) {
|
|
2642
|
+
const l = i(_);
|
|
2643
|
+
return m(f(r), {
|
|
2644
|
+
method: "PUT",
|
|
2645
|
+
headers: s(l),
|
|
2646
|
+
body: a(l)
|
|
2647
|
+
});
|
|
2648
|
+
},
|
|
2649
|
+
post(r, _) {
|
|
2650
|
+
const l = i(_);
|
|
2651
|
+
return m(f(r), {
|
|
2652
|
+
method: "POST",
|
|
2653
|
+
headers: s(l),
|
|
2654
|
+
body: a(l)
|
|
2655
|
+
});
|
|
2656
|
+
}
|
|
2657
|
+
};
|
|
2658
|
+
}
|
|
2659
|
+
const { request: Kl, del: jl, get: Jl, post: Yl, put: Ql } = Il(), Ca = /* @__PURE__ */ new WeakMap(), Pa = /* @__PURE__ */ new WeakMap();
|
|
2660
|
+
function Xl(e) {
|
|
2661
|
+
return Ca.get(e);
|
|
2662
|
+
}
|
|
2663
|
+
function ka(e) {
|
|
2664
|
+
return Pa.get(e);
|
|
2665
|
+
}
|
|
2666
|
+
function fn(e, t = {}) {
|
|
2667
|
+
const n = En(), s = kn({})[Rt], [i, o] = Xe(e), c = new Proxy(
|
|
2668
|
+
{ [Rt]: s },
|
|
2669
|
+
{
|
|
2670
|
+
get(f, h) {
|
|
2671
|
+
if (!f[h]) {
|
|
2672
|
+
const [m, r, _] = h.match(/^(\w*Color)(\d+)$/) || [];
|
|
2673
|
+
r && (f[h] = `oklch(from ${f[r]} calc(l - ${(Number(_) - 400) / 1e3}) c h)`);
|
|
2674
|
+
}
|
|
2675
|
+
return f[h];
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
);
|
|
2679
|
+
Pa.set(c, t), Ca.set(c, i);
|
|
2680
|
+
const a = () => {
|
|
2681
|
+
let f = "";
|
|
2682
|
+
Object.keys(i).forEach((h) => {
|
|
2683
|
+
t[h] || (t[h] = `--${oe(h)}-${n}`, c[h] = `var(${t[h]})`), f += `${t[h]}:${i[h]};`;
|
|
2684
|
+
}), s.setContent(`:scope,:host{${f}}`);
|
|
2685
|
+
};
|
|
2686
|
+
return a(), pt(i, () => {
|
|
2687
|
+
a(), s.updateStyle();
|
|
2688
|
+
}), [c, o];
|
|
2689
|
+
}
|
|
2690
|
+
function Rl(e) {
|
|
2691
|
+
return fn(e);
|
|
2692
|
+
}
|
|
2693
|
+
function Zl(e) {
|
|
2694
|
+
const t = Rl(e);
|
|
2695
|
+
return document.adoptedStyleSheets.push(t[0][Rt].getStyle()), t;
|
|
2696
|
+
}
|
|
2697
|
+
function th(e, t) {
|
|
2698
|
+
return fn(t, ka(e));
|
|
2699
|
+
}
|
|
2700
|
+
function eh(e) {
|
|
2701
|
+
const [t] = fn(e), n = ka(t);
|
|
2702
|
+
return [t, (i) => (o, { addInitializer: c, access: a }) => {
|
|
2703
|
+
c(function() {
|
|
2704
|
+
const [f, h] = fn({ ...e }, n);
|
|
2705
|
+
this.internals.sheets.push(f[Rt].getStyle(this)), this.memo(() => h(a.get(this).apply(this)), i && (() => i(this)));
|
|
2706
|
+
});
|
|
2707
|
+
}];
|
|
2708
|
+
}
|
|
2472
2709
|
export {
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
G as
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2710
|
+
Pn as BoundaryCSSState,
|
|
2711
|
+
se as GemActiveLinkElement,
|
|
2712
|
+
Be as GemDialogBaseElement,
|
|
2713
|
+
B as GemElement,
|
|
2714
|
+
yt as GemError,
|
|
2715
|
+
z as GemLightRouteElement,
|
|
2716
|
+
R as GemLinkElement,
|
|
2717
|
+
Rn as GemReflectElement,
|
|
2718
|
+
Ue as GemRouteElement,
|
|
2719
|
+
xe as GemTitleElement,
|
|
2720
|
+
ie as GemUnsafeElement,
|
|
2721
|
+
Ct as GemUseElement,
|
|
2722
|
+
hr as I18n,
|
|
2723
|
+
Da as LinkedList,
|
|
2724
|
+
xl as Logger,
|
|
2725
|
+
Fa as PropProxyMap,
|
|
2726
|
+
De as QueryString,
|
|
2727
|
+
Ls as RenderErrorEvent,
|
|
2728
|
+
fr as SVGTemplateResult,
|
|
2729
|
+
Rt as SheetToken,
|
|
2730
|
+
ne as StoreListenerMap,
|
|
2731
|
+
$n as TemplateResult,
|
|
2732
|
+
Cn as UpdateToken,
|
|
2733
|
+
vr as absoluteLocation,
|
|
2734
|
+
wr as addListener,
|
|
2735
|
+
Ot as addMicrotask,
|
|
2736
|
+
Hs as adoptedStyle,
|
|
2737
|
+
An as aria,
|
|
2738
|
+
pc as async,
|
|
2739
|
+
G as attribute,
|
|
2740
|
+
yc as basePathStore,
|
|
2741
|
+
On as boolattribute,
|
|
2742
|
+
oe as camelToKebabCase,
|
|
2743
|
+
Ua as classMap,
|
|
2744
|
+
Ts as cleanObject,
|
|
2745
|
+
pt as connect,
|
|
2746
|
+
Nn as connectStore,
|
|
2747
|
+
kn as createCSSSheet,
|
|
2748
|
+
xc as createHistoryParams,
|
|
2749
|
+
Ul as createModalClass,
|
|
2750
|
+
js as createPath,
|
|
2751
|
+
$r as createRef,
|
|
2752
|
+
Ns as createState,
|
|
2753
|
+
bn as createStore,
|
|
2754
|
+
As as createTemplate,
|
|
2755
|
+
yr as css,
|
|
2756
|
+
fc as customElement,
|
|
2757
|
+
jl as del,
|
|
2758
|
+
Sn as directive,
|
|
2759
|
+
Ba as disconnect,
|
|
2760
|
+
$t as effect,
|
|
2761
|
+
ye as emitter,
|
|
2762
|
+
Dl as exportPartsMap,
|
|
2763
|
+
lc as fallback,
|
|
2764
|
+
Jl as get,
|
|
2765
|
+
ka as getThemeProps,
|
|
2766
|
+
Xl as getThemeStore,
|
|
2767
|
+
dc as globalemitter,
|
|
2768
|
+
ql as guard,
|
|
2769
|
+
O as history,
|
|
2770
|
+
at as html,
|
|
2771
|
+
Sc as ifDefined,
|
|
2772
|
+
Il as initRequest,
|
|
2773
|
+
qa as isArrayChange,
|
|
2774
|
+
zl as kebabToCamelCase,
|
|
2775
|
+
Tl as logger,
|
|
2776
|
+
ao as matchPath,
|
|
2777
|
+
Bl as mediaQuery,
|
|
2778
|
+
kr as memo,
|
|
2779
|
+
qe as mounted,
|
|
2780
|
+
ac as numattribute,
|
|
2781
|
+
Os as objectMapToString,
|
|
2782
|
+
Or as part,
|
|
2783
|
+
Gl as partMap,
|
|
2784
|
+
Yl as post,
|
|
2785
|
+
U as property,
|
|
2786
|
+
Ql as put,
|
|
2787
|
+
En as randomStr,
|
|
2788
|
+
xs as raw,
|
|
2789
|
+
ks as render,
|
|
2790
|
+
Fl as repeat,
|
|
2791
|
+
Kl as request,
|
|
2792
|
+
Ht as shadow,
|
|
2793
|
+
uc as slot,
|
|
2794
|
+
Nl as splice,
|
|
2795
|
+
Ln as state,
|
|
2796
|
+
Vl as styleMap,
|
|
2797
|
+
Wl as styled,
|
|
2798
|
+
Ga as svg,
|
|
2799
|
+
xr as template,
|
|
2800
|
+
At as titleStore,
|
|
2801
|
+
cc as unmounted,
|
|
2802
|
+
It as updateStore,
|
|
2803
|
+
eh as useDecoratorTheme,
|
|
2804
|
+
th as useOverrideTheme,
|
|
2805
|
+
Rl as useScopedTheme,
|
|
2806
|
+
Xe as useStore,
|
|
2807
|
+
Zl as useTheme,
|
|
2808
|
+
nc as version,
|
|
2809
|
+
Mn as willMount
|
|
2565
2810
|
};
|