@wral/studio.mods.auth 0.3.7

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.
@@ -0,0 +1,3379 @@
1
+ var fe = Object.defineProperty;
2
+ var me = (o, t, e) => t in o ? fe(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
+ var E = (o, t, e) => me(o, typeof t != "symbol" ? t + "" : t, e);
4
+ function mt(o) {
5
+ return {
6
+ // Underlying mechanism to use the REST URLs directly.
7
+ api: (t, e) => O(o, t, e),
8
+ mintToken: ({ username: t, password: e }) => ge({ config: o, username: t, password: e }),
9
+ refreshToken: ({ token: t }) => ve({ config: o, token: t }),
10
+ pubkey: () => ye({ config: o }),
11
+ updatePassword: ({ token: t, currentPassword: e, newPassword: r }) => we({ config: o, token: t, currentPassword: e, newPassword: r }),
12
+ triggerResetPassword: ({ username: t }) => _e({ config: o, username: t }),
13
+ confirmResetPassword: ({ username: t, newPassword: e, confirmationCode: r }) => $e({ config: o, username: t, newPassword: e, confirmationCode: r })
14
+ };
15
+ }
16
+ function ge({ config: o, username: t, password: e }) {
17
+ return O(o, "/v1/user/login", {
18
+ method: "POST",
19
+ body: {
20
+ username: t,
21
+ password: e
22
+ }
23
+ });
24
+ }
25
+ function ve({ config: o, token: t }) {
26
+ return O(o, "/v1/refresh", {
27
+ method: "POST",
28
+ body: {
29
+ token: t
30
+ }
31
+ });
32
+ }
33
+ function ye({ config: o }) {
34
+ return O(o, "/v1/pubkey", {
35
+ method: "GET"
36
+ });
37
+ }
38
+ function we({ config: o, token: t, currentPassword: e, newPassword: r }) {
39
+ return O(o, "/v1/user/password", {
40
+ method: "PUT",
41
+ body: {
42
+ currentPassword: e,
43
+ newPassword: r
44
+ },
45
+ headers: {
46
+ Authorization: `Bearer ${t}`
47
+ }
48
+ });
49
+ }
50
+ function _e({ config: o, username: t }) {
51
+ return O(o, "/v1/user/password/reset", {
52
+ method: "POST",
53
+ body: {
54
+ username: t
55
+ }
56
+ });
57
+ }
58
+ function $e({ config: o, username: t, newPassword: e, confirmationCode: r }) {
59
+ return O(o, "/v1/user/password/reset/confirm", {
60
+ method: "POST",
61
+ body: {
62
+ username: t,
63
+ newPassword: e,
64
+ confirmationCode: r
65
+ }
66
+ });
67
+ }
68
+ async function O(o, t, e) {
69
+ var c;
70
+ const r = o.baseUrl.endsWith("/") ? o.baseUrl : `${o.baseUrl}/`, s = t.startsWith("/") ? t.substring(1) : t, i = new URL(s, r), d = Object.assign({}, e, {
71
+ headers: Object.assign({}, {
72
+ "Content-Type": "application/json"
73
+ }, e == null ? void 0 : e.headers),
74
+ body: e != null && e.body ? JSON.stringify(e.body) : void 0
75
+ }), l = await fetch(i.toString(), d);
76
+ if (!l.ok) {
77
+ const b = new Error("API request failed.");
78
+ if (b.status = l.status, b.statusText = l.statusText, b.url = i.toString(), b.headers = l.headers, b.bodyUsed = l.bodyUsed, (c = l.headers.get("Content-Type")) != null && c.includes("application/json"))
79
+ try {
80
+ b.body = await l.json();
81
+ } catch {
82
+ b.body = "Failed to parse response body.";
83
+ }
84
+ throw b;
85
+ }
86
+ if (l.status !== 204)
87
+ return await l.json();
88
+ }
89
+ /**
90
+ * @license
91
+ * Copyright 2019 Google LLC
92
+ * SPDX-License-Identifier: BSD-3-Clause
93
+ */
94
+ const rt = globalThis, xt = rt.ShadowRoot && (rt.ShadyCSS === void 0 || rt.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, kt = Symbol(), Ut = /* @__PURE__ */ new WeakMap();
95
+ let Jt = class {
96
+ constructor(t, e, r) {
97
+ if (this._$cssResult$ = !0, r !== kt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
98
+ this.cssText = t, this.t = e;
99
+ }
100
+ get styleSheet() {
101
+ let t = this.o;
102
+ const e = this.t;
103
+ if (xt && t === void 0) {
104
+ const r = e !== void 0 && e.length === 1;
105
+ r && (t = Ut.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && Ut.set(e, t));
106
+ }
107
+ return t;
108
+ }
109
+ toString() {
110
+ return this.cssText;
111
+ }
112
+ };
113
+ const xe = (o) => new Jt(typeof o == "string" ? o : o + "", void 0, kt), $ = (o, ...t) => {
114
+ const e = o.length === 1 ? o[0] : t.reduce((r, s, i) => r + ((n) => {
115
+ if (n._$cssResult$ === !0) return n.cssText;
116
+ if (typeof n == "number") return n;
117
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
118
+ })(s) + o[i + 1], o[0]);
119
+ return new Jt(e, o, kt);
120
+ }, ke = (o, t) => {
121
+ if (xt) o.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
122
+ else for (const e of t) {
123
+ const r = document.createElement("style"), s = rt.litNonce;
124
+ s !== void 0 && r.setAttribute("nonce", s), r.textContent = e.cssText, o.appendChild(r);
125
+ }
126
+ }, Lt = xt ? (o) => o : (o) => o instanceof CSSStyleSheet ? ((t) => {
127
+ let e = "";
128
+ for (const r of t.cssRules) e += r.cssText;
129
+ return xe(e);
130
+ })(o) : o;
131
+ /**
132
+ * @license
133
+ * Copyright 2017 Google LLC
134
+ * SPDX-License-Identifier: BSD-3-Clause
135
+ */
136
+ const { is: Ce, defineProperty: Ae, getOwnPropertyDescriptor: Se, getOwnPropertyNames: Ee, getOwnPropertySymbols: Pe, getPrototypeOf: Te } = Object, A = globalThis, Ot = A.trustedTypes, ze = Ot ? Ot.emptyScript : "", lt = A.reactiveElementPolyfillSupport, q = (o, t) => o, R = { toAttribute(o, t) {
137
+ switch (t) {
138
+ case Boolean:
139
+ o = o ? ze : null;
140
+ break;
141
+ case Object:
142
+ case Array:
143
+ o = o == null ? o : JSON.stringify(o);
144
+ }
145
+ return o;
146
+ }, fromAttribute(o, t) {
147
+ let e = o;
148
+ switch (t) {
149
+ case Boolean:
150
+ e = o !== null;
151
+ break;
152
+ case Number:
153
+ e = o === null ? null : Number(o);
154
+ break;
155
+ case Object:
156
+ case Array:
157
+ try {
158
+ e = JSON.parse(o);
159
+ } catch {
160
+ e = null;
161
+ }
162
+ }
163
+ return e;
164
+ } }, Ct = (o, t) => !Ce(o, t), It = { attribute: !0, type: String, converter: R, reflect: !1, hasChanged: Ct };
165
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), A.litPropertyMetadata ?? (A.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
166
+ class I extends HTMLElement {
167
+ static addInitializer(t) {
168
+ this._$Ei(), (this.l ?? (this.l = [])).push(t);
169
+ }
170
+ static get observedAttributes() {
171
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
172
+ }
173
+ static createProperty(t, e = It) {
174
+ if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
175
+ const r = Symbol(), s = this.getPropertyDescriptor(t, r, e);
176
+ s !== void 0 && Ae(this.prototype, t, s);
177
+ }
178
+ }
179
+ static getPropertyDescriptor(t, e, r) {
180
+ const { get: s, set: i } = Se(this.prototype, t) ?? { get() {
181
+ return this[e];
182
+ }, set(n) {
183
+ this[e] = n;
184
+ } };
185
+ return { get() {
186
+ return s == null ? void 0 : s.call(this);
187
+ }, set(n) {
188
+ const d = s == null ? void 0 : s.call(this);
189
+ i.call(this, n), this.requestUpdate(t, d, r);
190
+ }, configurable: !0, enumerable: !0 };
191
+ }
192
+ static getPropertyOptions(t) {
193
+ return this.elementProperties.get(t) ?? It;
194
+ }
195
+ static _$Ei() {
196
+ if (this.hasOwnProperty(q("elementProperties"))) return;
197
+ const t = Te(this);
198
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
199
+ }
200
+ static finalize() {
201
+ if (this.hasOwnProperty(q("finalized"))) return;
202
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(q("properties"))) {
203
+ const e = this.properties, r = [...Ee(e), ...Pe(e)];
204
+ for (const s of r) this.createProperty(s, e[s]);
205
+ }
206
+ const t = this[Symbol.metadata];
207
+ if (t !== null) {
208
+ const e = litPropertyMetadata.get(t);
209
+ if (e !== void 0) for (const [r, s] of e) this.elementProperties.set(r, s);
210
+ }
211
+ this._$Eh = /* @__PURE__ */ new Map();
212
+ for (const [e, r] of this.elementProperties) {
213
+ const s = this._$Eu(e, r);
214
+ s !== void 0 && this._$Eh.set(s, e);
215
+ }
216
+ this.elementStyles = this.finalizeStyles(this.styles);
217
+ }
218
+ static finalizeStyles(t) {
219
+ const e = [];
220
+ if (Array.isArray(t)) {
221
+ const r = new Set(t.flat(1 / 0).reverse());
222
+ for (const s of r) e.unshift(Lt(s));
223
+ } else t !== void 0 && e.push(Lt(t));
224
+ return e;
225
+ }
226
+ static _$Eu(t, e) {
227
+ const r = e.attribute;
228
+ return r === !1 ? void 0 : typeof r == "string" ? r : typeof t == "string" ? t.toLowerCase() : void 0;
229
+ }
230
+ constructor() {
231
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
232
+ }
233
+ _$Ev() {
234
+ var t;
235
+ this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
236
+ }
237
+ addController(t) {
238
+ var e;
239
+ (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
240
+ }
241
+ removeController(t) {
242
+ var e;
243
+ (e = this._$EO) == null || e.delete(t);
244
+ }
245
+ _$E_() {
246
+ const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
247
+ for (const r of e.keys()) this.hasOwnProperty(r) && (t.set(r, this[r]), delete this[r]);
248
+ t.size > 0 && (this._$Ep = t);
249
+ }
250
+ createRenderRoot() {
251
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
252
+ return ke(t, this.constructor.elementStyles), t;
253
+ }
254
+ connectedCallback() {
255
+ var t;
256
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
257
+ var r;
258
+ return (r = e.hostConnected) == null ? void 0 : r.call(e);
259
+ });
260
+ }
261
+ enableUpdating(t) {
262
+ }
263
+ disconnectedCallback() {
264
+ var t;
265
+ (t = this._$EO) == null || t.forEach((e) => {
266
+ var r;
267
+ return (r = e.hostDisconnected) == null ? void 0 : r.call(e);
268
+ });
269
+ }
270
+ attributeChangedCallback(t, e, r) {
271
+ this._$AK(t, r);
272
+ }
273
+ _$EC(t, e) {
274
+ var i;
275
+ const r = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, r);
276
+ if (s !== void 0 && r.reflect === !0) {
277
+ const n = (((i = r.converter) == null ? void 0 : i.toAttribute) !== void 0 ? r.converter : R).toAttribute(e, r.type);
278
+ this._$Em = t, n == null ? this.removeAttribute(s) : this.setAttribute(s, n), this._$Em = null;
279
+ }
280
+ }
281
+ _$AK(t, e) {
282
+ var i;
283
+ const r = this.constructor, s = r._$Eh.get(t);
284
+ if (s !== void 0 && this._$Em !== s) {
285
+ const n = r.getPropertyOptions(s), d = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((i = n.converter) == null ? void 0 : i.fromAttribute) !== void 0 ? n.converter : R;
286
+ this._$Em = s, this[s] = d.fromAttribute(e, n.type), this._$Em = null;
287
+ }
288
+ }
289
+ requestUpdate(t, e, r) {
290
+ if (t !== void 0) {
291
+ if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ?? Ct)(this[t], e)) return;
292
+ this.P(t, e, r);
293
+ }
294
+ this.isUpdatePending === !1 && (this._$ES = this._$ET());
295
+ }
296
+ P(t, e, r) {
297
+ this._$AL.has(t) || this._$AL.set(t, e), r.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
298
+ }
299
+ async _$ET() {
300
+ this.isUpdatePending = !0;
301
+ try {
302
+ await this._$ES;
303
+ } catch (e) {
304
+ Promise.reject(e);
305
+ }
306
+ const t = this.scheduleUpdate();
307
+ return t != null && await t, !this.isUpdatePending;
308
+ }
309
+ scheduleUpdate() {
310
+ return this.performUpdate();
311
+ }
312
+ performUpdate() {
313
+ var r;
314
+ if (!this.isUpdatePending) return;
315
+ if (!this.hasUpdated) {
316
+ if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
317
+ for (const [i, n] of this._$Ep) this[i] = n;
318
+ this._$Ep = void 0;
319
+ }
320
+ const s = this.constructor.elementProperties;
321
+ if (s.size > 0) for (const [i, n] of s) n.wrapped !== !0 || this._$AL.has(i) || this[i] === void 0 || this.P(i, this[i], n);
322
+ }
323
+ let t = !1;
324
+ const e = this._$AL;
325
+ try {
326
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (r = this._$EO) == null || r.forEach((s) => {
327
+ var i;
328
+ return (i = s.hostUpdate) == null ? void 0 : i.call(s);
329
+ }), this.update(e)) : this._$EU();
330
+ } catch (s) {
331
+ throw t = !1, this._$EU(), s;
332
+ }
333
+ t && this._$AE(e);
334
+ }
335
+ willUpdate(t) {
336
+ }
337
+ _$AE(t) {
338
+ var e;
339
+ (e = this._$EO) == null || e.forEach((r) => {
340
+ var s;
341
+ return (s = r.hostUpdated) == null ? void 0 : s.call(r);
342
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
343
+ }
344
+ _$EU() {
345
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
346
+ }
347
+ get updateComplete() {
348
+ return this.getUpdateComplete();
349
+ }
350
+ getUpdateComplete() {
351
+ return this._$ES;
352
+ }
353
+ shouldUpdate(t) {
354
+ return !0;
355
+ }
356
+ update(t) {
357
+ this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU();
358
+ }
359
+ updated(t) {
360
+ }
361
+ firstUpdated(t) {
362
+ }
363
+ }
364
+ I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[q("elementProperties")] = /* @__PURE__ */ new Map(), I[q("finalized")] = /* @__PURE__ */ new Map(), lt == null || lt({ ReactiveElement: I }), (A.reactiveElementVersions ?? (A.reactiveElementVersions = [])).push("2.0.4");
365
+ /**
366
+ * @license
367
+ * Copyright 2017 Google LLC
368
+ * SPDX-License-Identifier: BSD-3-Clause
369
+ */
370
+ const W = globalThis, st = W.trustedTypes, Vt = st ? st.createPolicy("lit-html", { createHTML: (o) => o }) : void 0, Gt = "$lit$", C = `lit$${Math.random().toFixed(9).slice(2)}$`, Qt = "?" + C, Ue = `<${Qt}>`, L = document, Z = () => L.createComment(""), Y = (o) => o === null || typeof o != "object" && typeof o != "function", At = Array.isArray, Le = (o) => At(o) || typeof (o == null ? void 0 : o[Symbol.iterator]) == "function", ut = `[
371
+ \f\r]`, N = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Rt = /-->/g, Bt = />/g, P = RegExp(`>|${ut}(?:([^\\s"'>=/]+)(${ut}*=${ut}*(?:[^
372
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Mt = /'/g, Nt = /"/g, Xt = /^(?:script|style|textarea|title)$/i, Oe = (o) => (t, ...e) => ({ _$litType$: o, strings: t, values: e }), v = Oe(1), w = Symbol.for("lit-noChange"), g = Symbol.for("lit-nothing"), Dt = /* @__PURE__ */ new WeakMap(), U = L.createTreeWalker(L, 129);
373
+ function te(o, t) {
374
+ if (!At(o) || !o.hasOwnProperty("raw")) throw Error("invalid template strings array");
375
+ return Vt !== void 0 ? Vt.createHTML(t) : t;
376
+ }
377
+ const Ie = (o, t) => {
378
+ const e = o.length - 1, r = [];
379
+ let s, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = N;
380
+ for (let d = 0; d < e; d++) {
381
+ const l = o[d];
382
+ let c, b, p = -1, _ = 0;
383
+ for (; _ < l.length && (n.lastIndex = _, b = n.exec(l), b !== null); ) _ = n.lastIndex, n === N ? b[1] === "!--" ? n = Rt : b[1] !== void 0 ? n = Bt : b[2] !== void 0 ? (Xt.test(b[2]) && (s = RegExp("</" + b[2], "g")), n = P) : b[3] !== void 0 && (n = P) : n === P ? b[0] === ">" ? (n = s ?? N, p = -1) : b[1] === void 0 ? p = -2 : (p = n.lastIndex - b[2].length, c = b[1], n = b[3] === void 0 ? P : b[3] === '"' ? Nt : Mt) : n === Nt || n === Mt ? n = P : n === Rt || n === Bt ? n = N : (n = P, s = void 0);
384
+ const y = n === P && o[d + 1].startsWith("/>") ? " " : "";
385
+ i += n === N ? l + Ue : p >= 0 ? (r.push(c), l.slice(0, p) + Gt + l.slice(p) + C + y) : l + C + (p === -2 ? d : y);
386
+ }
387
+ return [te(o, i + (o[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
388
+ };
389
+ class J {
390
+ constructor({ strings: t, _$litType$: e }, r) {
391
+ let s;
392
+ this.parts = [];
393
+ let i = 0, n = 0;
394
+ const d = t.length - 1, l = this.parts, [c, b] = Ie(t, e);
395
+ if (this.el = J.createElement(c, r), U.currentNode = this.el.content, e === 2 || e === 3) {
396
+ const p = this.el.content.firstChild;
397
+ p.replaceWith(...p.childNodes);
398
+ }
399
+ for (; (s = U.nextNode()) !== null && l.length < d; ) {
400
+ if (s.nodeType === 1) {
401
+ if (s.hasAttributes()) for (const p of s.getAttributeNames()) if (p.endsWith(Gt)) {
402
+ const _ = b[n++], y = s.getAttribute(p).split(C), tt = /([.?@])?(.*)/.exec(_);
403
+ l.push({ type: 1, index: i, name: tt[2], strings: y, ctor: tt[1] === "." ? Re : tt[1] === "?" ? Be : tt[1] === "@" ? Me : nt }), s.removeAttribute(p);
404
+ } else p.startsWith(C) && (l.push({ type: 6, index: i }), s.removeAttribute(p));
405
+ if (Xt.test(s.tagName)) {
406
+ const p = s.textContent.split(C), _ = p.length - 1;
407
+ if (_ > 0) {
408
+ s.textContent = st ? st.emptyScript : "";
409
+ for (let y = 0; y < _; y++) s.append(p[y], Z()), U.nextNode(), l.push({ type: 2, index: ++i });
410
+ s.append(p[_], Z());
411
+ }
412
+ }
413
+ } else if (s.nodeType === 8) if (s.data === Qt) l.push({ type: 2, index: i });
414
+ else {
415
+ let p = -1;
416
+ for (; (p = s.data.indexOf(C, p + 1)) !== -1; ) l.push({ type: 7, index: i }), p += C.length - 1;
417
+ }
418
+ i++;
419
+ }
420
+ }
421
+ static createElement(t, e) {
422
+ const r = L.createElement("template");
423
+ return r.innerHTML = t, r;
424
+ }
425
+ }
426
+ function B(o, t, e = o, r) {
427
+ var n, d;
428
+ if (t === w) return t;
429
+ let s = r !== void 0 ? (n = e.o) == null ? void 0 : n[r] : e.l;
430
+ const i = Y(t) ? void 0 : t._$litDirective$;
431
+ return (s == null ? void 0 : s.constructor) !== i && ((d = s == null ? void 0 : s._$AO) == null || d.call(s, !1), i === void 0 ? s = void 0 : (s = new i(o), s._$AT(o, e, r)), r !== void 0 ? (e.o ?? (e.o = []))[r] = s : e.l = s), s !== void 0 && (t = B(o, s._$AS(o, t.values), s, r)), t;
432
+ }
433
+ class Ve {
434
+ constructor(t, e) {
435
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
436
+ }
437
+ get parentNode() {
438
+ return this._$AM.parentNode;
439
+ }
440
+ get _$AU() {
441
+ return this._$AM._$AU;
442
+ }
443
+ u(t) {
444
+ const { el: { content: e }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? L).importNode(e, !0);
445
+ U.currentNode = s;
446
+ let i = U.nextNode(), n = 0, d = 0, l = r[0];
447
+ for (; l !== void 0; ) {
448
+ if (n === l.index) {
449
+ let c;
450
+ l.type === 2 ? c = new G(i, i.nextSibling, this, t) : l.type === 1 ? c = new l.ctor(i, l.name, l.strings, this, t) : l.type === 6 && (c = new Ne(i, this, t)), this._$AV.push(c), l = r[++d];
451
+ }
452
+ n !== (l == null ? void 0 : l.index) && (i = U.nextNode(), n++);
453
+ }
454
+ return U.currentNode = L, s;
455
+ }
456
+ p(t) {
457
+ let e = 0;
458
+ for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(t, r, e), e += r.strings.length - 2) : r._$AI(t[e])), e++;
459
+ }
460
+ }
461
+ class G {
462
+ get _$AU() {
463
+ var t;
464
+ return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this.v;
465
+ }
466
+ constructor(t, e, r, s) {
467
+ this.type = 2, this._$AH = g, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = r, this.options = s, this.v = (s == null ? void 0 : s.isConnected) ?? !0;
468
+ }
469
+ get parentNode() {
470
+ let t = this._$AA.parentNode;
471
+ const e = this._$AM;
472
+ return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
473
+ }
474
+ get startNode() {
475
+ return this._$AA;
476
+ }
477
+ get endNode() {
478
+ return this._$AB;
479
+ }
480
+ _$AI(t, e = this) {
481
+ t = B(this, t, e), Y(t) ? t === g || t == null || t === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : t !== this._$AH && t !== w && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Le(t) ? this.k(t) : this._(t);
482
+ }
483
+ O(t) {
484
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
485
+ }
486
+ T(t) {
487
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
488
+ }
489
+ _(t) {
490
+ this._$AH !== g && Y(this._$AH) ? this._$AA.nextSibling.data = t : this.T(L.createTextNode(t)), this._$AH = t;
491
+ }
492
+ $(t) {
493
+ var i;
494
+ const { values: e, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = J.createElement(te(r.h, r.h[0]), this.options)), r);
495
+ if (((i = this._$AH) == null ? void 0 : i._$AD) === s) this._$AH.p(e);
496
+ else {
497
+ const n = new Ve(s, this), d = n.u(this.options);
498
+ n.p(e), this.T(d), this._$AH = n;
499
+ }
500
+ }
501
+ _$AC(t) {
502
+ let e = Dt.get(t.strings);
503
+ return e === void 0 && Dt.set(t.strings, e = new J(t)), e;
504
+ }
505
+ k(t) {
506
+ At(this._$AH) || (this._$AH = [], this._$AR());
507
+ const e = this._$AH;
508
+ let r, s = 0;
509
+ for (const i of t) s === e.length ? e.push(r = new G(this.O(Z()), this.O(Z()), this, this.options)) : r = e[s], r._$AI(i), s++;
510
+ s < e.length && (this._$AR(r && r._$AB.nextSibling, s), e.length = s);
511
+ }
512
+ _$AR(t = this._$AA.nextSibling, e) {
513
+ var r;
514
+ for ((r = this._$AP) == null ? void 0 : r.call(this, !1, !0, e); t && t !== this._$AB; ) {
515
+ const s = t.nextSibling;
516
+ t.remove(), t = s;
517
+ }
518
+ }
519
+ setConnected(t) {
520
+ var e;
521
+ this._$AM === void 0 && (this.v = t, (e = this._$AP) == null || e.call(this, t));
522
+ }
523
+ }
524
+ class nt {
525
+ get tagName() {
526
+ return this.element.tagName;
527
+ }
528
+ get _$AU() {
529
+ return this._$AM._$AU;
530
+ }
531
+ constructor(t, e, r, s, i) {
532
+ this.type = 1, this._$AH = g, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = i, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = g;
533
+ }
534
+ _$AI(t, e = this, r, s) {
535
+ const i = this.strings;
536
+ let n = !1;
537
+ if (i === void 0) t = B(this, t, e, 0), n = !Y(t) || t !== this._$AH && t !== w, n && (this._$AH = t);
538
+ else {
539
+ const d = t;
540
+ let l, c;
541
+ for (t = i[0], l = 0; l < i.length - 1; l++) c = B(this, d[r + l], e, l), c === w && (c = this._$AH[l]), n || (n = !Y(c) || c !== this._$AH[l]), c === g ? t = g : t !== g && (t += (c ?? "") + i[l + 1]), this._$AH[l] = c;
542
+ }
543
+ n && !s && this.j(t);
544
+ }
545
+ j(t) {
546
+ t === g ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
547
+ }
548
+ }
549
+ class Re extends nt {
550
+ constructor() {
551
+ super(...arguments), this.type = 3;
552
+ }
553
+ j(t) {
554
+ this.element[this.name] = t === g ? void 0 : t;
555
+ }
556
+ }
557
+ class Be extends nt {
558
+ constructor() {
559
+ super(...arguments), this.type = 4;
560
+ }
561
+ j(t) {
562
+ this.element.toggleAttribute(this.name, !!t && t !== g);
563
+ }
564
+ }
565
+ class Me extends nt {
566
+ constructor(t, e, r, s, i) {
567
+ super(t, e, r, s, i), this.type = 5;
568
+ }
569
+ _$AI(t, e = this) {
570
+ if ((t = B(this, t, e, 0) ?? g) === w) return;
571
+ const r = this._$AH, s = t === g && r !== g || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, i = t !== g && (r === g || s);
572
+ s && this.element.removeEventListener(this.name, this, r), i && this.element.addEventListener(this.name, this, t), this._$AH = t;
573
+ }
574
+ handleEvent(t) {
575
+ var e;
576
+ typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
577
+ }
578
+ }
579
+ class Ne {
580
+ constructor(t, e, r) {
581
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = r;
582
+ }
583
+ get _$AU() {
584
+ return this._$AM._$AU;
585
+ }
586
+ _$AI(t) {
587
+ B(this, t);
588
+ }
589
+ }
590
+ const dt = W.litHtmlPolyfillSupport;
591
+ dt == null || dt(J, G), (W.litHtmlVersions ?? (W.litHtmlVersions = [])).push("3.2.0");
592
+ const De = (o, t, e) => {
593
+ const r = (e == null ? void 0 : e.renderBefore) ?? t;
594
+ let s = r._$litPart$;
595
+ if (s === void 0) {
596
+ const i = (e == null ? void 0 : e.renderBefore) ?? null;
597
+ r._$litPart$ = s = new G(t.insertBefore(Z(), i), i, void 0, e ?? {});
598
+ }
599
+ return s._$AI(o), s;
600
+ };
601
+ /**
602
+ * @license
603
+ * Copyright 2017 Google LLC
604
+ * SPDX-License-Identifier: BSD-3-Clause
605
+ */
606
+ class S extends I {
607
+ constructor() {
608
+ super(...arguments), this.renderOptions = { host: this }, this.o = void 0;
609
+ }
610
+ createRenderRoot() {
611
+ var e;
612
+ const t = super.createRenderRoot();
613
+ return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
614
+ }
615
+ update(t) {
616
+ const e = this.render();
617
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this.o = De(e, this.renderRoot, this.renderOptions);
618
+ }
619
+ connectedCallback() {
620
+ var t;
621
+ super.connectedCallback(), (t = this.o) == null || t.setConnected(!0);
622
+ }
623
+ disconnectedCallback() {
624
+ var t;
625
+ super.disconnectedCallback(), (t = this.o) == null || t.setConnected(!1);
626
+ }
627
+ render() {
628
+ return w;
629
+ }
630
+ }
631
+ var Yt;
632
+ S._$litElement$ = !0, S.finalized = !0, (Yt = globalThis.litElementHydrateSupport) == null || Yt.call(globalThis, { LitElement: S });
633
+ const ct = globalThis.litElementPolyfillSupport;
634
+ ct == null || ct({ LitElement: S });
635
+ (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.0");
636
+ var Fe = $`
637
+ :host {
638
+ --border-color: var(--sl-color-neutral-200);
639
+ --border-radius: var(--sl-border-radius-medium);
640
+ --border-width: 1px;
641
+ --padding: var(--sl-spacing-large);
642
+
643
+ display: inline-block;
644
+ }
645
+
646
+ .card {
647
+ display: flex;
648
+ flex-direction: column;
649
+ background-color: var(--sl-panel-background-color);
650
+ box-shadow: var(--sl-shadow-x-small);
651
+ border: solid var(--border-width) var(--border-color);
652
+ border-radius: var(--border-radius);
653
+ }
654
+
655
+ .card__image {
656
+ display: flex;
657
+ border-top-left-radius: var(--border-radius);
658
+ border-top-right-radius: var(--border-radius);
659
+ margin: calc(-1 * var(--border-width));
660
+ overflow: hidden;
661
+ }
662
+
663
+ .card__image::slotted(img) {
664
+ display: block;
665
+ width: 100%;
666
+ }
667
+
668
+ .card:not(.card--has-image) .card__image {
669
+ display: none;
670
+ }
671
+
672
+ .card__header {
673
+ display: block;
674
+ border-bottom: solid var(--border-width) var(--border-color);
675
+ padding: calc(var(--padding) / 2) var(--padding);
676
+ }
677
+
678
+ .card:not(.card--has-header) .card__header {
679
+ display: none;
680
+ }
681
+
682
+ .card:not(.card--has-image) .card__header {
683
+ border-top-left-radius: var(--border-radius);
684
+ border-top-right-radius: var(--border-radius);
685
+ }
686
+
687
+ .card__body {
688
+ display: block;
689
+ padding: var(--padding);
690
+ }
691
+
692
+ .card--has-footer .card__footer {
693
+ display: block;
694
+ border-top: solid var(--border-width) var(--border-color);
695
+ padding: var(--padding);
696
+ }
697
+
698
+ .card:not(.card--has-footer) .card__footer {
699
+ display: none;
700
+ }
701
+ `, St = class {
702
+ constructor(o, ...t) {
703
+ this.slotNames = [], this.handleSlotChange = (e) => {
704
+ const r = e.target;
705
+ (this.slotNames.includes("[default]") && !r.name || r.name && this.slotNames.includes(r.name)) && this.host.requestUpdate();
706
+ }, (this.host = o).addController(this), this.slotNames = t;
707
+ }
708
+ hasDefaultSlot() {
709
+ return [...this.host.childNodes].some((o) => {
710
+ if (o.nodeType === o.TEXT_NODE && o.textContent.trim() !== "")
711
+ return !0;
712
+ if (o.nodeType === o.ELEMENT_NODE) {
713
+ const t = o;
714
+ if (t.tagName.toLowerCase() === "sl-visually-hidden")
715
+ return !1;
716
+ if (!t.hasAttribute("slot"))
717
+ return !0;
718
+ }
719
+ return !1;
720
+ });
721
+ }
722
+ hasNamedSlot(o) {
723
+ return this.host.querySelector(`:scope > [slot="${o}"]`) !== null;
724
+ }
725
+ test(o) {
726
+ return o === "[default]" ? this.hasDefaultSlot() : this.hasNamedSlot(o);
727
+ }
728
+ hostConnected() {
729
+ this.host.shadowRoot.addEventListener("slotchange", this.handleSlotChange);
730
+ }
731
+ hostDisconnected() {
732
+ this.host.shadowRoot.removeEventListener("slotchange", this.handleSlotChange);
733
+ }
734
+ }, Q = $`
735
+ :host {
736
+ box-sizing: border-box;
737
+ }
738
+
739
+ :host *,
740
+ :host *::before,
741
+ :host *::after {
742
+ box-sizing: inherit;
743
+ }
744
+
745
+ [hidden] {
746
+ display: none !important;
747
+ }
748
+ `, ee = Object.defineProperty, He = Object.defineProperties, je = Object.getOwnPropertyDescriptor, qe = Object.getOwnPropertyDescriptors, Ft = Object.getOwnPropertySymbols, We = Object.prototype.hasOwnProperty, Ke = Object.prototype.propertyIsEnumerable, Ht = (o, t, e) => t in o ? ee(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e, X = (o, t) => {
749
+ for (var e in t || (t = {}))
750
+ We.call(t, e) && Ht(o, e, t[e]);
751
+ if (Ft)
752
+ for (var e of Ft(t))
753
+ Ke.call(t, e) && Ht(o, e, t[e]);
754
+ return o;
755
+ }, oe = (o, t) => He(o, qe(t)), a = (o, t, e, r) => {
756
+ for (var s = r > 1 ? void 0 : r ? je(t, e) : t, i = o.length - 1, n; i >= 0; i--)
757
+ (n = o[i]) && (s = (r ? n(t, e, s) : n(s)) || s);
758
+ return r && s && ee(t, e, s), s;
759
+ };
760
+ /**
761
+ * @license
762
+ * Copyright 2017 Google LLC
763
+ * SPDX-License-Identifier: BSD-3-Clause
764
+ */
765
+ const Ze = { attribute: !0, type: String, converter: R, reflect: !1, hasChanged: Ct }, Ye = (o = Ze, t, e) => {
766
+ const { kind: r, metadata: s } = e;
767
+ let i = globalThis.litPropertyMetadata.get(s);
768
+ if (i === void 0 && globalThis.litPropertyMetadata.set(s, i = /* @__PURE__ */ new Map()), i.set(e.name, o), r === "accessor") {
769
+ const { name: n } = e;
770
+ return { set(d) {
771
+ const l = t.get.call(this);
772
+ t.set.call(this, d), this.requestUpdate(n, l, o);
773
+ }, init(d) {
774
+ return d !== void 0 && this.P(n, void 0, o), d;
775
+ } };
776
+ }
777
+ if (r === "setter") {
778
+ const { name: n } = e;
779
+ return function(d) {
780
+ const l = this[n];
781
+ t.call(this, d), this.requestUpdate(n, l, o);
782
+ };
783
+ }
784
+ throw Error("Unsupported decorator location: " + r);
785
+ };
786
+ function u(o) {
787
+ return (t, e) => typeof e == "object" ? Ye(o, t, e) : ((r, s, i) => {
788
+ const n = s.hasOwnProperty(i);
789
+ return s.constructor.createProperty(i, n ? { ...r, wrapped: !0 } : r), n ? Object.getOwnPropertyDescriptor(s, i) : void 0;
790
+ })(o, t, e);
791
+ }
792
+ /**
793
+ * @license
794
+ * Copyright 2017 Google LLC
795
+ * SPDX-License-Identifier: BSD-3-Clause
796
+ */
797
+ function at(o) {
798
+ return u({ ...o, state: !0, attribute: !1 });
799
+ }
800
+ /**
801
+ * @license
802
+ * Copyright 2017 Google LLC
803
+ * SPDX-License-Identifier: BSD-3-Clause
804
+ */
805
+ const Je = (o, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(o, t, e), e);
806
+ /**
807
+ * @license
808
+ * Copyright 2017 Google LLC
809
+ * SPDX-License-Identifier: BSD-3-Clause
810
+ */
811
+ function re(o, t) {
812
+ return (e, r, s) => {
813
+ const i = (n) => {
814
+ var d;
815
+ return ((d = n.renderRoot) == null ? void 0 : d.querySelector(o)) ?? null;
816
+ };
817
+ return Je(e, r, { get() {
818
+ return i(this);
819
+ } });
820
+ };
821
+ }
822
+ var k = class extends S {
823
+ constructor() {
824
+ super(), Object.entries(this.constructor.dependencies).forEach(([o, t]) => {
825
+ this.constructor.define(o, t);
826
+ });
827
+ }
828
+ emit(o, t) {
829
+ const e = new CustomEvent(o, X({
830
+ bubbles: !0,
831
+ cancelable: !1,
832
+ composed: !0,
833
+ detail: {}
834
+ }, t));
835
+ return this.dispatchEvent(e), e;
836
+ }
837
+ /* eslint-enable */
838
+ static define(o, t = this, e = {}) {
839
+ const r = customElements.get(o);
840
+ if (!r) {
841
+ try {
842
+ customElements.define(o, t, e);
843
+ } catch {
844
+ customElements.define(o, class extends t {
845
+ }, e);
846
+ }
847
+ return;
848
+ }
849
+ let s = " (unknown version)", i = s;
850
+ "version" in t && t.version && (s = " v" + t.version), "version" in r && r.version && (i = " v" + r.version), !(s && i && s === i) && console.warn(
851
+ `Attempted to register <${o}>${s}, but <${o}>${i} has already been registered.`
852
+ );
853
+ }
854
+ };
855
+ k.version = "2.16.0";
856
+ k.dependencies = {};
857
+ a([
858
+ u()
859
+ ], k.prototype, "dir", 2);
860
+ a([
861
+ u()
862
+ ], k.prototype, "lang", 2);
863
+ /**
864
+ * @license
865
+ * Copyright 2017 Google LLC
866
+ * SPDX-License-Identifier: BSD-3-Clause
867
+ */
868
+ const T = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, se = (o) => (...t) => ({ _$litDirective$: o, values: t });
869
+ class ie {
870
+ constructor(t) {
871
+ }
872
+ get _$AU() {
873
+ return this._$AM._$AU;
874
+ }
875
+ _$AT(t, e, r) {
876
+ this.t = t, this._$AM = e, this.i = r;
877
+ }
878
+ _$AS(t, e) {
879
+ return this.update(t, e);
880
+ }
881
+ update(t, e) {
882
+ return this.render(...e);
883
+ }
884
+ }
885
+ /**
886
+ * @license
887
+ * Copyright 2018 Google LLC
888
+ * SPDX-License-Identifier: BSD-3-Clause
889
+ */
890
+ const it = se(class extends ie {
891
+ constructor(o) {
892
+ var t;
893
+ if (super(o), o.type !== T.ATTRIBUTE || o.name !== "class" || ((t = o.strings) == null ? void 0 : t.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
894
+ }
895
+ render(o) {
896
+ return " " + Object.keys(o).filter((t) => o[t]).join(" ") + " ";
897
+ }
898
+ update(o, [t]) {
899
+ var r, s;
900
+ if (this.st === void 0) {
901
+ this.st = /* @__PURE__ */ new Set(), o.strings !== void 0 && (this.nt = new Set(o.strings.join(" ").split(/\s/).filter((i) => i !== "")));
902
+ for (const i in t) t[i] && !((r = this.nt) != null && r.has(i)) && this.st.add(i);
903
+ return this.render(t);
904
+ }
905
+ const e = o.element.classList;
906
+ for (const i of this.st) i in t || (e.remove(i), this.st.delete(i));
907
+ for (const i in t) {
908
+ const n = !!t[i];
909
+ n === this.st.has(i) || (s = this.nt) != null && s.has(i) || (n ? (e.add(i), this.st.add(i)) : (e.remove(i), this.st.delete(i)));
910
+ }
911
+ return w;
912
+ }
913
+ });
914
+ var ne = class extends k {
915
+ constructor() {
916
+ super(...arguments), this.hasSlotController = new St(this, "footer", "header", "image");
917
+ }
918
+ render() {
919
+ return v`
920
+ <div
921
+ part="base"
922
+ class=${it({
923
+ card: !0,
924
+ "card--has-footer": this.hasSlotController.test("footer"),
925
+ "card--has-image": this.hasSlotController.test("image"),
926
+ "card--has-header": this.hasSlotController.test("header")
927
+ })}
928
+ >
929
+ <slot name="image" part="image" class="card__image"></slot>
930
+ <slot name="header" part="header" class="card__header"></slot>
931
+ <slot part="body" class="card__body"></slot>
932
+ <slot name="footer" part="footer" class="card__footer"></slot>
933
+ </div>
934
+ `;
935
+ }
936
+ };
937
+ ne.styles = [Q, Fe];
938
+ ne.define("sl-card");
939
+ var Ge = $`
940
+ :host {
941
+ display: block;
942
+ }
943
+
944
+ .input {
945
+ flex: 1 1 auto;
946
+ display: inline-flex;
947
+ align-items: stretch;
948
+ justify-content: start;
949
+ position: relative;
950
+ width: 100%;
951
+ font-family: var(--sl-input-font-family);
952
+ font-weight: var(--sl-input-font-weight);
953
+ letter-spacing: var(--sl-input-letter-spacing);
954
+ vertical-align: middle;
955
+ overflow: hidden;
956
+ cursor: text;
957
+ transition:
958
+ var(--sl-transition-fast) color,
959
+ var(--sl-transition-fast) border,
960
+ var(--sl-transition-fast) box-shadow,
961
+ var(--sl-transition-fast) background-color;
962
+ }
963
+
964
+ /* Standard inputs */
965
+ .input--standard {
966
+ background-color: var(--sl-input-background-color);
967
+ border: solid var(--sl-input-border-width) var(--sl-input-border-color);
968
+ }
969
+
970
+ .input--standard:hover:not(.input--disabled) {
971
+ background-color: var(--sl-input-background-color-hover);
972
+ border-color: var(--sl-input-border-color-hover);
973
+ }
974
+
975
+ .input--standard.input--focused:not(.input--disabled) {
976
+ background-color: var(--sl-input-background-color-focus);
977
+ border-color: var(--sl-input-border-color-focus);
978
+ box-shadow: 0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color);
979
+ }
980
+
981
+ .input--standard.input--focused:not(.input--disabled) .input__control {
982
+ color: var(--sl-input-color-focus);
983
+ }
984
+
985
+ .input--standard.input--disabled {
986
+ background-color: var(--sl-input-background-color-disabled);
987
+ border-color: var(--sl-input-border-color-disabled);
988
+ opacity: 0.5;
989
+ cursor: not-allowed;
990
+ }
991
+
992
+ .input--standard.input--disabled .input__control {
993
+ color: var(--sl-input-color-disabled);
994
+ }
995
+
996
+ .input--standard.input--disabled .input__control::placeholder {
997
+ color: var(--sl-input-placeholder-color-disabled);
998
+ }
999
+
1000
+ /* Filled inputs */
1001
+ .input--filled {
1002
+ border: none;
1003
+ background-color: var(--sl-input-filled-background-color);
1004
+ color: var(--sl-input-color);
1005
+ }
1006
+
1007
+ .input--filled:hover:not(.input--disabled) {
1008
+ background-color: var(--sl-input-filled-background-color-hover);
1009
+ }
1010
+
1011
+ .input--filled.input--focused:not(.input--disabled) {
1012
+ background-color: var(--sl-input-filled-background-color-focus);
1013
+ outline: var(--sl-focus-ring);
1014
+ outline-offset: var(--sl-focus-ring-offset);
1015
+ }
1016
+
1017
+ .input--filled.input--disabled {
1018
+ background-color: var(--sl-input-filled-background-color-disabled);
1019
+ opacity: 0.5;
1020
+ cursor: not-allowed;
1021
+ }
1022
+
1023
+ .input__control {
1024
+ flex: 1 1 auto;
1025
+ font-family: inherit;
1026
+ font-size: inherit;
1027
+ font-weight: inherit;
1028
+ min-width: 0;
1029
+ height: 100%;
1030
+ color: var(--sl-input-color);
1031
+ border: none;
1032
+ background: inherit;
1033
+ box-shadow: none;
1034
+ padding: 0;
1035
+ margin: 0;
1036
+ cursor: inherit;
1037
+ -webkit-appearance: none;
1038
+ }
1039
+
1040
+ .input__control::-webkit-search-decoration,
1041
+ .input__control::-webkit-search-cancel-button,
1042
+ .input__control::-webkit-search-results-button,
1043
+ .input__control::-webkit-search-results-decoration {
1044
+ -webkit-appearance: none;
1045
+ }
1046
+
1047
+ .input__control:-webkit-autofill,
1048
+ .input__control:-webkit-autofill:hover,
1049
+ .input__control:-webkit-autofill:focus,
1050
+ .input__control:-webkit-autofill:active {
1051
+ box-shadow: 0 0 0 var(--sl-input-height-large) var(--sl-input-background-color-hover) inset !important;
1052
+ -webkit-text-fill-color: var(--sl-color-primary-500);
1053
+ caret-color: var(--sl-input-color);
1054
+ }
1055
+
1056
+ .input--filled .input__control:-webkit-autofill,
1057
+ .input--filled .input__control:-webkit-autofill:hover,
1058
+ .input--filled .input__control:-webkit-autofill:focus,
1059
+ .input--filled .input__control:-webkit-autofill:active {
1060
+ box-shadow: 0 0 0 var(--sl-input-height-large) var(--sl-input-filled-background-color) inset !important;
1061
+ }
1062
+
1063
+ .input__control::placeholder {
1064
+ color: var(--sl-input-placeholder-color);
1065
+ user-select: none;
1066
+ -webkit-user-select: none;
1067
+ }
1068
+
1069
+ .input:hover:not(.input--disabled) .input__control {
1070
+ color: var(--sl-input-color-hover);
1071
+ }
1072
+
1073
+ .input__control:focus {
1074
+ outline: none;
1075
+ }
1076
+
1077
+ .input__prefix,
1078
+ .input__suffix {
1079
+ display: inline-flex;
1080
+ flex: 0 0 auto;
1081
+ align-items: center;
1082
+ cursor: default;
1083
+ }
1084
+
1085
+ .input__prefix ::slotted(sl-icon),
1086
+ .input__suffix ::slotted(sl-icon) {
1087
+ color: var(--sl-input-icon-color);
1088
+ }
1089
+
1090
+ /*
1091
+ * Size modifiers
1092
+ */
1093
+
1094
+ .input--small {
1095
+ border-radius: var(--sl-input-border-radius-small);
1096
+ font-size: var(--sl-input-font-size-small);
1097
+ height: var(--sl-input-height-small);
1098
+ }
1099
+
1100
+ .input--small .input__control {
1101
+ height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2);
1102
+ padding: 0 var(--sl-input-spacing-small);
1103
+ }
1104
+
1105
+ .input--small .input__clear,
1106
+ .input--small .input__password-toggle {
1107
+ width: calc(1em + var(--sl-input-spacing-small) * 2);
1108
+ }
1109
+
1110
+ .input--small .input__prefix ::slotted(*) {
1111
+ margin-inline-start: var(--sl-input-spacing-small);
1112
+ }
1113
+
1114
+ .input--small .input__suffix ::slotted(*) {
1115
+ margin-inline-end: var(--sl-input-spacing-small);
1116
+ }
1117
+
1118
+ .input--medium {
1119
+ border-radius: var(--sl-input-border-radius-medium);
1120
+ font-size: var(--sl-input-font-size-medium);
1121
+ height: var(--sl-input-height-medium);
1122
+ }
1123
+
1124
+ .input--medium .input__control {
1125
+ height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2);
1126
+ padding: 0 var(--sl-input-spacing-medium);
1127
+ }
1128
+
1129
+ .input--medium .input__clear,
1130
+ .input--medium .input__password-toggle {
1131
+ width: calc(1em + var(--sl-input-spacing-medium) * 2);
1132
+ }
1133
+
1134
+ .input--medium .input__prefix ::slotted(*) {
1135
+ margin-inline-start: var(--sl-input-spacing-medium);
1136
+ }
1137
+
1138
+ .input--medium .input__suffix ::slotted(*) {
1139
+ margin-inline-end: var(--sl-input-spacing-medium);
1140
+ }
1141
+
1142
+ .input--large {
1143
+ border-radius: var(--sl-input-border-radius-large);
1144
+ font-size: var(--sl-input-font-size-large);
1145
+ height: var(--sl-input-height-large);
1146
+ }
1147
+
1148
+ .input--large .input__control {
1149
+ height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2);
1150
+ padding: 0 var(--sl-input-spacing-large);
1151
+ }
1152
+
1153
+ .input--large .input__clear,
1154
+ .input--large .input__password-toggle {
1155
+ width: calc(1em + var(--sl-input-spacing-large) * 2);
1156
+ }
1157
+
1158
+ .input--large .input__prefix ::slotted(*) {
1159
+ margin-inline-start: var(--sl-input-spacing-large);
1160
+ }
1161
+
1162
+ .input--large .input__suffix ::slotted(*) {
1163
+ margin-inline-end: var(--sl-input-spacing-large);
1164
+ }
1165
+
1166
+ /*
1167
+ * Pill modifier
1168
+ */
1169
+
1170
+ .input--pill.input--small {
1171
+ border-radius: var(--sl-input-height-small);
1172
+ }
1173
+
1174
+ .input--pill.input--medium {
1175
+ border-radius: var(--sl-input-height-medium);
1176
+ }
1177
+
1178
+ .input--pill.input--large {
1179
+ border-radius: var(--sl-input-height-large);
1180
+ }
1181
+
1182
+ /*
1183
+ * Clearable + Password Toggle
1184
+ */
1185
+
1186
+ .input__clear,
1187
+ .input__password-toggle {
1188
+ display: inline-flex;
1189
+ align-items: center;
1190
+ justify-content: center;
1191
+ font-size: inherit;
1192
+ color: var(--sl-input-icon-color);
1193
+ border: none;
1194
+ background: none;
1195
+ padding: 0;
1196
+ transition: var(--sl-transition-fast) color;
1197
+ cursor: pointer;
1198
+ }
1199
+
1200
+ .input__clear:hover,
1201
+ .input__password-toggle:hover {
1202
+ color: var(--sl-input-icon-color-hover);
1203
+ }
1204
+
1205
+ .input__clear:focus,
1206
+ .input__password-toggle:focus {
1207
+ outline: none;
1208
+ }
1209
+
1210
+ /* Don't show the browser's password toggle in Edge */
1211
+ ::-ms-reveal {
1212
+ display: none;
1213
+ }
1214
+
1215
+ /* Hide the built-in number spinner */
1216
+ .input--no-spin-buttons input[type='number']::-webkit-outer-spin-button,
1217
+ .input--no-spin-buttons input[type='number']::-webkit-inner-spin-button {
1218
+ -webkit-appearance: none;
1219
+ display: none;
1220
+ }
1221
+
1222
+ .input--no-spin-buttons input[type='number'] {
1223
+ -moz-appearance: textfield;
1224
+ }
1225
+ `, Qe = (o = "value") => (t, e) => {
1226
+ const r = t.constructor, s = r.prototype.attributeChangedCallback;
1227
+ r.prototype.attributeChangedCallback = function(i, n, d) {
1228
+ var l;
1229
+ const c = r.getPropertyOptions(o), b = typeof c.attribute == "string" ? c.attribute : o;
1230
+ if (i === b) {
1231
+ const p = c.converter || R, y = (typeof p == "function" ? p : (l = p == null ? void 0 : p.fromAttribute) != null ? l : R.fromAttribute)(d, c.type);
1232
+ this[o] !== y && (this[e] = y);
1233
+ }
1234
+ s.call(this, i, n, d);
1235
+ };
1236
+ }, Xe = $`
1237
+ .form-control .form-control__label {
1238
+ display: none;
1239
+ }
1240
+
1241
+ .form-control .form-control__help-text {
1242
+ display: none;
1243
+ }
1244
+
1245
+ /* Label */
1246
+ .form-control--has-label .form-control__label {
1247
+ display: inline-block;
1248
+ color: var(--sl-input-label-color);
1249
+ margin-bottom: var(--sl-spacing-3x-small);
1250
+ }
1251
+
1252
+ .form-control--has-label.form-control--small .form-control__label {
1253
+ font-size: var(--sl-input-label-font-size-small);
1254
+ }
1255
+
1256
+ .form-control--has-label.form-control--medium .form-control__label {
1257
+ font-size: var(--sl-input-label-font-size-medium);
1258
+ }
1259
+
1260
+ .form-control--has-label.form-control--large .form-control__label {
1261
+ font-size: var(--sl-input-label-font-size-large);
1262
+ }
1263
+
1264
+ :host([required]) .form-control--has-label .form-control__label::after {
1265
+ content: var(--sl-input-required-content);
1266
+ margin-inline-start: var(--sl-input-required-content-offset);
1267
+ color: var(--sl-input-required-content-color);
1268
+ }
1269
+
1270
+ /* Help text */
1271
+ .form-control--has-help-text .form-control__help-text {
1272
+ display: block;
1273
+ color: var(--sl-input-help-text-color);
1274
+ margin-top: var(--sl-spacing-3x-small);
1275
+ }
1276
+
1277
+ .form-control--has-help-text.form-control--small .form-control__help-text {
1278
+ font-size: var(--sl-input-help-text-font-size-small);
1279
+ }
1280
+
1281
+ .form-control--has-help-text.form-control--medium .form-control__help-text {
1282
+ font-size: var(--sl-input-help-text-font-size-medium);
1283
+ }
1284
+
1285
+ .form-control--has-help-text.form-control--large .form-control__help-text {
1286
+ font-size: var(--sl-input-help-text-font-size-large);
1287
+ }
1288
+
1289
+ .form-control--has-help-text.form-control--radio-group .form-control__help-text {
1290
+ margin-top: var(--sl-spacing-2x-small);
1291
+ }
1292
+ `, D = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakSet(), et = /* @__PURE__ */ new WeakMap(), ae = class {
1293
+ constructor(o, t) {
1294
+ this.handleFormData = (e) => {
1295
+ const r = this.options.disabled(this.host), s = this.options.name(this.host), i = this.options.value(this.host), n = this.host.tagName.toLowerCase() === "sl-button";
1296
+ this.host.isConnected && !r && !n && typeof s == "string" && s.length > 0 && typeof i < "u" && (Array.isArray(i) ? i.forEach((d) => {
1297
+ e.formData.append(s, d.toString());
1298
+ }) : e.formData.append(s, i.toString()));
1299
+ }, this.handleFormSubmit = (e) => {
1300
+ var r;
1301
+ const s = this.options.disabled(this.host), i = this.options.reportValidity;
1302
+ this.form && !this.form.noValidate && ((r = D.get(this.form)) == null || r.forEach((n) => {
1303
+ this.setUserInteracted(n, !0);
1304
+ })), this.form && !this.form.noValidate && !s && !i(this.host) && (e.preventDefault(), e.stopImmediatePropagation());
1305
+ }, this.handleFormReset = () => {
1306
+ this.options.setValue(this.host, this.options.defaultValue(this.host)), this.setUserInteracted(this.host, !1), et.set(this.host, []);
1307
+ }, this.handleInteraction = (e) => {
1308
+ const r = et.get(this.host);
1309
+ r.includes(e.type) || r.push(e.type), r.length === this.options.assumeInteractionOn.length && this.setUserInteracted(this.host, !0);
1310
+ }, this.checkFormValidity = () => {
1311
+ if (this.form && !this.form.noValidate) {
1312
+ const e = this.form.querySelectorAll("*");
1313
+ for (const r of e)
1314
+ if (typeof r.checkValidity == "function" && !r.checkValidity())
1315
+ return !1;
1316
+ }
1317
+ return !0;
1318
+ }, this.reportFormValidity = () => {
1319
+ if (this.form && !this.form.noValidate) {
1320
+ const e = this.form.querySelectorAll("*");
1321
+ for (const r of e)
1322
+ if (typeof r.reportValidity == "function" && !r.reportValidity())
1323
+ return !1;
1324
+ }
1325
+ return !0;
1326
+ }, (this.host = o).addController(this), this.options = X({
1327
+ form: (e) => {
1328
+ const r = e.form;
1329
+ if (r) {
1330
+ const i = e.getRootNode().querySelector(`#${r}`);
1331
+ if (i)
1332
+ return i;
1333
+ }
1334
+ return e.closest("form");
1335
+ },
1336
+ name: (e) => e.name,
1337
+ value: (e) => e.value,
1338
+ defaultValue: (e) => e.defaultValue,
1339
+ disabled: (e) => {
1340
+ var r;
1341
+ return (r = e.disabled) != null ? r : !1;
1342
+ },
1343
+ reportValidity: (e) => typeof e.reportValidity == "function" ? e.reportValidity() : !0,
1344
+ checkValidity: (e) => typeof e.checkValidity == "function" ? e.checkValidity() : !0,
1345
+ setValue: (e, r) => e.value = r,
1346
+ assumeInteractionOn: ["sl-input"]
1347
+ }, t);
1348
+ }
1349
+ hostConnected() {
1350
+ const o = this.options.form(this.host);
1351
+ o && this.attachForm(o), et.set(this.host, []), this.options.assumeInteractionOn.forEach((t) => {
1352
+ this.host.addEventListener(t, this.handleInteraction);
1353
+ });
1354
+ }
1355
+ hostDisconnected() {
1356
+ this.detachForm(), et.delete(this.host), this.options.assumeInteractionOn.forEach((o) => {
1357
+ this.host.removeEventListener(o, this.handleInteraction);
1358
+ });
1359
+ }
1360
+ hostUpdated() {
1361
+ const o = this.options.form(this.host);
1362
+ o || this.detachForm(), o && this.form !== o && (this.detachForm(), this.attachForm(o)), this.host.hasUpdated && this.setValidity(this.host.validity.valid);
1363
+ }
1364
+ attachForm(o) {
1365
+ o ? (this.form = o, D.has(this.form) ? D.get(this.form).add(this.host) : D.set(this.form, /* @__PURE__ */ new Set([this.host])), this.form.addEventListener("formdata", this.handleFormData), this.form.addEventListener("submit", this.handleFormSubmit), this.form.addEventListener("reset", this.handleFormReset), F.has(this.form) || (F.set(this.form, this.form.reportValidity), this.form.reportValidity = () => this.reportFormValidity()), H.has(this.form) || (H.set(this.form, this.form.checkValidity), this.form.checkValidity = () => this.checkFormValidity())) : this.form = void 0;
1366
+ }
1367
+ detachForm() {
1368
+ if (!this.form)
1369
+ return;
1370
+ const o = D.get(this.form);
1371
+ o && (o.delete(this.host), o.size <= 0 && (this.form.removeEventListener("formdata", this.handleFormData), this.form.removeEventListener("submit", this.handleFormSubmit), this.form.removeEventListener("reset", this.handleFormReset), F.has(this.form) && (this.form.reportValidity = F.get(this.form), F.delete(this.form)), H.has(this.form) && (this.form.checkValidity = H.get(this.form), H.delete(this.form)), this.form = void 0));
1372
+ }
1373
+ setUserInteracted(o, t) {
1374
+ t ? ht.add(o) : ht.delete(o), o.requestUpdate();
1375
+ }
1376
+ doAction(o, t) {
1377
+ if (this.form) {
1378
+ const e = document.createElement("button");
1379
+ e.type = o, e.style.position = "absolute", e.style.width = "0", e.style.height = "0", e.style.clipPath = "inset(50%)", e.style.overflow = "hidden", e.style.whiteSpace = "nowrap", t && (e.name = t.name, e.value = t.value, ["formaction", "formenctype", "formmethod", "formnovalidate", "formtarget"].forEach((r) => {
1380
+ t.hasAttribute(r) && e.setAttribute(r, t.getAttribute(r));
1381
+ })), this.form.append(e), e.click(), e.remove();
1382
+ }
1383
+ }
1384
+ /** Returns the associated `<form>` element, if one exists. */
1385
+ getForm() {
1386
+ var o;
1387
+ return (o = this.form) != null ? o : null;
1388
+ }
1389
+ /** Resets the form, restoring all the control to their default value */
1390
+ reset(o) {
1391
+ this.doAction("reset", o);
1392
+ }
1393
+ /** Submits the form, triggering validation and form data injection. */
1394
+ submit(o) {
1395
+ this.doAction("submit", o);
1396
+ }
1397
+ /**
1398
+ * Synchronously sets the form control's validity. Call this when you know the future validity but need to update
1399
+ * the host element immediately, i.e. before Lit updates the component in the next update.
1400
+ */
1401
+ setValidity(o) {
1402
+ const t = this.host, e = !!ht.has(t), r = !!t.required;
1403
+ t.toggleAttribute("data-required", r), t.toggleAttribute("data-optional", !r), t.toggleAttribute("data-invalid", !o), t.toggleAttribute("data-valid", o), t.toggleAttribute("data-user-invalid", !o && e), t.toggleAttribute("data-user-valid", o && e);
1404
+ }
1405
+ /**
1406
+ * Updates the form control's validity based on the current value of `host.validity.valid`. Call this when anything
1407
+ * that affects constraint validation changes so the component receives the correct validity states.
1408
+ */
1409
+ updateValidity() {
1410
+ const o = this.host;
1411
+ this.setValidity(o.validity.valid);
1412
+ }
1413
+ /**
1414
+ * Dispatches a non-bubbling, cancelable custom event of type `sl-invalid`.
1415
+ * If the `sl-invalid` event will be cancelled then the original `invalid`
1416
+ * event (which may have been passed as argument) will also be cancelled.
1417
+ * If no original `invalid` event has been passed then the `sl-invalid`
1418
+ * event will be cancelled before being dispatched.
1419
+ */
1420
+ emitInvalidEvent(o) {
1421
+ const t = new CustomEvent("sl-invalid", {
1422
+ bubbles: !1,
1423
+ composed: !1,
1424
+ cancelable: !0,
1425
+ detail: {}
1426
+ });
1427
+ o || t.preventDefault(), this.host.dispatchEvent(t) || o == null || o.preventDefault();
1428
+ }
1429
+ }, Et = Object.freeze({
1430
+ badInput: !1,
1431
+ customError: !1,
1432
+ patternMismatch: !1,
1433
+ rangeOverflow: !1,
1434
+ rangeUnderflow: !1,
1435
+ stepMismatch: !1,
1436
+ tooLong: !1,
1437
+ tooShort: !1,
1438
+ typeMismatch: !1,
1439
+ valid: !0,
1440
+ valueMissing: !1
1441
+ });
1442
+ Object.freeze(oe(X({}, Et), {
1443
+ valid: !1,
1444
+ valueMissing: !0
1445
+ }));
1446
+ Object.freeze(oe(X({}, Et), {
1447
+ valid: !1,
1448
+ customError: !0
1449
+ }));
1450
+ const gt = /* @__PURE__ */ new Set(), V = /* @__PURE__ */ new Map();
1451
+ let z, Pt = "ltr", Tt = "en";
1452
+ const le = typeof MutationObserver < "u" && typeof document < "u" && typeof document.documentElement < "u";
1453
+ if (le) {
1454
+ const o = new MutationObserver(de);
1455
+ Pt = document.documentElement.dir || "ltr", Tt = document.documentElement.lang || navigator.language, o.observe(document.documentElement, {
1456
+ attributes: !0,
1457
+ attributeFilter: ["dir", "lang"]
1458
+ });
1459
+ }
1460
+ function ue(...o) {
1461
+ o.map((t) => {
1462
+ const e = t.$code.toLowerCase();
1463
+ V.has(e) ? V.set(e, Object.assign(Object.assign({}, V.get(e)), t)) : V.set(e, t), z || (z = t);
1464
+ }), de();
1465
+ }
1466
+ function de() {
1467
+ le && (Pt = document.documentElement.dir || "ltr", Tt = document.documentElement.lang || navigator.language), [...gt.keys()].map((o) => {
1468
+ typeof o.requestUpdate == "function" && o.requestUpdate();
1469
+ });
1470
+ }
1471
+ let to = class {
1472
+ constructor(t) {
1473
+ this.host = t, this.host.addController(this);
1474
+ }
1475
+ hostConnected() {
1476
+ gt.add(this.host);
1477
+ }
1478
+ hostDisconnected() {
1479
+ gt.delete(this.host);
1480
+ }
1481
+ dir() {
1482
+ return `${this.host.dir || Pt}`.toLowerCase();
1483
+ }
1484
+ lang() {
1485
+ return `${this.host.lang || Tt}`.toLowerCase();
1486
+ }
1487
+ getTranslationData(t) {
1488
+ var e, r;
1489
+ const s = new Intl.Locale(t.replace(/_/g, "-")), i = s == null ? void 0 : s.language.toLowerCase(), n = (r = (e = s == null ? void 0 : s.region) === null || e === void 0 ? void 0 : e.toLowerCase()) !== null && r !== void 0 ? r : "", d = V.get(`${i}-${n}`), l = V.get(i);
1490
+ return { locale: s, language: i, region: n, primary: d, secondary: l };
1491
+ }
1492
+ exists(t, e) {
1493
+ var r;
1494
+ const { primary: s, secondary: i } = this.getTranslationData((r = e.lang) !== null && r !== void 0 ? r : this.lang());
1495
+ return e = Object.assign({ includeFallback: !1 }, e), !!(s && s[t] || i && i[t] || e.includeFallback && z && z[t]);
1496
+ }
1497
+ term(t, ...e) {
1498
+ const { primary: r, secondary: s } = this.getTranslationData(this.lang());
1499
+ let i;
1500
+ if (r && r[t])
1501
+ i = r[t];
1502
+ else if (s && s[t])
1503
+ i = s[t];
1504
+ else if (z && z[t])
1505
+ i = z[t];
1506
+ else
1507
+ return console.error(`No translation found for: ${String(t)}`), String(t);
1508
+ return typeof i == "function" ? i(...e) : i;
1509
+ }
1510
+ date(t, e) {
1511
+ return t = new Date(t), new Intl.DateTimeFormat(this.lang(), e).format(t);
1512
+ }
1513
+ number(t, e) {
1514
+ return t = Number(t), isNaN(t) ? "" : new Intl.NumberFormat(this.lang(), e).format(t);
1515
+ }
1516
+ relativeTime(t, e, r) {
1517
+ return new Intl.RelativeTimeFormat(this.lang(), r).format(t, e);
1518
+ }
1519
+ };
1520
+ var ce = {
1521
+ $code: "en",
1522
+ $name: "English",
1523
+ $dir: "ltr",
1524
+ carousel: "Carousel",
1525
+ clearEntry: "Clear entry",
1526
+ close: "Close",
1527
+ copied: "Copied",
1528
+ copy: "Copy",
1529
+ currentValue: "Current value",
1530
+ error: "Error",
1531
+ goToSlide: (o, t) => `Go to slide ${o} of ${t}`,
1532
+ hidePassword: "Hide password",
1533
+ loading: "Loading",
1534
+ nextSlide: "Next slide",
1535
+ numOptionsSelected: (o) => o === 0 ? "No options selected" : o === 1 ? "1 option selected" : `${o} options selected`,
1536
+ previousSlide: "Previous slide",
1537
+ progress: "Progress",
1538
+ remove: "Remove",
1539
+ resize: "Resize",
1540
+ scrollToEnd: "Scroll to end",
1541
+ scrollToStart: "Scroll to start",
1542
+ selectAColorFromTheScreen: "Select a color from the screen",
1543
+ showPassword: "Show password",
1544
+ slideNum: (o) => `Slide ${o}`,
1545
+ toggleColorFormat: "Toggle color format"
1546
+ };
1547
+ ue(ce);
1548
+ var eo = ce, zt = class extends to {
1549
+ };
1550
+ ue(eo);
1551
+ var vt = "";
1552
+ function jt(o) {
1553
+ vt = o;
1554
+ }
1555
+ function oo(o = "") {
1556
+ if (!vt) {
1557
+ const t = [...document.getElementsByTagName("script")], e = t.find((r) => r.hasAttribute("data-shoelace"));
1558
+ if (e)
1559
+ jt(e.getAttribute("data-shoelace"));
1560
+ else {
1561
+ const r = t.find((i) => /shoelace(\.min)?\.js($|\?)/.test(i.src) || /shoelace-autoloader(\.min)?\.js($|\?)/.test(i.src));
1562
+ let s = "";
1563
+ r && (s = r.getAttribute("src")), jt(s.split("/").slice(0, -1).join("/"));
1564
+ }
1565
+ }
1566
+ return vt.replace(/\/$/, "") + (o ? `/${o.replace(/^\//, "")}` : "");
1567
+ }
1568
+ var ro = {
1569
+ name: "default",
1570
+ resolver: (o) => oo(`assets/icons/${o}.svg`)
1571
+ }, so = ro, qt = {
1572
+ caret: `
1573
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
1574
+ <polyline points="6 9 12 15 18 9"></polyline>
1575
+ </svg>
1576
+ `,
1577
+ check: `
1578
+ <svg part="checked-icon" class="checkbox__icon" viewBox="0 0 16 16">
1579
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
1580
+ <g stroke="currentColor">
1581
+ <g transform="translate(3.428571, 3.428571)">
1582
+ <path d="M0,5.71428571 L3.42857143,9.14285714"></path>
1583
+ <path d="M9.14285714,0 L3.42857143,9.14285714"></path>
1584
+ </g>
1585
+ </g>
1586
+ </g>
1587
+ </svg>
1588
+ `,
1589
+ "chevron-down": `
1590
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">
1591
+ <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/>
1592
+ </svg>
1593
+ `,
1594
+ "chevron-left": `
1595
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16">
1596
+ <path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/>
1597
+ </svg>
1598
+ `,
1599
+ "chevron-right": `
1600
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16">
1601
+ <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/>
1602
+ </svg>
1603
+ `,
1604
+ copy: `
1605
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16">
1606
+ <path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V2Zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H6ZM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1H2Z"/>
1607
+ </svg>
1608
+ `,
1609
+ eye: `
1610
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16">
1611
+ <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
1612
+ <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
1613
+ </svg>
1614
+ `,
1615
+ "eye-slash": `
1616
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash" viewBox="0 0 16 16">
1617
+ <path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/>
1618
+ <path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/>
1619
+ <path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"/>
1620
+ </svg>
1621
+ `,
1622
+ eyedropper: `
1623
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eyedropper" viewBox="0 0 16 16">
1624
+ <path d="M13.354.646a1.207 1.207 0 0 0-1.708 0L8.5 3.793l-.646-.647a.5.5 0 1 0-.708.708L8.293 5l-7.147 7.146A.5.5 0 0 0 1 12.5v1.793l-.854.853a.5.5 0 1 0 .708.707L1.707 15H3.5a.5.5 0 0 0 .354-.146L11 7.707l1.146 1.147a.5.5 0 0 0 .708-.708l-.647-.646 3.147-3.146a1.207 1.207 0 0 0 0-1.708l-2-2zM2 12.707l7-7L10.293 7l-7 7H2v-1.293z"></path>
1625
+ </svg>
1626
+ `,
1627
+ "grip-vertical": `
1628
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grip-vertical" viewBox="0 0 16 16">
1629
+ <path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"></path>
1630
+ </svg>
1631
+ `,
1632
+ indeterminate: `
1633
+ <svg part="indeterminate-icon" class="checkbox__icon" viewBox="0 0 16 16">
1634
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
1635
+ <g stroke="currentColor" stroke-width="2">
1636
+ <g transform="translate(2.285714, 6.857143)">
1637
+ <path d="M10.2857143,1.14285714 L1.14285714,1.14285714"></path>
1638
+ </g>
1639
+ </g>
1640
+ </g>
1641
+ </svg>
1642
+ `,
1643
+ "person-fill": `
1644
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16">
1645
+ <path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>
1646
+ </svg>
1647
+ `,
1648
+ "play-fill": `
1649
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16">
1650
+ <path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path>
1651
+ </svg>
1652
+ `,
1653
+ "pause-fill": `
1654
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause-fill" viewBox="0 0 16 16">
1655
+ <path d="M5.5 3.5A1.5 1.5 0 0 1 7 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5zm5 0A1.5 1.5 0 0 1 12 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5z"></path>
1656
+ </svg>
1657
+ `,
1658
+ radio: `
1659
+ <svg part="checked-icon" class="radio__icon" viewBox="0 0 16 16">
1660
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
1661
+ <g fill="currentColor">
1662
+ <circle cx="8" cy="8" r="3.42857143"></circle>
1663
+ </g>
1664
+ </g>
1665
+ </svg>
1666
+ `,
1667
+ "star-fill": `
1668
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">
1669
+ <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
1670
+ </svg>
1671
+ `,
1672
+ "x-lg": `
1673
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16">
1674
+ <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>
1675
+ </svg>
1676
+ `,
1677
+ "x-circle-fill": `
1678
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16">
1679
+ <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"></path>
1680
+ </svg>
1681
+ `
1682
+ }, io = {
1683
+ name: "system",
1684
+ resolver: (o) => o in qt ? `data:image/svg+xml,${encodeURIComponent(qt[o])}` : ""
1685
+ }, no = io, ao = [so, no], yt = [];
1686
+ function lo(o) {
1687
+ yt.push(o);
1688
+ }
1689
+ function uo(o) {
1690
+ yt = yt.filter((t) => t !== o);
1691
+ }
1692
+ function Wt(o) {
1693
+ return ao.find((t) => t.name === o);
1694
+ }
1695
+ var co = $`
1696
+ :host {
1697
+ display: inline-block;
1698
+ width: 1em;
1699
+ height: 1em;
1700
+ box-sizing: content-box !important;
1701
+ }
1702
+
1703
+ svg {
1704
+ display: block;
1705
+ height: 100%;
1706
+ width: 100%;
1707
+ }
1708
+ `;
1709
+ function M(o, t) {
1710
+ const e = X({
1711
+ waitUntilFirstUpdate: !1
1712
+ }, t);
1713
+ return (r, s) => {
1714
+ const { update: i } = r, n = Array.isArray(o) ? o : [o];
1715
+ r.update = function(d) {
1716
+ n.forEach((l) => {
1717
+ const c = l;
1718
+ if (d.has(c)) {
1719
+ const b = d.get(c), p = this[c];
1720
+ b !== p && (!e.waitUntilFirstUpdate || this.hasUpdated) && this[s](b, p);
1721
+ }
1722
+ }), i.call(this, d);
1723
+ };
1724
+ };
1725
+ }
1726
+ /**
1727
+ * @license
1728
+ * Copyright 2020 Google LLC
1729
+ * SPDX-License-Identifier: BSD-3-Clause
1730
+ */
1731
+ const ho = (o, t) => (o == null ? void 0 : o._$litType$) !== void 0, po = (o) => o.strings === void 0, bo = {}, fo = (o, t = bo) => o._$AH = t;
1732
+ var j = Symbol(), ot = Symbol(), pt, bt = /* @__PURE__ */ new Map(), x = class extends k {
1733
+ constructor() {
1734
+ super(...arguments), this.initialRender = !1, this.svg = null, this.label = "", this.library = "default";
1735
+ }
1736
+ /** Given a URL, this function returns the resulting SVG element or an appropriate error symbol. */
1737
+ async resolveIcon(o, t) {
1738
+ var e;
1739
+ let r;
1740
+ if (t != null && t.spriteSheet) {
1741
+ this.svg = v`<svg part="svg">
1742
+ <use part="use" href="${o}"></use>
1743
+ </svg>`, await this.updateComplete;
1744
+ const s = this.shadowRoot.querySelector("[part='svg']");
1745
+ return typeof t.mutator == "function" && t.mutator(s), this.svg;
1746
+ }
1747
+ try {
1748
+ if (r = await fetch(o, { mode: "cors" }), !r.ok)
1749
+ return r.status === 410 ? j : ot;
1750
+ } catch {
1751
+ return ot;
1752
+ }
1753
+ try {
1754
+ const s = document.createElement("div");
1755
+ s.innerHTML = await r.text();
1756
+ const i = s.firstElementChild;
1757
+ if (((e = i == null ? void 0 : i.tagName) == null ? void 0 : e.toLowerCase()) !== "svg")
1758
+ return j;
1759
+ pt || (pt = new DOMParser());
1760
+ const d = pt.parseFromString(i.outerHTML, "text/html").body.querySelector("svg");
1761
+ return d ? (d.part.add("svg"), document.adoptNode(d)) : j;
1762
+ } catch {
1763
+ return j;
1764
+ }
1765
+ }
1766
+ connectedCallback() {
1767
+ super.connectedCallback(), lo(this);
1768
+ }
1769
+ firstUpdated() {
1770
+ this.initialRender = !0, this.setIcon();
1771
+ }
1772
+ disconnectedCallback() {
1773
+ super.disconnectedCallback(), uo(this);
1774
+ }
1775
+ getIconSource() {
1776
+ const o = Wt(this.library);
1777
+ return this.name && o ? {
1778
+ url: o.resolver(this.name),
1779
+ fromLibrary: !0
1780
+ } : {
1781
+ url: this.src,
1782
+ fromLibrary: !1
1783
+ };
1784
+ }
1785
+ handleLabelChange() {
1786
+ typeof this.label == "string" && this.label.length > 0 ? (this.setAttribute("role", "img"), this.setAttribute("aria-label", this.label), this.removeAttribute("aria-hidden")) : (this.removeAttribute("role"), this.removeAttribute("aria-label"), this.setAttribute("aria-hidden", "true"));
1787
+ }
1788
+ async setIcon() {
1789
+ var o;
1790
+ const { url: t, fromLibrary: e } = this.getIconSource(), r = e ? Wt(this.library) : void 0;
1791
+ if (!t) {
1792
+ this.svg = null;
1793
+ return;
1794
+ }
1795
+ let s = bt.get(t);
1796
+ if (s || (s = this.resolveIcon(t, r), bt.set(t, s)), !this.initialRender)
1797
+ return;
1798
+ const i = await s;
1799
+ if (i === ot && bt.delete(t), t === this.getIconSource().url) {
1800
+ if (ho(i)) {
1801
+ this.svg = i;
1802
+ return;
1803
+ }
1804
+ switch (i) {
1805
+ case ot:
1806
+ case j:
1807
+ this.svg = null, this.emit("sl-error");
1808
+ break;
1809
+ default:
1810
+ this.svg = i.cloneNode(!0), (o = r == null ? void 0 : r.mutator) == null || o.call(r, this.svg), this.emit("sl-load");
1811
+ }
1812
+ }
1813
+ }
1814
+ render() {
1815
+ return this.svg;
1816
+ }
1817
+ };
1818
+ x.styles = [Q, co];
1819
+ a([
1820
+ at()
1821
+ ], x.prototype, "svg", 2);
1822
+ a([
1823
+ u({ reflect: !0 })
1824
+ ], x.prototype, "name", 2);
1825
+ a([
1826
+ u()
1827
+ ], x.prototype, "src", 2);
1828
+ a([
1829
+ u()
1830
+ ], x.prototype, "label", 2);
1831
+ a([
1832
+ u({ reflect: !0 })
1833
+ ], x.prototype, "library", 2);
1834
+ a([
1835
+ M("label")
1836
+ ], x.prototype, "handleLabelChange", 1);
1837
+ a([
1838
+ M(["name", "src", "library"])
1839
+ ], x.prototype, "setIcon", 1);
1840
+ /**
1841
+ * @license
1842
+ * Copyright 2018 Google LLC
1843
+ * SPDX-License-Identifier: BSD-3-Clause
1844
+ */
1845
+ const m = (o) => o ?? g;
1846
+ /**
1847
+ * @license
1848
+ * Copyright 2020 Google LLC
1849
+ * SPDX-License-Identifier: BSD-3-Clause
1850
+ */
1851
+ const mo = se(class extends ie {
1852
+ constructor(o) {
1853
+ if (super(o), o.type !== T.PROPERTY && o.type !== T.ATTRIBUTE && o.type !== T.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
1854
+ if (!po(o)) throw Error("`live` bindings can only contain a single expression");
1855
+ }
1856
+ render(o) {
1857
+ return o;
1858
+ }
1859
+ update(o, [t]) {
1860
+ if (t === w || t === g) return t;
1861
+ const e = o.element, r = o.name;
1862
+ if (o.type === T.PROPERTY) {
1863
+ if (t === e[r]) return w;
1864
+ } else if (o.type === T.BOOLEAN_ATTRIBUTE) {
1865
+ if (!!t === e.hasAttribute(r)) return w;
1866
+ } else if (o.type === T.ATTRIBUTE && e.getAttribute(r) === t + "") return w;
1867
+ return fo(o), t;
1868
+ }
1869
+ });
1870
+ var h = class extends k {
1871
+ constructor() {
1872
+ super(...arguments), this.formControlController = new ae(this, {
1873
+ assumeInteractionOn: ["sl-blur", "sl-input"]
1874
+ }), this.hasSlotController = new St(this, "help-text", "label"), this.localize = new zt(this), this.hasFocus = !1, this.title = "", this.__numberInput = Object.assign(document.createElement("input"), { type: "number" }), this.__dateInput = Object.assign(document.createElement("input"), { type: "date" }), this.type = "text", this.name = "", this.value = "", this.defaultValue = "", this.size = "medium", this.filled = !1, this.pill = !1, this.label = "", this.helpText = "", this.clearable = !1, this.disabled = !1, this.placeholder = "", this.readonly = !1, this.passwordToggle = !1, this.passwordVisible = !1, this.noSpinButtons = !1, this.form = "", this.required = !1, this.spellcheck = !0;
1875
+ }
1876
+ //
1877
+ // NOTE: We use an in-memory input for these getters/setters instead of the one in the template because the properties
1878
+ // can be set before the component is rendered.
1879
+ //
1880
+ /**
1881
+ * Gets or sets the current value as a `Date` object. Returns `null` if the value can't be converted. This will use the native `<input type="{{type}}">` implementation and may result in an error.
1882
+ */
1883
+ get valueAsDate() {
1884
+ var o;
1885
+ return this.__dateInput.type = this.type, this.__dateInput.value = this.value, ((o = this.input) == null ? void 0 : o.valueAsDate) || this.__dateInput.valueAsDate;
1886
+ }
1887
+ set valueAsDate(o) {
1888
+ this.__dateInput.type = this.type, this.__dateInput.valueAsDate = o, this.value = this.__dateInput.value;
1889
+ }
1890
+ /** Gets or sets the current value as a number. Returns `NaN` if the value can't be converted. */
1891
+ get valueAsNumber() {
1892
+ var o;
1893
+ return this.__numberInput.value = this.value, ((o = this.input) == null ? void 0 : o.valueAsNumber) || this.__numberInput.valueAsNumber;
1894
+ }
1895
+ set valueAsNumber(o) {
1896
+ this.__numberInput.valueAsNumber = o, this.value = this.__numberInput.value;
1897
+ }
1898
+ /** Gets the validity state object */
1899
+ get validity() {
1900
+ return this.input.validity;
1901
+ }
1902
+ /** Gets the validation message */
1903
+ get validationMessage() {
1904
+ return this.input.validationMessage;
1905
+ }
1906
+ firstUpdated() {
1907
+ this.formControlController.updateValidity();
1908
+ }
1909
+ handleBlur() {
1910
+ this.hasFocus = !1, this.emit("sl-blur");
1911
+ }
1912
+ handleChange() {
1913
+ this.value = this.input.value, this.emit("sl-change");
1914
+ }
1915
+ handleClearClick(o) {
1916
+ o.preventDefault(), this.value !== "" && (this.value = "", this.emit("sl-clear"), this.emit("sl-input"), this.emit("sl-change")), this.input.focus();
1917
+ }
1918
+ handleFocus() {
1919
+ this.hasFocus = !0, this.emit("sl-focus");
1920
+ }
1921
+ handleInput() {
1922
+ this.value = this.input.value, this.formControlController.updateValidity(), this.emit("sl-input");
1923
+ }
1924
+ handleInvalid(o) {
1925
+ this.formControlController.setValidity(!1), this.formControlController.emitInvalidEvent(o);
1926
+ }
1927
+ handleKeyDown(o) {
1928
+ const t = o.metaKey || o.ctrlKey || o.shiftKey || o.altKey;
1929
+ o.key === "Enter" && !t && setTimeout(() => {
1930
+ !o.defaultPrevented && !o.isComposing && this.formControlController.submit();
1931
+ });
1932
+ }
1933
+ handlePasswordToggle() {
1934
+ this.passwordVisible = !this.passwordVisible;
1935
+ }
1936
+ handleDisabledChange() {
1937
+ this.formControlController.setValidity(this.disabled);
1938
+ }
1939
+ handleStepChange() {
1940
+ this.input.step = String(this.step), this.formControlController.updateValidity();
1941
+ }
1942
+ async handleValueChange() {
1943
+ await this.updateComplete, this.formControlController.updateValidity();
1944
+ }
1945
+ /** Sets focus on the input. */
1946
+ focus(o) {
1947
+ this.input.focus(o);
1948
+ }
1949
+ /** Removes focus from the input. */
1950
+ blur() {
1951
+ this.input.blur();
1952
+ }
1953
+ /** Selects all the text in the input. */
1954
+ select() {
1955
+ this.input.select();
1956
+ }
1957
+ /** Sets the start and end positions of the text selection (0-based). */
1958
+ setSelectionRange(o, t, e = "none") {
1959
+ this.input.setSelectionRange(o, t, e);
1960
+ }
1961
+ /** Replaces a range of text with a new string. */
1962
+ setRangeText(o, t, e, r = "preserve") {
1963
+ const s = t ?? this.input.selectionStart, i = e ?? this.input.selectionEnd;
1964
+ this.input.setRangeText(o, s, i, r), this.value !== this.input.value && (this.value = this.input.value);
1965
+ }
1966
+ /** Displays the browser picker for an input element (only works if the browser supports it for the input type). */
1967
+ showPicker() {
1968
+ "showPicker" in HTMLInputElement.prototype && this.input.showPicker();
1969
+ }
1970
+ /** Increments the value of a numeric input type by the value of the step attribute. */
1971
+ stepUp() {
1972
+ this.input.stepUp(), this.value !== this.input.value && (this.value = this.input.value);
1973
+ }
1974
+ /** Decrements the value of a numeric input type by the value of the step attribute. */
1975
+ stepDown() {
1976
+ this.input.stepDown(), this.value !== this.input.value && (this.value = this.input.value);
1977
+ }
1978
+ /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */
1979
+ checkValidity() {
1980
+ return this.input.checkValidity();
1981
+ }
1982
+ /** Gets the associated form, if one exists. */
1983
+ getForm() {
1984
+ return this.formControlController.getForm();
1985
+ }
1986
+ /** Checks for validity and shows the browser's validation message if the control is invalid. */
1987
+ reportValidity() {
1988
+ return this.input.reportValidity();
1989
+ }
1990
+ /** Sets a custom validation message. Pass an empty string to restore validity. */
1991
+ setCustomValidity(o) {
1992
+ this.input.setCustomValidity(o), this.formControlController.updateValidity();
1993
+ }
1994
+ render() {
1995
+ const o = this.hasSlotController.test("label"), t = this.hasSlotController.test("help-text"), e = this.label ? !0 : !!o, r = this.helpText ? !0 : !!t, i = this.clearable && !this.disabled && !this.readonly && (typeof this.value == "number" || this.value.length > 0);
1996
+ return v`
1997
+ <div
1998
+ part="form-control"
1999
+ class=${it({
2000
+ "form-control": !0,
2001
+ "form-control--small": this.size === "small",
2002
+ "form-control--medium": this.size === "medium",
2003
+ "form-control--large": this.size === "large",
2004
+ "form-control--has-label": e,
2005
+ "form-control--has-help-text": r
2006
+ })}
2007
+ >
2008
+ <label
2009
+ part="form-control-label"
2010
+ class="form-control__label"
2011
+ for="input"
2012
+ aria-hidden=${e ? "false" : "true"}
2013
+ >
2014
+ <slot name="label">${this.label}</slot>
2015
+ </label>
2016
+
2017
+ <div part="form-control-input" class="form-control-input">
2018
+ <div
2019
+ part="base"
2020
+ class=${it({
2021
+ input: !0,
2022
+ // Sizes
2023
+ "input--small": this.size === "small",
2024
+ "input--medium": this.size === "medium",
2025
+ "input--large": this.size === "large",
2026
+ // States
2027
+ "input--pill": this.pill,
2028
+ "input--standard": !this.filled,
2029
+ "input--filled": this.filled,
2030
+ "input--disabled": this.disabled,
2031
+ "input--focused": this.hasFocus,
2032
+ "input--empty": !this.value,
2033
+ "input--no-spin-buttons": this.noSpinButtons
2034
+ })}
2035
+ >
2036
+ <span part="prefix" class="input__prefix">
2037
+ <slot name="prefix"></slot>
2038
+ </span>
2039
+
2040
+ <input
2041
+ part="input"
2042
+ id="input"
2043
+ class="input__control"
2044
+ type=${this.type === "password" && this.passwordVisible ? "text" : this.type}
2045
+ title=${this.title}
2046
+ name=${m(this.name)}
2047
+ ?disabled=${this.disabled}
2048
+ ?readonly=${this.readonly}
2049
+ ?required=${this.required}
2050
+ placeholder=${m(this.placeholder)}
2051
+ minlength=${m(this.minlength)}
2052
+ maxlength=${m(this.maxlength)}
2053
+ min=${m(this.min)}
2054
+ max=${m(this.max)}
2055
+ step=${m(this.step)}
2056
+ .value=${mo(this.value)}
2057
+ autocapitalize=${m(this.autocapitalize)}
2058
+ autocomplete=${m(this.autocomplete)}
2059
+ autocorrect=${m(this.autocorrect)}
2060
+ ?autofocus=${this.autofocus}
2061
+ spellcheck=${this.spellcheck}
2062
+ pattern=${m(this.pattern)}
2063
+ enterkeyhint=${m(this.enterkeyhint)}
2064
+ inputmode=${m(this.inputmode)}
2065
+ aria-describedby="help-text"
2066
+ @change=${this.handleChange}
2067
+ @input=${this.handleInput}
2068
+ @invalid=${this.handleInvalid}
2069
+ @keydown=${this.handleKeyDown}
2070
+ @focus=${this.handleFocus}
2071
+ @blur=${this.handleBlur}
2072
+ />
2073
+
2074
+ ${i ? v`
2075
+ <button
2076
+ part="clear-button"
2077
+ class="input__clear"
2078
+ type="button"
2079
+ aria-label=${this.localize.term("clearEntry")}
2080
+ @click=${this.handleClearClick}
2081
+ tabindex="-1"
2082
+ >
2083
+ <slot name="clear-icon">
2084
+ <sl-icon name="x-circle-fill" library="system"></sl-icon>
2085
+ </slot>
2086
+ </button>
2087
+ ` : ""}
2088
+ ${this.passwordToggle && !this.disabled ? v`
2089
+ <button
2090
+ part="password-toggle-button"
2091
+ class="input__password-toggle"
2092
+ type="button"
2093
+ aria-label=${this.localize.term(this.passwordVisible ? "hidePassword" : "showPassword")}
2094
+ @click=${this.handlePasswordToggle}
2095
+ tabindex="-1"
2096
+ >
2097
+ ${this.passwordVisible ? v`
2098
+ <slot name="show-password-icon">
2099
+ <sl-icon name="eye-slash" library="system"></sl-icon>
2100
+ </slot>
2101
+ ` : v`
2102
+ <slot name="hide-password-icon">
2103
+ <sl-icon name="eye" library="system"></sl-icon>
2104
+ </slot>
2105
+ `}
2106
+ </button>
2107
+ ` : ""}
2108
+
2109
+ <span part="suffix" class="input__suffix">
2110
+ <slot name="suffix"></slot>
2111
+ </span>
2112
+ </div>
2113
+ </div>
2114
+
2115
+ <div
2116
+ part="form-control-help-text"
2117
+ id="help-text"
2118
+ class="form-control__help-text"
2119
+ aria-hidden=${r ? "false" : "true"}
2120
+ >
2121
+ <slot name="help-text">${this.helpText}</slot>
2122
+ </div>
2123
+ </div>
2124
+ `;
2125
+ }
2126
+ };
2127
+ h.styles = [Q, Xe, Ge];
2128
+ h.dependencies = { "sl-icon": x };
2129
+ a([
2130
+ re(".input__control")
2131
+ ], h.prototype, "input", 2);
2132
+ a([
2133
+ at()
2134
+ ], h.prototype, "hasFocus", 2);
2135
+ a([
2136
+ u()
2137
+ ], h.prototype, "title", 2);
2138
+ a([
2139
+ u({ reflect: !0 })
2140
+ ], h.prototype, "type", 2);
2141
+ a([
2142
+ u()
2143
+ ], h.prototype, "name", 2);
2144
+ a([
2145
+ u()
2146
+ ], h.prototype, "value", 2);
2147
+ a([
2148
+ Qe()
2149
+ ], h.prototype, "defaultValue", 2);
2150
+ a([
2151
+ u({ reflect: !0 })
2152
+ ], h.prototype, "size", 2);
2153
+ a([
2154
+ u({ type: Boolean, reflect: !0 })
2155
+ ], h.prototype, "filled", 2);
2156
+ a([
2157
+ u({ type: Boolean, reflect: !0 })
2158
+ ], h.prototype, "pill", 2);
2159
+ a([
2160
+ u()
2161
+ ], h.prototype, "label", 2);
2162
+ a([
2163
+ u({ attribute: "help-text" })
2164
+ ], h.prototype, "helpText", 2);
2165
+ a([
2166
+ u({ type: Boolean })
2167
+ ], h.prototype, "clearable", 2);
2168
+ a([
2169
+ u({ type: Boolean, reflect: !0 })
2170
+ ], h.prototype, "disabled", 2);
2171
+ a([
2172
+ u()
2173
+ ], h.prototype, "placeholder", 2);
2174
+ a([
2175
+ u({ type: Boolean, reflect: !0 })
2176
+ ], h.prototype, "readonly", 2);
2177
+ a([
2178
+ u({ attribute: "password-toggle", type: Boolean })
2179
+ ], h.prototype, "passwordToggle", 2);
2180
+ a([
2181
+ u({ attribute: "password-visible", type: Boolean })
2182
+ ], h.prototype, "passwordVisible", 2);
2183
+ a([
2184
+ u({ attribute: "no-spin-buttons", type: Boolean })
2185
+ ], h.prototype, "noSpinButtons", 2);
2186
+ a([
2187
+ u({ reflect: !0 })
2188
+ ], h.prototype, "form", 2);
2189
+ a([
2190
+ u({ type: Boolean, reflect: !0 })
2191
+ ], h.prototype, "required", 2);
2192
+ a([
2193
+ u()
2194
+ ], h.prototype, "pattern", 2);
2195
+ a([
2196
+ u({ type: Number })
2197
+ ], h.prototype, "minlength", 2);
2198
+ a([
2199
+ u({ type: Number })
2200
+ ], h.prototype, "maxlength", 2);
2201
+ a([
2202
+ u()
2203
+ ], h.prototype, "min", 2);
2204
+ a([
2205
+ u()
2206
+ ], h.prototype, "max", 2);
2207
+ a([
2208
+ u()
2209
+ ], h.prototype, "step", 2);
2210
+ a([
2211
+ u()
2212
+ ], h.prototype, "autocapitalize", 2);
2213
+ a([
2214
+ u()
2215
+ ], h.prototype, "autocorrect", 2);
2216
+ a([
2217
+ u()
2218
+ ], h.prototype, "autocomplete", 2);
2219
+ a([
2220
+ u({ type: Boolean })
2221
+ ], h.prototype, "autofocus", 2);
2222
+ a([
2223
+ u()
2224
+ ], h.prototype, "enterkeyhint", 2);
2225
+ a([
2226
+ u({
2227
+ type: Boolean,
2228
+ converter: {
2229
+ // Allow "true|false" attribute values but keep the property boolean
2230
+ fromAttribute: (o) => !(!o || o === "false"),
2231
+ toAttribute: (o) => o ? "true" : "false"
2232
+ }
2233
+ })
2234
+ ], h.prototype, "spellcheck", 2);
2235
+ a([
2236
+ u()
2237
+ ], h.prototype, "inputmode", 2);
2238
+ a([
2239
+ M("disabled", { waitUntilFirstUpdate: !0 })
2240
+ ], h.prototype, "handleDisabledChange", 1);
2241
+ a([
2242
+ M("step", { waitUntilFirstUpdate: !0 })
2243
+ ], h.prototype, "handleStepChange", 1);
2244
+ a([
2245
+ M("value", { waitUntilFirstUpdate: !0 })
2246
+ ], h.prototype, "handleValueChange", 1);
2247
+ h.define("sl-input");
2248
+ var go = $`
2249
+ :host {
2250
+ --track-width: 2px;
2251
+ --track-color: rgb(128 128 128 / 25%);
2252
+ --indicator-color: var(--sl-color-primary-600);
2253
+ --speed: 2s;
2254
+
2255
+ display: inline-flex;
2256
+ width: 1em;
2257
+ height: 1em;
2258
+ flex: none;
2259
+ }
2260
+
2261
+ .spinner {
2262
+ flex: 1 1 auto;
2263
+ height: 100%;
2264
+ width: 100%;
2265
+ }
2266
+
2267
+ .spinner__track,
2268
+ .spinner__indicator {
2269
+ fill: none;
2270
+ stroke-width: var(--track-width);
2271
+ r: calc(0.5em - var(--track-width) / 2);
2272
+ cx: 0.5em;
2273
+ cy: 0.5em;
2274
+ transform-origin: 50% 50%;
2275
+ }
2276
+
2277
+ .spinner__track {
2278
+ stroke: var(--track-color);
2279
+ transform-origin: 0% 0%;
2280
+ }
2281
+
2282
+ .spinner__indicator {
2283
+ stroke: var(--indicator-color);
2284
+ stroke-linecap: round;
2285
+ stroke-dasharray: 150% 75%;
2286
+ animation: spin var(--speed) linear infinite;
2287
+ }
2288
+
2289
+ @keyframes spin {
2290
+ 0% {
2291
+ transform: rotate(0deg);
2292
+ stroke-dasharray: 0.05em, 3em;
2293
+ }
2294
+
2295
+ 50% {
2296
+ transform: rotate(450deg);
2297
+ stroke-dasharray: 1.375em, 1.375em;
2298
+ }
2299
+
2300
+ 100% {
2301
+ transform: rotate(1080deg);
2302
+ stroke-dasharray: 0.05em, 3em;
2303
+ }
2304
+ }
2305
+ `, he = class extends k {
2306
+ constructor() {
2307
+ super(...arguments), this.localize = new zt(this);
2308
+ }
2309
+ render() {
2310
+ return v`
2311
+ <svg part="base" class="spinner" role="progressbar" aria-label=${this.localize.term("loading")}>
2312
+ <circle class="spinner__track"></circle>
2313
+ <circle class="spinner__indicator"></circle>
2314
+ </svg>
2315
+ `;
2316
+ }
2317
+ };
2318
+ he.styles = [Q, go];
2319
+ var vo = $`
2320
+ :host {
2321
+ display: inline-block;
2322
+ position: relative;
2323
+ width: auto;
2324
+ cursor: pointer;
2325
+ }
2326
+
2327
+ .button {
2328
+ display: inline-flex;
2329
+ align-items: stretch;
2330
+ justify-content: center;
2331
+ width: 100%;
2332
+ border-style: solid;
2333
+ border-width: var(--sl-input-border-width);
2334
+ font-family: var(--sl-input-font-family);
2335
+ font-weight: var(--sl-font-weight-semibold);
2336
+ text-decoration: none;
2337
+ user-select: none;
2338
+ -webkit-user-select: none;
2339
+ white-space: nowrap;
2340
+ vertical-align: middle;
2341
+ padding: 0;
2342
+ transition:
2343
+ var(--sl-transition-x-fast) background-color,
2344
+ var(--sl-transition-x-fast) color,
2345
+ var(--sl-transition-x-fast) border,
2346
+ var(--sl-transition-x-fast) box-shadow;
2347
+ cursor: inherit;
2348
+ }
2349
+
2350
+ .button::-moz-focus-inner {
2351
+ border: 0;
2352
+ }
2353
+
2354
+ .button:focus {
2355
+ outline: none;
2356
+ }
2357
+
2358
+ .button:focus-visible {
2359
+ outline: var(--sl-focus-ring);
2360
+ outline-offset: var(--sl-focus-ring-offset);
2361
+ }
2362
+
2363
+ .button--disabled {
2364
+ opacity: 0.5;
2365
+ cursor: not-allowed;
2366
+ }
2367
+
2368
+ /* When disabled, prevent mouse events from bubbling up from children */
2369
+ .button--disabled * {
2370
+ pointer-events: none;
2371
+ }
2372
+
2373
+ .button__prefix,
2374
+ .button__suffix {
2375
+ flex: 0 0 auto;
2376
+ display: flex;
2377
+ align-items: center;
2378
+ pointer-events: none;
2379
+ }
2380
+
2381
+ .button__label {
2382
+ display: inline-block;
2383
+ }
2384
+
2385
+ .button__label::slotted(sl-icon) {
2386
+ vertical-align: -2px;
2387
+ }
2388
+
2389
+ /*
2390
+ * Standard buttons
2391
+ */
2392
+
2393
+ /* Default */
2394
+ .button--standard.button--default {
2395
+ background-color: var(--sl-color-neutral-0);
2396
+ border-color: var(--sl-input-border-color);
2397
+ color: var(--sl-color-neutral-700);
2398
+ }
2399
+
2400
+ .button--standard.button--default:hover:not(.button--disabled) {
2401
+ background-color: var(--sl-color-primary-50);
2402
+ border-color: var(--sl-color-primary-300);
2403
+ color: var(--sl-color-primary-700);
2404
+ }
2405
+
2406
+ .button--standard.button--default:active:not(.button--disabled) {
2407
+ background-color: var(--sl-color-primary-100);
2408
+ border-color: var(--sl-color-primary-400);
2409
+ color: var(--sl-color-primary-700);
2410
+ }
2411
+
2412
+ /* Primary */
2413
+ .button--standard.button--primary {
2414
+ background-color: var(--sl-color-primary-600);
2415
+ border-color: var(--sl-color-primary-600);
2416
+ color: var(--sl-color-neutral-0);
2417
+ }
2418
+
2419
+ .button--standard.button--primary:hover:not(.button--disabled) {
2420
+ background-color: var(--sl-color-primary-500);
2421
+ border-color: var(--sl-color-primary-500);
2422
+ color: var(--sl-color-neutral-0);
2423
+ }
2424
+
2425
+ .button--standard.button--primary:active:not(.button--disabled) {
2426
+ background-color: var(--sl-color-primary-600);
2427
+ border-color: var(--sl-color-primary-600);
2428
+ color: var(--sl-color-neutral-0);
2429
+ }
2430
+
2431
+ /* Success */
2432
+ .button--standard.button--success {
2433
+ background-color: var(--sl-color-success-600);
2434
+ border-color: var(--sl-color-success-600);
2435
+ color: var(--sl-color-neutral-0);
2436
+ }
2437
+
2438
+ .button--standard.button--success:hover:not(.button--disabled) {
2439
+ background-color: var(--sl-color-success-500);
2440
+ border-color: var(--sl-color-success-500);
2441
+ color: var(--sl-color-neutral-0);
2442
+ }
2443
+
2444
+ .button--standard.button--success:active:not(.button--disabled) {
2445
+ background-color: var(--sl-color-success-600);
2446
+ border-color: var(--sl-color-success-600);
2447
+ color: var(--sl-color-neutral-0);
2448
+ }
2449
+
2450
+ /* Neutral */
2451
+ .button--standard.button--neutral {
2452
+ background-color: var(--sl-color-neutral-600);
2453
+ border-color: var(--sl-color-neutral-600);
2454
+ color: var(--sl-color-neutral-0);
2455
+ }
2456
+
2457
+ .button--standard.button--neutral:hover:not(.button--disabled) {
2458
+ background-color: var(--sl-color-neutral-500);
2459
+ border-color: var(--sl-color-neutral-500);
2460
+ color: var(--sl-color-neutral-0);
2461
+ }
2462
+
2463
+ .button--standard.button--neutral:active:not(.button--disabled) {
2464
+ background-color: var(--sl-color-neutral-600);
2465
+ border-color: var(--sl-color-neutral-600);
2466
+ color: var(--sl-color-neutral-0);
2467
+ }
2468
+
2469
+ /* Warning */
2470
+ .button--standard.button--warning {
2471
+ background-color: var(--sl-color-warning-600);
2472
+ border-color: var(--sl-color-warning-600);
2473
+ color: var(--sl-color-neutral-0);
2474
+ }
2475
+ .button--standard.button--warning:hover:not(.button--disabled) {
2476
+ background-color: var(--sl-color-warning-500);
2477
+ border-color: var(--sl-color-warning-500);
2478
+ color: var(--sl-color-neutral-0);
2479
+ }
2480
+
2481
+ .button--standard.button--warning:active:not(.button--disabled) {
2482
+ background-color: var(--sl-color-warning-600);
2483
+ border-color: var(--sl-color-warning-600);
2484
+ color: var(--sl-color-neutral-0);
2485
+ }
2486
+
2487
+ /* Danger */
2488
+ .button--standard.button--danger {
2489
+ background-color: var(--sl-color-danger-600);
2490
+ border-color: var(--sl-color-danger-600);
2491
+ color: var(--sl-color-neutral-0);
2492
+ }
2493
+
2494
+ .button--standard.button--danger:hover:not(.button--disabled) {
2495
+ background-color: var(--sl-color-danger-500);
2496
+ border-color: var(--sl-color-danger-500);
2497
+ color: var(--sl-color-neutral-0);
2498
+ }
2499
+
2500
+ .button--standard.button--danger:active:not(.button--disabled) {
2501
+ background-color: var(--sl-color-danger-600);
2502
+ border-color: var(--sl-color-danger-600);
2503
+ color: var(--sl-color-neutral-0);
2504
+ }
2505
+
2506
+ /*
2507
+ * Outline buttons
2508
+ */
2509
+
2510
+ .button--outline {
2511
+ background: none;
2512
+ border: solid 1px;
2513
+ }
2514
+
2515
+ /* Default */
2516
+ .button--outline.button--default {
2517
+ border-color: var(--sl-input-border-color);
2518
+ color: var(--sl-color-neutral-700);
2519
+ }
2520
+
2521
+ .button--outline.button--default:hover:not(.button--disabled),
2522
+ .button--outline.button--default.button--checked:not(.button--disabled) {
2523
+ border-color: var(--sl-color-primary-600);
2524
+ background-color: var(--sl-color-primary-600);
2525
+ color: var(--sl-color-neutral-0);
2526
+ }
2527
+
2528
+ .button--outline.button--default:active:not(.button--disabled) {
2529
+ border-color: var(--sl-color-primary-700);
2530
+ background-color: var(--sl-color-primary-700);
2531
+ color: var(--sl-color-neutral-0);
2532
+ }
2533
+
2534
+ /* Primary */
2535
+ .button--outline.button--primary {
2536
+ border-color: var(--sl-color-primary-600);
2537
+ color: var(--sl-color-primary-600);
2538
+ }
2539
+
2540
+ .button--outline.button--primary:hover:not(.button--disabled),
2541
+ .button--outline.button--primary.button--checked:not(.button--disabled) {
2542
+ background-color: var(--sl-color-primary-600);
2543
+ color: var(--sl-color-neutral-0);
2544
+ }
2545
+
2546
+ .button--outline.button--primary:active:not(.button--disabled) {
2547
+ border-color: var(--sl-color-primary-700);
2548
+ background-color: var(--sl-color-primary-700);
2549
+ color: var(--sl-color-neutral-0);
2550
+ }
2551
+
2552
+ /* Success */
2553
+ .button--outline.button--success {
2554
+ border-color: var(--sl-color-success-600);
2555
+ color: var(--sl-color-success-600);
2556
+ }
2557
+
2558
+ .button--outline.button--success:hover:not(.button--disabled),
2559
+ .button--outline.button--success.button--checked:not(.button--disabled) {
2560
+ background-color: var(--sl-color-success-600);
2561
+ color: var(--sl-color-neutral-0);
2562
+ }
2563
+
2564
+ .button--outline.button--success:active:not(.button--disabled) {
2565
+ border-color: var(--sl-color-success-700);
2566
+ background-color: var(--sl-color-success-700);
2567
+ color: var(--sl-color-neutral-0);
2568
+ }
2569
+
2570
+ /* Neutral */
2571
+ .button--outline.button--neutral {
2572
+ border-color: var(--sl-color-neutral-600);
2573
+ color: var(--sl-color-neutral-600);
2574
+ }
2575
+
2576
+ .button--outline.button--neutral:hover:not(.button--disabled),
2577
+ .button--outline.button--neutral.button--checked:not(.button--disabled) {
2578
+ background-color: var(--sl-color-neutral-600);
2579
+ color: var(--sl-color-neutral-0);
2580
+ }
2581
+
2582
+ .button--outline.button--neutral:active:not(.button--disabled) {
2583
+ border-color: var(--sl-color-neutral-700);
2584
+ background-color: var(--sl-color-neutral-700);
2585
+ color: var(--sl-color-neutral-0);
2586
+ }
2587
+
2588
+ /* Warning */
2589
+ .button--outline.button--warning {
2590
+ border-color: var(--sl-color-warning-600);
2591
+ color: var(--sl-color-warning-600);
2592
+ }
2593
+
2594
+ .button--outline.button--warning:hover:not(.button--disabled),
2595
+ .button--outline.button--warning.button--checked:not(.button--disabled) {
2596
+ background-color: var(--sl-color-warning-600);
2597
+ color: var(--sl-color-neutral-0);
2598
+ }
2599
+
2600
+ .button--outline.button--warning:active:not(.button--disabled) {
2601
+ border-color: var(--sl-color-warning-700);
2602
+ background-color: var(--sl-color-warning-700);
2603
+ color: var(--sl-color-neutral-0);
2604
+ }
2605
+
2606
+ /* Danger */
2607
+ .button--outline.button--danger {
2608
+ border-color: var(--sl-color-danger-600);
2609
+ color: var(--sl-color-danger-600);
2610
+ }
2611
+
2612
+ .button--outline.button--danger:hover:not(.button--disabled),
2613
+ .button--outline.button--danger.button--checked:not(.button--disabled) {
2614
+ background-color: var(--sl-color-danger-600);
2615
+ color: var(--sl-color-neutral-0);
2616
+ }
2617
+
2618
+ .button--outline.button--danger:active:not(.button--disabled) {
2619
+ border-color: var(--sl-color-danger-700);
2620
+ background-color: var(--sl-color-danger-700);
2621
+ color: var(--sl-color-neutral-0);
2622
+ }
2623
+
2624
+ @media (forced-colors: active) {
2625
+ .button.button--outline.button--checked:not(.button--disabled) {
2626
+ outline: solid 2px transparent;
2627
+ }
2628
+ }
2629
+
2630
+ /*
2631
+ * Text buttons
2632
+ */
2633
+
2634
+ .button--text {
2635
+ background-color: transparent;
2636
+ border-color: transparent;
2637
+ color: var(--sl-color-primary-600);
2638
+ }
2639
+
2640
+ .button--text:hover:not(.button--disabled) {
2641
+ background-color: transparent;
2642
+ border-color: transparent;
2643
+ color: var(--sl-color-primary-500);
2644
+ }
2645
+
2646
+ .button--text:focus-visible:not(.button--disabled) {
2647
+ background-color: transparent;
2648
+ border-color: transparent;
2649
+ color: var(--sl-color-primary-500);
2650
+ }
2651
+
2652
+ .button--text:active:not(.button--disabled) {
2653
+ background-color: transparent;
2654
+ border-color: transparent;
2655
+ color: var(--sl-color-primary-700);
2656
+ }
2657
+
2658
+ /*
2659
+ * Size modifiers
2660
+ */
2661
+
2662
+ .button--small {
2663
+ height: auto;
2664
+ min-height: var(--sl-input-height-small);
2665
+ font-size: var(--sl-button-font-size-small);
2666
+ line-height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2);
2667
+ border-radius: var(--sl-input-border-radius-small);
2668
+ }
2669
+
2670
+ .button--medium {
2671
+ height: auto;
2672
+ min-height: var(--sl-input-height-medium);
2673
+ font-size: var(--sl-button-font-size-medium);
2674
+ line-height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2);
2675
+ border-radius: var(--sl-input-border-radius-medium);
2676
+ }
2677
+
2678
+ .button--large {
2679
+ height: auto;
2680
+ min-height: var(--sl-input-height-large);
2681
+ font-size: var(--sl-button-font-size-large);
2682
+ line-height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2);
2683
+ border-radius: var(--sl-input-border-radius-large);
2684
+ }
2685
+
2686
+ /*
2687
+ * Pill modifier
2688
+ */
2689
+
2690
+ .button--pill.button--small {
2691
+ border-radius: var(--sl-input-height-small);
2692
+ }
2693
+
2694
+ .button--pill.button--medium {
2695
+ border-radius: var(--sl-input-height-medium);
2696
+ }
2697
+
2698
+ .button--pill.button--large {
2699
+ border-radius: var(--sl-input-height-large);
2700
+ }
2701
+
2702
+ /*
2703
+ * Circle modifier
2704
+ */
2705
+
2706
+ .button--circle {
2707
+ padding-left: 0;
2708
+ padding-right: 0;
2709
+ }
2710
+
2711
+ .button--circle.button--small {
2712
+ width: var(--sl-input-height-small);
2713
+ border-radius: 50%;
2714
+ }
2715
+
2716
+ .button--circle.button--medium {
2717
+ width: var(--sl-input-height-medium);
2718
+ border-radius: 50%;
2719
+ }
2720
+
2721
+ .button--circle.button--large {
2722
+ width: var(--sl-input-height-large);
2723
+ border-radius: 50%;
2724
+ }
2725
+
2726
+ .button--circle .button__prefix,
2727
+ .button--circle .button__suffix,
2728
+ .button--circle .button__caret {
2729
+ display: none;
2730
+ }
2731
+
2732
+ /*
2733
+ * Caret modifier
2734
+ */
2735
+
2736
+ .button--caret .button__suffix {
2737
+ display: none;
2738
+ }
2739
+
2740
+ .button--caret .button__caret {
2741
+ height: auto;
2742
+ }
2743
+
2744
+ /*
2745
+ * Loading modifier
2746
+ */
2747
+
2748
+ .button--loading {
2749
+ position: relative;
2750
+ cursor: wait;
2751
+ }
2752
+
2753
+ .button--loading .button__prefix,
2754
+ .button--loading .button__label,
2755
+ .button--loading .button__suffix,
2756
+ .button--loading .button__caret {
2757
+ visibility: hidden;
2758
+ }
2759
+
2760
+ .button--loading sl-spinner {
2761
+ --indicator-color: currentColor;
2762
+ position: absolute;
2763
+ font-size: 1em;
2764
+ height: 1em;
2765
+ width: 1em;
2766
+ top: calc(50% - 0.5em);
2767
+ left: calc(50% - 0.5em);
2768
+ }
2769
+
2770
+ /*
2771
+ * Badges
2772
+ */
2773
+
2774
+ .button ::slotted(sl-badge) {
2775
+ position: absolute;
2776
+ top: 0;
2777
+ right: 0;
2778
+ translate: 50% -50%;
2779
+ pointer-events: none;
2780
+ }
2781
+
2782
+ .button--rtl ::slotted(sl-badge) {
2783
+ right: auto;
2784
+ left: 0;
2785
+ translate: -50% -50%;
2786
+ }
2787
+
2788
+ /*
2789
+ * Button spacing
2790
+ */
2791
+
2792
+ .button--has-label.button--small .button__label {
2793
+ padding: 0 var(--sl-spacing-small);
2794
+ }
2795
+
2796
+ .button--has-label.button--medium .button__label {
2797
+ padding: 0 var(--sl-spacing-medium);
2798
+ }
2799
+
2800
+ .button--has-label.button--large .button__label {
2801
+ padding: 0 var(--sl-spacing-large);
2802
+ }
2803
+
2804
+ .button--has-prefix.button--small {
2805
+ padding-inline-start: var(--sl-spacing-x-small);
2806
+ }
2807
+
2808
+ .button--has-prefix.button--small .button__label {
2809
+ padding-inline-start: var(--sl-spacing-x-small);
2810
+ }
2811
+
2812
+ .button--has-prefix.button--medium {
2813
+ padding-inline-start: var(--sl-spacing-small);
2814
+ }
2815
+
2816
+ .button--has-prefix.button--medium .button__label {
2817
+ padding-inline-start: var(--sl-spacing-small);
2818
+ }
2819
+
2820
+ .button--has-prefix.button--large {
2821
+ padding-inline-start: var(--sl-spacing-small);
2822
+ }
2823
+
2824
+ .button--has-prefix.button--large .button__label {
2825
+ padding-inline-start: var(--sl-spacing-small);
2826
+ }
2827
+
2828
+ .button--has-suffix.button--small,
2829
+ .button--caret.button--small {
2830
+ padding-inline-end: var(--sl-spacing-x-small);
2831
+ }
2832
+
2833
+ .button--has-suffix.button--small .button__label,
2834
+ .button--caret.button--small .button__label {
2835
+ padding-inline-end: var(--sl-spacing-x-small);
2836
+ }
2837
+
2838
+ .button--has-suffix.button--medium,
2839
+ .button--caret.button--medium {
2840
+ padding-inline-end: var(--sl-spacing-small);
2841
+ }
2842
+
2843
+ .button--has-suffix.button--medium .button__label,
2844
+ .button--caret.button--medium .button__label {
2845
+ padding-inline-end: var(--sl-spacing-small);
2846
+ }
2847
+
2848
+ .button--has-suffix.button--large,
2849
+ .button--caret.button--large {
2850
+ padding-inline-end: var(--sl-spacing-small);
2851
+ }
2852
+
2853
+ .button--has-suffix.button--large .button__label,
2854
+ .button--caret.button--large .button__label {
2855
+ padding-inline-end: var(--sl-spacing-small);
2856
+ }
2857
+
2858
+ /*
2859
+ * Button groups support a variety of button types (e.g. buttons with tooltips, buttons as dropdown triggers, etc.).
2860
+ * This means buttons aren't always direct descendants of the button group, thus we can't target them with the
2861
+ * ::slotted selector. To work around this, the button group component does some magic to add these special classes to
2862
+ * buttons and we style them here instead.
2863
+ */
2864
+
2865
+ :host([data-sl-button-group__button--first]:not([data-sl-button-group__button--last])) .button {
2866
+ border-start-end-radius: 0;
2867
+ border-end-end-radius: 0;
2868
+ }
2869
+
2870
+ :host([data-sl-button-group__button--inner]) .button {
2871
+ border-radius: 0;
2872
+ }
2873
+
2874
+ :host([data-sl-button-group__button--last]:not([data-sl-button-group__button--first])) .button {
2875
+ border-start-start-radius: 0;
2876
+ border-end-start-radius: 0;
2877
+ }
2878
+
2879
+ /* All except the first */
2880
+ :host([data-sl-button-group__button]:not([data-sl-button-group__button--first])) {
2881
+ margin-inline-start: calc(-1 * var(--sl-input-border-width));
2882
+ }
2883
+
2884
+ /* Add a visual separator between solid buttons */
2885
+ :host(
2886
+ [data-sl-button-group__button]:not(
2887
+ [data-sl-button-group__button--first],
2888
+ [data-sl-button-group__button--radio],
2889
+ [variant='default']
2890
+ ):not(:hover)
2891
+ )
2892
+ .button:after {
2893
+ content: '';
2894
+ position: absolute;
2895
+ top: 0;
2896
+ inset-inline-start: 0;
2897
+ bottom: 0;
2898
+ border-left: solid 1px rgb(128 128 128 / 33%);
2899
+ mix-blend-mode: multiply;
2900
+ }
2901
+
2902
+ /* Bump hovered, focused, and checked buttons up so their focus ring isn't clipped */
2903
+ :host([data-sl-button-group__button--hover]) {
2904
+ z-index: 1;
2905
+ }
2906
+
2907
+ /* Focus and checked are always on top */
2908
+ :host([data-sl-button-group__button--focus]),
2909
+ :host([data-sl-button-group__button][checked]) {
2910
+ z-index: 2;
2911
+ }
2912
+ `;
2913
+ /**
2914
+ * @license
2915
+ * Copyright 2020 Google LLC
2916
+ * SPDX-License-Identifier: BSD-3-Clause
2917
+ */
2918
+ const pe = Symbol.for(""), yo = (o) => {
2919
+ if ((o == null ? void 0 : o.r) === pe) return o == null ? void 0 : o._$litStatic$;
2920
+ }, Kt = (o, ...t) => ({ _$litStatic$: t.reduce((e, r, s) => e + ((i) => {
2921
+ if (i._$litStatic$ !== void 0) return i._$litStatic$;
2922
+ throw Error(`Value passed to 'literal' function must be a 'literal' result: ${i}. Use 'unsafeStatic' to pass non-literal values, but
2923
+ take care to ensure page security.`);
2924
+ })(r) + o[s + 1], o[0]), r: pe }), Zt = /* @__PURE__ */ new Map(), wo = (o) => (t, ...e) => {
2925
+ const r = e.length;
2926
+ let s, i;
2927
+ const n = [], d = [];
2928
+ let l, c = 0, b = !1;
2929
+ for (; c < r; ) {
2930
+ for (l = t[c]; c < r && (i = e[c], (s = yo(i)) !== void 0); ) l += s + t[++c], b = !0;
2931
+ c !== r && d.push(i), n.push(l), c++;
2932
+ }
2933
+ if (c === r && n.push(t[r]), b) {
2934
+ const p = n.join("$$lit$$");
2935
+ (t = Zt.get(p)) === void 0 && (n.raw = n, Zt.set(p, t = n)), e = d;
2936
+ }
2937
+ return o(t, ...e);
2938
+ }, ft = wo(v);
2939
+ var f = class extends k {
2940
+ constructor() {
2941
+ super(...arguments), this.formControlController = new ae(this, {
2942
+ assumeInteractionOn: ["click"]
2943
+ }), this.hasSlotController = new St(this, "[default]", "prefix", "suffix"), this.localize = new zt(this), this.hasFocus = !1, this.invalid = !1, this.title = "", this.variant = "default", this.size = "medium", this.caret = !1, this.disabled = !1, this.loading = !1, this.outline = !1, this.pill = !1, this.circle = !1, this.type = "button", this.name = "", this.value = "", this.href = "", this.rel = "noreferrer noopener";
2944
+ }
2945
+ /** Gets the validity state object */
2946
+ get validity() {
2947
+ return this.isButton() ? this.button.validity : Et;
2948
+ }
2949
+ /** Gets the validation message */
2950
+ get validationMessage() {
2951
+ return this.isButton() ? this.button.validationMessage : "";
2952
+ }
2953
+ firstUpdated() {
2954
+ this.isButton() && this.formControlController.updateValidity();
2955
+ }
2956
+ handleBlur() {
2957
+ this.hasFocus = !1, this.emit("sl-blur");
2958
+ }
2959
+ handleFocus() {
2960
+ this.hasFocus = !0, this.emit("sl-focus");
2961
+ }
2962
+ handleClick() {
2963
+ this.type === "submit" && this.formControlController.submit(this), this.type === "reset" && this.formControlController.reset(this);
2964
+ }
2965
+ handleInvalid(o) {
2966
+ this.formControlController.setValidity(!1), this.formControlController.emitInvalidEvent(o);
2967
+ }
2968
+ isButton() {
2969
+ return !this.href;
2970
+ }
2971
+ isLink() {
2972
+ return !!this.href;
2973
+ }
2974
+ handleDisabledChange() {
2975
+ this.isButton() && this.formControlController.setValidity(this.disabled);
2976
+ }
2977
+ /** Simulates a click on the button. */
2978
+ click() {
2979
+ this.button.click();
2980
+ }
2981
+ /** Sets focus on the button. */
2982
+ focus(o) {
2983
+ this.button.focus(o);
2984
+ }
2985
+ /** Removes focus from the button. */
2986
+ blur() {
2987
+ this.button.blur();
2988
+ }
2989
+ /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */
2990
+ checkValidity() {
2991
+ return this.isButton() ? this.button.checkValidity() : !0;
2992
+ }
2993
+ /** Gets the associated form, if one exists. */
2994
+ getForm() {
2995
+ return this.formControlController.getForm();
2996
+ }
2997
+ /** Checks for validity and shows the browser's validation message if the control is invalid. */
2998
+ reportValidity() {
2999
+ return this.isButton() ? this.button.reportValidity() : !0;
3000
+ }
3001
+ /** Sets a custom validation message. Pass an empty string to restore validity. */
3002
+ setCustomValidity(o) {
3003
+ this.isButton() && (this.button.setCustomValidity(o), this.formControlController.updateValidity());
3004
+ }
3005
+ render() {
3006
+ const o = this.isLink(), t = o ? Kt`a` : Kt`button`;
3007
+ return ft`
3008
+ <${t}
3009
+ part="base"
3010
+ class=${it({
3011
+ button: !0,
3012
+ "button--default": this.variant === "default",
3013
+ "button--primary": this.variant === "primary",
3014
+ "button--success": this.variant === "success",
3015
+ "button--neutral": this.variant === "neutral",
3016
+ "button--warning": this.variant === "warning",
3017
+ "button--danger": this.variant === "danger",
3018
+ "button--text": this.variant === "text",
3019
+ "button--small": this.size === "small",
3020
+ "button--medium": this.size === "medium",
3021
+ "button--large": this.size === "large",
3022
+ "button--caret": this.caret,
3023
+ "button--circle": this.circle,
3024
+ "button--disabled": this.disabled,
3025
+ "button--focused": this.hasFocus,
3026
+ "button--loading": this.loading,
3027
+ "button--standard": !this.outline,
3028
+ "button--outline": this.outline,
3029
+ "button--pill": this.pill,
3030
+ "button--rtl": this.localize.dir() === "rtl",
3031
+ "button--has-label": this.hasSlotController.test("[default]"),
3032
+ "button--has-prefix": this.hasSlotController.test("prefix"),
3033
+ "button--has-suffix": this.hasSlotController.test("suffix")
3034
+ })}
3035
+ ?disabled=${m(o ? void 0 : this.disabled)}
3036
+ type=${m(o ? void 0 : this.type)}
3037
+ title=${this.title}
3038
+ name=${m(o ? void 0 : this.name)}
3039
+ value=${m(o ? void 0 : this.value)}
3040
+ href=${m(o ? this.href : void 0)}
3041
+ target=${m(o ? this.target : void 0)}
3042
+ download=${m(o ? this.download : void 0)}
3043
+ rel=${m(o ? this.rel : void 0)}
3044
+ role=${m(o ? void 0 : "button")}
3045
+ aria-disabled=${this.disabled ? "true" : "false"}
3046
+ tabindex=${this.disabled ? "-1" : "0"}
3047
+ @blur=${this.handleBlur}
3048
+ @focus=${this.handleFocus}
3049
+ @invalid=${this.isButton() ? this.handleInvalid : null}
3050
+ @click=${this.handleClick}
3051
+ >
3052
+ <slot name="prefix" part="prefix" class="button__prefix"></slot>
3053
+ <slot part="label" class="button__label"></slot>
3054
+ <slot name="suffix" part="suffix" class="button__suffix"></slot>
3055
+ ${this.caret ? ft` <sl-icon part="caret" class="button__caret" library="system" name="caret"></sl-icon> ` : ""}
3056
+ ${this.loading ? ft`<sl-spinner part="spinner"></sl-spinner>` : ""}
3057
+ </${t}>
3058
+ `;
3059
+ }
3060
+ };
3061
+ f.styles = [Q, vo];
3062
+ f.dependencies = {
3063
+ "sl-icon": x,
3064
+ "sl-spinner": he
3065
+ };
3066
+ a([
3067
+ re(".button")
3068
+ ], f.prototype, "button", 2);
3069
+ a([
3070
+ at()
3071
+ ], f.prototype, "hasFocus", 2);
3072
+ a([
3073
+ at()
3074
+ ], f.prototype, "invalid", 2);
3075
+ a([
3076
+ u()
3077
+ ], f.prototype, "title", 2);
3078
+ a([
3079
+ u({ reflect: !0 })
3080
+ ], f.prototype, "variant", 2);
3081
+ a([
3082
+ u({ reflect: !0 })
3083
+ ], f.prototype, "size", 2);
3084
+ a([
3085
+ u({ type: Boolean, reflect: !0 })
3086
+ ], f.prototype, "caret", 2);
3087
+ a([
3088
+ u({ type: Boolean, reflect: !0 })
3089
+ ], f.prototype, "disabled", 2);
3090
+ a([
3091
+ u({ type: Boolean, reflect: !0 })
3092
+ ], f.prototype, "loading", 2);
3093
+ a([
3094
+ u({ type: Boolean, reflect: !0 })
3095
+ ], f.prototype, "outline", 2);
3096
+ a([
3097
+ u({ type: Boolean, reflect: !0 })
3098
+ ], f.prototype, "pill", 2);
3099
+ a([
3100
+ u({ type: Boolean, reflect: !0 })
3101
+ ], f.prototype, "circle", 2);
3102
+ a([
3103
+ u()
3104
+ ], f.prototype, "type", 2);
3105
+ a([
3106
+ u()
3107
+ ], f.prototype, "name", 2);
3108
+ a([
3109
+ u()
3110
+ ], f.prototype, "value", 2);
3111
+ a([
3112
+ u()
3113
+ ], f.prototype, "href", 2);
3114
+ a([
3115
+ u()
3116
+ ], f.prototype, "target", 2);
3117
+ a([
3118
+ u()
3119
+ ], f.prototype, "rel", 2);
3120
+ a([
3121
+ u()
3122
+ ], f.prototype, "download", 2);
3123
+ a([
3124
+ u()
3125
+ ], f.prototype, "form", 2);
3126
+ a([
3127
+ u({ attribute: "formaction" })
3128
+ ], f.prototype, "formAction", 2);
3129
+ a([
3130
+ u({ attribute: "formenctype" })
3131
+ ], f.prototype, "formEnctype", 2);
3132
+ a([
3133
+ u({ attribute: "formmethod" })
3134
+ ], f.prototype, "formMethod", 2);
3135
+ a([
3136
+ u({ attribute: "formnovalidate", type: Boolean })
3137
+ ], f.prototype, "formNoValidate", 2);
3138
+ a([
3139
+ u({ attribute: "formtarget" })
3140
+ ], f.prototype, "formTarget", 2);
3141
+ a([
3142
+ M("disabled", { waitUntilFirstUpdate: !0 })
3143
+ ], f.prototype, "handleDisabledChange", 1);
3144
+ f.define("sl-button");
3145
+ class wt extends S {
3146
+ constructor() {
3147
+ super(), this.username = "", this.password = "", this.disabled = !1;
3148
+ }
3149
+ handleSubmit(t) {
3150
+ t.preventDefault(), this.dispatchEvent(
3151
+ new CustomEvent("login-attempt", {
3152
+ detail: {
3153
+ username: this.username,
3154
+ password: this.password
3155
+ },
3156
+ bubbles: !0,
3157
+ composed: !0
3158
+ })
3159
+ );
3160
+ }
3161
+ handleInputChange(t) {
3162
+ const { name: e, value: r } = t.target;
3163
+ this[e] = r;
3164
+ }
3165
+ render() {
3166
+ return v`
3167
+ <sl-card>
3168
+ <form @submit="${this.handleSubmit}">
3169
+ <sl-input
3170
+ name="username"
3171
+ placeholder="Username or Email"
3172
+ .value="${this.username}"
3173
+ autocomplete="username"
3174
+ @sl-change="${this.handleInputChange}">
3175
+ </sl-input>
3176
+ <sl-input
3177
+ type="password"
3178
+ name="password"
3179
+ placeholder="Password"
3180
+ .value="${this.password}"
3181
+ autocomplete="current-password"
3182
+ @sl-change="${this.handleInputChange}">
3183
+ </sl-input>
3184
+ <sl-button type="submit" ?disabled="${this.disabled}">Login</sl-button>
3185
+ </form>
3186
+ </sl-card>
3187
+ `;
3188
+ }
3189
+ }
3190
+ E(wt, "styles", $`
3191
+ :host {
3192
+ display: flex;
3193
+ justify-content: center;
3194
+ align-items: center;
3195
+ height: 100vh;
3196
+ box-sizing: border-box;
3197
+ }
3198
+ sl-card {
3199
+ width: 300px;
3200
+ --padding: var(--sl-card-padding);
3201
+ --background-color: var(--sl-card-background-color);
3202
+ --border-radius: var(--sl-card-border-radius);
3203
+ --box-shadow: var(--sl-card-shadow);
3204
+ }
3205
+ sl-input, sl-button {
3206
+ width: 100%;
3207
+ margin-bottom: 10px;
3208
+ }
3209
+ `), E(wt, "properties", {
3210
+ username: { type: String },
3211
+ password: { type: String },
3212
+ disabled: { type: Boolean, reflect: !0 }
3213
+ });
3214
+ customElements.define("studio-login", wt);
3215
+ class _t extends S {
3216
+ constructor() {
3217
+ super(), this.currentPassword = "", this.newPassword = "", this.confirmPassword = "";
3218
+ }
3219
+ render() {
3220
+ return v`
3221
+ <form @submit="${this.handleSubmit}">
3222
+ <input type="password" name="currentPassword"
3223
+ autocomplete="current-password"
3224
+ placeholder="Current Password"
3225
+ .value="${this.currentPassword}"
3226
+ @input="${this.updateProperty("currentPassword")}"
3227
+ >
3228
+ <input type="password" name="newPassword"
3229
+ placeholder="New Password"
3230
+ .value="${this.newPassword}"
3231
+ @input="${this.updateProperty("newPassword")}"
3232
+ >
3233
+ <input type="password" name="confirmPassword"
3234
+ placeholder="Confirm New Password"
3235
+ .value="${this.confirmPassword}"
3236
+ @input="${this.updateProperty("confirmPassword")}"
3237
+ >
3238
+ <button type="submit">Change Password</button>
3239
+ </form>
3240
+ `;
3241
+ }
3242
+ updateProperty(t) {
3243
+ return (e) => {
3244
+ this[t] = e.target.value;
3245
+ };
3246
+ }
3247
+ handleSubmit(t) {
3248
+ t.preventDefault(), this.newPassword === this.confirmPassword ? this.dispatchEvent(new CustomEvent("change-password", {
3249
+ detail: {
3250
+ currentPassword: this.currentPassword,
3251
+ newPassword: this.newPassword
3252
+ }
3253
+ })) : alert("The new passwords do not match.");
3254
+ }
3255
+ }
3256
+ E(_t, "styles", $`
3257
+ :host {
3258
+ display: block;
3259
+ box-sizing: border-box;
3260
+ }
3261
+ input, button {
3262
+ width: 100%;
3263
+ margin-bottom: 10px;
3264
+ padding: 8px;
3265
+ box-sizing: border-box;
3266
+ }
3267
+ `), E(_t, "properties", {
3268
+ currentPassword: { type: String },
3269
+ newPassword: { type: String },
3270
+ confirmPassword: { type: String }
3271
+ });
3272
+ customElements.define("studio-change-password", _t);
3273
+ class $t extends S {
3274
+ constructor() {
3275
+ super(), this.apibaseurl = "", this.error = "", this.isAwaiting = !1, this.lastResult = void 0, this.forceChangePassword = !1, this.handleLogin = this.handleLogin.bind(this), this.handleLoginResult = this.handleLoginResult.bind(this), this.handleLoginError = this.handleLoginError.bind(this), this.renderPasswordChangeForm = this.renderPasswordChangeForm.bind(this);
3276
+ }
3277
+ handleLogin(t) {
3278
+ this.isAwaiting = !0;
3279
+ const { username: e, password: r } = t.detail, s = mt({ baseUrl: this.apibaseurl });
3280
+ this.requestUpdate(), s.mintToken({ username: e, password: r }).then(this.handleLoginResult).catch(this.handleLoginError);
3281
+ }
3282
+ handleLoginResult(t) {
3283
+ var e;
3284
+ this.error = "", this.isAwaiting = !1, this.lastResult = t, ((e = t.challenge) == null ? void 0 : e.name) === "NEW_PASSWORD_REQUIRED" ? (this.forceChangePassword = !0, this.error = "You must set a new password to continue.") : this.dispatchEvent(new CustomEvent("login-success", { detail: t })), this.requestUpdate();
3285
+ }
3286
+ handleLoginError(t) {
3287
+ var e, r;
3288
+ console.error("Error logging in:", t), this.error = ((r = (e = t == null ? void 0 : t.body) == null ? void 0 : e.error) == null ? void 0 : r.message) || "Invalid username or password", this.isAwaiting = !1, this.requestUpdate();
3289
+ }
3290
+ handleChangePassword(t) {
3291
+ const { currentPassword: e, newPassword: r } = t.detail, { token: s } = this.lastResult, i = mt({ baseUrl: this.apibaseurl });
3292
+ this.requestUpdate(), i.updatePassword({ token: s, currentPassword: e, newPassword: r }).then(() => {
3293
+ this.forceChangePassword = !1, this.error = "Login with your new password.", this.isAwaiting = !1, this.requestUpdate();
3294
+ }).catch((n) => {
3295
+ var d, l;
3296
+ this.error = ((l = (d = n == null ? void 0 : n.body) == null ? void 0 : d.error) == null ? void 0 : l.message) || n.message, this.isAwaiting = !1, this.requestUpdate();
3297
+ });
3298
+ }
3299
+ renderPasswordChangeForm() {
3300
+ return v`
3301
+ <div>
3302
+ ${this.error ? v`<div class="error">${this.error}</div>` : null}
3303
+ <studio-change-password @change-password=${this.handleChangePassword}>
3304
+ </studio-change-password>
3305
+ </div>
3306
+ `;
3307
+ }
3308
+ renderLoginForm() {
3309
+ return v`
3310
+ ${this.error ? v`<div class="error">${this.error}</div>` : null}
3311
+ <studio-login
3312
+ @login-attempt=${this.handleLogin}
3313
+ ?disabled=${this.isAwaiting}
3314
+ ></studio-login>
3315
+ `;
3316
+ }
3317
+ render() {
3318
+ return this.forceChangePassword ? this.renderPasswordChangeForm() : this.renderLoginForm();
3319
+ }
3320
+ }
3321
+ E($t, "properties", {
3322
+ apibaseurl: { type: String },
3323
+ error: { type: String }
3324
+ }), E($t, "styles", $`
3325
+ :host {
3326
+ display: block;
3327
+ max-width: 400px;
3328
+ margin: 0 auto;
3329
+ }
3330
+ `);
3331
+ window.customElements.define("mod-auth-login-form", $t);
3332
+ function be({ studio: o, config: t }) {
3333
+ return new Promise((e, r) => {
3334
+ let s = window.sessionStorage.getItem(K());
3335
+ if (s) {
3336
+ ko(s) ? _o({ studio: o, config: t, token: s }).then(e).catch((l) => {
3337
+ console.error("Failed to refresh token:", l), window.sessionStorage.removeItem(K()), be({ studio: o, config: t }).then(e).catch(r);
3338
+ }) : e(s);
3339
+ return;
3340
+ }
3341
+ const i = (l) => (window.sessionStorage.setItem(K(), l), l);
3342
+ let n;
3343
+ const d = (l) => {
3344
+ const { token: c } = l.detail;
3345
+ i(c), e(c), o.pub("system::workspace", "dismiss", n);
3346
+ };
3347
+ n = v`<mod-auth-login-form
3348
+ id="login"
3349
+ apibaseurl=${t.apibaseurl}
3350
+ @login-success=${d}></mod-auth-login-form>`, o.pub("system::workspace", "present", n);
3351
+ });
3352
+ }
3353
+ async function _o({ studio: o, config: t, token: e }) {
3354
+ const r = t.apibaseurl, s = mt({ baseUrl: r }), { token: i } = await s.refreshToken({ token: e });
3355
+ return window.sessionStorage.setItem(K(), i), i;
3356
+ }
3357
+ function $o({ studio: o }) {
3358
+ window.sessionStorage.removeItem(K());
3359
+ }
3360
+ function xo(o) {
3361
+ return JSON.parse(window.atob(o.split(".")[1].replace(/-/g, "+").replace(/_/g, "/")));
3362
+ }
3363
+ function ko(o, t = 300, e = Date.now()) {
3364
+ return xo(o).exp * 1e3 - t < e;
3365
+ }
3366
+ function K() {
3367
+ return "studio.wral::auth_token";
3368
+ }
3369
+ function Eo(o, t) {
3370
+ o.sub("studio.wral::mod-auth", "token-request", ({ state: e }) => {
3371
+ const { callback: r } = e.value;
3372
+ r ? be({ studio: o, config: t }).then((s) => r(s)).catch((s) => r(null, s)) : console.warn("No token callback defined");
3373
+ }), o.sub("studio.wral::mod-auth", "logout", () => {
3374
+ $o({ studio: o });
3375
+ });
3376
+ }
3377
+ export {
3378
+ Eo as init
3379
+ };