@mantou/gem 2.2.0 → 2.2.1

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