@nysds/nys-fileinput 1.10.1 → 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 oe, LitElement as ne, html as y } from "lit";
1
+ import { css as se, LitElement as re, html as y } from "lit";
2
2
  /*!
3
3
  * ▒█▄░▒█ ▒█░░▒█ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█
4
4
  * ▒█▒█▒█ ▒█▄▄▄█ ░▀▀▀▄▄ ▒█░▒█ ░▀▀▀▄▄
@@ -14,18 +14,18 @@ import { css as oe, LitElement as ne, html as y } from "lit";
14
14
  * Copyright 2019 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- const z = globalThis, j = z.ShadowRoot && (z.ShadyCSS === void 0 || z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, le = Symbol(), J = /* @__PURE__ */ new WeakMap();
18
- let pe = class {
17
+ const D = globalThis, L = D.ShadowRoot && (D.ShadyCSS === void 0 || D.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, oe = Symbol(), Y = /* @__PURE__ */ new WeakMap();
18
+ let de = class {
19
19
  constructor(e, t, i) {
20
- if (this._$cssResult$ = !0, i !== le) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
20
+ if (this._$cssResult$ = !0, i !== oe) 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 (L && e === void 0) {
27
27
  const i = t !== void 0 && t.length === 1;
28
- i && (e = J.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && J.set(t, e));
28
+ i && (e = Y.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && Y.set(t, e));
29
29
  }
30
30
  return e;
31
31
  }
@@ -33,26 +33,26 @@ let pe = class {
33
33
  return this.cssText;
34
34
  }
35
35
  };
36
- const ue = (o) => new pe(typeof o == "string" ? o : o + "", void 0, le), fe = (o, e) => {
37
- if (j) o.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
36
+ const ce = (o) => new de(typeof o == "string" ? o : o + "", void 0, oe), pe = (o, e) => {
37
+ if (L) o.adoptedStyleSheets = e.map(((t) => t instanceof CSSStyleSheet ? t : t.styleSheet));
38
38
  else for (const t of e) {
39
- const i = document.createElement("style"), s = z.litNonce;
39
+ const i = document.createElement("style"), s = D.litNonce;
40
40
  s !== void 0 && i.setAttribute("nonce", s), i.textContent = t.cssText, o.appendChild(i);
41
41
  }
42
- }, K = j ? (o) => o : (o) => o instanceof CSSStyleSheet ? ((e) => {
42
+ }, G = L ? (o) => o : (o) => o instanceof CSSStyleSheet ? ((e) => {
43
43
  let t = "";
44
44
  for (const i of e.cssRules) t += i.cssText;
45
- return ue(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: _e, defineProperty: ye, getOwnPropertyDescriptor: ge, getOwnPropertyNames: me, getOwnPropertySymbols: ve, getPrototypeOf: $e } = Object, $ = globalThis, Z = $.trustedTypes, be = Z ? Z.emptyScript : "", I = $.reactiveElementPolyfillSupport, P = (o, e) => o, R = { toAttribute(o, e) {
52
+ const { is: ue, defineProperty: fe, getOwnPropertyDescriptor: _e, getOwnPropertyNames: ye, getOwnPropertySymbols: ge, getPrototypeOf: me } = Object, q = globalThis, J = q.trustedTypes, ve = J ? J.emptyScript : "", $e = q.reactiveElementPolyfillSupport, C = (o, e) => o, U = { toAttribute(o, e) {
53
53
  switch (e) {
54
54
  case Boolean:
55
- o = o ? be : null;
55
+ o = o ? ve : null;
56
56
  break;
57
57
  case Object:
58
58
  case Array:
@@ -77,46 +77,44 @@ const { is: _e, defineProperty: ye, getOwnPropertyDescriptor: ge, getOwnProperty
77
77
  }
78
78
  }
79
79
  return t;
80
- } }, W = (o, e) => !_e(o, e), Q = { attribute: !0, type: String, converter: R, reflect: !1, hasChanged: W };
81
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), $.litPropertyMetadata ?? ($.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
82
- class x extends HTMLElement {
80
+ } }, B = (o, e) => !ue(o, e), K = { attribute: !0, type: String, converter: U, reflect: !1, useDefault: !1, hasChanged: B };
81
+ Symbol.metadata ??= Symbol("metadata"), q.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 = Q) {
90
- if (t.state && (t.attribute = !1), this._$Ei(), this.elementProperties.set(e, t), !t.noAccessor) {
89
+ static createProperty(e, t = K) {
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 i = Symbol(), s = this.getPropertyDescriptor(e, i, t);
92
- s !== void 0 && ye(this.prototype, e, s);
92
+ s !== void 0 && fe(this.prototype, e, s);
93
93
  }
94
94
  }
95
95
  static getPropertyDescriptor(e, t, i) {
96
- const { get: s, set: r } = ge(this.prototype, e) ?? { get() {
96
+ const { get: s, set: r } = _e(this.prototype, e) ?? { get() {
97
97
  return this[t];
98
98
  }, set(n) {
99
99
  this[t] = n;
100
100
  } };
101
- return { get() {
102
- return s == null ? void 0 : s.call(this);
103
- }, set(n) {
104
- const a = s == null ? void 0 : s.call(this);
105
- r.call(this, n), this.requestUpdate(e, a, i);
101
+ return { get: s, set(n) {
102
+ const a = s?.call(this);
103
+ r?.call(this, n), this.requestUpdate(e, a, i);
106
104
  }, configurable: !0, enumerable: !0 };
107
105
  }
108
106
  static getPropertyOptions(e) {
109
- return this.elementProperties.get(e) ?? Q;
107
+ return this.elementProperties.get(e) ?? K;
110
108
  }
111
109
  static _$Ei() {
112
- if (this.hasOwnProperty(P("elementProperties"))) return;
113
- const e = $e(this);
110
+ if (this.hasOwnProperty(C("elementProperties"))) return;
111
+ const e = me(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, i = [...me(t), ...ve(t)];
115
+ if (this.hasOwnProperty(C("finalized"))) return;
116
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(C("properties"))) {
117
+ const t = this.properties, i = [...ye(t), ...ge(t)];
120
118
  for (const s of i) this.createProperty(s, t[s]);
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 i = new Set(e.flat(1 / 0).reverse());
138
- for (const s of i) t.unshift(K(s));
139
- } else e !== void 0 && t.push(K(e));
136
+ for (const s of i) t.unshift(G(s));
137
+ } else e !== void 0 && t.push(G(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 fe(e, this.constructor.elementStyles), e;
163
+ return pe(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 i;
174
- return (i = t.hostConnected) == null ? void 0 : i.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 i;
183
- return (i = t.hostDisconnected) == null ? void 0 : i.call(t);
184
- });
171
+ this._$EO?.forEach(((e) => e.hostDisconnected?.()));
185
172
  }
186
173
  attributeChangedCallback(e, t, i) {
187
174
  this._$AK(e, i);
188
175
  }
189
- _$EC(e, t) {
190
- var r;
176
+ _$ET(e, t) {
191
177
  const i = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, i);
192
178
  if (s !== void 0 && i.reflect === !0) {
193
- const n = (((r = i.converter) == null ? void 0 : r.toAttribute) !== void 0 ? i.converter : R).toAttribute(t, i.type);
194
- this._$Em = e, n == null ? this.removeAttribute(s) : this.setAttribute(s, n), this._$Em = null;
179
+ const r = (i.converter?.toAttribute !== void 0 ? i.converter : U).toAttribute(t, i.type);
180
+ this._$Em = e, r == null ? this.removeAttribute(s) : this.setAttribute(s, r), this._$Em = null;
195
181
  }
196
182
  }
197
183
  _$AK(e, t) {
198
- var r;
199
184
  const i = this.constructor, s = i._$Eh.get(e);
200
185
  if (s !== void 0 && this._$Em !== s) {
201
- const n = i.getPropertyOptions(s), a = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((r = n.converter) == null ? void 0 : r.fromAttribute) !== void 0 ? n.converter : R;
202
- this._$Em = s, this[s] = a.fromAttribute(t, n.type), this._$Em = null;
186
+ const r = i.getPropertyOptions(s), n = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute !== void 0 ? r.converter : U;
187
+ this._$Em = s;
188
+ const a = n.fromAttribute(t, r.type);
189
+ this[s] = a ?? this._$Ej?.get(s) ?? a, this._$Em = null;
203
190
  }
204
191
  }
205
192
  requestUpdate(e, t, i) {
206
193
  if (e !== void 0) {
207
- if (i ?? (i = this.constructor.getPropertyOptions(e)), !(i.hasChanged ?? W)(this[e], t)) return;
208
- this.P(e, t, i);
194
+ const s = this.constructor, r = this[e];
195
+ if (i ??= s.getPropertyOptions(e), !((i.hasChanged ?? B)(r, t) || i.useDefault && i.reflect && r === this._$Ej?.get(e) && !this.hasAttribute(s._$Eu(e, i)))) return;
196
+ this.C(e, t, i);
209
197
  }
210
- this.isUpdatePending === !1 && (this._$ES = this._$ET());
198
+ this.isUpdatePending === !1 && (this._$ES = this._$EP());
211
199
  }
212
- P(e, t, i) {
213
- this._$AL.has(e) || this._$AL.set(e, t), i.reflect === !0 && this._$Em !== e && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(e);
200
+ C(e, t, { useDefault: i, reflect: s, wrapped: r }, n) {
201
+ i && !(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 || i || (t = void 0), this._$AL.set(e, t)), s === !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 i;
230
217
  if (!this.isUpdatePending) return;
231
218
  if (!this.hasUpdated) {
232
- if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
233
- for (const [r, n] of this._$Ep) this[r] = n;
219
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
220
+ for (const [s, r] of this._$Ep) this[s] = r;
234
221
  this._$Ep = void 0;
235
222
  }
236
- const s = this.constructor.elementProperties;
237
- if (s.size > 0) for (const [r, n] of s) n.wrapped !== !0 || this._$AL.has(r) || this[r] === void 0 || this.P(r, this[r], n);
223
+ const i = this.constructor.elementProperties;
224
+ if (i.size > 0) for (const [s, r] of i) {
225
+ const { wrapped: n } = r, a = this[s];
226
+ n !== !0 || this._$AL.has(s) || a === void 0 || this.C(s, 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), (i = this._$EO) == null || i.forEach((s) => {
243
- var r;
244
- return (r = s.hostUpdate) == null ? void 0 : r.call(s);
245
- }), this.update(t)) : this._$EU();
246
- } catch (s) {
247
- throw e = !1, this._$EU(), s;
232
+ e = this.shouldUpdate(t), e ? (this.willUpdate(t), this._$EO?.forEach(((i) => i.hostUpdate?.())), this.update(t)) : this._$EM();
233
+ } catch (i) {
234
+ throw e = !1, this._$EM(), i;
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((i) => {
256
- var s;
257
- return (s = i.hostUpdated) == null ? void 0 : s.call(i);
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,29 +253,29 @@ 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(), I == null || I({ ReactiveElement: x }), ($.reactiveElementVersions ?? ($.reactiveElementVersions = [])).push("2.0.4");
263
+ S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[C("elementProperties")] = /* @__PURE__ */ new Map(), S[C("finalized")] = /* @__PURE__ */ new Map(), $e?.({ ReactiveElement: S }), (q.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 Ae = { attribute: !0, type: String, converter: R, reflect: !1, hasChanged: W }, we = (o = Ae, e, t) => {
269
+ const be = { attribute: !0, type: String, converter: U, reflect: !1, hasChanged: B }, Ae = (o = be, e, t) => {
287
270
  const { kind: i, metadata: s } = t;
288
271
  let r = globalThis.litPropertyMetadata.get(s);
289
- if (r === void 0 && globalThis.litPropertyMetadata.set(s, r = /* @__PURE__ */ new Map()), r.set(t.name, o), i === "accessor") {
272
+ if (r === void 0 && globalThis.litPropertyMetadata.set(s, r = /* @__PURE__ */ new Map()), i === "setter" && ((o = Object.create(o)).wrapped = !0), r.set(t.name, o), i === "accessor") {
290
273
  const { name: n } = t;
291
274
  return { set(a) {
292
275
  const l = e.get.call(this);
293
276
  e.set.call(this, a), this.requestUpdate(n, l, o);
294
277
  }, init(a) {
295
- return a !== void 0 && this.P(n, void 0, o), a;
278
+ return a !== void 0 && this.C(n, void 0, o, a), a;
296
279
  } };
297
280
  }
298
281
  if (i === "setter") {
@@ -305,9 +288,9 @@ const Ae = { attribute: !0, type: String, converter: R, reflect: !1, hasChanged:
305
288
  throw Error("Unsupported decorator location: " + i);
306
289
  };
307
290
  function d(o) {
308
- return (e, t) => typeof t == "object" ? we(o, e, t) : ((i, s, r) => {
291
+ return (e, t) => typeof t == "object" ? Ae(o, e, t) : ((i, s, r) => {
309
292
  const n = s.hasOwnProperty(r);
310
- return s.constructor.createProperty(r, n ? { ...i, wrapped: !0 } : i), n ? Object.getOwnPropertyDescriptor(s, r) : void 0;
293
+ return s.constructor.createProperty(r, i), n ? Object.getOwnPropertyDescriptor(s, r) : void 0;
311
294
  })(o, e, t);
312
295
  }
313
296
  /**
@@ -315,50 +298,50 @@ function d(o) {
315
298
  * Copyright 2017 Google LLC
316
299
  * SPDX-License-Identifier: BSD-3-Clause
317
300
  */
318
- const k = globalThis, O = k.trustedTypes, X = O ? O.createPolicy("lit-html", { createHTML: (o) => o }) : void 0, ae = "$lit$", v = `lit$${Math.random().toFixed(9).slice(2)}$`, he = "?" + v, Ee = `<${he}>`, w = document, H = () => w.createComment(""), F = (o) => o === null || typeof o != "object" && typeof o != "function", Y = Array.isArray, Se = (o) => Y(o) || typeof (o == null ? void 0 : o[Symbol.iterator]) == "function", B = `[
319
- \f\r]`, C = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ee = /-->/g, te = />/g, b = RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
320
- \f\r"'\`<>=]|("|')|))|$)`, "g"), ie = /'/g, se = /"/g, de = /^(?:script|style|textarea|title)$/i, M = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), re = /* @__PURE__ */ new WeakMap(), A = w.createTreeWalker(w, 129);
321
- function ce(o, e) {
322
- if (!Y(o) || !o.hasOwnProperty("raw")) throw Error("invalid template strings array");
323
- return X !== void 0 ? X.createHTML(e) : e;
301
+ const j = globalThis, z = j.trustedTypes, Z = z ? z.createPolicy("lit-html", { createHTML: (o) => o }) : void 0, ne = "$lit$", v = `lit$${Math.random().toFixed(9).slice(2)}$`, le = "?" + v, we = `<${le}>`, A = document, R = () => A.createComment(""), P = (o) => o === null || typeof o != "object" && typeof o != "function", V = Array.isArray, Ee = (o) => V(o) || typeof o?.[Symbol.iterator] == "function", I = `[
302
+ \f\r]`, x = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Q = /-->/g, X = />/g, $ = RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^
303
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), ee = /'/g, te = /"/g, ae = /^(?:script|style|textarea|title)$/i, k = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), ie = /* @__PURE__ */ new WeakMap(), b = A.createTreeWalker(A, 129);
304
+ function he(o, e) {
305
+ if (!V(o) || !o.hasOwnProperty("raw")) throw Error("invalid template strings array");
306
+ return Z !== void 0 ? Z.createHTML(e) : e;
324
307
  }
325
- const xe = (o, e) => {
308
+ const Se = (o, e) => {
326
309
  const t = o.length - 1, i = [];
327
- let s, r = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = C;
310
+ let s, r = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = x;
328
311
  for (let a = 0; a < t; a++) {
329
312
  const l = o[a];
330
313
  let u, f, h = -1, g = 0;
331
- for (; g < l.length && (n.lastIndex = g, f = n.exec(l), f !== null); ) g = n.lastIndex, n === C ? f[1] === "!--" ? n = ee : f[1] !== void 0 ? n = te : f[2] !== void 0 ? (de.test(f[2]) && (s = RegExp("</" + f[2], "g")), n = b) : f[3] !== void 0 && (n = b) : n === b ? f[0] === ">" ? (n = s ?? C, h = -1) : f[1] === void 0 ? h = -2 : (h = n.lastIndex - f[2].length, u = f[1], n = f[3] === void 0 ? b : f[3] === '"' ? se : ie) : n === se || n === ie ? n = b : n === ee || n === te ? n = C : (n = b, s = void 0);
332
- const m = n === b && o[a + 1].startsWith("/>") ? " " : "";
333
- r += n === C ? l + Ee : h >= 0 ? (i.push(u), l.slice(0, h) + ae + l.slice(h) + v + m) : l + v + (h === -2 ? a : m);
314
+ for (; g < l.length && (n.lastIndex = g, f = n.exec(l), f !== null); ) g = n.lastIndex, n === x ? f[1] === "!--" ? n = Q : f[1] !== void 0 ? n = X : f[2] !== void 0 ? (ae.test(f[2]) && (s = RegExp("</" + f[2], "g")), n = $) : f[3] !== void 0 && (n = $) : n === $ ? f[0] === ">" ? (n = s ?? x, h = -1) : f[1] === void 0 ? h = -2 : (h = n.lastIndex - f[2].length, u = f[1], n = f[3] === void 0 ? $ : f[3] === '"' ? te : ee) : n === te || n === ee ? n = $ : n === Q || n === X ? n = x : (n = $, s = void 0);
315
+ const m = n === $ && o[a + 1].startsWith("/>") ? " " : "";
316
+ r += n === x ? l + we : h >= 0 ? (i.push(u), l.slice(0, h) + ne + l.slice(h) + v + m) : l + v + (h === -2 ? a : m);
334
317
  }
335
- return [ce(o, r + (o[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
318
+ return [he(o, r + (o[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
336
319
  };
337
- class U {
320
+ class F {
338
321
  constructor({ strings: e, _$litType$: t }, i) {
339
322
  let s;
340
323
  this.parts = [];
341
324
  let r = 0, n = 0;
342
- const a = e.length - 1, l = this.parts, [u, f] = xe(e, t);
343
- if (this.el = U.createElement(u, i), A.currentNode = this.el.content, t === 2 || t === 3) {
325
+ const a = e.length - 1, l = this.parts, [u, f] = Se(e, t);
326
+ if (this.el = F.createElement(u, i), b.currentNode = this.el.content, t === 2 || t === 3) {
344
327
  const h = this.el.content.firstChild;
345
328
  h.replaceWith(...h.childNodes);
346
329
  }
347
- for (; (s = A.nextNode()) !== null && l.length < a; ) {
330
+ for (; (s = b.nextNode()) !== null && l.length < a; ) {
348
331
  if (s.nodeType === 1) {
349
- if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(ae)) {
350
- const g = f[n++], m = s.getAttribute(h).split(v), D = /([.?@])?(.*)/.exec(g);
351
- l.push({ type: 1, index: r, name: D[2], strings: m, ctor: D[1] === "." ? Pe : D[1] === "?" ? ke : D[1] === "@" ? Fe : N }), s.removeAttribute(h);
332
+ if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(ne)) {
333
+ const g = f[n++], m = s.getAttribute(h).split(v), M = /([.?@])?(.*)/.exec(g);
334
+ l.push({ type: 1, index: r, name: M[2], strings: m, ctor: M[1] === "." ? Ce : M[1] === "?" ? Pe : M[1] === "@" ? ke : T }), s.removeAttribute(h);
352
335
  } else h.startsWith(v) && (l.push({ type: 6, index: r }), s.removeAttribute(h));
353
- if (de.test(s.tagName)) {
336
+ if (ae.test(s.tagName)) {
354
337
  const h = s.textContent.split(v), g = h.length - 1;
355
338
  if (g > 0) {
356
- s.textContent = O ? O.emptyScript : "";
357
- for (let m = 0; m < g; m++) s.append(h[m], H()), A.nextNode(), l.push({ type: 2, index: ++r });
358
- s.append(h[g], H());
339
+ s.textContent = z ? z.emptyScript : "";
340
+ for (let m = 0; m < g; m++) s.append(h[m], R()), b.nextNode(), l.push({ type: 2, index: ++r });
341
+ s.append(h[g], R());
359
342
  }
360
343
  }
361
- } else if (s.nodeType === 8) if (s.data === he) l.push({ type: 2, index: r });
344
+ } else if (s.nodeType === 8) if (s.data === le) l.push({ type: 2, index: r });
362
345
  else {
363
346
  let h = -1;
364
347
  for (; (h = s.data.indexOf(v, h + 1)) !== -1; ) l.push({ type: 7, index: r }), h += v.length - 1;
@@ -367,18 +350,17 @@ class U {
367
350
  }
368
351
  }
369
352
  static createElement(e, t) {
370
- const i = w.createElement("template");
353
+ const i = A.createElement("template");
371
354
  return i.innerHTML = e, i;
372
355
  }
373
356
  }
374
- function S(o, e, t = o, i) {
375
- var n, a;
376
- if (e === M) return e;
377
- let s = i !== void 0 ? (n = t._$Co) == null ? void 0 : n[i] : t._$Cl;
378
- const r = F(e) ? void 0 : e._$litDirective$;
379
- return (s == null ? void 0 : s.constructor) !== r && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), r === void 0 ? s = void 0 : (s = new r(o), s._$AT(o, t, i)), i !== void 0 ? (t._$Co ?? (t._$Co = []))[i] = s : t._$Cl = s), s !== void 0 && (e = S(o, s._$AS(o, e.values), s, i)), e;
357
+ function E(o, e, t = o, i) {
358
+ if (e === k) return e;
359
+ let s = i !== void 0 ? t._$Co?.[i] : t._$Cl;
360
+ const r = P(e) ? void 0 : e._$litDirective$;
361
+ return s?.constructor !== r && (s?._$AO?.(!1), r === void 0 ? s = void 0 : (s = new r(o), s._$AT(o, t, i)), i !== void 0 ? (t._$Co ??= [])[i] = s : t._$Cl = s), s !== void 0 && (e = E(o, s._$AS(o, e.values), s, i)), e;
380
362
  }
381
- class Ce {
363
+ class xe {
382
364
  constructor(e, t) {
383
365
  this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
384
366
  }
@@ -389,35 +371,34 @@ class Ce {
389
371
  return this._$AM._$AU;
390
372
  }
391
373
  u(e) {
392
- const { el: { content: t }, parts: i } = this._$AD, s = ((e == null ? void 0 : e.creationScope) ?? w).importNode(t, !0);
393
- A.currentNode = s;
394
- let r = A.nextNode(), n = 0, a = 0, l = i[0];
374
+ const { el: { content: t }, parts: i } = this._$AD, s = (e?.creationScope ?? A).importNode(t, !0);
375
+ b.currentNode = s;
376
+ let r = b.nextNode(), n = 0, a = 0, l = i[0];
395
377
  for (; l !== void 0; ) {
396
378
  if (n === l.index) {
397
379
  let u;
398
- l.type === 2 ? u = new q(r, r.nextSibling, this, e) : l.type === 1 ? u = new l.ctor(r, l.name, l.strings, this, e) : l.type === 6 && (u = new Me(r, this, e)), this._$AV.push(u), l = i[++a];
380
+ l.type === 2 ? u = new H(r, r.nextSibling, this, e) : l.type === 1 ? u = new l.ctor(r, l.name, l.strings, this, e) : l.type === 6 && (u = new Fe(r, this, e)), this._$AV.push(u), l = i[++a];
399
381
  }
400
- n !== (l == null ? void 0 : l.index) && (r = A.nextNode(), n++);
382
+ n !== l?.index && (r = b.nextNode(), n++);
401
383
  }
402
- return A.currentNode = w, s;
384
+ return b.currentNode = A, s;
403
385
  }
404
386
  p(e) {
405
387
  let t = 0;
406
388
  for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(e, i, t), t += i.strings.length - 2) : i._$AI(e[t])), t++;
407
389
  }
408
390
  }
409
- class q {
391
+ class H {
410
392
  get _$AU() {
411
- var e;
412
- return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
393
+ return this._$AM?._$AU ?? this._$Cv;
413
394
  }
414
395
  constructor(e, t, i, s) {
415
- this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
396
+ this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = s, this._$Cv = s?.isConnected ?? !0;
416
397
  }
417
398
  get parentNode() {
418
399
  let e = this._$AA.parentNode;
419
400
  const t = this._$AM;
420
- return t !== void 0 && (e == null ? void 0 : e.nodeType) === 11 && (e = t.parentNode), e;
401
+ return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
421
402
  }
422
403
  get startNode() {
423
404
  return this._$AA;
@@ -426,7 +407,7 @@ class q {
426
407
  return this._$AB;
427
408
  }
428
409
  _$AI(e, t = this) {
429
- e = S(this, e, t), F(e) ? e === c || e == null || e === "" ? (this._$AH !== c && this._$AR(), this._$AH = c) : e !== this._$AH && e !== M && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Se(e) ? this.k(e) : this._(e);
410
+ e = E(this, e, t), P(e) ? e === c || e == null || e === "" ? (this._$AH !== c && this._$AR(), this._$AH = c) : e !== this._$AH && e !== k && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ee(e) ? this.k(e) : this._(e);
430
411
  }
431
412
  O(e) {
432
413
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -435,41 +416,38 @@ class q {
435
416
  this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
436
417
  }
437
418
  _(e) {
438
- this._$AH !== c && F(this._$AH) ? this._$AA.nextSibling.data = e : this.T(w.createTextNode(e)), this._$AH = e;
419
+ this._$AH !== c && P(this._$AH) ? this._$AA.nextSibling.data = e : this.T(A.createTextNode(e)), this._$AH = e;
439
420
  }
440
421
  $(e) {
441
- var r;
442
- const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = U.createElement(ce(i.h, i.h[0]), this.options)), i);
443
- if (((r = this._$AH) == null ? void 0 : r._$AD) === s) this._$AH.p(t);
422
+ const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = F.createElement(he(i.h, i.h[0]), this.options)), i);
423
+ if (this._$AH?._$AD === s) this._$AH.p(t);
444
424
  else {
445
- const n = new Ce(s, this), a = n.u(this.options);
446
- n.p(t), this.T(a), this._$AH = n;
425
+ const r = new xe(s, this), n = r.u(this.options);
426
+ r.p(t), this.T(n), this._$AH = r;
447
427
  }
448
428
  }
449
429
  _$AC(e) {
450
- let t = re.get(e.strings);
451
- return t === void 0 && re.set(e.strings, t = new U(e)), t;
430
+ let t = ie.get(e.strings);
431
+ return t === void 0 && ie.set(e.strings, t = new F(e)), t;
452
432
  }
453
433
  k(e) {
454
- Y(this._$AH) || (this._$AH = [], this._$AR());
434
+ V(this._$AH) || (this._$AH = [], this._$AR());
455
435
  const t = this._$AH;
456
436
  let i, s = 0;
457
- for (const r of e) s === t.length ? t.push(i = new q(this.O(H()), this.O(H()), this, this.options)) : i = t[s], i._$AI(r), s++;
437
+ for (const r of e) s === t.length ? t.push(i = new H(this.O(R()), this.O(R()), this, this.options)) : i = t[s], i._$AI(r), s++;
458
438
  s < t.length && (this._$AR(i && i._$AB.nextSibling, s), t.length = s);
459
439
  }
460
440
  _$AR(e = this._$AA.nextSibling, t) {
461
- var i;
462
- for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, t); e && e !== this._$AB; ) {
463
- const s = e.nextSibling;
464
- e.remove(), e = s;
441
+ for (this._$AP?.(!1, !0, t); e !== this._$AB; ) {
442
+ const i = e.nextSibling;
443
+ e.remove(), e = i;
465
444
  }
466
445
  }
467
446
  setConnected(e) {
468
- var t;
469
- this._$AM === void 0 && (this._$Cv = e, (t = this._$AP) == null || t.call(this, e));
447
+ this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
470
448
  }
471
449
  }
472
- class N {
450
+ class T {
473
451
  get tagName() {
474
452
  return this.element.tagName;
475
453
  }
@@ -482,11 +460,11 @@ class N {
482
460
  _$AI(e, t = this, i, s) {
483
461
  const r = this.strings;
484
462
  let n = !1;
485
- if (r === void 0) e = S(this, e, t, 0), n = !F(e) || e !== this._$AH && e !== M, n && (this._$AH = e);
463
+ if (r === void 0) e = E(this, e, t, 0), n = !P(e) || e !== this._$AH && e !== k, n && (this._$AH = e);
486
464
  else {
487
465
  const a = e;
488
466
  let l, u;
489
- for (e = r[0], l = 0; l < r.length - 1; l++) u = S(this, a[i + l], t, l), u === M && (u = this._$AH[l]), n || (n = !F(u) || u !== this._$AH[l]), u === c ? e = c : e !== c && (e += (u ?? "") + r[l + 1]), this._$AH[l] = u;
467
+ for (e = r[0], l = 0; l < r.length - 1; l++) u = E(this, a[i + l], t, l), u === k && (u = this._$AH[l]), n ||= !P(u) || u !== this._$AH[l], u === c ? e = c : e !== c && (e += (u ?? "") + r[l + 1]), this._$AH[l] = u;
490
468
  }
491
469
  n && !s && this.j(e);
492
470
  }
@@ -494,7 +472,7 @@ class N {
494
472
  e === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
495
473
  }
496
474
  }
497
- class Pe extends N {
475
+ class Ce extends T {
498
476
  constructor() {
499
477
  super(...arguments), this.type = 3;
500
478
  }
@@ -502,7 +480,7 @@ class Pe extends N {
502
480
  this.element[this.name] = e === c ? void 0 : e;
503
481
  }
504
482
  }
505
- class ke extends N {
483
+ class Pe extends T {
506
484
  constructor() {
507
485
  super(...arguments), this.type = 4;
508
486
  }
@@ -510,21 +488,20 @@ class ke extends N {
510
488
  this.element.toggleAttribute(this.name, !!e && e !== c);
511
489
  }
512
490
  }
513
- class Fe extends N {
491
+ class ke extends T {
514
492
  constructor(e, t, i, s, r) {
515
493
  super(e, t, i, s, r), this.type = 5;
516
494
  }
517
495
  _$AI(e, t = this) {
518
- if ((e = S(this, e, t, 0) ?? c) === M) return;
496
+ if ((e = E(this, e, t, 0) ?? c) === k) return;
519
497
  const i = this._$AH, s = e === c && i !== c || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, r = e !== c && (i === c || s);
520
498
  s && this.element.removeEventListener(this.name, this, i), r && this.element.addEventListener(this.name, this, e), this._$AH = e;
521
499
  }
522
500
  handleEvent(e) {
523
- var t;
524
- typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
501
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
525
502
  }
526
503
  }
527
- class Me {
504
+ class Fe {
528
505
  constructor(e, t, i) {
529
506
  this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = i;
530
507
  }
@@ -532,18 +509,18 @@ class Me {
532
509
  return this._$AM._$AU;
533
510
  }
534
511
  _$AI(e) {
535
- S(this, e);
512
+ E(this, e);
536
513
  }
537
514
  }
538
- const V = k.litHtmlPolyfillSupport;
539
- V == null || V(U, q), (k.litHtmlVersions ?? (k.litHtmlVersions = [])).push("3.2.1");
515
+ const Me = j.litHtmlPolyfillSupport;
516
+ Me?.(F, H), (j.litHtmlVersions ??= []).push("3.3.1");
540
517
  /**
541
518
  * @license
542
519
  * Copyright 2018 Google LLC
543
520
  * SPDX-License-Identifier: BSD-3-Clause
544
521
  */
545
- const Ue = (o) => o ?? c;
546
- async function De(o, e) {
522
+ const De = (o) => o ?? c;
523
+ async function Ue(o, e) {
547
524
  if (!e || e.trim() === "") return !0;
548
525
  const t = e.toLowerCase().split(",").map((r) => r.trim()), i = o.name.toLowerCase(), s = i.includes(".") ? i.split(".").pop() : "";
549
526
  for (const r of t)
@@ -551,7 +528,7 @@ async function De(o, e) {
551
528
  return !0;
552
529
  return !1;
553
530
  }
554
- const ze = oe`
531
+ const ze = se`
555
532
  :host {
556
533
  /* Global Fileinput Styles */
557
534
  --_nys-fileinput-gap: var(--nys-space-100, 8px);
@@ -684,7 +661,7 @@ const ze = oe`
684
661
  progress::-webkit-progress-bar {
685
662
  background-color: var(--_nys-fileinput-progress-background);
686
663
  }
687
- `, Re = oe`
664
+ `, Re = se`
688
665
  :host {
689
666
  /* Global fileitem Styles */
690
667
  --_nys-fileitem-border-radius: var(--nys-radius-md, 4px);
@@ -830,12 +807,12 @@ const ze = oe`
830
807
  }
831
808
  }
832
809
  `;
833
- var Oe = Object.defineProperty, L = (o, e, t, i) => {
810
+ var Oe = Object.defineProperty, N = (o, e, t, i) => {
834
811
  for (var s = void 0, r = o.length - 1, n; r >= 0; r--)
835
812
  (n = o[r]) && (s = n(e, t, s) || s);
836
813
  return s && Oe(e, t, s), s;
837
814
  };
838
- const G = class G extends ne {
815
+ const W = class W extends re {
839
816
  constructor() {
840
817
  super(...arguments), this.filename = "", this.status = "pending", this.progress = 0, this.errorMessage = "";
841
818
  }
@@ -890,7 +867,7 @@ const G = class G extends ne {
890
867
  ariaLabel="close button"
891
868
  size="sm"
892
869
  variant="ghost"
893
- .onClick=${() => this._handleRemove()}
870
+ @nys-click=${this._handleRemove}
894
871
  ariaLabel="Remove file: ${this.filename}"
895
872
  ></nys-button>
896
873
  </div>
@@ -908,31 +885,31 @@ const G = class G extends ne {
908
885
  `;
909
886
  }
910
887
  };
911
- G.styles = Re;
912
- let E = G;
913
- L([
888
+ W.styles = Re;
889
+ let w = W;
890
+ N([
914
891
  d({ type: String })
915
- ], E.prototype, "filename");
916
- L([
892
+ ], w.prototype, "filename");
893
+ N([
917
894
  d({ type: String })
918
- ], E.prototype, "status");
919
- L([
895
+ ], w.prototype, "status");
896
+ N([
920
897
  d({ type: Number })
921
- ], E.prototype, "progress");
922
- L([
898
+ ], w.prototype, "progress");
899
+ N([
923
900
  d({ type: String })
924
- ], E.prototype, "errorMessage");
925
- customElements.define("nys-fileitem", E);
926
- var He = Object.defineProperty, _ = (o, e, t, i) => {
901
+ ], w.prototype, "errorMessage");
902
+ customElements.define("nys-fileitem", w);
903
+ var qe = Object.defineProperty, _ = (o, e, t, i) => {
927
904
  for (var s = void 0, r = o.length - 1, n; r >= 0; r--)
928
905
  (n = o[r]) && (s = n(e, t, s) || s);
929
- return s && He(e, t, s), s;
906
+ return s && qe(e, t, s), s;
930
907
  };
931
- let Te = 0;
932
- const T = class T extends ne {
908
+ let He = 0;
909
+ const O = class O extends re {
933
910
  // allows use of elementInternals' API
934
911
  constructor() {
935
- super(), this.id = "", this.name = "", this.label = "", this.description = "", this.multiple = !1, this.form = null, this._tooltip = "", this.accept = "", this.disabled = !1, this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.dropzone = !1, this.width = "full", this.invert = !1, this._selectedFiles = [], this._dragActive = !1, this._internals = this.attachInternals();
912
+ super(), this.id = "", this.name = "", this.label = "", this.description = "", this.multiple = !1, this.form = null, this._tooltip = "", this.accept = "", this.disabled = !1, this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.dropzone = !1, this.width = "full", this.inverted = !1, this._selectedFiles = [], this._dragActive = !1, this._internals = this.attachInternals();
936
913
  }
937
914
  get _isDropDisabled() {
938
915
  return this.disabled || !this.multiple && this._selectedFiles.length > 0;
@@ -956,17 +933,15 @@ const T = class T extends ne {
956
933
  return `${t}${e ? " Error: One or more files are not valid file types." : ""}`;
957
934
  }
958
935
  get _innerNysButton() {
959
- var i;
960
- const e = this.renderRoot.querySelector(
936
+ return this.renderRoot.querySelector(
961
937
  '[name="file-btn"]'
962
- );
963
- return (i = e == null ? void 0 : e.shadowRoot) == null ? void 0 : i.querySelector(
938
+ )?.shadowRoot?.querySelector(
964
939
  "button"
965
940
  );
966
941
  }
967
942
  // Generate a unique ID if one is not provided
968
943
  connectedCallback() {
969
- super.connectedCallback(), this.id || (this.id = `nys-fileinput-${Date.now()}-${Te++}`), this.addEventListener("invalid", this._handleInvalid);
944
+ super.connectedCallback(), this.id || (this.id = `nys-fileinput-${Date.now()}-${He++}`), this.addEventListener("invalid", this._handleInvalid);
970
945
  }
971
946
  disconnectedCallback() {
972
947
  super.disconnectedCallback(), this.removeEventListener("invalid", this._handleInvalid);
@@ -976,34 +951,31 @@ const T = class T extends ne {
976
951
  }
977
952
  /********************** Form Integration **********************/
978
953
  _setValue() {
979
- var e;
980
954
  if (this.multiple) {
981
- const t = this._selectedFiles.map((i) => i.file);
982
- if (t.length > 0) {
983
- const i = new FormData();
984
- t.forEach((s) => {
985
- i.append(this.name, s);
986
- }), this._internals.setFormValue(i);
955
+ const e = this._selectedFiles.map((t) => t.file);
956
+ if (e.length > 0) {
957
+ const t = new FormData();
958
+ e.forEach((i) => {
959
+ t.append(this.name, i);
960
+ }), this._internals.setFormValue(t);
987
961
  } else
988
962
  this._internals.setFormValue(null);
989
963
  } else {
990
- const t = ((e = this._selectedFiles[0]) == null ? void 0 : e.file) || null;
991
- this._internals.setFormValue(t);
964
+ const e = this._selectedFiles[0]?.file || null;
965
+ this._internals.setFormValue(e);
992
966
  }
993
967
  this._manageRequire();
994
968
  }
995
969
  // Called to internally set the initial internalElement required flag.
996
970
  _manageRequire() {
997
- var s;
998
- const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector("input");
971
+ const e = this.shadowRoot?.querySelector("input");
999
972
  if (!e) return;
1000
973
  const t = this.errorMessage || "Please upload a file.";
1001
974
  this.required && this._selectedFiles.length == 0 ? (this._internals.ariaRequired = "true", this._internals.setValidity({ valueMissing: !0 }, t, e)) : (this._internals.ariaRequired = "false", this._internals.setValidity({}, "", e));
1002
975
  }
1003
976
  _setValidityMessage(e = "") {
1004
- var i, s;
1005
- const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector("input");
1006
- t && (this.showError = e === (this.errorMessage || "Please upload a file."), (s = this.errorMessage) != null && s.trim() && e !== "" && (e = this.errorMessage), this._internals.setValidity(
977
+ const t = this.shadowRoot?.querySelector("input");
978
+ t && (this.showError = e === (this.errorMessage || "Please upload a file."), this.errorMessage?.trim() && e !== "" && (e = this.errorMessage), this._internals.setValidity(
1007
979
  e ? { customError: !0 } : {},
1008
980
  e,
1009
981
  t
@@ -1018,8 +990,7 @@ const T = class T extends ne {
1018
990
  }
1019
991
  // This helper function is called to perform the element's native validation.
1020
992
  checkValidity() {
1021
- var t;
1022
- const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector("input");
993
+ const e = this.shadowRoot?.querySelector("input");
1023
994
  return e ? e.checkValidity() : !0;
1024
995
  }
1025
996
  _handleInvalid(e) {
@@ -1049,7 +1020,7 @@ const T = class T extends ne {
1049
1020
  async _processFile(e) {
1050
1021
  e.status = "processing";
1051
1022
  try {
1052
- if (!await De(e.file, this.accept)) {
1023
+ if (!await Ue(e.file, this.accept)) {
1053
1024
  e.status = "error", e.errorMsg = "File type is invalid.", this.requestUpdate();
1054
1025
  return;
1055
1026
  }
@@ -1078,10 +1049,9 @@ const T = class T extends ne {
1078
1049
  );
1079
1050
  }
1080
1051
  _openFileDialog() {
1081
- const e = this.renderRoot.querySelector(
1052
+ this.renderRoot.querySelector(
1082
1053
  ".hidden-file-input"
1083
- );
1084
- e == null || e.click();
1054
+ )?.click();
1085
1055
  }
1086
1056
  _handlePostFileSelectionFocus() {
1087
1057
  if (this.multiple) {
@@ -1091,15 +1061,14 @@ const T = class T extends ne {
1091
1061
  this._focusFirstFileItemIfSingleMode();
1092
1062
  }
1093
1063
  async _focusFirstFileItemIfSingleMode() {
1094
- var e;
1095
1064
  if (!this.multiple) {
1096
1065
  await this.updateComplete;
1097
1066
  const t = this.renderRoot.querySelector(
1098
1067
  "nys-fileitem"
1099
- ), i = (e = t == null ? void 0 : t.shadowRoot) == null ? void 0 : e.querySelector(
1068
+ )?.shadowRoot?.querySelector(
1100
1069
  ".file-item"
1101
1070
  );
1102
- i && (i.setAttribute("tabindex", "-1"), i.focus());
1071
+ t && (t.setAttribute("tabindex", "-1"), t.focus());
1103
1072
  }
1104
1073
  }
1105
1074
  /******************** Event Handlers ********************/
@@ -1111,15 +1080,14 @@ const T = class T extends ne {
1111
1080
  }), this.requestUpdate(), this._dispatchChangeEvent(), this._handlePostFileSelectionFocus();
1112
1081
  }
1113
1082
  _handleFileRemove(e) {
1114
- var i;
1115
1083
  const t = e.detail.filename;
1116
1084
  if (this._selectedFiles = this._selectedFiles.filter(
1117
- (s) => s.file.name !== t
1085
+ (i) => i.file.name !== t
1118
1086
  ), this._selectedFiles.length === 0) {
1119
- const s = (i = this.shadowRoot) == null ? void 0 : i.querySelector(
1087
+ const i = this.shadowRoot?.querySelector(
1120
1088
  "input"
1121
1089
  );
1122
- s && (s.value = "");
1090
+ i && (i.value = "");
1123
1091
  }
1124
1092
  this._setValue(), this._validate(), this.requestUpdate(), this._dispatchChangeEvent();
1125
1093
  }
@@ -1131,14 +1099,13 @@ const T = class T extends ne {
1131
1099
  this.disabled || (e.stopPropagation(), e.preventDefault(), e.currentTarget === e.target && (this._dragActive = !1, this.requestUpdate()));
1132
1100
  }
1133
1101
  _onDrop(e) {
1134
- var s;
1135
1102
  if (this.disabled) return;
1136
1103
  e.preventDefault(), this._dragActive = !1, this.requestUpdate();
1137
- const t = (s = e.dataTransfer) == null ? void 0 : s.files;
1104
+ const t = e.dataTransfer?.files;
1138
1105
  if (!t) return;
1139
1106
  const i = Array.from(t);
1140
- this.multiple ? i.forEach((r) => {
1141
- this._saveSelectedFiles(r);
1107
+ this.multiple ? i.forEach((s) => {
1108
+ this._saveSelectedFiles(s);
1142
1109
  }) : this._saveSelectedFiles(i[0]), this.requestUpdate(), this._dispatchChangeEvent();
1143
1110
  }
1144
1111
  render() {
@@ -1152,7 +1119,7 @@ const T = class T extends ne {
1152
1119
  description=${this.description}
1153
1120
  flag=${this.required ? "required" : this.optional ? "optional" : ""}
1154
1121
  _tooltip=${this._tooltip}
1155
- ?invert=${this.invert}
1122
+ ?inverted=${this.inverted}
1156
1123
  >
1157
1124
  <slot name="description" slot="description">${this.description}</slot>
1158
1125
  </nys-label>
@@ -1163,7 +1130,7 @@ const T = class T extends ne {
1163
1130
  type="file"
1164
1131
  name=${this.name}
1165
1132
  accept=${this.accept}
1166
- form=${Ue(this.form || void 0)}
1133
+ form=${De(this.form || void 0)}
1167
1134
  ?multiple=${this.multiple}
1168
1135
  ?required=${this.required}
1169
1136
  ?disabled=${this.disabled || !this.multiple && this._selectedFiles.length > 0}
@@ -1186,27 +1153,28 @@ const T = class T extends ne {
1186
1153
  aria-label="Drag files here or choose from folder"
1187
1154
  >
1188
1155
  ${this._dragActive ? y`<p>Drop file to upload</p>` : y` <nys-button
1189
- id=${this.id}
1156
+ id="choose-files-btn-drag"
1190
1157
  name="file-btn"
1191
1158
  label=${this.multiple ? "Choose files" : "Choose file"}
1192
1159
  variant="outline"
1193
1160
  ariaLabel=${this._buttonAriaLabel}
1194
1161
  ariaDescription=${this._buttonAriaDescription}
1195
1162
  ?disabled=${this._isDropDisabled}
1196
- .onClick=${(e) => {
1163
+ @nys-click=${(e) => {
1197
1164
  e.stopPropagation(), this._openFileDialog();
1198
1165
  }}
1166
+ @click=${(e) => e.stopPropagation()}
1199
1167
  ></nys-button>
1200
1168
  <p>or drag here</p>`}
1201
1169
  </div>` : y`<nys-button
1202
- id=${this.id}
1170
+ id="choose-files-btn"
1203
1171
  name="file-btn"
1204
1172
  label=${this.multiple ? "Choose files" : "Choose file"}
1205
1173
  variant="outline"
1206
1174
  ariaLabel=${this._buttonAriaLabel}
1207
1175
  ariaDescription=${this._buttonAriaDescription}
1208
1176
  ?disabled=${this.disabled || !this.multiple && this._selectedFiles.length > 0}
1209
- .onClick=${() => this._openFileDialog()}
1177
+ @nys-click=${this._openFileDialog}
1210
1178
  ></nys-button>`}
1211
1179
  ${this.showError ? y`
1212
1180
  <nys-errormessage
@@ -1231,8 +1199,8 @@ const T = class T extends ne {
1231
1199
  </div>`;
1232
1200
  }
1233
1201
  };
1234
- T.styles = ze, T.formAssociated = !0;
1235
- let p = T;
1202
+ O.styles = ze, O.formAssociated = !0;
1203
+ let p = O;
1236
1204
  _([
1237
1205
  d({ type: String })
1238
1206
  ], p.prototype, "id");
@@ -1280,7 +1248,7 @@ _([
1280
1248
  ], p.prototype, "width");
1281
1249
  _([
1282
1250
  d({ type: Boolean, reflect: !0 })
1283
- ], p.prototype, "invert");
1251
+ ], p.prototype, "inverted");
1284
1252
  customElements.get("nys-fileinput") || customElements.define("nys-fileinput", p);
1285
1253
  export {
1286
1254
  p as NysFileinput