next-flow-design 1.6.2 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,184 +1,184 @@
1
- import { css as E, LitElement as R, html as f } from "lit";
2
- const Y = globalThis, oe = Y.ShadowRoot && (Y.ShadyCSS === void 0 || Y.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, we = /* @__PURE__ */ Symbol(), he = /* @__PURE__ */ new WeakMap();
3
- let Se = class {
4
- constructor(e, o, r) {
5
- if (this._$cssResult$ = !0, r !== we) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
6
- this.cssText = e, this.t = o;
1
+ import { css as A, LitElement as L, html as p } from "lit";
2
+ const G = globalThis, rt = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, xt = /* @__PURE__ */ Symbol(), dt = /* @__PURE__ */ new WeakMap();
3
+ let Pt = class {
4
+ constructor(t, o, s) {
5
+ if (this._$cssResult$ = !0, s !== xt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
6
+ this.cssText = t, this.t = o;
7
7
  }
8
8
  get styleSheet() {
9
- let e = this.o;
9
+ let t = this.o;
10
10
  const o = this.t;
11
- if (oe && e === void 0) {
12
- const r = o !== void 0 && o.length === 1;
13
- r && (e = he.get(o)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), r && he.set(o, e));
11
+ if (rt && t === void 0) {
12
+ const s = o !== void 0 && o.length === 1;
13
+ s && (t = dt.get(o)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && dt.set(o, t));
14
14
  }
15
- return e;
15
+ return t;
16
16
  }
17
17
  toString() {
18
18
  return this.cssText;
19
19
  }
20
20
  };
21
- const Ce = (t) => new Se(typeof t == "string" ? t : t + "", void 0, we), Pe = (t, e) => {
22
- if (oe) t.adoptedStyleSheets = e.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
23
- else for (const o of e) {
24
- const r = document.createElement("style"), s = Y.litNonce;
25
- s !== void 0 && r.setAttribute("nonce", s), r.textContent = o.cssText, t.appendChild(r);
21
+ const Dt = (e) => new Pt(typeof e == "string" ? e : e + "", void 0, xt), Mt = (e, t) => {
22
+ if (rt) e.adoptedStyleSheets = t.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
23
+ else for (const o of t) {
24
+ const s = document.createElement("style"), r = G.litNonce;
25
+ r !== void 0 && s.setAttribute("nonce", r), s.textContent = o.cssText, e.appendChild(s);
26
26
  }
27
- }, ce = oe ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
27
+ }, ut = rt ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
28
28
  let o = "";
29
- for (const r of e.cssRules) o += r.cssText;
30
- return Ce(o);
31
- })(t) : t;
32
- const { is: Me, defineProperty: De, getOwnPropertyDescriptor: Te, getOwnPropertyNames: Oe, getOwnPropertySymbols: Be, getPrototypeOf: Ve } = Object, J = globalThis, de = J.trustedTypes, He = de ? de.emptyScript : "", Ne = J.reactiveElementPolyfillSupport, U = (t, e) => t, X = { toAttribute(t, e) {
33
- switch (e) {
29
+ for (const s of t.cssRules) o += s.cssText;
30
+ return Dt(o);
31
+ })(e) : e;
32
+ const { is: Ht, defineProperty: Tt, getOwnPropertyDescriptor: Ot, getOwnPropertyNames: zt, getOwnPropertySymbols: Bt, getPrototypeOf: Vt } = Object, tt = globalThis, pt = tt.trustedTypes, Nt = pt ? pt.emptyScript : "", Ft = tt.reactiveElementPolyfillSupport, j = (e, t) => e, J = { toAttribute(e, t) {
33
+ switch (t) {
34
34
  case Boolean:
35
- t = t ? He : null;
35
+ e = e ? Nt : null;
36
36
  break;
37
37
  case Object:
38
38
  case Array:
39
- t = t == null ? t : JSON.stringify(t);
39
+ e = e == null ? e : JSON.stringify(e);
40
40
  }
41
- return t;
42
- }, fromAttribute(t, e) {
43
- let o = t;
44
- switch (e) {
41
+ return e;
42
+ }, fromAttribute(e, t) {
43
+ let o = e;
44
+ switch (t) {
45
45
  case Boolean:
46
- o = t !== null;
46
+ o = e !== null;
47
47
  break;
48
48
  case Number:
49
- o = t === null ? null : Number(t);
49
+ o = e === null ? null : Number(e);
50
50
  break;
51
51
  case Object:
52
52
  case Array:
53
53
  try {
54
- o = JSON.parse(t);
54
+ o = JSON.parse(e);
55
55
  } catch {
56
56
  o = null;
57
57
  }
58
58
  }
59
59
  return o;
60
- } }, re = (t, e) => !Me(t, e), ue = { attribute: !0, type: String, converter: X, reflect: !1, useDefault: !1, hasChanged: re };
61
- Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), J.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
62
- let B = class extends HTMLElement {
63
- static addInitializer(e) {
64
- this._$Ei(), (this.l ??= []).push(e);
60
+ } }, it = (e, t) => !Ht(e, t), ft = { attribute: !0, type: String, converter: J, reflect: !1, useDefault: !1, hasChanged: it };
61
+ Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), tt.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
62
+ let V = class extends HTMLElement {
63
+ static addInitializer(t) {
64
+ this._$Ei(), (this.l ??= []).push(t);
65
65
  }
66
66
  static get observedAttributes() {
67
67
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
68
68
  }
69
- static createProperty(e, o = ue) {
70
- if (o.state && (o.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((o = Object.create(o)).wrapped = !0), this.elementProperties.set(e, o), !o.noAccessor) {
71
- const r = /* @__PURE__ */ Symbol(), s = this.getPropertyDescriptor(e, r, o);
72
- s !== void 0 && De(this.prototype, e, s);
69
+ static createProperty(t, o = ft) {
70
+ if (o.state && (o.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((o = Object.create(o)).wrapped = !0), this.elementProperties.set(t, o), !o.noAccessor) {
71
+ const s = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(t, s, o);
72
+ r !== void 0 && Tt(this.prototype, t, r);
73
73
  }
74
74
  }
75
- static getPropertyDescriptor(e, o, r) {
76
- const { get: s, set: i } = Te(this.prototype, e) ?? { get() {
75
+ static getPropertyDescriptor(t, o, s) {
76
+ const { get: r, set: i } = Ot(this.prototype, t) ?? { get() {
77
77
  return this[o];
78
78
  }, set(n) {
79
79
  this[o] = n;
80
80
  } };
81
- return { get: s, set(n) {
82
- const l = s?.call(this);
83
- i?.call(this, n), this.requestUpdate(e, l, r);
81
+ return { get: r, set(n) {
82
+ const l = r?.call(this);
83
+ i?.call(this, n), this.requestUpdate(t, l, s);
84
84
  }, configurable: !0, enumerable: !0 };
85
85
  }
86
- static getPropertyOptions(e) {
87
- return this.elementProperties.get(e) ?? ue;
86
+ static getPropertyOptions(t) {
87
+ return this.elementProperties.get(t) ?? ft;
88
88
  }
89
89
  static _$Ei() {
90
- if (this.hasOwnProperty(U("elementProperties"))) return;
91
- const e = Ve(this);
92
- e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
90
+ if (this.hasOwnProperty(j("elementProperties"))) return;
91
+ const t = Vt(this);
92
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
93
93
  }
94
94
  static finalize() {
95
- if (this.hasOwnProperty(U("finalized"))) return;
96
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(U("properties"))) {
97
- const o = this.properties, r = [...Oe(o), ...Be(o)];
98
- for (const s of r) this.createProperty(s, o[s]);
95
+ if (this.hasOwnProperty(j("finalized"))) return;
96
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(j("properties"))) {
97
+ const o = this.properties, s = [...zt(o), ...Bt(o)];
98
+ for (const r of s) this.createProperty(r, o[r]);
99
99
  }
100
- const e = this[Symbol.metadata];
101
- if (e !== null) {
102
- const o = litPropertyMetadata.get(e);
103
- if (o !== void 0) for (const [r, s] of o) this.elementProperties.set(r, s);
100
+ const t = this[Symbol.metadata];
101
+ if (t !== null) {
102
+ const o = litPropertyMetadata.get(t);
103
+ if (o !== void 0) for (const [s, r] of o) this.elementProperties.set(s, r);
104
104
  }
105
105
  this._$Eh = /* @__PURE__ */ new Map();
106
- for (const [o, r] of this.elementProperties) {
107
- const s = this._$Eu(o, r);
108
- s !== void 0 && this._$Eh.set(s, o);
106
+ for (const [o, s] of this.elementProperties) {
107
+ const r = this._$Eu(o, s);
108
+ r !== void 0 && this._$Eh.set(r, o);
109
109
  }
110
110
  this.elementStyles = this.finalizeStyles(this.styles);
111
111
  }
112
- static finalizeStyles(e) {
112
+ static finalizeStyles(t) {
113
113
  const o = [];
114
- if (Array.isArray(e)) {
115
- const r = new Set(e.flat(1 / 0).reverse());
116
- for (const s of r) o.unshift(ce(s));
117
- } else e !== void 0 && o.push(ce(e));
114
+ if (Array.isArray(t)) {
115
+ const s = new Set(t.flat(1 / 0).reverse());
116
+ for (const r of s) o.unshift(ut(r));
117
+ } else t !== void 0 && o.push(ut(t));
118
118
  return o;
119
119
  }
120
- static _$Eu(e, o) {
121
- const r = o.attribute;
122
- return r === !1 ? void 0 : typeof r == "string" ? r : typeof e == "string" ? e.toLowerCase() : void 0;
120
+ static _$Eu(t, o) {
121
+ const s = o.attribute;
122
+ return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
123
123
  }
124
124
  constructor() {
125
125
  super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
126
126
  }
127
127
  _$Ev() {
128
- this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this));
128
+ this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t) => t(this));
129
129
  }
130
- addController(e) {
131
- (this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
130
+ addController(t) {
131
+ (this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
132
132
  }
133
- removeController(e) {
134
- this._$EO?.delete(e);
133
+ removeController(t) {
134
+ this._$EO?.delete(t);
135
135
  }
136
136
  _$E_() {
137
- const e = /* @__PURE__ */ new Map(), o = this.constructor.elementProperties;
138
- for (const r of o.keys()) this.hasOwnProperty(r) && (e.set(r, this[r]), delete this[r]);
139
- e.size > 0 && (this._$Ep = e);
137
+ const t = /* @__PURE__ */ new Map(), o = this.constructor.elementProperties;
138
+ for (const s of o.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
139
+ t.size > 0 && (this._$Ep = t);
140
140
  }
141
141
  createRenderRoot() {
142
- const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
143
- return Pe(e, this.constructor.elementStyles), e;
142
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
143
+ return Mt(t, this.constructor.elementStyles), t;
144
144
  }
145
145
  connectedCallback() {
146
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.());
146
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
147
147
  }
148
- enableUpdating(e) {
148
+ enableUpdating(t) {
149
149
  }
150
150
  disconnectedCallback() {
151
- this._$EO?.forEach((e) => e.hostDisconnected?.());
151
+ this._$EO?.forEach((t) => t.hostDisconnected?.());
152
152
  }
153
- attributeChangedCallback(e, o, r) {
154
- this._$AK(e, r);
153
+ attributeChangedCallback(t, o, s) {
154
+ this._$AK(t, s);
155
155
  }
156
- _$ET(e, o) {
157
- const r = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, r);
158
- if (s !== void 0 && r.reflect === !0) {
159
- const i = (r.converter?.toAttribute !== void 0 ? r.converter : X).toAttribute(o, r.type);
160
- this._$Em = e, i == null ? this.removeAttribute(s) : this.setAttribute(s, i), this._$Em = null;
156
+ _$ET(t, o) {
157
+ const s = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, s);
158
+ if (r !== void 0 && s.reflect === !0) {
159
+ const i = (s.converter?.toAttribute !== void 0 ? s.converter : J).toAttribute(o, s.type);
160
+ this._$Em = t, i == null ? this.removeAttribute(r) : this.setAttribute(r, i), this._$Em = null;
161
161
  }
162
162
  }
163
- _$AK(e, o) {
164
- const r = this.constructor, s = r._$Eh.get(e);
165
- if (s !== void 0 && this._$Em !== s) {
166
- const i = r.getPropertyOptions(s), n = typeof i.converter == "function" ? { fromAttribute: i.converter } : i.converter?.fromAttribute !== void 0 ? i.converter : X;
167
- this._$Em = s;
163
+ _$AK(t, o) {
164
+ const s = this.constructor, r = s._$Eh.get(t);
165
+ if (r !== void 0 && this._$Em !== r) {
166
+ const i = s.getPropertyOptions(r), n = typeof i.converter == "function" ? { fromAttribute: i.converter } : i.converter?.fromAttribute !== void 0 ? i.converter : J;
167
+ this._$Em = r;
168
168
  const l = n.fromAttribute(o, i.type);
169
- this[s] = l ?? this._$Ej?.get(s) ?? l, this._$Em = null;
169
+ this[r] = l ?? this._$Ej?.get(r) ?? l, this._$Em = null;
170
170
  }
171
171
  }
172
- requestUpdate(e, o, r, s = !1, i) {
173
- if (e !== void 0) {
172
+ requestUpdate(t, o, s, r = !1, i) {
173
+ if (t !== void 0) {
174
174
  const n = this.constructor;
175
- if (s === !1 && (i = this[e]), r ??= n.getPropertyOptions(e), !((r.hasChanged ?? re)(i, o) || r.useDefault && r.reflect && i === this._$Ej?.get(e) && !this.hasAttribute(n._$Eu(e, r)))) return;
176
- this.C(e, o, r);
175
+ if (r === !1 && (i = this[t]), s ??= n.getPropertyOptions(t), !((s.hasChanged ?? it)(i, o) || s.useDefault && s.reflect && i === this._$Ej?.get(t) && !this.hasAttribute(n._$Eu(t, s)))) return;
176
+ this.C(t, o, s);
177
177
  }
178
178
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
179
179
  }
180
- C(e, o, { useDefault: r, reflect: s, wrapped: i }, n) {
181
- r && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, n ?? o ?? this[e]), i !== !0 || n !== void 0) || (this._$AL.has(e) || (this.hasUpdated || r || (o = void 0), this._$AL.set(e, o)), s === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
180
+ C(t, o, { useDefault: s, reflect: r, wrapped: i }, n) {
181
+ s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? o ?? this[t]), i !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (o = void 0), this._$AL.set(t, o)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
182
182
  }
183
183
  async _$EP() {
184
184
  this.isUpdatePending = !0;
@@ -187,8 +187,8 @@ let B = class extends HTMLElement {
187
187
  } catch (o) {
188
188
  Promise.reject(o);
189
189
  }
190
- const e = this.scheduleUpdate();
191
- return e != null && await e, !this.isUpdatePending;
190
+ const t = this.scheduleUpdate();
191
+ return t != null && await t, !this.isUpdatePending;
192
192
  }
193
193
  scheduleUpdate() {
194
194
  return this.performUpdate();
@@ -197,28 +197,28 @@ let B = class extends HTMLElement {
197
197
  if (!this.isUpdatePending) return;
198
198
  if (!this.hasUpdated) {
199
199
  if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
200
- for (const [s, i] of this._$Ep) this[s] = i;
200
+ for (const [r, i] of this._$Ep) this[r] = i;
201
201
  this._$Ep = void 0;
202
202
  }
203
- const r = this.constructor.elementProperties;
204
- if (r.size > 0) for (const [s, i] of r) {
205
- const { wrapped: n } = i, l = this[s];
206
- n !== !0 || this._$AL.has(s) || l === void 0 || this.C(s, void 0, i, l);
203
+ const s = this.constructor.elementProperties;
204
+ if (s.size > 0) for (const [r, i] of s) {
205
+ const { wrapped: n } = i, l = this[r];
206
+ n !== !0 || this._$AL.has(r) || l === void 0 || this.C(r, void 0, i, l);
207
207
  }
208
208
  }
209
- let e = !1;
209
+ let t = !1;
210
210
  const o = this._$AL;
211
211
  try {
212
- e = this.shouldUpdate(o), e ? (this.willUpdate(o), this._$EO?.forEach((r) => r.hostUpdate?.()), this.update(o)) : this._$EM();
213
- } catch (r) {
214
- throw e = !1, this._$EM(), r;
212
+ t = this.shouldUpdate(o), t ? (this.willUpdate(o), this._$EO?.forEach((s) => s.hostUpdate?.()), this.update(o)) : this._$EM();
213
+ } catch (s) {
214
+ throw t = !1, this._$EM(), s;
215
215
  }
216
- e && this._$AE(o);
216
+ t && this._$AE(o);
217
217
  }
218
- willUpdate(e) {
218
+ willUpdate(t) {
219
219
  }
220
- _$AE(e) {
221
- this._$EO?.forEach((o) => o.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
220
+ _$AE(t) {
221
+ this._$EO?.forEach((o) => o.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
222
222
  }
223
223
  _$EM() {
224
224
  this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
@@ -229,113 +229,113 @@ let B = class extends HTMLElement {
229
229
  getUpdateComplete() {
230
230
  return this._$ES;
231
231
  }
232
- shouldUpdate(e) {
232
+ shouldUpdate(t) {
233
233
  return !0;
234
234
  }
235
- update(e) {
235
+ update(t) {
236
236
  this._$Eq &&= this._$Eq.forEach((o) => this._$ET(o, this[o])), this._$EM();
237
237
  }
238
- updated(e) {
238
+ updated(t) {
239
239
  }
240
- firstUpdated(e) {
240
+ firstUpdated(t) {
241
241
  }
242
242
  };
243
- B.elementStyles = [], B.shadowRootOptions = { mode: "open" }, B[U("elementProperties")] = /* @__PURE__ */ new Map(), B[U("finalized")] = /* @__PURE__ */ new Map(), Ne?.({ ReactiveElement: B }), (J.reactiveElementVersions ??= []).push("2.1.2");
244
- const Ue = { attribute: !0, type: String, converter: X, reflect: !1, hasChanged: re }, Fe = (t = Ue, e, o) => {
245
- const { kind: r, metadata: s } = o;
246
- let i = globalThis.litPropertyMetadata.get(s);
247
- if (i === void 0 && globalThis.litPropertyMetadata.set(s, i = /* @__PURE__ */ new Map()), r === "setter" && ((t = Object.create(t)).wrapped = !0), i.set(o.name, t), r === "accessor") {
243
+ V.elementStyles = [], V.shadowRootOptions = { mode: "open" }, V[j("elementProperties")] = /* @__PURE__ */ new Map(), V[j("finalized")] = /* @__PURE__ */ new Map(), Ft?.({ ReactiveElement: V }), (tt.reactiveElementVersions ??= []).push("2.1.2");
244
+ const Lt = { attribute: !0, type: String, converter: J, reflect: !1, hasChanged: it }, Ut = (e = Lt, t, o) => {
245
+ const { kind: s, metadata: r } = o;
246
+ let i = globalThis.litPropertyMetadata.get(r);
247
+ if (i === void 0 && globalThis.litPropertyMetadata.set(r, i = /* @__PURE__ */ new Map()), s === "setter" && ((e = Object.create(e)).wrapped = !0), i.set(o.name, e), s === "accessor") {
248
248
  const { name: n } = o;
249
249
  return { set(l) {
250
- const a = e.get.call(this);
251
- e.set.call(this, l), this.requestUpdate(n, a, t, !0, l);
250
+ const a = t.get.call(this);
251
+ t.set.call(this, l), this.requestUpdate(n, a, e, !0, l);
252
252
  }, init(l) {
253
- return l !== void 0 && this.C(n, void 0, t, l), l;
253
+ return l !== void 0 && this.C(n, void 0, e, l), l;
254
254
  } };
255
255
  }
256
- if (r === "setter") {
256
+ if (s === "setter") {
257
257
  const { name: n } = o;
258
258
  return function(l) {
259
259
  const a = this[n];
260
- e.call(this, l), this.requestUpdate(n, a, t, !0, l);
260
+ t.call(this, l), this.requestUpdate(n, a, e, !0, l);
261
261
  };
262
262
  }
263
- throw Error("Unsupported decorator location: " + r);
263
+ throw Error("Unsupported decorator location: " + s);
264
264
  };
265
- function h(t) {
266
- return (e, o) => typeof o == "object" ? Fe(t, e, o) : ((r, s, i) => {
267
- const n = s.hasOwnProperty(i);
268
- return s.constructor.createProperty(i, r), n ? Object.getOwnPropertyDescriptor(s, i) : void 0;
269
- })(t, e, o);
265
+ function h(e) {
266
+ return (t, o) => typeof o == "object" ? Ut(e, t, o) : ((s, r, i) => {
267
+ const n = r.hasOwnProperty(i);
268
+ return r.constructor.createProperty(i, s), n ? Object.getOwnPropertyDescriptor(r, i) : void 0;
269
+ })(e, t, o);
270
270
  }
271
- function w(t) {
272
- return h({ ...t, state: !0, attribute: !1 });
271
+ function _(e) {
272
+ return h({ ...e, state: !0, attribute: !1 });
273
273
  }
274
- const se = globalThis, pe = (t) => t, G = se.trustedTypes, fe = G ? G.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, $e = "$lit$", A = `lit$${Math.random().toFixed(9).slice(2)}$`, xe = "?" + A, Le = `<${xe}>`, P = document, F = () => P.createComment(""), L = (t) => t === null || typeof t != "object" && typeof t != "function", ie = Array.isArray, ze = (t) => ie(t) || typeof t?.[Symbol.iterator] == "function", ee = `[
275
- \f\r]`, N = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, be = /-->/g, me = />/g, S = RegExp(`>|${ee}(?:([^\\s"'>=/]+)(${ee}*=${ee}*(?:[^
276
- \f\r"'\`<>=]|("|')|))|$)`, "g"), ge = /'/g, ve = /"/g, ke = /^(?:script|style|textarea|title)$/i, je = (t) => (e, ...o) => ({ _$litType$: t, strings: e, values: o }), te = je(1), M = /* @__PURE__ */ Symbol.for("lit-noChange"), b = /* @__PURE__ */ Symbol.for("lit-nothing"), _e = /* @__PURE__ */ new WeakMap(), C = P.createTreeWalker(P, 129);
277
- function Ae(t, e) {
278
- if (!ie(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
279
- return fe !== void 0 ? fe.createHTML(e) : e;
274
+ const nt = globalThis, bt = (e) => e, Q = nt.trustedTypes, mt = Q ? Q.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, kt = "$lit$", P = `lit$${Math.random().toFixed(9).slice(2)}$`, Et = "?" + P, Rt = `<${Et}>`, T = document, I = () => T.createComment(""), q = (e) => e === null || typeof e != "object" && typeof e != "function", at = Array.isArray, jt = (e) => at(e) || typeof e?.[Symbol.iterator] == "function", ot = `[
275
+ \f\r]`, R = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, gt = /-->/g, vt = />/g, M = RegExp(`>|${ot}(?:([^\\s"'>=/]+)(${ot}*=${ot}*(?:[^
276
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), yt = /'/g, wt = /"/g, St = /^(?:script|style|textarea|title)$/i, It = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), st = It(1), O = /* @__PURE__ */ Symbol.for("lit-noChange"), b = /* @__PURE__ */ Symbol.for("lit-nothing"), _t = /* @__PURE__ */ new WeakMap(), H = T.createTreeWalker(T, 129);
277
+ function At(e, t) {
278
+ if (!at(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
279
+ return mt !== void 0 ? mt.createHTML(t) : t;
280
280
  }
281
- const Ie = (t, e) => {
282
- const o = t.length - 1, r = [];
283
- let s, i = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = N;
281
+ const qt = (e, t) => {
282
+ const o = e.length - 1, s = [];
283
+ let r, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = R;
284
284
  for (let l = 0; l < o; l++) {
285
- const a = t[l];
286
- let c, u, d = -1, $ = 0;
287
- for (; $ < a.length && (n.lastIndex = $, u = n.exec(a), u !== null); ) $ = n.lastIndex, n === N ? u[1] === "!--" ? n = be : u[1] !== void 0 ? n = me : u[2] !== void 0 ? (ke.test(u[2]) && (s = RegExp("</" + u[2], "g")), n = S) : u[3] !== void 0 && (n = S) : n === S ? u[0] === ">" ? (n = s ?? N, d = -1) : u[1] === void 0 ? d = -2 : (d = n.lastIndex - u[2].length, c = u[1], n = u[3] === void 0 ? S : u[3] === '"' ? ve : ge) : n === ve || n === ge ? n = S : n === be || n === me ? n = N : (n = S, s = void 0);
288
- const k = n === S && t[l + 1].startsWith("/>") ? " " : "";
289
- i += n === N ? a + Le : d >= 0 ? (r.push(c), a.slice(0, d) + $e + a.slice(d) + A + k) : a + A + (d === -2 ? l : k);
285
+ const a = e[l];
286
+ let c, u, d = -1, w = 0;
287
+ for (; w < a.length && (n.lastIndex = w, u = n.exec(a), u !== null); ) w = n.lastIndex, n === R ? u[1] === "!--" ? n = gt : u[1] !== void 0 ? n = vt : u[2] !== void 0 ? (St.test(u[2]) && (r = RegExp("</" + u[2], "g")), n = M) : u[3] !== void 0 && (n = M) : n === M ? u[0] === ">" ? (n = r ?? R, d = -1) : u[1] === void 0 ? d = -2 : (d = n.lastIndex - u[2].length, c = u[1], n = u[3] === void 0 ? M : u[3] === '"' ? wt : yt) : n === wt || n === yt ? n = M : n === gt || n === vt ? n = R : (n = M, r = void 0);
288
+ const k = n === M && e[l + 1].startsWith("/>") ? " " : "";
289
+ i += n === R ? a + Rt : d >= 0 ? (s.push(c), a.slice(0, d) + kt + a.slice(d) + P + k) : a + P + (d === -2 ? l : k);
290
290
  }
291
- return [Ae(t, i + (t[o] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
291
+ return [At(e, i + (e[o] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
292
292
  };
293
- class z {
294
- constructor({ strings: e, _$litType$: o }, r) {
295
- let s;
293
+ class W {
294
+ constructor({ strings: t, _$litType$: o }, s) {
295
+ let r;
296
296
  this.parts = [];
297
297
  let i = 0, n = 0;
298
- const l = e.length - 1, a = this.parts, [c, u] = Ie(e, o);
299
- if (this.el = z.createElement(c, r), C.currentNode = this.el.content, o === 2 || o === 3) {
298
+ const l = t.length - 1, a = this.parts, [c, u] = qt(t, o);
299
+ if (this.el = W.createElement(c, s), H.currentNode = this.el.content, o === 2 || o === 3) {
300
300
  const d = this.el.content.firstChild;
301
301
  d.replaceWith(...d.childNodes);
302
302
  }
303
- for (; (s = C.nextNode()) !== null && a.length < l; ) {
304
- if (s.nodeType === 1) {
305
- if (s.hasAttributes()) for (const d of s.getAttributeNames()) if (d.endsWith($e)) {
306
- const $ = u[n++], k = s.getAttribute(d).split(A), Z = /([.?@])?(.*)/.exec($);
307
- a.push({ type: 1, index: i, name: Z[2], strings: k, ctor: Z[1] === "." ? qe : Z[1] === "?" ? We : Z[1] === "@" ? Ke : Q }), s.removeAttribute(d);
308
- } else d.startsWith(A) && (a.push({ type: 6, index: i }), s.removeAttribute(d));
309
- if (ke.test(s.tagName)) {
310
- const d = s.textContent.split(A), $ = d.length - 1;
311
- if ($ > 0) {
312
- s.textContent = G ? G.emptyScript : "";
313
- for (let k = 0; k < $; k++) s.append(d[k], F()), C.nextNode(), a.push({ type: 2, index: ++i });
314
- s.append(d[$], F());
303
+ for (; (r = H.nextNode()) !== null && a.length < l; ) {
304
+ if (r.nodeType === 1) {
305
+ if (r.hasAttributes()) for (const d of r.getAttributeNames()) if (d.endsWith(kt)) {
306
+ const w = u[n++], k = r.getAttribute(d).split(P), E = /([.?@])?(.*)/.exec(w);
307
+ a.push({ type: 1, index: i, name: E[2], strings: k, ctor: E[1] === "." ? Kt : E[1] === "?" ? Yt : E[1] === "@" ? Zt : et }), r.removeAttribute(d);
308
+ } else d.startsWith(P) && (a.push({ type: 6, index: i }), r.removeAttribute(d));
309
+ if (St.test(r.tagName)) {
310
+ const d = r.textContent.split(P), w = d.length - 1;
311
+ if (w > 0) {
312
+ r.textContent = Q ? Q.emptyScript : "";
313
+ for (let k = 0; k < w; k++) r.append(d[k], I()), H.nextNode(), a.push({ type: 2, index: ++i });
314
+ r.append(d[w], I());
315
315
  }
316
316
  }
317
- } else if (s.nodeType === 8) if (s.data === xe) a.push({ type: 2, index: i });
317
+ } else if (r.nodeType === 8) if (r.data === Et) a.push({ type: 2, index: i });
318
318
  else {
319
319
  let d = -1;
320
- for (; (d = s.data.indexOf(A, d + 1)) !== -1; ) a.push({ type: 7, index: i }), d += A.length - 1;
320
+ for (; (d = r.data.indexOf(P, d + 1)) !== -1; ) a.push({ type: 7, index: i }), d += P.length - 1;
321
321
  }
322
322
  i++;
323
323
  }
324
324
  }
325
- static createElement(e, o) {
326
- const r = P.createElement("template");
327
- return r.innerHTML = e, r;
325
+ static createElement(t, o) {
326
+ const s = T.createElement("template");
327
+ return s.innerHTML = t, s;
328
328
  }
329
329
  }
330
- function H(t, e, o = t, r) {
331
- if (e === M) return e;
332
- let s = r !== void 0 ? o._$Co?.[r] : o._$Cl;
333
- const i = L(e) ? void 0 : e._$litDirective$;
334
- return s?.constructor !== i && (s?._$AO?.(!1), i === void 0 ? s = void 0 : (s = new i(t), s._$AT(t, o, r)), r !== void 0 ? (o._$Co ??= [])[r] = s : o._$Cl = s), s !== void 0 && (e = H(t, s._$AS(t, e.values), s, r)), e;
330
+ function F(e, t, o = e, s) {
331
+ if (t === O) return t;
332
+ let r = s !== void 0 ? o._$Co?.[s] : o._$Cl;
333
+ const i = q(t) ? void 0 : t._$litDirective$;
334
+ return r?.constructor !== i && (r?._$AO?.(!1), i === void 0 ? r = void 0 : (r = new i(e), r._$AT(e, o, s)), s !== void 0 ? (o._$Co ??= [])[s] = r : o._$Cl = r), r !== void 0 && (t = F(e, r._$AS(e, t.values), r, s)), t;
335
335
  }
336
- class Re {
337
- constructor(e, o) {
338
- this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = o;
336
+ class Wt {
337
+ constructor(t, o) {
338
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = o;
339
339
  }
340
340
  get parentNode() {
341
341
  return this._$AM.parentNode;
@@ -343,35 +343,35 @@ class Re {
343
343
  get _$AU() {
344
344
  return this._$AM._$AU;
345
345
  }
346
- u(e) {
347
- const { el: { content: o }, parts: r } = this._$AD, s = (e?.creationScope ?? P).importNode(o, !0);
348
- C.currentNode = s;
349
- let i = C.nextNode(), n = 0, l = 0, a = r[0];
346
+ u(t) {
347
+ const { el: { content: o }, parts: s } = this._$AD, r = (t?.creationScope ?? T).importNode(o, !0);
348
+ H.currentNode = r;
349
+ let i = H.nextNode(), n = 0, l = 0, a = s[0];
350
350
  for (; a !== void 0; ) {
351
351
  if (n === a.index) {
352
352
  let c;
353
- a.type === 2 ? c = new q(i, i.nextSibling, this, e) : a.type === 1 ? c = new a.ctor(i, a.name, a.strings, this, e) : a.type === 6 && (c = new Ze(i, this, e)), this._$AV.push(c), a = r[++l];
353
+ a.type === 2 ? c = new Z(i, i.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(i, a.name, a.strings, this, t) : a.type === 6 && (c = new Xt(i, this, t)), this._$AV.push(c), a = s[++l];
354
354
  }
355
- n !== a?.index && (i = C.nextNode(), n++);
355
+ n !== a?.index && (i = H.nextNode(), n++);
356
356
  }
357
- return C.currentNode = P, s;
357
+ return H.currentNode = T, r;
358
358
  }
359
- p(e) {
359
+ p(t) {
360
360
  let o = 0;
361
- for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(e, r, o), o += r.strings.length - 2) : r._$AI(e[o])), o++;
361
+ for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, o), o += s.strings.length - 2) : s._$AI(t[o])), o++;
362
362
  }
363
363
  }
364
- class q {
364
+ class Z {
365
365
  get _$AU() {
366
366
  return this._$AM?._$AU ?? this._$Cv;
367
367
  }
368
- constructor(e, o, r, s) {
369
- this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = e, this._$AB = o, this._$AM = r, this.options = s, this._$Cv = s?.isConnected ?? !0;
368
+ constructor(t, o, s, r) {
369
+ this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = t, this._$AB = o, this._$AM = s, this.options = r, this._$Cv = r?.isConnected ?? !0;
370
370
  }
371
371
  get parentNode() {
372
- let e = this._$AA.parentNode;
372
+ let t = this._$AA.parentNode;
373
373
  const o = this._$AM;
374
- return o !== void 0 && e?.nodeType === 11 && (e = o.parentNode), e;
374
+ return o !== void 0 && t?.nodeType === 11 && (t = o.parentNode), t;
375
375
  }
376
376
  get startNode() {
377
377
  return this._$AA;
@@ -379,135 +379,135 @@ class q {
379
379
  get endNode() {
380
380
  return this._$AB;
381
381
  }
382
- _$AI(e, o = this) {
383
- e = H(this, e, o), L(e) ? e === b || e == null || e === "" ? (this._$AH !== b && this._$AR(), this._$AH = b) : e !== this._$AH && e !== M && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : ze(e) ? this.k(e) : this._(e);
382
+ _$AI(t, o = this) {
383
+ t = F(this, t, o), q(t) ? t === b || t == null || t === "" ? (this._$AH !== b && this._$AR(), this._$AH = b) : t !== this._$AH && t !== O && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : jt(t) ? this.k(t) : this._(t);
384
384
  }
385
- O(e) {
386
- return this._$AA.parentNode.insertBefore(e, this._$AB);
385
+ O(t) {
386
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
387
387
  }
388
- T(e) {
389
- this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
388
+ T(t) {
389
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
390
390
  }
391
- _(e) {
392
- this._$AH !== b && L(this._$AH) ? this._$AA.nextSibling.data = e : this.T(P.createTextNode(e)), this._$AH = e;
391
+ _(t) {
392
+ this._$AH !== b && q(this._$AH) ? this._$AA.nextSibling.data = t : this.T(T.createTextNode(t)), this._$AH = t;
393
393
  }
394
- $(e) {
395
- const { values: o, _$litType$: r } = e, s = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = z.createElement(Ae(r.h, r.h[0]), this.options)), r);
396
- if (this._$AH?._$AD === s) this._$AH.p(o);
394
+ $(t) {
395
+ const { values: o, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = W.createElement(At(s.h, s.h[0]), this.options)), s);
396
+ if (this._$AH?._$AD === r) this._$AH.p(o);
397
397
  else {
398
- const i = new Re(s, this), n = i.u(this.options);
398
+ const i = new Wt(r, this), n = i.u(this.options);
399
399
  i.p(o), this.T(n), this._$AH = i;
400
400
  }
401
401
  }
402
- _$AC(e) {
403
- let o = _e.get(e.strings);
404
- return o === void 0 && _e.set(e.strings, o = new z(e)), o;
402
+ _$AC(t) {
403
+ let o = _t.get(t.strings);
404
+ return o === void 0 && _t.set(t.strings, o = new W(t)), o;
405
405
  }
406
- k(e) {
407
- ie(this._$AH) || (this._$AH = [], this._$AR());
406
+ k(t) {
407
+ at(this._$AH) || (this._$AH = [], this._$AR());
408
408
  const o = this._$AH;
409
- let r, s = 0;
410
- for (const i of e) s === o.length ? o.push(r = new q(this.O(F()), this.O(F()), this, this.options)) : r = o[s], r._$AI(i), s++;
411
- s < o.length && (this._$AR(r && r._$AB.nextSibling, s), o.length = s);
412
- }
413
- _$AR(e = this._$AA.nextSibling, o) {
414
- for (this._$AP?.(!1, !0, o); e !== this._$AB; ) {
415
- const r = pe(e).nextSibling;
416
- pe(e).remove(), e = r;
409
+ let s, r = 0;
410
+ for (const i of t) r === o.length ? o.push(s = new Z(this.O(I()), this.O(I()), this, this.options)) : s = o[r], s._$AI(i), r++;
411
+ r < o.length && (this._$AR(s && s._$AB.nextSibling, r), o.length = r);
412
+ }
413
+ _$AR(t = this._$AA.nextSibling, o) {
414
+ for (this._$AP?.(!1, !0, o); t !== this._$AB; ) {
415
+ const s = bt(t).nextSibling;
416
+ bt(t).remove(), t = s;
417
417
  }
418
418
  }
419
- setConnected(e) {
420
- this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
419
+ setConnected(t) {
420
+ this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
421
421
  }
422
422
  }
423
- class Q {
423
+ class et {
424
424
  get tagName() {
425
425
  return this.element.tagName;
426
426
  }
427
427
  get _$AU() {
428
428
  return this._$AM._$AU;
429
429
  }
430
- constructor(e, o, r, s, i) {
431
- this.type = 1, this._$AH = b, this._$AN = void 0, this.element = e, this.name = o, this._$AM = s, this.options = i, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = b;
430
+ constructor(t, o, s, r, i) {
431
+ this.type = 1, this._$AH = b, this._$AN = void 0, this.element = t, this.name = o, this._$AM = r, this.options = i, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = b;
432
432
  }
433
- _$AI(e, o = this, r, s) {
433
+ _$AI(t, o = this, s, r) {
434
434
  const i = this.strings;
435
435
  let n = !1;
436
- if (i === void 0) e = H(this, e, o, 0), n = !L(e) || e !== this._$AH && e !== M, n && (this._$AH = e);
436
+ if (i === void 0) t = F(this, t, o, 0), n = !q(t) || t !== this._$AH && t !== O, n && (this._$AH = t);
437
437
  else {
438
- const l = e;
438
+ const l = t;
439
439
  let a, c;
440
- for (e = i[0], a = 0; a < i.length - 1; a++) c = H(this, l[r + a], o, a), c === M && (c = this._$AH[a]), n ||= !L(c) || c !== this._$AH[a], c === b ? e = b : e !== b && (e += (c ?? "") + i[a + 1]), this._$AH[a] = c;
440
+ for (t = i[0], a = 0; a < i.length - 1; a++) c = F(this, l[s + a], o, a), c === O && (c = this._$AH[a]), n ||= !q(c) || c !== this._$AH[a], c === b ? t = b : t !== b && (t += (c ?? "") + i[a + 1]), this._$AH[a] = c;
441
441
  }
442
- n && !s && this.j(e);
442
+ n && !r && this.j(t);
443
443
  }
444
- j(e) {
445
- e === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
444
+ j(t) {
445
+ t === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
446
446
  }
447
447
  }
448
- class qe extends Q {
448
+ class Kt extends et {
449
449
  constructor() {
450
450
  super(...arguments), this.type = 3;
451
451
  }
452
- j(e) {
453
- this.element[this.name] = e === b ? void 0 : e;
452
+ j(t) {
453
+ this.element[this.name] = t === b ? void 0 : t;
454
454
  }
455
455
  }
456
- class We extends Q {
456
+ class Yt extends et {
457
457
  constructor() {
458
458
  super(...arguments), this.type = 4;
459
459
  }
460
- j(e) {
461
- this.element.toggleAttribute(this.name, !!e && e !== b);
460
+ j(t) {
461
+ this.element.toggleAttribute(this.name, !!t && t !== b);
462
462
  }
463
463
  }
464
- class Ke extends Q {
465
- constructor(e, o, r, s, i) {
466
- super(e, o, r, s, i), this.type = 5;
464
+ class Zt extends et {
465
+ constructor(t, o, s, r, i) {
466
+ super(t, o, s, r, i), this.type = 5;
467
467
  }
468
- _$AI(e, o = this) {
469
- if ((e = H(this, e, o, 0) ?? b) === M) return;
470
- const r = this._$AH, s = e === b && r !== b || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, i = e !== b && (r === b || s);
471
- s && this.element.removeEventListener(this.name, this, r), i && this.element.addEventListener(this.name, this, e), this._$AH = e;
468
+ _$AI(t, o = this) {
469
+ if ((t = F(this, t, o, 0) ?? b) === O) return;
470
+ const s = this._$AH, r = t === b && s !== b || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, i = t !== b && (s === b || r);
471
+ r && this.element.removeEventListener(this.name, this, s), i && this.element.addEventListener(this.name, this, t), this._$AH = t;
472
472
  }
473
- handleEvent(e) {
474
- typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
473
+ handleEvent(t) {
474
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
475
475
  }
476
476
  }
477
- class Ze {
478
- constructor(e, o, r) {
479
- this.element = e, this.type = 6, this._$AN = void 0, this._$AM = o, this.options = r;
477
+ class Xt {
478
+ constructor(t, o, s) {
479
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = o, this.options = s;
480
480
  }
481
481
  get _$AU() {
482
482
  return this._$AM._$AU;
483
483
  }
484
- _$AI(e) {
485
- H(this, e);
484
+ _$AI(t) {
485
+ F(this, t);
486
486
  }
487
487
  }
488
- const Ye = se.litHtmlPolyfillSupport;
489
- Ye?.(z, q), (se.litHtmlVersions ??= []).push("3.3.2");
490
- const Xe = (t, e, o) => {
491
- const r = o?.renderBefore ?? e;
492
- let s = r._$litPart$;
493
- if (s === void 0) {
488
+ const Gt = nt.litHtmlPolyfillSupport;
489
+ Gt?.(W, Z), (nt.litHtmlVersions ??= []).push("3.3.2");
490
+ const Jt = (e, t, o) => {
491
+ const s = o?.renderBefore ?? t;
492
+ let r = s._$litPart$;
493
+ if (r === void 0) {
494
494
  const i = o?.renderBefore ?? null;
495
- r._$litPart$ = s = new q(e.insertBefore(F(), i), i, void 0, o ?? {});
495
+ s._$litPart$ = r = new Z(t.insertBefore(I(), i), i, void 0, o ?? {});
496
496
  }
497
- return s._$AI(t), s;
497
+ return r._$AI(e), r;
498
498
  };
499
- const ne = globalThis;
500
- let V = class extends B {
499
+ const lt = globalThis;
500
+ let N = class extends V {
501
501
  constructor() {
502
502
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
503
503
  }
504
504
  createRenderRoot() {
505
- const e = super.createRenderRoot();
506
- return this.renderOptions.renderBefore ??= e.firstChild, e;
505
+ const t = super.createRenderRoot();
506
+ return this.renderOptions.renderBefore ??= t.firstChild, t;
507
507
  }
508
- update(e) {
508
+ update(t) {
509
509
  const o = this.render();
510
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Xe(o, this.renderRoot, this.renderOptions);
510
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Jt(o, this.renderRoot, this.renderOptions);
511
511
  }
512
512
  connectedCallback() {
513
513
  super.connectedCallback(), this._$Do?.setConnected(!0);
@@ -516,26 +516,26 @@ let V = class extends B {
516
516
  super.disconnectedCallback(), this._$Do?.setConnected(!1);
517
517
  }
518
518
  render() {
519
- return M;
519
+ return O;
520
520
  }
521
521
  };
522
- V._$litElement$ = !0, V.finalized = !0, ne.litElementHydrateSupport?.({ LitElement: V });
523
- const Ge = ne.litElementPolyfillSupport;
524
- Ge?.({ LitElement: V });
525
- (ne.litElementVersions ??= []).push("4.2.2");
526
- const Je = E`:host{cursor:pointer;-webkit-user-select:none;user-select:none;width:calc(1rem + 2px);height:calc(1rem + 2px)}:host([disabled]){cursor:not-allowed;opacity:.6}.checkbox-container{position:relative;transition:opacity .2s ease}.checkbox-box{width:1rem;height:1rem;border-radius:.25rem;background-color:var(--nf-background-color);border:1px solid var(--nf-border-color);display:flex;align-items:center;justify-content:center;transition:background-color .2s ease,border-color .2s ease}:host(:hover:not([checked]):not([disabled])) .checkbox-box{border-color:var(--nf-primary-color,var(--nf-primary-color))}:host([checked]) .checkbox-box{background-color:var(--nf-primary-color,var(--nf-primary-color));border-color:var(--nf-primary-color,var(--nf-primary-color))}:host([disabled]) .checkbox-box{border-color:#fffc;background:#fffc;cursor:not-allowed;pointer-events:none}:host([disabled][checked]) .checkbox-box{background-color:#fffc;border-color:#fffc}.checkbox-icon{color:#fff;font-size:.75rem;line-height:1;font-weight:700;transition:transform .2s ease;display:flex;align-items:center}:host([checked]) .checkbox-icon{transform:scale(1)}:host(:focus) .checkbox-container{outline:.125rem solid var(--nf-primary-color,var(--nf-primary-color));outline-offset:.125rem}`, T = (t) => (e) => (typeof window > "u" || customElements.get(t) || customElements.define(t, e), e);
527
- var Qe = Object.defineProperty, et = Object.getOwnPropertyDescriptor, ae = (t, e, o, r) => {
528
- for (var s = r > 1 ? void 0 : r ? et(e, o) : e, i = t.length - 1, n; i >= 0; i--)
529
- (n = t[i]) && (s = (r ? n(e, o, s) : n(s)) || s);
530
- return r && s && Qe(e, o, s), s;
522
+ N._$litElement$ = !0, N.finalized = !0, lt.litElementHydrateSupport?.({ LitElement: N });
523
+ const Qt = lt.litElementPolyfillSupport;
524
+ Qt?.({ LitElement: N });
525
+ (lt.litElementVersions ??= []).push("4.2.2");
526
+ const te = A`:host{cursor:pointer;-webkit-user-select:none;user-select:none;width:calc(1rem + 2px);height:calc(1rem + 2px)}:host([disabled]){cursor:not-allowed;opacity:.6}.checkbox-container{position:relative;transition:opacity .2s ease}.checkbox-box{width:1rem;height:1rem;border-radius:.25rem;background-color:var(--nf-background-color);border:1px solid var(--nf-border-color);display:flex;align-items:center;justify-content:center;transition:background-color .2s ease,border-color .2s ease}:host(:hover:not([checked]):not([disabled])) .checkbox-box{border-color:var(--nf-primary-color,var(--nf-primary-color))}:host([checked]) .checkbox-box{background-color:var(--nf-primary-color,var(--nf-primary-color));border-color:var(--nf-primary-color,var(--nf-primary-color))}:host([disabled]) .checkbox-box{border-color:#fffc;background:#fffc;cursor:not-allowed;pointer-events:none}:host([disabled][checked]) .checkbox-box{background-color:#fffc;border-color:#fffc}.checkbox-icon{color:#fff;font-size:.75rem;line-height:1;font-weight:700;transition:transform .2s ease;display:flex;align-items:center}:host([checked]) .checkbox-icon{transform:scale(1)}:host(:focus) .checkbox-container{outline:.125rem solid var(--nf-primary-color,var(--nf-primary-color));outline-offset:.125rem}`, D = (e) => (t) => (typeof window > "u" || customElements.get(e) || customElements.define(e, t), t);
527
+ var ee = Object.defineProperty, oe = Object.getOwnPropertyDescriptor, ht = (e, t, o, s) => {
528
+ for (var r = s > 1 ? void 0 : s ? oe(t, o) : t, i = e.length - 1, n; i >= 0; i--)
529
+ (n = e[i]) && (r = (s ? n(t, o, r) : n(r)) || r);
530
+ return s && r && ee(t, o, r), r;
531
531
  };
532
- let j = class extends V {
532
+ let K = class extends N {
533
533
  constructor() {
534
534
  super(...arguments), this.checked = !1, this.disabled = !1;
535
535
  }
536
536
  // 切换复选框状态
537
- toggleCheckbox(t) {
538
- this.disabled || (t.stopPropagation(), this.checked = !this.checked, this.dispatchEvent(
537
+ toggleCheckbox(e) {
538
+ this.disabled || (e.stopPropagation(), this.checked = !this.checked, this.dispatchEvent(
539
539
  new CustomEvent("change", {
540
540
  bubbles: !0,
541
541
  composed: !0,
@@ -545,7 +545,7 @@ let j = class extends V {
545
545
  }
546
546
  // 渲染复选框组件
547
547
  render() {
548
- return te`<div class=checkbox-container @click=${this.toggleCheckbox} aria-checked=${this.checked} aria-disabled=${this.disabled} role=checkbox><div class=checkbox-box>${this.checked ? te`<div class=checkbox-icon><svg viewBox="64 64 896 896"focusable=false data-icon=check width=0.625rem height=0.625rem fill=currentColor aria-hidden=true><path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"></path></svg></div>` : ""}</div></div>`;
548
+ return st`<div class=checkbox-container @click=${this.toggleCheckbox} aria-checked=${this.checked} aria-disabled=${this.disabled} role=checkbox><div class=checkbox-box>${this.checked ? st`<div class=checkbox-icon><svg viewBox="64 64 896 896"focusable=false data-icon=check width=0.625rem height=0.625rem fill=currentColor aria-hidden=true><path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"></path></svg></div>` : ""}</div></div>`;
549
549
  }
550
550
  connectedCallback() {
551
551
  this.style.transition = "none", super.connectedCallback(), requestAnimationFrame(() => {
@@ -553,36 +553,36 @@ let j = class extends V {
553
553
  });
554
554
  }
555
555
  };
556
- j.styles = [Je];
557
- ae([
556
+ K.styles = [te];
557
+ ht([
558
558
  h({ type: Boolean, reflect: !0 })
559
- ], j.prototype, "checked", 2);
560
- ae([
559
+ ], K.prototype, "checked", 2);
560
+ ht([
561
561
  h({ type: Boolean, reflect: !0 })
562
- ], j.prototype, "disabled", 2);
563
- j = ae([
564
- T("nf-checkbox")
565
- ], j);
566
- const W = E`:host{display:inline-flex;align-items:center;position:relative;width:var(--nf-width);height:var(--nf-height);padding:var(--nf-padding);margin:var(--nf-margin);font-size:var(--nf-text-font-size);font-weight:var(--nf-font-weight);color:var(--nf-color);background:var(--nf-background-color);border-radius:var(--nf-border-radius);border:1px solid var(--nf-border-color);outline:0;background-clip:padding-box;box-shadow:0 0 0 .15rem var(--nf-box-shadow-color);transition:color var(--nf-transition) ease-in-out,background-color var(--nf-transition) ease-in-out,border-color var(--nf-transition) ease-in-out,box-shadow var(--nf-transition) ease-in-out}:host(:focus){border-color:var(--nf-border-color-hover);box-shadow:0 0 0 .15rem var(--nf-box-shadow-color-focus);background:var(--nf-background-color-hover)}:host(:hover:not([disabled])){border-color:var(--nf-border-color-hover);background:var(--nf-background-color-hover)}:host([disabled]){cursor:not-allowed;opacity:.6;pointer-events:auto}:host([disabled]:hover){border-color:var(--nf-border-color);background:var(--nf-background-color)}`, tt = E`:host{display:inline-block;position:relative;width:calc(.9rem + (var(--nf-height) - 1.25rem)/ 2 + 7ch)}:host(:not([disabled-alpha])){width:calc(.9rem + (var(--nf-height) - 1.25rem)/ 2 + 9ch)}:host([disabled]){cursor:not-allowed;opacity:.6}:host([disabled]:hover){border-color:var(--nf-border-color);background:var(--nf-background-color)}:host([open]){border-color:var(--nf-border-color-hover);box-shadow:0 0 0 .15rem var(--nf-box-shadow-color-focus)}.trigger{width:calc(100% + 1.5rem + 2px);height:calc(100% + 2px);margin:-1px -.75rem;padding:1px .75rem;box-sizing:border-box;display:flex;align-items:center;cursor:pointer;transition:all .2s;font-size:.875rem;position:relative}:host(:not([disabled])) .trigger:hover{border-color:var(--nf-color-primary)}.trigger[disabled]{cursor:not-allowed;opacity:.6}:host([disabled]) .trigger{cursor:not-allowed;color:var(--nf-color-disabled)}.color-block{width:1.25rem;height:1.25rem;border-radius:.125rem;margin-left:calc((var(--nf-height) - 1.25rem)/ 2 - .75rem);margin-right:.4rem}:host(.hide-text) .color-block{margin-right:calc((var(--nf-height) - 1.25rem)/ 2 - .75rem)}.color-text{flex:1;text-align:center;text-transform:uppercase}.panel{position:absolute;z-index:1000;background:var(--nf-color-picker-card-background,var(--nf-dropdown-background));-webkit-backdrop-filter:blur(64px);backdrop-filter:blur(64px);border-radius:var(--nf-border-radius);box-shadow:0 6px 16px 0 var(--nf-color-picker-card-shadow,var(--nf-dropdown-shadow)),0 3px 6px -4px var(--nf-color-picker-card-shadow,var(--nf-dropdown-shadow)),0 9px 28px 8px var(--nf-color-picker-card-shadow,var(--nf-dropdown-shadow));-webkit-user-select:none;user-select:none}.panel-content{padding:.75rem;width:15rem}.color-selector{height:9.375rem;position:relative;margin-bottom:.75rem;border-radius:var(--nf-border-radius);overflow:hidden}.color-sb{width:100%;height:100%;position:relative;cursor:pointer}.sb-white{position:absolute;inset:0;background:linear-gradient(to right,#fff,#fff0)}.sb-black{position:absolute;inset:0;background:linear-gradient(to top,#000,#0000)}.selector{position:absolute;width:.625rem;height:.625rem;border:.125rem solid #fff;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 .125rem #00000080;pointer-events:none}.slider-container{margin-bottom:.5rem}.slider-container:last-child{margin-bottom:0}.sliders-row{display:flex;align-items:center;gap:.75rem}.sliders{flex:1}.slider{position:relative;height:.75rem;border-radius:.375rem}.hue-slider{background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red)}.alpha-slider{position:relative;background-image:linear-gradient(45deg,var(--nf-color-picker-card-checker,#ccc) 25%,transparent 25%),linear-gradient(-45deg,var(--nf-color-picker-card-checker,#ccc) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--nf-color-picker-card-checker,#ccc) 75%),linear-gradient(-45deg,transparent 75%,var(--nf-color-picker-card-checker,#ccc) 75%);background-size:.375rem .375rem;background-position:0 0,0 .1875rem,.1875rem -.1875rem,-.1875rem 0;background-color:var(--nf-color-picker-card-checker-bg,#fff);border-radius:.375rem}.alpha-slider-input{position:relative;z-index:2}.alpha-gradient{position:absolute;inset:0;border-radius:.375rem}input[type=range]{-webkit-appearance:none;width:100%;height:100%;background:0 0;outline:0;position:absolute;top:0;left:0;margin:0;padding:0}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:1rem;height:1rem;border-radius:50%;background:#fff;border:.125rem solid var(--nf-color-border);cursor:pointer;box-shadow:0 0 .125rem #00000080;position:relative;z-index:1}input[type=range]::-moz-range-thumb{width:1rem;height:1rem;border-radius:50%;background:#fff;border:.125rem solid var(--nf-color-border);cursor:pointer;box-shadow:0 0 .125rem #00000080}.current-color-container{display:flex}.current-color{width:2rem;height:2rem;border-radius:var(--nf-border-radius);border:.0625rem solid var(--nf-color-border)}:host(:not([disabled-alpha])) .current-color{width:2.5rem;height:2.5rem}`;
567
- var ot = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, _ = (t, e, o, r) => {
568
- for (var s = r > 1 ? void 0 : r ? rt(e, o) : e, i = t.length - 1, n; i >= 0; i--)
569
- (n = t[i]) && (s = (r ? n(e, o, s) : n(s)) || s);
570
- return r && s && ot(e, o, s), s;
562
+ ], K.prototype, "disabled", 2);
563
+ K = ht([
564
+ D("nf-checkbox")
565
+ ], K);
566
+ const U = A`:host{display:inline-flex;align-items:center;position:relative;width:var(--nf-width);height:var(--nf-height);padding:var(--nf-padding);margin:var(--nf-margin);font-size:var(--nf-text-font-size);font-weight:var(--nf-font-weight);color:var(--nf-color);background:var(--nf-background-color);border-radius:var(--nf-border-radius);border:1px solid var(--nf-border-color);outline:0;background-clip:padding-box;box-shadow:0 0 0 .15rem var(--nf-box-shadow-color);transition:color var(--nf-transition) ease-in-out,background-color var(--nf-transition) ease-in-out,border-color var(--nf-transition) ease-in-out,box-shadow var(--nf-transition) ease-in-out}:host(:focus){border-color:var(--nf-border-color-hover);box-shadow:0 0 0 .15rem var(--nf-box-shadow-color-focus);background:var(--nf-background-color-hover)}:host(:hover:not([disabled])){border-color:var(--nf-border-color-hover);background:var(--nf-background-color-hover)}:host([disabled]){cursor:not-allowed;opacity:.6;pointer-events:auto}:host([disabled]:hover){border-color:var(--nf-border-color);background:var(--nf-background-color)}`, se = A`:host{display:inline-block;position:relative;width:calc(.9rem + (var(--nf-height) - 1.25rem)/ 2 + 7ch)}:host(:not([disabled-alpha])){width:calc(.9rem + (var(--nf-height) - 1.25rem)/ 2 + 9ch)}:host([disabled]){cursor:not-allowed;opacity:.6}:host([disabled]:hover){border-color:var(--nf-border-color);background:var(--nf-background-color)}:host([open]){border-color:var(--nf-border-color-hover);box-shadow:0 0 0 .15rem var(--nf-box-shadow-color-focus)}.trigger{width:calc(100% + 1.5rem + 2px);height:calc(100% + 2px);margin:-1px -.75rem;padding:1px .75rem;box-sizing:border-box;display:flex;align-items:center;cursor:pointer;transition:all .2s;font-size:.875rem;position:relative}:host(:not([disabled])) .trigger:hover{border-color:var(--nf-color-primary)}.trigger[disabled]{cursor:not-allowed;opacity:.6}:host([disabled]) .trigger{cursor:not-allowed;color:var(--nf-color-disabled)}.color-block{width:1.25rem;height:1.25rem;border-radius:.125rem;margin-left:calc((var(--nf-height) - 1.25rem)/ 2 - .75rem);margin-right:.4rem}:host(.hide-text) .color-block{margin-right:calc((var(--nf-height) - 1.25rem)/ 2 - .75rem)}.color-text{flex:1;text-align:center;text-transform:uppercase}.panel{position:absolute;z-index:1000;background:var(--nf-color-picker-card-background,var(--nf-dropdown-background));-webkit-backdrop-filter:blur(64px);backdrop-filter:blur(64px);border-radius:var(--nf-border-radius);box-shadow:0 6px 16px 0 var(--nf-color-picker-card-shadow,var(--nf-dropdown-shadow)),0 3px 6px -4px var(--nf-color-picker-card-shadow,var(--nf-dropdown-shadow)),0 9px 28px 8px var(--nf-color-picker-card-shadow,var(--nf-dropdown-shadow));-webkit-user-select:none;user-select:none}.panel-content{padding:.75rem;width:15rem}.color-selector{height:9.375rem;position:relative;margin-bottom:.75rem;border-radius:var(--nf-border-radius);overflow:hidden}.color-sb{width:100%;height:100%;position:relative;cursor:pointer}.sb-white{position:absolute;inset:0;background:linear-gradient(to right,#fff,#fff0)}.sb-black{position:absolute;inset:0;background:linear-gradient(to top,#000,#0000)}.selector{position:absolute;width:.625rem;height:.625rem;border:.125rem solid #fff;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 .125rem #00000080;pointer-events:none}.slider-container{margin-bottom:.5rem}.slider-container:last-child{margin-bottom:0}.sliders-row{display:flex;align-items:center;gap:.75rem}.sliders{flex:1}.slider{position:relative;height:.75rem;border-radius:.375rem}.hue-slider{background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red)}.alpha-slider{position:relative;background-image:linear-gradient(45deg,var(--nf-color-picker-card-checker,#ccc) 25%,transparent 25%),linear-gradient(-45deg,var(--nf-color-picker-card-checker,#ccc) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--nf-color-picker-card-checker,#ccc) 75%),linear-gradient(-45deg,transparent 75%,var(--nf-color-picker-card-checker,#ccc) 75%);background-size:.375rem .375rem;background-position:0 0,0 .1875rem,.1875rem -.1875rem,-.1875rem 0;background-color:var(--nf-color-picker-card-checker-bg,#fff);border-radius:.375rem}.alpha-slider-input{position:relative;z-index:2}.alpha-gradient{position:absolute;inset:0;border-radius:.375rem}input[type=range]{-webkit-appearance:none;width:100%;height:100%;background:0 0;outline:0;position:absolute;top:0;left:0;margin:0;padding:0}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:1rem;height:1rem;border-radius:50%;background:#fff;border:.125rem solid var(--nf-color-border);cursor:pointer;box-shadow:0 0 .125rem #00000080;position:relative;z-index:1}input[type=range]::-moz-range-thumb{width:1rem;height:1rem;border-radius:50%;background:#fff;border:.125rem solid var(--nf-color-border);cursor:pointer;box-shadow:0 0 .125rem #00000080}.current-color-container{display:flex}.current-color{width:2rem;height:2rem;border-radius:var(--nf-border-radius);border:.0625rem solid var(--nf-color-border)}:host(:not([disabled-alpha])) .current-color{width:2.5rem;height:2.5rem}`;
567
+ var re = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, y = (e, t, o, s) => {
568
+ for (var r = s > 1 ? void 0 : s ? ie(t, o) : t, i = e.length - 1, n; i >= 0; i--)
569
+ (n = e[i]) && (r = (s ? n(t, o, r) : n(r)) || r);
570
+ return s && r && re(t, o, r), r;
571
571
  };
572
- let g = class extends R {
572
+ let g = class extends L {
573
573
  constructor() {
574
- super(...arguments), this.value = "#FF0000", this.disabled = !1, this.disabledAlpha = !1, this.open = !1, this.showText = !0, this.placement = "bottom", this.align = "left", this.autoAdjust = !0, this._panelVisible = !1, this._internalValue = "#FF0000FF", this._hsb = { h: 0, s: 100, b: 100 }, this._panelPosition = { top: 0, left: 0 }, this._handleGlobalClick = (t) => {
575
- this._panelVisible && !this.contains(t.target) && this._closePanel();
576
- }, this._handleKeyDown = (t) => {
577
- this._panelVisible && t.key === "Escape" && this._closePanel();
578
- }, this._handleSBMouseDown = (t) => {
579
- t.preventDefault(), this._handleSBChange(t), document.addEventListener("mousemove", this._handleSBMouseMove), document.addEventListener("mouseup", this._handleSBMouseUp);
580
- }, this._handleSBMouseMove = (t) => {
581
- t.preventDefault(), this._handleSBChange(t);
574
+ super(...arguments), this.value = "#FF0000", this.disabled = !1, this.disabledAlpha = !1, this.open = !1, this.showText = !0, this.placement = "bottom", this.align = "left", this.autoAdjust = !0, this._panelVisible = !1, this._internalValue = "#FF0000FF", this._hsb = { h: 0, s: 100, b: 100 }, this._panelPosition = { top: 0, left: 0 }, this._handleGlobalClick = (e) => {
575
+ this._panelVisible && !this.contains(e.target) && this._closePanel();
576
+ }, this._handleKeyDown = (e) => {
577
+ this._panelVisible && e.key === "Escape" && this._closePanel();
578
+ }, this._handleSBMouseDown = (e) => {
579
+ e.preventDefault(), this._handleSBChange(e), document.addEventListener("mousemove", this._handleSBMouseMove), document.addEventListener("mouseup", this._handleSBMouseUp);
580
+ }, this._handleSBMouseMove = (e) => {
581
+ e.preventDefault(), this._handleSBChange(e);
582
582
  }, this._handleSBMouseUp = () => {
583
583
  document.removeEventListener("mousemove", this._handleSBMouseMove), document.removeEventListener("mouseup", this._handleSBMouseUp);
584
- }, this._handleSBTouchMove = (t) => {
585
- t.preventDefault(), this._handleSBChange(t);
584
+ }, this._handleSBTouchMove = (e) => {
585
+ e.preventDefault(), this._handleSBChange(e);
586
586
  };
587
587
  }
588
588
  connectedCallback() {
@@ -596,47 +596,47 @@ let g = class extends R {
596
596
  firstUpdated() {
597
597
  this._updateInternalValue(this.value), this._updateHSBFromHex(this._internalValue), this.classList.toggle("hide-text", !this.showText);
598
598
  }
599
- updated(t) {
600
- t.has("value") && (this._updateInternalValue(this.value), this._updateHSBFromHex(this._internalValue)), t.has("open") && (this._panelVisible = this.open, this.open && this._updatePanelPosition()), t.has("showText") && this.classList.toggle("hide-text", !this.showText);
599
+ updated(e) {
600
+ e.has("value") && (this._updateInternalValue(this.value), this._updateHSBFromHex(this._internalValue)), e.has("open") && (this._panelVisible = this.open, this.open && this._updatePanelPosition()), e.has("showText") && this.classList.toggle("hide-text", !this.showText);
601
601
  }
602
602
  // 更新内部颜色值
603
- _updateInternalValue(t) {
604
- if (t.startsWith("#")) {
605
- const e = t.slice(1);
606
- e.length === 6 ? this._internalValue = t + "FF" : e.length === 8 ? this._internalValue = t : this._internalValue = "#FF0000FF";
603
+ _updateInternalValue(e) {
604
+ if (e.startsWith("#")) {
605
+ const t = e.slice(1);
606
+ t.length === 6 ? this._internalValue = e + "FF" : t.length === 8 ? this._internalValue = e : this._internalValue = "#FF0000FF";
607
607
  } else
608
608
  this._internalValue = "#FF0000FF";
609
609
  }
610
610
  // 从HEX颜色值更新HSB值
611
- _updateHSBFromHex(t) {
612
- const e = parseInt(t.slice(1, 3), 16) / 255, o = parseInt(t.slice(3, 5), 16) / 255, r = parseInt(t.slice(5, 7), 16) / 255, s = Math.max(e, o, r), i = Math.min(e, o, r), n = s - i;
611
+ _updateHSBFromHex(e) {
612
+ const t = parseInt(e.slice(1, 3), 16) / 255, o = parseInt(e.slice(3, 5), 16) / 255, s = parseInt(e.slice(5, 7), 16) / 255, r = Math.max(t, o, s), i = Math.min(t, o, s), n = r - i;
613
613
  let l = 0, a = 0;
614
- const c = s;
615
- n !== 0 && (a = n / s, s === e ? l = (o - r) / n % 6 : s === o ? l = (r - e) / n + 2 : l = (e - o) / n + 4, l *= 60, l < 0 && (l += 360)), this._hsb = {
614
+ const c = r;
615
+ n !== 0 && (a = n / r, r === t ? l = (o - s) / n % 6 : r === o ? l = (s - t) / n + 2 : l = (t - o) / n + 4, l *= 60, l < 0 && (l += 360)), this._hsb = {
616
616
  h: Math.round(l),
617
617
  s: Math.round(a * 100),
618
618
  b: Math.round(c * 100)
619
619
  };
620
620
  }
621
621
  // 从HSB值生成HEX颜色值
622
- _generateHexFromHSB(t, e, o, r = "FF") {
623
- e /= 100, o /= 100;
624
- const s = o * e, i = s * (1 - Math.abs(t / 60 % 2 - 1)), n = o - s;
622
+ _generateHexFromHSB(e, t, o, s = "FF") {
623
+ t /= 100, o /= 100;
624
+ const r = o * t, i = r * (1 - Math.abs(e / 60 % 2 - 1)), n = o - r;
625
625
  let l = 0, a = 0, c = 0;
626
- return 0 <= t && t < 60 ? (l = s, a = i, c = 0) : 60 <= t && t < 120 ? (l = i, a = s, c = 0) : 120 <= t && t < 180 ? (l = 0, a = s, c = i) : 180 <= t && t < 240 ? (l = 0, a = i, c = s) : 240 <= t && t < 300 ? (l = i, a = 0, c = s) : 300 <= t && t < 360 && (l = s, a = 0, c = i), l = Math.round((l + n) * 255), a = Math.round((a + n) * 255), c = Math.round((c + n) * 255), "#" + l.toString(16).padStart(2, "0") + a.toString(16).padStart(2, "0") + c.toString(16).padStart(2, "0") + r;
626
+ return 0 <= e && e < 60 ? (l = r, a = i, c = 0) : 60 <= e && e < 120 ? (l = i, a = r, c = 0) : 120 <= e && e < 180 ? (l = 0, a = r, c = i) : 180 <= e && e < 240 ? (l = 0, a = i, c = r) : 240 <= e && e < 300 ? (l = i, a = 0, c = r) : 300 <= e && e < 360 && (l = r, a = 0, c = i), l = Math.round((l + n) * 255), a = Math.round((a + n) * 255), c = Math.round((c + n) * 255), "#" + l.toString(16).padStart(2, "0") + a.toString(16).padStart(2, "0") + c.toString(16).padStart(2, "0") + s;
627
627
  }
628
628
  // 计算面板位置
629
629
  _updatePanelPosition() {
630
630
  requestAnimationFrame(() => {
631
- const t = this.getBoundingClientRect(), e = this.shadowRoot?.querySelector(".panel");
632
- if (!e) return;
633
- const o = 0.15 * 16, r = 8, s = e.offsetWidth || 240, i = e.offsetHeight || 300;
631
+ const e = this.getBoundingClientRect(), t = this.shadowRoot?.querySelector(".panel");
632
+ if (!t) return;
633
+ const o = 0.15 * 16, s = 8, r = t.offsetWidth || 240, i = t.offsetHeight || 300;
634
634
  let n = this.placement, l = this.align;
635
- this.autoAdjust && (n === "bottom" ? window.innerHeight - t.bottom - r < i && t.top - r >= i && (n = "top") : t.top - r < i && window.innerHeight - t.bottom - r >= i && (n = "bottom"), l === "right" ? t.right - o < s && t.left + t.width + o + s <= window.innerWidth && (l = "left") : t.left - o + s > window.innerWidth && t.right - o >= s && (l = "right"));
635
+ this.autoAdjust && (n === "bottom" ? window.innerHeight - e.bottom - s < i && e.top - s >= i && (n = "top") : e.top - s < i && window.innerHeight - e.bottom - s >= i && (n = "bottom"), l === "right" ? e.right - o < r && e.left + e.width + o + r <= window.innerWidth && (l = "left") : e.left - o + r > window.innerWidth && e.right - o >= r && (l = "right"));
636
636
  let a;
637
- n === "bottom" ? a = t.height + r : a = -i - r;
637
+ n === "bottom" ? a = e.height + s : a = -i - s;
638
638
  let c;
639
- l === "right" ? c = t.width - s + o : c = -o, this._panelPosition = { top: a, left: c };
639
+ l === "right" ? c = e.width - r + o : c = -o, this._panelPosition = { top: a, left: c };
640
640
  });
641
641
  }
642
642
  // 打开面板
@@ -662,47 +662,47 @@ let g = class extends R {
662
662
  this._panelVisible ? this._closePanel() : this._openPanel();
663
663
  }
664
664
  // 处理HSB颜色变化
665
- _handleHSBChange(t, e, o) {
666
- this._hsb = { h: t, s: e, b: o };
667
- const r = this._internalValue.slice(7), s = this._generateHexFromHSB(t, e, o, r);
668
- this._handleColorChange(s);
665
+ _handleHSBChange(e, t, o) {
666
+ this._hsb = { h: e, s: t, b: o };
667
+ const s = this._internalValue.slice(7), r = this._generateHexFromHSB(e, t, o, s);
668
+ this._handleColorChange(r);
669
669
  }
670
670
  // 处理Alpha值变化
671
- _handleAlphaChange(t) {
672
- const e = Math.round(t * 255 / 100).toString(16).padStart(2, "0").toUpperCase(), o = "#" + this._internalValue.slice(1, 7) + e;
671
+ _handleAlphaChange(e) {
672
+ const t = Math.round(e * 255 / 100).toString(16).padStart(2, "0").toUpperCase(), o = "#" + this._internalValue.slice(1, 7) + t;
673
673
  this._handleColorChange(o);
674
674
  }
675
675
  // 处理颜色变化
676
- _handleColorChange(t) {
677
- this._internalValue = t;
678
- const e = this.disabledAlpha || t.endsWith("FF") ? "#" + t.slice(1, 7) : t;
676
+ _handleColorChange(e) {
677
+ this._internalValue = e;
678
+ const t = this.disabledAlpha || e.endsWith("FF") ? "#" + e.slice(1, 7) : e;
679
679
  this.dispatchEvent(new CustomEvent("change", {
680
- detail: e,
680
+ detail: t,
681
681
  bubbles: !0,
682
682
  composed: !0
683
683
  }));
684
684
  }
685
685
  // 处理色相选择
686
- _handleHueChange(t) {
687
- const e = t.target, o = parseInt(e.value);
686
+ _handleHueChange(e) {
687
+ const t = e.target, o = parseInt(t.value);
688
688
  this._handleHSBChange(o, this._hsb.s, this._hsb.b);
689
689
  }
690
690
  // 处理饱和度和亮度选择
691
- _handleSBChange(t) {
692
- const e = this.shadowRoot?.querySelector(".color-sb");
693
- if (!e) return;
694
- const o = e.getBoundingClientRect(), r = t instanceof MouseEvent ? t.clientX : t.touches[0].clientX, s = t instanceof MouseEvent ? t.clientY : t.touches[0].clientY, i = Math.max(0, Math.min(100, Math.round((r - o.left) / o.width * 100))), n = Math.max(0, Math.min(100, Math.round((1 - (s - o.top) / o.height) * 100)));
691
+ _handleSBChange(e) {
692
+ const t = this.shadowRoot?.querySelector(".color-sb");
693
+ if (!t) return;
694
+ const o = t.getBoundingClientRect(), s = e instanceof MouseEvent ? e.clientX : e.touches[0].clientX, r = e instanceof MouseEvent ? e.clientY : e.touches[0].clientY, i = Math.max(0, Math.min(100, Math.round((s - o.left) / o.width * 100))), n = Math.max(0, Math.min(100, Math.round((1 - (r - o.top) / o.height) * 100)));
695
695
  this._handleHSBChange(this._hsb.h, i, n);
696
696
  }
697
697
  // 处理透明度选择
698
- _handleAlphaChangeInput(t) {
699
- const e = t.target, o = parseInt(e.value);
698
+ _handleAlphaChangeInput(e) {
699
+ const t = e.target, o = parseInt(t.value);
700
700
  this._handleAlphaChange(o);
701
701
  }
702
702
  // 渲染触发器
703
703
  _renderTrigger() {
704
- const t = "#" + this._internalValue.slice(1, 7), e = this._internalValue.slice(7);
705
- return f`
704
+ const e = "#" + this._internalValue.slice(1, 7), t = this._internalValue.slice(7);
705
+ return p`
706
706
  <div
707
707
  class="trigger"
708
708
  @click="${this._togglePanel}"
@@ -710,20 +710,20 @@ let g = class extends R {
710
710
  >
711
711
  <div
712
712
  class="color-block"
713
- style="background-color: ${this.disabledAlpha ? t : this._internalValue}"
713
+ style="background-color: ${this.disabledAlpha ? e : this._internalValue}"
714
714
  ></div>
715
- ${this.showText ? f`<div class="color-text">${this.disabledAlpha || e === "FF" ? t : this._internalValue}</div>` : ""}
715
+ ${this.showText ? p`<div class="color-text">${this.disabledAlpha || t === "FF" ? e : this._internalValue}</div>` : ""}
716
716
  </div>
717
717
  `;
718
718
  }
719
719
  // 渲染颜色选择区域
720
720
  _renderColorSelector() {
721
- const t = this._generateHexFromHSB(this._hsb.h, 100, 100, "FF"), e = this._hsb.s / 100 * 100, o = (1 - this._hsb.b / 100) * 100;
722
- return f`
721
+ const e = this._generateHexFromHSB(this._hsb.h, 100, 100, "FF"), t = this._hsb.s / 100 * 100, o = (1 - this._hsb.b / 100) * 100;
722
+ return p`
723
723
  <div class="color-selector">
724
724
  <div
725
725
  class="color-sb"
726
- style="background-color: ${t};"
726
+ style="background-color: ${e};"
727
727
  @mousedown="${this._handleSBMouseDown}"
728
728
  @touchstart="${this._handleSBTouchMove}"
729
729
  @touchmove="${this._handleSBTouchMove}"
@@ -732,7 +732,7 @@ let g = class extends R {
732
732
  <div class="sb-black"></div>
733
733
  <div
734
734
  class="selector"
735
- style="left: ${e}%; top: ${o}%;"
735
+ style="left: ${t}%; top: ${o}%;"
736
736
  ></div>
737
737
  </div>
738
738
  </div>
@@ -740,7 +740,7 @@ let g = class extends R {
740
740
  }
741
741
  // 渲染色相选择条
742
742
  _renderHueSlider() {
743
- return f`
743
+ return p`
744
744
  <div class="slider-container">
745
745
  <div class="slider hue-slider">
746
746
  <input
@@ -758,19 +758,19 @@ let g = class extends R {
758
758
  // 渲染透明度选择条
759
759
  _renderAlphaSlider() {
760
760
  if (this.disabledAlpha) return null;
761
- const t = parseInt(this._internalValue.slice(7), 16) / 255 * 100, e = "#" + this._internalValue.slice(1, 7);
762
- return f`
761
+ const e = parseInt(this._internalValue.slice(7), 16) / 255 * 100, t = "#" + this._internalValue.slice(1, 7);
762
+ return p`
763
763
  <div class="slider-container">
764
764
  <div class="slider alpha-slider">
765
765
  <div
766
766
  class="alpha-gradient"
767
- style="background: linear-gradient(to right, transparent, ${e})"
767
+ style="background: linear-gradient(to right, transparent, ${t})"
768
768
  ></div>
769
769
  <input
770
770
  type="range"
771
771
  min="0"
772
772
  max="100"
773
- .value="${Math.round(t).toString()}"
773
+ .value="${Math.round(e).toString()}"
774
774
  @input="${this._handleAlphaChangeInput}"
775
775
  class="alpha-slider-input"
776
776
  >
@@ -780,7 +780,7 @@ let g = class extends R {
780
780
  }
781
781
  // 渲染当前颜色显示
782
782
  _renderCurrentColor() {
783
- return f`
783
+ return p`
784
784
  <div class="current-color-container">
785
785
  <div
786
786
  class="current-color"
@@ -791,7 +791,7 @@ let g = class extends R {
791
791
  }
792
792
  // 渲染颜色面板
793
793
  _renderPanel() {
794
- return this._panelVisible ? f`
794
+ return this._panelVisible ? p`
795
795
  <div
796
796
  class="panel"
797
797
  style="top: ${this._panelPosition.top}px; left: ${this._panelPosition.left}px;"
@@ -810,124 +810,124 @@ let g = class extends R {
810
810
  ` : null;
811
811
  }
812
812
  render() {
813
- return f`
813
+ return p`
814
814
  ${this._renderTrigger()}
815
815
  ${this._renderPanel()}
816
816
  `;
817
817
  }
818
818
  };
819
- g.styles = [W, tt];
820
- _([
819
+ g.styles = [U, se];
820
+ y([
821
821
  h({ type: String })
822
822
  ], g.prototype, "value", 2);
823
- _([
823
+ y([
824
824
  h({ type: Boolean, reflect: !0 })
825
825
  ], g.prototype, "disabled", 2);
826
- _([
826
+ y([
827
827
  h({ type: Boolean, reflect: !0, attribute: "disabled-alpha" })
828
828
  ], g.prototype, "disabledAlpha", 2);
829
- _([
829
+ y([
830
830
  h({ type: Boolean, reflect: !0 })
831
831
  ], g.prototype, "open", 2);
832
- _([
832
+ y([
833
833
  h({
834
834
  attribute: "show-text",
835
835
  reflect: !0,
836
836
  converter: {
837
- fromAttribute: (t) => t !== "false",
838
- toAttribute: (t) => t ? null : "false"
837
+ fromAttribute: (e) => e !== "false",
838
+ toAttribute: (e) => e ? null : "false"
839
839
  }
840
840
  })
841
841
  ], g.prototype, "showText", 2);
842
- _([
842
+ y([
843
843
  h({ type: String })
844
844
  ], g.prototype, "placement", 2);
845
- _([
845
+ y([
846
846
  h({ type: String })
847
847
  ], g.prototype, "align", 2);
848
- _([
848
+ y([
849
849
  h({
850
850
  attribute: "auto-adjust",
851
851
  converter: {
852
- fromAttribute: (t) => t !== "false",
853
- toAttribute: (t) => t ? null : "false"
852
+ fromAttribute: (e) => e !== "false",
853
+ toAttribute: (e) => e ? null : "false"
854
854
  }
855
855
  })
856
856
  ], g.prototype, "autoAdjust", 2);
857
- _([
858
- w()
857
+ y([
858
+ _()
859
859
  ], g.prototype, "_panelVisible", 2);
860
- _([
861
- w()
860
+ y([
861
+ _()
862
862
  ], g.prototype, "_internalValue", 2);
863
- _([
864
- w()
863
+ y([
864
+ _()
865
865
  ], g.prototype, "_hsb", 2);
866
- _([
867
- w()
866
+ y([
867
+ _()
868
868
  ], g.prototype, "_panelPosition", 2);
869
- g = _([
870
- T("nf-color-picker")
869
+ g = y([
870
+ D("nf-color-picker")
871
871
  ], g);
872
- const st = E`:host{width:var(--nf-width);position:relative;display:inline-block;--nf-input-padding:0 .75rem}:host([disabled]) .input{cursor:not-allowed;color:var(--nf-color-disabled)}:host([disabled]) .toggle-password{cursor:not-allowed;pointer-events:none;opacity:.5}::slotted(*){position:absolute;top:50%;left:.75rem;transform:translateY(-50%);color:var(--nf-color)}:host([disabled]) ::slotted(*){color:var(--nf-color-disabled)}.input{position:absolute;inset:0;padding:var(--nf-input-padding);outline:0;border:none;background:0 0;box-sizing:border-box;color:var(--nf-color);font-size:var(--nf-font-size);font-weight:var(--nf-font-weight);font-family:var(--nf-font-family),sans-serif}.input:has(.toggle-password){padding-right:2.5rem}.input .toggle-password{position:absolute;top:50%;right:.5rem;transform:translateY(-50%);background:0 0;border:none;cursor:pointer;padding:.25rem;display:flex;align-items:center;justify-content:center;color:var(--nf-select-icon-color);transition:color var(--nf-transition-fast) ease;outline:0}.input .toggle-password:hover{color:var(--nf-icon-color-hover)}.input .toggle-password:active{color:var(--nf-icon-color-active)}.input .toggle-password svg{display:block}`;
873
- var it = Object.defineProperty, nt = Object.getOwnPropertyDescriptor, O = (t, e, o, r) => {
874
- for (var s = r > 1 ? void 0 : r ? nt(e, o) : e, i = t.length - 1, n; i >= 0; i--)
875
- (n = t[i]) && (s = (r ? n(e, o, s) : n(s)) || s);
876
- return r && s && it(e, o, s), s;
872
+ const ne = A`:host{width:var(--nf-width);position:relative;display:inline-block;--nf-input-padding:0 .75rem}:host([disabled]) .input{cursor:not-allowed;color:var(--nf-color-disabled)}:host([disabled]) .toggle-password{cursor:not-allowed;pointer-events:none;opacity:.5}::slotted(*){position:absolute;top:50%;left:.75rem;transform:translateY(-50%);color:var(--nf-color)}:host([disabled]) ::slotted(*){color:var(--nf-color-disabled)}.input{position:absolute;inset:0;padding:var(--nf-input-padding);outline:0;border:none;background:0 0;box-sizing:border-box;color:var(--nf-color);font-size:var(--nf-font-size);font-weight:var(--nf-font-weight);font-family:var(--nf-font-family),sans-serif}.input:has(.toggle-password){padding-right:2.5rem}.input .toggle-password{position:absolute;top:50%;right:.5rem;transform:translateY(-50%);background:0 0;border:none;cursor:pointer;padding:.25rem;display:flex;align-items:center;justify-content:center;color:var(--nf-select-icon-color);transition:color var(--nf-transition-fast) ease;outline:0}.input .toggle-password:hover{color:var(--nf-icon-color-hover)}.input .toggle-password:active{color:var(--nf-icon-color-active)}.input .toggle-password svg{display:block}`;
873
+ var ae = Object.defineProperty, le = Object.getOwnPropertyDescriptor, B = (e, t, o, s) => {
874
+ for (var r = s > 1 ? void 0 : s ? le(t, o) : t, i = e.length - 1, n; i >= 0; i--)
875
+ (n = e[i]) && (r = (s ? n(t, o, r) : n(r)) || r);
876
+ return s && r && ae(t, o, r), r;
877
877
  };
878
- let x = class extends R {
878
+ let S = class extends L {
879
879
  constructor() {
880
- super(...arguments), this.value = "", this.placeholder = "", this.type = "text", this.disabled = !1, this.showPassword = !1, this.onInput = (t) => {
881
- t.stopPropagation();
882
- const e = t.target?.value;
880
+ super(...arguments), this.value = "", this.placeholder = "", this.type = "text", this.disabled = !1, this.showPassword = !1, this.onInput = (e) => {
881
+ e.stopPropagation();
882
+ const t = e.target?.value;
883
883
  this.dispatchEvent(
884
884
  new CustomEvent("input", {
885
- detail: e,
885
+ detail: t,
886
886
  bubbles: !0,
887
887
  composed: !0
888
888
  })
889
- ), e !== void 0 && this.value !== e && this.dispatchEvent(
889
+ ), t !== void 0 && this.value !== t && this.dispatchEvent(
890
890
  new CustomEvent("change", {
891
- detail: e,
891
+ detail: t,
892
892
  bubbles: !0,
893
893
  composed: !0
894
894
  })
895
895
  );
896
- }, this.onChange = (t) => {
897
- t.stopPropagation();
898
- const e = t.target?.value;
899
- e !== void 0 && this.value !== e && this.dispatchEvent(
896
+ }, this.onChange = (e) => {
897
+ e.stopPropagation();
898
+ const t = e.target?.value;
899
+ t !== void 0 && this.value !== t && this.dispatchEvent(
900
900
  new CustomEvent("change", {
901
- detail: e,
901
+ detail: t,
902
902
  bubbles: !0,
903
903
  composed: !0
904
904
  })
905
905
  );
906
- }, this.onKeyDown = (t) => {
907
- if (t.key === "Enter") {
908
- t.stopPropagation();
909
- const e = t.target?.value;
910
- e !== void 0 && this.dispatchEvent(
906
+ }, this.onKeyDown = (e) => {
907
+ if (e.key === "Enter") {
908
+ e.stopPropagation();
909
+ const t = e.target?.value;
910
+ t !== void 0 && this.dispatchEvent(
911
911
  new CustomEvent("pressEnter", {
912
- detail: e,
912
+ detail: t,
913
913
  bubbles: !0,
914
914
  composed: !0
915
915
  })
916
916
  );
917
917
  }
918
- }, this.togglePasswordVisibility = (t) => {
919
- this.disabled || (t.preventDefault(), t.stopPropagation(), this.showPassword = !this.showPassword);
918
+ }, this.togglePasswordVisibility = (e) => {
919
+ this.disabled || (e.preventDefault(), e.stopPropagation(), this.showPassword = !this.showPassword);
920
920
  };
921
921
  }
922
922
  render() {
923
- const t = this.type === "password" && !this.showPassword ? "password" : "text", e = this.type === "password";
924
- return f`<slot></slot><input class=input type=${t} .value=${this.value} placeholder=${this.placeholder} maxlength=${this.maxLength ?? ""} ?disabled=${this.disabled} @input=${this.onInput} @change=${this.onChange} @keydown=${this.onKeyDown}> ${e ? f`<button class=toggle-password type=button tabindex=-1 @click=${this.togglePasswordVisibility} aria-label=${this.showPassword ? "Hide password" : "Show password"}>${this.showPassword ? this.renderEyeOffIcon() : this.renderEyeIcon()}</button>` : ""}`;
923
+ const e = this.type === "password" && !this.showPassword ? "password" : "text", t = this.type === "password";
924
+ return p`<slot></slot><input class=input type=${e} .value=${this.value} placeholder=${this.placeholder} maxlength=${this.maxLength ?? ""} ?disabled=${this.disabled} @input=${this.onInput} @change=${this.onChange} @keydown=${this.onKeyDown}> ${t ? p`<button class=toggle-password type=button tabindex=-1 @click=${this.togglePasswordVisibility} aria-label=${this.showPassword ? "Hide password" : "Show password"}>${this.showPassword ? this.renderEyeOffIcon() : this.renderEyeIcon()}</button>` : ""}`;
925
925
  }
926
926
  renderEyeIcon() {
927
- return f`<svg width=16 height=16 viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx=12 cy=12 r=3 /></svg>`;
927
+ return p`<svg width=16 height=16 viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx=12 cy=12 r=3 /></svg>`;
928
928
  }
929
929
  renderEyeOffIcon() {
930
- return f`<svg width=16 height=16 viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1=1 y1=1 x2=23 y2=23 /></svg>`;
930
+ return p`<svg width=16 height=16 viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1=1 y1=1 x2=23 y2=23 /></svg>`;
931
931
  }
932
932
  connectedCallback() {
933
933
  this.style.transition = "none", super.connectedCallback(), requestAnimationFrame(() => {
@@ -935,124 +935,124 @@ let x = class extends R {
935
935
  });
936
936
  }
937
937
  };
938
- x.styles = [W, st];
939
- O([
938
+ S.styles = [U, ne];
939
+ B([
940
940
  h({ type: String })
941
- ], x.prototype, "value", 2);
942
- O([
941
+ ], S.prototype, "value", 2);
942
+ B([
943
943
  h({ type: String })
944
- ], x.prototype, "placeholder", 2);
945
- O([
944
+ ], S.prototype, "placeholder", 2);
945
+ B([
946
946
  h({ type: String })
947
- ], x.prototype, "type", 2);
948
- O([
947
+ ], S.prototype, "type", 2);
948
+ B([
949
949
  h({ type: Number })
950
- ], x.prototype, "maxLength", 2);
951
- O([
950
+ ], S.prototype, "maxLength", 2);
951
+ B([
952
952
  h({ type: Boolean, reflect: !0 })
953
- ], x.prototype, "disabled", 2);
954
- O([
955
- w()
956
- ], x.prototype, "showPassword", 2);
957
- x = O([
958
- T("nf-input")
959
- ], x);
960
- const at = E`:host{width:10rem;position:relative;display:inline-flex;align-items:center;box-sizing:border-box;padding:0;overflow:hidden;--nf-input-number-color:var(--nf-color);--nf-input-number-prefix-color:color-mix(in srgb, var(--nf-color), transparent 20%);--nf-input-number-surfix-color:color-mix(in srgb, var(--nf-color), transparent 20%)}.input-number{position:relative;padding-right:.6125rem;flex:1;height:100%;outline:0;border:none;background:0 0;box-sizing:border-box;color:var(--nf-input-number-color);font-weight:var(--nf-font-weight);text-align:left;transition:padding-right var(--nf-transition-fast) ease}.input-number .input-number-input-wrapper{height:100%}.input-number .input-number-input-wrapper .input-number-input{background:0 0;width:100%;height:100%;text-align:start;border:0;outline:0;padding:0;box-sizing:border-box;color:var(--nf-input-number-color);font-size:var(--nf-font-size);font-weight:var(--nf-font-weight);font-family:var(--nf-font-family),sans-serif}.input-number::-webkit-inner-spin-button,.input-number::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input-number[type=number]{appearance:textfield}:host([controls]) .input-number:hover{padding-right:1.5rem}:host([controls]) .input-number:hover .controls{width:1.5rem}:host([center]) .input-number{padding-left:1.5rem!important;padding-right:1.5rem!important}:host([center]) .input-number .input-number-input{text-align:center}:host([center]) .input-number:hover{padding-left:1.5rem!important;padding-right:1.5rem!important}:host([center]) .input-prefix{position:absolute;left:0;top:0;bottom:0;z-index:1;pointer-events:none}:host([center]) .input-suffix{position:absolute;right:0;top:0;bottom:0;z-index:1;pointer-events:none}:host([center]) .input-number{flex:1;width:100%}.input-prefix{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding-inline-start:.6125rem;color:var(--nf-input-number-prefix-color);font-size:var(--nf-font-size);pointer-events:none;-webkit-user-select:none;user-select:none}.input-prefix:not(:empty){padding-inline-end:.25rem}.input-suffix{display:flex;align-items:center;justify-content:center;color:var(--nf-input-number-surfix-color);font-size:var(--nf-font-size);pointer-events:none;-webkit-user-select:none;user-select:none}.input-suffix:not(:empty){padding-inline-end:.6125rem;padding-inline-start:.5rem}.controls{position:absolute;top:0;right:0;height:100%;width:0;overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box;transition:width var(--nf-transition-fast) ease}.controls:before{content:\"\";position:absolute;left:0;top:0;bottom:0;width:.67px;background-color:var(--nf-control-divider-color)}:host([suffix]) .controls:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:.67px;background-color:var(--nf-control-divider-color)}.control-btn{flex:1;display:flex;align-items:center;justify-content:center;background:0 0;border:none;cursor:pointer;transition:background-color var(--nf-transition-fast) ease;outline:0;-webkit-user-select:none;user-select:none}.control-btn:hover{background-color:var(--nf-control-btn-background-hover)}.control-btn:active{background-color:var(--nf-control-btn-background-active)}.control-btn:focus-visible{background-color:var(--nf-control-btn-background-hover)}.control-btn svg{display:block;pointer-events:none;fill:none;stroke:var(--nf-select-icon-color);stroke-width:1;stroke-linecap:round}.control-btn-up{border-bottom:.67px solid var(--nf-control-divider-color)}:host(:not([suffix])) .control-btn-up{border-top-right-radius:var(--nf-border-radius)}:host(:not([suffix])) .control-btn-down{border-bottom-right-radius:var(--nf-border-radius)}:host([disabled]) .input-number-input{cursor:not-allowed;color:var(--nf-color-disabled)}:host([disabled]) .input-prefix,:host([disabled]) .input-suffix{color:var(--nf-color-disabled)}:host([disabled]) .controls{display:none}:host([disabled]) .control-btn{cursor:not-allowed;pointer-events:none;opacity:.5}`;
961
- var lt = Object.defineProperty, ht = Object.getOwnPropertyDescriptor, m = (t, e, o, r) => {
962
- for (var s = r > 1 ? void 0 : r ? ht(e, o) : e, i = t.length - 1, n; i >= 0; i--)
963
- (n = t[i]) && (s = (r ? n(e, o, s) : n(s)) || s);
964
- return r && s && lt(e, o, s), s;
953
+ ], S.prototype, "disabled", 2);
954
+ B([
955
+ _()
956
+ ], S.prototype, "showPassword", 2);
957
+ S = B([
958
+ D("nf-input")
959
+ ], S);
960
+ const he = A`:host{width:10rem;position:relative;display:inline-flex;align-items:center;box-sizing:border-box;padding:0;overflow:hidden;--nf-input-number-color:var(--nf-color);--nf-input-number-prefix-color:color-mix(in srgb, var(--nf-color), transparent 20%);--nf-input-number-surfix-color:color-mix(in srgb, var(--nf-color), transparent 20%)}.input-number{position:relative;padding-right:.6125rem;flex:1;height:100%;outline:0;border:none;background:0 0;box-sizing:border-box;color:var(--nf-input-number-color);font-weight:var(--nf-font-weight);text-align:left;transition:padding-right var(--nf-transition-fast) ease}.input-number .input-number-input-wrapper{height:100%}.input-number .input-number-input-wrapper .input-number-input{background:0 0;width:100%;height:100%;text-align:start;border:0;outline:0;padding:0;box-sizing:border-box;color:var(--nf-input-number-color);font-size:var(--nf-font-size);font-weight:var(--nf-font-weight);font-family:var(--nf-font-family),sans-serif}.input-number::-webkit-inner-spin-button,.input-number::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input-number[type=number]{appearance:textfield}:host([controls]) .input-number:hover{padding-right:1.5rem}:host([controls]) .input-number:hover .controls{width:1.5rem}:host([center]) .input-number{padding-left:1.5rem!important;padding-right:1.5rem!important}:host([center]) .input-number .input-number-input{text-align:center}:host([center]) .input-number:hover{padding-left:1.5rem!important;padding-right:1.5rem!important}:host([center]) .input-prefix{position:absolute;left:0;top:0;bottom:0;z-index:1;pointer-events:none}:host([center]) .input-suffix{position:absolute;right:0;top:0;bottom:0;z-index:1;pointer-events:none}:host([center]) .input-number{flex:1;width:100%}.input-prefix{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding-inline-start:.6125rem;color:var(--nf-input-number-prefix-color);font-size:var(--nf-font-size);pointer-events:none;-webkit-user-select:none;user-select:none}.input-prefix:not(:empty){padding-inline-end:.25rem}.input-suffix{display:flex;align-items:center;justify-content:center;color:var(--nf-input-number-surfix-color);font-size:var(--nf-font-size);pointer-events:none;-webkit-user-select:none;user-select:none}.input-suffix:not(:empty){padding-inline-end:.6125rem;padding-inline-start:.5rem}.controls{position:absolute;top:0;right:0;height:100%;width:0;overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box;transition:width var(--nf-transition-fast) ease}.controls:before{content:\"\";position:absolute;left:0;top:0;bottom:0;width:.67px;background-color:var(--nf-control-divider-color)}:host([suffix]) .controls:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:.67px;background-color:var(--nf-control-divider-color)}.control-btn{flex:1;display:flex;align-items:center;justify-content:center;background:0 0;border:none;cursor:pointer;transition:background-color var(--nf-transition-fast) ease;outline:0;-webkit-user-select:none;user-select:none}.control-btn:hover{background-color:var(--nf-control-btn-background-hover)}.control-btn:active{background-color:var(--nf-control-btn-background-active)}.control-btn:focus-visible{background-color:var(--nf-control-btn-background-hover)}.control-btn svg{display:block;pointer-events:none;fill:none;stroke:var(--nf-select-icon-color);stroke-width:1;stroke-linecap:round}.control-btn-up{border-bottom:.67px solid var(--nf-control-divider-color)}:host(:not([suffix])) .control-btn-up{border-top-right-radius:var(--nf-border-radius)}:host(:not([suffix])) .control-btn-down{border-bottom-right-radius:var(--nf-border-radius)}:host([disabled]) .input-number-input{cursor:not-allowed;color:var(--nf-color-disabled)}:host([disabled]) .input-prefix,:host([disabled]) .input-suffix{color:var(--nf-color-disabled)}:host([disabled]) .controls{display:none}:host([disabled]) .control-btn{cursor:not-allowed;pointer-events:none;opacity:.5}`;
961
+ var ce = Object.defineProperty, de = Object.getOwnPropertyDescriptor, m = (e, t, o, s) => {
962
+ for (var r = s > 1 ? void 0 : s ? de(t, o) : t, i = e.length - 1, n; i >= 0; i--)
963
+ (n = e[i]) && (r = (s ? n(t, o, r) : n(r)) || r);
964
+ return s && r && ce(t, o, r), r;
965
965
  };
966
- let p = class extends R {
966
+ let f = class extends L {
967
967
  constructor() {
968
- super(...arguments), this.value = 0, this.formatter = (t) => {
969
- if (t === null) return "";
970
- const e = String(t);
971
- return e.includes("e") ? t.toLocaleString("en", {
968
+ super(...arguments), this.value = 0, this.formatter = (e) => {
969
+ if (e === null) return "";
970
+ const t = String(e);
971
+ return t.includes("e") ? e.toLocaleString("en", {
972
972
  useGrouping: !1,
973
973
  maximumFractionDigits: 20,
974
974
  minimumFractionDigits: 0
975
- }) : e;
976
- }, this.parser = (t) => {
977
- if (t.trim().length == 0 || t.endsWith("."))
975
+ }) : t;
976
+ }, this.parser = (e) => {
977
+ if (e.trim().length == 0 || e.endsWith("."))
978
978
  return null;
979
- const e = Number(t);
980
- return Number.isNaN(e) ? null : this.clampValue(e);
979
+ const t = Number(e);
980
+ return Number.isNaN(t) ? null : this.clampValue(t);
981
981
  }, this.prefix = null, this.suffix = null, this.controls = !0, this.step = 1, this.min = null, this.max = null, this.changeOnWheel = !0, this.disabled = !1, this.noDecimal = !1, this.noZero = !1, this.noNegative = !1, this.center = !1, this.text = "", this.isTyping = !1, this.isFocused = !1;
982
982
  }
983
983
  // 对解析结果进行额外验证
984
- validateParsed(t) {
985
- return t === null || this.noDecimal && !Number.isInteger(t) || this.noZero && t === 0 || this.noNegative && t < 0 ? null : t;
984
+ validateParsed(e) {
985
+ return e === null || this.noDecimal && !Number.isInteger(e) || this.noZero && e === 0 || this.noNegative && e < 0 ? null : e;
986
986
  }
987
987
  /* ================== 文本设置 ================== */
988
988
  // 验证并设置 text,过滤不合规字符
989
- setText(t) {
990
- let e = t;
991
- if (e = e.replace(/[^0-9+.\-]/g, ""), this.noNegative && (e = e.replace(/[+\-]/g, "")), this.noDecimal && e.includes(".")) {
992
- const o = Number(e);
993
- Number.isNaN(o) ? e = e.replace(/\./g, "") : e = String(Math.round(o));
989
+ setText(e) {
990
+ let t = e;
991
+ if (t = t.replace(/[^0-9+.\-]/g, ""), this.noNegative && (t = t.replace(/[+\-]/g, "")), this.noDecimal && t.includes(".")) {
992
+ const o = Number(t);
993
+ Number.isNaN(o) ? t = t.replace(/\./g, "") : t = String(Math.round(o));
994
994
  }
995
- return this.text = e, e === t;
995
+ return this.text = t, t === e;
996
996
  }
997
997
  /* ================== 生命周期 ================== */
998
- willUpdate(t) {
998
+ willUpdate(e) {
999
999
  if (this.center && this.suffix && this.controls)
1000
1000
  throw new Error(
1001
1001
  "[nf-input-number] center 模式下不允许同时开启 suffix 和 controls,请关闭其中一个。"
1002
1002
  );
1003
- t.has("value") && !this.isTyping && this.setText(this.formatter(this.value));
1003
+ e.has("value") && !this.isTyping && this.setText(this.formatter(this.value));
1004
1004
  }
1005
1005
  /* ================== 事件处理 ================== */
1006
- onInput(t) {
1006
+ onInput(e) {
1007
1007
  this.isTyping = !0;
1008
- const e = t.target.value;
1009
- this.setText(e) || (t.target.value = this.text);
1008
+ const t = e.target.value;
1009
+ this.setText(t) || (e.target.value = this.text);
1010
1010
  }
1011
1011
  onBlur() {
1012
1012
  this.isTyping = !1, this.isFocused = !1;
1013
- const t = this.validateParsed(this.parser(this.text));
1014
- t !== null ? (this.value = t, this.setText(this.formatter(t)), this.dispatchEvent(
1013
+ const e = this.validateParsed(this.parser(this.text));
1014
+ e !== null ? (this.value = e, this.setText(this.formatter(e)), this.dispatchEvent(
1015
1015
  new CustomEvent("change", {
1016
- detail: t
1016
+ detail: e
1017
1017
  })
1018
1018
  )) : this.setText(this.formatter(this.value));
1019
1019
  }
1020
1020
  onFocus() {
1021
1021
  this.isFocused = !0;
1022
1022
  }
1023
- onWheel(t) {
1023
+ onWheel(e) {
1024
1024
  if (this.disabled || !this.changeOnWheel || !this.isFocused) return;
1025
- t.preventDefault();
1026
- const e = t.deltaY < 0 ? 1 : -1;
1027
- this.handleStepChange(e);
1025
+ e.preventDefault();
1026
+ const t = e.deltaY < 0 ? 1 : -1;
1027
+ this.handleStepChange(t);
1028
1028
  }
1029
- onKeyDown(t) {
1030
- t.stopPropagation(), t.key === "Enter" && t.target.blur();
1029
+ onKeyDown(e) {
1030
+ e.stopPropagation(), e.key === "Enter" && e.target.blur();
1031
1031
  }
1032
- onKeyUp(t) {
1033
- t.stopPropagation();
1032
+ onKeyUp(e) {
1033
+ e.stopPropagation();
1034
1034
  }
1035
1035
  /* ================== 提交逻辑 ================== */
1036
1036
  // 修正浮点误差(保留 12 位有效精度)
1037
- fixFloatingPoint(t) {
1038
- return parseFloat(t.toPrecision(12));
1037
+ fixFloatingPoint(e) {
1038
+ return parseFloat(e.toPrecision(12));
1039
1039
  }
1040
1040
  // 限制值在 min/max 范围内
1041
- clampValue(t) {
1042
- let e = t;
1043
- return this.min !== null && this.min !== void 0 && (e = Math.max(e, this.min)), this.max !== null && this.max !== void 0 && (e = Math.min(e, this.max)), e;
1041
+ clampValue(e) {
1042
+ let t = e;
1043
+ return this.min !== null && this.min !== void 0 && (t = Math.max(t, this.min)), this.max !== null && this.max !== void 0 && (t = Math.min(t, this.max)), t;
1044
1044
  }
1045
1045
  // 步进按钮处理
1046
- handleStepChange(t) {
1046
+ handleStepChange(e) {
1047
1047
  if (this.disabled) return;
1048
- const e = this.validateParsed(this.parser(this.text));
1049
- if (e === null)
1048
+ const t = this.validateParsed(this.parser(this.text));
1049
+ if (t === null)
1050
1050
  return;
1051
- this.value = e;
1052
- let o = this.fixFloatingPoint(this.value + t * this.step);
1051
+ this.value = t;
1052
+ let o = this.fixFloatingPoint(this.value + e * this.step);
1053
1053
  o = this.clampValue(o);
1054
- const r = this.validateParsed(o);
1055
- r !== null && (o = r, o !== this.value && (this.value = o, this.setText(this.formatter(o)), this.dispatchEvent(
1054
+ const s = this.validateParsed(o);
1055
+ s !== null && (o = s, o !== this.value && (this.value = o, this.setText(this.formatter(o)), this.dispatchEvent(
1056
1056
  new CustomEvent("change", {
1057
1057
  detail: o
1058
1058
  })
@@ -1065,88 +1065,88 @@ let p = class extends R {
1065
1065
  }
1066
1066
  /* ================== Render ================== */
1067
1067
  render() {
1068
- return f`<div class=input-prefix>${this.prefix}</div><div class=input-number><div class=input-number-input-wrapper><input inputmode=decimal class=input-number-input .value=${this.text} ?disabled=${this.disabled} @blur=${this.onBlur} @focus=${this.onFocus} @input=${this.onInput} @keydown=${this.onKeyDown} @wheel=${this.onWheel} @keyup=${this.onKeyUp}></div>${this.controls ? f`<div class=controls><button class="control-btn control-btn-up"type=button ?disabled=${this.disabled} @click=${() => this.handleStepChange(1)} aria-label="Increase value"><svg width=12 height=12 viewBox="0 0 24 24"><path d="M6 14.6l6-6.6 6 6.6"/></svg></button><button class="control-btn control-btn-down"type=button ?disabled=${this.disabled} @click=${() => this.handleStepChange(-1)} aria-label="Decrease value"><svg width=12 height=12 viewBox="0 0 24 24"><path d="M18 9.4l-6 6.6-6-6.6"/></svg></button></div>` : ""}</div>${this.suffix ? f`<div class=input-suffix>${this.suffix}</div>` : ""}`;
1068
+ return p`<div class=input-prefix>${this.prefix}</div><div class=input-number><div class=input-number-input-wrapper><input inputmode=decimal class=input-number-input .value=${this.text} ?disabled=${this.disabled} @blur=${this.onBlur} @focus=${this.onFocus} @input=${this.onInput} @keydown=${this.onKeyDown} @wheel=${this.onWheel} @keyup=${this.onKeyUp}></div>${this.controls ? p`<div class=controls><button class="control-btn control-btn-up"type=button ?disabled=${this.disabled} @click=${() => this.handleStepChange(1)} aria-label="Increase value"><svg width=12 height=12 viewBox="0 0 24 24"><path d="M6 14.6l6-6.6 6 6.6"/></svg></button><button class="control-btn control-btn-down"type=button ?disabled=${this.disabled} @click=${() => this.handleStepChange(-1)} aria-label="Decrease value"><svg width=12 height=12 viewBox="0 0 24 24"><path d="M18 9.4l-6 6.6-6-6.6"/></svg></button></div>` : ""}</div>${this.suffix ? p`<div class=input-suffix>${this.suffix}</div>` : ""}`;
1069
1069
  }
1070
1070
  };
1071
- p.styles = [W, at];
1071
+ f.styles = [U, he];
1072
1072
  m([
1073
1073
  h({ type: Number })
1074
- ], p.prototype, "value", 2);
1074
+ ], f.prototype, "value", 2);
1075
1075
  m([
1076
1076
  h({ attribute: !1 })
1077
- ], p.prototype, "formatter", 2);
1077
+ ], f.prototype, "formatter", 2);
1078
1078
  m([
1079
1079
  h({ attribute: !1 })
1080
- ], p.prototype, "parser", 2);
1080
+ ], f.prototype, "parser", 2);
1081
1081
  m([
1082
1082
  h({ type: String, reflect: !0 })
1083
- ], p.prototype, "prefix", 2);
1083
+ ], f.prototype, "prefix", 2);
1084
1084
  m([
1085
1085
  h({ type: String, reflect: !0 })
1086
- ], p.prototype, "suffix", 2);
1086
+ ], f.prototype, "suffix", 2);
1087
1087
  m([
1088
1088
  h({
1089
1089
  type: Boolean,
1090
1090
  reflect: !0,
1091
1091
  converter: {
1092
- fromAttribute: (t) => t !== "false" && t !== null,
1093
- toAttribute: (t) => t ? "" : null
1092
+ fromAttribute: (e) => e !== "false" && e !== null,
1093
+ toAttribute: (e) => e ? "" : null
1094
1094
  }
1095
1095
  })
1096
- ], p.prototype, "controls", 2);
1096
+ ], f.prototype, "controls", 2);
1097
1097
  m([
1098
1098
  h({ type: Number })
1099
- ], p.prototype, "step", 2);
1099
+ ], f.prototype, "step", 2);
1100
1100
  m([
1101
1101
  h({ type: Number })
1102
- ], p.prototype, "min", 2);
1102
+ ], f.prototype, "min", 2);
1103
1103
  m([
1104
1104
  h({ type: Number })
1105
- ], p.prototype, "max", 2);
1105
+ ], f.prototype, "max", 2);
1106
1106
  m([
1107
1107
  h({
1108
1108
  type: Boolean,
1109
1109
  attribute: "change-on-wheel",
1110
1110
  converter: {
1111
- fromAttribute: (t) => t !== "false" && t !== null,
1112
- toAttribute: (t) => t ? "" : null
1111
+ fromAttribute: (e) => e !== "false" && e !== null,
1112
+ toAttribute: (e) => e ? "" : null
1113
1113
  }
1114
1114
  })
1115
- ], p.prototype, "changeOnWheel", 2);
1115
+ ], f.prototype, "changeOnWheel", 2);
1116
1116
  m([
1117
1117
  h({ type: Boolean, reflect: !0 })
1118
- ], p.prototype, "disabled", 2);
1118
+ ], f.prototype, "disabled", 2);
1119
1119
  m([
1120
1120
  h({ type: Boolean, attribute: "no-decimal" })
1121
- ], p.prototype, "noDecimal", 2);
1121
+ ], f.prototype, "noDecimal", 2);
1122
1122
  m([
1123
1123
  h({ type: Boolean, attribute: "no-zero" })
1124
- ], p.prototype, "noZero", 2);
1124
+ ], f.prototype, "noZero", 2);
1125
1125
  m([
1126
1126
  h({ type: Boolean, attribute: "no-negative" })
1127
- ], p.prototype, "noNegative", 2);
1127
+ ], f.prototype, "noNegative", 2);
1128
1128
  m([
1129
1129
  h({ type: Boolean, reflect: !0 })
1130
- ], p.prototype, "center", 2);
1130
+ ], f.prototype, "center", 2);
1131
1131
  m([
1132
- w()
1133
- ], p.prototype, "text", 2);
1132
+ _()
1133
+ ], f.prototype, "text", 2);
1134
1134
  m([
1135
- w()
1136
- ], p.prototype, "isFocused", 2);
1137
- p = m([
1138
- T("nf-input-number")
1139
- ], p);
1140
- async function ct(t) {
1141
- return new Promise((e) => setTimeout(e, t));
1135
+ _()
1136
+ ], f.prototype, "isFocused", 2);
1137
+ f = m([
1138
+ D("nf-input-number")
1139
+ ], f);
1140
+ async function ue(e) {
1141
+ return new Promise((t) => setTimeout(t, e));
1142
1142
  }
1143
- const dt = E`:host{width:var(--nf-width);-webkit-user-select:none;user-select:none;cursor:pointer}:host .text{flex-grow:1;display:inline-block;outline:0;white-space:nowrap}:host .icon{width:1.5rem;height:1.5rem;display:inline-block;fill:none;stroke:var(--nf-select-icon-color);stroke-width:1;stroke-linecap:round;margin:0 -.3rem 0 .5rem}:host .dropdown{position:absolute;top:2rem;right:0;left:0;padding:.3rem;background:var(--nf-dropdown-background);-webkit-backdrop-filter:blur(32px);backdrop-filter:blur(32px);border-radius:.5rem;opacity:0;pointer-events:none;color:var(--nf-color);box-shadow:0 0 1rem 0 var(--nf-dropdown-shadow);z-index:1000;transition:opacity var(--nf-transition) ease-out,transform var(--nf-transition) ease-out}:host .dropdown .item{white-space:nowrap;padding:.4rem .7rem;overflow:hidden;text-overflow:ellipsis;border-radius:.3rem;cursor:pointer}:host .dropdown .item-unselected:hover{background:var(--nf-item-background-hover);transition:background-color var(--nf-transition) ease-in-out}:host .dropdown .item-unselected:active{background:var(--nf-item-background-active)}:host .dropdown .item-selected{background-color:color-mix(in srgb,var(--nf-primary-color) 30%,transparent)}:host([disabled]){cursor:not-allowed}:host([disabled]) .text{color:var(--nf-color-disabled)}:host([disabled]) .icon{stroke:var(--nf-color-disabled)}:host([disabled]) .dropdown{display:none}:host(:focus:not([disabled])){color:var(--nf-focus-text-color)}:host(:focus:not([disabled])) .dropdown{transform:translateY(.5rem);opacity:1;pointer-events:auto}:host(:focus:not([disabled])) .cover{pointer-events:auto}`;
1144
- var ut = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, K = (t, e, o, r) => {
1145
- for (var s = r > 1 ? void 0 : r ? pt(e, o) : e, i = t.length - 1, n; i >= 0; i--)
1146
- (n = t[i]) && (s = (r ? n(e, o, s) : n(s)) || s);
1147
- return r && s && ut(e, o, s), s;
1143
+ const pe = A`:host{width:var(--nf-width);-webkit-user-select:none;user-select:none;cursor:pointer}:host .text{flex-grow:1;display:inline-block;outline:0;white-space:nowrap}:host .icon{width:1.5rem;height:1.5rem;display:inline-block;fill:none;stroke:var(--nf-select-icon-color);stroke-width:1;stroke-linecap:round;margin:0 -.3rem 0 .5rem}:host .dropdown{position:absolute;top:2rem;right:0;left:0;padding:.3rem;background:var(--nf-dropdown-background);-webkit-backdrop-filter:blur(32px);backdrop-filter:blur(32px);border-radius:.5rem;opacity:0;pointer-events:none;color:var(--nf-color);box-shadow:0 0 1rem 0 var(--nf-dropdown-shadow);z-index:1000;transition:opacity var(--nf-transition) ease-out,transform var(--nf-transition) ease-out}:host .dropdown .item{white-space:nowrap;padding:.4rem .7rem;overflow:hidden;text-overflow:ellipsis;border-radius:.3rem;cursor:pointer}:host .dropdown .item-unselected:hover{background:var(--nf-item-background-hover);transition:background-color var(--nf-transition) ease-in-out}:host .dropdown .item-unselected:active{background:var(--nf-item-background-active)}:host .dropdown .item-selected{background-color:color-mix(in srgb,var(--nf-primary-color) 30%,transparent)}:host([disabled]){cursor:not-allowed}:host([disabled]) .text{color:var(--nf-color-disabled)}:host([disabled]) .icon{stroke:var(--nf-color-disabled)}:host([disabled]) .dropdown{display:none}:host(:focus:not([disabled])){color:var(--nf-focus-text-color)}:host(:focus:not([disabled])) .dropdown{transform:translateY(.5rem);opacity:1;pointer-events:auto}:host(:focus:not([disabled])) .cover{pointer-events:auto}`;
1144
+ var fe = Object.defineProperty, be = Object.getOwnPropertyDescriptor, X = (e, t, o, s) => {
1145
+ for (var r = s > 1 ? void 0 : s ? be(t, o) : t, i = e.length - 1, n; i >= 0; i--)
1146
+ (n = e[i]) && (r = (s ? n(t, o, r) : n(r)) || r);
1147
+ return s && r && fe(t, o, r), r;
1148
1148
  };
1149
- let D = class extends R {
1149
+ let z = class extends L {
1150
1150
  constructor() {
1151
1151
  super(...arguments), this.value = "", this.options = [], this.disabled = !1, this.showDropdown = !1, this.jumpCloseFlag = !1, this.timeoutId = null, this.onFocus = () => {
1152
1152
  this.disabled || (this.timeoutId && clearTimeout(this.timeoutId), this.showDropdown = !0, this.jumpCloseFlag = !0);
@@ -1164,14 +1164,14 @@ let D = class extends R {
1164
1164
  }
1165
1165
  };
1166
1166
  }
1167
- async set(t) {
1168
- this.dispatchEvent(new CustomEvent("input", { detail: t, bubbles: !0, composed: !0 })), this.value !== t && this.dispatchEvent(new CustomEvent("change", { detail: t, bubbles: !0, composed: !0 })), await ct(34), this.blur();
1167
+ async set(e) {
1168
+ this.dispatchEvent(new CustomEvent("input", { detail: e, bubbles: !0, composed: !0 })), this.value !== e && this.dispatchEvent(new CustomEvent("change", { detail: e, bubbles: !0, composed: !0 })), await ue(34), this.blur();
1169
1169
  }
1170
1170
  render() {
1171
- const t = this.options.findIndex((o) => o.value == this.value), e = t > -1 ? this.options[t]?.label : this.value;
1172
- return f`<div class=dropdown>${(this.showDropdown ? this.options : []).map(
1173
- (o) => f`<div @click=${() => this.set(o.value)} class="item ${this.value == o.value ? "item-selected" : "item-unselected"}">${o.label}</div>`
1174
- )}</div><slot></slot><div class=text>${e}</div><svg class=icon width=24 height=24 viewBox="0 0 24 24"><path d="M17 10l-5 5.5-5-5.5"/></svg>`;
1171
+ const e = this.options.findIndex((o) => o.value == this.value), t = e > -1 ? this.options[e]?.label : this.value;
1172
+ return p`<div class=dropdown>${(this.showDropdown ? this.options : []).map(
1173
+ (o) => p`<div @click=${() => this.set(o.value)} class="item ${this.value == o.value ? "item-selected" : "item-unselected"}">${o.label}</div>`
1174
+ )}</div><slot></slot><div class=text>${t}</div><svg class=icon width=24 height=24 viewBox="0 0 24 24"><path d="M17 10l-5 5.5-5-5.5"/></svg>`;
1175
1175
  }
1176
1176
  connectedCallback() {
1177
1177
  this.style.transition = "none", super.connectedCallback(), this.disabled || (this.tabIndex = 0), this.addEventListener("focus", this.onFocus), this.addEventListener("blur", this.onBlur), this.addEventListener("click", this.onClick), requestAnimationFrame(() => {
@@ -1182,68 +1182,68 @@ let D = class extends R {
1182
1182
  super.disconnectedCallback(), this.removeEventListener("focus", this.onFocus), this.removeEventListener("blur", this.onBlur), this.removeEventListener("click", this.onClick);
1183
1183
  }
1184
1184
  };
1185
- D.styles = [W, dt];
1186
- K([
1185
+ z.styles = [U, pe];
1186
+ X([
1187
1187
  h({ type: String })
1188
- ], D.prototype, "value", 2);
1189
- K([
1188
+ ], z.prototype, "value", 2);
1189
+ X([
1190
1190
  h({
1191
1191
  type: Array,
1192
- converter: (t) => {
1192
+ converter: (e) => {
1193
1193
  try {
1194
- if (typeof t == "string")
1195
- return JSON.parse(t);
1196
- if (typeof t == "object" && Array.isArray(t))
1197
- return t;
1198
- } catch (e) {
1199
- console.error("Failed to convert property options:", e);
1194
+ if (typeof e == "string")
1195
+ return JSON.parse(e);
1196
+ if (typeof e == "object" && Array.isArray(e))
1197
+ return e;
1198
+ } catch (t) {
1199
+ console.error("Failed to convert property options:", t);
1200
1200
  }
1201
1201
  return [];
1202
1202
  }
1203
1203
  })
1204
- ], D.prototype, "options", 2);
1205
- K([
1204
+ ], z.prototype, "options", 2);
1205
+ X([
1206
1206
  h({ type: Boolean, reflect: !0 })
1207
- ], D.prototype, "disabled", 2);
1208
- K([
1209
- w()
1210
- ], D.prototype, "showDropdown", 2);
1211
- D = K([
1212
- T("nf-select")
1213
- ], D);
1214
- const ft = E`:host{display:inline-flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;outline:0;--nf-switch-padding:.1rem}:host[disabled]{cursor:not-allowed;opacity:.6}.switch-wrapper{position:relative;display:inline-block}.switch-container{position:relative;z-index:1;width:3.1rem;height:1.5rem;background-color:var(--nf-background-color);border-radius:.75rem;transition:background-color .2s ease;overflow:hidden}:host(:not([disabled]):not([checked])) .switch-container:hover{background:var(--nf-background-color-hover)}:host([checked]) .switch-container{background-color:var(--nf-primary-color,var(--nf-primary-color))}:host([disabled]) .switch-container{opacity:.5}.ripple{position:absolute;border-radius:.875rem;inset:-.2rem;background-color:#6464641a;animation:ripple-animation 1s ease-out forwards;pointer-events:none;opacity:1}@keyframes ripple-animation{0%{opacity:0}20%{opacity:1}to{opacity:0}}.switch-thumb{position:absolute;top:.125rem;left:0;width:1.25rem;height:1.25rem;transition:transform .2s ease-in-out}.switch-thumb:before{content:\"\";position:absolute;top:0;left:0;width:1.25rem;height:1.25rem;background-color:#fff;border-radius:.625rem;box-shadow:0 .125rem .25rem #0003;transition:width .2s ease-in-out,transform .2s ease-in-out}:host(:not([checked])) .switch-thumb{transform:translate(.125rem)}:host(:not([checked])) .switch-container:active .switch-thumb:before{width:1.625rem;border-radius:.625rem}:host([checked]) .switch-thumb{transform:translate(1.725rem)}:host([checked]) .switch-container:active .switch-thumb:before{width:1.625rem;border-radius:.625rem;transform:translate(-.375rem)}:host(:focus) .switch-container{outline:.125rem solid var(--nf-primary-color,var(--nf-primary-color));outline-offset:.125rem}`;
1215
- var bt = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, le = (t, e, o, r) => {
1216
- for (var s = r > 1 ? void 0 : r ? mt(e, o) : e, i = t.length - 1, n; i >= 0; i--)
1217
- (n = t[i]) && (s = (r ? n(e, o, s) : n(s)) || s);
1218
- return r && s && bt(e, o, s), s;
1207
+ ], z.prototype, "disabled", 2);
1208
+ X([
1209
+ _()
1210
+ ], z.prototype, "showDropdown", 2);
1211
+ z = X([
1212
+ D("nf-select")
1213
+ ], z);
1214
+ const me = A`:host{display:inline-flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;outline:0;--nf-switch-padding:.1rem}:host[disabled]{cursor:not-allowed;opacity:.6}.switch-wrapper{position:relative;display:inline-block}.switch-container{position:relative;z-index:1;width:3.1rem;height:1.5rem;background-color:var(--nf-background-color);border-radius:.75rem;transition:background-color .2s ease;overflow:hidden}:host(:not([disabled]):not([checked])) .switch-container:hover{background:var(--nf-background-color-hover)}:host([checked]) .switch-container{background-color:var(--nf-primary-color,var(--nf-primary-color))}:host([disabled]) .switch-container{opacity:.5}.ripple{position:absolute;border-radius:.875rem;inset:-.2rem;background-color:#6464641a;animation:ripple-animation 1s ease-out forwards;pointer-events:none;opacity:1}@keyframes ripple-animation{0%{opacity:0}20%{opacity:1}to{opacity:0}}.switch-thumb{position:absolute;top:.125rem;left:0;width:1.25rem;height:1.25rem;transition:transform .2s ease-in-out}.switch-thumb:before{content:\"\";position:absolute;top:0;left:0;width:1.25rem;height:1.25rem;background-color:#fff;border-radius:.625rem;box-shadow:0 .125rem .25rem #0003;transition:width .2s ease-in-out,transform .2s ease-in-out}:host(:not([checked])) .switch-thumb{transform:translate(.125rem)}:host(:not([checked])) .switch-container:active .switch-thumb:before{width:1.625rem;border-radius:.625rem}:host([checked]) .switch-thumb{transform:translate(1.725rem)}:host([checked]) .switch-container:active .switch-thumb:before{width:1.625rem;border-radius:.625rem;transform:translate(-.375rem)}:host(:focus) .switch-container{outline:.125rem solid var(--nf-primary-color,var(--nf-primary-color));outline-offset:.125rem}`;
1215
+ var ge = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, ct = (e, t, o, s) => {
1216
+ for (var r = s > 1 ? void 0 : s ? ve(t, o) : t, i = e.length - 1, n; i >= 0; i--)
1217
+ (n = e[i]) && (r = (s ? n(t, o, r) : n(r)) || r);
1218
+ return s && r && ge(t, o, r), r;
1219
1219
  };
1220
- let I = class extends V {
1220
+ let Y = class extends N {
1221
1221
  constructor() {
1222
1222
  super(...arguments), this.checked = !1, this.disabled = !1, this.rippleElement = null;
1223
1223
  }
1224
1224
  // 切换开关状态
1225
- toggleSwitch(t) {
1226
- this.disabled || (t.stopPropagation(), this.checked = !this.checked, this.dispatchEvent(
1225
+ toggleSwitch(e) {
1226
+ this.disabled || (e.stopPropagation(), this.checked = !this.checked, this.dispatchEvent(
1227
1227
  new CustomEvent("change", {
1228
1228
  bubbles: !0,
1229
1229
  composed: !0,
1230
1230
  detail: this.checked
1231
1231
  })
1232
- ), this.createRipple(t));
1233
- }
1234
- createRipple(t) {
1235
- const e = this.shadowRoot?.querySelector(".switch-wrapper");
1236
- if (!e) return;
1237
- const o = e.querySelector(".ripple");
1238
- o && e.removeChild(o);
1239
- const r = document.createElement("div");
1240
- r.classList.add("ripple"), e.appendChild(r), r.addEventListener("animationend", () => {
1241
- e.contains(r) && e.removeChild(r);
1232
+ ), this.createRipple(e));
1233
+ }
1234
+ createRipple(e) {
1235
+ const t = this.shadowRoot?.querySelector(".switch-wrapper");
1236
+ if (!t) return;
1237
+ const o = t.querySelector(".ripple");
1238
+ o && t.removeChild(o);
1239
+ const s = document.createElement("div");
1240
+ s.classList.add("ripple"), t.appendChild(s), s.addEventListener("animationend", () => {
1241
+ t.contains(s) && t.removeChild(s);
1242
1242
  });
1243
1243
  }
1244
1244
  // 渲染开关组件
1245
1245
  render() {
1246
- return te`<div class=switch-wrapper><div class=switch-container @click=${this.toggleSwitch} aria-checked=${this.checked} aria-disabled=${this.disabled} role=switch><div class=switch-thumb></div></div></div>`;
1246
+ return st`<div class=switch-wrapper><div class=switch-container @click=${this.toggleSwitch} aria-checked=${this.checked} aria-disabled=${this.disabled} role=switch><div class=switch-thumb></div></div></div>`;
1247
1247
  }
1248
1248
  connectedCallback() {
1249
1249
  this.style.transition = "none", super.connectedCallback(), requestAnimationFrame(() => {
@@ -1251,71 +1251,71 @@ let I = class extends V {
1251
1251
  });
1252
1252
  }
1253
1253
  };
1254
- I.styles = [ft];
1255
- le([
1254
+ Y.styles = [me];
1255
+ ct([
1256
1256
  h({ type: Boolean, reflect: !0 })
1257
- ], I.prototype, "checked", 2);
1258
- le([
1257
+ ], Y.prototype, "checked", 2);
1258
+ ct([
1259
1259
  h({ type: Boolean, reflect: !0 })
1260
- ], I.prototype, "disabled", 2);
1261
- I = le([
1262
- T("nf-switch")
1263
- ], I);
1264
- const gt = { ATTRIBUTE: 1 }, vt = (t) => (...e) => ({ _$litDirective$: t, values: e });
1265
- let _t = class {
1266
- constructor(e) {
1260
+ ], Y.prototype, "disabled", 2);
1261
+ Y = ct([
1262
+ D("nf-switch")
1263
+ ], Y);
1264
+ const ye = { ATTRIBUTE: 1 }, we = (e) => (...t) => ({ _$litDirective$: e, values: t });
1265
+ let _e = class {
1266
+ constructor(t) {
1267
1267
  }
1268
1268
  get _$AU() {
1269
1269
  return this._$AM._$AU;
1270
1270
  }
1271
- _$AT(e, o, r) {
1272
- this._$Ct = e, this._$AM = o, this._$Ci = r;
1271
+ _$AT(t, o, s) {
1272
+ this._$Ct = t, this._$AM = o, this._$Ci = s;
1273
1273
  }
1274
- _$AS(e, o) {
1275
- return this.update(e, o);
1274
+ _$AS(t, o) {
1275
+ return this.update(t, o);
1276
1276
  }
1277
- update(e, o) {
1277
+ update(t, o) {
1278
1278
  return this.render(...o);
1279
1279
  }
1280
1280
  };
1281
- const Ee = "important", yt = " !" + Ee, ye = vt(class extends _t {
1282
- constructor(t) {
1283
- if (super(t), t.type !== gt.ATTRIBUTE || t.name !== "style" || t.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
1281
+ const Ct = "important", $e = " !" + Ct, $t = we(class extends _e {
1282
+ constructor(e) {
1283
+ if (super(e), e.type !== ye.ATTRIBUTE || e.name !== "style" || e.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
1284
1284
  }
1285
- render(t) {
1286
- return Object.keys(t).reduce((e, o) => {
1287
- const r = t[o];
1288
- return r == null ? e : e + `${o = o.includes("-") ? o : o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${r};`;
1285
+ render(e) {
1286
+ return Object.keys(e).reduce((t, o) => {
1287
+ const s = e[o];
1288
+ return s == null ? t : t + `${o = o.includes("-") ? o : o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s};`;
1289
1289
  }, "");
1290
1290
  }
1291
- update(t, [e]) {
1292
- const { style: o } = t.element;
1293
- if (this.ft === void 0) return this.ft = new Set(Object.keys(e)), this.render(e);
1294
- for (const r of this.ft) e[r] == null && (this.ft.delete(r), r.includes("-") ? o.removeProperty(r) : o[r] = null);
1295
- for (const r in e) {
1296
- const s = e[r];
1297
- if (s != null) {
1298
- this.ft.add(r);
1299
- const i = typeof s == "string" && s.endsWith(yt);
1300
- r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? Ee : "") : o[r] = s;
1291
+ update(e, [t]) {
1292
+ const { style: o } = e.element;
1293
+ if (this.ft === void 0) return this.ft = new Set(Object.keys(t)), this.render(t);
1294
+ for (const s of this.ft) t[s] == null && (this.ft.delete(s), s.includes("-") ? o.removeProperty(s) : o[s] = null);
1295
+ for (const s in t) {
1296
+ const r = t[s];
1297
+ if (r != null) {
1298
+ this.ft.add(s);
1299
+ const i = typeof r == "string" && r.endsWith($e);
1300
+ s.includes("-") || i ? o.setProperty(s, i ? r.slice(0, -11) : r, i ? Ct : "") : o[s] = r;
1301
1301
  }
1302
1302
  }
1303
- return M;
1303
+ return O;
1304
1304
  }
1305
- }), wt = E`:host{display:inline-flex;align-items:center;position:relative;width:100%;height:1.25rem;background-color:var(--nf-border-color,#e0e0e0);border-radius:.625rem;cursor:pointer;-webkit-user-select:none;user-select:none;border:none;box-shadow:none;padding:0}:host:hover{background-color:var(--nf-border-color,#e0e0e0);border:none}:host:focus{box-shadow:none;outline:0}:host([disabled]){cursor:not-allowed;opacity:.6}.slider-fill{position:absolute;left:0;top:0;height:100%;background-color:var(--nf-primary-color,#5e72f9);border-radius:.625rem 0 0 .625rem;pointer-events:none}.slider-handle{position:absolute;width:1.25rem;height:1.25rem;background-color:#fff;border-radius:50%;top:50%;transform:translate(-50%,-50%);cursor:grab;outline:0;box-shadow:0 1px 3px #0000004d;transition:transform .15s ease,box-shadow .15s ease;z-index:1}:host([disabled]) .slider-handle{cursor:not-allowed}:host(:not([disabled])) .slider-handle:hover{transform:translate(-50%,-50%) scale(1.05)}:host(:not([disabled])) .slider-handle:active{cursor:grabbing;transform:translate(-50%,-50%) scale(1.15);box-shadow:0 3px 8px #0006}.slider-handle:focus{box-shadow:0 0 0 3px #5e72f94d}.slider-tooltip{position:absolute;bottom:calc(100% + .5rem);left:50%;transform:translate(-50%);background-color:var(--nf-slider-tooltip-background);color:var(--nf-color);padding:.25rem .5rem;border-radius:.25rem;font-size:.75rem;white-space:nowrap;opacity:0;transition:opacity .2s ease;pointer-events:none;box-shadow:0 0 .4rem .1rem #0000001a}.slider-tooltip.visible{opacity:1}`;
1306
- var $t = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, y = (t, e, o, r) => {
1307
- for (var s = r > 1 ? void 0 : r ? xt(e, o) : e, i = t.length - 1, n; i >= 0; i--)
1308
- (n = t[i]) && (s = (r ? n(e, o, s) : n(s)) || s);
1309
- return r && s && $t(e, o, s), s;
1305
+ }), xe = A`:host{display:inline-flex;align-items:center;position:relative;width:100%;height:1.25rem;background-color:var(--nf-border-color,#e0e0e0);border-radius:.625rem;cursor:pointer;-webkit-user-select:none;user-select:none;border:none;box-shadow:none;padding:0}:host:hover{background-color:var(--nf-border-color,#e0e0e0);border:none}:host:focus{box-shadow:none;outline:0}:host([disabled]){cursor:not-allowed;opacity:.6}.slider-fill{position:absolute;left:0;top:0;height:100%;background-color:var(--nf-primary-color,#5e72f9);border-radius:.625rem 0 0 .625rem;pointer-events:none}.slider-handle{position:absolute;width:1.25rem;height:1.25rem;background-color:#fff;border-radius:50%;top:50%;transform:translate(-50%,-50%);cursor:grab;outline:0;box-shadow:0 1px 3px #0000004d;transition:transform .15s ease,box-shadow .15s ease;z-index:1}:host([disabled]) .slider-handle{cursor:not-allowed}:host(:not([disabled])) .slider-handle:hover{transform:translate(-50%,-50%) scale(1.05)}:host(:not([disabled])) .slider-handle:active{cursor:grabbing;transform:translate(-50%,-50%) scale(1.15);box-shadow:0 3px 8px #0006}.slider-handle:focus{box-shadow:0 0 0 3px #5e72f94d}.slider-tooltip{position:absolute;bottom:calc(100% + .5rem);left:50%;transform:translate(-50%);background-color:var(--nf-slider-tooltip-background);color:var(--nf-color);padding:.25rem .5rem;border-radius:.25rem;font-size:.75rem;white-space:nowrap;opacity:0;transition:opacity .2s ease;pointer-events:none;box-shadow:0 0 .4rem .1rem #0000001a}.slider-tooltip.visible{opacity:1}`;
1306
+ var ke = Object.defineProperty, Ee = Object.getOwnPropertyDescriptor, $ = (e, t, o, s) => {
1307
+ for (var r = s > 1 ? void 0 : s ? Ee(t, o) : t, i = e.length - 1, n; i >= 0; i--)
1308
+ (n = e[i]) && (r = (s ? n(t, o, r) : n(r)) || r);
1309
+ return s && r && ke(t, o, r), r;
1310
1310
  };
1311
- let v = class extends R {
1311
+ let v = class extends L {
1312
1312
  constructor() {
1313
- super(...arguments), this.value = 0, this.defaultValue = 0, this.min = 0, this.max = 100, this.step = 1, this.disabled = !1, this.range = !1, this.tooltip = !1, this._currentValue = 0, this._isDragging = !1, this._showTooltip = !1, this._handleHostMouseDown = (t) => {
1314
- this.disabled || (t.preventDefault(), this._startDrag(t));
1315
- }, this._handleHostTouchStart = (t) => {
1316
- this.disabled || (t.preventDefault(), this._startDrag(t));
1317
- }, this._handleDrag = (t) => {
1318
- this._isDragging && (t.preventDefault(), this._updateValue(t));
1313
+ super(...arguments), this.value = 0, this.defaultValue = 0, this.min = 0, this.max = 100, this.step = 1, this.disabled = !1, this.range = !1, this.tooltip = !1, this._currentValue = 0, this._isDragging = !1, this._showTooltip = !1, this._handleHostMouseDown = (e) => {
1314
+ this.disabled || (e.preventDefault(), this._startDrag(e));
1315
+ }, this._handleHostTouchStart = (e) => {
1316
+ this.disabled || (e.preventDefault(), this._startDrag(e));
1317
+ }, this._handleDrag = (e) => {
1318
+ this._isDragging && (e.preventDefault(), this._updateValue(e));
1319
1319
  }, this._stopDrag = () => {
1320
1320
  this._isDragging && (this._isDragging = !1, this._showTooltip = !1, document.removeEventListener("mousemove", this._handleDrag), document.removeEventListener("touchmove", this._handleDrag), document.removeEventListener("mouseup", this._stopDrag), document.removeEventListener("touchend", this._stopDrag), this.dispatchEvent(
1321
1321
  new CustomEvent("change", {
@@ -1334,38 +1334,38 @@ let v = class extends R {
1334
1334
  disconnectedCallback() {
1335
1335
  super.disconnectedCallback(), this.removeEventListener("mousedown", this._handleHostMouseDown), this.removeEventListener("touchstart", this._handleHostTouchStart), document.removeEventListener("mousemove", this._handleDrag), document.removeEventListener("touchmove", this._handleDrag), document.removeEventListener("mouseup", this._stopDrag), document.removeEventListener("touchend", this._stopDrag);
1336
1336
  }
1337
- updated(t) {
1338
- t.has("value") && (this._currentValue = this.value);
1337
+ updated(e) {
1338
+ e.has("value") && (this._currentValue = this.value);
1339
1339
  }
1340
- _handleMouseDown(t) {
1341
- this.disabled || (t.stopPropagation(), t.preventDefault(), this._startDrag(t));
1340
+ _handleMouseDown(e) {
1341
+ this.disabled || (e.stopPropagation(), e.preventDefault(), this._startDrag(e));
1342
1342
  }
1343
- _handleTouchStart(t) {
1344
- this.disabled || (t.stopPropagation(), t.preventDefault(), this._startDrag(t));
1343
+ _handleTouchStart(e) {
1344
+ this.disabled || (e.stopPropagation(), e.preventDefault(), this._startDrag(e));
1345
1345
  }
1346
- _handleKeyDown(t) {
1346
+ _handleKeyDown(e) {
1347
1347
  if (this.disabled) return;
1348
- let e = this._currentValue;
1349
- switch (t.key) {
1348
+ let t = this._currentValue;
1349
+ switch (e.key) {
1350
1350
  case "ArrowLeft":
1351
1351
  case "ArrowDown":
1352
- e = Math.max(this.min, this._currentValue - this.step), t.preventDefault();
1352
+ t = Math.max(this.min, this._currentValue - this.step), e.preventDefault();
1353
1353
  break;
1354
1354
  case "ArrowRight":
1355
1355
  case "ArrowUp":
1356
- e = Math.min(this.max, this._currentValue + this.step), t.preventDefault();
1356
+ t = Math.min(this.max, this._currentValue + this.step), e.preventDefault();
1357
1357
  break;
1358
1358
  case "Home":
1359
- e = this.min, t.preventDefault();
1359
+ t = this.min, e.preventDefault();
1360
1360
  break;
1361
1361
  case "End":
1362
- e = this.max, t.preventDefault();
1362
+ t = this.max, e.preventDefault();
1363
1363
  break;
1364
1364
  default:
1365
1365
  this._showTooltip = !1, this.requestUpdate();
1366
1366
  return;
1367
1367
  }
1368
- e !== this._currentValue && (this._currentValue = e, this._showTooltip = !0, this.requestUpdate(), this.dispatchEvent(
1368
+ t !== this._currentValue && (this._currentValue = t, this._showTooltip = !0, this.requestUpdate(), this.dispatchEvent(
1369
1369
  new CustomEvent("change", {
1370
1370
  detail: this._currentValue,
1371
1371
  bubbles: !0,
@@ -1375,65 +1375,187 @@ let v = class extends R {
1375
1375
  this._showTooltip = !1, this.requestUpdate();
1376
1376
  }, 1e3));
1377
1377
  }
1378
- _startDrag(t) {
1379
- this._isDragging = !0, this._showTooltip = !0, this._updateValue(t), document.addEventListener("mousemove", this._handleDrag), document.addEventListener("touchmove", this._handleDrag, { passive: !1 }), document.addEventListener("mouseup", this._stopDrag), document.addEventListener("touchend", this._stopDrag);
1378
+ _startDrag(e) {
1379
+ this._isDragging = !0, this._showTooltip = !0, this._updateValue(e), document.addEventListener("mousemove", this._handleDrag), document.addEventListener("touchmove", this._handleDrag, { passive: !1 }), document.addEventListener("mouseup", this._stopDrag), document.addEventListener("touchend", this._stopDrag);
1380
1380
  }
1381
- _updateValue(t) {
1382
- const e = this.getBoundingClientRect(), o = t instanceof MouseEvent ? t.clientX : t.touches[0].clientX, r = Math.max(0, Math.min(1, (o - e.left) / e.width)), s = this.max - this.min, i = this.min + r * s, n = Math.round((i - this.min) / this.step), l = this.min + n * this.step;
1381
+ _updateValue(e) {
1382
+ const t = this.getBoundingClientRect(), o = e instanceof MouseEvent ? e.clientX : e.touches[0].clientX, s = Math.max(0, Math.min(1, (o - t.left) / t.width)), r = this.max - this.min, i = this.min + s * r, n = Math.round((i - this.min) / this.step), l = this.min + n * this.step;
1383
1383
  this._currentValue = Math.min(this.max, Math.max(this.min, l)), this.requestUpdate();
1384
1384
  }
1385
1385
  _getValuePercentage() {
1386
- const t = this.max - this.min;
1387
- return t === 0 ? 0 : (this._currentValue - this.min) / t * 100;
1386
+ const e = this.max - this.min;
1387
+ return e === 0 ? 0 : (this._currentValue - this.min) / e * 100;
1388
1388
  }
1389
1389
  render() {
1390
- const t = this._getValuePercentage(), e = `${t}%`, o = `${t}%`, r = `slider-tooltip ${this._showTooltip || this.tooltip ? "visible" : ""}`;
1391
- return f`<div class=slider-fill style=${ye({ width: o })}></div><div class=slider-handle style=${ye({ left: e })} tabindex=${this.disabled ? -1 : 0} @mousedown=${this._handleMouseDown} @touchstart=${this._handleTouchStart} @keydown=${this._handleKeyDown}><div class=${r}>${this._currentValue}</div></div>`;
1390
+ const e = this._getValuePercentage(), t = `${e}%`, o = `${e}%`, s = `slider-tooltip ${this._showTooltip || this.tooltip ? "visible" : ""}`;
1391
+ return p`<div class=slider-fill style=${$t({ width: o })}></div><div class=slider-handle style=${$t({ left: t })} tabindex=${this.disabled ? -1 : 0} @mousedown=${this._handleMouseDown} @touchstart=${this._handleTouchStart} @keydown=${this._handleKeyDown}><div class=${s}>${this._currentValue}</div></div>`;
1392
1392
  }
1393
1393
  };
1394
- v.styles = [W, wt];
1395
- y([
1394
+ v.styles = [U, xe];
1395
+ $([
1396
1396
  h({ type: Number })
1397
1397
  ], v.prototype, "value", 2);
1398
- y([
1398
+ $([
1399
1399
  h({ type: Number })
1400
1400
  ], v.prototype, "defaultValue", 2);
1401
- y([
1401
+ $([
1402
1402
  h({ type: Number })
1403
1403
  ], v.prototype, "min", 2);
1404
- y([
1404
+ $([
1405
1405
  h({ type: Number })
1406
1406
  ], v.prototype, "max", 2);
1407
- y([
1407
+ $([
1408
1408
  h({ type: Number })
1409
1409
  ], v.prototype, "step", 2);
1410
- y([
1410
+ $([
1411
1411
  h({ type: Boolean, reflect: !0 })
1412
1412
  ], v.prototype, "disabled", 2);
1413
- y([
1413
+ $([
1414
1414
  h({ type: Boolean })
1415
1415
  ], v.prototype, "range", 2);
1416
- y([
1416
+ $([
1417
1417
  h({ type: Boolean })
1418
1418
  ], v.prototype, "tooltip", 2);
1419
- y([
1420
- w()
1419
+ $([
1420
+ _()
1421
1421
  ], v.prototype, "_currentValue", 2);
1422
- y([
1423
- w()
1422
+ $([
1423
+ _()
1424
1424
  ], v.prototype, "_isDragging", 2);
1425
- y([
1426
- w()
1425
+ $([
1426
+ _()
1427
1427
  ], v.prototype, "_showTooltip", 2);
1428
- v = y([
1429
- T("nf-slider")
1428
+ v = $([
1429
+ D("nf-slider")
1430
1430
  ], v);
1431
+ const Se = A`:host{width:var(--nf-width);position:relative;display:inline-block;--nf-textarea-padding:.4rem .75rem}:host([disabled]) .textarea{cursor:not-allowed;color:var(--nf-color-disabled)}::slotted(*){position:absolute;top:.75rem;left:.75rem;color:var(--nf-color)}:host([disabled]) ::slotted(*){color:var(--nf-color-disabled)}.textarea{position:absolute;inset:0;padding:var(--nf-textarea-padding);outline:0;border:none;background:0 0;box-sizing:border-box;color:var(--nf-color);font-size:var(--nf-font-size);font-weight:var(--nf-font-weight);font-family:var(--nf-font-family),sans-serif;resize:vertical;line-height:1.5715;overflow-y:auto;overflow-x:hidden}.textarea::-webkit-scrollbar{width:6px}.textarea::-webkit-scrollbar-track{background:0 0}.textarea::-webkit-scrollbar-thumb{background:var(--nf-scrollbar-thumb-color,rgba(0,0,0,.2));border-radius:3px}.textarea::-webkit-scrollbar-thumb:hover{background:var(--nf-scrollbar-thumb-hover-color,rgba(0,0,0,.3))}:host([autoSize]) .textarea{resize:none;overflow-y:hidden}.counter{position:absolute;bottom:.5rem;right:.75rem;font-size:.75rem;color:var(--nf-color-secondary,rgba(0,0,0,.45));pointer-events:none;-webkit-user-select:none;user-select:none}`;
1432
+ var Ae = Object.defineProperty, Ce = Object.getOwnPropertyDescriptor, C = (e, t, o, s) => {
1433
+ for (var r = s > 1 ? void 0 : s ? Ce(t, o) : t, i = e.length - 1, n; i >= 0; i--)
1434
+ (n = e[i]) && (r = (s ? n(t, o, r) : n(r)) || r);
1435
+ return s && r && Ae(t, o, r), r;
1436
+ };
1437
+ let x = class extends L {
1438
+ constructor() {
1439
+ super(...arguments), this.value = "", this.placeholder = "", this.rows = 3, this.disabled = !1, this.showCount = !1, this.autoSize = !1, this.onInput = (e) => {
1440
+ e.stopPropagation();
1441
+ const t = e.target, o = t.value;
1442
+ this.textareaRef = t, this.dispatchEvent(
1443
+ new CustomEvent("input", {
1444
+ detail: o,
1445
+ bubbles: !0,
1446
+ composed: !0
1447
+ })
1448
+ ), o !== void 0 && this.value !== o && (this.value = o, this.dispatchEvent(
1449
+ new CustomEvent("change", {
1450
+ detail: o,
1451
+ bubbles: !0,
1452
+ composed: !0
1453
+ })
1454
+ ));
1455
+ }, this.onChange = (e) => {
1456
+ e.stopPropagation();
1457
+ const t = e.target?.value;
1458
+ t !== void 0 && this.value !== t && this.dispatchEvent(
1459
+ new CustomEvent("change", {
1460
+ detail: t,
1461
+ bubbles: !0,
1462
+ composed: !0
1463
+ })
1464
+ );
1465
+ }, this.onKeyDown = (e) => {
1466
+ if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
1467
+ e.stopPropagation();
1468
+ const t = e.target?.value;
1469
+ t !== void 0 && this.dispatchEvent(
1470
+ new CustomEvent("pressEnter", {
1471
+ detail: t,
1472
+ bubbles: !0,
1473
+ composed: !0
1474
+ })
1475
+ );
1476
+ }
1477
+ };
1478
+ }
1479
+ render() {
1480
+ const e = this.showCount && this.maxLength !== void 0;
1481
+ return p`<slot></slot><textarea class=textarea .value=${this.value} placeholder=${this.placeholder} maxlength=${this.maxLength ?? ""} rows=${this.autoSize ? void 0 : this.rows} ?disabled=${this.disabled} @input=${this.onInput} @change=${this.onChange} @keydown=${this.onKeyDown}></textarea>${e ? p`<div class=counter>${this.value.length} / ${this.maxLength}</div>` : ""}`;
1482
+ }
1483
+ adjustHeight() {
1484
+ if (!this.textareaRef || !this.autoSize) return;
1485
+ const e = this.textareaRef;
1486
+ e.style.height = "0", e.style.overflowY = "hidden";
1487
+ const t = e.scrollHeight, o = getComputedStyle(e), s = parseFloat(o.lineHeight), r = parseFloat(o.paddingTop), i = parseFloat(o.paddingBottom);
1488
+ let n = t, l = !1;
1489
+ const a = typeof this.autoSize == "object" ? this.autoSize : {}, c = a.minRows, u = a.maxRows;
1490
+ if (c !== void 0) {
1491
+ const E = s * c + r + i;
1492
+ n = Math.max(n, E);
1493
+ }
1494
+ if (u !== void 0) {
1495
+ const E = s * u + r + i;
1496
+ t > E && (l = !0), n = Math.min(n, E);
1497
+ }
1498
+ const d = parseFloat(getComputedStyle(document.documentElement).fontSize), w = n / d, k = 0.125;
1499
+ e.style.height = `${w}rem`, e.style.overflowY = l ? "auto" : "hidden", this.style.height = `${w + k}rem`;
1500
+ }
1501
+ updated(e) {
1502
+ e.has("value") && this.autoSize && this.textareaRef && this.adjustHeight(), (e.has("rows") || e.has("autoSize")) && (this.updateHostHeight(), e.has("autoSize") && this.autoSize && this.textareaRef && this.adjustHeight());
1503
+ }
1504
+ firstUpdated() {
1505
+ this.textareaRef = this.shadowRoot?.querySelector(".textarea"), this.updateHostHeight(), this.autoSize && this.textareaRef && this.adjustHeight();
1506
+ }
1507
+ updateHostHeight() {
1508
+ if (this.autoSize) {
1509
+ if (!this.textareaRef) {
1510
+ const t = (typeof this.autoSize == "object" ? this.autoSize : {}).minRows ?? 2, n = 0.875 * 1.5715 * t + 0.8 + 0.125;
1511
+ this.style.height = `${n}rem`;
1512
+ }
1513
+ } else {
1514
+ const r = 1.3750624999999999 * this.rows + 0.8 + 0.125;
1515
+ this.style.height = `${r}rem`;
1516
+ }
1517
+ }
1518
+ connectedCallback() {
1519
+ this.style.transition = "none", super.connectedCallback(), requestAnimationFrame(() => {
1520
+ this.style.transition = "";
1521
+ });
1522
+ }
1523
+ };
1524
+ x.styles = [U, Se];
1525
+ C([
1526
+ h({ type: String })
1527
+ ], x.prototype, "value", 2);
1528
+ C([
1529
+ h({ type: String })
1530
+ ], x.prototype, "placeholder", 2);
1531
+ C([
1532
+ h({ type: Number })
1533
+ ], x.prototype, "maxLength", 2);
1534
+ C([
1535
+ h({ type: Number })
1536
+ ], x.prototype, "rows", 2);
1537
+ C([
1538
+ h({ type: Boolean, reflect: !0 })
1539
+ ], x.prototype, "disabled", 2);
1540
+ C([
1541
+ h({ type: Boolean })
1542
+ ], x.prototype, "showCount", 2);
1543
+ C([
1544
+ h({ type: Object })
1545
+ ], x.prototype, "autoSize", 2);
1546
+ C([
1547
+ _()
1548
+ ], x.prototype, "textareaRef", 2);
1549
+ x = C([
1550
+ D("nf-textarea")
1551
+ ], x);
1431
1552
  export {
1432
- j as NfCheckboxElement,
1553
+ K as NfCheckboxElement,
1433
1554
  g as NfColorPickerElement,
1434
- x as NfInputElement,
1435
- p as NfInputNumberElement,
1436
- D as NfSelectElement,
1555
+ S as NfInputElement,
1556
+ f as NfInputNumberElement,
1557
+ z as NfSelectElement,
1437
1558
  v as NfSliderElement,
1438
- I as NfSwitchElement
1559
+ Y as NfSwitchElement,
1560
+ x as NfTextareaElement
1439
1561
  };