@nysds/nys-select 1.10.0 → 1.11.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,4 +1,4 @@
1
- import { css as ce, LitElement as ie, html as re } from "lit";
1
+ import { css as ae, LitElement as te, html as se } from "lit";
2
2
  /*!
3
3
  * ▒█▄░▒█ ▒█░░▒█ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█
4
4
  * ▒█▒█▒█ ▒█▄▄▄█ ░▀▀▀▄▄ ▒█░▒█ ░▀▀▀▄▄
@@ -14,18 +14,18 @@ import { css as ce, LitElement as ie, html as re } from "lit";
14
14
  * Copyright 2019 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- const T = globalThis, j = T.ShadowRoot && (T.ShadyCSS === void 0 || T.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, oe = Symbol(), G = /* @__PURE__ */ new WeakMap();
18
- let de = class {
17
+ const H = globalThis, V = H.ShadowRoot && (H.ShadyCSS === void 0 || H.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ie = Symbol(), W = /* @__PURE__ */ new WeakMap();
18
+ let he = class {
19
19
  constructor(e, t, s) {
20
- if (this._$cssResult$ = !0, s !== oe) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
20
+ if (this._$cssResult$ = !0, s !== ie) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
21
21
  this.cssText = e, this.t = t;
22
22
  }
23
23
  get styleSheet() {
24
24
  let e = this.o;
25
25
  const t = this.t;
26
- if (j && e === void 0) {
26
+ if (V && e === void 0) {
27
27
  const s = t !== void 0 && t.length === 1;
28
- s && (e = G.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && G.set(t, e));
28
+ s && (e = W.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && W.set(t, e));
29
29
  }
30
30
  return e;
31
31
  }
@@ -33,26 +33,26 @@ let de = class {
33
33
  return this.cssText;
34
34
  }
35
35
  };
36
- const pe = (o) => new de(typeof o == "string" ? o : o + "", void 0, oe), ue = (o, e) => {
37
- if (j) o.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
36
+ const ce = (o) => new he(typeof o == "string" ? o : o + "", void 0, ie), de = (o, e) => {
37
+ if (V) o.adoptedStyleSheets = e.map(((t) => t instanceof CSSStyleSheet ? t : t.styleSheet));
38
38
  else for (const t of e) {
39
- const s = document.createElement("style"), i = T.litNonce;
39
+ const s = document.createElement("style"), i = H.litNonce;
40
40
  i !== void 0 && s.setAttribute("nonce", i), s.textContent = t.cssText, o.appendChild(s);
41
41
  }
42
- }, J = j ? (o) => o : (o) => o instanceof CSSStyleSheet ? ((e) => {
42
+ }, F = V ? (o) => o : (o) => o instanceof CSSStyleSheet ? ((e) => {
43
43
  let t = "";
44
44
  for (const s of e.cssRules) t += s.cssText;
45
- return pe(t);
45
+ return ce(t);
46
46
  })(o) : o;
47
47
  /**
48
48
  * @license
49
49
  * Copyright 2017 Google LLC
50
50
  * SPDX-License-Identifier: BSD-3-Clause
51
51
  */
52
- const { is: ye, defineProperty: _e, getOwnPropertyDescriptor: fe, getOwnPropertyNames: ve, getOwnPropertySymbols: $e, getPrototypeOf: me } = Object, g = globalThis, K = g.trustedTypes, ge = K ? K.emptyScript : "", L = g.reactiveElementPolyfillSupport, P = (o, e) => o, I = { toAttribute(o, e) {
52
+ const { is: pe, defineProperty: ue, getOwnPropertyDescriptor: ye, getOwnPropertyNames: _e, getOwnPropertySymbols: fe, getPrototypeOf: ve } = Object, k = globalThis, G = k.trustedTypes, $e = G ? G.emptyScript : "", me = k.reactiveElementPolyfillSupport, C = (o, e) => o, R = { toAttribute(o, e) {
53
53
  switch (e) {
54
54
  case Boolean:
55
- o = o ? ge : null;
55
+ o = o ? $e : null;
56
56
  break;
57
57
  case Object:
58
58
  case Array:
@@ -77,46 +77,44 @@ const { is: ye, defineProperty: _e, getOwnPropertyDescriptor: fe, getOwnProperty
77
77
  }
78
78
  }
79
79
  return t;
80
- } }, W = (o, e) => !ye(o, e), Z = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: W };
81
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), g.litPropertyMetadata ?? (g.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
82
- class x extends HTMLElement {
80
+ } }, z = (o, e) => !pe(o, e), J = { attribute: !0, type: String, converter: R, reflect: !1, useDefault: !1, hasChanged: z };
81
+ Symbol.metadata ??= Symbol("metadata"), k.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
82
+ class S extends HTMLElement {
83
83
  static addInitializer(e) {
84
- this._$Ei(), (this.l ?? (this.l = [])).push(e);
84
+ this._$Ei(), (this.l ??= []).push(e);
85
85
  }
86
86
  static get observedAttributes() {
87
87
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
88
88
  }
89
- static createProperty(e, t = Z) {
90
- if (t.state && (t.attribute = !1), this._$Ei(), this.elementProperties.set(e, t), !t.noAccessor) {
89
+ static createProperty(e, t = J) {
90
+ if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
91
91
  const s = Symbol(), i = this.getPropertyDescriptor(e, s, t);
92
- i !== void 0 && _e(this.prototype, e, i);
92
+ i !== void 0 && ue(this.prototype, e, i);
93
93
  }
94
94
  }
95
95
  static getPropertyDescriptor(e, t, s) {
96
- const { get: i, set: n } = fe(this.prototype, e) ?? { get() {
96
+ const { get: i, set: r } = ye(this.prototype, e) ?? { get() {
97
97
  return this[t];
98
- }, set(r) {
99
- this[t] = r;
98
+ }, set(n) {
99
+ this[t] = n;
100
100
  } };
101
- return { get() {
102
- return i == null ? void 0 : i.call(this);
103
- }, set(r) {
104
- const a = i == null ? void 0 : i.call(this);
105
- n.call(this, r), this.requestUpdate(e, a, s);
101
+ return { get: i, set(n) {
102
+ const a = i?.call(this);
103
+ r?.call(this, n), this.requestUpdate(e, a, s);
106
104
  }, configurable: !0, enumerable: !0 };
107
105
  }
108
106
  static getPropertyOptions(e) {
109
- return this.elementProperties.get(e) ?? Z;
107
+ return this.elementProperties.get(e) ?? J;
110
108
  }
111
109
  static _$Ei() {
112
- if (this.hasOwnProperty(P("elementProperties"))) return;
113
- const e = me(this);
110
+ if (this.hasOwnProperty(C("elementProperties"))) return;
111
+ const e = ve(this);
114
112
  e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
115
113
  }
116
114
  static finalize() {
117
- if (this.hasOwnProperty(P("finalized"))) return;
118
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(P("properties"))) {
119
- const t = this.properties, s = [...ve(t), ...$e(t)];
115
+ if (this.hasOwnProperty(C("finalized"))) return;
116
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(C("properties"))) {
117
+ const t = this.properties, s = [..._e(t), ...fe(t)];
120
118
  for (const i of s) this.createProperty(i, t[i]);
121
119
  }
122
120
  const e = this[Symbol.metadata];
@@ -135,8 +133,8 @@ class x extends HTMLElement {
135
133
  const t = [];
136
134
  if (Array.isArray(e)) {
137
135
  const s = new Set(e.flat(1 / 0).reverse());
138
- for (const i of s) t.unshift(J(i));
139
- } else e !== void 0 && t.push(J(e));
136
+ for (const i of s) t.unshift(F(i));
137
+ } else e !== void 0 && t.push(F(e));
140
138
  return t;
141
139
  }
142
140
  static _$Eu(e, t) {
@@ -147,16 +145,13 @@ class x extends HTMLElement {
147
145
  super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
148
146
  }
149
147
  _$Ev() {
150
- var e;
151
- this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (e = this.constructor.l) == null || e.forEach((t) => t(this));
148
+ this._$ES = new Promise(((e) => this.enableUpdating = e)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((e) => e(this)));
152
149
  }
153
150
  addController(e) {
154
- var t;
155
- (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(e), this.renderRoot !== void 0 && this.isConnected && ((t = e.hostConnected) == null || t.call(e));
151
+ (this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
156
152
  }
157
153
  removeController(e) {
158
- var t;
159
- (t = this._$EO) == null || t.delete(e);
154
+ this._$EO?.delete(e);
160
155
  }
161
156
  _$E_() {
162
157
  const e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
@@ -165,54 +160,47 @@ class x extends HTMLElement {
165
160
  }
166
161
  createRenderRoot() {
167
162
  const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
168
- return ue(e, this.constructor.elementStyles), e;
163
+ return de(e, this.constructor.elementStyles), e;
169
164
  }
170
165
  connectedCallback() {
171
- var e;
172
- this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (e = this._$EO) == null || e.forEach((t) => {
173
- var s;
174
- return (s = t.hostConnected) == null ? void 0 : s.call(t);
175
- });
166
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((e) => e.hostConnected?.()));
176
167
  }
177
168
  enableUpdating(e) {
178
169
  }
179
170
  disconnectedCallback() {
180
- var e;
181
- (e = this._$EO) == null || e.forEach((t) => {
182
- var s;
183
- return (s = t.hostDisconnected) == null ? void 0 : s.call(t);
184
- });
171
+ this._$EO?.forEach(((e) => e.hostDisconnected?.()));
185
172
  }
186
173
  attributeChangedCallback(e, t, s) {
187
174
  this._$AK(e, s);
188
175
  }
189
- _$EC(e, t) {
190
- var n;
176
+ _$ET(e, t) {
191
177
  const s = this.constructor.elementProperties.get(e), i = this.constructor._$Eu(e, s);
192
178
  if (i !== void 0 && s.reflect === !0) {
193
- const r = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : I).toAttribute(t, s.type);
179
+ const r = (s.converter?.toAttribute !== void 0 ? s.converter : R).toAttribute(t, s.type);
194
180
  this._$Em = e, r == null ? this.removeAttribute(i) : this.setAttribute(i, r), this._$Em = null;
195
181
  }
196
182
  }
197
183
  _$AK(e, t) {
198
- var n;
199
184
  const s = this.constructor, i = s._$Eh.get(e);
200
185
  if (i !== void 0 && this._$Em !== i) {
201
- const r = s.getPropertyOptions(i), a = typeof r.converter == "function" ? { fromAttribute: r.converter } : ((n = r.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? r.converter : I;
202
- this._$Em = i, this[i] = a.fromAttribute(t, r.type), this._$Em = null;
186
+ const r = s.getPropertyOptions(i), n = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute !== void 0 ? r.converter : R;
187
+ this._$Em = i;
188
+ const a = n.fromAttribute(t, r.type);
189
+ this[i] = a ?? this._$Ej?.get(i) ?? a, this._$Em = null;
203
190
  }
204
191
  }
205
192
  requestUpdate(e, t, s) {
206
193
  if (e !== void 0) {
207
- if (s ?? (s = this.constructor.getPropertyOptions(e)), !(s.hasChanged ?? W)(this[e], t)) return;
208
- this.P(e, t, s);
194
+ const i = this.constructor, r = this[e];
195
+ if (s ??= i.getPropertyOptions(e), !((s.hasChanged ?? z)(r, t) || s.useDefault && s.reflect && r === this._$Ej?.get(e) && !this.hasAttribute(i._$Eu(e, s)))) return;
196
+ this.C(e, t, s);
209
197
  }
210
- this.isUpdatePending === !1 && (this._$ES = this._$ET());
198
+ this.isUpdatePending === !1 && (this._$ES = this._$EP());
211
199
  }
212
- P(e, t, s) {
213
- this._$AL.has(e) || this._$AL.set(e, t), s.reflect === !0 && this._$Em !== e && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(e);
200
+ C(e, t, { useDefault: s, reflect: i, wrapped: r }, n) {
201
+ s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, n ?? t ?? this[e]), r !== !0 || n !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (t = void 0), this._$AL.set(e, t)), i === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
214
202
  }
215
- async _$ET() {
203
+ async _$EP() {
216
204
  this.isUpdatePending = !0;
217
205
  try {
218
206
  await this._$ES;
@@ -226,38 +214,33 @@ class x extends HTMLElement {
226
214
  return this.performUpdate();
227
215
  }
228
216
  performUpdate() {
229
- var s;
230
217
  if (!this.isUpdatePending) return;
231
218
  if (!this.hasUpdated) {
232
- if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
233
- for (const [n, r] of this._$Ep) this[n] = r;
219
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
220
+ for (const [i, r] of this._$Ep) this[i] = r;
234
221
  this._$Ep = void 0;
235
222
  }
236
- const i = this.constructor.elementProperties;
237
- if (i.size > 0) for (const [n, r] of i) r.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.P(n, this[n], r);
223
+ const s = this.constructor.elementProperties;
224
+ if (s.size > 0) for (const [i, r] of s) {
225
+ const { wrapped: n } = r, a = this[i];
226
+ n !== !0 || this._$AL.has(i) || a === void 0 || this.C(i, void 0, r, a);
227
+ }
238
228
  }
239
229
  let e = !1;
240
230
  const t = this._$AL;
241
231
  try {
242
- e = this.shouldUpdate(t), e ? (this.willUpdate(t), (s = this._$EO) == null || s.forEach((i) => {
243
- var n;
244
- return (n = i.hostUpdate) == null ? void 0 : n.call(i);
245
- }), this.update(t)) : this._$EU();
246
- } catch (i) {
247
- throw e = !1, this._$EU(), i;
232
+ e = this.shouldUpdate(t), e ? (this.willUpdate(t), this._$EO?.forEach(((s) => s.hostUpdate?.())), this.update(t)) : this._$EM();
233
+ } catch (s) {
234
+ throw e = !1, this._$EM(), s;
248
235
  }
249
236
  e && this._$AE(t);
250
237
  }
251
238
  willUpdate(e) {
252
239
  }
253
240
  _$AE(e) {
254
- var t;
255
- (t = this._$EO) == null || t.forEach((s) => {
256
- var i;
257
- return (i = s.hostUpdated) == null ? void 0 : i.call(s);
258
- }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
241
+ this._$EO?.forEach(((t) => t.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
259
242
  }
260
- _$EU() {
243
+ _$EM() {
261
244
  this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
262
245
  }
263
246
  get updateComplete() {
@@ -270,47 +253,47 @@ class x extends HTMLElement {
270
253
  return !0;
271
254
  }
272
255
  update(e) {
273
- this._$Ej && (this._$Ej = this._$Ej.forEach((t) => this._$EC(t, this[t]))), this._$EU();
256
+ this._$Eq &&= this._$Eq.forEach(((t) => this._$ET(t, this[t]))), this._$EM();
274
257
  }
275
258
  updated(e) {
276
259
  }
277
260
  firstUpdated(e) {
278
261
  }
279
262
  }
280
- x.elementStyles = [], x.shadowRootOptions = { mode: "open" }, x[P("elementProperties")] = /* @__PURE__ */ new Map(), x[P("finalized")] = /* @__PURE__ */ new Map(), L == null || L({ ReactiveElement: x }), (g.reactiveElementVersions ?? (g.reactiveElementVersions = [])).push("2.0.4");
263
+ S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[C("elementProperties")] = /* @__PURE__ */ new Map(), S[C("finalized")] = /* @__PURE__ */ new Map(), me?.({ ReactiveElement: S }), (k.reactiveElementVersions ??= []).push("2.1.1");
281
264
  /**
282
265
  * @license
283
266
  * Copyright 2017 Google LLC
284
267
  * SPDX-License-Identifier: BSD-3-Clause
285
268
  */
286
- const be = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: W }, Ae = (o = be, e, t) => {
269
+ const be = { attribute: !0, type: String, converter: R, reflect: !1, hasChanged: z }, ge = (o = be, e, t) => {
287
270
  const { kind: s, metadata: i } = t;
288
- let n = globalThis.litPropertyMetadata.get(i);
289
- if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), n.set(t.name, o), s === "accessor") {
290
- const { name: r } = t;
271
+ let r = globalThis.litPropertyMetadata.get(i);
272
+ if (r === void 0 && globalThis.litPropertyMetadata.set(i, r = /* @__PURE__ */ new Map()), s === "setter" && ((o = Object.create(o)).wrapped = !0), r.set(t.name, o), s === "accessor") {
273
+ const { name: n } = t;
291
274
  return { set(a) {
292
275
  const l = e.get.call(this);
293
- e.set.call(this, a), this.requestUpdate(r, l, o);
276
+ e.set.call(this, a), this.requestUpdate(n, l, o);
294
277
  }, init(a) {
295
- return a !== void 0 && this.P(r, void 0, o), a;
278
+ return a !== void 0 && this.C(n, void 0, o, a), a;
296
279
  } };
297
280
  }
298
281
  if (s === "setter") {
299
- const { name: r } = t;
282
+ const { name: n } = t;
300
283
  return function(a) {
301
- const l = this[r];
302
- e.call(this, a), this.requestUpdate(r, l, o);
284
+ const l = this[n];
285
+ e.call(this, a), this.requestUpdate(n, l, o);
303
286
  };
304
287
  }
305
288
  throw Error("Unsupported decorator location: " + s);
306
289
  };
307
- function p(o) {
308
- return (e, t) => typeof t == "object" ? Ae(o, e, t) : ((s, i, n) => {
309
- const r = i.hasOwnProperty(n);
310
- return i.constructor.createProperty(n, r ? { ...s, wrapped: !0 } : s), r ? Object.getOwnPropertyDescriptor(i, n) : void 0;
290
+ function d(o) {
291
+ return (e, t) => typeof t == "object" ? ge(o, e, t) : ((s, i, r) => {
292
+ const n = i.hasOwnProperty(r);
293
+ return i.constructor.createProperty(r, s), n ? Object.getOwnPropertyDescriptor(i, r) : void 0;
311
294
  })(o, e, t);
312
295
  }
313
- const we = ce`
296
+ const Ae = ae`
314
297
  :host {
315
298
  /* Global Select Styles */
316
299
  --_nys-select-width: 100%;
@@ -374,6 +357,7 @@ const we = ce`
374
357
  .nys-select__select {
375
358
  color: var(--_nys-select-color);
376
359
  font-weight: var(--_nys-select-font-weight);
360
+ font-family: var(--_nys-select-font-family);
377
361
  border-radius: var(--_nys-select-border-radius);
378
362
  border: solid var(--_nys-select-border-width)
379
363
  var(--_nys-select-border-color);
@@ -459,55 +443,55 @@ const we = ce`
459
443
  * Copyright 2017 Google LLC
460
444
  * SPDX-License-Identifier: BSD-3-Clause
461
445
  */
462
- const U = globalThis, k = U.trustedTypes, Y = k ? k.createPolicy("lit-html", { createHTML: (o) => o }) : void 0, ne = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, le = "?" + m, Ee = `<${le}>`, w = document, q = () => w.createComment(""), M = (o) => o === null || typeof o != "object" && typeof o != "function", F = Array.isArray, Se = (o) => F(o) || typeof (o == null ? void 0 : o[Symbol.iterator]) == "function", B = `[
463
- \f\r]`, C = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Q = /-->/g, X = />/g, b = RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
464
- \f\r"'\`<>=]|("|')|))|$)`, "g"), ee = /'/g, te = /"/g, ae = /^(?:script|style|textarea|title)$/i, O = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), se = /* @__PURE__ */ new WeakMap(), A = w.createTreeWalker(w, 129);
465
- function he(o, e) {
466
- if (!F(o) || !o.hasOwnProperty("raw")) throw Error("invalid template strings array");
467
- return Y !== void 0 ? Y.createHTML(e) : e;
446
+ const B = globalThis, T = B.trustedTypes, K = T ? T.createPolicy("lit-html", { createHTML: (o) => o }) : void 0, re = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, oe = "?" + m, we = `<${oe}>`, w = document, I = () => w.createComment(""), P = (o) => o === null || typeof o != "object" && typeof o != "function", L = Array.isArray, Ee = (o) => L(o) || typeof o?.[Symbol.iterator] == "function", D = `[
447
+ \f\r]`, x = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Z = /-->/g, Y = />/g, g = RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^
448
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Q = /'/g, X = /"/g, ne = /^(?:script|style|textarea|title)$/i, U = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), ee = /* @__PURE__ */ new WeakMap(), A = w.createTreeWalker(w, 129);
449
+ function le(o, e) {
450
+ if (!L(o) || !o.hasOwnProperty("raw")) throw Error("invalid template strings array");
451
+ return K !== void 0 ? K.createHTML(e) : e;
468
452
  }
469
- const xe = (o, e) => {
453
+ const Se = (o, e) => {
470
454
  const t = o.length - 1, s = [];
471
- let i, n = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r = C;
455
+ let i, r = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = x;
472
456
  for (let a = 0; a < t; a++) {
473
457
  const l = o[a];
474
- let d, u, h = -1, f = 0;
475
- for (; f < l.length && (r.lastIndex = f, u = r.exec(l), u !== null); ) f = r.lastIndex, r === C ? u[1] === "!--" ? r = Q : u[1] !== void 0 ? r = X : u[2] !== void 0 ? (ae.test(u[2]) && (i = RegExp("</" + u[2], "g")), r = b) : u[3] !== void 0 && (r = b) : r === b ? u[0] === ">" ? (r = i ?? C, h = -1) : u[1] === void 0 ? h = -2 : (h = r.lastIndex - u[2].length, d = u[1], r = u[3] === void 0 ? b : u[3] === '"' ? te : ee) : r === te || r === ee ? r = b : r === Q || r === X ? r = C : (r = b, i = void 0);
476
- const $ = r === b && o[a + 1].startsWith("/>") ? " " : "";
477
- n += r === C ? l + Ee : h >= 0 ? (s.push(d), l.slice(0, h) + ne + l.slice(h) + m + $) : l + m + (h === -2 ? a : $);
458
+ let p, u, h = -1, f = 0;
459
+ for (; f < l.length && (n.lastIndex = f, u = n.exec(l), u !== null); ) f = n.lastIndex, n === x ? u[1] === "!--" ? n = Z : u[1] !== void 0 ? n = Y : u[2] !== void 0 ? (ne.test(u[2]) && (i = RegExp("</" + u[2], "g")), n = g) : u[3] !== void 0 && (n = g) : n === g ? u[0] === ">" ? (n = i ?? x, h = -1) : u[1] === void 0 ? h = -2 : (h = n.lastIndex - u[2].length, p = u[1], n = u[3] === void 0 ? g : u[3] === '"' ? X : Q) : n === X || n === Q ? n = g : n === Z || n === Y ? n = x : (n = g, i = void 0);
460
+ const $ = n === g && o[a + 1].startsWith("/>") ? " " : "";
461
+ r += n === x ? l + we : h >= 0 ? (s.push(p), l.slice(0, h) + re + l.slice(h) + m + $) : l + m + (h === -2 ? a : $);
478
462
  }
479
- return [he(o, n + (o[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
463
+ return [le(o, r + (o[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
480
464
  };
481
- class H {
465
+ class O {
482
466
  constructor({ strings: e, _$litType$: t }, s) {
483
467
  let i;
484
468
  this.parts = [];
485
- let n = 0, r = 0;
486
- const a = e.length - 1, l = this.parts, [d, u] = xe(e, t);
487
- if (this.el = H.createElement(d, s), A.currentNode = this.el.content, t === 2 || t === 3) {
469
+ let r = 0, n = 0;
470
+ const a = e.length - 1, l = this.parts, [p, u] = Se(e, t);
471
+ if (this.el = O.createElement(p, s), A.currentNode = this.el.content, t === 2 || t === 3) {
488
472
  const h = this.el.content.firstChild;
489
473
  h.replaceWith(...h.childNodes);
490
474
  }
491
475
  for (; (i = A.nextNode()) !== null && l.length < a; ) {
492
476
  if (i.nodeType === 1) {
493
- if (i.hasAttributes()) for (const h of i.getAttributeNames()) if (h.endsWith(ne)) {
494
- const f = u[r++], $ = i.getAttribute(h).split(m), N = /([.?@])?(.*)/.exec(f);
495
- l.push({ type: 1, index: n, name: N[2], strings: $, ctor: N[1] === "." ? Pe : N[1] === "?" ? Ue : N[1] === "@" ? Me : z }), i.removeAttribute(h);
496
- } else h.startsWith(m) && (l.push({ type: 6, index: n }), i.removeAttribute(h));
497
- if (ae.test(i.tagName)) {
477
+ if (i.hasAttributes()) for (const h of i.getAttributeNames()) if (h.endsWith(re)) {
478
+ const f = u[n++], $ = i.getAttribute(h).split(m), N = /([.?@])?(.*)/.exec(f);
479
+ l.push({ type: 1, index: r, name: N[2], strings: $, ctor: N[1] === "." ? Ce : N[1] === "?" ? Pe : N[1] === "@" ? Ue : j }), i.removeAttribute(h);
480
+ } else h.startsWith(m) && (l.push({ type: 6, index: r }), i.removeAttribute(h));
481
+ if (ne.test(i.tagName)) {
498
482
  const h = i.textContent.split(m), f = h.length - 1;
499
483
  if (f > 0) {
500
- i.textContent = k ? k.emptyScript : "";
501
- for (let $ = 0; $ < f; $++) i.append(h[$], q()), A.nextNode(), l.push({ type: 2, index: ++n });
502
- i.append(h[f], q());
484
+ i.textContent = T ? T.emptyScript : "";
485
+ for (let $ = 0; $ < f; $++) i.append(h[$], I()), A.nextNode(), l.push({ type: 2, index: ++r });
486
+ i.append(h[f], I());
503
487
  }
504
488
  }
505
- } else if (i.nodeType === 8) if (i.data === le) l.push({ type: 2, index: n });
489
+ } else if (i.nodeType === 8) if (i.data === oe) l.push({ type: 2, index: r });
506
490
  else {
507
491
  let h = -1;
508
- for (; (h = i.data.indexOf(m, h + 1)) !== -1; ) l.push({ type: 7, index: n }), h += m.length - 1;
492
+ for (; (h = i.data.indexOf(m, h + 1)) !== -1; ) l.push({ type: 7, index: r }), h += m.length - 1;
509
493
  }
510
- n++;
494
+ r++;
511
495
  }
512
496
  }
513
497
  static createElement(e, t) {
@@ -515,14 +499,13 @@ class H {
515
499
  return s.innerHTML = e, s;
516
500
  }
517
501
  }
518
- function S(o, e, t = o, s) {
519
- var r, a;
520
- if (e === O) return e;
521
- let i = s !== void 0 ? (r = t._$Co) == null ? void 0 : r[s] : t._$Cl;
522
- const n = M(e) ? void 0 : e._$litDirective$;
523
- return (i == null ? void 0 : i.constructor) !== n && ((a = i == null ? void 0 : i._$AO) == null || a.call(i, !1), n === void 0 ? i = void 0 : (i = new n(o), i._$AT(o, t, s)), s !== void 0 ? (t._$Co ?? (t._$Co = []))[s] = i : t._$Cl = i), i !== void 0 && (e = S(o, i._$AS(o, e.values), i, s)), e;
502
+ function E(o, e, t = o, s) {
503
+ if (e === U) return e;
504
+ let i = s !== void 0 ? t._$Co?.[s] : t._$Cl;
505
+ const r = P(e) ? void 0 : e._$litDirective$;
506
+ return i?.constructor !== r && (i?._$AO?.(!1), r === void 0 ? i = void 0 : (i = new r(o), i._$AT(o, t, s)), s !== void 0 ? (t._$Co ??= [])[s] = i : t._$Cl = i), i !== void 0 && (e = E(o, i._$AS(o, e.values), i, s)), e;
524
507
  }
525
- class Ce {
508
+ class xe {
526
509
  constructor(e, t) {
527
510
  this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
528
511
  }
@@ -533,15 +516,15 @@ class Ce {
533
516
  return this._$AM._$AU;
534
517
  }
535
518
  u(e) {
536
- const { el: { content: t }, parts: s } = this._$AD, i = ((e == null ? void 0 : e.creationScope) ?? w).importNode(t, !0);
519
+ const { el: { content: t }, parts: s } = this._$AD, i = (e?.creationScope ?? w).importNode(t, !0);
537
520
  A.currentNode = i;
538
- let n = A.nextNode(), r = 0, a = 0, l = s[0];
521
+ let r = A.nextNode(), n = 0, a = 0, l = s[0];
539
522
  for (; l !== void 0; ) {
540
- if (r === l.index) {
541
- let d;
542
- l.type === 2 ? d = new V(n, n.nextSibling, this, e) : l.type === 1 ? d = new l.ctor(n, l.name, l.strings, this, e) : l.type === 6 && (d = new Oe(n, this, e)), this._$AV.push(d), l = s[++a];
523
+ if (n === l.index) {
524
+ let p;
525
+ l.type === 2 ? p = new q(r, r.nextSibling, this, e) : l.type === 1 ? p = new l.ctor(r, l.name, l.strings, this, e) : l.type === 6 && (p = new Oe(r, this, e)), this._$AV.push(p), l = s[++a];
543
526
  }
544
- r !== (l == null ? void 0 : l.index) && (n = A.nextNode(), r++);
527
+ n !== l?.index && (r = A.nextNode(), n++);
545
528
  }
546
529
  return A.currentNode = w, i;
547
530
  }
@@ -550,18 +533,17 @@ class Ce {
550
533
  for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, t), t += s.strings.length - 2) : s._$AI(e[t])), t++;
551
534
  }
552
535
  }
553
- class V {
536
+ class q {
554
537
  get _$AU() {
555
- var e;
556
- return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
538
+ return this._$AM?._$AU ?? this._$Cv;
557
539
  }
558
540
  constructor(e, t, s, i) {
559
- this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
541
+ this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = i, this._$Cv = i?.isConnected ?? !0;
560
542
  }
561
543
  get parentNode() {
562
544
  let e = this._$AA.parentNode;
563
545
  const t = this._$AM;
564
- return t !== void 0 && (e == null ? void 0 : e.nodeType) === 11 && (e = t.parentNode), e;
546
+ return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
565
547
  }
566
548
  get startNode() {
567
549
  return this._$AA;
@@ -570,7 +552,7 @@ class V {
570
552
  return this._$AB;
571
553
  }
572
554
  _$AI(e, t = this) {
573
- e = S(this, e, t), M(e) ? e === c || e == null || e === "" ? (this._$AH !== c && this._$AR(), this._$AH = c) : e !== this._$AH && e !== O && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Se(e) ? this.k(e) : this._(e);
555
+ e = E(this, e, t), P(e) ? e === c || e == null || e === "" ? (this._$AH !== c && this._$AR(), this._$AH = c) : e !== this._$AH && e !== U && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ee(e) ? this.k(e) : this._(e);
574
556
  }
575
557
  O(e) {
576
558
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -579,66 +561,63 @@ class V {
579
561
  this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
580
562
  }
581
563
  _(e) {
582
- this._$AH !== c && M(this._$AH) ? this._$AA.nextSibling.data = e : this.T(w.createTextNode(e)), this._$AH = e;
564
+ this._$AH !== c && P(this._$AH) ? this._$AA.nextSibling.data = e : this.T(w.createTextNode(e)), this._$AH = e;
583
565
  }
584
566
  $(e) {
585
- var n;
586
- const { values: t, _$litType$: s } = e, i = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = H.createElement(he(s.h, s.h[0]), this.options)), s);
587
- if (((n = this._$AH) == null ? void 0 : n._$AD) === i) this._$AH.p(t);
567
+ const { values: t, _$litType$: s } = e, i = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = O.createElement(le(s.h, s.h[0]), this.options)), s);
568
+ if (this._$AH?._$AD === i) this._$AH.p(t);
588
569
  else {
589
- const r = new Ce(i, this), a = r.u(this.options);
590
- r.p(t), this.T(a), this._$AH = r;
570
+ const r = new xe(i, this), n = r.u(this.options);
571
+ r.p(t), this.T(n), this._$AH = r;
591
572
  }
592
573
  }
593
574
  _$AC(e) {
594
- let t = se.get(e.strings);
595
- return t === void 0 && se.set(e.strings, t = new H(e)), t;
575
+ let t = ee.get(e.strings);
576
+ return t === void 0 && ee.set(e.strings, t = new O(e)), t;
596
577
  }
597
578
  k(e) {
598
- F(this._$AH) || (this._$AH = [], this._$AR());
579
+ L(this._$AH) || (this._$AH = [], this._$AR());
599
580
  const t = this._$AH;
600
581
  let s, i = 0;
601
- for (const n of e) i === t.length ? t.push(s = new V(this.O(q()), this.O(q()), this, this.options)) : s = t[i], s._$AI(n), i++;
582
+ for (const r of e) i === t.length ? t.push(s = new q(this.O(I()), this.O(I()), this, this.options)) : s = t[i], s._$AI(r), i++;
602
583
  i < t.length && (this._$AR(s && s._$AB.nextSibling, i), t.length = i);
603
584
  }
604
585
  _$AR(e = this._$AA.nextSibling, t) {
605
- var s;
606
- for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, t); e && e !== this._$AB; ) {
607
- const i = e.nextSibling;
608
- e.remove(), e = i;
586
+ for (this._$AP?.(!1, !0, t); e !== this._$AB; ) {
587
+ const s = e.nextSibling;
588
+ e.remove(), e = s;
609
589
  }
610
590
  }
611
591
  setConnected(e) {
612
- var t;
613
- this._$AM === void 0 && (this._$Cv = e, (t = this._$AP) == null || t.call(this, e));
592
+ this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
614
593
  }
615
594
  }
616
- class z {
595
+ class j {
617
596
  get tagName() {
618
597
  return this.element.tagName;
619
598
  }
620
599
  get _$AU() {
621
600
  return this._$AM._$AU;
622
601
  }
623
- constructor(e, t, s, i, n) {
624
- this.type = 1, this._$AH = c, this._$AN = void 0, this.element = e, this.name = t, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = c;
602
+ constructor(e, t, s, i, r) {
603
+ this.type = 1, this._$AH = c, this._$AN = void 0, this.element = e, this.name = t, 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 = c;
625
604
  }
626
605
  _$AI(e, t = this, s, i) {
627
- const n = this.strings;
628
- let r = !1;
629
- if (n === void 0) e = S(this, e, t, 0), r = !M(e) || e !== this._$AH && e !== O, r && (this._$AH = e);
606
+ const r = this.strings;
607
+ let n = !1;
608
+ if (r === void 0) e = E(this, e, t, 0), n = !P(e) || e !== this._$AH && e !== U, n && (this._$AH = e);
630
609
  else {
631
610
  const a = e;
632
- let l, d;
633
- for (e = n[0], l = 0; l < n.length - 1; l++) d = S(this, a[s + l], t, l), d === O && (d = this._$AH[l]), r || (r = !M(d) || d !== this._$AH[l]), d === c ? e = c : e !== c && (e += (d ?? "") + n[l + 1]), this._$AH[l] = d;
611
+ let l, p;
612
+ for (e = r[0], l = 0; l < r.length - 1; l++) p = E(this, a[s + l], t, l), p === U && (p = this._$AH[l]), n ||= !P(p) || p !== this._$AH[l], p === c ? e = c : e !== c && (e += (p ?? "") + r[l + 1]), this._$AH[l] = p;
634
613
  }
635
- r && !i && this.j(e);
614
+ n && !i && this.j(e);
636
615
  }
637
616
  j(e) {
638
617
  e === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
639
618
  }
640
619
  }
641
- class Pe extends z {
620
+ class Ce extends j {
642
621
  constructor() {
643
622
  super(...arguments), this.type = 3;
644
623
  }
@@ -646,7 +625,7 @@ class Pe extends z {
646
625
  this.element[this.name] = e === c ? void 0 : e;
647
626
  }
648
627
  }
649
- class Ue extends z {
628
+ class Pe extends j {
650
629
  constructor() {
651
630
  super(...arguments), this.type = 4;
652
631
  }
@@ -654,18 +633,17 @@ class Ue extends z {
654
633
  this.element.toggleAttribute(this.name, !!e && e !== c);
655
634
  }
656
635
  }
657
- class Me extends z {
658
- constructor(e, t, s, i, n) {
659
- super(e, t, s, i, n), this.type = 5;
636
+ class Ue extends j {
637
+ constructor(e, t, s, i, r) {
638
+ super(e, t, s, i, r), this.type = 5;
660
639
  }
661
640
  _$AI(e, t = this) {
662
- if ((e = S(this, e, t, 0) ?? c) === O) return;
663
- const s = this._$AH, i = e === c && s !== c || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, n = e !== c && (s === c || i);
664
- i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, e), this._$AH = e;
641
+ if ((e = E(this, e, t, 0) ?? c) === U) return;
642
+ const s = this._$AH, i = e === c && s !== c || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, r = e !== c && (s === c || i);
643
+ i && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, e), this._$AH = e;
665
644
  }
666
645
  handleEvent(e) {
667
- var t;
668
- typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
646
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
669
647
  }
670
648
  }
671
649
  class Oe {
@@ -676,37 +654,35 @@ class Oe {
676
654
  return this._$AM._$AU;
677
655
  }
678
656
  _$AI(e) {
679
- S(this, e);
657
+ E(this, e);
680
658
  }
681
659
  }
682
- const D = U.litHtmlPolyfillSupport;
683
- D == null || D(H, V), (U.litHtmlVersions ?? (U.litHtmlVersions = [])).push("3.2.1");
660
+ const Me = B.litHtmlPolyfillSupport;
661
+ Me?.(O, q), (B.litHtmlVersions ??= []).push("3.3.1");
684
662
  /**
685
663
  * @license
686
664
  * Copyright 2018 Google LLC
687
665
  * SPDX-License-Identifier: BSD-3-Clause
688
666
  */
689
- const He = (o) => o ?? c;
690
- var Re = Object.defineProperty, R = (o, e, t, s) => {
691
- for (var i = void 0, n = o.length - 1, r; n >= 0; n--)
692
- (r = o[n]) && (i = r(e, t, i) || i);
693
- return i && Re(e, t, i), i;
667
+ const Ne = (o) => o ?? c;
668
+ var He = Object.defineProperty, M = (o, e, t, s) => {
669
+ for (var i = void 0, r = o.length - 1, n; r >= 0; r--)
670
+ (n = o[r]) && (i = n(e, t, i) || i);
671
+ return i && He(e, t, i), i;
694
672
  };
695
- class E extends ie {
673
+ class b extends te {
696
674
  constructor() {
697
675
  super(...arguments), this.disabled = !1, this.selected = !1, this.value = "", this.label = "", this.hidden = !1;
698
676
  }
699
677
  firstUpdated() {
700
- var t;
701
- const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector("slot");
678
+ const e = this.shadowRoot?.querySelector("slot");
702
679
  e && e.addEventListener("slotchange", () => {
703
- var i;
704
- const s = e.assignedNodes({ flatten: !0 });
705
- s.length > 0 && (this.label = ((i = s[0].textContent) == null ? void 0 : i.trim()) || "");
680
+ const t = e.assignedNodes({ flatten: !0 });
681
+ t.length > 0 && (this.label = t[0].textContent?.trim() || "");
706
682
  });
707
683
  }
708
684
  render() {
709
- return re`
685
+ return se`
710
686
  <option
711
687
  ?disabled=${this.disabled}
712
688
  ?selected=${this.selected}
@@ -719,33 +695,33 @@ class E extends ie {
719
695
  `;
720
696
  }
721
697
  }
722
- R([
723
- p({ type: Boolean, reflect: !0 })
724
- ], E.prototype, "disabled");
725
- R([
726
- p({ type: Boolean, reflect: !0 })
727
- ], E.prototype, "selected");
728
- R([
729
- p({ type: String })
730
- ], E.prototype, "value");
731
- R([
732
- p({ type: String })
733
- ], E.prototype, "label");
734
- R([
735
- p({ type: Boolean, reflect: !0 })
736
- ], E.prototype, "hidden");
737
- customElements.define("nys-option", E);
738
- var Ne = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, _ = (o, e, t, s) => {
739
- for (var i = s > 1 ? void 0 : s ? Te(e, t) : e, n = o.length - 1, r; n >= 0; n--)
740
- (r = o[n]) && (i = (s ? r(e, t, i) : r(i)) || i);
741
- return s && i && Ne(e, t, i), i;
698
+ M([
699
+ d({ type: Boolean, reflect: !0 })
700
+ ], b.prototype, "disabled");
701
+ M([
702
+ d({ type: Boolean, reflect: !0 })
703
+ ], b.prototype, "selected");
704
+ M([
705
+ d({ type: String })
706
+ ], b.prototype, "value");
707
+ M([
708
+ d({ type: String })
709
+ ], b.prototype, "label");
710
+ M([
711
+ d({ type: Boolean, reflect: !0 })
712
+ ], b.prototype, "hidden");
713
+ customElements.define("nys-option", b);
714
+ var Re = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, _ = (o, e, t, s) => {
715
+ for (var i = s > 1 ? void 0 : s ? Te(e, t) : e, r = o.length - 1, n; r >= 0; r--)
716
+ (n = o[r]) && (i = (s ? n(e, t, i) : n(i)) || i);
717
+ return s && i && Re(e, t, i), i;
742
718
  };
743
719
  let Ie = 0;
744
720
  var v;
745
- const y = (v = class extends ie {
721
+ const y = (v = class extends te {
746
722
  // allows use of elementInternals' API
747
723
  constructor() {
748
- super(), this.id = "", this.name = "", this.label = "", this.description = "", this.value = "", this.disabled = !1, this.required = !1, this.optional = !1, this._tooltip = "", this.form = null, this.showError = !1, this.errorMessage = "", this._width = "md", this._hasUserInteracted = !1, this._internals = this.attachInternals();
724
+ super(), this.id = "", this.name = "", this.label = "", this.description = "", this.value = "", this.disabled = !1, this.required = !1, this.optional = !1, this._tooltip = "", this.form = null, this.inverted = !1, this.showError = !1, this.errorMessage = "", this._width = "full", this._hasUserInteracted = !1, this._internals = this.attachInternals();
749
725
  }
750
726
  get width() {
751
727
  return this._width;
@@ -770,16 +746,35 @@ const y = (v = class extends ie {
770
746
  this.value = "";
771
747
  }
772
748
  _handleSlotChange() {
773
- var i, n;
774
- const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(
749
+ const e = this.shadowRoot?.querySelector(
775
750
  'slot:not([name="description"])'
776
- ), t = (n = this.shadowRoot) == null ? void 0 : n.querySelector("select");
751
+ ), t = this.shadowRoot?.querySelector("select");
777
752
  if (!e || !t) return;
778
- t.querySelectorAll("option:not([hidden])").forEach((r) => r.remove()), e.assignedElements({ flatten: !0 }).forEach((r) => {
779
- var a;
780
- if (r instanceof E) {
781
- const l = document.createElement("option");
782
- l.value = r.value, l.textContent = r.label || ((a = r.textContent) == null ? void 0 : a.trim()) || "", l.disabled = r.disabled, l.selected = r.selected, t.appendChild(l);
753
+ Array.from(t.children).forEach((i) => {
754
+ i.hasAttribute("data-native") || i.remove();
755
+ }), e.assignedElements({ flatten: !0 }).forEach((i) => {
756
+ if (i instanceof b) {
757
+ const r = document.createElement("option");
758
+ r.value = i.value, r.textContent = i.label || i.textContent?.trim() || "", r.disabled = i.disabled, r.selected = i.selected, t.appendChild(r);
759
+ return;
760
+ }
761
+ if (i.tagName === "OPTION") {
762
+ const r = i.cloneNode(!0);
763
+ r.setAttribute("data-native", "true"), t.appendChild(r);
764
+ return;
765
+ }
766
+ if (i.tagName === "OPTGROUP") {
767
+ const r = document.createElement("optgroup");
768
+ r.label = i.label, i.disabled && (r.disabled = !0), Array.from(i.children).forEach((n) => {
769
+ if (n instanceof b) {
770
+ const a = document.createElement("option");
771
+ a.value = n.value, a.textContent = n.label || n.textContent?.trim() || "", a.disabled = n.disabled, a.selected = n.selected, r.appendChild(a);
772
+ } else if (n.tagName === "OPTION") {
773
+ const a = n.cloneNode(!0);
774
+ r.appendChild(a);
775
+ }
776
+ }), t.appendChild(r);
777
+ return;
783
778
  }
784
779
  });
785
780
  }
@@ -788,24 +783,21 @@ const y = (v = class extends ie {
788
783
  this._internals.setFormValue(this.value), this._manageRequire();
789
784
  }
790
785
  _manageRequire() {
791
- var i;
792
- const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector("select");
786
+ const e = this.shadowRoot?.querySelector("select");
793
787
  if (!e) return;
794
788
  const t = this.errorMessage || "Please select an option.";
795
789
  this.required && !this.value ? (this._internals.ariaRequired = "true", this._internals.setValidity({ valueMissing: !0 }, t, e)) : (this._internals.ariaRequired = "false", this._internals.setValidity({}), this._hasUserInteracted = !1);
796
790
  }
797
791
  _setValidityMessage(e = "") {
798
- var s, i;
799
- const t = (s = this.shadowRoot) == null ? void 0 : s.querySelector("select");
800
- t && (this.showError = !!e, (i = this.errorMessage) != null && i.trim() && e !== "" && (e = this.errorMessage), this._internals.setValidity(
792
+ const t = this.shadowRoot?.querySelector("select");
793
+ t && (this.showError = !!e, this.errorMessage?.trim() && e !== "" && (e = this.errorMessage), this._internals.setValidity(
801
794
  e ? { customError: !0 } : {},
802
795
  e,
803
796
  t
804
797
  ));
805
798
  }
806
799
  _validate() {
807
- var s;
808
- const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector("select");
800
+ const e = this.shadowRoot?.querySelector("select");
809
801
  if (!e) return;
810
802
  let t = e.validationMessage;
811
803
  this._manageRequire(), this._setValidityMessage(t);
@@ -813,18 +805,16 @@ const y = (v = class extends ie {
813
805
  /********************** Functions **********************/
814
806
  // This helper function is called to perform the element's native validation.
815
807
  checkValidity() {
816
- var t;
817
- const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector("select");
808
+ const e = this.shadowRoot?.querySelector("select");
818
809
  return e ? e.checkValidity() : !0;
819
810
  }
820
811
  _handleInvalid(e) {
821
- var s;
822
812
  e.preventDefault(), this._hasUserInteracted = !0, this._validate(), this.showError = !0;
823
- const t = (s = this.shadowRoot) == null ? void 0 : s.querySelector("select");
813
+ const t = this.shadowRoot?.querySelector("select");
824
814
  if (t) {
825
- const i = this._internals.form;
826
- i ? Array.from(i.elements).find(
827
- (a) => typeof a.checkValidity == "function" && !a.checkValidity()
815
+ const s = this._internals.form;
816
+ s ? Array.from(s.elements).find(
817
+ (n) => typeof n.checkValidity == "function" && !n.checkValidity()
828
818
  ) === this && t.focus() : t.focus();
829
819
  }
830
820
  }
@@ -850,14 +840,13 @@ const y = (v = class extends ie {
850
840
  }
851
841
  // Check if the current value matches any option, and if so, set it as selected
852
842
  updated(e) {
853
- var t;
854
843
  if (super.updated(e), e.has("value")) {
855
- const s = (t = this.shadowRoot) == null ? void 0 : t.querySelector("select");
856
- s && (s.value = this.value);
844
+ const t = this.shadowRoot?.querySelector("select");
845
+ t && (t.value = this.value);
857
846
  }
858
847
  }
859
848
  render() {
860
- return re`
849
+ return se`
861
850
  <div class="nys-select">
862
851
  <nys-label
863
852
  for=${this.id}
@@ -865,6 +854,7 @@ const y = (v = class extends ie {
865
854
  description=${this.description}
866
855
  flag=${this.required ? "required" : this.optional ? "optional" : ""}
867
856
  _tooltip=${this._tooltip}
857
+ ?inverted=${this.inverted}
868
858
  >
869
859
  <slot name="description" slot="description">${this.description}</slot>
870
860
  </nys-label>
@@ -873,7 +863,7 @@ const y = (v = class extends ie {
873
863
  class="nys-select__select"
874
864
  name=${this.name}
875
865
  id=${this.id}
876
- form=${He(this.form || void 0)}
866
+ form=${Ne(this.form || void 0)}
877
867
  ?disabled=${this.disabled}
878
868
  ?required=${this.required}
879
869
  aria-disabled="${this.disabled}"
@@ -902,50 +892,53 @@ const y = (v = class extends ie {
902
892
  </div>
903
893
  `;
904
894
  }
905
- }, v.VALID_WIDTHS = ["sm", "md", "lg", "full"], v.styles = we, v.formAssociated = !0, v);
895
+ }, v.VALID_WIDTHS = ["sm", "md", "lg", "full"], v.styles = Ae, v.formAssociated = !0, v);
906
896
  _([
907
- p({ type: String })
897
+ d({ type: String })
908
898
  ], y.prototype, "id", 2);
909
899
  _([
910
- p({ type: String, reflect: !0 })
900
+ d({ type: String, reflect: !0 })
911
901
  ], y.prototype, "name", 2);
912
902
  _([
913
- p({ type: String })
903
+ d({ type: String })
914
904
  ], y.prototype, "label", 2);
915
905
  _([
916
- p({ type: String })
906
+ d({ type: String })
917
907
  ], y.prototype, "description", 2);
918
908
  _([
919
- p({ type: String })
909
+ d({ type: String })
920
910
  ], y.prototype, "value", 2);
921
911
  _([
922
- p({ type: Boolean, reflect: !0 })
912
+ d({ type: Boolean, reflect: !0 })
923
913
  ], y.prototype, "disabled", 2);
924
914
  _([
925
- p({ type: Boolean, reflect: !0 })
915
+ d({ type: Boolean, reflect: !0 })
926
916
  ], y.prototype, "required", 2);
927
917
  _([
928
- p({ type: Boolean, reflect: !0 })
918
+ d({ type: Boolean, reflect: !0 })
929
919
  ], y.prototype, "optional", 2);
930
920
  _([
931
- p({ type: String })
921
+ d({ type: String })
932
922
  ], y.prototype, "_tooltip", 2);
933
923
  _([
934
- p({ type: String, reflect: !0 })
924
+ d({ type: String, reflect: !0 })
935
925
  ], y.prototype, "form", 2);
936
926
  _([
937
- p({ type: Boolean, reflect: !0 })
927
+ d({ type: Boolean, reflect: !0 })
928
+ ], y.prototype, "inverted", 2);
929
+ _([
930
+ d({ type: Boolean, reflect: !0 })
938
931
  ], y.prototype, "showError", 2);
939
932
  _([
940
- p({ type: String })
933
+ d({ type: String })
941
934
  ], y.prototype, "errorMessage", 2);
942
935
  _([
943
- p({ reflect: !0 })
936
+ d({ reflect: !0 })
944
937
  ], y.prototype, "width", 1);
945
938
  let ke = y;
946
939
  customElements.get("nys-select") || customElements.define("nys-select", ke);
947
940
  export {
948
- E as NysOption,
941
+ b as NysOption,
949
942
  ke as NysSelect
950
943
  };
951
944
  //# sourceMappingURL=nys-select.js.map