@nysds/nys-textinput 1.3.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,4 @@
1
- import { css as qt, LitElement as jt, html as x } from "lit";
2
- import "@nysds/nys-icon";
3
- import "@nysds/nys-label";
4
- import "@nysds/nys-errormessage";
1
+ import { css as lt, LitElement as ht, html as F } from "lit";
5
2
  /*!
6
3
  * ▒█▄░▒█ ▒█░░▒█ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█
7
4
  * ▒█▒█▒█ ▒█▄▄▄█ ░▀▀▀▄▄ ▒█░▒█ ░▀▀▀▄▄
@@ -17,18 +14,18 @@ import "@nysds/nys-errormessage";
17
14
  * Copyright 2019 Google LLC
18
15
  * SPDX-License-Identifier: BSD-3-Clause
19
16
  */
20
- const Q = globalThis, ft = Q.ShadowRoot && (Q.ShadyCSS === void 0 || Q.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ft = Symbol(), mt = /* @__PURE__ */ new WeakMap();
21
- let ne = class {
17
+ const O = globalThis, D = O.ShadowRoot && (O.ShadyCSS === void 0 || O.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, it = Symbol(), Y = /* @__PURE__ */ new WeakMap();
18
+ let dt = class {
22
19
  constructor(t, e, s) {
23
- if (this._$cssResult$ = !0, s !== Ft) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
20
+ if (this._$cssResult$ = !0, s !== it) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
24
21
  this.cssText = t, this.t = e;
25
22
  }
26
23
  get styleSheet() {
27
24
  let t = this.o;
28
25
  const e = this.t;
29
- if (ft && t === void 0) {
26
+ if (D && t === void 0) {
30
27
  const s = e !== void 0 && e.length === 1;
31
- s && (t = mt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && mt.set(e, t));
28
+ s && (t = Y.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Y.set(e, t));
32
29
  }
33
30
  return t;
34
31
  }
@@ -36,26 +33,26 @@ let ne = class {
36
33
  return this.cssText;
37
34
  }
38
35
  };
39
- const re = (n) => new ne(typeof n == "string" ? n : n + "", void 0, Ft), ie = (n, t) => {
40
- if (ft) n.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
36
+ const ut = (n) => new dt(typeof n == "string" ? n : n + "", void 0, it), ct = (n, t) => {
37
+ if (D) n.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
41
38
  else for (const e of t) {
42
- const s = document.createElement("style"), o = Q.litNonce;
43
- o !== void 0 && s.setAttribute("nonce", o), s.textContent = e.cssText, n.appendChild(s);
39
+ const s = document.createElement("style"), i = O.litNonce;
40
+ i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, n.appendChild(s);
44
41
  }
45
- }, xt = ft ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
42
+ }, G = D ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
46
43
  let e = "";
47
44
  for (const s of t.cssRules) e += s.cssText;
48
- return re(e);
45
+ return ut(e);
49
46
  })(n) : n;
50
47
  /**
51
48
  * @license
52
49
  * Copyright 2017 Google LLC
53
50
  * SPDX-License-Identifier: BSD-3-Clause
54
51
  */
55
- const { is: ae, defineProperty: le, getOwnPropertyDescriptor: he, getOwnPropertyNames: ce, getOwnPropertySymbols: de, getPrototypeOf: ue } = Object, I = globalThis, At = I.trustedTypes, pe = At ? At.emptyScript : "", ct = I.reactiveElementPolyfillSupport, j = (n, t) => n, tt = { toAttribute(n, t) {
52
+ const { is: pt, defineProperty: yt, getOwnPropertyDescriptor: _t, getOwnPropertyNames: ft, getOwnPropertySymbols: vt, getPrototypeOf: bt } = Object, $ = globalThis, J = $.trustedTypes, gt = J ? J.emptyScript : "", z = $.reactiveElementPolyfillSupport, M = (n, t) => n, N = { toAttribute(n, t) {
56
53
  switch (t) {
57
54
  case Boolean:
58
- n = n ? pe : null;
55
+ n = n ? gt : null;
59
56
  break;
60
57
  case Object:
61
58
  case Array:
@@ -80,57 +77,57 @@ const { is: ae, defineProperty: le, getOwnPropertyDescriptor: he, getOwnProperty
80
77
  }
81
78
  }
82
79
  return e;
83
- } }, bt = (n, t) => !ae(n, t), wt = { attribute: !0, type: String, converter: tt, reflect: !1, hasChanged: bt };
84
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), I.litPropertyMetadata ?? (I.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
85
- class L extends HTMLElement {
80
+ } }, j = (n, t) => !pt(n, t), K = { attribute: !0, type: String, converter: N, reflect: !1, hasChanged: j };
81
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), $.litPropertyMetadata ?? ($.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
82
+ class S extends HTMLElement {
86
83
  static addInitializer(t) {
87
84
  this._$Ei(), (this.l ?? (this.l = [])).push(t);
88
85
  }
89
86
  static get observedAttributes() {
90
87
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
91
88
  }
92
- static createProperty(t, e = wt) {
89
+ static createProperty(t, e = K) {
93
90
  if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
94
- const s = Symbol(), o = this.getPropertyDescriptor(t, s, e);
95
- o !== void 0 && le(this.prototype, t, o);
91
+ const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
92
+ i !== void 0 && yt(this.prototype, t, i);
96
93
  }
97
94
  }
98
95
  static getPropertyDescriptor(t, e, s) {
99
- const { get: o, set: i } = he(this.prototype, t) ?? { get() {
96
+ const { get: i, set: r } = _t(this.prototype, t) ?? { get() {
100
97
  return this[e];
101
- }, set(r) {
102
- this[e] = r;
98
+ }, set(o) {
99
+ this[e] = o;
103
100
  } };
104
101
  return { get() {
105
- return o == null ? void 0 : o.call(this);
106
- }, set(r) {
107
- const l = o == null ? void 0 : o.call(this);
108
- i.call(this, r), this.requestUpdate(t, l, s);
102
+ return i == null ? void 0 : i.call(this);
103
+ }, set(o) {
104
+ const l = i == null ? void 0 : i.call(this);
105
+ r.call(this, o), this.requestUpdate(t, l, s);
109
106
  }, configurable: !0, enumerable: !0 };
110
107
  }
111
108
  static getPropertyOptions(t) {
112
- return this.elementProperties.get(t) ?? wt;
109
+ return this.elementProperties.get(t) ?? K;
113
110
  }
114
111
  static _$Ei() {
115
- if (this.hasOwnProperty(j("elementProperties"))) return;
116
- const t = ue(this);
112
+ if (this.hasOwnProperty(M("elementProperties"))) return;
113
+ const t = bt(this);
117
114
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
118
115
  }
119
116
  static finalize() {
120
- if (this.hasOwnProperty(j("finalized"))) return;
121
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(j("properties"))) {
122
- const e = this.properties, s = [...ce(e), ...de(e)];
123
- for (const o of s) this.createProperty(o, e[o]);
117
+ if (this.hasOwnProperty(M("finalized"))) return;
118
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(M("properties"))) {
119
+ const e = this.properties, s = [...ft(e), ...vt(e)];
120
+ for (const i of s) this.createProperty(i, e[i]);
124
121
  }
125
122
  const t = this[Symbol.metadata];
126
123
  if (t !== null) {
127
124
  const e = litPropertyMetadata.get(t);
128
- if (e !== void 0) for (const [s, o] of e) this.elementProperties.set(s, o);
125
+ if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
129
126
  }
130
127
  this._$Eh = /* @__PURE__ */ new Map();
131
128
  for (const [e, s] of this.elementProperties) {
132
- const o = this._$Eu(e, s);
133
- o !== void 0 && this._$Eh.set(o, e);
129
+ const i = this._$Eu(e, s);
130
+ i !== void 0 && this._$Eh.set(i, e);
134
131
  }
135
132
  this.elementStyles = this.finalizeStyles(this.styles);
136
133
  }
@@ -138,8 +135,8 @@ class L extends HTMLElement {
138
135
  const e = [];
139
136
  if (Array.isArray(t)) {
140
137
  const s = new Set(t.flat(1 / 0).reverse());
141
- for (const o of s) e.unshift(xt(o));
142
- } else t !== void 0 && e.push(xt(t));
138
+ for (const i of s) e.unshift(G(i));
139
+ } else t !== void 0 && e.push(G(t));
143
140
  return e;
144
141
  }
145
142
  static _$Eu(t, e) {
@@ -168,7 +165,7 @@ class L extends HTMLElement {
168
165
  }
169
166
  createRenderRoot() {
170
167
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
171
- return ie(t, this.constructor.elementStyles), t;
168
+ return ct(t, this.constructor.elementStyles), t;
172
169
  }
173
170
  connectedCallback() {
174
171
  var t;
@@ -190,24 +187,24 @@ class L extends HTMLElement {
190
187
  this._$AK(t, s);
191
188
  }
192
189
  _$EC(t, e) {
193
- var i;
194
- const s = this.constructor.elementProperties.get(t), o = this.constructor._$Eu(t, s);
195
- if (o !== void 0 && s.reflect === !0) {
196
- const r = (((i = s.converter) == null ? void 0 : i.toAttribute) !== void 0 ? s.converter : tt).toAttribute(e, s.type);
197
- this._$Em = t, r == null ? this.removeAttribute(o) : this.setAttribute(o, r), this._$Em = null;
190
+ var r;
191
+ const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
192
+ if (i !== void 0 && s.reflect === !0) {
193
+ const o = (((r = s.converter) == null ? void 0 : r.toAttribute) !== void 0 ? s.converter : N).toAttribute(e, s.type);
194
+ this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
198
195
  }
199
196
  }
200
197
  _$AK(t, e) {
201
- var i;
202
- const s = this.constructor, o = s._$Eh.get(t);
203
- if (o !== void 0 && this._$Em !== o) {
204
- const r = s.getPropertyOptions(o), l = typeof r.converter == "function" ? { fromAttribute: r.converter } : ((i = r.converter) == null ? void 0 : i.fromAttribute) !== void 0 ? r.converter : tt;
205
- this._$Em = o, this[o] = l.fromAttribute(e, r.type), this._$Em = null;
198
+ var r;
199
+ const s = this.constructor, i = s._$Eh.get(t);
200
+ if (i !== void 0 && this._$Em !== i) {
201
+ const o = s.getPropertyOptions(i), l = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((r = o.converter) == null ? void 0 : r.fromAttribute) !== void 0 ? o.converter : N;
202
+ this._$Em = i, this[i] = l.fromAttribute(e, o.type), this._$Em = null;
206
203
  }
207
204
  }
208
205
  requestUpdate(t, e, s) {
209
206
  if (t !== void 0) {
210
- if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? bt)(this[t], e)) return;
207
+ if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? j)(this[t], e)) return;
211
208
  this.P(t, e, s);
212
209
  }
213
210
  this.isUpdatePending === !1 && (this._$ES = this._$ET());
@@ -233,21 +230,21 @@ class L extends HTMLElement {
233
230
  if (!this.isUpdatePending) return;
234
231
  if (!this.hasUpdated) {
235
232
  if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
236
- for (const [i, r] of this._$Ep) this[i] = r;
233
+ for (const [r, o] of this._$Ep) this[r] = o;
237
234
  this._$Ep = void 0;
238
235
  }
239
- const o = this.constructor.elementProperties;
240
- if (o.size > 0) for (const [i, r] of o) r.wrapped !== !0 || this._$AL.has(i) || this[i] === void 0 || this.P(i, this[i], r);
236
+ const i = this.constructor.elementProperties;
237
+ if (i.size > 0) for (const [r, o] of i) o.wrapped !== !0 || this._$AL.has(r) || this[r] === void 0 || this.P(r, this[r], o);
241
238
  }
242
239
  let t = !1;
243
240
  const e = this._$AL;
244
241
  try {
245
- t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((o) => {
246
- var i;
247
- return (i = o.hostUpdate) == null ? void 0 : i.call(o);
242
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => {
243
+ var r;
244
+ return (r = i.hostUpdate) == null ? void 0 : r.call(i);
248
245
  }), this.update(e)) : this._$EU();
249
- } catch (o) {
250
- throw t = !1, this._$EU(), o;
246
+ } catch (i) {
247
+ throw t = !1, this._$EU(), i;
251
248
  }
252
249
  t && this._$AE(e);
253
250
  }
@@ -256,8 +253,8 @@ class L extends HTMLElement {
256
253
  _$AE(t) {
257
254
  var e;
258
255
  (e = this._$EO) == null || e.forEach((s) => {
259
- var o;
260
- return (o = s.hostUpdated) == null ? void 0 : o.call(s);
256
+ var i;
257
+ return (i = s.hostUpdated) == null ? void 0 : i.call(s);
261
258
  }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
262
259
  }
263
260
  _$EU() {
@@ -280,37 +277,37 @@ class L extends HTMLElement {
280
277
  firstUpdated(t) {
281
278
  }
282
279
  }
283
- L.elementStyles = [], L.shadowRootOptions = { mode: "open" }, L[j("elementProperties")] = /* @__PURE__ */ new Map(), L[j("finalized")] = /* @__PURE__ */ new Map(), ct == null || ct({ ReactiveElement: L }), (I.reactiveElementVersions ?? (I.reactiveElementVersions = [])).push("2.0.4");
280
+ S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[M("elementProperties")] = /* @__PURE__ */ new Map(), S[M("finalized")] = /* @__PURE__ */ new Map(), z == null || z({ ReactiveElement: S }), ($.reactiveElementVersions ?? ($.reactiveElementVersions = [])).push("2.0.4");
284
281
  /**
285
282
  * @license
286
283
  * Copyright 2017 Google LLC
287
284
  * SPDX-License-Identifier: BSD-3-Clause
288
285
  */
289
- const ye = { attribute: !0, type: String, converter: tt, reflect: !1, hasChanged: bt }, fe = (n = ye, t, e) => {
290
- const { kind: s, metadata: o } = e;
291
- let i = globalThis.litPropertyMetadata.get(o);
292
- if (i === void 0 && globalThis.litPropertyMetadata.set(o, i = /* @__PURE__ */ new Map()), i.set(e.name, n), s === "accessor") {
293
- const { name: r } = e;
286
+ const $t = { attribute: !0, type: String, converter: N, reflect: !1, hasChanged: j }, mt = (n = $t, t, e) => {
287
+ const { kind: s, metadata: i } = e;
288
+ let r = globalThis.litPropertyMetadata.get(i);
289
+ if (r === void 0 && globalThis.litPropertyMetadata.set(i, r = /* @__PURE__ */ new Map()), r.set(e.name, n), s === "accessor") {
290
+ const { name: o } = e;
294
291
  return { set(l) {
295
292
  const a = t.get.call(this);
296
- t.set.call(this, l), this.requestUpdate(r, a, n);
293
+ t.set.call(this, l), this.requestUpdate(o, a, n);
297
294
  }, init(l) {
298
- return l !== void 0 && this.P(r, void 0, n), l;
295
+ return l !== void 0 && this.P(o, void 0, n), l;
299
296
  } };
300
297
  }
301
298
  if (s === "setter") {
302
- const { name: r } = e;
299
+ const { name: o } = e;
303
300
  return function(l) {
304
- const a = this[r];
305
- t.call(this, l), this.requestUpdate(r, a, n);
301
+ const a = this[o];
302
+ t.call(this, l), this.requestUpdate(o, a, n);
306
303
  };
307
304
  }
308
305
  throw Error("Unsupported decorator location: " + s);
309
306
  };
310
- function p(n) {
311
- return (t, e) => typeof e == "object" ? fe(n, t, e) : ((s, o, i) => {
312
- const r = o.hasOwnProperty(i);
313
- return o.constructor.createProperty(i, r ? { ...s, wrapped: !0 } : s), r ? Object.getOwnPropertyDescriptor(o, i) : void 0;
307
+ function u(n) {
308
+ return (t, e) => typeof e == "object" ? mt(n, t, e) : ((s, i, r) => {
309
+ const o = i.hasOwnProperty(r);
310
+ return i.constructor.createProperty(r, o ? { ...s, wrapped: !0 } : s), o ? Object.getOwnPropertyDescriptor(i, r) : void 0;
314
311
  })(n, t, e);
315
312
  }
316
313
  /**
@@ -318,10 +315,10 @@ function p(n) {
318
315
  * Copyright 2017 Google LLC
319
316
  * SPDX-License-Identifier: BSD-3-Clause
320
317
  */
321
- function be(n) {
322
- return p({ ...n, state: !0, attribute: !1 });
318
+ function xt(n) {
319
+ return u({ ...n, state: !0, attribute: !1 });
323
320
  }
324
- const ve = qt`
321
+ const wt = lt`
325
322
  :host {
326
323
  /* Anything that can be overridden should be defined here */
327
324
 
@@ -540,70 +537,70 @@ const ve = qt`
540
537
  * Copyright 2017 Google LLC
541
538
  * SPDX-License-Identifier: BSD-3-Clause
542
539
  */
543
- const F = globalThis, et = F.trustedTypes, St = et ? et.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Wt = "$lit$", P = `lit$${Math.random().toFixed(9).slice(2)}$`, Gt = "?" + P, _e = `<${Gt}>`, O = document, st = () => O.createComment(""), G = (n) => n === null || typeof n != "object" && typeof n != "function", vt = Array.isArray, ge = (n) => vt(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", dt = `[
544
- \f\r]`, V = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Et = /-->/g, Pt = />/g, U = RegExp(`>|${dt}(?:([^\\s"'>=/]+)(${dt}*=${dt}*(?:[^
545
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, It = /"/g, Kt = /^(?:script|style|textarea|title)$/i, K = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), Ut = /* @__PURE__ */ new WeakMap(), M = O.createTreeWalker(O, 129);
546
- function Zt(n, t) {
547
- if (!vt(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
548
- return St !== void 0 ? St.createHTML(t) : t;
540
+ const C = globalThis, R = C.trustedTypes, Z = R ? R.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, nt = "$lit$", g = `lit$${Math.random().toFixed(9).slice(2)}$`, rt = "?" + g, At = `<${rt}>`, A = document, k = () => A.createComment(""), U = (n) => n === null || typeof n != "object" && typeof n != "function", W = Array.isArray, Et = (n) => W(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", L = `[
541
+ \f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Q = /-->/g, X = />/g, m = RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^
542
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), tt = /'/g, et = /"/g, ot = /^(?:script|style|textarea|title)$/i, H = Symbol.for("lit-noChange"), y = Symbol.for("lit-nothing"), st = /* @__PURE__ */ new WeakMap(), w = A.createTreeWalker(A, 129);
543
+ function at(n, t) {
544
+ if (!W(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
545
+ return Z !== void 0 ? Z.createHTML(t) : t;
549
546
  }
550
- const $e = (n, t) => {
547
+ const St = (n, t) => {
551
548
  const e = n.length - 1, s = [];
552
- let o, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", r = V;
549
+ let i, r = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = P;
553
550
  for (let l = 0; l < e; l++) {
554
551
  const a = n[l];
555
- let c, d, h = -1, b = 0;
556
- for (; b < a.length && (r.lastIndex = b, d = r.exec(a), d !== null); ) b = r.lastIndex, r === V ? d[1] === "!--" ? r = Et : d[1] !== void 0 ? r = Pt : d[2] !== void 0 ? (Kt.test(d[2]) && (o = RegExp("</" + d[2], "g")), r = U) : d[3] !== void 0 && (r = U) : r === U ? d[0] === ">" ? (r = o ?? V, h = -1) : d[1] === void 0 ? h = -2 : (h = r.lastIndex - d[2].length, c = d[1], r = d[3] === void 0 ? U : d[3] === '"' ? It : Ct) : r === It || r === Ct ? r = U : r === Et || r === Pt ? r = V : (r = U, o = void 0);
557
- const m = r === U && n[l + 1].startsWith("/>") ? " " : "";
558
- i += r === V ? a + _e : h >= 0 ? (s.push(c), a.slice(0, h) + Wt + a.slice(h) + P + m) : a + P + (h === -2 ? l : m);
552
+ let p, _, h = -1, v = 0;
553
+ for (; v < a.length && (o.lastIndex = v, _ = o.exec(a), _ !== null); ) v = o.lastIndex, o === P ? _[1] === "!--" ? o = Q : _[1] !== void 0 ? o = X : _[2] !== void 0 ? (ot.test(_[2]) && (i = RegExp("</" + _[2], "g")), o = m) : _[3] !== void 0 && (o = m) : o === m ? _[0] === ">" ? (o = i ?? P, h = -1) : _[1] === void 0 ? h = -2 : (h = o.lastIndex - _[2].length, p = _[1], o = _[3] === void 0 ? m : _[3] === '"' ? et : tt) : o === et || o === tt ? o = m : o === Q || o === X ? o = P : (o = m, i = void 0);
554
+ const b = o === m && n[l + 1].startsWith("/>") ? " " : "";
555
+ r += o === P ? a + At : h >= 0 ? (s.push(p), a.slice(0, h) + nt + a.slice(h) + g + b) : a + g + (h === -2 ? l : b);
559
556
  }
560
- return [Zt(n, i + (n[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
557
+ return [at(n, r + (n[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
561
558
  };
562
- let yt = class Yt {
559
+ class T {
563
560
  constructor({ strings: t, _$litType$: e }, s) {
564
- let o;
561
+ let i;
565
562
  this.parts = [];
566
- let i = 0, r = 0;
567
- const l = t.length - 1, a = this.parts, [c, d] = $e(t, e);
568
- if (this.el = Yt.createElement(c, s), M.currentNode = this.el.content, e === 2 || e === 3) {
563
+ let r = 0, o = 0;
564
+ const l = t.length - 1, a = this.parts, [p, _] = St(t, e);
565
+ if (this.el = T.createElement(p, s), w.currentNode = this.el.content, e === 2 || e === 3) {
569
566
  const h = this.el.content.firstChild;
570
567
  h.replaceWith(...h.childNodes);
571
568
  }
572
- for (; (o = M.nextNode()) !== null && a.length < l; ) {
573
- if (o.nodeType === 1) {
574
- if (o.hasAttributes()) for (const h of o.getAttributeNames()) if (h.endsWith(Wt)) {
575
- const b = d[r++], m = o.getAttribute(h).split(P), S = /([.?@])?(.*)/.exec(b);
576
- a.push({ type: 1, index: i, name: S[2], strings: m, ctor: S[1] === "." ? xe : S[1] === "?" ? Ae : S[1] === "@" ? we : at }), o.removeAttribute(h);
577
- } else h.startsWith(P) && (a.push({ type: 6, index: i }), o.removeAttribute(h));
578
- if (Kt.test(o.tagName)) {
579
- const h = o.textContent.split(P), b = h.length - 1;
580
- if (b > 0) {
581
- o.textContent = et ? et.emptyScript : "";
582
- for (let m = 0; m < b; m++) o.append(h[m], st()), M.nextNode(), a.push({ type: 2, index: ++i });
583
- o.append(h[b], st());
569
+ for (; (i = w.nextNode()) !== null && a.length < l; ) {
570
+ if (i.nodeType === 1) {
571
+ if (i.hasAttributes()) for (const h of i.getAttributeNames()) if (h.endsWith(nt)) {
572
+ const v = _[o++], b = i.getAttribute(h).split(g), I = /([.?@])?(.*)/.exec(v);
573
+ a.push({ type: 1, index: r, name: I[2], strings: b, ctor: I[1] === "." ? Mt : I[1] === "?" ? Ct : I[1] === "@" ? Ut : V }), i.removeAttribute(h);
574
+ } else h.startsWith(g) && (a.push({ type: 6, index: r }), i.removeAttribute(h));
575
+ if (ot.test(i.tagName)) {
576
+ const h = i.textContent.split(g), v = h.length - 1;
577
+ if (v > 0) {
578
+ i.textContent = R ? R.emptyScript : "";
579
+ for (let b = 0; b < v; b++) i.append(h[b], k()), w.nextNode(), a.push({ type: 2, index: ++r });
580
+ i.append(h[v], k());
584
581
  }
585
582
  }
586
- } else if (o.nodeType === 8) if (o.data === Gt) a.push({ type: 2, index: i });
583
+ } else if (i.nodeType === 8) if (i.data === rt) a.push({ type: 2, index: r });
587
584
  else {
588
585
  let h = -1;
589
- for (; (h = o.data.indexOf(P, h + 1)) !== -1; ) a.push({ type: 7, index: i }), h += P.length - 1;
586
+ for (; (h = i.data.indexOf(g, h + 1)) !== -1; ) a.push({ type: 7, index: r }), h += g.length - 1;
590
587
  }
591
- i++;
588
+ r++;
592
589
  }
593
590
  }
594
591
  static createElement(t, e) {
595
- const s = O.createElement("template");
592
+ const s = A.createElement("template");
596
593
  return s.innerHTML = t, s;
597
594
  }
598
- };
599
- function R(n, t, e = n, s) {
600
- var r, l;
601
- if (t === K) return t;
602
- let o = s !== void 0 ? (r = e._$Co) == null ? void 0 : r[s] : e._$Cl;
603
- const i = G(t) ? void 0 : t._$litDirective$;
604
- return (o == null ? void 0 : o.constructor) !== i && ((l = o == null ? void 0 : o._$AO) == null || l.call(o, !1), i === void 0 ? o = void 0 : (o = new i(n), o._$AT(n, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = o : e._$Cl = o), o !== void 0 && (t = R(n, o._$AS(n, t.values), o, s)), t;
605
595
  }
606
- let me = class {
596
+ function E(n, t, e = n, s) {
597
+ var o, l;
598
+ if (t === H) return t;
599
+ let i = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
600
+ const r = U(t) ? void 0 : t._$litDirective$;
601
+ return (i == null ? void 0 : i.constructor) !== r && ((l = i == null ? void 0 : i._$AO) == null || l.call(i, !1), r === void 0 ? i = void 0 : (i = new r(n), i._$AT(n, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = E(n, i._$AS(n, t.values), i, s)), t;
602
+ }
603
+ class Pt {
607
604
  constructor(t, e) {
608
605
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
609
606
  }
@@ -614,29 +611,30 @@ let me = class {
614
611
  return this._$AM._$AU;
615
612
  }
616
613
  u(t) {
617
- const { el: { content: e }, parts: s } = this._$AD, o = ((t == null ? void 0 : t.creationScope) ?? O).importNode(e, !0);
618
- M.currentNode = o;
619
- let i = M.nextNode(), r = 0, l = 0, a = s[0];
614
+ const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? A).importNode(e, !0);
615
+ w.currentNode = i;
616
+ let r = w.nextNode(), o = 0, l = 0, a = s[0];
620
617
  for (; a !== void 0; ) {
621
- if (r === a.index) {
622
- let c;
623
- a.type === 2 ? c = new Jt(i, i.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(i, a.name, a.strings, this, t) : a.type === 6 && (c = new Se(i, this, t)), this._$AV.push(c), a = s[++l];
618
+ if (o === a.index) {
619
+ let p;
620
+ a.type === 2 ? p = new B(r, r.nextSibling, this, t) : a.type === 1 ? p = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (p = new Ht(r, this, t)), this._$AV.push(p), a = s[++l];
624
621
  }
625
- r !== (a == null ? void 0 : a.index) && (i = M.nextNode(), r++);
622
+ o !== (a == null ? void 0 : a.index) && (r = w.nextNode(), o++);
626
623
  }
627
- return M.currentNode = O, o;
624
+ return w.currentNode = A, i;
628
625
  }
629
626
  p(t) {
630
627
  let e = 0;
631
628
  for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
632
629
  }
633
- }, Jt = class Qt {
630
+ }
631
+ class B {
634
632
  get _$AU() {
635
633
  var t;
636
634
  return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
637
635
  }
638
- constructor(t, e, s, o) {
639
- this.type = 2, this._$AH = v, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = o, this._$Cv = (o == null ? void 0 : o.isConnected) ?? !0;
636
+ constructor(t, e, s, i) {
637
+ this.type = 2, this._$AH = y, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
640
638
  }
641
639
  get parentNode() {
642
640
  let t = this._$AA.parentNode;
@@ -650,7 +648,7 @@ let me = class {
650
648
  return this._$AB;
651
649
  }
652
650
  _$AI(t, e = this) {
653
- t = R(this, t, e), G(t) ? t === v || t == null || t === "" ? (this._$AH !== v && this._$AR(), this._$AH = v) : t !== this._$AH && t !== K && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : ge(t) ? this.k(t) : this._(t);
651
+ t = E(this, t, e), U(t) ? t === y || t == null || t === "" ? (this._$AH !== y && this._$AR(), this._$AH = y) : t !== this._$AH && t !== H && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Et(t) ? this.k(t) : this._(t);
654
652
  }
655
653
  O(t) {
656
654
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -659,93 +657,96 @@ let me = class {
659
657
  this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
660
658
  }
661
659
  _(t) {
662
- this._$AH !== v && G(this._$AH) ? this._$AA.nextSibling.data = t : this.T(O.createTextNode(t)), this._$AH = t;
660
+ this._$AH !== y && U(this._$AH) ? this._$AA.nextSibling.data = t : this.T(A.createTextNode(t)), this._$AH = t;
663
661
  }
664
662
  $(t) {
665
- var i;
666
- const { values: e, _$litType$: s } = t, o = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = yt.createElement(Zt(s.h, s.h[0]), this.options)), s);
667
- if (((i = this._$AH) == null ? void 0 : i._$AD) === o) this._$AH.p(e);
663
+ var r;
664
+ const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = T.createElement(at(s.h, s.h[0]), this.options)), s);
665
+ if (((r = this._$AH) == null ? void 0 : r._$AD) === i) this._$AH.p(e);
668
666
  else {
669
- const r = new me(o, this), l = r.u(this.options);
670
- r.p(e), this.T(l), this._$AH = r;
667
+ const o = new Pt(i, this), l = o.u(this.options);
668
+ o.p(e), this.T(l), this._$AH = o;
671
669
  }
672
670
  }
673
671
  _$AC(t) {
674
- let e = Ut.get(t.strings);
675
- return e === void 0 && Ut.set(t.strings, e = new yt(t)), e;
672
+ let e = st.get(t.strings);
673
+ return e === void 0 && st.set(t.strings, e = new T(t)), e;
676
674
  }
677
675
  k(t) {
678
- vt(this._$AH) || (this._$AH = [], this._$AR());
676
+ W(this._$AH) || (this._$AH = [], this._$AR());
679
677
  const e = this._$AH;
680
- let s, o = 0;
681
- for (const i of t) o === e.length ? e.push(s = new Qt(this.O(st()), this.O(st()), this, this.options)) : s = e[o], s._$AI(i), o++;
682
- o < e.length && (this._$AR(s && s._$AB.nextSibling, o), e.length = o);
678
+ let s, i = 0;
679
+ for (const r of t) i === e.length ? e.push(s = new B(this.O(k()), this.O(k()), this, this.options)) : s = e[i], s._$AI(r), i++;
680
+ i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
683
681
  }
684
682
  _$AR(t = this._$AA.nextSibling, e) {
685
683
  var s;
686
684
  for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
687
- const o = t.nextSibling;
688
- t.remove(), t = o;
685
+ const i = t.nextSibling;
686
+ t.remove(), t = i;
689
687
  }
690
688
  }
691
689
  setConnected(t) {
692
690
  var e;
693
691
  this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
694
692
  }
695
- }, at = class {
693
+ }
694
+ class V {
696
695
  get tagName() {
697
696
  return this.element.tagName;
698
697
  }
699
698
  get _$AU() {
700
699
  return this._$AM._$AU;
701
700
  }
702
- constructor(t, e, s, o, i) {
703
- this.type = 1, this._$AH = v, this._$AN = void 0, this.element = t, this.name = e, this._$AM = o, this.options = i, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = v;
701
+ constructor(t, e, s, i, r) {
702
+ this.type = 1, this._$AH = y, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = r, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = y;
704
703
  }
705
- _$AI(t, e = this, s, o) {
706
- const i = this.strings;
707
- let r = !1;
708
- if (i === void 0) t = R(this, t, e, 0), r = !G(t) || t !== this._$AH && t !== K, r && (this._$AH = t);
704
+ _$AI(t, e = this, s, i) {
705
+ const r = this.strings;
706
+ let o = !1;
707
+ if (r === void 0) t = E(this, t, e, 0), o = !U(t) || t !== this._$AH && t !== H, o && (this._$AH = t);
709
708
  else {
710
709
  const l = t;
711
- let a, c;
712
- for (t = i[0], a = 0; a < i.length - 1; a++) c = R(this, l[s + a], e, a), c === K && (c = this._$AH[a]), r || (r = !G(c) || c !== this._$AH[a]), c === v ? t = v : t !== v && (t += (c ?? "") + i[a + 1]), this._$AH[a] = c;
710
+ let a, p;
711
+ for (t = r[0], a = 0; a < r.length - 1; a++) p = E(this, l[s + a], e, a), p === H && (p = this._$AH[a]), o || (o = !U(p) || p !== this._$AH[a]), p === y ? t = y : t !== y && (t += (p ?? "") + r[a + 1]), this._$AH[a] = p;
713
712
  }
714
- r && !o && this.j(t);
713
+ o && !i && this.j(t);
715
714
  }
716
715
  j(t) {
717
- t === v ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
716
+ t === y ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
718
717
  }
719
- };
720
- class xe extends at {
718
+ }
719
+ class Mt extends V {
721
720
  constructor() {
722
721
  super(...arguments), this.type = 3;
723
722
  }
724
723
  j(t) {
725
- this.element[this.name] = t === v ? void 0 : t;
724
+ this.element[this.name] = t === y ? void 0 : t;
726
725
  }
727
726
  }
728
- let Ae = class extends at {
727
+ class Ct extends V {
729
728
  constructor() {
730
729
  super(...arguments), this.type = 4;
731
730
  }
732
731
  j(t) {
733
- this.element.toggleAttribute(this.name, !!t && t !== v);
732
+ this.element.toggleAttribute(this.name, !!t && t !== y);
734
733
  }
735
- }, we = class extends at {
736
- constructor(t, e, s, o, i) {
737
- super(t, e, s, o, i), this.type = 5;
734
+ }
735
+ class Ut extends V {
736
+ constructor(t, e, s, i, r) {
737
+ super(t, e, s, i, r), this.type = 5;
738
738
  }
739
739
  _$AI(t, e = this) {
740
- if ((t = R(this, t, e, 0) ?? v) === K) return;
741
- const s = this._$AH, o = t === v && s !== v || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, i = t !== v && (s === v || o);
742
- o && this.element.removeEventListener(this.name, this, s), i && this.element.addEventListener(this.name, this, t), this._$AH = t;
740
+ if ((t = E(this, t, e, 0) ?? y) === H) return;
741
+ const s = this._$AH, i = t === y && s !== y || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, r = t !== y && (s === y || i);
742
+ i && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
743
743
  }
744
744
  handleEvent(t) {
745
745
  var e;
746
746
  typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
747
747
  }
748
- }, Se = class {
748
+ }
749
+ class Ht {
749
750
  constructor(t, e, s) {
750
751
  this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
751
752
  }
@@ -753,1330 +754,142 @@ let Ae = class extends at {
753
754
  return this._$AM._$AU;
754
755
  }
755
756
  _$AI(t) {
756
- R(this, t);
757
+ E(this, t);
757
758
  }
758
- };
759
- const ut = F.litHtmlPolyfillSupport;
760
- ut == null || ut(yt, Jt), (F.litHtmlVersions ?? (F.litHtmlVersions = [])).push("3.2.1");
759
+ }
760
+ const q = C.litHtmlPolyfillSupport;
761
+ q == null || q(T, B), (C.litHtmlVersions ?? (C.litHtmlVersions = [])).push("3.2.1");
761
762
  /**
762
763
  * @license
763
764
  * Copyright 2018 Google LLC
764
765
  * SPDX-License-Identifier: BSD-3-Clause
765
766
  */
766
- const T = (n) => n ?? v;
767
- /*!
768
- *
769
- * ▒█▄░▒█ ▒█░░▒█ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█
770
- * ▒█▒█▒█ ▒█▄▄▄█ ░▀▀▀▄▄ ▒█░▒█ ░▀▀▀▄▄
771
- * ▒█░░▀█ ░░▒█░░ ▒█▄▄▄█ ▒█▄▄▀ ▒█▄▄▄█
772
- *
773
- * Button Component
774
- * Part of the New York State Design System
775
- * Repository: https://github.com/its-hcd/nysds
776
- * License: MIT
777
- */
778
- /**
779
- * @license
780
- * Copyright 2019 Google LLC
781
- * SPDX-License-Identifier: BSD-3-Clause
782
- */
783
- const X = globalThis, _t = X.ShadowRoot && (X.ShadyCSS === void 0 || X.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Xt = Symbol(), Tt = /* @__PURE__ */ new WeakMap();
784
- let Ee = class {
785
- constructor(n, t, e) {
786
- if (this._$cssResult$ = !0, e !== Xt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
787
- this.cssText = n, this.t = t;
788
- }
789
- get styleSheet() {
790
- let n = this.o;
791
- const t = this.t;
792
- if (_t && n === void 0) {
793
- const e = t !== void 0 && t.length === 1;
794
- e && (n = Tt.get(t)), n === void 0 && ((this.o = n = new CSSStyleSheet()).replaceSync(this.cssText), e && Tt.set(t, n));
795
- }
796
- return n;
797
- }
798
- toString() {
799
- return this.cssText;
800
- }
767
+ const x = (n) => n ?? y;
768
+ var Tt = Object.defineProperty, It = Object.getOwnPropertyDescriptor, c = (n, t, e, s) => {
769
+ for (var i = s > 1 ? void 0 : s ? It(t, e) : t, r = n.length - 1, o; r >= 0; r--)
770
+ (o = n[r]) && (i = (s ? o(t, e, i) : o(i)) || i);
771
+ return s && i && Tt(t, e, i), i;
801
772
  };
802
- const Pe = (n) => new Ee(typeof n == "string" ? n : n + "", void 0, Xt), Ce = (n, t) => {
803
- if (_t) n.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
804
- else for (const e of t) {
805
- const s = document.createElement("style"), o = X.litNonce;
806
- o !== void 0 && s.setAttribute("nonce", o), s.textContent = e.cssText, n.appendChild(s);
807
- }
808
- }, kt = _t ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
809
- let e = "";
810
- for (const s of t.cssRules) e += s.cssText;
811
- return Pe(e);
812
- })(n) : n;
813
- /**
814
- * @license
815
- * Copyright 2017 Google LLC
816
- * SPDX-License-Identifier: BSD-3-Clause
817
- */
818
- const { is: Ie, defineProperty: Ue, getOwnPropertyDescriptor: Te, getOwnPropertyNames: ke, getOwnPropertySymbols: Me, getPrototypeOf: He } = Object, z = globalThis, Mt = z.trustedTypes, Oe = Mt ? Mt.emptyScript : "", Ht = z.reactiveElementPolyfillSupport, W = (n, t) => n, ot = { toAttribute(n, t) {
819
- switch (t) {
820
- case Boolean:
821
- n = n ? Oe : null;
822
- break;
823
- case Object:
824
- case Array:
825
- n = n == null ? n : JSON.stringify(n);
826
- }
827
- return n;
828
- }, fromAttribute(n, t) {
829
- let e = n;
830
- switch (t) {
831
- case Boolean:
832
- e = n !== null;
833
- break;
834
- case Number:
835
- e = n === null ? null : Number(n);
836
- break;
837
- case Object:
838
- case Array:
839
- try {
840
- e = JSON.parse(n);
841
- } catch {
842
- e = null;
843
- }
844
- }
845
- return e;
846
- } }, gt = (n, t) => !Ie(n, t), Ot = { attribute: !0, type: String, converter: ot, reflect: !1, hasChanged: gt };
847
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), z.litPropertyMetadata ?? (z.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
848
- class B extends HTMLElement {
849
- static addInitializer(t) {
850
- this._$Ei(), (this.l ?? (this.l = [])).push(t);
851
- }
852
- static get observedAttributes() {
853
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
854
- }
855
- static createProperty(t, e = Ot) {
856
- if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
857
- const s = Symbol(), o = this.getPropertyDescriptor(t, s, e);
858
- o !== void 0 && Ue(this.prototype, t, o);
859
- }
860
- }
861
- static getPropertyDescriptor(t, e, s) {
862
- const { get: o, set: i } = Te(this.prototype, t) ?? { get() {
863
- return this[e];
864
- }, set(r) {
865
- this[e] = r;
866
- } };
867
- return { get() {
868
- return o == null ? void 0 : o.call(this);
869
- }, set(r) {
870
- const l = o == null ? void 0 : o.call(this);
871
- i.call(this, r), this.requestUpdate(t, l, s);
872
- }, configurable: !0, enumerable: !0 };
873
- }
874
- static getPropertyOptions(t) {
875
- return this.elementProperties.get(t) ?? Ot;
876
- }
877
- static _$Ei() {
878
- if (this.hasOwnProperty(W("elementProperties"))) return;
879
- const t = He(this);
880
- t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
881
- }
882
- static finalize() {
883
- if (this.hasOwnProperty(W("finalized"))) return;
884
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(W("properties"))) {
885
- const e = this.properties, s = [...ke(e), ...Me(e)];
886
- for (const o of s) this.createProperty(o, e[o]);
887
- }
888
- const t = this[Symbol.metadata];
889
- if (t !== null) {
890
- const e = litPropertyMetadata.get(t);
891
- if (e !== void 0) for (const [s, o] of e) this.elementProperties.set(s, o);
892
- }
893
- this._$Eh = /* @__PURE__ */ new Map();
894
- for (const [e, s] of this.elementProperties) {
895
- const o = this._$Eu(e, s);
896
- o !== void 0 && this._$Eh.set(o, e);
897
- }
898
- this.elementStyles = this.finalizeStyles(this.styles);
899
- }
900
- static finalizeStyles(t) {
901
- const e = [];
902
- if (Array.isArray(t)) {
903
- const s = new Set(t.flat(1 / 0).reverse());
904
- for (const o of s) e.unshift(kt(o));
905
- } else t !== void 0 && e.push(kt(t));
906
- return e;
907
- }
908
- static _$Eu(t, e) {
909
- const s = e.attribute;
910
- return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
911
- }
773
+ let Ot = 0;
774
+ var f;
775
+ const d = (f = class extends ht {
776
+ // allows use of elementInternals' API
912
777
  constructor() {
913
- super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
914
- }
915
- _$Ev() {
916
- var t;
917
- this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
918
- }
919
- addController(t) {
920
- var e;
921
- (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
778
+ super(), this.id = "", this.name = "", this._type = "text", this.label = "", this.description = "", this.placeholder = "", this.value = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.optional = !1, this.form = "", this.pattern = "", this.maxlength = null, this.width = "full", this.step = null, this.min = null, this.max = null, this.showError = !1, this.errorMessage = "", this.showPassword = !1, this._originalErrorMessage = "", this._hasUserInteracted = !1, this._internals = this.attachInternals();
922
779
  }
923
- removeController(t) {
924
- var e;
925
- (e = this._$EO) == null || e.delete(t);
780
+ get type() {
781
+ return this._type;
926
782
  }
927
- _$E_() {
928
- const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
929
- for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
930
- t.size > 0 && (this._$Ep = t);
783
+ set type(t) {
784
+ this._type = f.VALID_TYPES.includes(
785
+ t
786
+ ) ? t : "text";
931
787
  }
932
- createRenderRoot() {
933
- const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
934
- return Ce(t, this.constructor.elementStyles), t;
788
+ // Ensure the "width" property is valid after updates
789
+ async updated(t) {
790
+ t.has("width") && (await Promise.resolve(), this.width = f.VALID_WIDTHS.includes(this.width) ? this.width : "full"), t.has("disabled") && (this._validateButtonSlot("startButton"), this._validateButtonSlot("endButton"));
935
791
  }
792
+ // Generate a unique ID if one is not provided
936
793
  connectedCallback() {
937
- var t;
938
- this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
939
- var s;
940
- return (s = e.hostConnected) == null ? void 0 : s.call(e);
941
- });
942
- }
943
- enableUpdating(t) {
794
+ super.connectedCallback(), this.id || (this.id = `nys-textinput-${Date.now()}-${Ot++}`), this._originalErrorMessage = this.errorMessage ?? "", this.addEventListener("invalid", this._handleInvalid);
944
795
  }
945
796
  disconnectedCallback() {
946
- var t;
947
- (t = this._$EO) == null || t.forEach((e) => {
948
- var s;
949
- return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
950
- });
797
+ super.disconnectedCallback(), this.removeEventListener("invalid", this._handleInvalid);
951
798
  }
952
- attributeChangedCallback(t, e, s) {
953
- this._$AK(t, s);
799
+ firstUpdated() {
800
+ this._setValue();
954
801
  }
955
- _$EC(t, e) {
956
- var s;
957
- const o = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, o);
958
- if (i !== void 0 && o.reflect === !0) {
959
- const r = (((s = o.converter) == null ? void 0 : s.toAttribute) !== void 0 ? o.converter : ot).toAttribute(e, o.type);
960
- this._$Em = t, r == null ? this.removeAttribute(i) : this.setAttribute(i, r), this._$Em = null;
961
- }
802
+ // This callback is automatically called when the parent form is reset.
803
+ formResetCallback() {
804
+ this.value = "";
962
805
  }
963
- _$AK(t, e) {
964
- var s;
965
- const o = this.constructor, i = o._$Eh.get(t);
966
- if (i !== void 0 && this._$Em !== i) {
967
- const r = o.getPropertyOptions(i), l = typeof r.converter == "function" ? { fromAttribute: r.converter } : ((s = r.converter) == null ? void 0 : s.fromAttribute) !== void 0 ? r.converter : ot;
968
- this._$Em = i, this[i] = l.fromAttribute(e, r.type), this._$Em = null;
969
- }
806
+ /********************** Form Integration **********************/
807
+ _setValue() {
808
+ this._internals.setFormValue(this.value), this._manageRequire();
970
809
  }
971
- requestUpdate(t, e, s) {
972
- if (t !== void 0) {
973
- if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? gt)(this[t], e)) return;
974
- this.P(t, e, s);
975
- }
976
- this.isUpdatePending === !1 && (this._$ES = this._$ET());
810
+ _manageRequire() {
811
+ var i, r;
812
+ const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector("input");
813
+ if (!t) return;
814
+ const e = this.errorMessage || "This field is required";
815
+ this.required && (!this.value || ((r = this.value) == null ? void 0 : r.trim()) === "") ? (this._internals.ariaRequired = "true", this._internals.setValidity({ valueMissing: !0 }, e, t)) : (this._internals.ariaRequired = "false", this._internals.setValidity({}), this._hasUserInteracted = !1);
977
816
  }
978
- P(t, e, s) {
979
- this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
817
+ _setValidityMessage(t = "") {
818
+ var i, r;
819
+ const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector("input");
820
+ if (!e) return;
821
+ this.showError = !!t, (r = this._originalErrorMessage) != null && r.trim() && t !== "" ? this.errorMessage = this._originalErrorMessage : this.errorMessage = t;
822
+ const s = t ? { customError: !0 } : {};
823
+ this._internals.setValidity(s, this.errorMessage, e);
980
824
  }
981
- async _$ET() {
982
- this.isUpdatePending = !0;
983
- try {
984
- await this._$ES;
985
- } catch (e) {
986
- Promise.reject(e);
987
- }
988
- const t = this.scheduleUpdate();
989
- return t != null && await t, !this.isUpdatePending;
825
+ _validate() {
826
+ var i;
827
+ const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector("input");
828
+ if (!t) return;
829
+ const e = t.validity;
830
+ let s = "";
831
+ e.valueMissing ? s = "This field is required" : e.typeMismatch ? s = "Invalid format for this type" : e.patternMismatch ? s = "Invalid format" : e.tooShort ? s = `Value is too short. Minimum length is ${t.minLength}` : e.tooLong ? s = `Value is too long. Maximum length is ${t.maxLength}` : e.rangeUnderflow ? s = `Value must be at least ${t.min}` : e.rangeOverflow ? s = `Value must be at most ${t.max}` : e.stepMismatch ? s = "Invalid step value" : s = t.validationMessage, this._setValidityMessage(s);
990
832
  }
991
- scheduleUpdate() {
992
- return this.performUpdate();
833
+ /********************** Functions **********************/
834
+ // This helper function is called to perform the element's native validation.
835
+ checkValidity() {
836
+ var e;
837
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("input");
838
+ return t ? t.checkValidity() : !0;
993
839
  }
994
- performUpdate() {
995
- var t;
996
- if (!this.isUpdatePending) return;
997
- if (!this.hasUpdated) {
998
- if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
999
- for (const [i, r] of this._$Ep) this[i] = r;
1000
- this._$Ep = void 0;
1001
- }
1002
- const o = this.constructor.elementProperties;
1003
- if (o.size > 0) for (const [i, r] of o) r.wrapped !== !0 || this._$AL.has(i) || this[i] === void 0 || this.P(i, this[i], r);
1004
- }
1005
- let e = !1;
1006
- const s = this._$AL;
1007
- try {
1008
- e = this.shouldUpdate(s), e ? (this.willUpdate(s), (t = this._$EO) == null || t.forEach((o) => {
1009
- var i;
1010
- return (i = o.hostUpdate) == null ? void 0 : i.call(o);
1011
- }), this.update(s)) : this._$EU();
1012
- } catch (o) {
1013
- throw e = !1, this._$EU(), o;
840
+ _handleInvalid(t) {
841
+ var s;
842
+ t.preventDefault(), this._hasUserInteracted = !0, this._validate();
843
+ const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector("input");
844
+ if (e) {
845
+ const i = this._internals.form;
846
+ i ? Array.from(i.elements).find(
847
+ (l) => typeof l.checkValidity == "function" && !l.checkValidity()
848
+ ) === this && e.focus() : e.focus();
1014
849
  }
1015
- e && this._$AE(s);
1016
850
  }
1017
- willUpdate(t) {
1018
- }
1019
- _$AE(t) {
1020
- var e;
1021
- (e = this._$EO) == null || e.forEach((s) => {
1022
- var o;
1023
- return (o = s.hostUpdated) == null ? void 0 : o.call(s);
1024
- }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
851
+ _togglePasswordVisibility() {
852
+ this.showPassword = !this.showPassword;
1025
853
  }
1026
- _$EU() {
1027
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
854
+ /******************** Event Handlers ********************/
855
+ // Handle input event to check pattern validity
856
+ _handleInput(t) {
857
+ const e = t.target;
858
+ this.value = e.value, this._internals.setFormValue(this.value), this._hasUserInteracted && this._validate(), this.dispatchEvent(
859
+ new CustomEvent("nys-input", {
860
+ detail: { value: this.value },
861
+ bubbles: !0,
862
+ composed: !0
863
+ })
864
+ );
1028
865
  }
1029
- get updateComplete() {
1030
- return this.getUpdateComplete();
866
+ // Handle focus event
867
+ _handleFocus() {
868
+ this.dispatchEvent(new Event("nys-focus"));
1031
869
  }
1032
- getUpdateComplete() {
1033
- return this._$ES;
1034
- }
1035
- shouldUpdate(t) {
1036
- return !0;
1037
- }
1038
- update(t) {
1039
- this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU();
1040
- }
1041
- updated(t) {
1042
- }
1043
- firstUpdated(t) {
1044
- }
1045
- }
1046
- B.elementStyles = [], B.shadowRootOptions = { mode: "open" }, B[W("elementProperties")] = /* @__PURE__ */ new Map(), B[W("finalized")] = /* @__PURE__ */ new Map(), Ht == null || Ht({ ReactiveElement: B }), (z.reactiveElementVersions ?? (z.reactiveElementVersions = [])).push("2.0.4");
1047
- /**
1048
- * @license
1049
- * Copyright 2017 Google LLC
1050
- * SPDX-License-Identifier: BSD-3-Clause
1051
- */
1052
- const Ne = { attribute: !0, type: String, converter: ot, reflect: !1, hasChanged: gt }, Re = (n = Ne, t, e) => {
1053
- const { kind: s, metadata: o } = e;
1054
- let i = globalThis.litPropertyMetadata.get(o);
1055
- if (i === void 0 && globalThis.litPropertyMetadata.set(o, i = /* @__PURE__ */ new Map()), i.set(e.name, n), s === "accessor") {
1056
- const { name: r } = e;
1057
- return { set(l) {
1058
- const a = t.get.call(this);
1059
- t.set.call(this, l), this.requestUpdate(r, a, n);
1060
- }, init(l) {
1061
- return l !== void 0 && this.P(r, void 0, n), l;
1062
- } };
1063
- }
1064
- if (s === "setter") {
1065
- const { name: r } = e;
1066
- return function(l) {
1067
- const a = this[r];
1068
- t.call(this, l), this.requestUpdate(r, a, n);
1069
- };
1070
- }
1071
- throw Error("Unsupported decorator location: " + s);
1072
- };
1073
- function g(n) {
1074
- return (t, e) => typeof e == "object" ? Re(n, t, e) : ((s, o, i) => {
1075
- const r = o.hasOwnProperty(i);
1076
- return o.constructor.createProperty(i, r ? { ...s, wrapped: !0 } : s), r ? Object.getOwnPropertyDescriptor(o, i) : void 0;
1077
- })(n, t, e);
1078
- }
1079
- const ze = qt`
1080
- :host {
1081
- /* Anything that can be overridden should be defined here */
1082
-
1083
- /* Global Button Styles */
1084
- --_nys-button-width: fit-content;
1085
- --_nys-button-height: var(--nys-size-600, 48px);
1086
- --_nys-button-radius-left: var(--nys-radius-xl, 12px);
1087
- --_nys-button-radius-right: var(--nys-radius-xl, 12px);
1088
- --_nys-button-padding-y: var(--nys-space-150, 12px);
1089
- --_nys-button-padding-x: var(--nys-space-250, 20px);
1090
- --_nys-button-gap: var(--nys-space-100, 8px);
1091
- --_nys-button-width-border: var(--nys-border-width-md, 2px);
1092
- --_nys-button-width-focus: var(--nys-border-width-md, 2px);
1093
- --_nys-button-offset-focus: var(--nys-space-2px, 2px);
1094
- --_nys-button-color-focus: var(--nys-color-focus, #004dd1);
1095
-
1096
- /* Global Button Colors */
1097
- --_nys-button-color-bg: var(--nys-color-theme, #154973);
1098
- --_nys-button-color-text: var(--nys-color-text-reverse, #ffffff);
1099
- --_nys-button-color-border: var(--nys-color-theme, #154973);
1100
-
1101
- --_nys-button-color-bg-hover: var(--nys-color-theme-strong, #0e324f);
1102
- --_nys-button-color-text-hover: var(--nys-color-text-reverse, #ffffff);
1103
- --_nys-button-color-border-hover: var(--nys-color-theme-strong, #0e324f);
1104
-
1105
- --_nys-button-color-bg-active: var(--nys-color-theme-stronger, #081b2b);
1106
- --_nys-button-color-text-active: var(--nys-color-text-reverse, #ffffff);
1107
- --_nys-button-color-border-active: var(--nys-color-theme-stronger, #081b2b);
1108
-
1109
- --_nys-button-color-bg-disabled: var(--nys-color-neutral-10, #f6f6f6);
1110
- --_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
1111
- --_nys-button-color-border-disabled: var(--nys-color-neutral-10, #f6f6f6);
1112
-
1113
- /* Typography */
1114
- --_nys-button-font-size: var(--nys-font-size-ui-md, 16px);
1115
- --_nys-button-font-weight: var(--nys-font-weight-semibold, 600);
1116
- --_nys-button-line-height: var(--nys-font-lineheight-ui-md, 24px);
1117
- --_nys-button-font-family: var(
1118
- --nys-font-family-ui,
1119
- var(
1120
- --nys-font-family-sans,
1121
- "Proxima Nova",
1122
- "Helvetica Neue",
1123
- "Helvetica",
1124
- "Arial",
1125
- sans-serif
1126
- )
1127
- );
1128
- }
1129
-
1130
- /* Sizes */
1131
- :host([size="sm"]) {
1132
- --_nys-button-height: var(--nys-size-500, 40px);
1133
- --_nys-button-padding-y: var(--nys-space-100, 8px);
1134
- --_nys-button-padding-x: var(--nys-space-200, 16px);
1135
- }
1136
- :host([size="md"]) {
1137
- --_nys-button-height: var(--nys-size-600, 48px);
1138
- --_nys-button-padding-y: var(--nys-space-150, 12px);
1139
- --_nys-button-padding-x: var(--nys-space-250, 20px);
1140
- }
1141
- :host([size="lg"]) {
1142
- --_nys-button-height: var(--nys-size-700, 56px);
1143
- --_nys-button-padding-y: var(--nys-space-200, 16px);
1144
- --_nys-button-padding-x: var(--nys-space-300, 24px);
1145
- }
1146
- :host([fullWidth]) {
1147
- --_nys-button-width: 100%;
1148
- }
1149
-
1150
- /* VARIANTS */
1151
-
1152
- /* Filled */
1153
- :host([variant="filled"]) {
1154
- /* Filled - Default */
1155
- --_nys-button-color-bg: var(--nys-color-theme, #154973);
1156
- --_nys-button-color-text: var(--nys-color-text-reverse, #ffffff);
1157
- --_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
1158
-
1159
- /* Filled - Hover */
1160
- --_nys-button-color-bg-hover: var(--nys-color-theme-strong, #0e324f);
1161
- --_nys-button-color-text-hover: var(--nys-color-text-reverse, #ffffff);
1162
- --_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
1163
-
1164
- /* Filled - Pressed/Active */
1165
- --_nys-button-color-bg-active: var(--nys-color-theme-stronger, #081b2b);
1166
- --_nys-button-color-text-active: var(--nys-color-text-reverse, #ffffff);
1167
- --_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
1168
-
1169
- /* Filled - Disabled */
1170
- --_nys-button-color-bg-disabled: var(--nys-color-neutral-10, #f6f6f6);
1171
- --_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
1172
- --_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
1173
- }
1174
-
1175
- /* Outline */
1176
- :host([variant="outline"]) {
1177
- /* Outline - Default */
1178
- --_nys-button-color-bg: var(--nys-color-surface, #ffffff);
1179
- --_nys-button-color-text: var(--nys-color-theme, #154973);
1180
- --_nys-button-color-border: var(--nys-color-theme, #154973);
1181
-
1182
- /* Outline - Hover */
1183
- --_nys-button-color-bg-hover: var(--nys-color-theme-weaker, #eff6fb);
1184
- --_nys-button-color-text-hover: var(--nys-color-theme, #154973);
1185
- --_nys-button-color-border-hover: var(--nys-color-theme, #154973);
1186
-
1187
- /* Outline - Pressed/Active */
1188
- --_nys-button-color-bg-active: var(--nys-color-theme-weak, #cddde9);
1189
- --_nys-button-color-text-active: var(--nys-color-theme, #154973);
1190
- --_nys-button-color-border-active: var(--nys-color-theme, #154973);
1191
-
1192
- /* Outline - Disabled */
1193
- --_nys-button-color-bg-disabled: var(--nys-color-surface, #ffffff);
1194
- --_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
1195
- --_nys-button-color-border-disabled: var(--nys-color-neutral-100, #d0d0ce);
1196
- }
1197
-
1198
- /* Text */
1199
- :host([variant="text"]) {
1200
- --_nys-button-height: fit-content;
1201
- --_nys-button-radius-left: var(--nys-radius-md, 4px);
1202
- --_nys-button-radius-right: var(--nys-radius-md, 4px);
1203
- --_nys-button-padding-y: var(--nys-space-2px, 2px);
1204
- --_nys-button-padding-x: var(--nys-space-50, 4px);
1205
- --_nys-button-width-border: 0px;
1206
- --_nys-button-text-decoration: underline;
1207
-
1208
- /* Text - Default */
1209
- --_nys-button-color-bg: var(--nys-color-transparent, #ffffff00);
1210
- --_nys-button-color-text: var(--nys-color-link, #004dd1);
1211
- --_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
1212
-
1213
- /* Text - Hover */
1214
- --_nys-button-color-bg-hover: var(--nys-color-transparent, #ffffff00);
1215
- --_nys-button-color-text-hover: var(--nys-color-link-strong, #003ba1);
1216
- --_nys-button-color-border-hover: var(--nys-color-transparent, #ffffff00);
1217
-
1218
- /* Text - Pressed/Active */
1219
- --_nys-button-color-bg-active: var(--nys-color-transparent, #ffffff00);
1220
- --_nys-button-color-text-active: var(--nys-color-link-strongest, #002971);
1221
- --_nys-button-color-border-active: var(--nys-color-transparent, #ffffff00);
1222
-
1223
- /* Text - Disabled */
1224
- --_nys-button-color-bg-disabled: var(--nys-color-transparent, #ffffff00);
1225
- --_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
1226
- --_nys-button-color-border-disabled: var(
1227
- --nys-color-transparent,
1228
- #ffffff00
1229
- );
1230
- }
1231
-
1232
- /* Ghost */
1233
- :host([variant="ghost"]) {
1234
- /* Ghost - Default */
1235
- --_nys-button-color-bg: var(--nys-color-transparent, #ffffff00);
1236
- --_nys-button-color-text: var(--nys-color-text, #1b1b1b);
1237
- --_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
1238
-
1239
- /* Ghost - Hover */
1240
- --_nys-button-color-bg-hover: var(
1241
- --nys-color-black-transparent-100,
1242
- #0000001a
1243
- );
1244
- --_nys-button-color-text-hover: var(--nys-color-text, #1b1b1b);
1245
- --_nys-button-color-border-hover: var(--nys-color-transparent, #ffffff00);
1246
-
1247
- /* Ghost - Active */
1248
- --_nys-button-color-bg-active: var(
1249
- --nys-color-black-transparent-200,
1250
- #00000033
1251
- );
1252
- --_nys-button-color-text-active: var(--nys-color-text, #1b1b1b);
1253
- --_nys-button-color-border-active: var(--nys-color-transparent, #ffffff00);
1254
-
1255
- /* Ghost - Disabled */
1256
- --_nys-button-color-bg-disabled: var(--nys-color-transparent, #ffffff00);
1257
- --_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
1258
- --_nys-button-color-border-disabled: var(
1259
- --nys-color-transparent,
1260
- #ffffff00
1261
- );
1262
- }
1263
-
1264
- /* INVERTED VARIANTS */
1265
-
1266
- /* Filled Inverted */
1267
- :host([variant="filled"][inverted]) {
1268
- /* Filled Inverted - Default */
1269
- --_nys-button-color-bg: var(--nys-color-surface, #ffffff);
1270
- --_nys-button-color-text: var(--nys-color-text, #1b1b1b);
1271
- --_nys-button-color-border-disabled: var(
1272
- --nys-color-transparent,
1273
- #ffffff00
1274
- );
1275
-
1276
- /* Filled Inverted - Hover */
1277
- --_nys-button-color-bg-hover: var(--nys-color-neutral-100, #d0d0ce);
1278
- --_nys-button-color-text-hover: var(--nys-color-text, #1b1b1b);
1279
- --_nys-button-color-border-disabled: var(
1280
- --nys-color-transparent,
1281
- #ffffff00
1282
- );
1283
-
1284
- /* Filled Inverted - Pressed/Active */
1285
- --_nys-button-color-bg-active: var(--nys-color-neutral-300, #a7a9ab);
1286
- --_nys-button-color-text-active: var(--nys-color-text, #1b1b1b);
1287
- --_nys-button-color-border-disabled: var(
1288
- --nys-color-transparent,
1289
- #ffffff00
1290
- );
1291
-
1292
- /* Filled Inverted - Disabled */
1293
- --_nys-button-color-bg-disabled: var(--nys-color-text, #1b1b1b);
1294
- --_nys-button-color-text-disabled: var(--nys-color-text-disabled, #62666a);
1295
- --_nys-button-color-border-disabled: var(
1296
- --nys-color-transparent,
1297
- #ffffff00
1298
- );
1299
- }
1300
-
1301
- /* Outline Inverted */
1302
- :host([variant="outline"][inverted]) {
1303
- /* Outline Inverted - Default */
1304
- --_nys-button-color-bg: var(--nys-color-surface-reverse, #1b1b1b);
1305
- --_nys-button-color-text: var(--nys-color-text-reverse, #ffffff);
1306
- --_nys-button-color-border: var(--nys-color-ink-reverse, #ffffff);
1307
-
1308
- /* Outline Inverted - Hover */
1309
- --_nys-button-color-bg-hover: var(--nys-color-surface-reverse, #1b1b1b);
1310
- --_nys-button-color-text-hover: var(--nys-color-text-reverse-weak, #d0d0ce);
1311
- --_nys-button-color-border-hover: var(--nys-color-neutral-100, #d0d0ce);
1312
-
1313
- /* Outline Inverted - Pressed/Active */
1314
- --_nys-button-color-bg-active: var(--nys-color-surface-reverse, #1b1b1b);
1315
- --_nys-button-color-text-active: var(
1316
- --nys-color-text-reverse-weaker,
1317
- #bec0c1
1318
- );
1319
- --_nys-button-color-border-active: var(--nys-color-neutral-300, #a7a9ab);
1320
-
1321
- /* Outline Inverted - Disabled */
1322
- --_nys-button-color-bg-disabled: var(--nys-color-surface-reverse, #1b1b1b);
1323
- --_nys-button-color-text-disabled: var(
1324
- --nys-color-text-reverse-disabled,
1325
- #62666a
1326
- );
1327
- --_nys-button-color-border-disabled: var(--nys-color-neutral-600, #62666a);
1328
- }
1329
-
1330
- /* Text Inverted */
1331
- :host([variant="text"][inverted]) {
1332
- --_nys-button-height: fit-content;
1333
- --_nys-button-radius-left: var(--nys-radius-md, 4px);
1334
- --_nys-button-radius-right: var(--nys-radius-md, 4px);
1335
- --_nys-button-padding-y: var(--nys-space-2px, 2px);
1336
- --_nys-button-padding-x: var(--nys-space-50, 4px);
1337
- --_nys-button-width-border: 0px;
1338
- --_nys-button-text-decoration: underline;
1339
-
1340
- /* Text Inverted - Default */
1341
- --_nys-button-color-bg: var(--nys-color-transparent, #ffffff00);
1342
- --_nys-button-color-text: var(--nys-color-link-reverse, #a7a9ab);
1343
- --_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
1344
-
1345
- /* Text Inverted - Hover */
1346
- --_nys-button-color-bg-hover: var(--nys-color-transparent, #ffffff00);
1347
- --_nys-button-color-text-hover: var(
1348
- --nys-color-link-reverse-strong,
1349
- #ededed
1350
- );
1351
- --_nys-button-color-border-hover: var(--nys-color-transparent, #ffffff00);
1352
-
1353
- /* Text Inverted - Pressed/Active */
1354
- --_nys-button-color-bg-active: var(--nys-color-transparent, #ffffff00);
1355
- --_nys-button-color-text-active: var(
1356
- --nys-color-reverse-strongest,
1357
- #ffffff
1358
- );
1359
- --_nys-button-color-border-active: var(--nys-color-transparent, #ffffff00);
1360
-
1361
- /* Text Inverted - Disabled */
1362
- --_nys-button-color-bg-disabled: var(--nys-color-transparent, #ffffff00);
1363
- --_nys-button-color-text-disabled: var(
1364
- --nys-color-text-reverse-disabled,
1365
- #62666a
1366
- );
1367
- --_nys-button-color-border-disabled: var(
1368
- --nys-color-transparent,
1369
- #ffffff00
1370
- );
1371
- }
1372
-
1373
- /* Ghost Inverted */
1374
- :host([variant="ghost"][inverted]) {
1375
- /* Ghost Inverted - Default */
1376
- --_nys-button-color-bg: var(--nys-color-transparent, #ffffff00);
1377
- --_nys-button-color-text: var(--nys-color-text-reverse, #ffffff);
1378
- --_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
1379
-
1380
- /* Ghost Inverted - Hover */
1381
- --_nys-button-color-bg-hover: var(
1382
- --nys-color-white-transparent-100,
1383
- #ffffff1a
1384
- );
1385
- --_nys-button-color-text-hover: var(--nys-color-text-reverse, #ffffff);
1386
- --_nys-button-color-border-hover: var(--nys-color-transparent, #ffffff00);
1387
-
1388
- /* Ghost Inverted - Pressed/Active */
1389
- --_nys-button-color-bg-active: var(
1390
- --nys-color-white-transparent-200,
1391
- #ffffff33
1392
- );
1393
- --_nys-button-color-text-active: var(--nys-color-text-reverse, #ffffff);
1394
- --_nys-button-color-border-active: var(--nys-color-transparent, #ffffff00);
1395
-
1396
- /* Ghost Inverted - Disabled */
1397
- --_nys-button-color-bg-disabled: var(--nys-color-transparent, #ffffff00);
1398
- --_nys-button-color-text-disabled: var(--nys-color-text-disabled, #62666a);
1399
- --_nys-button-color-border-disabled: var(
1400
- --nys-color-transparent,
1401
- #ffffff00
1402
- );
1403
- }
1404
-
1405
- /* Circle */
1406
- :host([circle]) {
1407
- --_nys-button-width: var(--_nys-button-height);
1408
- --_nys-button-radius-left: var(--nys-radius-round, 1776px);
1409
- --_nys-button-radius-right: var(--nys-radius-round, 1776px);
1410
- --_nys-button-padding-y: 0;
1411
- --_nys-button-padding-x: 0;
1412
- }
1413
-
1414
- .nys-button {
1415
- width: var(--_nys-button-width);
1416
- min-height: var(--_nys-button-height);
1417
- /* set every corner individually */
1418
- border-top-left-radius: var(--_nys-button-radius-left);
1419
- border-bottom-left-radius: var(--_nys-button-radius-left);
1420
- border-top-right-radius: var(--_nys-button-radius-right);
1421
- border-bottom-right-radius: var(--_nys-button-radius-right);
1422
- padding: var(--_nys-button-padding-y) var(--_nys-button-padding-x);
1423
- display: flex;
1424
- align-items: center;
1425
- justify-content: center;
1426
- gap: var(--_nys-button-gap);
1427
- font-family: var(--_nys-button-font-family);
1428
- font-size: var(--_nys-button-font-size);
1429
- font-weight: var(--_nys-button-font-weight);
1430
- line-height: var(--_nys-button-line-height);
1431
- text-decoration: var(--_nys-button-text-decoration);
1432
- box-sizing: border-box;
1433
- background-color: var(--_nys-button-color-bg);
1434
- color: var(--_nys-button-color-text);
1435
- border: solid var(--_nys-button-width-border)
1436
- var(--_nys-button-color-border);
1437
- cursor: pointer;
1438
- }
1439
-
1440
- :host([circle]) .nys-button {
1441
- max-width: var(--_nys-button-height);
1442
- max-height: var(--_nys-button-height);
1443
- }
1444
-
1445
- .nys-button:hover {
1446
- background-color: var(--_nys-button-color-bg-hover);
1447
- color: var(--_nys-button-color-text-hover);
1448
- border-color: var(--_nys-button-color-border-hover);
1449
- }
1450
-
1451
- .nys-button:active {
1452
- background-color: var(--_nys-button-color-bg-active);
1453
- color: var(--_nys-button-color-text-active);
1454
- border-color: var(--_nys-button-color-border-active);
1455
- }
1456
-
1457
- .nys-button:disabled,
1458
- a[disabled] {
1459
- background-color: var(--_nys-button-color-bg-disabled);
1460
- color: var(--_nys-button-color-text-disabled);
1461
- border-color: var(--_nys-button-color-border-disabled);
1462
- cursor: not-allowed;
1463
- }
1464
-
1465
- .nys-button__linkwrapper:has([disabled]) {
1466
- cursor: not-allowed;
1467
- width: fit-content;
1468
- }
1469
-
1470
- /* Remove click functionality from disabled link button */
1471
- a[disabled] {
1472
- pointer-events: none;
1473
- }
1474
-
1475
- a[disabled]:hover {
1476
- background-color: var(--_nys-button-color-bg-disabled);
1477
- color: var(--_nys-button-color-text-disabled);
1478
- border-color: var(--_nys-button-color-border-disabled);
1479
- }
1480
-
1481
- .nys-button * {
1482
- cursor: pointer;
1483
- }
1484
-
1485
- .nys-button:disabled * {
1486
- cursor: not-allowed;
1487
- }
1488
-
1489
- .nys-button:focus-visible {
1490
- outline-offset: var(--_nys-button-offset-focus);
1491
- outline: solid var(--_nys-button-width-focus) var(--_nys-button-color-focus);
1492
- }
1493
-
1494
- .nys-button__text {
1495
- display: flex;
1496
- align-items: center;
1497
- user-select: none;
1498
- }
1499
- `;
1500
- /**
1501
- * @license
1502
- * Copyright 2017 Google LLC
1503
- * SPDX-License-Identifier: BSD-3-Clause
1504
- */
1505
- const nt = globalThis, rt = nt.trustedTypes, Nt = rt ? rt.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, te = "$lit$", C = `lit$${Math.random().toFixed(9).slice(2)}$`, ee = "?" + C, De = `<${ee}>`, N = document, it = () => N.createComment(""), Z = (n) => n === null || typeof n != "object" && typeof n != "function", $t = Array.isArray, Le = (n) => $t(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", pt = `[
1506
- \f\r]`, q = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Rt = /-->/g, zt = />/g, k = RegExp(`>|${pt}(?:([^\\s"'>=/]+)(${pt}*=${pt}*(?:[^
1507
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Dt = /'/g, Lt = /"/g, se = /^(?:script|style|textarea|title)$/i, Y = Symbol.for("lit-noChange"), _ = Symbol.for("lit-nothing"), Vt = /* @__PURE__ */ new WeakMap(), H = N.createTreeWalker(N, 129);
1508
- function oe(n, t) {
1509
- if (!$t(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
1510
- return Nt !== void 0 ? Nt.createHTML(t) : t;
1511
- }
1512
- const Ve = (n, t) => {
1513
- const e = n.length - 1, s = [];
1514
- let o, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", r = q;
1515
- for (let l = 0; l < e; l++) {
1516
- const a = n[l];
1517
- let c, d, h = -1, b = 0;
1518
- for (; b < a.length && (r.lastIndex = b, d = r.exec(a), d !== null); ) b = r.lastIndex, r === q ? d[1] === "!--" ? r = Rt : d[1] !== void 0 ? r = zt : d[2] !== void 0 ? (se.test(d[2]) && (o = RegExp("</" + d[2], "g")), r = k) : d[3] !== void 0 && (r = k) : r === k ? d[0] === ">" ? (r = o ?? q, h = -1) : d[1] === void 0 ? h = -2 : (h = r.lastIndex - d[2].length, c = d[1], r = d[3] === void 0 ? k : d[3] === '"' ? Lt : Dt) : r === Lt || r === Dt ? r = k : r === Rt || r === zt ? r = q : (r = k, o = void 0);
1519
- const m = r === k && n[l + 1].startsWith("/>") ? " " : "";
1520
- i += r === q ? a + De : h >= 0 ? (s.push(c), a.slice(0, h) + te + a.slice(h) + C + m) : a + C + (h === -2 ? l : m);
1521
- }
1522
- return [oe(n, i + (n[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
1523
- };
1524
- class J {
1525
- constructor({ strings: t, _$litType$: e }, s) {
1526
- let o;
1527
- this.parts = [];
1528
- let i = 0, r = 0;
1529
- const l = t.length - 1, a = this.parts, [c, d] = Ve(t, e);
1530
- if (this.el = J.createElement(c, s), H.currentNode = this.el.content, e === 2 || e === 3) {
1531
- const h = this.el.content.firstChild;
1532
- h.replaceWith(...h.childNodes);
1533
- }
1534
- for (; (o = H.nextNode()) !== null && a.length < l; ) {
1535
- if (o.nodeType === 1) {
1536
- if (o.hasAttributes()) for (const h of o.getAttributeNames()) if (h.endsWith(te)) {
1537
- const b = d[r++], m = o.getAttribute(h).split(C), S = /([.?@])?(.*)/.exec(b);
1538
- a.push({ type: 1, index: i, name: S[2], strings: m, ctor: S[1] === "." ? qe : S[1] === "?" ? je : S[1] === "@" ? Fe : ht }), o.removeAttribute(h);
1539
- } else h.startsWith(C) && (a.push({ type: 6, index: i }), o.removeAttribute(h));
1540
- if (se.test(o.tagName)) {
1541
- const h = o.textContent.split(C), b = h.length - 1;
1542
- if (b > 0) {
1543
- o.textContent = rt ? rt.emptyScript : "";
1544
- for (let m = 0; m < b; m++) o.append(h[m], it()), H.nextNode(), a.push({ type: 2, index: ++i });
1545
- o.append(h[b], it());
1546
- }
1547
- }
1548
- } else if (o.nodeType === 8) if (o.data === ee) a.push({ type: 2, index: i });
1549
- else {
1550
- let h = -1;
1551
- for (; (h = o.data.indexOf(C, h + 1)) !== -1; ) a.push({ type: 7, index: i }), h += C.length - 1;
1552
- }
1553
- i++;
1554
- }
1555
- }
1556
- static createElement(t, e) {
1557
- const s = N.createElement("template");
1558
- return s.innerHTML = t, s;
1559
- }
1560
- }
1561
- function D(n, t, e = n, s) {
1562
- var o, i;
1563
- if (t === Y) return t;
1564
- let r = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
1565
- const l = Z(t) ? void 0 : t._$litDirective$;
1566
- return (r == null ? void 0 : r.constructor) !== l && ((i = r == null ? void 0 : r._$AO) == null || i.call(r, !1), l === void 0 ? r = void 0 : (r = new l(n), r._$AT(n, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = r : e._$Cl = r), r !== void 0 && (t = D(n, r._$AS(n, t.values), r, s)), t;
1567
- }
1568
- class Be {
1569
- constructor(t, e) {
1570
- this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
1571
- }
1572
- get parentNode() {
1573
- return this._$AM.parentNode;
1574
- }
1575
- get _$AU() {
1576
- return this._$AM._$AU;
1577
- }
1578
- u(t) {
1579
- const { el: { content: e }, parts: s } = this._$AD, o = ((t == null ? void 0 : t.creationScope) ?? N).importNode(e, !0);
1580
- H.currentNode = o;
1581
- let i = H.nextNode(), r = 0, l = 0, a = s[0];
1582
- for (; a !== void 0; ) {
1583
- if (r === a.index) {
1584
- let c;
1585
- a.type === 2 ? c = new lt(i, i.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(i, a.name, a.strings, this, t) : a.type === 6 && (c = new We(i, this, t)), this._$AV.push(c), a = s[++l];
1586
- }
1587
- r !== (a == null ? void 0 : a.index) && (i = H.nextNode(), r++);
1588
- }
1589
- return H.currentNode = N, o;
1590
- }
1591
- p(t) {
1592
- let e = 0;
1593
- for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
1594
- }
1595
- }
1596
- class lt {
1597
- get _$AU() {
1598
- var t;
1599
- return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
1600
- }
1601
- constructor(t, e, s, o) {
1602
- this.type = 2, this._$AH = _, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = o, this._$Cv = (o == null ? void 0 : o.isConnected) ?? !0;
1603
- }
1604
- get parentNode() {
1605
- let t = this._$AA.parentNode;
1606
- const e = this._$AM;
1607
- return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
1608
- }
1609
- get startNode() {
1610
- return this._$AA;
1611
- }
1612
- get endNode() {
1613
- return this._$AB;
1614
- }
1615
- _$AI(t, e = this) {
1616
- t = D(this, t, e), Z(t) ? t === _ || t == null || t === "" ? (this._$AH !== _ && this._$AR(), this._$AH = _) : t !== this._$AH && t !== Y && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Le(t) ? this.k(t) : this._(t);
1617
- }
1618
- O(t) {
1619
- return this._$AA.parentNode.insertBefore(t, this._$AB);
1620
- }
1621
- T(t) {
1622
- this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
1623
- }
1624
- _(t) {
1625
- this._$AH !== _ && Z(this._$AH) ? this._$AA.nextSibling.data = t : this.T(N.createTextNode(t)), this._$AH = t;
1626
- }
1627
- $(t) {
1628
- var e;
1629
- const { values: s, _$litType$: o } = t, i = typeof o == "number" ? this._$AC(t) : (o.el === void 0 && (o.el = J.createElement(oe(o.h, o.h[0]), this.options)), o);
1630
- if (((e = this._$AH) == null ? void 0 : e._$AD) === i) this._$AH.p(s);
1631
- else {
1632
- const r = new Be(i, this), l = r.u(this.options);
1633
- r.p(s), this.T(l), this._$AH = r;
1634
- }
1635
- }
1636
- _$AC(t) {
1637
- let e = Vt.get(t.strings);
1638
- return e === void 0 && Vt.set(t.strings, e = new J(t)), e;
1639
- }
1640
- k(t) {
1641
- $t(this._$AH) || (this._$AH = [], this._$AR());
1642
- const e = this._$AH;
1643
- let s, o = 0;
1644
- for (const i of t) o === e.length ? e.push(s = new lt(this.O(it()), this.O(it()), this, this.options)) : s = e[o], s._$AI(i), o++;
1645
- o < e.length && (this._$AR(s && s._$AB.nextSibling, o), e.length = o);
1646
- }
1647
- _$AR(t = this._$AA.nextSibling, e) {
1648
- var s;
1649
- for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
1650
- const o = t.nextSibling;
1651
- t.remove(), t = o;
1652
- }
1653
- }
1654
- setConnected(t) {
1655
- var e;
1656
- this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
1657
- }
1658
- }
1659
- class ht {
1660
- get tagName() {
1661
- return this.element.tagName;
1662
- }
1663
- get _$AU() {
1664
- return this._$AM._$AU;
1665
- }
1666
- constructor(t, e, s, o, i) {
1667
- this.type = 1, this._$AH = _, this._$AN = void 0, this.element = t, this.name = e, this._$AM = o, this.options = i, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = _;
1668
- }
1669
- _$AI(t, e = this, s, o) {
1670
- const i = this.strings;
1671
- let r = !1;
1672
- if (i === void 0) t = D(this, t, e, 0), r = !Z(t) || t !== this._$AH && t !== Y, r && (this._$AH = t);
1673
- else {
1674
- const l = t;
1675
- let a, c;
1676
- for (t = i[0], a = 0; a < i.length - 1; a++) c = D(this, l[s + a], e, a), c === Y && (c = this._$AH[a]), r || (r = !Z(c) || c !== this._$AH[a]), c === _ ? t = _ : t !== _ && (t += (c ?? "") + i[a + 1]), this._$AH[a] = c;
1677
- }
1678
- r && !o && this.j(t);
1679
- }
1680
- j(t) {
1681
- t === _ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
1682
- }
1683
- }
1684
- class qe extends ht {
1685
- constructor() {
1686
- super(...arguments), this.type = 3;
1687
- }
1688
- j(t) {
1689
- this.element[this.name] = t === _ ? void 0 : t;
1690
- }
1691
- }
1692
- class je extends ht {
1693
- constructor() {
1694
- super(...arguments), this.type = 4;
1695
- }
1696
- j(t) {
1697
- this.element.toggleAttribute(this.name, !!t && t !== _);
1698
- }
1699
- }
1700
- class Fe extends ht {
1701
- constructor(t, e, s, o, i) {
1702
- super(t, e, s, o, i), this.type = 5;
1703
- }
1704
- _$AI(t, e = this) {
1705
- if ((t = D(this, t, e, 0) ?? _) === Y) return;
1706
- const s = this._$AH, o = t === _ && s !== _ || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, i = t !== _ && (s === _ || o);
1707
- o && this.element.removeEventListener(this.name, this, s), i && this.element.addEventListener(this.name, this, t), this._$AH = t;
1708
- }
1709
- handleEvent(t) {
1710
- var e;
1711
- typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
1712
- }
1713
- }
1714
- class We {
1715
- constructor(t, e, s) {
1716
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
1717
- }
1718
- get _$AU() {
1719
- return this._$AM._$AU;
1720
- }
1721
- _$AI(t) {
1722
- D(this, t);
1723
- }
1724
- }
1725
- const Bt = nt.litHtmlPolyfillSupport;
1726
- Bt == null || Bt(J, lt), (nt.litHtmlVersions ?? (nt.litHtmlVersions = [])).push("3.2.1");
1727
- /**
1728
- * @license
1729
- * Copyright 2018 Google LLC
1730
- * SPDX-License-Identifier: BSD-3-Clause
1731
- */
1732
- const E = (n) => n ?? _;
1733
- var Ge = Object.defineProperty, Ke = Object.getOwnPropertyDescriptor, $ = (n, t, e, s) => {
1734
- for (var o = s > 1 ? void 0 : s ? Ke(t, e) : t, i = n.length - 1, r; i >= 0; i--)
1735
- (r = n[i]) && (o = (s ? r(t, e, o) : r(o)) || o);
1736
- return s && o && Ge(t, e, o), o;
1737
- };
1738
- let Ze = 0;
1739
- var A;
1740
- const f = (A = class extends jt {
1741
- // allows use of elementInternals' API
1742
- constructor() {
1743
- super(), this.id = "", this.name = "", this._size = "md", this.fullWidth = !1, this._variant = "filled", this.inverted = !1, this.label = "", this.ariaLabel = "", this.prefixIcon = "", this.suffixIcon = "", this.circle = !1, this.icon = "", this.disabled = !1, this.form = "", this.value = "", this._type = "button", this.onClick = () => {
1744
- }, this.href = "", this._target = "_self", this._internals = this.attachInternals();
1745
- }
1746
- get size() {
1747
- return this._size;
1748
- }
1749
- set size(n) {
1750
- this._size = A.VALID_SIZES.includes(
1751
- n
1752
- ) ? n : "md";
1753
- }
1754
- get variant() {
1755
- return this._variant;
1756
- }
1757
- set variant(n) {
1758
- this._variant = A.VALID_VARIANTS.includes(
1759
- n
1760
- ) ? n : "filled";
1761
- }
1762
- get type() {
1763
- return this._type;
1764
- }
1765
- set type(n) {
1766
- this._type = A.VALID_TYPES.includes(
1767
- n
1768
- ) ? n : "button";
1769
- }
1770
- get target() {
1771
- return this._target;
1772
- }
1773
- set target(n) {
1774
- this._target = A.VALID_TARGETS.includes(
1775
- n
1776
- ) ? n : "_self";
1777
- }
1778
- connectedCallback() {
1779
- super.connectedCallback(), this.id || (this.id = this._generateUniqueId());
1780
- }
1781
- /******************** Functions ********************/
1782
- _generateUniqueId() {
1783
- return `nys-button-${Date.now()}-${Ze++}`;
1784
- }
1785
- _manageFormAction(n) {
1786
- typeof this.onClick == "function" && this.onClick(n);
1787
- const t = this._internals.form;
1788
- if (t)
1789
- switch (this.type) {
1790
- case "submit":
1791
- t.requestSubmit();
1792
- break;
1793
- case "reset":
1794
- t.reset();
1795
- break;
1796
- }
1797
- }
1798
- /******************** Event Handlers ********************/
1799
- // Handle focus event
1800
- _handleFocus() {
1801
- this.dispatchEvent(new Event("nys-focus"));
1802
- }
1803
- // Handle blur event
1804
- _handleBlur() {
1805
- this.dispatchEvent(new Event("nys-blur"));
1806
- }
1807
- _handleClick(n) {
1808
- if (this.disabled) {
1809
- n.preventDefault();
1810
- return;
1811
- }
1812
- this._manageFormAction(n), this.dispatchEvent(new Event("nys-click"));
1813
- }
1814
- // Handle keydown for keyboard accessibility
1815
- _handleKeydown(n) {
1816
- (n.code === "Space" || n.code === "Enter" || n.key === " " || n.key === "Enter") && (n.preventDefault(), this.disabled || this._manageFormAction(n));
1817
- }
1818
- render() {
1819
- return x`
1820
- ${this.href ? x`
1821
- <div class="nys-button__linkwrapper">
1822
- <a
1823
- class="nys-button"
1824
- id=${E(this.id)}
1825
- name=${E(this.name ? this.name : void 0)}
1826
- ?disabled=${this.disabled}
1827
- aria-disabled="${this.disabled ? "true" : "false"}"
1828
- form=${E(this.form ? this.form : void 0)}
1829
- value=${E(this.value ? this.value : void 0)}
1830
- href=${this.href}
1831
- target=${this.target}
1832
- aria-label=${this.ariaLabel || this.label || (this.circle ? this.icon : null) || "button"}
1833
- @click=${this._handleClick}
1834
- @focus="${this._handleFocus}"
1835
- @blur="${this._handleBlur}"
1836
- >
1837
- ${this.prefixIcon && this.variant !== "text" ? x`<slot name="prefix-icon">
1838
- <nys-icon size="16" name=${this.prefixIcon}></nys-icon>
1839
- </slot>` : ""}
1840
- ${this.label && !this.circle ? x`<label class="nys-button__text">${this.label}</label>` : ""}
1841
- ${this.suffixIcon && this.variant !== "text" ? x`<slot name="suffix-icon">
1842
- <nys-icon size="16" name=${this.suffixIcon}></nys-icon>
1843
- </slot>` : ""}
1844
- ${this.circle && this.icon ? x`<slot name="circle-icon"
1845
- ><nys-icon
1846
- size=${this.size === "sm" ? "24" : this.size === "lg" ? "40" : "32"}
1847
- name=${this.icon}
1848
- ></nys-icon
1849
- ></slot>` : ""}
1850
- </a>
1851
- </div>
1852
- ` : x`
1853
- <button
1854
- class="nys-button"
1855
- id=${E(this.id)}
1856
- name=${E(this.name ? this.name : void 0)}
1857
- ?disabled=${this.disabled}
1858
- form=${E(this.form ? this.form : void 0)}
1859
- value=${E(this.value ? this.value : void 0)}
1860
- type=${this.type}
1861
- aria-label=${this.ariaLabel || this.label || (this.circle ? this.icon : null) || "button"}
1862
- @click=${this._handleClick}
1863
- @focus="${this._handleFocus}"
1864
- @blur="${this._handleBlur}"
1865
- @keydown="${this._handleKeydown}"
1866
- >
1867
- ${this.prefixIcon && this.variant !== "text" ? x`<slot name="prefix-icon">
1868
- <nys-icon size="16" name=${this.prefixIcon}></nys-icon>
1869
- </slot>` : ""}
1870
- ${this.label && !this.circle ? x`<label class="nys-button__text">${this.label}</label>` : ""}
1871
- ${this.suffixIcon && this.variant !== "text" ? x`<slot name="suffix-icon">
1872
- <nys-icon size="16" name=${this.suffixIcon}></nys-icon>
1873
- </slot>` : ""}
1874
- ${this.circle && this.icon ? x`<slot name="circle-icon">
1875
- <nys-icon
1876
- size=${this.size === "sm" ? "24" : this.size === "lg" ? "40" : "32"}
1877
- name=${this.icon}
1878
- ></nys-icon>
1879
- </slot>` : ""}
1880
- </button>
1881
- `}
1882
- `;
1883
- }
1884
- }, A.VALID_SIZES = ["sm", "md", "lg"], A.VALID_VARIANTS = [
1885
- "filled",
1886
- "outline",
1887
- "ghost",
1888
- "text"
1889
- ], A.VALID_TYPES = ["submit", "reset", "button"], A.VALID_TARGETS = [
1890
- "_self",
1891
- "_blank",
1892
- "_parent",
1893
- "_top",
1894
- "framename"
1895
- ], A.styles = ze, A.formAssociated = !0, A);
1896
- $([
1897
- g({ type: String })
1898
- ], f.prototype, "id", 2);
1899
- $([
1900
- g({ type: String, reflect: !0 })
1901
- ], f.prototype, "name", 2);
1902
- $([
1903
- g({ reflect: !0 })
1904
- ], f.prototype, "size", 1);
1905
- $([
1906
- g({ type: Boolean, reflect: !0 })
1907
- ], f.prototype, "fullWidth", 2);
1908
- $([
1909
- g({ reflect: !0 })
1910
- ], f.prototype, "variant", 1);
1911
- $([
1912
- g({ type: Boolean, reflect: !0 })
1913
- ], f.prototype, "inverted", 2);
1914
- $([
1915
- g({ type: String })
1916
- ], f.prototype, "label", 2);
1917
- $([
1918
- g({ type: String })
1919
- ], f.prototype, "ariaLabel", 2);
1920
- $([
1921
- g({ type: String })
1922
- ], f.prototype, "prefixIcon", 2);
1923
- $([
1924
- g({ type: String })
1925
- ], f.prototype, "suffixIcon", 2);
1926
- $([
1927
- g({ type: Boolean, reflect: !0 })
1928
- ], f.prototype, "circle", 2);
1929
- $([
1930
- g({ type: String })
1931
- ], f.prototype, "icon", 2);
1932
- $([
1933
- g({ type: Boolean, reflect: !0 })
1934
- ], f.prototype, "disabled", 2);
1935
- $([
1936
- g({ type: String })
1937
- ], f.prototype, "form", 2);
1938
- $([
1939
- g({ type: String })
1940
- ], f.prototype, "value", 2);
1941
- $([
1942
- g({ reflect: !0 })
1943
- ], f.prototype, "type", 1);
1944
- $([
1945
- g({ type: Function })
1946
- ], f.prototype, "onClick", 2);
1947
- $([
1948
- g({ type: String })
1949
- ], f.prototype, "href", 2);
1950
- $([
1951
- g({ reflect: !0 })
1952
- ], f.prototype, "target", 1);
1953
- let Ye = f;
1954
- customElements.get("nys-button") || customElements.define("nys-button", Ye);
1955
- var Je = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, y = (n, t, e, s) => {
1956
- for (var o = s > 1 ? void 0 : s ? Qe(t, e) : t, i = n.length - 1, r; i >= 0; i--)
1957
- (r = n[i]) && (o = (s ? r(t, e, o) : r(o)) || o);
1958
- return s && o && Je(t, e, o), o;
1959
- };
1960
- let Xe = 0;
1961
- var w;
1962
- const u = (w = class extends jt {
1963
- // allows use of elementInternals' API
1964
- constructor() {
1965
- super(), this.id = "", this.name = "", this._type = "text", this.label = "", this.description = "", this.placeholder = "", this.value = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.optional = !1, this.form = "", this.pattern = "", this.maxlength = null, this.width = "full", this.step = null, this.min = null, this.max = null, this.showError = !1, this.errorMessage = "", this.showPassword = !1, this._originalErrorMessage = "", this._hasUserInteracted = !1, this._internals = this.attachInternals();
1966
- }
1967
- get type() {
1968
- return this._type;
1969
- }
1970
- set type(t) {
1971
- this._type = w.VALID_TYPES.includes(
1972
- t
1973
- ) ? t : "text";
1974
- }
1975
- // Ensure the "width" property is valid after updates
1976
- async updated(t) {
1977
- t.has("width") && (await Promise.resolve(), this.width = w.VALID_WIDTHS.includes(this.width) ? this.width : "full"), t.has("disabled") && (this._validateButtonSlot("startButton"), this._validateButtonSlot("endButton"));
1978
- }
1979
- // Generate a unique ID if one is not provided
1980
- connectedCallback() {
1981
- super.connectedCallback(), this.id || (this.id = `nys-textinput-${Date.now()}-${Xe++}`), this._originalErrorMessage = this.errorMessage ?? "", this.addEventListener("invalid", this._handleInvalid);
1982
- }
1983
- disconnectedCallback() {
1984
- super.disconnectedCallback(), this.removeEventListener("invalid", this._handleInvalid);
1985
- }
1986
- firstUpdated() {
1987
- this._setValue(), this._manageRequire();
1988
- }
1989
- // This callback is automatically called when the parent form is reset.
1990
- formResetCallback() {
1991
- this.value = "";
1992
- }
1993
- /********************** Form Integration **********************/
1994
- _setValue() {
1995
- this._internals.setFormValue(this.value), this._manageRequire();
1996
- }
1997
- _manageRequire() {
1998
- var o, i;
1999
- const t = (o = this.shadowRoot) == null ? void 0 : o.querySelector("input");
2000
- if (!t) return;
2001
- const e = this.errorMessage || "This field is required";
2002
- this.required && (!this.value || ((i = this.value) == null ? void 0 : i.trim()) === "") ? (this._internals.ariaRequired = "true", this._internals.setValidity({ valueMissing: !0 }, e, t)) : (this._internals.ariaRequired = "false", this._internals.setValidity({}), this._hasUserInteracted = !1);
2003
- }
2004
- _setValidityMessage(t = "") {
2005
- var o, i;
2006
- const e = (o = this.shadowRoot) == null ? void 0 : o.querySelector("input");
2007
- if (!e) return;
2008
- this.showError = !!t, (i = this._originalErrorMessage) != null && i.trim() && t !== "" ? this.errorMessage = this._originalErrorMessage : this.errorMessage = t;
2009
- const s = t ? { customError: !0 } : {};
2010
- this._internals.setValidity(s, this.errorMessage, e);
2011
- }
2012
- _validate() {
2013
- var o;
2014
- const t = (o = this.shadowRoot) == null ? void 0 : o.querySelector("input");
2015
- if (!t) return;
2016
- const e = t.validity;
2017
- let s = "";
2018
- e.valueMissing ? s = "This field is required" : e.typeMismatch ? s = "Invalid format for this type" : e.patternMismatch ? s = "Invalid format" : e.tooShort ? s = `Value is too short. Minimum length is ${t.minLength}` : e.tooLong ? s = `Value is too long. Maximum length is ${t.maxLength}` : e.rangeUnderflow ? s = `Value must be at least ${t.min}` : e.rangeOverflow ? s = `Value must be at most ${t.max}` : e.stepMismatch ? s = "Invalid step value" : s = t.validationMessage, this._setValidityMessage(s);
2019
- }
2020
- /********************** Functions **********************/
2021
- // This helper function is called to perform the element's native validation.
2022
- checkValidity() {
2023
- var e;
2024
- const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("input");
2025
- return t ? t.checkValidity() : !0;
2026
- }
2027
- _handleInvalid(t) {
2028
- var s;
2029
- t.preventDefault(), this._hasUserInteracted = !0, this._validate();
2030
- const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector("input");
2031
- if (e) {
2032
- const o = this._internals.form;
2033
- o ? Array.from(o.elements).find(
2034
- (l) => typeof l.checkValidity == "function" && !l.checkValidity()
2035
- ) === this && e.focus() : e.focus();
2036
- }
2037
- }
2038
- _togglePasswordVisibility() {
2039
- this.showPassword = !this.showPassword;
2040
- }
2041
- /******************** Event Handlers ********************/
2042
- // Handle input event to check pattern validity
2043
- _handleInput(t) {
2044
- const e = t.target;
2045
- this.value = e.value, this._internals.setFormValue(this.value), this._hasUserInteracted && this._validate(), this.dispatchEvent(
2046
- new CustomEvent("nys-input", {
2047
- detail: { value: this.value },
2048
- bubbles: !0,
2049
- composed: !0
2050
- })
2051
- );
2052
- }
2053
- // Handle focus event
2054
- _handleFocus() {
2055
- this.dispatchEvent(new Event("nys-focus"));
2056
- }
2057
- // Handle blur event
2058
- _handleBlur() {
2059
- this._hasUserInteracted || (this._hasUserInteracted = !0), this._validate(), this.dispatchEvent(new Event("nys-blur"));
870
+ // Handle blur event
871
+ _handleBlur() {
872
+ this._hasUserInteracted || (this._hasUserInteracted = !0), this._validate(), this.dispatchEvent(new Event("nys-blur"));
2060
873
  }
2061
874
  _validateButtonSlot(t) {
2062
- var r, l;
2063
- const e = (r = this.shadowRoot) == null ? void 0 : r.querySelector(
875
+ var o, l;
876
+ const e = (o = this.shadowRoot) == null ? void 0 : o.querySelector(
2064
877
  'slot[name="' + t + '"]'
2065
878
  ), s = (l = this.shadowRoot) == null ? void 0 : l.querySelector(
2066
879
  ".nys-textinput__buttoncontainer"
2067
880
  );
2068
881
  if (!e || !s) return;
2069
- const o = e.assignedElements();
2070
- let i = !1;
2071
- o.forEach((a) => {
2072
- a instanceof HTMLElement && a.tagName.toLowerCase() === "nys-button" && !i ? (i = !0, a.setAttribute("size", "sm"), a.setAttribute("variant", "primary"), this.disabled ? a.setAttribute("disabled", "true") : a.removeAttribute("disabled")) : (console.warn(
882
+ const i = e.assignedElements();
883
+ let r = !1;
884
+ i.forEach((a) => {
885
+ a instanceof HTMLElement && a.tagName.toLowerCase() === "nys-button" && !r ? (r = !0, a.setAttribute("size", "sm"), a.setAttribute("variant", "primary"), this.disabled ? a.setAttribute("disabled", "true") : a.removeAttribute("disabled")) : (console.warn(
2073
886
  "The '" + t + "' slot only accepts a single <nys-button> element. Removing invalid or extra node:",
2074
887
  a
2075
888
  ), a.remove());
2076
- }), t === "startButton" ? s.classList.toggle("has-start-button", i) : t === "endButton" && s.classList.toggle("has-end-button", i);
889
+ }), t === "startButton" ? s.classList.toggle("has-start-button", r) : t === "endButton" && s.classList.toggle("has-end-button", r);
2077
890
  }
2078
891
  render() {
2079
- return x`
892
+ return F`
2080
893
  <div class="nys-textinput">
2081
894
  <nys-label
2082
895
  id=${this.id}
@@ -2104,22 +917,22 @@ const u = (w = class extends jt {
2104
917
  aria-disabled="${this.disabled}"
2105
918
  aria-label="${[this.label, this.description].filter(Boolean).join(" ")}"
2106
919
  .value=${this.value}
2107
- placeholder=${T(
920
+ placeholder=${x(
2108
921
  this.placeholder ? this.placeholder : void 0
2109
922
  )}
2110
- pattern=${T(this.pattern ? this.pattern : void 0)}
2111
- min=${T(this.min !== "" ? this.min : void 0)}
2112
- maxlength=${T(
923
+ pattern=${x(this.pattern ? this.pattern : void 0)}
924
+ min=${x(this.min !== "" ? this.min : void 0)}
925
+ maxlength=${x(
2113
926
  this.maxlength !== "" ? this.maxlength : void 0
2114
927
  )}
2115
- step=${T(this.step !== "" ? this.step : void 0)}
2116
- max=${T(this.max !== "" ? this.max : void 0)}
2117
- form=${T(this.form ? this.form : void 0)}
928
+ step=${x(this.step !== "" ? this.step : void 0)}
929
+ max=${x(this.max !== "" ? this.max : void 0)}
930
+ form=${x(this.form ? this.form : void 0)}
2118
931
  @input=${this._handleInput}
2119
932
  @focus="${this._handleFocus}"
2120
933
  @blur="${this._handleBlur}"
2121
934
  />
2122
- ${this.type === "password" ? x` <nys-button
935
+ ${this.type === "password" ? F` <nys-button
2123
936
  class="eye-icon"
2124
937
  id="password-toggle"
2125
938
  suffixIcon="slotted"
@@ -2146,7 +959,7 @@ const u = (w = class extends jt {
2146
959
  </div>
2147
960
  `;
2148
961
  }
2149
- }, w.VALID_TYPES = [
962
+ }, f.VALID_TYPES = [
2150
963
  "email",
2151
964
  "number",
2152
965
  "password",
@@ -2154,73 +967,73 @@ const u = (w = class extends jt {
2154
967
  "tel",
2155
968
  "text",
2156
969
  "url"
2157
- ], w.VALID_WIDTHS = ["sm", "md", "lg", "full"], w.styles = ve, w.formAssociated = !0, w);
2158
- y([
2159
- p({ type: String })
2160
- ], u.prototype, "id", 2);
2161
- y([
2162
- p({ type: String, reflect: !0 })
2163
- ], u.prototype, "name", 2);
2164
- y([
2165
- p({ reflect: !0 })
2166
- ], u.prototype, "type", 1);
2167
- y([
2168
- p({ type: String })
2169
- ], u.prototype, "label", 2);
2170
- y([
2171
- p({ type: String })
2172
- ], u.prototype, "description", 2);
2173
- y([
2174
- p({ type: String })
2175
- ], u.prototype, "placeholder", 2);
2176
- y([
2177
- p({ type: String })
2178
- ], u.prototype, "value", 2);
2179
- y([
2180
- p({ type: Boolean, reflect: !0 })
2181
- ], u.prototype, "disabled", 2);
2182
- y([
2183
- p({ type: Boolean, reflect: !0 })
2184
- ], u.prototype, "readonly", 2);
2185
- y([
2186
- p({ type: Boolean, reflect: !0 })
2187
- ], u.prototype, "required", 2);
2188
- y([
2189
- p({ type: Boolean, reflect: !0 })
2190
- ], u.prototype, "optional", 2);
2191
- y([
2192
- p({ type: String })
2193
- ], u.prototype, "form", 2);
2194
- y([
2195
- p({ type: String })
2196
- ], u.prototype, "pattern", 2);
2197
- y([
2198
- p({ type: Number })
2199
- ], u.prototype, "maxlength", 2);
2200
- y([
2201
- p({ reflect: !0 })
2202
- ], u.prototype, "width", 2);
2203
- y([
2204
- p({ type: Number })
2205
- ], u.prototype, "step", 2);
2206
- y([
2207
- p({ type: Number })
2208
- ], u.prototype, "min", 2);
2209
- y([
2210
- p({ type: Number })
2211
- ], u.prototype, "max", 2);
2212
- y([
2213
- p({ type: Boolean, reflect: !0 })
2214
- ], u.prototype, "showError", 2);
2215
- y([
2216
- p({ type: String })
2217
- ], u.prototype, "errorMessage", 2);
2218
- y([
2219
- be()
2220
- ], u.prototype, "showPassword", 2);
2221
- let ts = u;
2222
- customElements.get("nys-textinput") || customElements.define("nys-textinput", ts);
970
+ ], f.VALID_WIDTHS = ["sm", "md", "lg", "full"], f.styles = wt, f.formAssociated = !0, f);
971
+ c([
972
+ u({ type: String })
973
+ ], d.prototype, "id", 2);
974
+ c([
975
+ u({ type: String, reflect: !0 })
976
+ ], d.prototype, "name", 2);
977
+ c([
978
+ u({ reflect: !0 })
979
+ ], d.prototype, "type", 1);
980
+ c([
981
+ u({ type: String })
982
+ ], d.prototype, "label", 2);
983
+ c([
984
+ u({ type: String })
985
+ ], d.prototype, "description", 2);
986
+ c([
987
+ u({ type: String })
988
+ ], d.prototype, "placeholder", 2);
989
+ c([
990
+ u({ type: String })
991
+ ], d.prototype, "value", 2);
992
+ c([
993
+ u({ type: Boolean, reflect: !0 })
994
+ ], d.prototype, "disabled", 2);
995
+ c([
996
+ u({ type: Boolean, reflect: !0 })
997
+ ], d.prototype, "readonly", 2);
998
+ c([
999
+ u({ type: Boolean, reflect: !0 })
1000
+ ], d.prototype, "required", 2);
1001
+ c([
1002
+ u({ type: Boolean, reflect: !0 })
1003
+ ], d.prototype, "optional", 2);
1004
+ c([
1005
+ u({ type: String })
1006
+ ], d.prototype, "form", 2);
1007
+ c([
1008
+ u({ type: String })
1009
+ ], d.prototype, "pattern", 2);
1010
+ c([
1011
+ u({ type: Number })
1012
+ ], d.prototype, "maxlength", 2);
1013
+ c([
1014
+ u({ reflect: !0 })
1015
+ ], d.prototype, "width", 2);
1016
+ c([
1017
+ u({ type: Number })
1018
+ ], d.prototype, "step", 2);
1019
+ c([
1020
+ u({ type: Number })
1021
+ ], d.prototype, "min", 2);
1022
+ c([
1023
+ u({ type: Number })
1024
+ ], d.prototype, "max", 2);
1025
+ c([
1026
+ u({ type: Boolean, reflect: !0 })
1027
+ ], d.prototype, "showError", 2);
1028
+ c([
1029
+ u({ type: String })
1030
+ ], d.prototype, "errorMessage", 2);
1031
+ c([
1032
+ xt()
1033
+ ], d.prototype, "showPassword", 2);
1034
+ let Nt = d;
1035
+ customElements.get("nys-textinput") || customElements.define("nys-textinput", Nt);
2223
1036
  export {
2224
- ts as NysTextinput
1037
+ Nt as NysTextinput
2225
1038
  };
2226
1039
  //# sourceMappingURL=nys-textinput.js.map