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