@florid-kit/components 0.0.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs ADDED
@@ -0,0 +1,807 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ const R = globalThis, F = R.ShadowRoot && (R.ShadyCSS === void 0 || R.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, J = Symbol(), X = /* @__PURE__ */ new WeakMap();
7
+ let lt = class {
8
+ constructor(t, e, s) {
9
+ if (this._$cssResult$ = !0, s !== J) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
10
+ this.cssText = t, this.t = e;
11
+ }
12
+ get styleSheet() {
13
+ let t = this.o;
14
+ const e = this.t;
15
+ if (F && t === void 0) {
16
+ const s = e !== void 0 && e.length === 1;
17
+ s && (t = X.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && X.set(e, t));
18
+ }
19
+ return t;
20
+ }
21
+ toString() {
22
+ return this.cssText;
23
+ }
24
+ };
25
+ const ct = (r) => new lt(typeof r == "string" ? r : r + "", void 0, J), K = (r, ...t) => {
26
+ const e = r.length === 1 ? r[0] : t.reduce((s, i, o) => s + ((n) => {
27
+ if (n._$cssResult$ === !0) return n.cssText;
28
+ if (typeof n == "number") return n;
29
+ 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.");
30
+ })(i) + r[o + 1], r[0]);
31
+ return new lt(e, r, J);
32
+ }, ft = (r, t) => {
33
+ if (F) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
34
+ else for (const e of t) {
35
+ const s = document.createElement("style"), i = R.litNonce;
36
+ i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
37
+ }
38
+ }, Y = F ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
39
+ let e = "";
40
+ for (const s of t.cssRules) e += s.cssText;
41
+ return ct(e);
42
+ })(r) : r;
43
+ /**
44
+ * @license
45
+ * Copyright 2017 Google LLC
46
+ * SPDX-License-Identifier: BSD-3-Clause
47
+ */
48
+ const { is: bt, defineProperty: _t, getOwnPropertyDescriptor: mt, getOwnPropertyNames: gt, getOwnPropertySymbols: vt, getPrototypeOf: yt } = Object, _ = globalThis, tt = _.trustedTypes, At = tt ? tt.emptyScript : "", L = _.reactiveElementPolyfillSupport, P = (r, t) => r, k = { toAttribute(r, t) {
49
+ switch (t) {
50
+ case Boolean:
51
+ r = r ? At : null;
52
+ break;
53
+ case Object:
54
+ case Array:
55
+ r = r == null ? r : JSON.stringify(r);
56
+ }
57
+ return r;
58
+ }, fromAttribute(r, t) {
59
+ let e = r;
60
+ switch (t) {
61
+ case Boolean:
62
+ e = r !== null;
63
+ break;
64
+ case Number:
65
+ e = r === null ? null : Number(r);
66
+ break;
67
+ case Object:
68
+ case Array:
69
+ try {
70
+ e = JSON.parse(r);
71
+ } catch {
72
+ e = null;
73
+ }
74
+ }
75
+ return e;
76
+ } }, Z = (r, t) => !bt(r, t), et = { attribute: !0, type: String, converter: k, reflect: !1, hasChanged: Z };
77
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), _.litPropertyMetadata ?? (_.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
78
+ class A extends HTMLElement {
79
+ static addInitializer(t) {
80
+ this._$Ei(), (this.l ?? (this.l = [])).push(t);
81
+ }
82
+ static get observedAttributes() {
83
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
84
+ }
85
+ static createProperty(t, e = et) {
86
+ if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
87
+ const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
88
+ i !== void 0 && _t(this.prototype, t, i);
89
+ }
90
+ }
91
+ static getPropertyDescriptor(t, e, s) {
92
+ const { get: i, set: o } = mt(this.prototype, t) ?? { get() {
93
+ return this[e];
94
+ }, set(n) {
95
+ this[e] = n;
96
+ } };
97
+ return { get() {
98
+ return i == null ? void 0 : i.call(this);
99
+ }, set(n) {
100
+ const h = i == null ? void 0 : i.call(this);
101
+ o.call(this, n), this.requestUpdate(t, h, s);
102
+ }, configurable: !0, enumerable: !0 };
103
+ }
104
+ static getPropertyOptions(t) {
105
+ return this.elementProperties.get(t) ?? et;
106
+ }
107
+ static _$Ei() {
108
+ if (this.hasOwnProperty(P("elementProperties"))) return;
109
+ const t = yt(this);
110
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
111
+ }
112
+ static finalize() {
113
+ if (this.hasOwnProperty(P("finalized"))) return;
114
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(P("properties"))) {
115
+ const e = this.properties, s = [...gt(e), ...vt(e)];
116
+ for (const i of s) this.createProperty(i, e[i]);
117
+ }
118
+ const t = this[Symbol.metadata];
119
+ if (t !== null) {
120
+ const e = litPropertyMetadata.get(t);
121
+ if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
122
+ }
123
+ this._$Eh = /* @__PURE__ */ new Map();
124
+ for (const [e, s] of this.elementProperties) {
125
+ const i = this._$Eu(e, s);
126
+ i !== void 0 && this._$Eh.set(i, e);
127
+ }
128
+ this.elementStyles = this.finalizeStyles(this.styles);
129
+ }
130
+ static finalizeStyles(t) {
131
+ const e = [];
132
+ if (Array.isArray(t)) {
133
+ const s = new Set(t.flat(1 / 0).reverse());
134
+ for (const i of s) e.unshift(Y(i));
135
+ } else t !== void 0 && e.push(Y(t));
136
+ return e;
137
+ }
138
+ static _$Eu(t, e) {
139
+ const s = e.attribute;
140
+ return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
141
+ }
142
+ constructor() {
143
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
144
+ }
145
+ _$Ev() {
146
+ var t;
147
+ 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));
148
+ }
149
+ addController(t) {
150
+ var e;
151
+ (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
152
+ }
153
+ removeController(t) {
154
+ var e;
155
+ (e = this._$EO) == null || e.delete(t);
156
+ }
157
+ _$E_() {
158
+ const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
159
+ for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
160
+ t.size > 0 && (this._$Ep = t);
161
+ }
162
+ createRenderRoot() {
163
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
164
+ return ft(t, this.constructor.elementStyles), t;
165
+ }
166
+ connectedCallback() {
167
+ var t;
168
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
169
+ var s;
170
+ return (s = e.hostConnected) == null ? void 0 : s.call(e);
171
+ });
172
+ }
173
+ enableUpdating(t) {
174
+ }
175
+ disconnectedCallback() {
176
+ var t;
177
+ (t = this._$EO) == null || t.forEach((e) => {
178
+ var s;
179
+ return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
180
+ });
181
+ }
182
+ attributeChangedCallback(t, e, s) {
183
+ this._$AK(t, s);
184
+ }
185
+ _$EC(t, e) {
186
+ var o;
187
+ const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
188
+ if (i !== void 0 && s.reflect === !0) {
189
+ const n = (((o = s.converter) == null ? void 0 : o.toAttribute) !== void 0 ? s.converter : k).toAttribute(e, s.type);
190
+ this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
191
+ }
192
+ }
193
+ _$AK(t, e) {
194
+ var o;
195
+ const s = this.constructor, i = s._$Eh.get(t);
196
+ if (i !== void 0 && this._$Em !== i) {
197
+ const n = s.getPropertyOptions(i), h = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((o = n.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? n.converter : k;
198
+ this._$Em = i, this[i] = h.fromAttribute(e, n.type), this._$Em = null;
199
+ }
200
+ }
201
+ requestUpdate(t, e, s) {
202
+ if (t !== void 0) {
203
+ if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? Z)(this[t], e)) return;
204
+ this.P(t, e, s);
205
+ }
206
+ this.isUpdatePending === !1 && (this._$ES = this._$ET());
207
+ }
208
+ P(t, e, s) {
209
+ this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
210
+ }
211
+ async _$ET() {
212
+ this.isUpdatePending = !0;
213
+ try {
214
+ await this._$ES;
215
+ } catch (e) {
216
+ Promise.reject(e);
217
+ }
218
+ const t = this.scheduleUpdate();
219
+ return t != null && await t, !this.isUpdatePending;
220
+ }
221
+ scheduleUpdate() {
222
+ return this.performUpdate();
223
+ }
224
+ performUpdate() {
225
+ var s;
226
+ if (!this.isUpdatePending) return;
227
+ if (!this.hasUpdated) {
228
+ if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
229
+ for (const [o, n] of this._$Ep) this[o] = n;
230
+ this._$Ep = void 0;
231
+ }
232
+ const i = this.constructor.elementProperties;
233
+ if (i.size > 0) for (const [o, n] of i) n.wrapped !== !0 || this._$AL.has(o) || this[o] === void 0 || this.P(o, this[o], n);
234
+ }
235
+ let t = !1;
236
+ const e = this._$AL;
237
+ try {
238
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => {
239
+ var o;
240
+ return (o = i.hostUpdate) == null ? void 0 : o.call(i);
241
+ }), this.update(e)) : this._$EU();
242
+ } catch (i) {
243
+ throw t = !1, this._$EU(), i;
244
+ }
245
+ t && this._$AE(e);
246
+ }
247
+ willUpdate(t) {
248
+ }
249
+ _$AE(t) {
250
+ var e;
251
+ (e = this._$EO) == null || e.forEach((s) => {
252
+ var i;
253
+ return (i = s.hostUpdated) == null ? void 0 : i.call(s);
254
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
255
+ }
256
+ _$EU() {
257
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
258
+ }
259
+ get updateComplete() {
260
+ return this.getUpdateComplete();
261
+ }
262
+ getUpdateComplete() {
263
+ return this._$ES;
264
+ }
265
+ shouldUpdate(t) {
266
+ return !0;
267
+ }
268
+ update(t) {
269
+ this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU();
270
+ }
271
+ updated(t) {
272
+ }
273
+ firstUpdated(t) {
274
+ }
275
+ }
276
+ A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, A[P("elementProperties")] = /* @__PURE__ */ new Map(), A[P("finalized")] = /* @__PURE__ */ new Map(), L == null || L({ ReactiveElement: A }), (_.reactiveElementVersions ?? (_.reactiveElementVersions = [])).push("2.0.4");
277
+ /**
278
+ * @license
279
+ * Copyright 2017 Google LLC
280
+ * SPDX-License-Identifier: BSD-3-Clause
281
+ */
282
+ const C = globalThis, z = C.trustedTypes, st = z ? z.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, dt = "$lit$", b = `lit$${Math.random().toFixed(9).slice(2)}$`, ut = "?" + b, Et = `<${ut}>`, v = document, O = () => v.createComment(""), T = (r) => r === null || typeof r != "object" && typeof r != "function", G = Array.isArray, St = (r) => G(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", j = `[
283
+ \f\r]`, x = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, it = /-->/g, rt = />/g, m = RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^
284
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, ot = /"/g, pt = /^(?:script|style|textarea|title)$/i, wt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), B = wt(1), E = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), g = v.createTreeWalker(v, 129);
285
+ function $t(r, t) {
286
+ if (!G(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
287
+ return st !== void 0 ? st.createHTML(t) : t;
288
+ }
289
+ const xt = (r, t) => {
290
+ const e = r.length - 1, s = [];
291
+ let i, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = x;
292
+ for (let h = 0; h < e; h++) {
293
+ const a = r[h];
294
+ let d, u, l = -1, $ = 0;
295
+ for (; $ < a.length && (n.lastIndex = $, u = n.exec(a), u !== null); ) $ = n.lastIndex, n === x ? u[1] === "!--" ? n = it : u[1] !== void 0 ? n = rt : u[2] !== void 0 ? (pt.test(u[2]) && (i = RegExp("</" + u[2], "g")), n = m) : u[3] !== void 0 && (n = m) : n === m ? u[0] === ">" ? (n = i ?? x, l = -1) : u[1] === void 0 ? l = -2 : (l = n.lastIndex - u[2].length, d = u[1], n = u[3] === void 0 ? m : u[3] === '"' ? ot : nt) : n === ot || n === nt ? n = m : n === it || n === rt ? n = x : (n = m, i = void 0);
296
+ const f = n === m && r[h + 1].startsWith("/>") ? " " : "";
297
+ o += n === x ? a + Et : l >= 0 ? (s.push(d), a.slice(0, l) + dt + a.slice(l) + b + f) : a + b + (l === -2 ? h : f);
298
+ }
299
+ return [$t(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
300
+ };
301
+ class H {
302
+ constructor({ strings: t, _$litType$: e }, s) {
303
+ let i;
304
+ this.parts = [];
305
+ let o = 0, n = 0;
306
+ const h = t.length - 1, a = this.parts, [d, u] = xt(t, e);
307
+ if (this.el = H.createElement(d, s), g.currentNode = this.el.content, e === 2 || e === 3) {
308
+ const l = this.el.content.firstChild;
309
+ l.replaceWith(...l.childNodes);
310
+ }
311
+ for (; (i = g.nextNode()) !== null && a.length < h; ) {
312
+ if (i.nodeType === 1) {
313
+ if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(dt)) {
314
+ const $ = u[n++], f = i.getAttribute(l).split(b), N = /([.?@])?(.*)/.exec($);
315
+ a.push({ type: 1, index: o, name: N[2], strings: f, ctor: N[1] === "." ? Ct : N[1] === "?" ? Ut : N[1] === "@" ? Ot : I }), i.removeAttribute(l);
316
+ } else l.startsWith(b) && (a.push({ type: 6, index: o }), i.removeAttribute(l));
317
+ if (pt.test(i.tagName)) {
318
+ const l = i.textContent.split(b), $ = l.length - 1;
319
+ if ($ > 0) {
320
+ i.textContent = z ? z.emptyScript : "";
321
+ for (let f = 0; f < $; f++) i.append(l[f], O()), g.nextNode(), a.push({ type: 2, index: ++o });
322
+ i.append(l[$], O());
323
+ }
324
+ }
325
+ } else if (i.nodeType === 8) if (i.data === ut) a.push({ type: 2, index: o });
326
+ else {
327
+ let l = -1;
328
+ for (; (l = i.data.indexOf(b, l + 1)) !== -1; ) a.push({ type: 7, index: o }), l += b.length - 1;
329
+ }
330
+ o++;
331
+ }
332
+ }
333
+ static createElement(t, e) {
334
+ const s = v.createElement("template");
335
+ return s.innerHTML = t, s;
336
+ }
337
+ }
338
+ function S(r, t, e = r, s) {
339
+ var n, h;
340
+ if (t === E) return t;
341
+ let i = s !== void 0 ? (n = e._$Co) == null ? void 0 : n[s] : e._$Cl;
342
+ const o = T(t) ? void 0 : t._$litDirective$;
343
+ return (i == null ? void 0 : i.constructor) !== o && ((h = i == null ? void 0 : i._$AO) == null || h.call(i, !1), o === void 0 ? i = void 0 : (i = new o(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = S(r, i._$AS(r, t.values), i, s)), t;
344
+ }
345
+ class Pt {
346
+ constructor(t, e) {
347
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
348
+ }
349
+ get parentNode() {
350
+ return this._$AM.parentNode;
351
+ }
352
+ get _$AU() {
353
+ return this._$AM._$AU;
354
+ }
355
+ u(t) {
356
+ const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? v).importNode(e, !0);
357
+ g.currentNode = i;
358
+ let o = g.nextNode(), n = 0, h = 0, a = s[0];
359
+ for (; a !== void 0; ) {
360
+ if (n === a.index) {
361
+ let d;
362
+ a.type === 2 ? d = new M(o, o.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (d = new Tt(o, this, t)), this._$AV.push(d), a = s[++h];
363
+ }
364
+ n !== (a == null ? void 0 : a.index) && (o = g.nextNode(), n++);
365
+ }
366
+ return g.currentNode = v, i;
367
+ }
368
+ p(t) {
369
+ let e = 0;
370
+ for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
371
+ }
372
+ }
373
+ class M {
374
+ get _$AU() {
375
+ var t;
376
+ return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
377
+ }
378
+ constructor(t, e, s, i) {
379
+ this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
380
+ }
381
+ get parentNode() {
382
+ let t = this._$AA.parentNode;
383
+ const e = this._$AM;
384
+ return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
385
+ }
386
+ get startNode() {
387
+ return this._$AA;
388
+ }
389
+ get endNode() {
390
+ return this._$AB;
391
+ }
392
+ _$AI(t, e = this) {
393
+ t = S(this, t, e), T(t) ? t === c || t == null || t === "" ? (this._$AH !== c && this._$AR(), this._$AH = c) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : St(t) ? this.k(t) : this._(t);
394
+ }
395
+ O(t) {
396
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
397
+ }
398
+ T(t) {
399
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
400
+ }
401
+ _(t) {
402
+ this._$AH !== c && T(this._$AH) ? this._$AA.nextSibling.data = t : this.T(v.createTextNode(t)), this._$AH = t;
403
+ }
404
+ $(t) {
405
+ var o;
406
+ const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = H.createElement($t(s.h, s.h[0]), this.options)), s);
407
+ if (((o = this._$AH) == null ? void 0 : o._$AD) === i) this._$AH.p(e);
408
+ else {
409
+ const n = new Pt(i, this), h = n.u(this.options);
410
+ n.p(e), this.T(h), this._$AH = n;
411
+ }
412
+ }
413
+ _$AC(t) {
414
+ let e = at.get(t.strings);
415
+ return e === void 0 && at.set(t.strings, e = new H(t)), e;
416
+ }
417
+ k(t) {
418
+ G(this._$AH) || (this._$AH = [], this._$AR());
419
+ const e = this._$AH;
420
+ let s, i = 0;
421
+ for (const o of t) i === e.length ? e.push(s = new M(this.O(O()), this.O(O()), this, this.options)) : s = e[i], s._$AI(o), i++;
422
+ i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
423
+ }
424
+ _$AR(t = this._$AA.nextSibling, e) {
425
+ var s;
426
+ for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
427
+ const i = t.nextSibling;
428
+ t.remove(), t = i;
429
+ }
430
+ }
431
+ setConnected(t) {
432
+ var e;
433
+ this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
434
+ }
435
+ }
436
+ class I {
437
+ get tagName() {
438
+ return this.element.tagName;
439
+ }
440
+ get _$AU() {
441
+ return this._$AM._$AU;
442
+ }
443
+ constructor(t, e, s, i, o) {
444
+ this.type = 1, this._$AH = c, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = c;
445
+ }
446
+ _$AI(t, e = this, s, i) {
447
+ const o = this.strings;
448
+ let n = !1;
449
+ if (o === void 0) t = S(this, t, e, 0), n = !T(t) || t !== this._$AH && t !== E, n && (this._$AH = t);
450
+ else {
451
+ const h = t;
452
+ let a, d;
453
+ for (t = o[0], a = 0; a < o.length - 1; a++) d = S(this, h[s + a], e, a), d === E && (d = this._$AH[a]), n || (n = !T(d) || d !== this._$AH[a]), d === c ? t = c : t !== c && (t += (d ?? "") + o[a + 1]), this._$AH[a] = d;
454
+ }
455
+ n && !i && this.j(t);
456
+ }
457
+ j(t) {
458
+ t === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
459
+ }
460
+ }
461
+ class Ct extends I {
462
+ constructor() {
463
+ super(...arguments), this.type = 3;
464
+ }
465
+ j(t) {
466
+ this.element[this.name] = t === c ? void 0 : t;
467
+ }
468
+ }
469
+ class Ut extends I {
470
+ constructor() {
471
+ super(...arguments), this.type = 4;
472
+ }
473
+ j(t) {
474
+ this.element.toggleAttribute(this.name, !!t && t !== c);
475
+ }
476
+ }
477
+ class Ot extends I {
478
+ constructor(t, e, s, i, o) {
479
+ super(t, e, s, i, o), this.type = 5;
480
+ }
481
+ _$AI(t, e = this) {
482
+ if ((t = S(this, t, e, 0) ?? c) === E) return;
483
+ const s = this._$AH, i = t === c && s !== c || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== c && (s === c || i);
484
+ i && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
485
+ }
486
+ handleEvent(t) {
487
+ var e;
488
+ typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
489
+ }
490
+ }
491
+ class Tt {
492
+ constructor(t, e, s) {
493
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
494
+ }
495
+ get _$AU() {
496
+ return this._$AM._$AU;
497
+ }
498
+ _$AI(t) {
499
+ S(this, t);
500
+ }
501
+ }
502
+ const D = C.litHtmlPolyfillSupport;
503
+ D == null || D(H, M), (C.litHtmlVersions ?? (C.litHtmlVersions = [])).push("3.2.1");
504
+ const Ht = (r, t, e) => {
505
+ const s = (e == null ? void 0 : e.renderBefore) ?? t;
506
+ let i = s._$litPart$;
507
+ if (i === void 0) {
508
+ const o = (e == null ? void 0 : e.renderBefore) ?? null;
509
+ s._$litPart$ = i = new M(t.insertBefore(O(), o), o, void 0, e ?? {});
510
+ }
511
+ return i._$AI(r), i;
512
+ };
513
+ /**
514
+ * @license
515
+ * Copyright 2017 Google LLC
516
+ * SPDX-License-Identifier: BSD-3-Clause
517
+ */
518
+ let U = class extends A {
519
+ constructor() {
520
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
521
+ }
522
+ createRenderRoot() {
523
+ var e;
524
+ const t = super.createRenderRoot();
525
+ return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
526
+ }
527
+ update(t) {
528
+ const e = this.render();
529
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Ht(e, this.renderRoot, this.renderOptions);
530
+ }
531
+ connectedCallback() {
532
+ var t;
533
+ super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
534
+ }
535
+ disconnectedCallback() {
536
+ var t;
537
+ super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
538
+ }
539
+ render() {
540
+ return E;
541
+ }
542
+ };
543
+ var ht;
544
+ U._$litElement$ = !0, U.finalized = !0, (ht = globalThis.litElementHydrateSupport) == null || ht.call(globalThis, { LitElement: U });
545
+ const V = globalThis.litElementPolyfillSupport;
546
+ V == null || V({ LitElement: U });
547
+ (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
548
+ /**
549
+ * @license
550
+ * Copyright 2017 Google LLC
551
+ * SPDX-License-Identifier: BSD-3-Clause
552
+ */
553
+ const Mt = (r) => (t, e) => {
554
+ e !== void 0 ? e.addInitializer(() => {
555
+ customElements.define(r, t);
556
+ }) : customElements.define(r, t);
557
+ };
558
+ /**
559
+ * @license
560
+ * Copyright 2017 Google LLC
561
+ * SPDX-License-Identifier: BSD-3-Clause
562
+ */
563
+ const Nt = { attribute: !0, type: String, converter: k, reflect: !1, hasChanged: Z }, Rt = (r = Nt, t, e) => {
564
+ const { kind: s, metadata: i } = e;
565
+ let o = globalThis.litPropertyMetadata.get(i);
566
+ if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), o.set(e.name, r), s === "accessor") {
567
+ const { name: n } = e;
568
+ return { set(h) {
569
+ const a = t.get.call(this);
570
+ t.set.call(this, h), this.requestUpdate(n, a, r);
571
+ }, init(h) {
572
+ return h !== void 0 && this.P(n, void 0, r), h;
573
+ } };
574
+ }
575
+ if (s === "setter") {
576
+ const { name: n } = e;
577
+ return function(h) {
578
+ const a = this[n];
579
+ t.call(this, h), this.requestUpdate(n, a, r);
580
+ };
581
+ }
582
+ throw Error("Unsupported decorator location: " + s);
583
+ };
584
+ function w(r) {
585
+ return (t, e) => typeof e == "object" ? Rt(r, t, e) : ((s, i, o) => {
586
+ const n = i.hasOwnProperty(o);
587
+ return i.constructor.createProperty(o, n ? { ...s, wrapped: !0 } : s), n ? Object.getOwnPropertyDescriptor(i, o) : void 0;
588
+ })(r, t, e);
589
+ }
590
+ const kt = K`
591
+ outline: 1px dashed var(--button-border-color);
592
+ outline-offset: 2px;
593
+ outline: dashed black;
594
+ `;
595
+ K`
596
+ :host * {
597
+ box-sizing: border-box;
598
+ }
599
+ `;
600
+ /**
601
+ * @license
602
+ * Copyright 2023 Google LLC
603
+ * SPDX-License-Identifier: Apache-2.0
604
+ */
605
+ const Q = Symbol("internals"), W = Symbol("privateInternals");
606
+ function zt(r) {
607
+ var t;
608
+ class e extends r {
609
+ get [(t = Q, t)]() {
610
+ return this[W] || (this[W] = this.attachInternals()), this[W];
611
+ }
612
+ }
613
+ return e;
614
+ }
615
+ /**
616
+ * @license
617
+ * Copyright 2023 Google LLC
618
+ * SPDX-License-Identifier: Apache-2.0
619
+ */
620
+ function It(r) {
621
+ r.addInitializer((t) => {
622
+ const e = t;
623
+ e.addEventListener("click", async (s) => {
624
+ const { type: i, [Q]: o } = e, { form: n } = o;
625
+ if (!(!n || i === "button") && (await new Promise((h) => {
626
+ setTimeout(h);
627
+ }), !s.defaultPrevented)) {
628
+ if (i === "reset") {
629
+ n.reset();
630
+ return;
631
+ }
632
+ n.addEventListener(
633
+ "submit",
634
+ (h) => {
635
+ Object.defineProperty(h, "submitter", {
636
+ configurable: !0,
637
+ enumerable: !0,
638
+ get: () => e
639
+ });
640
+ },
641
+ { capture: !0, once: !0 }
642
+ ), o.setFormValue(e.value), n.requestSubmit();
643
+ }
644
+ });
645
+ });
646
+ }
647
+ var Lt = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, y = (r, t, e, s) => {
648
+ for (var i = s > 1 ? void 0 : s ? jt(t, e) : t, o = r.length - 1, n; o >= 0; o--)
649
+ (n = r[o]) && (i = (s ? n(t, e, i) : n(i)) || i);
650
+ return s && i && Lt(t, e, i), i;
651
+ };
652
+ const Bt = zt(U), q = (r) => {
653
+ const t = `
654
+ --button-bg-disabled: var(--color-content-disabled);
655
+ --button-bg-hover: var(--color-container-action-${r}-hover);
656
+ --button-bg: var(--color-container-action-${r}-default);
657
+ --button-border-disabled: var(--color-border-${r});
658
+ --button-border-hover: var(--color-border-${r});
659
+ --button-border-width-disabled: var(--button-${r}-border-width-disabled);
660
+ --button-border-width: var(--button-${r}-border-width-default, 1px);
661
+ --button-border: var(--button-${r}-border-default);
662
+ --button-text-disabled: var(--color-content-action-${r}-disabled);
663
+ --button-text-hover: var(--color-content-action-${r}-hover);
664
+ --button-text: var(--color-content-action-${r}-default);
665
+ `;
666
+ return ct(t);
667
+ }, Dt = ["primary", "secondary", "tertiary"];
668
+ let p = class extends Bt {
669
+ constructor() {
670
+ super(...arguments), this.type = "submit", this.value = "", this.variant = "primary", this.disabled = !1, this.href = "", this.target = "";
671
+ }
672
+ get name() {
673
+ return this.getAttribute("name") ?? "";
674
+ }
675
+ set name(r) {
676
+ this.setAttribute("name", r);
677
+ }
678
+ /**
679
+ * The associated form element with which this element's value will submit.
680
+ */
681
+ get form() {
682
+ return this[Q].form;
683
+ }
684
+ // TODO: Add aria attributes support
685
+ // Adapt from: https://github.dev/material-components/material-web
686
+ willUpdate() {
687
+ const r = getComputedStyle(this).getPropertyValue("--button-variant");
688
+ r && Dt.some((t) => t === r) && (this.variant = r);
689
+ }
690
+ render() {
691
+ const r = this.href ? this.renderLink() : this.renderButton();
692
+ return B`${r}`;
693
+ }
694
+ renderLink() {
695
+ return B`<a
696
+ href=${this.href}
697
+ target=${this.target || c}
698
+ class="button"
699
+ ?disabled=${this.disabled}
700
+ >
701
+ <slot />
702
+ </a>`;
703
+ }
704
+ renderButton() {
705
+ return B`<button class="button" ?disabled=${this.disabled}>
706
+ <slot />
707
+ </button>`;
708
+ }
709
+ };
710
+ It(p);
711
+ p.formAssociated = !0;
712
+ p.styles = K`
713
+ :host {
714
+ display: inline-flex;
715
+ cursor: pointer;
716
+ ${q("primary")}
717
+ }
718
+
719
+ :host([variant="secondary"]) {
720
+ ${q("secondary")}
721
+ }
722
+
723
+ :host([variant="tertiary"]) {
724
+ ${q("tertiary")}
725
+ }
726
+
727
+ :host([disabled]) {
728
+ --button-bg: var(--button-bg-disabled);
729
+ --button-text: var(--button-text-disabled);
730
+ --button-border: var(--button-border-disabled);
731
+ }
732
+
733
+ .button {
734
+ -webkit-appearance: none;
735
+ align-items: center;
736
+ background-color: var(--button-bg);
737
+ border-color: var(--button-border);
738
+ border-radius: var(--button-radius);
739
+ border-width: var(--button-border-width);
740
+ border-style: solid;
741
+ box-sizing: border-box;
742
+ color: var(--button-text);
743
+ cursor: inherit;
744
+ display: inline-flex;
745
+ font-family: var(--font-family-sans);
746
+ font-size: var(--font-size-ui);
747
+ font-weight: var(--font-weight-ui);
748
+ gap: inherit;
749
+ height: 100%;
750
+ justify-content: center;
751
+ line-height: var(--font-line-height-ui);
752
+ min-width: 64px;
753
+ outline: none;
754
+ padding: 0;
755
+ padding: var(--button-padding-block) var(--button-padding-inline);
756
+ text-decoration: none;
757
+ vertical-align: middle;
758
+ width: 100%;
759
+
760
+ &::-moz-focus-inner {
761
+ padding: 0;
762
+ border: 0;
763
+ }
764
+ }
765
+
766
+ .button:disabled {
767
+ cursor: initial;
768
+ }
769
+
770
+ .button:hover:not([disabled]) {
771
+ background-color: var(--button-bg-hover);
772
+ color: var(--button-text-hover);
773
+ }
774
+
775
+ .button:focus-visible {
776
+ ${kt}
777
+ }
778
+
779
+ .button:active:not([disabled]) {
780
+ filter: brightness(95%);
781
+ }
782
+ `;
783
+ y([
784
+ w()
785
+ ], p.prototype, "type", 2);
786
+ y([
787
+ w({ reflect: !0 })
788
+ ], p.prototype, "value", 2);
789
+ y([
790
+ w({ reflect: !0 })
791
+ ], p.prototype, "variant", 2);
792
+ y([
793
+ w({
794
+ converter: {
795
+ fromAttribute: (r) => r === "" || r === "true"
796
+ }
797
+ })
798
+ ], p.prototype, "disabled", 2);
799
+ y([
800
+ w()
801
+ ], p.prototype, "href", 2);
802
+ y([
803
+ w()
804
+ ], p.prototype, "target", 2);
805
+ p = y([
806
+ Mt("o-button")
807
+ ], p);