@vibe-flags/core 0.1.0 → 0.1.1
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/dist/index.d.ts +28 -8
- package/dist/vibe-flags.cdn.js +73 -32
- package/dist/vibe-flags.cdn.mjs +534 -405
- package/dist/vibe-flags.js +268 -139
- package/package.json +1 -1
package/dist/vibe-flags.cdn.mjs
CHANGED
|
@@ -3,208 +3,208 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const
|
|
7
|
-
let
|
|
8
|
-
constructor(
|
|
9
|
-
if (this._$cssResult$ = !0, s !==
|
|
10
|
-
this.cssText =
|
|
6
|
+
const z = globalThis, Y = z.ShadowRoot && (z.ShadyCSS === void 0 || z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Z = Symbol(), re = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
let be = class {
|
|
8
|
+
constructor(e, t, s) {
|
|
9
|
+
if (this._$cssResult$ = !0, s !== Z) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
10
|
+
this.cssText = e, this.t = t;
|
|
11
11
|
}
|
|
12
12
|
get styleSheet() {
|
|
13
|
-
let
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
const s =
|
|
17
|
-
s && (
|
|
13
|
+
let e = this.o;
|
|
14
|
+
const t = this.t;
|
|
15
|
+
if (Y && e === void 0) {
|
|
16
|
+
const s = t !== void 0 && t.length === 1;
|
|
17
|
+
s && (e = re.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && re.set(t, e));
|
|
18
18
|
}
|
|
19
|
-
return
|
|
19
|
+
return e;
|
|
20
20
|
}
|
|
21
21
|
toString() {
|
|
22
22
|
return this.cssText;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const
|
|
26
|
-
const
|
|
25
|
+
const _e = (i) => new be(typeof i == "string" ? i : i + "", void 0, Z), G = (i, ...e) => {
|
|
26
|
+
const t = i.length === 1 ? i[0] : e.reduce((s, r, o) => s + ((n) => {
|
|
27
27
|
if (n._$cssResult$ === !0) return n.cssText;
|
|
28
28
|
if (typeof n == "number") return n;
|
|
29
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
30
|
})(r) + i[o + 1], i[0]);
|
|
31
|
-
return new
|
|
32
|
-
},
|
|
33
|
-
if (
|
|
34
|
-
else for (const
|
|
35
|
-
const s = document.createElement("style"), r =
|
|
36
|
-
r !== void 0 && s.setAttribute("nonce", r), s.textContent =
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
let
|
|
40
|
-
for (const s of
|
|
41
|
-
return
|
|
31
|
+
return new be(t, i, Z);
|
|
32
|
+
}, we = (i, e) => {
|
|
33
|
+
if (Y) i.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
34
|
+
else for (const t of e) {
|
|
35
|
+
const s = document.createElement("style"), r = z.litNonce;
|
|
36
|
+
r !== void 0 && s.setAttribute("nonce", r), s.textContent = t.cssText, i.appendChild(s);
|
|
37
|
+
}
|
|
38
|
+
}, oe = Y ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((e) => {
|
|
39
|
+
let t = "";
|
|
40
|
+
for (const s of e.cssRules) t += s.cssText;
|
|
41
|
+
return _e(t);
|
|
42
42
|
})(i) : i;
|
|
43
43
|
/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
|
-
const { is:
|
|
49
|
-
switch (
|
|
48
|
+
const { is: Ae, defineProperty: Se, getOwnPropertyDescriptor: ke, getOwnPropertyNames: Ee, getOwnPropertySymbols: Ce, getPrototypeOf: Pe } = Object, q = globalThis, ne = q.trustedTypes, Oe = ne ? ne.emptyScript : "", Me = q.reactiveElementPolyfillSupport, T = (i, e) => i, B = { toAttribute(i, e) {
|
|
49
|
+
switch (e) {
|
|
50
50
|
case Boolean:
|
|
51
|
-
i = i ?
|
|
51
|
+
i = i ? Oe : null;
|
|
52
52
|
break;
|
|
53
53
|
case Object:
|
|
54
54
|
case Array:
|
|
55
55
|
i = i == null ? i : JSON.stringify(i);
|
|
56
56
|
}
|
|
57
57
|
return i;
|
|
58
|
-
}, fromAttribute(i,
|
|
59
|
-
let
|
|
60
|
-
switch (
|
|
58
|
+
}, fromAttribute(i, e) {
|
|
59
|
+
let t = i;
|
|
60
|
+
switch (e) {
|
|
61
61
|
case Boolean:
|
|
62
|
-
|
|
62
|
+
t = i !== null;
|
|
63
63
|
break;
|
|
64
64
|
case Number:
|
|
65
|
-
|
|
65
|
+
t = i === null ? null : Number(i);
|
|
66
66
|
break;
|
|
67
67
|
case Object:
|
|
68
68
|
case Array:
|
|
69
69
|
try {
|
|
70
|
-
|
|
70
|
+
t = JSON.parse(i);
|
|
71
71
|
} catch {
|
|
72
|
-
|
|
72
|
+
t = null;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
return
|
|
76
|
-
} },
|
|
77
|
-
Symbol.metadata ??= Symbol("metadata"),
|
|
78
|
-
let
|
|
79
|
-
static addInitializer(
|
|
80
|
-
this._$Ei(), (this.l ??= []).push(
|
|
75
|
+
return t;
|
|
76
|
+
} }, Q = (i, e) => !Ae(i, e), ae = { attribute: !0, type: String, converter: B, reflect: !1, useDefault: !1, hasChanged: Q };
|
|
77
|
+
Symbol.metadata ??= Symbol("metadata"), q.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
78
|
+
let k = class extends HTMLElement {
|
|
79
|
+
static addInitializer(e) {
|
|
80
|
+
this._$Ei(), (this.l ??= []).push(e);
|
|
81
81
|
}
|
|
82
82
|
static get observedAttributes() {
|
|
83
83
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
84
|
}
|
|
85
|
-
static createProperty(
|
|
86
|
-
if (
|
|
87
|
-
const s = Symbol(), r = this.getPropertyDescriptor(
|
|
88
|
-
r !== void 0 &&
|
|
85
|
+
static createProperty(e, t = ae) {
|
|
86
|
+
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
87
|
+
const s = Symbol(), r = this.getPropertyDescriptor(e, s, t);
|
|
88
|
+
r !== void 0 && Se(this.prototype, e, r);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
static getPropertyDescriptor(
|
|
92
|
-
const { get: r, set: o } =
|
|
93
|
-
return this[
|
|
91
|
+
static getPropertyDescriptor(e, t, s) {
|
|
92
|
+
const { get: r, set: o } = ke(this.prototype, e) ?? { get() {
|
|
93
|
+
return this[t];
|
|
94
94
|
}, set(n) {
|
|
95
|
-
this[
|
|
95
|
+
this[t] = n;
|
|
96
96
|
} };
|
|
97
97
|
return { get: r, set(n) {
|
|
98
98
|
const l = r?.call(this);
|
|
99
|
-
o?.call(this, n), this.requestUpdate(
|
|
99
|
+
o?.call(this, n), this.requestUpdate(e, l, s);
|
|
100
100
|
}, configurable: !0, enumerable: !0 };
|
|
101
101
|
}
|
|
102
|
-
static getPropertyOptions(
|
|
103
|
-
return this.elementProperties.get(
|
|
102
|
+
static getPropertyOptions(e) {
|
|
103
|
+
return this.elementProperties.get(e) ?? ae;
|
|
104
104
|
}
|
|
105
105
|
static _$Ei() {
|
|
106
|
-
if (this.hasOwnProperty(
|
|
107
|
-
const
|
|
108
|
-
|
|
106
|
+
if (this.hasOwnProperty(T("elementProperties"))) return;
|
|
107
|
+
const e = Pe(this);
|
|
108
|
+
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
109
109
|
}
|
|
110
110
|
static finalize() {
|
|
111
|
-
if (this.hasOwnProperty(
|
|
112
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
113
|
-
const
|
|
114
|
-
for (const r of s) this.createProperty(r,
|
|
111
|
+
if (this.hasOwnProperty(T("finalized"))) return;
|
|
112
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(T("properties"))) {
|
|
113
|
+
const t = this.properties, s = [...Ee(t), ...Ce(t)];
|
|
114
|
+
for (const r of s) this.createProperty(r, t[r]);
|
|
115
115
|
}
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
116
|
+
const e = this[Symbol.metadata];
|
|
117
|
+
if (e !== null) {
|
|
118
|
+
const t = litPropertyMetadata.get(e);
|
|
119
|
+
if (t !== void 0) for (const [s, r] of t) this.elementProperties.set(s, r);
|
|
120
120
|
}
|
|
121
121
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
122
|
-
for (const [
|
|
123
|
-
const r = this._$Eu(
|
|
124
|
-
r !== void 0 && this._$Eh.set(r,
|
|
122
|
+
for (const [t, s] of this.elementProperties) {
|
|
123
|
+
const r = this._$Eu(t, s);
|
|
124
|
+
r !== void 0 && this._$Eh.set(r, t);
|
|
125
125
|
}
|
|
126
126
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
127
127
|
}
|
|
128
|
-
static finalizeStyles(
|
|
129
|
-
const
|
|
130
|
-
if (Array.isArray(
|
|
131
|
-
const s = new Set(
|
|
132
|
-
for (const r of s)
|
|
133
|
-
} else
|
|
134
|
-
return
|
|
128
|
+
static finalizeStyles(e) {
|
|
129
|
+
const t = [];
|
|
130
|
+
if (Array.isArray(e)) {
|
|
131
|
+
const s = new Set(e.flat(1 / 0).reverse());
|
|
132
|
+
for (const r of s) t.unshift(oe(r));
|
|
133
|
+
} else e !== void 0 && t.push(oe(e));
|
|
134
|
+
return t;
|
|
135
135
|
}
|
|
136
|
-
static _$Eu(
|
|
137
|
-
const s =
|
|
138
|
-
return s === !1 ? void 0 : typeof s == "string" ? s : typeof
|
|
136
|
+
static _$Eu(e, t) {
|
|
137
|
+
const s = t.attribute;
|
|
138
|
+
return s === !1 ? void 0 : typeof s == "string" ? s : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
139
139
|
}
|
|
140
140
|
constructor() {
|
|
141
141
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
142
142
|
}
|
|
143
143
|
_$Ev() {
|
|
144
|
-
this._$ES = new Promise((
|
|
144
|
+
this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this));
|
|
145
145
|
}
|
|
146
|
-
addController(
|
|
147
|
-
(this._$EO ??= /* @__PURE__ */ new Set()).add(
|
|
146
|
+
addController(e) {
|
|
147
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
|
|
148
148
|
}
|
|
149
|
-
removeController(
|
|
150
|
-
this._$EO?.delete(
|
|
149
|
+
removeController(e) {
|
|
150
|
+
this._$EO?.delete(e);
|
|
151
151
|
}
|
|
152
152
|
_$E_() {
|
|
153
|
-
const
|
|
154
|
-
for (const s of
|
|
155
|
-
|
|
153
|
+
const e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
|
|
154
|
+
for (const s of t.keys()) this.hasOwnProperty(s) && (e.set(s, this[s]), delete this[s]);
|
|
155
|
+
e.size > 0 && (this._$Ep = e);
|
|
156
156
|
}
|
|
157
157
|
createRenderRoot() {
|
|
158
|
-
const
|
|
159
|
-
return
|
|
158
|
+
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
159
|
+
return we(e, this.constructor.elementStyles), e;
|
|
160
160
|
}
|
|
161
161
|
connectedCallback() {
|
|
162
|
-
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((
|
|
162
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.());
|
|
163
163
|
}
|
|
164
|
-
enableUpdating(
|
|
164
|
+
enableUpdating(e) {
|
|
165
165
|
}
|
|
166
166
|
disconnectedCallback() {
|
|
167
|
-
this._$EO?.forEach((
|
|
167
|
+
this._$EO?.forEach((e) => e.hostDisconnected?.());
|
|
168
168
|
}
|
|
169
|
-
attributeChangedCallback(
|
|
170
|
-
this._$AK(
|
|
169
|
+
attributeChangedCallback(e, t, s) {
|
|
170
|
+
this._$AK(e, s);
|
|
171
171
|
}
|
|
172
|
-
_$ET(
|
|
173
|
-
const s = this.constructor.elementProperties.get(
|
|
172
|
+
_$ET(e, t) {
|
|
173
|
+
const s = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, s);
|
|
174
174
|
if (r !== void 0 && s.reflect === !0) {
|
|
175
|
-
const o = (s.converter?.toAttribute !== void 0 ? s.converter :
|
|
176
|
-
this._$Em =
|
|
175
|
+
const o = (s.converter?.toAttribute !== void 0 ? s.converter : B).toAttribute(t, s.type);
|
|
176
|
+
this._$Em = e, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
_$AK(
|
|
180
|
-
const s = this.constructor, r = s._$Eh.get(
|
|
179
|
+
_$AK(e, t) {
|
|
180
|
+
const s = this.constructor, r = s._$Eh.get(e);
|
|
181
181
|
if (r !== void 0 && this._$Em !== r) {
|
|
182
|
-
const o = s.getPropertyOptions(r), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter :
|
|
182
|
+
const o = s.getPropertyOptions(r), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : B;
|
|
183
183
|
this._$Em = r;
|
|
184
|
-
const l = n.fromAttribute(
|
|
184
|
+
const l = n.fromAttribute(t, o.type);
|
|
185
185
|
this[r] = l ?? this._$Ej?.get(r) ?? l, this._$Em = null;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
requestUpdate(
|
|
189
|
-
if (
|
|
188
|
+
requestUpdate(e, t, s, r = !1, o) {
|
|
189
|
+
if (e !== void 0) {
|
|
190
190
|
const n = this.constructor;
|
|
191
|
-
if (r === !1 && (o = this[
|
|
192
|
-
this.C(
|
|
191
|
+
if (r === !1 && (o = this[e]), s ??= n.getPropertyOptions(e), !((s.hasChanged ?? Q)(o, t) || s.useDefault && s.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(n._$Eu(e, s)))) return;
|
|
192
|
+
this.C(e, t, s);
|
|
193
193
|
}
|
|
194
194
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
195
195
|
}
|
|
196
|
-
C(
|
|
197
|
-
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(
|
|
196
|
+
C(e, t, { useDefault: s, reflect: r, wrapped: o }, n) {
|
|
197
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, n ?? t ?? this[e]), o !== !0 || n !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (t = void 0), this._$AL.set(e, t)), r === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
|
|
198
198
|
}
|
|
199
199
|
async _$EP() {
|
|
200
200
|
this.isUpdatePending = !0;
|
|
201
201
|
try {
|
|
202
202
|
await this._$ES;
|
|
203
|
-
} catch (
|
|
204
|
-
Promise.reject(
|
|
203
|
+
} catch (t) {
|
|
204
|
+
Promise.reject(t);
|
|
205
205
|
}
|
|
206
|
-
const
|
|
207
|
-
return
|
|
206
|
+
const e = this.scheduleUpdate();
|
|
207
|
+
return e != null && await e, !this.isUpdatePending;
|
|
208
208
|
}
|
|
209
209
|
scheduleUpdate() {
|
|
210
210
|
return this.performUpdate();
|
|
@@ -222,19 +222,19 @@ let S = class extends HTMLElement {
|
|
|
222
222
|
n !== !0 || this._$AL.has(r) || l === void 0 || this.C(r, void 0, o, l);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
let
|
|
226
|
-
const
|
|
225
|
+
let e = !1;
|
|
226
|
+
const t = this._$AL;
|
|
227
227
|
try {
|
|
228
|
-
|
|
228
|
+
e = this.shouldUpdate(t), e ? (this.willUpdate(t), this._$EO?.forEach((s) => s.hostUpdate?.()), this.update(t)) : this._$EM();
|
|
229
229
|
} catch (s) {
|
|
230
|
-
throw
|
|
230
|
+
throw e = !1, this._$EM(), s;
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
e && this._$AE(t);
|
|
233
233
|
}
|
|
234
|
-
willUpdate(
|
|
234
|
+
willUpdate(e) {
|
|
235
235
|
}
|
|
236
|
-
_$AE(
|
|
237
|
-
this._$EO?.forEach((
|
|
236
|
+
_$AE(e) {
|
|
237
|
+
this._$EO?.forEach((t) => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
238
238
|
}
|
|
239
239
|
_$EM() {
|
|
240
240
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
@@ -245,88 +245,88 @@ let S = class extends HTMLElement {
|
|
|
245
245
|
getUpdateComplete() {
|
|
246
246
|
return this._$ES;
|
|
247
247
|
}
|
|
248
|
-
shouldUpdate(
|
|
248
|
+
shouldUpdate(e) {
|
|
249
249
|
return !0;
|
|
250
250
|
}
|
|
251
|
-
update(
|
|
252
|
-
this._$Eq &&= this._$Eq.forEach((
|
|
251
|
+
update(e) {
|
|
252
|
+
this._$Eq &&= this._$Eq.forEach((t) => this._$ET(t, this[t])), this._$EM();
|
|
253
253
|
}
|
|
254
|
-
updated(
|
|
254
|
+
updated(e) {
|
|
255
255
|
}
|
|
256
|
-
firstUpdated(
|
|
256
|
+
firstUpdated(e) {
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
|
-
|
|
259
|
+
k.elementStyles = [], k.shadowRootOptions = { mode: "open" }, k[T("elementProperties")] = /* @__PURE__ */ new Map(), k[T("finalized")] = /* @__PURE__ */ new Map(), Me?.({ ReactiveElement: k }), (q.reactiveElementVersions ??= []).push("2.1.2");
|
|
260
260
|
/**
|
|
261
261
|
* @license
|
|
262
262
|
* Copyright 2017 Google LLC
|
|
263
263
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
264
264
|
*/
|
|
265
|
-
const
|
|
266
|
-
\f\r]`,
|
|
267
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
268
|
-
function
|
|
269
|
-
if (!
|
|
270
|
-
return
|
|
265
|
+
const ee = globalThis, le = (i) => i, L = ee.trustedTypes, he = L ? L.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, ye = "$lit$", y = `lit$${Math.random().toFixed(9).slice(2)}$`, $e = "?" + y, Te = `<${$e}>`, w = document, U = () => w.createComment(""), F = (i) => i === null || typeof i != "object" && typeof i != "function", te = Array.isArray, Ue = (i) => te(i) || typeof i?.[Symbol.iterator] == "function", J = `[
|
|
266
|
+
\f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ce = /-->/g, de = />/g, x = RegExp(`>|${J}(?:([^\\s"'>=/]+)(${J}*=${J}*(?:[^
|
|
267
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), pe = /'/g, fe = /"/g, me = /^(?:script|style|textarea|title)$/i, Fe = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), f = Fe(1), E = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), ue = /* @__PURE__ */ new WeakMap(), _ = w.createTreeWalker(w, 129);
|
|
268
|
+
function xe(i, e) {
|
|
269
|
+
if (!te(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
270
|
+
return he !== void 0 ? he.createHTML(e) : e;
|
|
271
271
|
}
|
|
272
|
-
const
|
|
273
|
-
const
|
|
274
|
-
let r, o =
|
|
275
|
-
for (let l = 0; l <
|
|
272
|
+
const Ne = (i, e) => {
|
|
273
|
+
const t = i.length - 1, s = [];
|
|
274
|
+
let r, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = O;
|
|
275
|
+
for (let l = 0; l < t; l++) {
|
|
276
276
|
const a = i[l];
|
|
277
|
-
let d, p, h = -1,
|
|
278
|
-
for (;
|
|
279
|
-
const
|
|
280
|
-
o += n ===
|
|
277
|
+
let d, p, h = -1, g = 0;
|
|
278
|
+
for (; g < a.length && (n.lastIndex = g, p = n.exec(a), p !== null); ) g = n.lastIndex, n === O ? p[1] === "!--" ? n = ce : p[1] !== void 0 ? n = de : p[2] !== void 0 ? (me.test(p[2]) && (r = RegExp("</" + p[2], "g")), n = x) : p[3] !== void 0 && (n = x) : n === x ? p[0] === ">" ? (n = r ?? O, h = -1) : p[1] === void 0 ? h = -2 : (h = n.lastIndex - p[2].length, d = p[1], n = p[3] === void 0 ? x : p[3] === '"' ? fe : pe) : n === fe || n === pe ? n = x : n === ce || n === de ? n = O : (n = x, r = void 0);
|
|
279
|
+
const b = n === x && i[l + 1].startsWith("/>") ? " " : "";
|
|
280
|
+
o += n === O ? a + Te : h >= 0 ? (s.push(d), a.slice(0, h) + ye + a.slice(h) + y + b) : a + y + (h === -2 ? l : b);
|
|
281
281
|
}
|
|
282
|
-
return [
|
|
282
|
+
return [xe(i, o + (i[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
|
|
283
283
|
};
|
|
284
284
|
class N {
|
|
285
|
-
constructor({ strings:
|
|
285
|
+
constructor({ strings: e, _$litType$: t }, s) {
|
|
286
286
|
let r;
|
|
287
287
|
this.parts = [];
|
|
288
288
|
let o = 0, n = 0;
|
|
289
|
-
const l =
|
|
290
|
-
if (this.el = N.createElement(d, s), _.currentNode = this.el.content,
|
|
289
|
+
const l = e.length - 1, a = this.parts, [d, p] = Ne(e, t);
|
|
290
|
+
if (this.el = N.createElement(d, s), _.currentNode = this.el.content, t === 2 || t === 3) {
|
|
291
291
|
const h = this.el.content.firstChild;
|
|
292
292
|
h.replaceWith(...h.childNodes);
|
|
293
293
|
}
|
|
294
294
|
for (; (r = _.nextNode()) !== null && a.length < l; ) {
|
|
295
295
|
if (r.nodeType === 1) {
|
|
296
|
-
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(
|
|
297
|
-
const
|
|
298
|
-
a.push({ type: 1, index: o, name:
|
|
299
|
-
} else h.startsWith(
|
|
300
|
-
if (
|
|
301
|
-
const h = r.textContent.split(
|
|
302
|
-
if (
|
|
303
|
-
r.textContent =
|
|
304
|
-
for (let
|
|
305
|
-
r.append(h[
|
|
296
|
+
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(ye)) {
|
|
297
|
+
const g = p[n++], b = r.getAttribute(h).split(y), D = /([.?@])?(.*)/.exec(g);
|
|
298
|
+
a.push({ type: 1, index: o, name: D[2], strings: b, ctor: D[1] === "." ? Re : D[1] === "?" ? je : D[1] === "@" ? Ie : W }), r.removeAttribute(h);
|
|
299
|
+
} else h.startsWith(y) && (a.push({ type: 6, index: o }), r.removeAttribute(h));
|
|
300
|
+
if (me.test(r.tagName)) {
|
|
301
|
+
const h = r.textContent.split(y), g = h.length - 1;
|
|
302
|
+
if (g > 0) {
|
|
303
|
+
r.textContent = L ? L.emptyScript : "";
|
|
304
|
+
for (let b = 0; b < g; b++) r.append(h[b], U()), _.nextNode(), a.push({ type: 2, index: ++o });
|
|
305
|
+
r.append(h[g], U());
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
} else if (r.nodeType === 8) if (r.data ===
|
|
308
|
+
} else if (r.nodeType === 8) if (r.data === $e) a.push({ type: 2, index: o });
|
|
309
309
|
else {
|
|
310
310
|
let h = -1;
|
|
311
|
-
for (; (h = r.data.indexOf(
|
|
311
|
+
for (; (h = r.data.indexOf(y, h + 1)) !== -1; ) a.push({ type: 7, index: o }), h += y.length - 1;
|
|
312
312
|
}
|
|
313
313
|
o++;
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
static createElement(
|
|
316
|
+
static createElement(e, t) {
|
|
317
317
|
const s = w.createElement("template");
|
|
318
|
-
return s.innerHTML =
|
|
318
|
+
return s.innerHTML = e, s;
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
-
function
|
|
322
|
-
if (
|
|
323
|
-
let r = s !== void 0 ?
|
|
324
|
-
const o =
|
|
325
|
-
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(i), r._$AT(i,
|
|
321
|
+
function C(i, e, t = i, s) {
|
|
322
|
+
if (e === E) return e;
|
|
323
|
+
let r = s !== void 0 ? t._$Co?.[s] : t._$Cl;
|
|
324
|
+
const o = F(e) ? void 0 : e._$litDirective$;
|
|
325
|
+
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(i), r._$AT(i, t, s)), s !== void 0 ? (t._$Co ??= [])[s] = r : t._$Cl = r), r !== void 0 && (e = C(i, r._$AS(i, e.values), r, s)), e;
|
|
326
326
|
}
|
|
327
|
-
class
|
|
328
|
-
constructor(
|
|
329
|
-
this._$AV = [], this._$AN = void 0, this._$AD =
|
|
327
|
+
class He {
|
|
328
|
+
constructor(e, t) {
|
|
329
|
+
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
330
330
|
}
|
|
331
331
|
get parentNode() {
|
|
332
332
|
return this._$AM.parentNode;
|
|
@@ -334,35 +334,35 @@ class Ot {
|
|
|
334
334
|
get _$AU() {
|
|
335
335
|
return this._$AM._$AU;
|
|
336
336
|
}
|
|
337
|
-
u(
|
|
338
|
-
const { el: { content:
|
|
337
|
+
u(e) {
|
|
338
|
+
const { el: { content: t }, parts: s } = this._$AD, r = (e?.creationScope ?? w).importNode(t, !0);
|
|
339
339
|
_.currentNode = r;
|
|
340
340
|
let o = _.nextNode(), n = 0, l = 0, a = s[0];
|
|
341
341
|
for (; a !== void 0; ) {
|
|
342
342
|
if (n === a.index) {
|
|
343
343
|
let d;
|
|
344
|
-
a.type === 2 ? d = new
|
|
344
|
+
a.type === 2 ? d = new R(o, o.nextSibling, this, e) : a.type === 1 ? d = new a.ctor(o, a.name, a.strings, this, e) : a.type === 6 && (d = new De(o, this, e)), this._$AV.push(d), a = s[++l];
|
|
345
345
|
}
|
|
346
346
|
n !== a?.index && (o = _.nextNode(), n++);
|
|
347
347
|
}
|
|
348
348
|
return _.currentNode = w, r;
|
|
349
349
|
}
|
|
350
|
-
p(
|
|
351
|
-
let
|
|
352
|
-
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(
|
|
350
|
+
p(e) {
|
|
351
|
+
let t = 0;
|
|
352
|
+
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, t), t += s.strings.length - 2) : s._$AI(e[t])), t++;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
-
class
|
|
355
|
+
class R {
|
|
356
356
|
get _$AU() {
|
|
357
357
|
return this._$AM?._$AU ?? this._$Cv;
|
|
358
358
|
}
|
|
359
|
-
constructor(
|
|
360
|
-
this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA =
|
|
359
|
+
constructor(e, t, s, r) {
|
|
360
|
+
this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
361
361
|
}
|
|
362
362
|
get parentNode() {
|
|
363
|
-
let
|
|
364
|
-
const
|
|
365
|
-
return
|
|
363
|
+
let e = this._$AA.parentNode;
|
|
364
|
+
const t = this._$AM;
|
|
365
|
+
return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
|
|
366
366
|
}
|
|
367
367
|
get startNode() {
|
|
368
368
|
return this._$AA;
|
|
@@ -370,120 +370,120 @@ class H {
|
|
|
370
370
|
get endNode() {
|
|
371
371
|
return this._$AB;
|
|
372
372
|
}
|
|
373
|
-
_$AI(
|
|
374
|
-
|
|
373
|
+
_$AI(e, t = this) {
|
|
374
|
+
e = C(this, e, t), F(e) ? e === c || e == null || e === "" ? (this._$AH !== c && this._$AR(), this._$AH = c) : e !== this._$AH && e !== E && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ue(e) ? this.k(e) : this._(e);
|
|
375
375
|
}
|
|
376
|
-
O(
|
|
377
|
-
return this._$AA.parentNode.insertBefore(
|
|
376
|
+
O(e) {
|
|
377
|
+
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
378
378
|
}
|
|
379
|
-
T(
|
|
380
|
-
this._$AH !==
|
|
379
|
+
T(e) {
|
|
380
|
+
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
381
381
|
}
|
|
382
|
-
_(
|
|
383
|
-
this._$AH !== c &&
|
|
382
|
+
_(e) {
|
|
383
|
+
this._$AH !== c && F(this._$AH) ? this._$AA.nextSibling.data = e : this.T(w.createTextNode(e)), this._$AH = e;
|
|
384
384
|
}
|
|
385
|
-
$(
|
|
386
|
-
const { values:
|
|
387
|
-
if (this._$AH?._$AD === r) this._$AH.p(
|
|
385
|
+
$(e) {
|
|
386
|
+
const { values: t, _$litType$: s } = e, r = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = N.createElement(xe(s.h, s.h[0]), this.options)), s);
|
|
387
|
+
if (this._$AH?._$AD === r) this._$AH.p(t);
|
|
388
388
|
else {
|
|
389
|
-
const o = new
|
|
390
|
-
o.p(
|
|
389
|
+
const o = new He(r, this), n = o.u(this.options);
|
|
390
|
+
o.p(t), this.T(n), this._$AH = o;
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
|
-
_$AC(
|
|
394
|
-
let
|
|
395
|
-
return
|
|
393
|
+
_$AC(e) {
|
|
394
|
+
let t = ue.get(e.strings);
|
|
395
|
+
return t === void 0 && ue.set(e.strings, t = new N(e)), t;
|
|
396
396
|
}
|
|
397
|
-
k(
|
|
398
|
-
|
|
399
|
-
const
|
|
397
|
+
k(e) {
|
|
398
|
+
te(this._$AH) || (this._$AH = [], this._$AR());
|
|
399
|
+
const t = this._$AH;
|
|
400
400
|
let s, r = 0;
|
|
401
|
-
for (const o of
|
|
402
|
-
r <
|
|
401
|
+
for (const o of e) r === t.length ? t.push(s = new R(this.O(U()), this.O(U()), this, this.options)) : s = t[r], s._$AI(o), r++;
|
|
402
|
+
r < t.length && (this._$AR(s && s._$AB.nextSibling, r), t.length = r);
|
|
403
403
|
}
|
|
404
|
-
_$AR(
|
|
405
|
-
for (this._$AP?.(!1, !0,
|
|
406
|
-
const s =
|
|
407
|
-
|
|
404
|
+
_$AR(e = this._$AA.nextSibling, t) {
|
|
405
|
+
for (this._$AP?.(!1, !0, t); e !== this._$AB; ) {
|
|
406
|
+
const s = le(e).nextSibling;
|
|
407
|
+
le(e).remove(), e = s;
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
setConnected(
|
|
411
|
-
this._$AM === void 0 && (this._$Cv =
|
|
410
|
+
setConnected(e) {
|
|
411
|
+
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
class
|
|
414
|
+
class W {
|
|
415
415
|
get tagName() {
|
|
416
416
|
return this.element.tagName;
|
|
417
417
|
}
|
|
418
418
|
get _$AU() {
|
|
419
419
|
return this._$AM._$AU;
|
|
420
420
|
}
|
|
421
|
-
constructor(
|
|
422
|
-
this.type = 1, this._$AH = c, this._$AN = void 0, this.element =
|
|
421
|
+
constructor(e, t, s, r, o) {
|
|
422
|
+
this.type = 1, this._$AH = c, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, 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;
|
|
423
423
|
}
|
|
424
|
-
_$AI(
|
|
424
|
+
_$AI(e, t = this, s, r) {
|
|
425
425
|
const o = this.strings;
|
|
426
426
|
let n = !1;
|
|
427
|
-
if (o === void 0)
|
|
427
|
+
if (o === void 0) e = C(this, e, t, 0), n = !F(e) || e !== this._$AH && e !== E, n && (this._$AH = e);
|
|
428
428
|
else {
|
|
429
|
-
const l =
|
|
429
|
+
const l = e;
|
|
430
430
|
let a, d;
|
|
431
|
-
for (
|
|
431
|
+
for (e = o[0], a = 0; a < o.length - 1; a++) d = C(this, l[s + a], t, a), d === E && (d = this._$AH[a]), n ||= !F(d) || d !== this._$AH[a], d === c ? e = c : e !== c && (e += (d ?? "") + o[a + 1]), this._$AH[a] = d;
|
|
432
432
|
}
|
|
433
|
-
n && !r && this.j(
|
|
433
|
+
n && !r && this.j(e);
|
|
434
434
|
}
|
|
435
|
-
j(
|
|
436
|
-
|
|
435
|
+
j(e) {
|
|
436
|
+
e === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
|
-
class
|
|
439
|
+
class Re extends W {
|
|
440
440
|
constructor() {
|
|
441
441
|
super(...arguments), this.type = 3;
|
|
442
442
|
}
|
|
443
|
-
j(
|
|
444
|
-
this.element[this.name] =
|
|
443
|
+
j(e) {
|
|
444
|
+
this.element[this.name] = e === c ? void 0 : e;
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
class
|
|
447
|
+
class je extends W {
|
|
448
448
|
constructor() {
|
|
449
449
|
super(...arguments), this.type = 4;
|
|
450
450
|
}
|
|
451
|
-
j(
|
|
452
|
-
this.element.toggleAttribute(this.name, !!
|
|
451
|
+
j(e) {
|
|
452
|
+
this.element.toggleAttribute(this.name, !!e && e !== c);
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
class
|
|
456
|
-
constructor(
|
|
457
|
-
super(
|
|
455
|
+
class Ie extends W {
|
|
456
|
+
constructor(e, t, s, r, o) {
|
|
457
|
+
super(e, t, s, r, o), this.type = 5;
|
|
458
458
|
}
|
|
459
|
-
_$AI(
|
|
460
|
-
if ((
|
|
461
|
-
const s = this._$AH, r =
|
|
462
|
-
r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this,
|
|
459
|
+
_$AI(e, t = this) {
|
|
460
|
+
if ((e = C(this, e, t, 0) ?? c) === E) return;
|
|
461
|
+
const s = this._$AH, r = e === c && s !== c || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, o = e !== c && (s === c || r);
|
|
462
|
+
r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
463
463
|
}
|
|
464
|
-
handleEvent(
|
|
465
|
-
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element,
|
|
464
|
+
handleEvent(e) {
|
|
465
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
|
-
class
|
|
469
|
-
constructor(
|
|
470
|
-
this.element =
|
|
468
|
+
class De {
|
|
469
|
+
constructor(e, t, s) {
|
|
470
|
+
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
|
|
471
471
|
}
|
|
472
472
|
get _$AU() {
|
|
473
473
|
return this._$AM._$AU;
|
|
474
474
|
}
|
|
475
|
-
_$AI(
|
|
476
|
-
|
|
475
|
+
_$AI(e) {
|
|
476
|
+
C(this, e);
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
const
|
|
482
|
-
const s =
|
|
479
|
+
const ze = ee.litHtmlPolyfillSupport;
|
|
480
|
+
ze?.(N, R), (ee.litHtmlVersions ??= []).push("3.3.2");
|
|
481
|
+
const Be = (i, e, t) => {
|
|
482
|
+
const s = t?.renderBefore ?? e;
|
|
483
483
|
let r = s._$litPart$;
|
|
484
484
|
if (r === void 0) {
|
|
485
|
-
const o =
|
|
486
|
-
s._$litPart$ = r = new
|
|
485
|
+
const o = t?.renderBefore ?? null;
|
|
486
|
+
s._$litPart$ = r = new R(e.insertBefore(U(), o), o, void 0, t ?? {});
|
|
487
487
|
}
|
|
488
488
|
return r._$AI(i), r;
|
|
489
489
|
};
|
|
@@ -492,18 +492,18 @@ const Rt = (i, t, e) => {
|
|
|
492
492
|
* Copyright 2017 Google LLC
|
|
493
493
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
494
494
|
*/
|
|
495
|
-
const
|
|
496
|
-
class
|
|
495
|
+
const se = globalThis;
|
|
496
|
+
class v extends k {
|
|
497
497
|
constructor() {
|
|
498
498
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
499
499
|
}
|
|
500
500
|
createRenderRoot() {
|
|
501
|
-
const
|
|
502
|
-
return this.renderOptions.renderBefore ??=
|
|
501
|
+
const e = super.createRenderRoot();
|
|
502
|
+
return this.renderOptions.renderBefore ??= e.firstChild, e;
|
|
503
503
|
}
|
|
504
|
-
update(
|
|
505
|
-
const
|
|
506
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(
|
|
504
|
+
update(e) {
|
|
505
|
+
const t = this.render();
|
|
506
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Be(t, this.renderRoot, this.renderOptions);
|
|
507
507
|
}
|
|
508
508
|
connectedCallback() {
|
|
509
509
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -515,101 +515,104 @@ class x extends S {
|
|
|
515
515
|
return E;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
(
|
|
518
|
+
v._$litElement$ = !0, v.finalized = !0, se.litElementHydrateSupport?.({ LitElement: v });
|
|
519
|
+
const Le = se.litElementPolyfillSupport;
|
|
520
|
+
Le?.({ LitElement: v });
|
|
521
|
+
(se.litElementVersions ??= []).push("4.2.2");
|
|
522
522
|
/**
|
|
523
523
|
* @license
|
|
524
524
|
* Copyright 2017 Google LLC
|
|
525
525
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
526
526
|
*/
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
customElements.define(i,
|
|
530
|
-
}) : customElements.define(i,
|
|
527
|
+
const j = (i) => (e, t) => {
|
|
528
|
+
t !== void 0 ? t.addInitializer(() => {
|
|
529
|
+
customElements.define(i, e);
|
|
530
|
+
}) : customElements.define(i, e);
|
|
531
531
|
};
|
|
532
532
|
/**
|
|
533
533
|
* @license
|
|
534
534
|
* Copyright 2017 Google LLC
|
|
535
535
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
536
536
|
*/
|
|
537
|
-
const
|
|
538
|
-
const { kind: s, metadata: r } =
|
|
537
|
+
const Ve = { attribute: !0, type: String, converter: B, reflect: !1, hasChanged: Q }, qe = (i = Ve, e, t) => {
|
|
538
|
+
const { kind: s, metadata: r } = t;
|
|
539
539
|
let o = globalThis.litPropertyMetadata.get(r);
|
|
540
|
-
if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), o.set(
|
|
541
|
-
const { name: n } =
|
|
540
|
+
if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), o.set(t.name, i), s === "accessor") {
|
|
541
|
+
const { name: n } = t;
|
|
542
542
|
return { set(l) {
|
|
543
|
-
const a =
|
|
544
|
-
|
|
543
|
+
const a = e.get.call(this);
|
|
544
|
+
e.set.call(this, l), this.requestUpdate(n, a, i, !0, l);
|
|
545
545
|
}, init(l) {
|
|
546
546
|
return l !== void 0 && this.C(n, void 0, i, l), l;
|
|
547
547
|
} };
|
|
548
548
|
}
|
|
549
549
|
if (s === "setter") {
|
|
550
|
-
const { name: n } =
|
|
550
|
+
const { name: n } = t;
|
|
551
551
|
return function(l) {
|
|
552
552
|
const a = this[n];
|
|
553
|
-
|
|
553
|
+
e.call(this, l), this.requestUpdate(n, a, i, !0, l);
|
|
554
554
|
};
|
|
555
555
|
}
|
|
556
556
|
throw Error("Unsupported decorator location: " + s);
|
|
557
557
|
};
|
|
558
|
-
function
|
|
559
|
-
return (
|
|
558
|
+
function S(i) {
|
|
559
|
+
return (e, t) => typeof t == "object" ? qe(i, e, t) : ((s, r, o) => {
|
|
560
560
|
const n = r.hasOwnProperty(o);
|
|
561
561
|
return r.constructor.createProperty(o, s), n ? Object.getOwnPropertyDescriptor(r, o) : void 0;
|
|
562
|
-
})(i,
|
|
562
|
+
})(i, e, t);
|
|
563
563
|
}
|
|
564
564
|
/**
|
|
565
565
|
* @license
|
|
566
566
|
* Copyright 2017 Google LLC
|
|
567
567
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
568
568
|
*/
|
|
569
|
-
function
|
|
570
|
-
return
|
|
569
|
+
function m(i) {
|
|
570
|
+
return S({ ...i, state: !0, attribute: !1 });
|
|
571
571
|
}
|
|
572
|
-
var
|
|
573
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
572
|
+
var We = Object.getOwnPropertyDescriptor, Ke = (i, e, t, s) => {
|
|
573
|
+
for (var r = s > 1 ? void 0 : s ? We(e, t) : e, o = i.length - 1, n; o >= 0; o--)
|
|
574
574
|
(n = i[o]) && (r = n(r) || r);
|
|
575
575
|
return r;
|
|
576
576
|
};
|
|
577
|
-
let
|
|
577
|
+
let ge = class extends v {
|
|
578
578
|
render() {
|
|
579
579
|
return f`<slot></slot>`;
|
|
580
580
|
}
|
|
581
581
|
};
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
],
|
|
585
|
-
const
|
|
586
|
-
|
|
582
|
+
ge = Ke([
|
|
583
|
+
j("vibe-flags")
|
|
584
|
+
], ge);
|
|
585
|
+
const M = "vibe-flags:";
|
|
586
|
+
function X(i) {
|
|
587
|
+
return i.type === "boolean" ? !1 : i.options[0] || "";
|
|
588
|
+
}
|
|
589
|
+
class Je extends EventTarget {
|
|
587
590
|
constructor() {
|
|
588
|
-
super(...arguments), this.configs = /* @__PURE__ */ new Map(), this.state = {}, this.listening = !1, this.onStorageEvent = (
|
|
589
|
-
if (!
|
|
590
|
-
const
|
|
591
|
-
if (
|
|
591
|
+
super(...arguments), this.configs = /* @__PURE__ */ new Map(), this.state = {}, this.listening = !1, this.onStorageEvent = (e) => {
|
|
592
|
+
if (!e.key?.startsWith(M)) return;
|
|
593
|
+
const t = e.key.slice(M.length), s = this.configs.get(t);
|
|
594
|
+
if (s)
|
|
592
595
|
try {
|
|
593
|
-
const
|
|
594
|
-
this.state[
|
|
596
|
+
const r = e.newValue ? JSON.parse(e.newValue) : X(s);
|
|
597
|
+
this.state[t] = r, this.dispatch(t);
|
|
595
598
|
} catch {
|
|
596
599
|
}
|
|
597
600
|
};
|
|
598
601
|
}
|
|
599
|
-
register(
|
|
600
|
-
this.configs.set(
|
|
601
|
-
const
|
|
602
|
-
this.state[
|
|
602
|
+
register(e) {
|
|
603
|
+
this.configs.set(e.key, e);
|
|
604
|
+
const t = this.readFromStorage(e.key);
|
|
605
|
+
this.state[e.key] = t ?? X(e), this.listening || (this.listening = !0, typeof window < "u" && window.addEventListener("storage", this.onStorageEvent)), this.dispatch(e.key);
|
|
603
606
|
}
|
|
604
|
-
unregister(
|
|
605
|
-
this.configs.delete(
|
|
607
|
+
unregister(e) {
|
|
608
|
+
this.configs.delete(e), delete this.state[e], this.dispatch();
|
|
606
609
|
}
|
|
607
|
-
get(
|
|
608
|
-
return this.state[
|
|
610
|
+
get(e) {
|
|
611
|
+
return this.state[e];
|
|
609
612
|
}
|
|
610
|
-
set(
|
|
611
|
-
const s = this.configs.get(
|
|
612
|
-
s && (s.type === "boolean" && typeof
|
|
613
|
+
set(e, t) {
|
|
614
|
+
const s = this.configs.get(e);
|
|
615
|
+
s && (s.type === "boolean" && typeof t != "boolean" || s.type === "select" && (typeof t != "string" || !s.options.includes(t)) || (this.state[e] = t, this.writeToStorage(e, t), this.dispatch(e)));
|
|
613
616
|
}
|
|
614
617
|
getAll() {
|
|
615
618
|
return { ...this.state };
|
|
@@ -617,122 +620,205 @@ class Lt extends EventTarget {
|
|
|
617
620
|
getConfig() {
|
|
618
621
|
return Array.from(this.configs.values());
|
|
619
622
|
}
|
|
620
|
-
getConfigForKey(
|
|
621
|
-
return this.configs.get(
|
|
623
|
+
getConfigForKey(e) {
|
|
624
|
+
return this.configs.get(e);
|
|
622
625
|
}
|
|
623
626
|
reset() {
|
|
624
|
-
for (const [
|
|
625
|
-
this.state[
|
|
627
|
+
for (const [e, t] of this.configs)
|
|
628
|
+
this.state[e] = X(t), this.removeFromStorage(e);
|
|
626
629
|
this.dispatch();
|
|
627
630
|
}
|
|
628
|
-
readFromStorage(
|
|
631
|
+
readFromStorage(e) {
|
|
629
632
|
if (typeof window > "u") return null;
|
|
630
633
|
try {
|
|
631
|
-
const
|
|
632
|
-
return
|
|
634
|
+
const t = localStorage.getItem(M + e);
|
|
635
|
+
return t === null ? null : JSON.parse(t);
|
|
633
636
|
} catch {
|
|
634
637
|
return null;
|
|
635
638
|
}
|
|
636
639
|
}
|
|
637
|
-
writeToStorage(
|
|
640
|
+
writeToStorage(e, t) {
|
|
638
641
|
if (!(typeof window > "u"))
|
|
639
642
|
try {
|
|
640
|
-
localStorage.setItem(
|
|
643
|
+
localStorage.setItem(M + e, JSON.stringify(t));
|
|
641
644
|
} catch {
|
|
642
645
|
}
|
|
643
646
|
}
|
|
644
|
-
removeFromStorage(
|
|
647
|
+
removeFromStorage(e) {
|
|
645
648
|
if (!(typeof window > "u"))
|
|
646
649
|
try {
|
|
647
|
-
localStorage.removeItem(
|
|
650
|
+
localStorage.removeItem(M + e);
|
|
648
651
|
} catch {
|
|
649
652
|
}
|
|
650
653
|
}
|
|
651
|
-
dispatch(
|
|
652
|
-
const
|
|
653
|
-
detail:
|
|
654
|
+
dispatch(e) {
|
|
655
|
+
const t = { key: e, state: this.getAll() }, s = new CustomEvent("vibe-flags-changed", {
|
|
656
|
+
detail: t,
|
|
654
657
|
bubbles: !0
|
|
655
658
|
});
|
|
656
|
-
this.dispatchEvent(s), typeof window < "u" && window.dispatchEvent(new CustomEvent("vibe-flags-changed", { detail:
|
|
659
|
+
this.dispatchEvent(s), typeof window < "u" && window.dispatchEvent(new CustomEvent("vibe-flags-changed", { detail: t }));
|
|
657
660
|
}
|
|
658
661
|
}
|
|
659
|
-
const
|
|
660
|
-
var
|
|
661
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
662
|
-
(n = i[o]) && (r = (s ? n(
|
|
663
|
-
return s && r &&
|
|
662
|
+
const u = new Je();
|
|
663
|
+
var Xe = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, P = (i, e, t, s) => {
|
|
664
|
+
for (var r = s > 1 ? void 0 : s ? Ye(e, t) : e, o = i.length - 1, n; o >= 0; o--)
|
|
665
|
+
(n = i[o]) && (r = (s ? n(e, t, r) : n(r)) || r);
|
|
666
|
+
return s && r && Xe(e, t, r), r;
|
|
664
667
|
};
|
|
665
|
-
|
|
668
|
+
if (typeof document < "u" && !document.getElementById("vibe-flag-fouc")) {
|
|
669
|
+
const i = document.createElement("style");
|
|
670
|
+
i.id = "vibe-flag-fouc", i.textContent = "vibe-flag-boolean:not(:defined),vibe-flag-boolean:defined,vibe-flag-select:not(:defined),vibe-flag-select:defined,vibe-flag-option:not(:defined),vibe-flag-option:defined{visibility:hidden}", document.head.appendChild(i);
|
|
671
|
+
}
|
|
672
|
+
let A = class extends v {
|
|
666
673
|
constructor() {
|
|
667
|
-
super(...arguments), this.key = "", this.description = "", this.
|
|
674
|
+
super(...arguments), this.key = "", this.description = "", this.value = "", this.isMatch = !1, this.ready = !1, this.onFlagChange = () => {
|
|
668
675
|
this.evaluate();
|
|
669
676
|
};
|
|
670
677
|
}
|
|
671
678
|
connectedCallback() {
|
|
672
|
-
super.connectedCallback(), window.addEventListener("vibe-flags-changed", this.onFlagChange), this.registerFlag()
|
|
679
|
+
super.connectedCallback(), window.addEventListener("vibe-flags-changed", this.onFlagChange), this.registerFlag();
|
|
673
680
|
}
|
|
674
681
|
disconnectedCallback() {
|
|
675
682
|
super.disconnectedCallback(), window.removeEventListener("vibe-flags-changed", this.onFlagChange);
|
|
676
683
|
}
|
|
677
684
|
willUpdate(i) {
|
|
678
|
-
|
|
685
|
+
(i.has("key") || i.has("description")) && this.registerFlag();
|
|
679
686
|
}
|
|
680
687
|
registerFlag() {
|
|
681
|
-
|
|
682
|
-
const i = this.type === "select" ? {
|
|
683
|
-
key: this.key,
|
|
684
|
-
type: "select",
|
|
685
|
-
default: this.defaultValue || this.parseOptions()[0] || "",
|
|
686
|
-
options: this.parseOptions(),
|
|
687
|
-
label: this.description || void 0
|
|
688
|
-
} : {
|
|
688
|
+
this.key && (u.getConfigForKey(this.key) || u.register({
|
|
689
689
|
key: this.key,
|
|
690
690
|
type: "boolean",
|
|
691
|
-
default: this.defaultValue ? this.defaultValue === "true" : !1,
|
|
692
691
|
label: this.description || void 0
|
|
693
|
-
};
|
|
694
|
-
m.register(i), this.registered = !0, this.evaluate();
|
|
695
|
-
}
|
|
696
|
-
parseOptions() {
|
|
697
|
-
return this.options.split(",").map((i) => i.trim()).filter(Boolean);
|
|
692
|
+
}), this.evaluate());
|
|
698
693
|
}
|
|
699
694
|
evaluate() {
|
|
700
|
-
const i =
|
|
701
|
-
|
|
702
|
-
this.isMatch = !1;
|
|
703
|
-
return;
|
|
704
|
-
}
|
|
705
|
-
this.isMatch = String(i) === this.value;
|
|
695
|
+
const i = u.get(this.key);
|
|
696
|
+
i === void 0 ? this.isMatch = !1 : this.value === "" ? this.isMatch = !0 : this.isMatch = String(i) === this.value, this.ready || (this.ready = !0, this.style.visibility = "visible");
|
|
706
697
|
}
|
|
707
698
|
render() {
|
|
708
699
|
return this.isMatch ? f`<slot></slot>` : c;
|
|
709
700
|
}
|
|
710
701
|
};
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
],
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
],
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
],
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
],
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
],
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
],
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
]
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
702
|
+
P([
|
|
703
|
+
S({ type: String })
|
|
704
|
+
], A.prototype, "key", 2);
|
|
705
|
+
P([
|
|
706
|
+
S({ type: String })
|
|
707
|
+
], A.prototype, "description", 2);
|
|
708
|
+
P([
|
|
709
|
+
S({ type: String })
|
|
710
|
+
], A.prototype, "value", 2);
|
|
711
|
+
P([
|
|
712
|
+
m()
|
|
713
|
+
], A.prototype, "isMatch", 2);
|
|
714
|
+
P([
|
|
715
|
+
m()
|
|
716
|
+
], A.prototype, "ready", 2);
|
|
717
|
+
A = P([
|
|
718
|
+
j("vibe-flag-boolean")
|
|
719
|
+
], A);
|
|
720
|
+
var Ze = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, K = (i, e, t, s) => {
|
|
721
|
+
for (var r = s > 1 ? void 0 : s ? Ge(e, t) : e, o = i.length - 1, n; o >= 0; o--)
|
|
722
|
+
(n = i[o]) && (r = (s ? n(e, t, r) : n(r)) || r);
|
|
723
|
+
return s && r && Ze(e, t, r), r;
|
|
724
|
+
};
|
|
725
|
+
let H = class extends v {
|
|
726
|
+
constructor() {
|
|
727
|
+
super(...arguments), this.key = "", this.description = "", this.ready = !1, this.onFlagChange = () => {
|
|
728
|
+
this.syncOptions();
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
connectedCallback() {
|
|
732
|
+
super.connectedCallback(), window.addEventListener("vibe-flags-changed", this.onFlagChange), queueMicrotask(() => this.registerFlag());
|
|
733
|
+
}
|
|
734
|
+
disconnectedCallback() {
|
|
735
|
+
super.disconnectedCallback(), window.removeEventListener("vibe-flags-changed", this.onFlagChange);
|
|
736
|
+
}
|
|
737
|
+
willUpdate(i) {
|
|
738
|
+
(i.has("key") || i.has("description")) && this.registerFlag();
|
|
739
|
+
}
|
|
740
|
+
getOptions() {
|
|
741
|
+
return Array.from(this.querySelectorAll("vibe-flag-option"));
|
|
742
|
+
}
|
|
743
|
+
registerFlag() {
|
|
744
|
+
if (!this.key) return;
|
|
745
|
+
const i = this.getOptions().map((e) => e.value).filter(Boolean);
|
|
746
|
+
i.length !== 0 && (u.getConfigForKey(this.key) || u.register({
|
|
747
|
+
key: this.key,
|
|
748
|
+
type: "select",
|
|
749
|
+
options: i,
|
|
750
|
+
label: this.description || void 0
|
|
751
|
+
}), this.syncOptions());
|
|
752
|
+
}
|
|
753
|
+
syncOptions() {
|
|
754
|
+
const i = u.get(this.key);
|
|
755
|
+
for (const e of this.getOptions())
|
|
756
|
+
e.active = e.value === i;
|
|
757
|
+
this.ready || (this.ready = !0, this.style.visibility = "visible");
|
|
758
|
+
}
|
|
759
|
+
render() {
|
|
760
|
+
return f`<slot></slot>`;
|
|
761
|
+
}
|
|
762
|
+
};
|
|
763
|
+
K([
|
|
764
|
+
S({ type: String })
|
|
765
|
+
], H.prototype, "key", 2);
|
|
766
|
+
K([
|
|
767
|
+
S({ type: String })
|
|
768
|
+
], H.prototype, "description", 2);
|
|
769
|
+
K([
|
|
770
|
+
m()
|
|
771
|
+
], H.prototype, "ready", 2);
|
|
772
|
+
H = K([
|
|
773
|
+
j("vibe-flag-select")
|
|
774
|
+
], H);
|
|
775
|
+
var Qe = Object.defineProperty, et = Object.getOwnPropertyDescriptor, ie = (i, e, t, s) => {
|
|
776
|
+
for (var r = s > 1 ? void 0 : s ? et(e, t) : e, o = i.length - 1, n; o >= 0; o--)
|
|
777
|
+
(n = i[o]) && (r = (s ? n(e, t, r) : n(r)) || r);
|
|
778
|
+
return s && r && Qe(e, t, r), r;
|
|
779
|
+
};
|
|
780
|
+
let V = class extends v {
|
|
781
|
+
constructor() {
|
|
782
|
+
super(...arguments), this.value = "", this.active = !1;
|
|
783
|
+
}
|
|
784
|
+
render() {
|
|
785
|
+
return this.active ? f`<slot></slot>` : c;
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
ie([
|
|
789
|
+
S({ type: String })
|
|
790
|
+
], V.prototype, "value", 2);
|
|
791
|
+
ie([
|
|
792
|
+
m()
|
|
793
|
+
], V.prototype, "active", 2);
|
|
794
|
+
V = ie([
|
|
795
|
+
j("vibe-flag-option")
|
|
796
|
+
], V);
|
|
797
|
+
const tt = G`
|
|
798
|
+
:host {
|
|
799
|
+
--vf-bg: #0a0a0a;
|
|
800
|
+
--vf-bg-muted: #171717;
|
|
801
|
+
--vf-bg-hover: #262626;
|
|
802
|
+
--vf-border: #2e2e2e;
|
|
803
|
+
--vf-text: #fafafa;
|
|
804
|
+
--vf-text-muted: #a3a3a3;
|
|
805
|
+
--vf-primary: #fafafa;
|
|
806
|
+
--vf-primary-fg: #0a0a0a;
|
|
807
|
+
--vf-accent: #818cf8;
|
|
808
|
+
--vf-accent-fg: #ffffff;
|
|
809
|
+
--vf-destructive: #ef4444;
|
|
810
|
+
--vf-radius: 6px;
|
|
811
|
+
--vf-radius-lg: 8px;
|
|
812
|
+
--vf-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
813
|
+
'Helvetica Neue', Arial, sans-serif;
|
|
814
|
+
--vf-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4),
|
|
815
|
+
0 1px 2px -1px rgba(0, 0, 0, 0.4);
|
|
816
|
+
--vf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5),
|
|
817
|
+
0 4px 6px -4px rgba(0, 0, 0, 0.5);
|
|
818
|
+
--vf-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6),
|
|
819
|
+
0 8px 10px -6px rgba(0, 0, 0, 0.6);
|
|
820
|
+
}
|
|
821
|
+
`, st = G`
|
|
736
822
|
:host {
|
|
737
823
|
--vf-bg: #ffffff;
|
|
738
824
|
--vf-bg-muted: #f5f5f5;
|
|
@@ -757,25 +843,41 @@ const Wt = dt`
|
|
|
757
843
|
0 8px 10px -6px rgba(0, 0, 0, 0.1);
|
|
758
844
|
}
|
|
759
845
|
`;
|
|
760
|
-
var
|
|
761
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
762
|
-
(n = i[o]) && (r = (s ? n(
|
|
763
|
-
return s && r &&
|
|
846
|
+
var it = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, I = (i, e, t, s) => {
|
|
847
|
+
for (var r = s > 1 ? void 0 : s ? rt(e, t) : e, o = i.length - 1, n; o >= 0; o--)
|
|
848
|
+
(n = i[o]) && (r = (s ? n(e, t, r) : n(r)) || r);
|
|
849
|
+
return s && r && it(e, t, r), r;
|
|
764
850
|
};
|
|
765
|
-
|
|
851
|
+
const ve = "vibeFlagsTheme";
|
|
852
|
+
let $ = class extends v {
|
|
766
853
|
constructor() {
|
|
767
|
-
super(...arguments), this.open = !1, this.flags = {}, this.configs = [], this.onFlagChange = () => {
|
|
854
|
+
super(...arguments), this.open = !1, this.flags = {}, this.configs = [], this.darkMode = !0, this.onFlagChange = () => {
|
|
768
855
|
this.syncFromStore();
|
|
769
856
|
};
|
|
770
857
|
}
|
|
771
858
|
connectedCallback() {
|
|
772
|
-
super.connectedCallback(), window.addEventListener("vibe-flags-changed", this.onFlagChange), this.syncFromStore();
|
|
859
|
+
super.connectedCallback(), window.addEventListener("vibe-flags-changed", this.onFlagChange), this.syncFromStore(), this.loadTheme();
|
|
773
860
|
}
|
|
774
861
|
disconnectedCallback() {
|
|
775
862
|
super.disconnectedCallback(), window.removeEventListener("vibe-flags-changed", this.onFlagChange);
|
|
776
863
|
}
|
|
864
|
+
loadTheme() {
|
|
865
|
+
if (typeof window > "u") return;
|
|
866
|
+
const i = localStorage.getItem(ve);
|
|
867
|
+
this.darkMode = i ? i === "dark" : !0, this.applyTheme();
|
|
868
|
+
}
|
|
869
|
+
toggleTheme() {
|
|
870
|
+
this.darkMode = !this.darkMode, localStorage.setItem(ve, this.darkMode ? "dark" : "light"), this.applyTheme();
|
|
871
|
+
}
|
|
872
|
+
applyTheme() {
|
|
873
|
+
const i = this.darkMode ? tt : st, e = new CSSStyleSheet();
|
|
874
|
+
e.replaceSync(i.cssText), this.shadowRoot.adoptedStyleSheets = [
|
|
875
|
+
...$.elementStyles.map((t) => t.styleSheet),
|
|
876
|
+
e
|
|
877
|
+
];
|
|
878
|
+
}
|
|
777
879
|
syncFromStore() {
|
|
778
|
-
this.configs =
|
|
880
|
+
this.configs = u.getConfig(), this.flags = u.getAll();
|
|
779
881
|
}
|
|
780
882
|
toggleSidebar() {
|
|
781
883
|
this.open = !this.open;
|
|
@@ -784,15 +886,15 @@ let C = class extends x {
|
|
|
784
886
|
this.open = !1;
|
|
785
887
|
}
|
|
786
888
|
onToggle(i) {
|
|
787
|
-
const
|
|
788
|
-
|
|
889
|
+
const e = this.flags[i];
|
|
890
|
+
u.set(i, !e);
|
|
789
891
|
}
|
|
790
|
-
onSelect(i,
|
|
791
|
-
const
|
|
792
|
-
|
|
892
|
+
onSelect(i, e) {
|
|
893
|
+
const t = e.target;
|
|
894
|
+
u.set(i, t.value);
|
|
793
895
|
}
|
|
794
896
|
onReset() {
|
|
795
|
-
|
|
897
|
+
u.reset();
|
|
796
898
|
}
|
|
797
899
|
renderFlagIcon() {
|
|
798
900
|
return f`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"/><line x1="4" y1="22" x2="4" y2="15"/></svg>`;
|
|
@@ -803,8 +905,14 @@ let C = class extends x {
|
|
|
803
905
|
renderChevronDown() {
|
|
804
906
|
return f`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>`;
|
|
805
907
|
}
|
|
908
|
+
renderSunIcon() {
|
|
909
|
+
return f`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg>`;
|
|
910
|
+
}
|
|
911
|
+
renderMoonIcon() {
|
|
912
|
+
return f`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>`;
|
|
913
|
+
}
|
|
806
914
|
renderBooleanFlag(i) {
|
|
807
|
-
const
|
|
915
|
+
const e = this.flags[i.key] === !0;
|
|
808
916
|
return f`
|
|
809
917
|
<div class="flag-item">
|
|
810
918
|
<div class="flag-row">
|
|
@@ -815,7 +923,7 @@ let C = class extends x {
|
|
|
815
923
|
<label class="toggle">
|
|
816
924
|
<input
|
|
817
925
|
type="checkbox"
|
|
818
|
-
.checked=${
|
|
926
|
+
.checked=${e}
|
|
819
927
|
@change=${() => this.onToggle(i.key)}
|
|
820
928
|
/>
|
|
821
929
|
<span class="toggle-track"></span>
|
|
@@ -827,7 +935,7 @@ let C = class extends x {
|
|
|
827
935
|
}
|
|
828
936
|
renderSelectFlag(i) {
|
|
829
937
|
if (i.type !== "select") return c;
|
|
830
|
-
const
|
|
938
|
+
const e = this.flags[i.key];
|
|
831
939
|
return f`
|
|
832
940
|
<div class="flag-item">
|
|
833
941
|
<div class="flag-row">
|
|
@@ -838,12 +946,12 @@ let C = class extends x {
|
|
|
838
946
|
<div class="select-wrapper">
|
|
839
947
|
<select
|
|
840
948
|
class="select"
|
|
841
|
-
.value=${
|
|
842
|
-
@change=${(
|
|
949
|
+
.value=${e}
|
|
950
|
+
@change=${(t) => this.onSelect(i.key, t)}
|
|
843
951
|
>
|
|
844
952
|
${i.options.map(
|
|
845
|
-
(
|
|
846
|
-
${
|
|
953
|
+
(t) => f`<option value=${t} ?selected=${t === e}>
|
|
954
|
+
${t}
|
|
847
955
|
</option>`
|
|
848
956
|
)}
|
|
849
957
|
</select>
|
|
@@ -870,9 +978,14 @@ let C = class extends x {
|
|
|
870
978
|
VibeFlags
|
|
871
979
|
<span class="badge">${this.configs.length}</span>
|
|
872
980
|
</h2>
|
|
873
|
-
<
|
|
874
|
-
${this.
|
|
875
|
-
|
|
981
|
+
<div class="header-actions">
|
|
982
|
+
<button class="icon-btn" @click=${this.toggleTheme} aria-label="Toggle theme" title="${this.darkMode ? "Switch to light theme" : "Switch to dark theme"}">
|
|
983
|
+
${this.darkMode ? this.renderSunIcon() : this.renderMoonIcon()}
|
|
984
|
+
</button>
|
|
985
|
+
<button class="icon-btn" @click=${this.closeSidebar} aria-label="Close">
|
|
986
|
+
${this.renderCloseIcon()}
|
|
987
|
+
</button>
|
|
988
|
+
</div>
|
|
876
989
|
</div>
|
|
877
990
|
|
|
878
991
|
<div class="flags">
|
|
@@ -890,9 +1003,8 @@ let C = class extends x {
|
|
|
890
1003
|
`;
|
|
891
1004
|
}
|
|
892
1005
|
};
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
dt`
|
|
1006
|
+
$.styles = [
|
|
1007
|
+
G`
|
|
896
1008
|
* {
|
|
897
1009
|
box-sizing: border-box;
|
|
898
1010
|
margin: 0;
|
|
@@ -979,6 +1091,12 @@ C.styles = [
|
|
|
979
1091
|
flex-shrink: 0;
|
|
980
1092
|
}
|
|
981
1093
|
|
|
1094
|
+
.header-left {
|
|
1095
|
+
display: flex;
|
|
1096
|
+
align-items: center;
|
|
1097
|
+
gap: 8px;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
982
1100
|
.header h2 {
|
|
983
1101
|
font-size: 16px;
|
|
984
1102
|
font-weight: 600;
|
|
@@ -994,6 +1112,12 @@ C.styles = [
|
|
|
994
1112
|
color: var(--vf-accent);
|
|
995
1113
|
}
|
|
996
1114
|
|
|
1115
|
+
.header-actions {
|
|
1116
|
+
display: flex;
|
|
1117
|
+
align-items: center;
|
|
1118
|
+
gap: 4px;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
997
1121
|
.badge {
|
|
998
1122
|
font-size: 11px;
|
|
999
1123
|
font-weight: 500;
|
|
@@ -1004,7 +1128,7 @@ C.styles = [
|
|
|
1004
1128
|
border: 1px solid var(--vf-border);
|
|
1005
1129
|
}
|
|
1006
1130
|
|
|
1007
|
-
.
|
|
1131
|
+
.icon-btn {
|
|
1008
1132
|
width: 32px;
|
|
1009
1133
|
height: 32px;
|
|
1010
1134
|
border: none;
|
|
@@ -1018,12 +1142,12 @@ C.styles = [
|
|
|
1018
1142
|
transition: all 0.15s ease;
|
|
1019
1143
|
}
|
|
1020
1144
|
|
|
1021
|
-
.
|
|
1145
|
+
.icon-btn:hover {
|
|
1022
1146
|
background: var(--vf-bg-muted);
|
|
1023
1147
|
color: var(--vf-text);
|
|
1024
1148
|
}
|
|
1025
1149
|
|
|
1026
|
-
.
|
|
1150
|
+
.icon-btn svg {
|
|
1027
1151
|
width: 16px;
|
|
1028
1152
|
height: 16px;
|
|
1029
1153
|
}
|
|
@@ -1196,21 +1320,26 @@ C.styles = [
|
|
|
1196
1320
|
}
|
|
1197
1321
|
`
|
|
1198
1322
|
];
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
],
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
],
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
],
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
],
|
|
1323
|
+
I([
|
|
1324
|
+
m()
|
|
1325
|
+
], $.prototype, "open", 2);
|
|
1326
|
+
I([
|
|
1327
|
+
m()
|
|
1328
|
+
], $.prototype, "flags", 2);
|
|
1329
|
+
I([
|
|
1330
|
+
m()
|
|
1331
|
+
], $.prototype, "configs", 2);
|
|
1332
|
+
I([
|
|
1333
|
+
m()
|
|
1334
|
+
], $.prototype, "darkMode", 2);
|
|
1335
|
+
$ = I([
|
|
1336
|
+
j("vibe-toolbar")
|
|
1337
|
+
], $);
|
|
1211
1338
|
export {
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1339
|
+
A as VibeFlagBoolean,
|
|
1340
|
+
V as VibeFlagOption,
|
|
1341
|
+
H as VibeFlagSelect,
|
|
1342
|
+
ge as VibeFlags,
|
|
1343
|
+
$ as VibeToolbar,
|
|
1344
|
+
u as flagStore
|
|
1216
1345
|
};
|