@openlv/modal 0.0.1-beta.10

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.
Files changed (94) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +1 -0
  3. package/dist/ar-CyZSQ56p.js +25 -0
  4. package/dist/ar-CyZSQ56p.js.map +1 -0
  5. package/dist/ar-xpXGBcxc.cjs +3 -0
  6. package/dist/ar-xpXGBcxc.cjs.map +1 -0
  7. package/dist/assets/logo.d.ts +5 -0
  8. package/dist/components/Header.d.ts +9 -0
  9. package/dist/components/ModalRoot.d.ts +9 -0
  10. package/dist/components/UnknownState.d.ts +4 -0
  11. package/dist/components/footer/Footer.d.ts +1 -0
  12. package/dist/components/footer/StatusIndicator.d.ts +1 -0
  13. package/dist/components/settings/a11y/index.d.ts +1 -0
  14. package/dist/components/settings/a11y/theme.d.ts +2 -0
  15. package/dist/components/settings/connection/index.d.ts +4 -0
  16. package/dist/components/settings/connection/signaling.d.ts +1 -0
  17. package/dist/components/settings/connection/transport.d.ts +1 -0
  18. package/dist/components/settings/index.d.ts +11 -0
  19. package/dist/context.d.ts +11 -0
  20. package/dist/element.d.ts +23 -0
  21. package/dist/es-B9xaw9fo.cjs +3 -0
  22. package/dist/es-B9xaw9fo.cjs.map +1 -0
  23. package/dist/es-C2sG0TfH.js +25 -0
  24. package/dist/es-C2sG0TfH.js.map +1 -0
  25. package/dist/fa-DCpZYzOX.cjs +3 -0
  26. package/dist/fa-DCpZYzOX.cjs.map +1 -0
  27. package/dist/fa-_bXJQdwj.js +25 -0
  28. package/dist/fa-_bXJQdwj.js.map +1 -0
  29. package/dist/flow/ConnectionFlow.d.ts +6 -0
  30. package/dist/flow/HandshakeOpen.d.ts +4 -0
  31. package/dist/flow/InfoScreen.d.ts +1 -0
  32. package/dist/flow/disconnected/ConnectionGraphic.d.ts +1 -0
  33. package/dist/flow/disconnected/Disconnected.d.ts +4 -0
  34. package/dist/fr-BRQDr1rj.js +25 -0
  35. package/dist/fr-BRQDr1rj.js.map +1 -0
  36. package/dist/fr-D54ESMxz.cjs +3 -0
  37. package/dist/fr-D54ESMxz.cjs.map +1 -0
  38. package/dist/he-BWZyf3Uy.cjs +3 -0
  39. package/dist/he-BWZyf3Uy.cjs.map +1 -0
  40. package/dist/he-NFIsHMZP.js +25 -0
  41. package/dist/he-NFIsHMZP.js.map +1 -0
  42. package/dist/hooks/useClipboard.d.ts +1 -0
  43. package/dist/hooks/useConnectionState.d.ts +7 -0
  44. package/dist/hooks/useEventEmitter.d.ts +2 -0
  45. package/dist/hooks/useNavigationStack.d.ts +12 -0
  46. package/dist/hooks/useProvider.d.ts +5 -0
  47. package/dist/hooks/usePunchTransition.d.ts +8 -0
  48. package/dist/hooks/useSession.d.ts +8 -0
  49. package/dist/hooks/useSettings.d.ts +45 -0
  50. package/dist/hooks/useThemeConfig.d.ts +8 -0
  51. package/dist/index.cjs.js +8 -0
  52. package/dist/index.cjs.js.map +1 -0
  53. package/dist/index.d.ts +13 -0
  54. package/dist/index.es.js +2633 -0
  55. package/dist/index.es.js.map +1 -0
  56. package/dist/modal.css +1 -0
  57. package/dist/nl-BRV9i3nM.js +24 -0
  58. package/dist/nl-BRV9i3nM.js.map +1 -0
  59. package/dist/nl-bCeoO8RU.cjs +2 -0
  60. package/dist/nl-bCeoO8RU.cjs.map +1 -0
  61. package/dist/openlv-CH8lb3Oi.js +98 -0
  62. package/dist/openlv-CH8lb3Oi.js.map +1 -0
  63. package/dist/openlv-SMG3Trx9.cjs +2 -0
  64. package/dist/openlv-SMG3Trx9.cjs.map +1 -0
  65. package/dist/simple-CAAgvkQC.js +114 -0
  66. package/dist/simple-CAAgvkQC.js.map +1 -0
  67. package/dist/simple-DDht1UVo.cjs +2 -0
  68. package/dist/simple-DDht1UVo.cjs.map +1 -0
  69. package/dist/styles/index.d.ts +5 -0
  70. package/dist/sv-BHh_RkLw.cjs +2 -0
  71. package/dist/sv-BHh_RkLw.cjs.map +1 -0
  72. package/dist/sv-CEyo-XBk.js +24 -0
  73. package/dist/sv-CEyo-XBk.js.map +1 -0
  74. package/dist/theme/index.d.ts +8 -0
  75. package/dist/theme/openlv.d.ts +141 -0
  76. package/dist/theme/simple.d.ts +137 -0
  77. package/dist/theme/types.d.ts +98 -0
  78. package/dist/types/connection.d.ts +13 -0
  79. package/dist/ui/Button.d.ts +62 -0
  80. package/dist/ui/InfoTooltip.d.ts +78 -0
  81. package/dist/ui/Input.d.ts +22 -0
  82. package/dist/ui/Select.d.ts +8 -0
  83. package/dist/ui/Toggle.d.ts +7 -0
  84. package/dist/ui/TransitionContainer.d.ts +9 -0
  85. package/dist/ui/menu/MenuGroup.d.ts +6 -0
  86. package/dist/ui/menu/MenuItem.d.ts +5 -0
  87. package/dist/ui/menu/MenuLink.d.ts +7 -0
  88. package/dist/utils/i18n.d.ts +34 -0
  89. package/dist/utils/log.d.ts +1 -0
  90. package/dist/zh-cn-Bqo3eRaE.cjs +3 -0
  91. package/dist/zh-cn-Bqo3eRaE.cjs.map +1 -0
  92. package/dist/zh-cn-DJpfZdjA.js +25 -0
  93. package/dist/zh-cn-DJpfZdjA.js.map +1 -0
  94. package/package.json +76 -0
@@ -0,0 +1,2633 @@
1
+ var vr = Object.defineProperty;
2
+ var mr = (t, e, r) => e in t ? vr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var Ct = (t, e, r) => mr(t, typeof e != "symbol" ? e + "" : e, r);
4
+ import { jsx as s, jsxs as v, Fragment as ht } from "preact/jsx-runtime";
5
+ import { useState as P, useEffect as I, useCallback as K, useMemo as vt, useContext as zt, useRef as G, useReducer as Ve, useLayoutEffect as yt, useImperativeHandle as Me, useId as Fe, useDebugValue as ze } from "preact/hooks";
6
+ import { render as mt, h as br, createContext as le, createElement as tt, Fragment as St, Component as bt, createRef as yr, toChildArray as it, cloneElement as wr, hydrate as xr, options as U } from "preact";
7
+ import * as kr from "qrcode-generator";
8
+ const Cr = 1, Nr = (t) => {
9
+ const e = new URLSearchParams();
10
+ return e.set("h", t.h), e.set("k", t.k), t.p && e.set("p", t.p), t.s && e.set("s", t.s), `openlv://${t.sessionId}@${Cr}?${e.toString()}`;
11
+ };
12
+ function _r(t) {
13
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
14
+ }
15
+ var Jt = { exports: {} }, pe;
16
+ function Sr() {
17
+ return pe || (pe = 1, (function(t) {
18
+ var e = Object.prototype.hasOwnProperty, r = "~";
19
+ function n() {
20
+ }
21
+ Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (r = !1));
22
+ function o(c, u, d) {
23
+ this.fn = c, this.context = u, this.once = d || !1;
24
+ }
25
+ function a(c, u, d, p, k) {
26
+ if (typeof d != "function")
27
+ throw new TypeError("The listener must be a function");
28
+ var m = new o(d, p || c, k), y = r ? r + u : u;
29
+ return c._events[y] ? c._events[y].fn ? c._events[y] = [c._events[y], m] : c._events[y].push(m) : (c._events[y] = m, c._eventsCount++), c;
30
+ }
31
+ function i(c, u) {
32
+ --c._eventsCount === 0 ? c._events = new n() : delete c._events[u];
33
+ }
34
+ function l() {
35
+ this._events = new n(), this._eventsCount = 0;
36
+ }
37
+ l.prototype.eventNames = function() {
38
+ var u = [], d, p;
39
+ if (this._eventsCount === 0) return u;
40
+ for (p in d = this._events)
41
+ e.call(d, p) && u.push(r ? p.slice(1) : p);
42
+ return Object.getOwnPropertySymbols ? u.concat(Object.getOwnPropertySymbols(d)) : u;
43
+ }, l.prototype.listeners = function(u) {
44
+ var d = r ? r + u : u, p = this._events[d];
45
+ if (!p) return [];
46
+ if (p.fn) return [p.fn];
47
+ for (var k = 0, m = p.length, y = new Array(m); k < m; k++)
48
+ y[k] = p[k].fn;
49
+ return y;
50
+ }, l.prototype.listenerCount = function(u) {
51
+ var d = r ? r + u : u, p = this._events[d];
52
+ return p ? p.fn ? 1 : p.length : 0;
53
+ }, l.prototype.emit = function(u, d, p, k, m, y) {
54
+ var E = r ? r + u : u;
55
+ if (!this._events[E]) return !1;
56
+ var f = this._events[E], x = arguments.length, g, h;
57
+ if (f.fn) {
58
+ switch (f.once && this.removeListener(u, f.fn, void 0, !0), x) {
59
+ case 1:
60
+ return f.fn.call(f.context), !0;
61
+ case 2:
62
+ return f.fn.call(f.context, d), !0;
63
+ case 3:
64
+ return f.fn.call(f.context, d, p), !0;
65
+ case 4:
66
+ return f.fn.call(f.context, d, p, k), !0;
67
+ case 5:
68
+ return f.fn.call(f.context, d, p, k, m), !0;
69
+ case 6:
70
+ return f.fn.call(f.context, d, p, k, m, y), !0;
71
+ }
72
+ for (h = 1, g = new Array(x - 1); h < x; h++)
73
+ g[h - 1] = arguments[h];
74
+ f.fn.apply(f.context, g);
75
+ } else {
76
+ var D = f.length, _;
77
+ for (h = 0; h < D; h++)
78
+ switch (f[h].once && this.removeListener(u, f[h].fn, void 0, !0), x) {
79
+ case 1:
80
+ f[h].fn.call(f[h].context);
81
+ break;
82
+ case 2:
83
+ f[h].fn.call(f[h].context, d);
84
+ break;
85
+ case 3:
86
+ f[h].fn.call(f[h].context, d, p);
87
+ break;
88
+ case 4:
89
+ f[h].fn.call(f[h].context, d, p, k);
90
+ break;
91
+ default:
92
+ if (!g) for (_ = 1, g = new Array(x - 1); _ < x; _++)
93
+ g[_ - 1] = arguments[_];
94
+ f[h].fn.apply(f[h].context, g);
95
+ }
96
+ }
97
+ return !0;
98
+ }, l.prototype.on = function(u, d, p) {
99
+ return a(this, u, d, p, !1);
100
+ }, l.prototype.once = function(u, d, p) {
101
+ return a(this, u, d, p, !0);
102
+ }, l.prototype.removeListener = function(u, d, p, k) {
103
+ var m = r ? r + u : u;
104
+ if (!this._events[m]) return this;
105
+ if (!d)
106
+ return i(this, m), this;
107
+ var y = this._events[m];
108
+ if (y.fn)
109
+ y.fn === d && (!k || y.once) && (!p || y.context === p) && i(this, m);
110
+ else {
111
+ for (var E = 0, f = [], x = y.length; E < x; E++)
112
+ (y[E].fn !== d || k && !y[E].once || p && y[E].context !== p) && f.push(y[E]);
113
+ f.length ? this._events[m] = f.length === 1 ? f[0] : f : i(this, m);
114
+ }
115
+ return this;
116
+ }, l.prototype.removeAllListeners = function(u) {
117
+ var d;
118
+ return u ? (d = r ? r + u : u, this._events[d] && i(this, d)) : (this._events = new n(), this._eventsCount = 0), this;
119
+ }, l.prototype.off = l.prototype.removeListener, l.prototype.addListener = l.prototype.on, l.prefixed = r, l.EventEmitter = l, t.exports = l;
120
+ })(Jt)), Jt.exports;
121
+ }
122
+ Sr();
123
+ const M = /* @__PURE__ */ Symbol.for("@ts-pattern/matcher"), Ue = /* @__PURE__ */ Symbol.for("@ts-pattern/isVariadic"), jt = "@ts-pattern/anonymous-select-key", Zt = (t) => !!(t && typeof t == "object"), Bt = (t) => t && !!t[M], L = (t, e, r) => {
124
+ if (Bt(t)) {
125
+ const n = t[M](), { matched: o, selections: a } = n.match(e);
126
+ return o && a && Object.keys(a).forEach((i) => r(i, a[i])), o;
127
+ }
128
+ if (Zt(t)) {
129
+ if (!Zt(e)) return !1;
130
+ if (Array.isArray(t)) {
131
+ if (!Array.isArray(e)) return !1;
132
+ let n = [], o = [], a = [];
133
+ for (const i of t.keys()) {
134
+ const l = t[i];
135
+ Bt(l) && l[Ue] ? a.push(l) : a.length ? o.push(l) : n.push(l);
136
+ }
137
+ if (a.length) {
138
+ if (a.length > 1) throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
139
+ if (e.length < n.length + o.length) return !1;
140
+ const i = e.slice(0, n.length), l = o.length === 0 ? [] : e.slice(-o.length), c = e.slice(n.length, o.length === 0 ? 1 / 0 : -o.length);
141
+ return n.every((u, d) => L(u, i[d], r)) && o.every((u, d) => L(u, l[d], r)) && (a.length === 0 || L(a[0], c, r));
142
+ }
143
+ return t.length === e.length && t.every((i, l) => L(i, e[l], r));
144
+ }
145
+ return Reflect.ownKeys(t).every((n) => {
146
+ const o = t[n];
147
+ return (n in e || Bt(a = o) && a[M]().matcherType === "optional") && L(o, e[n], r);
148
+ var a;
149
+ });
150
+ }
151
+ return Object.is(e, t);
152
+ }, V = (t) => {
153
+ var e, r, n;
154
+ return Zt(t) ? Bt(t) ? (e = (r = (n = t[M]()).getSelectionKeys) == null ? void 0 : r.call(n)) != null ? e : [] : Array.isArray(t) ? At(t, V) : At(Object.values(t), V) : [];
155
+ }, At = (t, e) => t.reduce((r, n) => r.concat(e(n)), []);
156
+ function Ar(...t) {
157
+ if (t.length === 1) {
158
+ const [e] = t;
159
+ return (r) => L(e, r, () => {
160
+ });
161
+ }
162
+ if (t.length === 2) {
163
+ const [e, r] = t;
164
+ return L(e, r, () => {
165
+ });
166
+ }
167
+ throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t.length}.`);
168
+ }
169
+ function B(t) {
170
+ return Object.assign(t, { optional: () => ce(t), and: (e) => S(t, e), or: (e) => We(t, e), select: (e) => e === void 0 ? Tt(t) : Tt(e, t) });
171
+ }
172
+ function $t(t) {
173
+ return Object.assign(((e) => Object.assign(e, { [Symbol.iterator]() {
174
+ let r = 0;
175
+ const n = [{ value: Object.assign(e, { [Ue]: !0 }), done: !1 }, { done: !0, value: void 0 }];
176
+ return { next: () => {
177
+ var o;
178
+ return (o = n[r++]) != null ? o : n.at(-1);
179
+ } };
180
+ } }))(t), { optional: () => $t(ce(t)), select: (e) => $t(e === void 0 ? Tt(t) : Tt(e, t)) });
181
+ }
182
+ function ce(t) {
183
+ return B({ [M]: () => ({ match: (e) => {
184
+ let r = {};
185
+ const n = (o, a) => {
186
+ r[o] = a;
187
+ };
188
+ return e === void 0 ? (V(t).forEach((o) => n(o, void 0)), { matched: !0, selections: r }) : { matched: L(t, e, n), selections: r };
189
+ }, getSelectionKeys: () => V(t), matcherType: "optional" }) });
190
+ }
191
+ const Tr = (t, e) => {
192
+ for (const r of t) if (!e(r)) return !1;
193
+ return !0;
194
+ }, Er = (t, e) => {
195
+ for (const [r, n] of t.entries()) if (!e(n, r)) return !1;
196
+ return !0;
197
+ }, Rr = (t, e) => {
198
+ const r = Reflect.ownKeys(t);
199
+ for (const n of r) if (!e(n, t[n])) return !1;
200
+ return !0;
201
+ };
202
+ function S(...t) {
203
+ return B({ [M]: () => ({ match: (e) => {
204
+ let r = {};
205
+ const n = (o, a) => {
206
+ r[o] = a;
207
+ };
208
+ return { matched: t.every((o) => L(o, e, n)), selections: r };
209
+ }, getSelectionKeys: () => At(t, V), matcherType: "and" }) });
210
+ }
211
+ function We(...t) {
212
+ return B({ [M]: () => ({ match: (e) => {
213
+ let r = {};
214
+ const n = (o, a) => {
215
+ r[o] = a;
216
+ };
217
+ return At(t, V).forEach((o) => n(o, void 0)), { matched: t.some((o) => L(o, e, n)), selections: r };
218
+ }, getSelectionKeys: () => At(t, V), matcherType: "or" }) });
219
+ }
220
+ function b(t) {
221
+ return { [M]: () => ({ match: (e) => ({ matched: !!t(e) }) }) };
222
+ }
223
+ function Tt(...t) {
224
+ const e = typeof t[0] == "string" ? t[0] : void 0, r = t.length === 2 ? t[1] : typeof t[0] == "string" ? void 0 : t[0];
225
+ return B({ [M]: () => ({ match: (n) => {
226
+ let o = { [e ?? jt]: n };
227
+ return { matched: r === void 0 || L(r, n, (a, i) => {
228
+ o[a] = i;
229
+ }), selections: o };
230
+ }, getSelectionKeys: () => [e ?? jt].concat(r === void 0 ? [] : V(r)) }) });
231
+ }
232
+ function Ge(t) {
233
+ return !0;
234
+ }
235
+ function Y(t) {
236
+ return typeof t == "number";
237
+ }
238
+ function et(t) {
239
+ return typeof t == "string";
240
+ }
241
+ function rt(t) {
242
+ return typeof t == "bigint";
243
+ }
244
+ const Ke = B(b(Ge)), Or = B(b(Ge)), Lr = Ke, nt = (t) => Object.assign(B(t), { startsWith: (e) => {
245
+ return nt(S(t, (r = e, b((n) => et(n) && n.startsWith(r)))));
246
+ var r;
247
+ }, endsWith: (e) => {
248
+ return nt(S(t, (r = e, b((n) => et(n) && n.endsWith(r)))));
249
+ var r;
250
+ }, minLength: (e) => nt(S(t, ((r) => b((n) => et(n) && n.length >= r))(e))), length: (e) => nt(S(t, ((r) => b((n) => et(n) && n.length === r))(e))), maxLength: (e) => nt(S(t, ((r) => b((n) => et(n) && n.length <= r))(e))), includes: (e) => {
251
+ return nt(S(t, (r = e, b((n) => et(n) && n.includes(r)))));
252
+ var r;
253
+ }, regex: (e) => {
254
+ return nt(S(t, (r = e, b((n) => et(n) && !!n.match(r)))));
255
+ var r;
256
+ } }), fe = nt(b(et)), Z = (t) => Object.assign(B(t), { between: (e, r) => Z(S(t, ((n, o) => b((a) => Y(a) && n <= a && o >= a))(e, r))), lt: (e) => Z(S(t, ((r) => b((n) => Y(n) && n < r))(e))), gt: (e) => Z(S(t, ((r) => b((n) => Y(n) && n > r))(e))), lte: (e) => Z(S(t, ((r) => b((n) => Y(n) && n <= r))(e))), gte: (e) => Z(S(t, ((r) => b((n) => Y(n) && n >= r))(e))), int: () => Z(S(t, b((e) => Y(e) && Number.isInteger(e)))), finite: () => Z(S(t, b((e) => Y(e) && Number.isFinite(e)))), positive: () => Z(S(t, b((e) => Y(e) && e > 0))), negative: () => Z(S(t, b((e) => Y(e) && e < 0))) }), Pr = Z(b(Y)), ot = (t) => Object.assign(B(t), { between: (e, r) => ot(S(t, ((n, o) => b((a) => rt(a) && n <= a && o >= a))(e, r))), lt: (e) => ot(S(t, ((r) => b((n) => rt(n) && n < r))(e))), gt: (e) => ot(S(t, ((r) => b((n) => rt(n) && n > r))(e))), lte: (e) => ot(S(t, ((r) => b((n) => rt(n) && n <= r))(e))), gte: (e) => ot(S(t, ((r) => b((n) => rt(n) && n >= r))(e))), positive: () => ot(S(t, b((e) => rt(e) && e > 0))), negative: () => ot(S(t, b((e) => rt(e) && e < 0))) }), Dr = ot(b(rt)), Br = B(b(function(t) {
257
+ return typeof t == "boolean";
258
+ })), Ir = B(b(function(t) {
259
+ return typeof t == "symbol";
260
+ })), jr = B(b(function(t) {
261
+ return t == null;
262
+ })), Vr = B(b(function(t) {
263
+ return t != null;
264
+ }));
265
+ var He = { __proto__: null, matcher: M, optional: ce, array: function(...t) {
266
+ return $t({ [M]: () => ({ match: (e) => {
267
+ if (!Array.isArray(e)) return { matched: !1 };
268
+ if (t.length === 0) return { matched: !0 };
269
+ const r = t[0];
270
+ let n = {};
271
+ if (e.length === 0) return V(r).forEach((a) => {
272
+ n[a] = [];
273
+ }), { matched: !0, selections: n };
274
+ const o = (a, i) => {
275
+ n[a] = (n[a] || []).concat([i]);
276
+ };
277
+ return { matched: e.every((a) => L(r, a, o)), selections: n };
278
+ }, getSelectionKeys: () => t.length === 0 ? [] : V(t[0]) }) });
279
+ }, set: function(...t) {
280
+ return B({ [M]: () => ({ match: (e) => {
281
+ if (!(e instanceof Set)) return { matched: !1 };
282
+ let r = {};
283
+ if (e.size === 0) return { matched: !0, selections: r };
284
+ if (t.length === 0) return { matched: !0 };
285
+ const n = (a, i) => {
286
+ r[a] = (r[a] || []).concat([i]);
287
+ }, o = t[0];
288
+ return { matched: Tr(e, (a) => L(o, a, n)), selections: r };
289
+ }, getSelectionKeys: () => t.length === 0 ? [] : V(t[0]) }) });
290
+ }, map: function(...t) {
291
+ return B({ [M]: () => ({ match: (e) => {
292
+ if (!(e instanceof Map)) return { matched: !1 };
293
+ let r = {};
294
+ if (e.size === 0) return { matched: !0, selections: r };
295
+ const n = (l, c) => {
296
+ r[l] = (r[l] || []).concat([c]);
297
+ };
298
+ if (t.length === 0) return { matched: !0 };
299
+ var o;
300
+ if (t.length === 1) throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(o = t[0]) == null ? void 0 : o.toString()}`);
301
+ const [a, i] = t;
302
+ return { matched: Er(e, (l, c) => {
303
+ const u = L(a, c, n), d = L(i, l, n);
304
+ return u && d;
305
+ }), selections: r };
306
+ }, getSelectionKeys: () => t.length === 0 ? [] : [...V(t[0]), ...V(t[1])] }) });
307
+ }, record: function(...t) {
308
+ return B({ [M]: () => ({ match: (e) => {
309
+ if (e === null || typeof e != "object" || Array.isArray(e)) return { matched: !1 };
310
+ var r;
311
+ if (t.length === 0) throw new Error(`\`P.record\` wasn't given enough arguments. Expected (value) or (key, value), received ${(r = t[0]) == null ? void 0 : r.toString()}`);
312
+ let n = {};
313
+ const o = (l, c) => {
314
+ n[l] = (n[l] || []).concat([c]);
315
+ }, [a, i] = t.length === 1 ? [fe, t[0]] : t;
316
+ return { matched: Rr(e, (l, c) => {
317
+ const u = typeof l != "string" || Number.isNaN(Number(l)) ? null : Number(l), d = u !== null && L(a, u, o), p = L(a, l, o), k = L(i, c, o);
318
+ return (p || d) && k;
319
+ }), selections: n };
320
+ }, getSelectionKeys: () => t.length === 0 ? [] : [...V(t[0]), ...V(t[1])] }) });
321
+ }, intersection: S, union: We, not: function(t) {
322
+ return B({ [M]: () => ({ match: (e) => ({ matched: !L(t, e, () => {
323
+ }) }), getSelectionKeys: () => [], matcherType: "not" }) });
324
+ }, when: b, select: Tt, any: Ke, unknown: Or, _: Lr, string: fe, number: Pr, bigint: Dr, boolean: Br, symbol: Ir, nullish: jr, nonNullable: Vr, instanceOf: function(t) {
325
+ return B(b(/* @__PURE__ */ (function(e) {
326
+ return (r) => r instanceof e;
327
+ })(t)));
328
+ }, shape: function(t) {
329
+ return B(b(Ar(t)));
330
+ } };
331
+ let Mr = class extends Error {
332
+ constructor(e) {
333
+ let r;
334
+ try {
335
+ r = JSON.stringify(e);
336
+ } catch {
337
+ r = e;
338
+ }
339
+ super(`Pattern matching error: no pattern matches value ${r}`), this.input = void 0, this.input = e;
340
+ }
341
+ };
342
+ const te = { matched: !1, value: void 0 };
343
+ function $(t) {
344
+ return new Fr(t, te);
345
+ }
346
+ let Fr = class ee {
347
+ constructor(e, r) {
348
+ this.input = void 0, this.state = void 0, this.input = e, this.state = r;
349
+ }
350
+ with(...e) {
351
+ if (this.state.matched) return this;
352
+ const r = e[e.length - 1], n = [e[0]];
353
+ let o;
354
+ e.length === 3 && typeof e[1] == "function" ? o = e[1] : e.length > 2 && n.push(...e.slice(1, e.length - 1));
355
+ let a = !1, i = {};
356
+ const l = (u, d) => {
357
+ a = !0, i[u] = d;
358
+ }, c = !n.some((u) => L(u, this.input, l)) || o && !o(this.input) ? te : { matched: !0, value: r(a ? jt in i ? i[jt] : i : this.input, this.input) };
359
+ return new ee(this.input, c);
360
+ }
361
+ when(e, r) {
362
+ if (this.state.matched) return this;
363
+ const n = !!e(this.input);
364
+ return new ee(this.input, n ? { matched: !0, value: r(this.input, this.input) } : te);
365
+ }
366
+ otherwise(e) {
367
+ return this.state.matched ? this.state.value : e(this.input);
368
+ }
369
+ exhaustive(e = zr) {
370
+ return this.state.matched ? this.state.value : e(this.input);
371
+ }
372
+ run() {
373
+ return this.exhaustive();
374
+ }
375
+ returnType() {
376
+ return this;
377
+ }
378
+ narrow() {
379
+ return this;
380
+ }
381
+ };
382
+ function zr(t) {
383
+ throw new Mr(t);
384
+ }
385
+ const gt = {
386
+ STANDBY: "standby",
387
+ CONNECTING: "connecting",
388
+ READY: "ready",
389
+ HANDSHAKE: "handshake",
390
+ HANDSHAKE_PARTIAL: "handshake-partial",
391
+ ENCRYPTED: "encrypted"
392
+ }, pt = {
393
+ CREATED: "created",
394
+ SIGNALING: "signaling",
395
+ READY: "ready",
396
+ LINKING: "linking",
397
+ CONNECTED: "connected",
398
+ DISCONNECTED: "disconnected"
399
+ }, ct = {
400
+ STANDBY: "standby",
401
+ CREATING: "creating",
402
+ CONNECTING: "connecting",
403
+ CONNECTED: "connected",
404
+ ERROR: "error"
405
+ };
406
+ var Qt = { exports: {} };
407
+ var he;
408
+ function Ur() {
409
+ return he || (he = 1, (function(t) {
410
+ (function() {
411
+ var e = {}.hasOwnProperty;
412
+ function r() {
413
+ for (var a = "", i = 0; i < arguments.length; i++) {
414
+ var l = arguments[i];
415
+ l && (a = o(a, n(l)));
416
+ }
417
+ return a;
418
+ }
419
+ function n(a) {
420
+ if (typeof a == "string" || typeof a == "number")
421
+ return a;
422
+ if (typeof a != "object")
423
+ return "";
424
+ if (Array.isArray(a))
425
+ return r.apply(null, a);
426
+ if (a.toString !== Object.prototype.toString && !a.toString.toString().includes("[native code]"))
427
+ return a.toString();
428
+ var i = "";
429
+ for (var l in a)
430
+ e.call(a, l) && a[l] && (i = o(i, l));
431
+ return i;
432
+ }
433
+ function o(a, i) {
434
+ return i ? a ? a + " " + i : a + i : a;
435
+ }
436
+ t.exports ? (r.default = r, t.exports = r) : window.classNames = r;
437
+ })();
438
+ })(Qt)), Qt.exports;
439
+ }
440
+ var Wr = Ur();
441
+ const at = /* @__PURE__ */ _r(Wr), Gr = async (t) => {
442
+ if (typeof t == "string") {
443
+ if (t === "simple")
444
+ return await import("./simple-CAAgvkQC.js").then((e) => e.simpleTheme);
445
+ if (t === "openlv")
446
+ return await import("./openlv-CH8lb3Oi.js").then((e) => e.openlvTheme);
447
+ throw new Error(`Unknown theme: ${t}`);
448
+ }
449
+ return t;
450
+ };
451
+ function re(t) {
452
+ return typeof t == "object" && t !== null && !Array.isArray(t);
453
+ }
454
+ const Je = (t, e = [], r = {}) => {
455
+ for (const [n, o] of Object.entries(t)) {
456
+ const a = [...e, n];
457
+ re(o) ? Je(o, a, r) : r[`--lv-${a.join("-")}`] = o;
458
+ }
459
+ return r;
460
+ }, Kr = (t = "auto", e = "system") => t === "light" || t === "dark" ? t : e === "system" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : e, Qe = (t, e) => {
461
+ const r = { ...t };
462
+ for (const n of Object.keys(e)) {
463
+ const o = t[n], a = e[n];
464
+ r[n] = re(o) && re(a) ? Qe(o, a) : a;
465
+ }
466
+ return r;
467
+ }, Hr = async (t, e = "system") => {
468
+ const r = await Gr(t.theme), n = Kr(t.mode, e), o = r[n];
469
+ if (!o) return "";
470
+ const a = r.common ? Qe(r.common, o) : o, i = Je(a);
471
+ return Object.entries(i).map(([l, c]) => `${l}: ${c};`).join(`
472
+ `);
473
+ }, ve = `@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-blue-200:oklch(88.2% .059 254.128);--color-blue-500:oklch(62.3% .214 259.815);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--font-weight-medium:500;--font-weight-semibold:600;--tracking-wide:.025em;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--ease-out:cubic-bezier(0,0,.2,1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.top-5{top:calc(var(--spacing)*5)}.top-full{top:100%}.bottom-0{bottom:calc(var(--spacing)*0)}.left-1\\/2{left:50%}.z-10{z-index:10}.z-10000{z-index:10000}.mx-auto{margin-inline:auto}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-11{height:calc(var(--spacing)*11)}.h-18{height:calc(var(--spacing)*18)}.h-38{height:calc(var(--spacing)*38)}.h-\\[200px\\]{height:200px}.h-full{height:100%}.min-h-32{min-height:calc(var(--spacing)*32)}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-12{width:calc(var(--spacing)*12)}.w-48{width:calc(var(--spacing)*48)}.w-\\[200px\\]{width:200px}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[400px\\]{max-width:400px}.flex-1{flex:1}.grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.animate-\\[bg-in_0\\.15s_ease-in-out\\]{animation:.15s ease-in-out bg-in}.animate-\\[fade-in_0\\.15s_ease-in-out\\]{animation:.15s ease-in-out fade-in}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.appearance-none{appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.-space-x-4>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*-4)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*-4)*calc(1 - var(--tw-space-x-reverse)))}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\\(--lv-control-button-primary-border\\){border-color:var(--lv-control-button-primary-border)}.border-\\(--lv-control-button-secondary-border\\){border-color:var(--lv-control-button-secondary-border)}.border-\\(--lv-control-button-secondary-border\\,var\\(--lv-control-button-secondary-background\\)\\){border-color:var(--lv-control-button-secondary-border,var(--lv-control-button-secondary-background))}.border-\\(--lv-control-input-border\\){border-color:var(--lv-control-input-border)}.border-blue-500{border-color:var(--color-blue-500)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-gray-400{border-color:var(--color-gray-400)}.border-gray-500{border-color:var(--color-gray-500)}.border-t-transparent{border-top-color:#0000}.bg-\\(--lv-body-background\\){background-color:var(--lv-body-background)}.bg-\\(--lv-card-background\\){background-color:var(--lv-card-background)}.bg-\\(--lv-control-button-primary-background\\){background-color:var(--lv-control-button-primary-background)}.bg-\\(--lv-control-button-secondary-background\\){background-color:var(--lv-control-button-secondary-background)}.bg-\\(--lv-qr-background\\){background-color:var(--lv-qr-background)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-\\[url\\(\\'data\\:image\\/svg\\+xml\\;charset\\=US-ASCII\\,\\%3Csvg\\%20xmlns\\%3D\\%22http\\%3A\\%2F\\%2Fwww\\.w3\\.org\\%2F2000\\%2Fsvg\\%22\\%20width\\%3D\\%2214\\%22\\%20height\\%3D\\%2214\\%22\\%20viewBox\\%3D\\%220\\%200\\%2024\\%2024\\%22\\%20fill\\%3D\\%22none\\%22\\%20stroke\\%3D\\%22\\%23888\\%22\\%20stroke-width\\%3D\\%222\\%22\\%3E\\%3Cpath\\%20d\\%3D\\%22M6\\%209l6\\%206\\%206-6\\%22\\%2F\\%3E\\%3C\\%2Fsvg\\%3E\\'\\)\\]{background-image:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2214%22%20height%3D%2214%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23888%22%20stroke-width%3D%222%22%3E%3Cpath%20d%3D%22M6%209l6%206%206-6%22%2F%3E%3C%2Fsvg%3E)}.bg-\\[length\\:14px\\]{background-size:14px}.bg-\\[right_8px_center\\]{background-position:right 8px center}.bg-no-repeat{background-repeat:no-repeat}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.ps-1{padding-inline-start:calc(var(--spacing)*1)}.pt-1{padding-top:calc(var(--spacing)*1)}.pr-0\\.5{padding-right:calc(var(--spacing)*.5)}.pr-8{padding-right:calc(var(--spacing)*8)}.pb-0\\.5{padding-bottom:calc(var(--spacing)*.5)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pl-2{padding-left:calc(var(--spacing)*2)}.text-center{text-align:center}.text-start{text-align:start}.font-sans{font-family:var(--font-sans)}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.whitespace-nowrap{white-space:nowrap}.text-\\(--lv-control-button-primary-color\\){color:var(--lv-control-button-primary-color)}.text-\\(--lv-control-button-secondary-color\\){color:var(--lv-control-button-secondary-color)}.text-\\(--lv-qr-color\\){color:var(--lv-qr-color)}.text-\\(--lv-text-muted\\){color:var(--lv-text-muted)}.text-\\(--lv-text-primary\\){color:var(--lv-text-primary)}.text-\\(--lv-text-secondary\\){color:var(--lv-text-secondary)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow,.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[height\\]{transition-property:height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}@media(hover:hover){.group-hover\\:block:is(:where(.group):hover *){display:block}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.first\\:rounded-t-sm:first-child{border-top-left-radius:var(--radius-sm);border-top-right-radius:var(--radius-sm)}.first\\:border-l-0:first-child{border-left-style:var(--tw-border-style);border-left-width:0}.first\\:pt-1\\.5:first-child{padding-top:calc(var(--spacing)*1.5)}.first\\:pt-2:first-child{padding-top:calc(var(--spacing)*2)}.last\\:rounded-b-sm:last-child{border-bottom-right-radius:var(--radius-sm);border-bottom-left-radius:var(--radius-sm)}.last\\:pb-2:last-child{padding-bottom:calc(var(--spacing)*2)}@media(hover:hover){.hover\\:\\[background-color\\:var\\(--lv-control-button-tertiary-hoverBackground\\)\\]:hover{background-color:var(--lv-control-button-tertiary-hoverBackground)}.hover\\:bg-\\(--lv-card-background\\):hover{background-color:var(--lv-card-background)}.hover\\:bg-\\(--lv-control-button-primary-background-hover\\):hover{background-color:var(--lv-control-button-primary-background-hover)}.hover\\:bg-\\(--lv-control-button-primary-hoverBackground\\,var\\(--lv-control-button-primary-background\\)\\):hover{background-color:var(--lv-control-button-primary-hoverBackground,var(--lv-control-button-primary-background))}.hover\\:bg-\\(--lv-control-button-secondary-background\\):hover{background-color:var(--lv-control-button-secondary-background)}.hover\\:bg-\\(--lv-control-button-secondary-hoverBackground\\):hover{background-color:var(--lv-control-button-secondary-hoverBackground)}.hover\\:bg-\\(--lv-control-button-secondary-hoverBackground\\,var\\(--lv-control-button-secondary-background\\)\\):hover{background-color:var(--lv-control-button-secondary-hoverBackground,var(--lv-control-button-secondary-background))}.hover\\:bg-\\(--lv-control-button-tertiary-hoverBackground\\):hover{background-color:var(--lv-control-button-tertiary-hoverBackground)}.hover\\:bg-\\(--lv-control-button-tertiary-hoverBackground\\,transparent\\):hover{background-color:var(--lv-control-button-tertiary-hoverBackground,transparent)}}.focus\\:border-blue-500:focus{border-color:var(--color-blue-500)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-\\(--lv-control-button-primary-background\\):focus{--tw-ring-color:var(--lv-control-button-primary-background)}.focus\\:ring-blue-200:focus{--tw-ring-color:var(--color-blue-200)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}.active\\:bg-\\(--lv-control-button-primary-activeBackground\\,var\\(--lv-control-button-primary-hoverBackground\\,var\\(--lv-control-button-primary-background\\)\\)\\):active{background-color:var(--lv-control-button-primary-activeBackground,var(--lv-control-button-primary-hoverBackground,var(--lv-control-button-primary-background)))}.active\\:bg-\\(--lv-control-button-secondary-activeBackground\\):active{background-color:var(--lv-control-button-secondary-activeBackground)}.active\\:bg-\\(--lv-control-button-secondary-activeBackground\\,var\\(--lv-control-button-secondary-hoverBackground\\,var\\(--lv-control-button-secondary-background\\)\\)\\):active{background-color:var(--lv-control-button-secondary-activeBackground,var(--lv-control-button-secondary-hoverBackground,var(--lv-control-button-secondary-background)))}.active\\:bg-\\(--lv-control-button-tertiary-activeBackground\\,var\\(--lv-control-button-tertiary-hoverBackground\\,transparent\\)\\):active{background-color:var(--lv-control-button-tertiary-activeBackground,var(--lv-control-button-tertiary-hoverBackground,transparent))}.disabled\\:bg-\\(--lv-control-button-primary-disabledBackground\\,var\\(--lv-control-button-primary-background\\)\\):disabled{background-color:var(--lv-control-button-primary-disabledBackground,var(--lv-control-button-primary-background))}.disabled\\:bg-\\(--lv-control-button-secondary-disabledBackground\\,var\\(--lv-control-button-secondary-background\\)\\):disabled{background-color:var(--lv-control-button-secondary-disabledBackground,var(--lv-control-button-secondary-background))}.disabled\\:text-\\(--lv-control-button-primary-disabledColor\\,var\\(--lv-control-button-primary-color\\)\\):disabled{color:var(--lv-control-button-primary-disabledColor,var(--lv-control-button-primary-color))}.disabled\\:text-\\(--lv-control-button-secondary-disabledColor\\,var\\(--lv-control-button-secondary-color\\)\\):disabled{color:var(--lv-control-button-secondary-disabledColor,var(--lv-control-button-secondary-color))}.disabled\\:text-\\(--lv-control-button-tertiary-disabledColor\\,var\\(--lv-text-muted\\)\\):disabled{color:var(--lv-control-button-tertiary-disabledColor,var(--lv-text-muted))}@media(min-width:48rem){.md\\:items-center{align-items:center}}@media(min-width:64rem){.lg\\:p-4{padding:calc(var(--spacing)*4)}}.ltr\\:right-5:where(:dir(ltr),[dir=ltr],[dir=ltr] *){right:calc(var(--spacing)*5)}.ltr\\:-ml-1:where(:dir(ltr),[dir=ltr],[dir=ltr] *){margin-left:calc(var(--spacing)*-1)}.ltr\\:translate-x-full:where(:dir(ltr),[dir=ltr],[dir=ltr] *){--tw-translate-x:100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.ltr\\:rounded-l-none:where(:dir(ltr),[dir=ltr],[dir=ltr] *){border-top-left-radius:0;border-bottom-left-radius:0}.rtl\\:left-5:where(:dir(rtl),[dir=rtl],[dir=rtl] *){left:calc(var(--spacing)*5)}.rtl\\:-mr-1:where(:dir(rtl),[dir=rtl],[dir=rtl] *){margin-right:calc(var(--spacing)*-1)}.rtl\\:-translate-x-full:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x:-100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.rtl\\:rotate-180:where(:dir(rtl),[dir=rtl],[dir=rtl] *){rotate:180deg}.rtl\\:rounded-r-none:where(:dir(rtl),[dir=rtl],[dir=rtl] *){border-top-right-radius:0;border-bottom-right-radius:0}}:root,:host{--color-body-background:var(--lv-body-background);--radius-radius:var(--lv-border-radius)}.border{border-style:solid}@keyframes fade-in{0%{transform:translateY(-2px)scale(.95)}to{transform:translateY(0)scale(1)}}@keyframes bg-in{0%{opacity:0;-webkit-backdrop-filter:blur();backdrop-filter:blur()}to{opacity:1;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}}.modal-transition__container{display:grid;position:relative}.modal-transition__layer{will-change:transform,opacity;grid-area:1/1;width:100%}.modal-transition__layer--outgoing{z-index:2;animation:.2s ease-out forwards modal-transition-out;position:absolute}.modal-transition__layer--incoming{animation:.2s ease-out forwards modal-transition-in}[data-openlv-theme-mode=dark] img[data-openlv-brand-logo]{filter:invert()brightness(1.1)}@media(prefers-color-scheme:dark){[data-openlv-theme-mode=system] img[data-openlv-brand-logo]{filter:invert()brightness(1.1)}}@keyframes modal-transition-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes modal-transition-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(1.05)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}`, me = async (t, e, r = "system") => {
474
+ let n = t.querySelector(
475
+ "style[data-openlv-modal]"
476
+ );
477
+ if (n || (n = document.createElement("style"), n.setAttribute("data-openlv-modal", "true"), t.appendChild(n)), e) {
478
+ const o = await Hr(e, r);
479
+ n.textContent = `:root, :host {
480
+ ${o}
481
+ }
482
+ ` + ve;
483
+ } else
484
+ n.textContent = ve;
485
+ };
486
+ class Xe extends HTMLElement {
487
+ constructor(r) {
488
+ super();
489
+ Ct(this, "shadow");
490
+ Ct(this, "renderRequested", !1);
491
+ Ct(this, "parameters");
492
+ Ct(this, "themeCleanup");
493
+ this.parameters = r, this.shadow = this.attachShadow({ mode: "open" });
494
+ const n = r.provider.storage.getSettings()?.theme ?? "system";
495
+ me(this.shadow, r.theme, n);
496
+ }
497
+ connectedCallback() {
498
+ this.requestRender(), this.themeCleanup?.(), this.setupThemeListener();
499
+ }
500
+ disconnectedCallback() {
501
+ mt(null, this.shadow), this.themeCleanup?.();
502
+ }
503
+ setupThemeListener() {
504
+ const r = () => {
505
+ const o = this.parameters.provider.storage.getSettings()?.theme ?? "system";
506
+ me(this.shadow, this.parameters.theme, o);
507
+ };
508
+ this.parameters.provider.storage.emitter.on("settings_change", r);
509
+ const n = window.matchMedia("(prefers-color-scheme: dark)");
510
+ n.addEventListener("change", r), this.themeCleanup = () => {
511
+ this.parameters.provider.storage.emitter.off("settings_change", r), n.removeEventListener("change", r);
512
+ };
513
+ }
514
+ showModal() {
515
+ this.style.display = "block";
516
+ }
517
+ hideModal() {
518
+ this.style.display = "none";
519
+ }
520
+ requestRender() {
521
+ this.renderRequested || (this.renderRequested = !0, queueMicrotask(() => {
522
+ this.renderRequested = !1, this.performRender();
523
+ }));
524
+ }
525
+ performRender() {
526
+ mt(br(un, this.parameters), this.shadow);
527
+ }
528
+ }
529
+ const Jr = { close: "Close", yes: "Yes", no: "No", protocol: "Protocol" }, Qr = { connectedSuccessfully: "Connected Successfully!", connecting: "Connecting", ready: "Ready", handshakeClosed: "Handshake Closed", handshakePartial: "Handshake Partial", encrypted: "Encrypted", signalError: "Signal Error", disconnected: "Disconnected" }, Xr = { title: "Settings", language: "Language", connection: { title: "Connection", description: "Configure how you connect to your wallet." }, theme: { title: "Appearance", mode: "Theme", light: "Light", dark: "Dark", system: "System" }, connectionPreferences: { title: "Connection preferences", retainSessionHistory: "Retain session history", autoReconnect: "Auto reconnect" }, signaling: { title: "Signaling", description: "Signaling is the handshake protocol used to establish a connection.", server: "Server", serverUrl: "Server URL" }, transport: { title: "Transport", description: "This is how the connection is maintained.", webrtc: "WebRTC", iceServers: { title: "ICE Servers", stun: "STUN Servers", turn: "TURN Servers", addStun: "Add STUN Server", addTurn: "Add TURN Server", username: "Username", credential: "Password" } }, appearance: "Appearance" }, qr = { title: "Connect Wallet" }, Yr = { title: "What is openlv?", scanQrCode: "Scan QR Code", approveOnDevice: "Approve on device", youreConnected: "You're connected!" }, Zr = { prompt: "Click the button below to start a connection", generateQr: "Generate QR", connectionSettings: "Connection settings" }, $r = { preparingConnection: "Preparing connection", generatingKeys: "Generating keys...", connecting: "Connecting", waitingForNetwork: "Waiting for network connection...", establishingConnection: "Establishing connection...", mayTakeFewSeconds: "This may take a few seconds...", connectedSuccessfully: "Connected Successfully!", walletConnectedReady: "Your wallet is now connected and ready to use.", disconnected: "Disconnected", connectionClosed: "The connection has been closed." }, tn = { clickToCopyUrl: "Click to copy connection URL", copyConnectionUrl: "Copy Connection URL", scanCodeInstruction: `Scan the code above using your mobile wallet.
530
+ Or copy the link and paste it into your wallet.` }, en = { urlCopied: "Connection URL copied to clipboard!", backToQr: "Back to QR", closeModal: "Close modal" }, rn = {
531
+ common: Jr,
532
+ status: Qr,
533
+ settings: Xr,
534
+ start: qr,
535
+ info: Yr,
536
+ disconnected: Zr,
537
+ connectionFlow: $r,
538
+ handshake: tn,
539
+ modal: en
540
+ }, ue = [
541
+ { tag: "en", name: "English", nativeName: "English" },
542
+ { tag: "nl", name: "Dutch", nativeName: "Nederlands" },
543
+ { tag: "es", name: "Spanish", nativeName: "Español" },
544
+ { tag: "sv", name: "Swedish", nativeName: "Svenska" },
545
+ { tag: "zh-cn", name: "Chinese (Simplified)", nativeName: "简体中文" },
546
+ { tag: "fr", name: "French", nativeName: "Français" },
547
+ { tag: "ar", name: "Arabic", nativeName: "العربية", rtl: !0 },
548
+ { tag: "he", name: "Hebrew", nativeName: "עברית", rtl: !0 },
549
+ { tag: "fa", name: "Persian", nativeName: "فارسی", rtl: !0 }
550
+ ], nn = (t) => ue.find((r) => r.tag === t)?.rtl ?? !1, be = ue.map((t) => t.tag), on = () => {
551
+ if (typeof navigator > "u") return "en";
552
+ const t = navigator.languages || [navigator.language];
553
+ for (const e of t) {
554
+ const r = e.toLowerCase();
555
+ if (be.includes(r))
556
+ return r;
557
+ if (r === "zh" || r.startsWith("zh-hans") || r.startsWith("zh-cn"))
558
+ return "zh-cn";
559
+ const [n] = r.split("-");
560
+ if (be.includes(n))
561
+ return n;
562
+ }
563
+ return "en";
564
+ }, ye = (t) => {
565
+ if (typeof navigator > "u") return 0;
566
+ const e = navigator.languages || [navigator.language];
567
+ for (let r = 0; r < e.length; r++) {
568
+ const n = e[r].toLowerCase();
569
+ if (n === t) return e.length - r + 1;
570
+ if (n.startsWith(`${t}-`) || t.startsWith(`${n}-`))
571
+ return e.length - r;
572
+ const [o] = n.split("-");
573
+ if (o === t || t.startsWith(`${o}-`))
574
+ return e.length - r - 0.5;
575
+ }
576
+ return 0;
577
+ }, we = (t, e) => {
578
+ if (!t) return;
579
+ const r = e.split(".").filter(Boolean);
580
+ if (r.length === 0) return;
581
+ let n = t;
582
+ for (const o of r) {
583
+ if (typeof n != "object" || n === null) return;
584
+ n = n[o];
585
+ }
586
+ return n;
587
+ }, xe = (t, e) => e ? t.replace(
588
+ /\{(\w+)\}/g,
589
+ (r, n) => {
590
+ const o = e[n];
591
+ return o === void 0 ? r : String(o);
592
+ }
593
+ ) : t, an = (t) => {
594
+ const e = we(t.primary, t.key);
595
+ if (typeof e == "string")
596
+ return xe(e, t.params);
597
+ const r = we(t.fallback, t.key);
598
+ return typeof r == "string" ? xe(r, t.params) : t.key;
599
+ }, qe = le(
600
+ null
601
+ ), sn = async (t) => $(t).with("en", () => Promise.resolve(null)).with("nl", async () => import("./nl-BRV9i3nM.js").then((e) => e.default)).with("es", async () => import("./es-C2sG0TfH.js").then((e) => e.default)).with("sv", async () => import("./sv-CEyo-XBk.js").then((e) => e.default)).with("fr", async () => import("./fr-BRQDr1rj.js").then((e) => e.default)).with(
602
+ "zh-cn",
603
+ async () => import("./zh-cn-DJpfZdjA.js").then((e) => e.default)
604
+ ).with("ar", async () => import("./ar-CyZSQ56p.js").then((e) => e.default)).with("he", async () => import("./he-NFIsHMZP.js").then((e) => e.default)).with("fa", async () => import("./fa-_bXJQdwj.js").then((e) => e.default)).exhaustive(), ln = ({
605
+ children: t,
606
+ initialLanguageTag: e = "en"
607
+ }) => {
608
+ const [r, n] = P(e), [o, a] = P(null), [i, l] = P(!1);
609
+ I(() => {
610
+ let p = !1;
611
+ return (async () => {
612
+ l(!0);
613
+ try {
614
+ const m = await sn(r);
615
+ if (p) return;
616
+ a(m);
617
+ } finally {
618
+ p || l(!1);
619
+ }
620
+ })(), () => {
621
+ p = !0;
622
+ };
623
+ }, [r]);
624
+ const c = K(
625
+ (p, k) => an({
626
+ primary: o,
627
+ fallback: rn,
628
+ key: p,
629
+ params: k
630
+ }).split(`
631
+ `).map(
632
+ (m, y, E) => y < E.length - 1 ? [m, /* @__PURE__ */ s("br", {}, y)] : [m]
633
+ ),
634
+ [o]
635
+ ), u = vt(() => nn(r), [r]), d = vt(
636
+ () => ({
637
+ languageTag: r,
638
+ setLanguageTag: n,
639
+ isLoadingLanguagePack: i,
640
+ isRtl: u,
641
+ t: c
642
+ }),
643
+ [i, u, r, c]
644
+ );
645
+ return /* @__PURE__ */ s(qe.Provider, { value: d, children: t });
646
+ }, H = () => {
647
+ const t = zt(qe);
648
+ if (!t)
649
+ throw new Error("TranslationProvider not found");
650
+ return t;
651
+ }, Ye = le({
652
+ provider: void 0,
653
+ themeConfig: void 0
654
+ }), cn = (t) => {
655
+ const e = t?.storage.getSettings().language;
656
+ return e || on();
657
+ }, un = ({
658
+ provider: t,
659
+ onClose: e,
660
+ theme: r
661
+ }) => {
662
+ const n = vt(
663
+ () => cn(t),
664
+ [t]
665
+ );
666
+ return /* @__PURE__ */ s(ln, { initialLanguageTag: n, children: /* @__PURE__ */ s(Ye.Provider, { value: { provider: t, themeConfig: r }, children: /* @__PURE__ */ s(Ho, { onClose: e }) }) });
667
+ }, Ze = () => {
668
+ const t = zt(Ye);
669
+ if (!t.provider) throw new Error("Provider not found");
670
+ return t;
671
+ }, Ot = () => {
672
+ const { provider: t } = Ze(), [e, r] = P(
673
+ t?.getState().status || ct.ERROR
674
+ );
675
+ if (I(() => {
676
+ const n = (a) => {
677
+ r(a);
678
+ };
679
+ t?.on("status_change", n);
680
+ const o = t?.getState().status;
681
+ return o && r(o), () => {
682
+ t?.off("status_change", n);
683
+ };
684
+ }, [t]), !t) throw new Error("Provider not found");
685
+ return { provider: t, status: e };
686
+ }, de = (...t) => console.log(
687
+ "%c[modal]%c",
688
+ "color: yellow; font-weight: bold",
689
+ "color: inherit; font-weight: normal",
690
+ ...t
691
+ ), $e = (t, e, r) => {
692
+ I(() => (t?.on(e, r), () => {
693
+ t?.off(e, r);
694
+ }), [t, e]);
695
+ }, wt = () => {
696
+ const { provider: t } = Ot(), [e, r] = P(
697
+ t?.storage.getSettings()
698
+ );
699
+ $e(
700
+ t?.storage.emitter,
701
+ "settings_change",
702
+ (g) => {
703
+ r(g);
704
+ }
705
+ );
706
+ const n = (g) => {
707
+ r(g), t?.storage.setSettings(g);
708
+ }, o = (g) => {
709
+ e?.signaling && e.signaling.p !== g && n({
710
+ ...e,
711
+ signaling: {
712
+ ...e.signaling,
713
+ p: g
714
+ }
715
+ });
716
+ }, a = (g) => {
717
+ e?.signaling && e.signaling.s[e.signaling.p] !== g && n({
718
+ ...e,
719
+ signaling: {
720
+ ...e.signaling,
721
+ s: {
722
+ ...e.signaling.s,
723
+ [e.signaling.p]: g
724
+ }
725
+ }
726
+ });
727
+ }, i = (g) => {
728
+ e && n({ ...e, retainHistory: g });
729
+ }, l = (g) => {
730
+ e && n({ ...e, autoReconnect: g });
731
+ }, c = (g) => {
732
+ e && e.theme !== g && (r({ ...e, theme: g }), t?.storage.setSettings({ ...e, theme: g }));
733
+ }, u = (g) => {
734
+ e && n({ ...e, language: g });
735
+ }, d = (g) => {
736
+ e && e.transport?.p !== g && n({
737
+ ...e,
738
+ transport: {
739
+ ...e.transport,
740
+ p: g
741
+ }
742
+ });
743
+ }, p = (g) => {
744
+ if (!e) return;
745
+ const h = e.transport?.s?.webrtc, D = g(h);
746
+ n({
747
+ ...e,
748
+ transport: {
749
+ p: e.transport?.p ?? "webrtc",
750
+ s: {
751
+ ...e.transport?.s,
752
+ webrtc: D
753
+ }
754
+ }
755
+ });
756
+ }, k = (g) => {
757
+ p((h) => ({
758
+ ...h,
759
+ stun: [...h?.stun ?? [], g]
760
+ }));
761
+ }, m = (g) => {
762
+ p((h) => {
763
+ const D = h?.stun?.filter((_, J) => J !== g);
764
+ return {
765
+ ...h,
766
+ stun: D?.length ? D : void 0
767
+ };
768
+ });
769
+ }, y = (g, h) => {
770
+ p((D) => {
771
+ const _ = [...D?.stun ?? []];
772
+ return _[g] = h, {
773
+ ...D,
774
+ stun: _
775
+ };
776
+ });
777
+ }, E = (g) => {
778
+ p((h) => ({
779
+ ...h,
780
+ turn: [...h?.turn ?? [], g]
781
+ }));
782
+ }, f = (g) => {
783
+ p((h) => {
784
+ const D = h?.turn?.filter((_, J) => J !== g);
785
+ return {
786
+ ...h,
787
+ turn: D?.length ? D : void 0
788
+ };
789
+ });
790
+ }, x = (g, h) => {
791
+ p((D) => {
792
+ const _ = [...D?.turn ?? []];
793
+ return _[g] = { ..._[g], ...h }, {
794
+ ...D,
795
+ turn: _
796
+ };
797
+ });
798
+ };
799
+ if (!e) throw new Error("Settings not found");
800
+ return {
801
+ settings: e,
802
+ updateSignalingProtocol: o,
803
+ updateSignalingServer: a,
804
+ updateRetainHistory: i,
805
+ updateAutoReconnect: l,
806
+ updateThemePreference: c,
807
+ updateLanguage: u,
808
+ updateTransportProtocol: d,
809
+ // STUN reducers
810
+ addStunServer: k,
811
+ removeStunServer: m,
812
+ updateStunServer: y,
813
+ // TURN reducers
814
+ addTurnServer: E,
815
+ removeTurnServer: f,
816
+ updateTurnServer: x
817
+ };
818
+ }, Lt = () => {
819
+ const { provider: t } = Ot(), [e, r] = P(
820
+ t?.getSession()
821
+ ), n = e?.getHandshakeParameters(), o = n ? Nr(n) : void 0, [a, i] = P(
822
+ e?.getState()
823
+ );
824
+ return $e(e?.emitter, "state_change", (l) => {
825
+ de("session state change: ", l), i(l);
826
+ }), I(() => {
827
+ const l = () => {
828
+ const u = t?.getSession();
829
+ u && r(u);
830
+ };
831
+ t?.on("status_change", l);
832
+ const c = t?.getSession();
833
+ return c && r(c), () => {
834
+ t?.off("status_change", l);
835
+ };
836
+ }, [t]), I(() => {
837
+ const l = (c) => {
838
+ r(c), i(c.getState());
839
+ };
840
+ return t?.on("session_started", l), () => {
841
+ t?.off("session_started", l);
842
+ };
843
+ }, [t]), I(() => {
844
+ e && i(e.getState());
845
+ }, [e]), {
846
+ uri: o,
847
+ status: a
848
+ };
849
+ }, dn = () => {
850
+ const { provider: t } = Ot(), { settings: e } = wt();
851
+ return {
852
+ start: () => {
853
+ const r = e?.signaling?.p, n = r ? e?.signaling?.s?.[r] : void 0;
854
+ if (!r || !n)
855
+ throw new Error("Invalid protocol or server");
856
+ return t?.createSession({
857
+ p: r,
858
+ s: n
859
+ });
860
+ }
861
+ };
862
+ }, ne = ({ state: t }) => {
863
+ const { status: e, uri: r } = Lt(), { status: n } = Ot();
864
+ return console.error("Unknown state: ", { state: t, sessionStatus: e, providerStatus: n }), /* @__PURE__ */ v("div", { className: "rounded-md bg-(--lv-control-button-secondary-background) p-2 text-(--lv-text-muted)", children: [
865
+ /* @__PURE__ */ v("div", { children: [
866
+ "Unknown state: ",
867
+ JSON.stringify(t)
868
+ ] }),
869
+ /* @__PURE__ */ v("div", { children: [
870
+ "URI: ",
871
+ r
872
+ ] }),
873
+ /* @__PURE__ */ v("div", { children: [
874
+ "Session Status: ",
875
+ JSON.stringify(e)
876
+ ] }),
877
+ /* @__PURE__ */ v("div", { children: [
878
+ "Provider Status: ",
879
+ JSON.stringify(n)
880
+ ] })
881
+ ] });
882
+ }, gn = ({
883
+ onCopy: t
884
+ }) => {
885
+ const { t: e } = H(), { uri: r } = Lt(), n = K(() => {
886
+ r && t(r);
887
+ }, [r, t]), o = K((a) => {
888
+ const i = kr.default, l = i(0, "M");
889
+ return l.addData(a), l.make(), l.createSvgTag({ cellSize: 5, margin: 0, scalable: !0 });
890
+ }, []);
891
+ return /* @__PURE__ */ v("div", { className: "flex flex-col items-center gap-4 px-2", children: [
892
+ /* @__PURE__ */ v("div", { className: "w-full space-y-4 rounded-md border border-(--lv-control-button-secondary-border) bg-(--lv-card-background) p-4", children: [
893
+ r && /* @__PURE__ */ s("div", { className: "relative mx-auto flex w-fit items-center justify-center rounded-lg border border-(--lv-control-button-secondary-border) bg-(--lv-qr-background) p-4", children: /* @__PURE__ */ s(
894
+ "button",
895
+ {
896
+ className: "h-[200px] w-[200px] cursor-pointer rounded bg-(--lv-qr-background) text-(--lv-qr-color)",
897
+ onClick: n,
898
+ title: e("handshake.clickToCopyUrl"),
899
+ dangerouslySetInnerHTML: { __html: o(r) }
900
+ }
901
+ ) }),
902
+ /* @__PURE__ */ s("div", { className: "w-full", children: /* @__PURE__ */ s(
903
+ "button",
904
+ {
905
+ type: "button",
906
+ onClick: n,
907
+ className: "w-full cursor-pointer rounded-lg border border-(--lv-control-button-secondary-border) bg-(--lv-control-button-secondary-background) px-4 py-2 text-sm text-(--lv-text-primary) transition hover:bg-(--lv-control-button-secondary-hoverBackground) active:bg-(--lv-control-button-secondary-activeBackground)",
908
+ children: e("handshake.copyConnectionUrl")
909
+ }
910
+ ) })
911
+ ] }),
912
+ /* @__PURE__ */ s("div", { className: "w-full text-sm text-(--lv-text-secondary)", children: /* @__PURE__ */ s("span", { children: e("handshake.scanCodeInstruction") }) })
913
+ ] });
914
+ }, pn = () => typeof document < "u" && "startViewTransition" in document, fn = (t) => {
915
+ pn() ? document.startViewTransition(t) : t();
916
+ }, Xt = () => /* @__PURE__ */ s("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ s("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-blue-500 border-t-transparent" }) }), O = {
917
+ CREATING: "creating",
918
+ CONNECTING: "connecting",
919
+ READY: "ready",
920
+ LINKING: "linking",
921
+ CONNECTED: "connected",
922
+ DISCONNECTED: "disconnected",
923
+ ERROR: "error"
924
+ }, hn = (t) => {
925
+ const [e, r] = P(t), n = G(t);
926
+ return I(() => {
927
+ t !== n.current && fn(() => {
928
+ r(t), n.current = t;
929
+ });
930
+ }, [t]), {
931
+ displayState: e
932
+ };
933
+ }, vn = (t) => t ? $(t).with({ status: pt.CREATED }, () => O.CREATING).with(
934
+ { status: pt.SIGNALING, signaling: He.select() },
935
+ (e) => $(e).with({ state: gt.STANDBY }, () => O.CONNECTING).with({ state: gt.CONNECTING }, () => O.CONNECTING).with({ state: gt.READY }, () => O.READY).with({ state: gt.HANDSHAKE }, () => O.LINKING).with({ state: gt.HANDSHAKE_PARTIAL }, () => O.LINKING).with({ state: gt.ENCRYPTED }, () => O.CONNECTED).otherwise(() => O.CONNECTING)
936
+ ).with({ status: pt.READY }, () => O.READY).with({ status: pt.LINKING }, () => O.LINKING).with({ status: pt.CONNECTED }, () => O.CONNECTED).with({ status: pt.DISCONNECTED }, () => O.DISCONNECTED).otherwise(() => O.ERROR) : O.CONNECTING, mn = ({ onClose: t, onCopy: e }) => {
937
+ const { t: r } = H(), { status: n } = Lt(), { displayState: o } = hn(vn(n));
938
+ return /* @__PURE__ */ s("div", { style: { viewTransitionName: "connection-flow" }, className: "w-full", children: $(o).with(O.CREATING, () => /* @__PURE__ */ v("div", { className: "flex flex-col items-center gap-4 p-6", children: [
939
+ /* @__PURE__ */ s(Xt, {}),
940
+ /* @__PURE__ */ v("div", { className: "text-center", children: [
941
+ /* @__PURE__ */ s("h3", { className: "mb-2 font-semibold text-(--lv-text-primary) text-lg", children: r("connectionFlow.preparingConnection") }),
942
+ /* @__PURE__ */ s("p", { className: "text-(--lv-text-muted) text-sm", children: r("connectionFlow.generatingKeys") })
943
+ ] })
944
+ ] })).with(O.CONNECTING, () => /* @__PURE__ */ v("div", { className: "flex flex-col items-center gap-4 p-6", children: [
945
+ /* @__PURE__ */ s(Xt, {}),
946
+ /* @__PURE__ */ v("div", { className: "text-center", children: [
947
+ /* @__PURE__ */ s("h3", { className: "mb-2 font-semibold text-(--lv-text-primary) text-lg", children: r("connectionFlow.connecting") }),
948
+ /* @__PURE__ */ s("p", { className: "text-(--lv-text-muted) text-sm", children: r("connectionFlow.waitingForNetwork") })
949
+ ] })
950
+ ] })).with(O.READY, () => /* @__PURE__ */ s(gn, { onCopy: e })).with(O.LINKING, () => /* @__PURE__ */ v("div", { className: "flex flex-col items-center gap-4 p-6", children: [
951
+ /* @__PURE__ */ s(Xt, {}),
952
+ /* @__PURE__ */ v("div", { className: "text-center", children: [
953
+ /* @__PURE__ */ s("h3", { className: "mb-2 font-semibold text-(--lv-text-primary) text-lg", children: r("connectionFlow.establishingConnection") }),
954
+ /* @__PURE__ */ s("p", { className: "text-(--lv-text-muted) text-sm", children: r("connectionFlow.mayTakeFewSeconds") })
955
+ ] })
956
+ ] })).with(O.CONNECTED, () => /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-4 p-6", children: /* @__PURE__ */ v("div", { className: "text-center", children: [
957
+ /* @__PURE__ */ s("div", { className: "mb-4 text-4xl", children: "✅" }),
958
+ /* @__PURE__ */ s("h3", { className: "mb-2 font-semibold text-(--lv-text-primary) text-lg", children: r("connectionFlow.connectedSuccessfully") }),
959
+ /* @__PURE__ */ s("p", { className: "text-(--lv-text-muted) text-sm", children: r("connectionFlow.walletConnectedReady") })
960
+ ] }) })).with(O.DISCONNECTED, () => /* @__PURE__ */ v("div", { className: "flex flex-col items-center gap-4 p-6", children: [
961
+ /* @__PURE__ */ v("div", { className: "text-center", children: [
962
+ /* @__PURE__ */ s("div", { className: "mb-4 text-4xl", children: "🔌" }),
963
+ /* @__PURE__ */ s("h3", { className: "mb-2 font-semibold text-(--lv-text-primary) text-lg", children: r("connectionFlow.disconnected") }),
964
+ /* @__PURE__ */ s("p", { className: "mb-4 text-(--lv-text-muted) text-sm", children: r("connectionFlow.connectionClosed") })
965
+ ] }),
966
+ /* @__PURE__ */ s(
967
+ "button",
968
+ {
969
+ type: "button",
970
+ onClick: t,
971
+ className: "w-full rounded-lg bg-(--lv-control-button-secondary-background) px-4 py-2 font-semibold text-(--lv-text-primary) text-sm transition hover:bg-(--lv-control-button-primary-background-hover)",
972
+ children: r("common.close")
973
+ }
974
+ )
975
+ ] })).otherwise(() => /* @__PURE__ */ s(ne, { state: n })) });
976
+ };
977
+ function tr(t, e) {
978
+ for (var r in e) t[r] = e[r];
979
+ return t;
980
+ }
981
+ function oe(t, e) {
982
+ for (var r in t) if (r !== "__source" && !(r in e)) return !0;
983
+ for (var n in e) if (n !== "__source" && t[n] !== e[n]) return !0;
984
+ return !1;
985
+ }
986
+ function er(t, e) {
987
+ var r = e(), n = P({ t: { __: r, u: e } }), o = n[0].t, a = n[1];
988
+ return yt(function() {
989
+ o.__ = r, o.u = e, qt(o) && a({ t: o });
990
+ }, [t, r, e]), I(function() {
991
+ return qt(o) && a({ t: o }), t(function() {
992
+ qt(o) && a({ t: o });
993
+ });
994
+ }, [t]), r;
995
+ }
996
+ function qt(t) {
997
+ var e, r, n = t.u, o = t.__;
998
+ try {
999
+ var a = n();
1000
+ return !((e = o) === (r = a) && (e !== 0 || 1 / e == 1 / r) || e != e && r != r);
1001
+ } catch {
1002
+ return !0;
1003
+ }
1004
+ }
1005
+ function rr(t) {
1006
+ t();
1007
+ }
1008
+ function nr(t) {
1009
+ return t;
1010
+ }
1011
+ function or() {
1012
+ return [!1, rr];
1013
+ }
1014
+ var ar = yt;
1015
+ function ae(t, e) {
1016
+ this.props = t, this.context = e;
1017
+ }
1018
+ function bn(t, e) {
1019
+ function r(o) {
1020
+ var a = this.props.ref, i = a == o.ref;
1021
+ return !i && a && (a.call ? a(null) : a.current = null), e ? !e(this.props, o) || !i : oe(this.props, o);
1022
+ }
1023
+ function n(o) {
1024
+ return this.shouldComponentUpdate = r, tt(t, o);
1025
+ }
1026
+ return n.displayName = "Memo(" + (t.displayName || t.name) + ")", n.prototype.isReactComponent = !0, n.__f = !0, n.type = t, n;
1027
+ }
1028
+ (ae.prototype = new bt()).isPureReactComponent = !0, ae.prototype.shouldComponentUpdate = function(t, e) {
1029
+ return oe(this.props, t) || oe(this.state, e);
1030
+ };
1031
+ var ke = U.__b;
1032
+ U.__b = function(t) {
1033
+ t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null), ke && ke(t);
1034
+ };
1035
+ var yn = typeof Symbol < "u" && Symbol.for && /* @__PURE__ */ Symbol.for("react.forward_ref") || 3911;
1036
+ function wn(t) {
1037
+ function e(r) {
1038
+ var n = tr({}, r);
1039
+ return delete n.ref, t(n, r.ref || null);
1040
+ }
1041
+ return e.$$typeof = yn, e.render = t, e.prototype.isReactComponent = e.__f = !0, e.displayName = "ForwardRef(" + (t.displayName || t.name) + ")", e;
1042
+ }
1043
+ var Ce = function(t, e) {
1044
+ return t == null ? null : it(it(t).map(e));
1045
+ }, xn = { map: Ce, forEach: Ce, count: function(t) {
1046
+ return t ? it(t).length : 0;
1047
+ }, only: function(t) {
1048
+ var e = it(t);
1049
+ if (e.length !== 1) throw "Children.only";
1050
+ return e[0];
1051
+ }, toArray: it }, kn = U.__e;
1052
+ U.__e = function(t, e, r, n) {
1053
+ if (t.then) {
1054
+ for (var o, a = e; a = a.__; ) if ((o = a.__c) && o.__c) return e.__e == null && (e.__e = r.__e, e.__k = r.__k), o.__c(t, e);
1055
+ }
1056
+ kn(t, e, r, n);
1057
+ };
1058
+ var Ne = U.unmount;
1059
+ function ir(t, e, r) {
1060
+ return t && (t.__c && t.__c.__H && (t.__c.__H.__.forEach(function(n) {
1061
+ typeof n.__c == "function" && n.__c();
1062
+ }), t.__c.__H = null), (t = tr({}, t)).__c != null && (t.__c.__P === r && (t.__c.__P = e), t.__c.__e = !0, t.__c = null), t.__k = t.__k && t.__k.map(function(n) {
1063
+ return ir(n, e, r);
1064
+ })), t;
1065
+ }
1066
+ function sr(t, e, r) {
1067
+ return t && r && (t.__v = null, t.__k = t.__k && t.__k.map(function(n) {
1068
+ return sr(n, e, r);
1069
+ }), t.__c && t.__c.__P === e && (t.__e && r.appendChild(t.__e), t.__c.__e = !0, t.__c.__P = r)), t;
1070
+ }
1071
+ function It() {
1072
+ this.__u = 0, this.o = null, this.__b = null;
1073
+ }
1074
+ function lr(t) {
1075
+ var e = t.__.__c;
1076
+ return e && e.__a && e.__a(t);
1077
+ }
1078
+ function Cn(t) {
1079
+ var e, r, n, o = null;
1080
+ function a(i) {
1081
+ if (e || (e = t()).then(function(l) {
1082
+ l && (o = l.default || l), n = !0;
1083
+ }, function(l) {
1084
+ r = l, n = !0;
1085
+ }), r) throw r;
1086
+ if (!n) throw e;
1087
+ return o ? tt(o, i) : null;
1088
+ }
1089
+ return a.displayName = "Lazy", a.__f = !0, a;
1090
+ }
1091
+ function Nt() {
1092
+ this.i = null, this.l = null;
1093
+ }
1094
+ U.unmount = function(t) {
1095
+ var e = t.__c;
1096
+ e && e.__R && e.__R(), e && 32 & t.__u && (t.type = null), Ne && Ne(t);
1097
+ }, (It.prototype = new bt()).__c = function(t, e) {
1098
+ var r = e.__c, n = this;
1099
+ n.o == null && (n.o = []), n.o.push(r);
1100
+ var o = lr(n.__v), a = !1, i = function() {
1101
+ a || (a = !0, r.__R = null, o ? o(l) : l());
1102
+ };
1103
+ r.__R = i;
1104
+ var l = function() {
1105
+ if (!--n.__u) {
1106
+ if (n.state.__a) {
1107
+ var c = n.state.__a;
1108
+ n.__v.__k[0] = sr(c, c.__c.__P, c.__c.__O);
1109
+ }
1110
+ var u;
1111
+ for (n.setState({ __a: n.__b = null }); u = n.o.pop(); ) u.forceUpdate();
1112
+ }
1113
+ };
1114
+ n.__u++ || 32 & e.__u || n.setState({ __a: n.__b = n.__v.__k[0] }), t.then(i, i);
1115
+ }, It.prototype.componentWillUnmount = function() {
1116
+ this.o = [];
1117
+ }, It.prototype.render = function(t, e) {
1118
+ if (this.__b) {
1119
+ if (this.__v.__k) {
1120
+ var r = document.createElement("div"), n = this.__v.__k[0].__c;
1121
+ this.__v.__k[0] = ir(this.__b, r, n.__O = n.__P);
1122
+ }
1123
+ this.__b = null;
1124
+ }
1125
+ var o = e.__a && tt(St, null, t.fallback);
1126
+ return o && (o.__u &= -33), [tt(St, null, e.__a ? null : t.children), o];
1127
+ };
1128
+ var _e = function(t, e, r) {
1129
+ if (++r[1] === r[0] && t.l.delete(e), t.props.revealOrder && (t.props.revealOrder[0] !== "t" || !t.l.size)) for (r = t.i; r; ) {
1130
+ for (; r.length > 3; ) r.pop()();
1131
+ if (r[1] < r[0]) break;
1132
+ t.i = r = r[2];
1133
+ }
1134
+ };
1135
+ function Nn(t) {
1136
+ return this.getChildContext = function() {
1137
+ return t.context;
1138
+ }, t.children;
1139
+ }
1140
+ function _n(t) {
1141
+ var e = this, r = t.h;
1142
+ if (e.componentWillUnmount = function() {
1143
+ mt(null, e.v), e.v = null, e.h = null;
1144
+ }, e.h && e.h !== r && e.componentWillUnmount(), !e.v) {
1145
+ for (var n = e.__v; n !== null && !n.__m && n.__ !== null; ) n = n.__;
1146
+ e.h = r, e.v = { nodeType: 1, parentNode: r, childNodes: [], __k: { __m: n.__m }, contains: function() {
1147
+ return !0;
1148
+ }, insertBefore: function(o, a) {
1149
+ this.childNodes.push(o), e.h.insertBefore(o, a);
1150
+ }, removeChild: function(o) {
1151
+ this.childNodes.splice(this.childNodes.indexOf(o) >>> 1, 1), e.h.removeChild(o);
1152
+ } };
1153
+ }
1154
+ mt(tt(Nn, { context: e.context }, t.__v), e.v);
1155
+ }
1156
+ function Sn(t, e) {
1157
+ var r = tt(_n, { __v: t, h: e });
1158
+ return r.containerInfo = e, r;
1159
+ }
1160
+ (Nt.prototype = new bt()).__a = function(t) {
1161
+ var e = this, r = lr(e.__v), n = e.l.get(t);
1162
+ return n[0]++, function(o) {
1163
+ var a = function() {
1164
+ e.props.revealOrder ? (n.push(o), _e(e, t, n)) : o();
1165
+ };
1166
+ r ? r(a) : a();
1167
+ };
1168
+ }, Nt.prototype.render = function(t) {
1169
+ this.i = null, this.l = /* @__PURE__ */ new Map();
1170
+ var e = it(t.children);
1171
+ t.revealOrder && t.revealOrder[0] === "b" && e.reverse();
1172
+ for (var r = e.length; r--; ) this.l.set(e[r], this.i = [1, 0, this.i]);
1173
+ return t.children;
1174
+ }, Nt.prototype.componentDidUpdate = Nt.prototype.componentDidMount = function() {
1175
+ var t = this;
1176
+ this.l.forEach(function(e, r) {
1177
+ _e(t, r, e);
1178
+ });
1179
+ };
1180
+ var cr = typeof Symbol < "u" && Symbol.for && /* @__PURE__ */ Symbol.for("react.element") || 60103, An = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, Tn = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, En = /[A-Z0-9]/g, Rn = typeof document < "u", On = function(t) {
1181
+ return (typeof Symbol < "u" && typeof /* @__PURE__ */ Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(t);
1182
+ };
1183
+ function Ln(t, e, r) {
1184
+ return e.__k == null && (e.textContent = ""), mt(t, e), typeof r == "function" && r(), t ? t.__c : null;
1185
+ }
1186
+ function Pn(t, e, r) {
1187
+ return xr(t, e), typeof r == "function" && r(), t ? t.__c : null;
1188
+ }
1189
+ bt.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t) {
1190
+ Object.defineProperty(bt.prototype, t, { configurable: !0, get: function() {
1191
+ return this["UNSAFE_" + t];
1192
+ }, set: function(e) {
1193
+ Object.defineProperty(this, t, { configurable: !0, writable: !0, value: e });
1194
+ } });
1195
+ });
1196
+ var Se = U.event;
1197
+ function Dn() {
1198
+ }
1199
+ function Bn() {
1200
+ return this.cancelBubble;
1201
+ }
1202
+ function In() {
1203
+ return this.defaultPrevented;
1204
+ }
1205
+ U.event = function(t) {
1206
+ return Se && (t = Se(t)), t.persist = Dn, t.isPropagationStopped = Bn, t.isDefaultPrevented = In, t.nativeEvent = t;
1207
+ };
1208
+ var ge, jn = { enumerable: !1, configurable: !0, get: function() {
1209
+ return this.class;
1210
+ } }, Ae = U.vnode;
1211
+ U.vnode = function(t) {
1212
+ typeof t.type == "string" && (function(e) {
1213
+ var r = e.props, n = e.type, o = {}, a = n.indexOf("-") === -1;
1214
+ for (var i in r) {
1215
+ var l = r[i];
1216
+ if (!(i === "value" && "defaultValue" in r && l == null || Rn && i === "children" && n === "noscript" || i === "class" || i === "className")) {
1217
+ var c = i.toLowerCase();
1218
+ i === "defaultValue" && "value" in r && r.value == null ? i = "value" : i === "download" && l === !0 ? l = "" : c === "translate" && l === "no" ? l = !1 : c[0] === "o" && c[1] === "n" ? c === "ondoubleclick" ? i = "ondblclick" : c !== "onchange" || n !== "input" && n !== "textarea" || On(r.type) ? c === "onfocus" ? i = "onfocusin" : c === "onblur" ? i = "onfocusout" : Tn.test(i) && (i = c) : c = i = "oninput" : a && An.test(i) ? i = i.replace(En, "-$&").toLowerCase() : l === null && (l = void 0), c === "oninput" && o[i = c] && (i = "oninputCapture"), o[i] = l;
1219
+ }
1220
+ }
1221
+ n == "select" && o.multiple && Array.isArray(o.value) && (o.value = it(r.children).forEach(function(u) {
1222
+ u.props.selected = o.value.indexOf(u.props.value) != -1;
1223
+ })), n == "select" && o.defaultValue != null && (o.value = it(r.children).forEach(function(u) {
1224
+ u.props.selected = o.multiple ? o.defaultValue.indexOf(u.props.value) != -1 : o.defaultValue == u.props.value;
1225
+ })), r.class && !r.className ? (o.class = r.class, Object.defineProperty(o, "className", jn)) : (r.className && !r.class || r.class && r.className) && (o.class = o.className = r.className), e.props = o;
1226
+ })(t), t.$$typeof = cr, Ae && Ae(t);
1227
+ };
1228
+ var Te = U.__r;
1229
+ U.__r = function(t) {
1230
+ Te && Te(t), ge = t.__c;
1231
+ };
1232
+ var Ee = U.diffed;
1233
+ U.diffed = function(t) {
1234
+ Ee && Ee(t);
1235
+ var e = t.props, r = t.__e;
1236
+ r != null && t.type === "textarea" && "value" in e && e.value !== r.value && (r.value = e.value == null ? "" : e.value), ge = null;
1237
+ };
1238
+ var Vn = { ReactCurrentDispatcher: { current: { readContext: function(t) {
1239
+ return ge.__n[t.__c].props.value;
1240
+ }, useCallback: K, useContext: zt, useDebugValue: ze, useDeferredValue: nr, useEffect: I, useId: Fe, useImperativeHandle: Me, useInsertionEffect: ar, useLayoutEffect: yt, useMemo: vt, useReducer: Ve, useRef: G, useState: P, useSyncExternalStore: er, useTransition: or } } };
1241
+ function Mn(t) {
1242
+ return tt.bind(null, t);
1243
+ }
1244
+ function Ut(t) {
1245
+ return !!t && t.$$typeof === cr;
1246
+ }
1247
+ function Fn(t) {
1248
+ return Ut(t) && t.type === St;
1249
+ }
1250
+ function zn(t) {
1251
+ return !!t && !!t.displayName && (typeof t.displayName == "string" || t.displayName instanceof String) && t.displayName.startsWith("Memo(");
1252
+ }
1253
+ function Un(t) {
1254
+ return Ut(t) ? wr.apply(null, arguments) : t;
1255
+ }
1256
+ function Wn(t) {
1257
+ return !!t.__k && (mt(null, t), !0);
1258
+ }
1259
+ function Gn(t) {
1260
+ return t && (t.base || t.nodeType === 1 && t) || null;
1261
+ }
1262
+ var Kn = function(t, e) {
1263
+ return t(e);
1264
+ }, Hn = function(t, e) {
1265
+ return t(e);
1266
+ }, Jn = St, Qn = Ut, ut = { useState: P, useId: Fe, useReducer: Ve, useEffect: I, useLayoutEffect: yt, useInsertionEffect: ar, useTransition: or, useDeferredValue: nr, useSyncExternalStore: er, startTransition: rr, useRef: G, useImperativeHandle: Me, useMemo: vt, useCallback: K, useContext: zt, useDebugValue: ze, version: "18.3.1", Children: xn, render: Ln, hydrate: Pn, unmountComponentAtNode: Wn, createPortal: Sn, createElement: tt, createContext: le, createFactory: Mn, cloneElement: Un, createRef: yr, Fragment: St, isValidElement: Ut, isElement: Qn, isFragment: Fn, isMemo: zn, findDOMNode: Gn, Component: bt, PureComponent: ae, memo: bn, forwardRef: wn, flushSync: Hn, unstable_batchedUpdates: Kn, StrictMode: Jn, Suspense: It, SuspenseList: Nt, lazy: Cn, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: Vn }, ur = {
1267
+ color: void 0,
1268
+ size: void 0,
1269
+ className: void 0,
1270
+ style: void 0,
1271
+ attr: void 0
1272
+ }, Re = ut.createContext && /* @__PURE__ */ ut.createContext(ur), Xn = ["attr", "size", "title"];
1273
+ function qn(t, e) {
1274
+ if (t == null) return {};
1275
+ var r = Yn(t, e), n, o;
1276
+ if (Object.getOwnPropertySymbols) {
1277
+ var a = Object.getOwnPropertySymbols(t);
1278
+ for (o = 0; o < a.length; o++)
1279
+ n = a[o], !(e.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(t, n) && (r[n] = t[n]);
1280
+ }
1281
+ return r;
1282
+ }
1283
+ function Yn(t, e) {
1284
+ if (t == null) return {};
1285
+ var r = {};
1286
+ for (var n in t)
1287
+ if (Object.prototype.hasOwnProperty.call(t, n)) {
1288
+ if (e.indexOf(n) >= 0) continue;
1289
+ r[n] = t[n];
1290
+ }
1291
+ return r;
1292
+ }
1293
+ function Vt() {
1294
+ return Vt = Object.assign ? Object.assign.bind() : function(t) {
1295
+ for (var e = 1; e < arguments.length; e++) {
1296
+ var r = arguments[e];
1297
+ for (var n in r)
1298
+ Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]);
1299
+ }
1300
+ return t;
1301
+ }, Vt.apply(this, arguments);
1302
+ }
1303
+ function Oe(t, e) {
1304
+ var r = Object.keys(t);
1305
+ if (Object.getOwnPropertySymbols) {
1306
+ var n = Object.getOwnPropertySymbols(t);
1307
+ e && (n = n.filter(function(o) {
1308
+ return Object.getOwnPropertyDescriptor(t, o).enumerable;
1309
+ })), r.push.apply(r, n);
1310
+ }
1311
+ return r;
1312
+ }
1313
+ function Mt(t) {
1314
+ for (var e = 1; e < arguments.length; e++) {
1315
+ var r = arguments[e] != null ? arguments[e] : {};
1316
+ e % 2 ? Oe(Object(r), !0).forEach(function(n) {
1317
+ Zn(t, n, r[n]);
1318
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : Oe(Object(r)).forEach(function(n) {
1319
+ Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(r, n));
1320
+ });
1321
+ }
1322
+ return t;
1323
+ }
1324
+ function Zn(t, e, r) {
1325
+ return e = $n(e), e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
1326
+ }
1327
+ function $n(t) {
1328
+ var e = to(t, "string");
1329
+ return typeof e == "symbol" ? e : e + "";
1330
+ }
1331
+ function to(t, e) {
1332
+ if (typeof t != "object" || !t) return t;
1333
+ var r = t[Symbol.toPrimitive];
1334
+ if (r !== void 0) {
1335
+ var n = r.call(t, e);
1336
+ if (typeof n != "object") return n;
1337
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1338
+ }
1339
+ return (e === "string" ? String : Number)(t);
1340
+ }
1341
+ function dr(t) {
1342
+ return t && t.map((e, r) => /* @__PURE__ */ ut.createElement(e.tag, Mt({
1343
+ key: r
1344
+ }, e.attr), dr(e.child)));
1345
+ }
1346
+ function dt(t) {
1347
+ return (e) => /* @__PURE__ */ ut.createElement(eo, Vt({
1348
+ attr: Mt({}, t.attr)
1349
+ }, e), dr(t.child));
1350
+ }
1351
+ function eo(t) {
1352
+ var e = (r) => {
1353
+ var {
1354
+ attr: n,
1355
+ size: o,
1356
+ title: a
1357
+ } = t, i = qn(t, Xn), l = o || r.size || "1em", c;
1358
+ return r.className && (c = r.className), t.className && (c = (c ? c + " " : "") + t.className), /* @__PURE__ */ ut.createElement("svg", Vt({
1359
+ stroke: "currentColor",
1360
+ fill: "currentColor",
1361
+ strokeWidth: "0"
1362
+ }, r.attr, n, i, {
1363
+ className: c,
1364
+ style: Mt(Mt({
1365
+ color: t.color || r.color
1366
+ }, r.style), t.style),
1367
+ height: l,
1368
+ width: l,
1369
+ xmlns: "http://www.w3.org/2000/svg"
1370
+ }), a && /* @__PURE__ */ ut.createElement("title", null, a), t.children);
1371
+ };
1372
+ return Re !== void 0 ? /* @__PURE__ */ ut.createElement(Re.Consumer, null, (r) => e(r)) : e(ur);
1373
+ }
1374
+ function ro(t) {
1375
+ return dt({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M416.3 256c0-21 13.1-38.9 31.7-46.1-4.9-20.5-13-39.7-23.7-57.1-6.4 2.8-13.2 4.3-20.1 4.3-12.6 0-25.2-4.8-34.9-14.4-14.9-14.9-18.2-36.8-10.2-55-17.3-10.7-36.6-18.8-57-23.7C295 82.5 277 95.7 256 95.7S217 82.5 209.9 64c-20.5 4.9-39.7 13-57.1 23.7 8.1 18.1 4.7 40.1-10.2 55-9.6 9.6-22.3 14.4-34.9 14.4-6.9 0-13.7-1.4-20.1-4.3C77 170.3 68.9 189.5 64 210c18.5 7.1 31.7 25 31.7 46.1 0 21-13.1 38.9-31.6 46.1 4.9 20.5 13 39.7 23.7 57.1 6.4-2.8 13.2-4.2 20-4.2 12.6 0 25.2 4.8 34.9 14.4 14.8 14.8 18.2 36.8 10.2 54.9 17.4 10.7 36.7 18.8 57.1 23.7 7.1-18.5 25-31.6 46-31.6s38.9 13.1 46 31.6c20.5-4.9 39.7-13 57.1-23.7-8-18.1-4.6-40 10.2-54.9 9.6-9.6 22.2-14.4 34.9-14.4 6.8 0 13.7 1.4 20 4.2 10.7-17.4 18.8-36.7 23.7-57.1-18.4-7.2-31.6-25.1-31.6-46.2zm-159.4 79.9c-44.3 0-80-35.9-80-80s35.7-80 80-80 80 35.9 80 80-35.7 80-80 80z" }, child: [] }] })(t);
1376
+ }
1377
+ var no = /\s+/g, oo = (t) => typeof t != "string" || !t ? t : t.replace(no, " ").trim(), Ft = (...t) => {
1378
+ const e = [], r = (n) => {
1379
+ if (!n && n !== 0 && n !== 0n) return;
1380
+ if (Array.isArray(n)) {
1381
+ for (let a = 0, i = n.length; a < i; a++) r(n[a]);
1382
+ return;
1383
+ }
1384
+ const o = typeof n;
1385
+ if (o === "string" || o === "number" || o === "bigint") {
1386
+ if (o === "number" && n !== n) return;
1387
+ e.push(String(n));
1388
+ } else if (o === "object") {
1389
+ const a = Object.keys(n);
1390
+ for (let i = 0, l = a.length; i < l; i++) {
1391
+ const c = a[i];
1392
+ n[c] && e.push(c);
1393
+ }
1394
+ }
1395
+ };
1396
+ for (let n = 0, o = t.length; n < o; n++) {
1397
+ const a = t[n];
1398
+ a != null && r(a);
1399
+ }
1400
+ return e.length > 0 ? oo(e.join(" ")) : void 0;
1401
+ }, Le = (t) => t === !1 ? "false" : t === !0 ? "true" : t === 0 ? "0" : t, W = (t) => {
1402
+ if (!t || typeof t != "object") return !0;
1403
+ for (const e in t) return !1;
1404
+ return !0;
1405
+ }, ao = (t, e) => {
1406
+ if (t === e) return !0;
1407
+ if (!t || !e) return !1;
1408
+ const r = Object.keys(t), n = Object.keys(e);
1409
+ if (r.length !== n.length) return !1;
1410
+ for (let o = 0; o < r.length; o++) {
1411
+ const a = r[o];
1412
+ if (!n.includes(a) || t[a] !== e[a]) return !1;
1413
+ }
1414
+ return !0;
1415
+ }, io = (t, e) => {
1416
+ for (const r in e)
1417
+ if (Object.prototype.hasOwnProperty.call(e, r)) {
1418
+ const n = e[r];
1419
+ r in t ? t[r] = Ft(t[r], n) : t[r] = n;
1420
+ }
1421
+ return t;
1422
+ }, gr = (t, e) => {
1423
+ for (let r = 0; r < t.length; r++) {
1424
+ const n = t[r];
1425
+ Array.isArray(n) ? gr(n, e) : n && e.push(n);
1426
+ }
1427
+ }, pr = (...t) => {
1428
+ const e = [];
1429
+ gr(t, e);
1430
+ const r = [];
1431
+ for (let n = 0; n < e.length; n++)
1432
+ e[n] && r.push(e[n]);
1433
+ return r;
1434
+ }, ie = (t, e) => {
1435
+ const r = {};
1436
+ for (const n in t) {
1437
+ const o = t[n];
1438
+ if (n in e) {
1439
+ const a = e[n];
1440
+ Array.isArray(o) || Array.isArray(a) ? r[n] = pr(a, o) : typeof o == "object" && typeof a == "object" && o && a ? r[n] = ie(o, a) : r[n] = a + " " + o;
1441
+ } else
1442
+ r[n] = o;
1443
+ }
1444
+ for (const n in e)
1445
+ n in t || (r[n] = e[n]);
1446
+ return r;
1447
+ }, so = {
1448
+ twMerge: !0,
1449
+ twMergeConfig: {}
1450
+ };
1451
+ function lo() {
1452
+ let t = null, e = {}, r = !1;
1453
+ return {
1454
+ get cachedTwMerge() {
1455
+ return t;
1456
+ },
1457
+ set cachedTwMerge(n) {
1458
+ t = n;
1459
+ },
1460
+ get cachedTwMergeConfig() {
1461
+ return e;
1462
+ },
1463
+ set cachedTwMergeConfig(n) {
1464
+ e = n;
1465
+ },
1466
+ get didTwMergeConfigChange() {
1467
+ return r;
1468
+ },
1469
+ set didTwMergeConfigChange(n) {
1470
+ r = n;
1471
+ },
1472
+ reset() {
1473
+ t = null, e = {}, r = !1;
1474
+ }
1475
+ };
1476
+ }
1477
+ var Yt = lo(), co = (t) => {
1478
+ const e = (n, o) => {
1479
+ const {
1480
+ extend: a = null,
1481
+ slots: i = {},
1482
+ variants: l = {},
1483
+ compoundVariants: c = [],
1484
+ compoundSlots: u = [],
1485
+ defaultVariants: d = {}
1486
+ } = n, p = { ...so, ...o }, k = a?.base ? Ft(a.base, n?.base) : n?.base, m = a?.variants && !W(a.variants) ? ie(l, a.variants) : l, y = a?.defaultVariants && !W(a.defaultVariants) ? { ...a.defaultVariants, ...d } : d;
1487
+ !W(p.twMergeConfig) && !ao(p.twMergeConfig, Yt.cachedTwMergeConfig) && (Yt.didTwMergeConfigChange = !0, Yt.cachedTwMergeConfig = p.twMergeConfig);
1488
+ const E = W(a?.slots), f = W(i) ? {} : {
1489
+ // add "base" to the slots object
1490
+ base: Ft(n?.base, E && a?.base),
1491
+ ...i
1492
+ }, x = E ? f : io(
1493
+ { ...a?.slots },
1494
+ W(f) ? { base: n?.base } : f
1495
+ ), g = W(a?.compoundVariants) ? c : pr(a?.compoundVariants, c), h = (_) => {
1496
+ if (W(m) && W(i) && E)
1497
+ return t(k, _?.class, _?.className)(p);
1498
+ if (g && !Array.isArray(g))
1499
+ throw new TypeError(
1500
+ `The "compoundVariants" prop must be an array. Received: ${typeof g}`
1501
+ );
1502
+ if (u && !Array.isArray(u))
1503
+ throw new TypeError(
1504
+ `The "compoundSlots" prop must be an array. Received: ${typeof u}`
1505
+ );
1506
+ const J = (C, N = m, w = null, A = null) => {
1507
+ const T = N[C];
1508
+ if (!T || W(T))
1509
+ return null;
1510
+ const R = A?.[C] ?? _?.[C];
1511
+ if (R === null) return null;
1512
+ const F = Le(R);
1513
+ if (typeof F == "object")
1514
+ return null;
1515
+ const Q = y?.[C], z = F ?? Le(Q);
1516
+ return T[z || "false"];
1517
+ }, Kt = () => {
1518
+ if (!m) return null;
1519
+ const C = Object.keys(m), N = [];
1520
+ for (let w = 0; w < C.length; w++) {
1521
+ const A = J(C[w], m);
1522
+ A && N.push(A);
1523
+ }
1524
+ return N;
1525
+ }, Ht = (C, N) => {
1526
+ if (!m || typeof m != "object") return null;
1527
+ const w = [];
1528
+ for (const A in m) {
1529
+ const T = J(A, m, C, N), R = C === "base" && typeof T == "string" ? T : T && T[C];
1530
+ R && w.push(R);
1531
+ }
1532
+ return w;
1533
+ }, xt = {};
1534
+ for (const C in _) {
1535
+ const N = _[C];
1536
+ N !== void 0 && (xt[C] = N);
1537
+ }
1538
+ const Pt = (C, N) => {
1539
+ const w = typeof _?.[C] == "object" ? {
1540
+ [C]: _[C]?.initial
1541
+ } : {};
1542
+ return {
1543
+ ...y,
1544
+ ...xt,
1545
+ ...w,
1546
+ ...N
1547
+ };
1548
+ }, kt = (C = [], N) => {
1549
+ const w = [], A = C.length;
1550
+ for (let T = 0; T < A; T++) {
1551
+ const { class: R, className: F, ...Q } = C[T];
1552
+ let z = !0;
1553
+ const X = Pt(null, N);
1554
+ for (const j in Q) {
1555
+ const q = Q[j], Dt = X[j];
1556
+ if (Array.isArray(q)) {
1557
+ if (!q.includes(Dt)) {
1558
+ z = !1;
1559
+ break;
1560
+ }
1561
+ } else {
1562
+ if ((q == null || q === !1) && (Dt == null || Dt === !1))
1563
+ continue;
1564
+ if (Dt !== q) {
1565
+ z = !1;
1566
+ break;
1567
+ }
1568
+ }
1569
+ }
1570
+ z && (R && w.push(R), F && w.push(F));
1571
+ }
1572
+ return w;
1573
+ }, st = (C) => {
1574
+ const N = kt(g, C);
1575
+ if (!Array.isArray(N)) return N;
1576
+ const w = {}, A = t;
1577
+ for (let T = 0; T < N.length; T++) {
1578
+ const R = N[T];
1579
+ if (typeof R == "string")
1580
+ w.base = A(w.base, R)(p);
1581
+ else if (typeof R == "object")
1582
+ for (const F in R)
1583
+ w[F] = A(w[F], R[F])(p);
1584
+ }
1585
+ return w;
1586
+ }, lt = (C) => {
1587
+ if (u.length < 1) return null;
1588
+ const N = {}, w = Pt(null, C);
1589
+ for (let A = 0; A < u.length; A++) {
1590
+ const {
1591
+ slots: T = [],
1592
+ class: R,
1593
+ className: F,
1594
+ ...Q
1595
+ } = u[A];
1596
+ if (!W(Q)) {
1597
+ let z = !0;
1598
+ for (const X in Q) {
1599
+ const j = w[X], q = Q[X];
1600
+ if (j === void 0 || (Array.isArray(q) ? !q.includes(j) : q !== j)) {
1601
+ z = !1;
1602
+ break;
1603
+ }
1604
+ }
1605
+ if (!z) continue;
1606
+ }
1607
+ for (let z = 0; z < T.length; z++) {
1608
+ const X = T[z];
1609
+ N[X] || (N[X] = []), N[X].push([R, F]);
1610
+ }
1611
+ }
1612
+ return N;
1613
+ };
1614
+ if (!W(i) || !E) {
1615
+ const C = {};
1616
+ if (typeof x == "object" && !W(x)) {
1617
+ const N = t;
1618
+ for (const w in x)
1619
+ C[w] = (A) => {
1620
+ const T = st(A), R = lt(A);
1621
+ return N(
1622
+ x[w],
1623
+ Ht(w, A),
1624
+ T ? T[w] : void 0,
1625
+ R ? R[w] : void 0,
1626
+ A?.class,
1627
+ A?.className
1628
+ )(p);
1629
+ };
1630
+ }
1631
+ return C;
1632
+ }
1633
+ return t(
1634
+ k,
1635
+ Kt(),
1636
+ kt(g),
1637
+ _?.class,
1638
+ _?.className
1639
+ )(p);
1640
+ }, D = () => {
1641
+ if (!(!m || typeof m != "object"))
1642
+ return Object.keys(m);
1643
+ };
1644
+ return h.variantKeys = D(), h.extend = a, h.base = k, h.slots = x, h.variants = m, h.defaultVariants = y, h.compoundSlots = u, h.compoundVariants = g, h;
1645
+ };
1646
+ return {
1647
+ tv: e,
1648
+ createTV: (n) => (o, a) => e(o, a ? ie(n, a) : n)
1649
+ };
1650
+ }, uo = (...t) => (e) => Ft(t) || void 0, { tv: Wt } = co(uo);
1651
+ const Pe = Wt({
1652
+ base: "flex items-center justify-center rounded-lg transition-all duration-100 cursor-pointer active:scale-95",
1653
+ variants: {
1654
+ $variant: {
1655
+ primary: "font-semibold text-sm bg-(--lv-control-button-primary-background) text-(--lv-control-button-primary-color) border-(--lv-control-button-primary-border) hover:bg-(--lv-control-button-primary-hoverBackground,var(--lv-control-button-primary-background)) active:bg-(--lv-control-button-primary-activeBackground,var(--lv-control-button-primary-hoverBackground,var(--lv-control-button-primary-background))) disabled:bg-(--lv-control-button-primary-disabledBackground,var(--lv-control-button-primary-background)) disabled:text-(--lv-control-button-primary-disabledColor,var(--lv-control-button-primary-color))",
1656
+ secondary: "border bg-(--lv-control-button-secondary-background) text-(--lv-control-button-secondary-color) border-(--lv-control-button-secondary-border,var(--lv-control-button-secondary-background)) hover:bg-(--lv-control-button-secondary-hoverBackground,var(--lv-control-button-secondary-background)) active:bg-(--lv-control-button-secondary-activeBackground,var(--lv-control-button-secondary-hoverBackground,var(--lv-control-button-secondary-background))) disabled:bg-(--lv-control-button-secondary-disabledBackground,var(--lv-control-button-secondary-background)) disabled:text-(--lv-control-button-secondary-disabledColor,var(--lv-control-button-secondary-color))",
1657
+ tertiary: "bg-transparent text-(--lv-text-muted) hover:bg-(--lv-control-button-tertiary-hoverBackground,transparent) active:bg-(--lv-control-button-tertiary-activeBackground,var(--lv-control-button-tertiary-hoverBackground,transparent)) disabled:text-(--lv-control-button-tertiary-disabledColor,var(--lv-text-muted))"
1658
+ },
1659
+ $size: {
1660
+ sm: "h-6",
1661
+ md: "h-8",
1662
+ lg: "h-11"
1663
+ },
1664
+ $aspect: {
1665
+ square: "aspect-square",
1666
+ auto: ""
1667
+ }
1668
+ },
1669
+ defaultVariants: {
1670
+ $size: "md",
1671
+ $variant: "primary",
1672
+ $aspect: "auto"
1673
+ }
1674
+ });
1675
+ function ft(t) {
1676
+ const { children: e, className: r, $variant: n, $size: o, $aspect: a, ...i } = t, { href: l, onClick: c } = t;
1677
+ if (l) {
1678
+ const d = {
1679
+ href: l,
1680
+ onClick: c,
1681
+ className: at(Pe({ $variant: n, $size: o, $aspect: a }), r),
1682
+ ...i
1683
+ };
1684
+ return tt("a", d, e);
1685
+ }
1686
+ const u = {
1687
+ onClick: c,
1688
+ className: at(Pe({ $variant: n, $size: o, $aspect: a }), r),
1689
+ ...i
1690
+ };
1691
+ return tt("button", u, e);
1692
+ }
1693
+ const go = ({ isApple: t }) => /* @__PURE__ */ v("div", { className: "flex h-full w-full justify-between", children: [
1694
+ /* @__PURE__ */ s("div", { className: "grow py-1 ps-1", children: /* @__PURE__ */ s("div", { className: "h-full rounded-sm border border-gray-300 bg-gray-400" }) }),
1695
+ /* @__PURE__ */ s("div", { className: "flex h-full w-3 flex-col items-center justify-center gap-0.5 pr-0.5", children: Array.from({ length: t ? 1 : 3 }).map((e, r) => /* @__PURE__ */ s(
1696
+ "div",
1697
+ {
1698
+ className: "h-1.5 w-1.5 rounded-full border border-gray-500"
1699
+ },
1700
+ "dot-t-" + r
1701
+ )) })
1702
+ ] }), po = ({ isApple: t }) => /* @__PURE__ */ v("div", { className: "flex h-full w-full flex-col justify-between", children: [
1703
+ /* @__PURE__ */ s("div", { className: "grow px-1 pt-1", children: /* @__PURE__ */ s("div", { className: "h-full rounded-sm border border-gray-200 bg-gray-300" }) }),
1704
+ /* @__PURE__ */ s("div", { className: "flex h-3 w-full items-center justify-center gap-0.5 pb-0.5", children: Array.from({ length: t ? 1 : 3 }).map((e, r) => /* @__PURE__ */ s(
1705
+ "div",
1706
+ {
1707
+ className: "h-1.5 w-1.5 rounded-full border border-gray-400"
1708
+ },
1709
+ "dot-p-" + r
1710
+ )) })
1711
+ ] }), fo = () => /* @__PURE__ */ v("div", { className: "-space-x-4 flex items-end", children: [
1712
+ /* @__PURE__ */ s("div", { className: "h-38 w-48 overflow-hidden rounded-lg bg-gray-300", children: /* @__PURE__ */ s(go, { isApple: !0 }) }),
1713
+ /* @__PURE__ */ s("div", { className: "h-18 w-12 overflow-hidden rounded-lg bg-gray-200", children: /* @__PURE__ */ s(po, { isApple: !0 }) })
1714
+ ] }), ho = ({
1715
+ onSettings: t
1716
+ }) => {
1717
+ const { t: e } = H(), { start: r } = dn();
1718
+ return /* @__PURE__ */ v("div", { className: "flex flex-col items-center gap-4 p-6", children: [
1719
+ /* @__PURE__ */ s(fo, {}),
1720
+ /* @__PURE__ */ s("div", { className: "text-center", children: /* @__PURE__ */ s("p", { className: "text-sm text-(--lv-text-secondary)", children: e("disconnected.prompt") }) }),
1721
+ /* @__PURE__ */ v("div", { className: "flex items-center", children: [
1722
+ /* @__PURE__ */ s(
1723
+ ft,
1724
+ {
1725
+ type: "button",
1726
+ onClick: r,
1727
+ className: "z-10 px-6 py-3",
1728
+ $variant: "primary",
1729
+ $size: "lg",
1730
+ children: e("disconnected.generateQr")
1731
+ }
1732
+ ),
1733
+ /* @__PURE__ */ s(
1734
+ ft,
1735
+ {
1736
+ type: "button",
1737
+ "aria-label": e("disconnected.connectionSettings"),
1738
+ "aria-pressed": !1,
1739
+ onClick: t,
1740
+ className: "px-3 ltr:-ml-1 ltr:rounded-l-none rtl:-mr-1 rtl:rounded-r-none",
1741
+ $aspect: "square",
1742
+ $size: "lg",
1743
+ $variant: "secondary",
1744
+ children: /* @__PURE__ */ s(ro, { className: "h-5 w-5 text-(--lv-text-muted)" })
1745
+ }
1746
+ )
1747
+ ] })
1748
+ ] });
1749
+ }, vo = () => {
1750
+ const { t } = H();
1751
+ return /* @__PURE__ */ v("div", { className: "flex flex-col space-y-2 px-4", children: [
1752
+ /* @__PURE__ */ s("div", { className: "min-h-32 w-full rounded-md border border-(--lv-control-button-secondary-border) p-2", children: t("info.scanQrCode") }),
1753
+ /* @__PURE__ */ s("div", { className: "w-full rounded-md border border-border p-2", children: t("info.approveOnDevice") }),
1754
+ /* @__PURE__ */ s("div", { className: "w-full rounded-md border border-border p-2", children: t("info.youreConnected") })
1755
+ ] });
1756
+ }, mo = async (t) => {
1757
+ if (!t) return !1;
1758
+ try {
1759
+ if (navigator?.clipboard?.writeText)
1760
+ return await navigator.clipboard.writeText(t), !0;
1761
+ } catch {
1762
+ }
1763
+ try {
1764
+ const e = document.createElement("textarea");
1765
+ e.value = t, e.style.position = "fixed", e.style.left = "-999999px", e.style.top = "-999999px", document.body.appendChild(e), e.focus(), e.select();
1766
+ const r = document.execCommand("copy");
1767
+ return document.body.removeChild(e), r;
1768
+ } catch {
1769
+ return !1;
1770
+ }
1771
+ }, se = (t, { duration: e = 200 } = {}) => {
1772
+ const [r, n] = P(t), [o, a] = P(null), i = G(), l = G(t);
1773
+ return I(() => {
1774
+ if (!Object.is(t, l.current))
1775
+ return i.current && window.clearTimeout(i.current), a(l.current), n(t), l.current = t, i.current = window.setTimeout(() => {
1776
+ a(null), i.current = void 0;
1777
+ }, e), () => {
1778
+ i.current && window.clearTimeout(i.current);
1779
+ };
1780
+ }, [t, e]), {
1781
+ current: r,
1782
+ previous: o,
1783
+ isTransitioning: o !== null
1784
+ };
1785
+ }, fr = () => {
1786
+ const { themeConfig: t } = Ze(), { settings: e, updateThemePreference: r } = wt(), n = t?.mode ?? "auto", o = e?.theme ?? "system", a = n === "auto";
1787
+ return {
1788
+ themeMode: a ? o ?? "system" : n,
1789
+ appThemeMode: n,
1790
+ userThemeMode: o,
1791
+ isUserConfigurable: a,
1792
+ updateThemePreference: r
1793
+ };
1794
+ }, bo = "data:image/webp;base64,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", yo = () => {
1795
+ const { t } = H(), { status: e } = Lt(), r = e?.status, n = e?.signaling?.state, o = $({ sessionState: r, signalState: n }).with({ sessionState: "connected" }, () => ({
1796
+ icon: "✅",
1797
+ text: t("status.connectedSuccessfully")
1798
+ })).with({ sessionState: "signaling", signalState: "standby" }, () => ({
1799
+ icon: "🫥",
1800
+ text: t("status.connecting")
1801
+ })).with({ sessionState: "signaling", signalState: "connecting" }, () => ({
1802
+ icon: "↗️",
1803
+ text: t("status.connecting")
1804
+ })).with({ sessionState: "signaling", signalState: "ready" }, () => ({
1805
+ icon: "👋",
1806
+ text: t("status.ready")
1807
+ })).with({ sessionState: "signaling", signalState: "handshake" }, () => ({
1808
+ icon: "🤝",
1809
+ text: t("status.handshakeClosed")
1810
+ })).with(
1811
+ { sessionState: "signaling", signalState: "handshake-partial" },
1812
+ () => ({
1813
+ icon: "🤝",
1814
+ text: t("status.handshakePartial")
1815
+ })
1816
+ ).with({ sessionState: "signaling", signalState: "encrypted" }, () => ({
1817
+ icon: "🔒",
1818
+ text: t("status.encrypted")
1819
+ })).with({ sessionState: "signaling", signalState: "error" }, () => ({
1820
+ icon: "❌",
1821
+ text: t("status.signalError")
1822
+ })).otherwise(() => {
1823
+ });
1824
+ if (!o) return /* @__PURE__ */ s(ht, {});
1825
+ const { icon: a, text: i } = o;
1826
+ return /* @__PURE__ */ v("div", { className: "group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-(--lv-control-button-secondary-background)", children: [
1827
+ /* @__PURE__ */ s("div", { className: "pointer-events-none whitespace-nowrap rounded-md text-xs opacity-0 group-hover:opacity-100", children: i }),
1828
+ /* @__PURE__ */ s("div", { children: a })
1829
+ ] });
1830
+ }, wo = () => /* @__PURE__ */ v(ht, { children: [
1831
+ /* @__PURE__ */ s("div", { className: "h-11 w-full" }),
1832
+ /* @__PURE__ */ v("div", { className: "absolute inset-x-0 bottom-0 flex items-end justify-between gap-2 px-3 py-2 text-(--lv-text-muted)", children: [
1833
+ /* @__PURE__ */ v(
1834
+ "a",
1835
+ {
1836
+ href: "https://github.com/v3xlabs/open-lavatory",
1837
+ target: "_blank",
1838
+ rel: "noreferrer",
1839
+ className: "flex items-center gap-2 p-1 font-semibold text-sm text-(--lv-text-muted)",
1840
+ children: [
1841
+ /* @__PURE__ */ s(
1842
+ "img",
1843
+ {
1844
+ src: bo,
1845
+ alt: "Open Lavatory Logo",
1846
+ width: 20,
1847
+ height: 20,
1848
+ className: "rounded",
1849
+ "data-openlv-brand-logo": !0
1850
+ }
1851
+ ),
1852
+ /* @__PURE__ */ s("span", { children: "openlv" })
1853
+ ]
1854
+ }
1855
+ ),
1856
+ /* @__PURE__ */ s("div", { className: "text-sm text-(--lv-text-muted)", children: /* @__PURE__ */ s(yo, {}) })
1857
+ ] })
1858
+ ] });
1859
+ function xo(t) {
1860
+ return dt({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "m15 18-6-6 6-6" }, child: [] }] })(t);
1861
+ }
1862
+ function ko(t) {
1863
+ return dt({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "m9 18 6-6-6-6" }, child: [] }] })(t);
1864
+ }
1865
+ function hr(t) {
1866
+ return dt({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "circle", attr: { cx: "12", cy: "12", r: "10" }, child: [] }, { tag: "path", attr: { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }, child: [] }, { tag: "path", attr: { d: "M12 17h.01" }, child: [] }] })(t);
1867
+ }
1868
+ function Co(t) {
1869
+ return dt({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M5 12h14" }, child: [] }, { tag: "path", attr: { d: "M12 5v14" }, child: [] }] })(t);
1870
+ }
1871
+ function No(t) {
1872
+ return dt({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M3 6h18" }, child: [] }, { tag: "path", attr: { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }, child: [] }, { tag: "path", attr: { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }, child: [] }, { tag: "line", attr: { x1: "10", x2: "10", y1: "11", y2: "17" }, child: [] }, { tag: "line", attr: { x1: "14", x2: "14", y1: "11", y2: "17" }, child: [] }] })(t);
1873
+ }
1874
+ function _o(t) {
1875
+ return dt({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M18 6 6 18" }, child: [] }, { tag: "path", attr: { d: "m6 6 12 12" }, child: [] }] })(t);
1876
+ }
1877
+ const So = ({
1878
+ title: t,
1879
+ view: e,
1880
+ onClose: r,
1881
+ onBack: n,
1882
+ setView: o
1883
+ }) => {
1884
+ const { t: a } = H();
1885
+ return /* @__PURE__ */ v("div", { className: "flex items-center justify-between px-2 py-2", children: [
1886
+ n ? /* @__PURE__ */ s(
1887
+ ft,
1888
+ {
1889
+ onClick: n,
1890
+ "aria-label": a(e === "settings" ? "modal.backToQr" : "modal.closeModal"),
1891
+ $variant: "tertiary",
1892
+ $aspect: "square",
1893
+ $size: "md",
1894
+ children: /* @__PURE__ */ s(xo, { className: "h-6 w-6 text-(--lv-text-muted) rtl:rotate-180" })
1895
+ }
1896
+ ) : (
1897
+ // <Button
1898
+ // type="button"
1899
+ // href="https://openlv.sh"
1900
+ // target="_blank"
1901
+ // $variant="tertiary"
1902
+ // $aspect="square"
1903
+ // $size="md"
1904
+ // >
1905
+ // <LuCircleHelp className="h-5 w-5" />
1906
+ // </Button>
1907
+ /* @__PURE__ */ s(
1908
+ ft,
1909
+ {
1910
+ type: "button",
1911
+ onClick: () => o("info"),
1912
+ $variant: "tertiary",
1913
+ $aspect: "square",
1914
+ $size: "md",
1915
+ children: /* @__PURE__ */ s(hr, { className: "h-5 w-5" })
1916
+ }
1917
+ )
1918
+ ),
1919
+ /* @__PURE__ */ s("h2", { className: "flex items-center justify-center gap-2 font-semibold text-(--lv-text-primary) text-lg", children: t }),
1920
+ /* @__PURE__ */ s(
1921
+ ft,
1922
+ {
1923
+ type: "button",
1924
+ "aria-label": a("common.close"),
1925
+ "aria-pressed": !1,
1926
+ onClick: r,
1927
+ $variant: "tertiary",
1928
+ $aspect: "square",
1929
+ $size: "md",
1930
+ children: /* @__PURE__ */ s(_o, { className: "h-6 w-6 text-(--lv-text-muted)" })
1931
+ }
1932
+ )
1933
+ ] });
1934
+ };
1935
+ function Ao(t, { transitionDuration: e = 200 } = {}) {
1936
+ const [r, n] = P(t), { current: o, previous: a, isTransitioning: i } = se(r, {
1937
+ duration: e
1938
+ }), l = K((u) => {
1939
+ n(u);
1940
+ }, []), c = K(() => {
1941
+ n(t);
1942
+ }, [t]);
1943
+ return {
1944
+ screen: o,
1945
+ previousScreen: a,
1946
+ isTransitioning: i,
1947
+ navigate: l,
1948
+ goBack: c,
1949
+ isAtRoot: o === t
1950
+ };
1951
+ }
1952
+ const To = ({
1953
+ current: t,
1954
+ previous: e,
1955
+ isTransitioning: r,
1956
+ render: n,
1957
+ className: o
1958
+ }) => /* @__PURE__ */ v("div", { className: at("modal-transition__container", o), children: [
1959
+ e !== null && /* @__PURE__ */ s("div", { className: "modal-transition__layer modal-transition__layer--outgoing", children: n(e) }),
1960
+ /* @__PURE__ */ s(
1961
+ "div",
1962
+ {
1963
+ className: at(
1964
+ "modal-transition__layer",
1965
+ r && "modal-transition__layer--incoming"
1966
+ ),
1967
+ children: n(t)
1968
+ }
1969
+ )
1970
+ ] }), Et = ({ title: t, right: e, children: r }) => /* @__PURE__ */ v("div", { children: [
1971
+ /* @__PURE__ */ v("div", { className: "flex items-end justify-between py-1 pl-2", children: [
1972
+ /* @__PURE__ */ s("div", { className: "font-medium text-(--lv-text-primary) text-sm", children: t }),
1973
+ /* @__PURE__ */ s("div", { children: e })
1974
+ ] }),
1975
+ /* @__PURE__ */ s("div", { className: "flex flex-col gap-1 rounded-md bg-(--lv-card-background)", children: r })
1976
+ ] }), Rt = ({ label: t, children: e }) => /* @__PURE__ */ v("div", { className: "flex items-baseline justify-between gap-2 px-2 py-1 first:pt-2 last:pb-2", children: [
1977
+ /* @__PURE__ */ s("div", { className: "text-sm text-(--lv-text-secondary) text-start", children: t }),
1978
+ /* @__PURE__ */ s("div", { children: e })
1979
+ ] }), Eo = Wt({
1980
+ slots: {
1981
+ root: "flex overflow-hidden rounded-md border border-(--lv-control-button-secondary-border)",
1982
+ box: "px-4 py-2 font-semibold text-xs transition border-l first:border-l-0 border-(--lv-control-button-secondary-border)"
1983
+ },
1984
+ variants: {
1985
+ active: {
1986
+ on: {
1987
+ box: "bg-(--lv-control-button-secondary-background) text-(--lv-text-primary)"
1988
+ },
1989
+ off: {
1990
+ box: "bg-transparent text-(--lv-text-secondary) cursor-pointer"
1991
+ }
1992
+ }
1993
+ },
1994
+ defaultVariants: {
1995
+ active: "off"
1996
+ }
1997
+ }), Ro = Wt({
1998
+ base: "w-full rounded-md border border-(--lv-control-button-secondary-border) bg-(--lv-control-button-secondary-background) px-3 py-2 font-semibold text-xs text-(--lv-text-primary) cursor-pointer focus:outline-none focus:ring-2 focus:ring-(--lv-control-button-primary-background) appearance-none bg-[url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2214%22%20height%3D%2214%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23888%22%20stroke-width%3D%222%22%3E%3Cpath%20d%3D%22M6%209l6%206%206-6%22%2F%3E%3C%2Fsvg%3E')] bg-[length:14px] bg-[right_8px_center] bg-no-repeat pr-8"
1999
+ }), Gt = ({
2000
+ options: t,
2001
+ value: e,
2002
+ onChange: r,
2003
+ dropdownThreshold: n = 3
2004
+ }) => {
2005
+ if (t.length > n) {
2006
+ const l = Ro();
2007
+ return /* @__PURE__ */ s(
2008
+ "select",
2009
+ {
2010
+ className: l,
2011
+ value: e,
2012
+ onChange: (c) => r(c.target.value),
2013
+ children: t.map(([c, u]) => /* @__PURE__ */ s("option", { value: c, children: u }, c))
2014
+ }
2015
+ );
2016
+ }
2017
+ const { root: a, box: i } = Eo({});
2018
+ return /* @__PURE__ */ s("div", { className: a(), children: t.map(([l, c]) => /* @__PURE__ */ s(
2019
+ "button",
2020
+ {
2021
+ type: "button",
2022
+ onClick: () => r(l),
2023
+ "aria-pressed": l === e,
2024
+ className: i({ active: l === e ? "on" : "off" }),
2025
+ children: c
2026
+ },
2027
+ l
2028
+ )) });
2029
+ }, Oo = () => {
2030
+ const { t } = H(), { userThemeMode: e, isUserConfigurable: r, updateThemePreference: n } = fr();
2031
+ if (!r)
2032
+ return null;
2033
+ const o = [
2034
+ ["light", t("settings.theme.light")],
2035
+ ["dark", t("settings.theme.dark")],
2036
+ ["system", t("settings.theme.system")]
2037
+ ];
2038
+ return /* @__PURE__ */ s(Rt, { label: t("settings.theme.mode"), children: /* @__PURE__ */ s(
2039
+ Gt,
2040
+ {
2041
+ options: o,
2042
+ value: e,
2043
+ onChange: (a) => n(a)
2044
+ }
2045
+ ) });
2046
+ }, Lo = () => {
2047
+ const { t, languageTag: e, setLanguageTag: r } = H(), { settings: n, updateLanguage: o } = wt(), a = vt(() => [...ue].sort((l, c) => {
2048
+ const u = ye(l.tag);
2049
+ return ye(c.tag) - u;
2050
+ }), []), i = (l) => {
2051
+ const c = l;
2052
+ r(c), o(c);
2053
+ };
2054
+ return /* @__PURE__ */ v(Et, { title: t("settings.appearance"), children: [
2055
+ /* @__PURE__ */ s(Rt, { label: t("settings.language"), children: /* @__PURE__ */ s(
2056
+ Gt,
2057
+ {
2058
+ options: a.map((l) => [l.tag, l.nativeName]),
2059
+ value: n?.language || e,
2060
+ onChange: i
2061
+ }
2062
+ ) }),
2063
+ /* @__PURE__ */ s(Oo, {})
2064
+ ] });
2065
+ }, Po = Wt({
2066
+ slots: {
2067
+ root: "group relative",
2068
+ box: "cursor-pointer rounded-md transition-colors flex items-center justify-center hover:[background-color:var(--lv-control-button-tertiary-hoverBackground)] text-(--lv-text-muted)",
2069
+ popover: "-translate-x-1/2 absolute top-full left-1/2 z-10 hidden rounded-md shadow-sm group-hover:block border border-(--lv-control-button-secondary-border) bg-(--lv-body-background) px-2 py-1.5 text-(--lv-text-primary) text-sm",
2070
+ icon: ""
2071
+ },
2072
+ variants: {
2073
+ size: {
2074
+ sm: {
2075
+ box: "h-5 w-5 p-1",
2076
+ icon: "h-3 w-3"
2077
+ },
2078
+ md: {
2079
+ box: "h-6 w-6 p-1",
2080
+ icon: "h-4 w-4"
2081
+ },
2082
+ lg: {
2083
+ box: "h-8 w-8 p-1.5",
2084
+ icon: "h-4 w-4"
2085
+ }
2086
+ },
2087
+ variant: {
2088
+ icon: "",
2089
+ text: ""
2090
+ }
2091
+ },
2092
+ defaultVariants: {
2093
+ size: "lg"
2094
+ }
2095
+ }), De = ({
2096
+ variant: t = "icon",
2097
+ children: e,
2098
+ size: r = "lg"
2099
+ }) => {
2100
+ const { root: n, box: o, popover: a, icon: i } = Po({ size: r, variant: t });
2101
+ return /* @__PURE__ */ v("div", { className: n(), children: [
2102
+ /* @__PURE__ */ s("div", { className: o(), children: $(t).with("icon", () => /* @__PURE__ */ s(hr, { className: i() })).with("text", () => /* @__PURE__ */ s("div", { children: "Text" })).exhaustive() }),
2103
+ /* @__PURE__ */ s("div", { className: a(), children: e })
2104
+ ] });
2105
+ }, Be = ({ label: t, value: e, onClick: r }) => /* @__PURE__ */ v(
2106
+ "button",
2107
+ {
2108
+ type: "button",
2109
+ onClick: r,
2110
+ className: "flex w-full cursor-pointer items-center justify-between gap-2 first:rounded-t-sm last:rounded-b-sm px-2 py-1 first:pt-1.5 last:pb-2 hover:bg-(--lv-control-button-tertiary-hoverBackground)",
2111
+ children: [
2112
+ /* @__PURE__ */ s("div", { className: "text-sm text-(--lv-text-secondary) flex items-center gap-1", children: t }),
2113
+ /* @__PURE__ */ v("div", { className: "flex items-center gap-1", children: [
2114
+ e && /* @__PURE__ */ s("span", { className: "text-sm text-(--lv-text-muted)", children: e }),
2115
+ /* @__PURE__ */ s(ko, { className: "h-4 w-4 text-(--lv-text-muted) rtl:rotate-180" })
2116
+ ] })
2117
+ ]
2118
+ }
2119
+ ), Do = ({ value: t, onChange: e }) => {
2120
+ const { t: r } = H();
2121
+ return /* @__PURE__ */ s(
2122
+ Gt,
2123
+ {
2124
+ options: [
2125
+ ["true", String(r("common.yes"))],
2126
+ ["false", String(r("common.no"))]
2127
+ ],
2128
+ value: t ? "true" : "false",
2129
+ onChange: (n) => e(n === "true")
2130
+ }
2131
+ );
2132
+ }, Bo = ({
2133
+ onNavigate: t
2134
+ }) => {
2135
+ const { t: e } = H(), { settings: r, updateRetainHistory: n, updateAutoReconnect: o } = wt();
2136
+ return /* @__PURE__ */ v(Et, { title: e("settings.connectionPreferences.title"), children: [
2137
+ /* @__PURE__ */ s(
2138
+ Be,
2139
+ {
2140
+ label: /* @__PURE__ */ v(ht, { children: [
2141
+ e("settings.signaling.title"),
2142
+ /* @__PURE__ */ s(De, { variant: "icon", children: e("settings.signaling.description") })
2143
+ ] }),
2144
+ onClick: () => t("signaling"),
2145
+ value: r?.signaling?.p
2146
+ }
2147
+ ),
2148
+ /* @__PURE__ */ s(
2149
+ Be,
2150
+ {
2151
+ label: /* @__PURE__ */ v(ht, { children: [
2152
+ e("settings.transport.title"),
2153
+ /* @__PURE__ */ s(De, { variant: "icon", children: e("settings.transport.description") })
2154
+ ] }),
2155
+ onClick: () => t("transport"),
2156
+ value: "WebRTC"
2157
+ }
2158
+ ),
2159
+ [
2160
+ [
2161
+ e("settings.connectionPreferences.retainSessionHistory"),
2162
+ "retainHistory",
2163
+ r?.retainHistory ?? !1,
2164
+ n
2165
+ ],
2166
+ [
2167
+ e("settings.connectionPreferences.autoReconnect"),
2168
+ "autoReconnect",
2169
+ r?.autoReconnect ?? !1,
2170
+ o
2171
+ ]
2172
+ ].map(([a, i, l, c]) => /* @__PURE__ */ s(Rt, { label: a, children: /* @__PURE__ */ s(Do, { label: a, value: l, onChange: c }) }, i))
2173
+ ] });
2174
+ }, Io = "h-9 w-full rounded-lg border bg-white px-3 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 text-(--lv-text-primary) bg-(--lv-body-background) border-(--lv-control-input-border)", _t = ({
2175
+ // eslint-disable-next-line no-restricted-syntax
2176
+ id: t,
2177
+ value: e,
2178
+ placeholder: r,
2179
+ ariaLabel: n,
2180
+ readOnly: o = !0,
2181
+ onChange: a
2182
+ }) => /* @__PURE__ */ s(
2183
+ "input",
2184
+ {
2185
+ id: t,
2186
+ className: Io,
2187
+ value: e,
2188
+ placeholder: r,
2189
+ "aria-label": n,
2190
+ readOnly: o,
2191
+ onChange: (i) => {
2192
+ i.target instanceof HTMLInputElement && a?.(i.target.value);
2193
+ }
2194
+ }
2195
+ ), jo = ["mqtt", "ntfy", "gun"], Vo = () => {
2196
+ const { t } = H(), { settings: e, updateSignalingProtocol: r, updateSignalingServer: n } = wt();
2197
+ return /* @__PURE__ */ v("div", { children: [
2198
+ /* @__PURE__ */ v(Et, { title: t("settings.signaling.title"), children: [
2199
+ /* @__PURE__ */ s(Rt, { label: t("common.protocol"), children: /* @__PURE__ */ s(
2200
+ Gt,
2201
+ {
2202
+ options: jo.map((o) => [
2203
+ o.toLowerCase(),
2204
+ o.toUpperCase()
2205
+ ]),
2206
+ value: e?.signaling?.p || "",
2207
+ onChange: r
2208
+ }
2209
+ ) }),
2210
+ /* @__PURE__ */ s(Rt, { label: t("settings.signaling.server"), children: /* @__PURE__ */ s(
2211
+ _t,
2212
+ {
2213
+ id: "server",
2214
+ value: e?.signaling?.s?.[e?.signaling?.p ?? ""] ?? "",
2215
+ onChange: (o) => n(o),
2216
+ placeholder: t("settings.signaling.serverUrl"),
2217
+ ariaLabel: t("settings.signaling.serverUrl"),
2218
+ readOnly: !1
2219
+ }
2220
+ ) })
2221
+ ] }),
2222
+ /* @__PURE__ */ s("div", { className: "p-2 text-sm text-(--lv-text-secondary) text-start", children: t("settings.signaling.description") })
2223
+ ] });
2224
+ }, Ie = ({
2225
+ children: t,
2226
+ onRemove: e
2227
+ }) => /* @__PURE__ */ v("div", { className: "flex items-center gap-2", children: [
2228
+ /* @__PURE__ */ s("div", { className: "flex-1", children: t }),
2229
+ /* @__PURE__ */ s(ft, { onClick: e, $variant: "tertiary", $aspect: "square", $size: "sm", children: /* @__PURE__ */ s(No, { className: "h-4 w-4 text-(--lv-text-muted)" }) })
2230
+ ] }), je = ({
2231
+ label: t,
2232
+ onClick: e
2233
+ }) => /* @__PURE__ */ v(
2234
+ "button",
2235
+ {
2236
+ type: "button",
2237
+ onClick: e,
2238
+ className: "flex w-full cursor-pointer items-center justify-center gap-1 rounded-md border border-dashed border-(--lv-control-input-border) py-2 text-sm text-(--lv-text-muted) hover:bg-(--lv-card-background)",
2239
+ children: [
2240
+ /* @__PURE__ */ s(Co, { className: "h-4 w-4" }),
2241
+ t
2242
+ ]
2243
+ }
2244
+ ), Mo = () => {
2245
+ const { t } = H(), {
2246
+ settings: e,
2247
+ addStunServer: r,
2248
+ removeStunServer: n,
2249
+ updateStunServer: o,
2250
+ addTurnServer: a,
2251
+ removeTurnServer: i,
2252
+ updateTurnServer: l
2253
+ } = wt(), c = e?.transport?.s?.webrtc?.stun ?? [], u = e?.transport?.s?.webrtc?.turn ?? [], d = (f, x) => {
2254
+ o(f, x);
2255
+ }, p = () => {
2256
+ r("");
2257
+ }, k = (f) => {
2258
+ n(f);
2259
+ }, m = (f, x, g) => {
2260
+ l(f, { [x]: g || void 0 });
2261
+ }, y = () => {
2262
+ a({ urls: "" });
2263
+ }, E = (f) => {
2264
+ i(f);
2265
+ };
2266
+ return /* @__PURE__ */ v(ht, { children: [
2267
+ /* @__PURE__ */ s(Et, { title: t("settings.transport.iceServers.stun"), children: /* @__PURE__ */ v("div", { className: "flex flex-col gap-2 p-2", children: [
2268
+ c.map((f, x) => /* @__PURE__ */ s(
2269
+ Ie,
2270
+ {
2271
+ onRemove: () => k(x),
2272
+ children: /* @__PURE__ */ s(
2273
+ _t,
2274
+ {
2275
+ value: f,
2276
+ onChange: (g) => d(x, g),
2277
+ placeholder: "stun:stun.l.google.com:19302",
2278
+ readOnly: !1
2279
+ }
2280
+ )
2281
+ },
2282
+ x
2283
+ )),
2284
+ /* @__PURE__ */ s(
2285
+ je,
2286
+ {
2287
+ label: t("settings.transport.iceServers.addStun"),
2288
+ onClick: p
2289
+ }
2290
+ )
2291
+ ] }) }),
2292
+ /* @__PURE__ */ s(Et, { title: t("settings.transport.iceServers.turn"), children: /* @__PURE__ */ v("div", { className: "flex flex-col gap-3 p-2", children: [
2293
+ u.map((f, x) => /* @__PURE__ */ v(
2294
+ "div",
2295
+ {
2296
+ className: "flex flex-col gap-2 rounded-md border border-(--lv-control-input-border) p-2",
2297
+ children: [
2298
+ /* @__PURE__ */ s(Ie, { onRemove: () => E(x), children: /* @__PURE__ */ s(
2299
+ _t,
2300
+ {
2301
+ value: f.urls,
2302
+ onChange: (g) => m(x, "urls", g),
2303
+ placeholder: "turn:relay.example.com:443",
2304
+ readOnly: !1
2305
+ }
2306
+ ) }),
2307
+ /* @__PURE__ */ v("div", { className: "grid grid-cols-2 gap-2", children: [
2308
+ /* @__PURE__ */ s(
2309
+ _t,
2310
+ {
2311
+ value: f.username ?? "",
2312
+ onChange: (g) => m(x, "username", g),
2313
+ placeholder: "Username",
2314
+ readOnly: !1
2315
+ }
2316
+ ),
2317
+ /* @__PURE__ */ s(
2318
+ _t,
2319
+ {
2320
+ value: f.credential ?? "",
2321
+ onChange: (g) => m(x, "credential", g),
2322
+ placeholder: "Password",
2323
+ readOnly: !1
2324
+ }
2325
+ )
2326
+ ] })
2327
+ ]
2328
+ },
2329
+ x
2330
+ )),
2331
+ /* @__PURE__ */ s(
2332
+ je,
2333
+ {
2334
+ label: t("settings.transport.iceServers.addTurn"),
2335
+ onClick: y
2336
+ }
2337
+ )
2338
+ ] }) }),
2339
+ /* @__PURE__ */ s("div", { className: "p-2 text-sm text-(--lv-text-secondary) text-start", children: t("settings.transport.description") })
2340
+ ] });
2341
+ }, Fo = (t) => {
2342
+ switch (t) {
2343
+ case "main":
2344
+ return "settings.title";
2345
+ case "signaling":
2346
+ return "settings.signaling.title";
2347
+ case "transport":
2348
+ return "settings.transport.title";
2349
+ }
2350
+ }, zo = ({
2351
+ onTitleChange: t,
2352
+ navigationRef: e
2353
+ }) => {
2354
+ const {
2355
+ screen: r,
2356
+ previousScreen: n,
2357
+ isTransitioning: o,
2358
+ navigate: a,
2359
+ goBack: i,
2360
+ isAtRoot: l
2361
+ } = Ao("main"), c = G({ goBack: i, isAtRoot: l });
2362
+ return c.current = { goBack: i, isAtRoot: l }, I(() => {
2363
+ e && (e.current = c.current);
2364
+ }, [e, i, l]), I(() => {
2365
+ t?.(Fo(r));
2366
+ }, [r, t]), /* @__PURE__ */ s("div", { className: "px-4 pb-2", children: /* @__PURE__ */ s(
2367
+ To,
2368
+ {
2369
+ current: r,
2370
+ previous: n,
2371
+ isTransitioning: o,
2372
+ render: (d) => {
2373
+ switch (d) {
2374
+ case "main":
2375
+ return /* @__PURE__ */ v(ht, { children: [
2376
+ /* @__PURE__ */ s(Bo, { onNavigate: a }),
2377
+ /* @__PURE__ */ s(Lo, {})
2378
+ ] });
2379
+ case "signaling":
2380
+ return /* @__PURE__ */ s(Vo, {});
2381
+ case "transport":
2382
+ return /* @__PURE__ */ s(Mo, {});
2383
+ }
2384
+ }
2385
+ }
2386
+ ) });
2387
+ }, Uo = () => {
2388
+ const [t, e] = P("start"), [r, n] = P(!1);
2389
+ return I(() => {
2390
+ if (!r) return;
2391
+ const o = window.setTimeout(() => n(!1), 2e3);
2392
+ return () => window.clearTimeout(o);
2393
+ }, [r]), {
2394
+ view: t,
2395
+ setView: e,
2396
+ copied: r,
2397
+ setCopied: n
2398
+ };
2399
+ }, Wo = (t) => {
2400
+ I(() => {
2401
+ const e = (r) => {
2402
+ r.key === "Escape" && t();
2403
+ };
2404
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
2405
+ }, [t]);
2406
+ }, Go = () => {
2407
+ const t = G(null), [e, r] = P(0), n = G(!1), o = K(
2408
+ (a, i = !1) => {
2409
+ const l = a || t.current;
2410
+ if (!l) return;
2411
+ const c = i ? l.scrollHeight : l.getBoundingClientRect().height;
2412
+ c > 0 && (r(
2413
+ (u) => typeof u == "number" && Math.abs(u - c) < 0.5 ? u : c
2414
+ ), n.current = !0);
2415
+ },
2416
+ []
2417
+ );
2418
+ return yt(() => {
2419
+ const a = t.current;
2420
+ if (!a || typeof ResizeObserver > "u") return;
2421
+ const i = new ResizeObserver(() => {
2422
+ o();
2423
+ });
2424
+ return i.observe(a), () => i.disconnect();
2425
+ }, [o]), I(() => {
2426
+ if (typeof window > "u") return;
2427
+ const a = () => {
2428
+ o();
2429
+ };
2430
+ return window.addEventListener("resize", a), () => window.removeEventListener("resize", a);
2431
+ }, [o]), {
2432
+ contentRef: t,
2433
+ height: e,
2434
+ measureHeight: o,
2435
+ setHeight: r
2436
+ };
2437
+ }, Ko = ({
2438
+ onClose: t,
2439
+ onCopy: e
2440
+ }) => {
2441
+ const { view: r, setView: n, copied: o, setCopied: a } = Uo(), { uri: i } = Lt(), { status: l, provider: c } = Ot(), { contentRef: u, height: d, measureHeight: p } = Go(), {
2442
+ current: k,
2443
+ previous: m,
2444
+ isTransitioning: y
2445
+ } = se(r), {
2446
+ current: E,
2447
+ previous: f,
2448
+ isTransitioning: x
2449
+ } = se(l), g = K(() => n("settings"), [n]), { t: h, isRtl: D } = H(), { themeMode: _ } = fr(), J = G(null), [Kt, Ht] = P("settings.title"), xt = $(r).with("start", () => h("start.title")).with("settings", () => h(Kt)).with("info", () => h("info.title")).exhaustive();
2450
+ Wo(t), I(() => {
2451
+ l === ct.CONNECTED && t();
2452
+ }, [l, t]);
2453
+ const Pt = K(async () => {
2454
+ i && await mo(i) && a(!0);
2455
+ }, [i, a]), kt = G(!0), st = G(), lt = G(void 0), [C, N] = P(!1), w = G();
2456
+ yt(() => {
2457
+ if (u.current)
2458
+ return kt.current ? (st.current && window.clearTimeout(st.current), st.current = window.setTimeout(() => {
2459
+ u.current && (p(void 0, !0), kt.current = !1);
2460
+ }, 0)) : p(), () => {
2461
+ st.current && window.clearTimeout(st.current);
2462
+ };
2463
+ }, [p, E, k]), I(() => (lt.current !== void 0 && d !== lt.current && d > 0 && lt.current > 0 && Math.abs(d - lt.current) > 0.5 && (N(!0), w.current && window.clearTimeout(w.current), w.current = window.setTimeout(() => {
2464
+ N(!1), w.current = void 0;
2465
+ }, 200)), lt.current = d, () => {
2466
+ w.current && window.clearTimeout(w.current);
2467
+ }), [d]);
2468
+ const A = () => {
2469
+ c?.closeSession();
2470
+ }, T = $({ view: r, status: l }).with({ view: "start", status: ct.STANDBY }, () => {
2471
+ }).with({ view: "start" }, () => A).with({ view: "settings" }, () => J.current && !J.current.isAtRoot ? () => J.current?.goBack() : () => n("start")).with({ view: "info" }, () => () => n("start")).otherwise(() => () => {
2472
+ A(), t();
2473
+ }), R = (j) => $(j).with("start", () => /* @__PURE__ */ s(ho, { onSettings: g })).with("settings", () => /* @__PURE__ */ s(
2474
+ zo,
2475
+ {
2476
+ onTitleChange: Ht,
2477
+ navigationRef: J
2478
+ }
2479
+ )).with("info", () => /* @__PURE__ */ s(vo, {})).otherwise(() => /* @__PURE__ */ s(ne, { state: j })), F = () => /* @__PURE__ */ v("div", { className: "modal-transition__container", children: [
2480
+ m && /* @__PURE__ */ s("div", { className: "modal-transition__layer modal-transition__layer--outgoing", children: R(m) }),
2481
+ /* @__PURE__ */ s(
2482
+ "div",
2483
+ {
2484
+ className: at(
2485
+ "modal-transition__layer",
2486
+ y && "modal-transition__layer--incoming"
2487
+ ),
2488
+ children: R(k)
2489
+ }
2490
+ )
2491
+ ] }), Q = (j) => $(j).with(ct.STANDBY, () => F()).with(
2492
+ He.union(
2493
+ ct.CREATING,
2494
+ ct.CONNECTING,
2495
+ ct.CONNECTED
2496
+ ),
2497
+ () => /* @__PURE__ */ s(mn, { onClose: t, onCopy: e || Pt })
2498
+ ).otherwise((q) => /* @__PURE__ */ s(ne, { state: q || "unknown status" }));
2499
+ de("view", r);
2500
+ const z = {
2501
+ background: "var(--lv-overlay-background, rgba(0,0,0,0.3))",
2502
+ backdropFilter: "var(--lv-overlay-backdrop-filter, blur(4px))"
2503
+ }, X = {
2504
+ background: "var(--lv-body-background)",
2505
+ color: "var(--lv-body-color, var(--lv-text-primary))",
2506
+ borderRadius: "var(--lv-border-radius, 16px)",
2507
+ boxShadow: "var(--lv-modal-shadow, 0px 12px 32px rgba(0,0,0,0.25))"
2508
+ };
2509
+ return /* @__PURE__ */ s(
2510
+ "div",
2511
+ {
2512
+ className: "fixed inset-0 z-10000 flex animate-[bg-in_0.15s_ease-in-out] items-end justify-center font-sans md:items-center lg:p-4",
2513
+ onClick: t,
2514
+ role: "presentation",
2515
+ "data-openlv-modal-root": !0,
2516
+ "data-openlv-theme-mode": _,
2517
+ dir: D ? "rtl" : "ltr",
2518
+ style: z,
2519
+ children: /* @__PURE__ */ v(
2520
+ "div",
2521
+ {
2522
+ className: at(
2523
+ "relative w-full max-w-[400px] animate-[fade-in_0.15s_ease-in-out] transition-[height] duration-200 ease-out",
2524
+ C || f ? "overflow-hidden" : void 0
2525
+ ),
2526
+ role: "dialog",
2527
+ "aria-modal": "true",
2528
+ "aria-label": xt,
2529
+ onClick: (j) => j.stopPropagation(),
2530
+ style: {
2531
+ ...typeof d == "number" && d > 0 ? { height: `${d}px` } : {},
2532
+ ...X
2533
+ },
2534
+ children: [
2535
+ /* @__PURE__ */ v("div", { ref: u, children: [
2536
+ /* @__PURE__ */ s(
2537
+ So,
2538
+ {
2539
+ title: xt,
2540
+ view: r,
2541
+ onClose: t,
2542
+ onBack: T,
2543
+ setView: n
2544
+ }
2545
+ ),
2546
+ /* @__PURE__ */ v("div", { className: "modal-transition__container", children: [
2547
+ f && /* @__PURE__ */ s("div", { className: "modal-transition__layer modal-transition__layer--outgoing absolute", children: /* @__PURE__ */ s("div", { className: "flex flex-col text-center", children: Q(f) }) }),
2548
+ /* @__PURE__ */ s(
2549
+ "div",
2550
+ {
2551
+ className: at(
2552
+ "modal-transition__layer",
2553
+ x && "modal-transition__layer--incoming"
2554
+ ),
2555
+ children: /* @__PURE__ */ s("div", { className: "flex flex-col text-center", children: Q(E) })
2556
+ }
2557
+ )
2558
+ ] }),
2559
+ /* @__PURE__ */ s(wo, {})
2560
+ ] }),
2561
+ /* @__PURE__ */ s(
2562
+ "div",
2563
+ {
2564
+ className: at(
2565
+ "absolute top-5 rounded-lg bg-blue-500 px-4 py-3 font-medium text-sm text-white transition-all ltr:right-5 rtl:left-5",
2566
+ o ? "translate-x-0 opacity-100" : "opacity-0 ltr:translate-x-full rtl:-translate-x-full"
2567
+ ),
2568
+ children: h("modal.urlCopied")
2569
+ }
2570
+ )
2571
+ ]
2572
+ }
2573
+ )
2574
+ }
2575
+ );
2576
+ }, Ho = ({ onClose: t = () => {
2577
+ }, onCopy: e }) => /* @__PURE__ */ s(Ko, { onClose: t, onCopy: e }), $o = (t = "idle") => {
2578
+ const [e, r] = P({
2579
+ state: t
2580
+ }), n = K(
2581
+ (i, l) => {
2582
+ r((c) => ({
2583
+ ...c,
2584
+ state: i,
2585
+ ...l
2586
+ }));
2587
+ },
2588
+ []
2589
+ ), o = K((i) => {
2590
+ r(i);
2591
+ }, []), a = K(() => {
2592
+ r({ state: "idle" });
2593
+ }, []);
2594
+ return {
2595
+ connectionInfo: e,
2596
+ updateState: n,
2597
+ updateConnectionInfo: o,
2598
+ reset: a
2599
+ };
2600
+ }, Jo = (t = "openlv-modal") => {
2601
+ if (typeof window > "u")
2602
+ return t;
2603
+ const e = window.customElements;
2604
+ return e ? (e.get(t) || e.define(
2605
+ t,
2606
+ Xe
2607
+ ), t) : (console.warn(
2608
+ "OpenLV modal: custom elements are not supported in this environment."
2609
+ ), t);
2610
+ }, ta = (t) => {
2611
+ const e = document.querySelector("openlv-modal");
2612
+ if (e && e.remove(), !e) {
2613
+ Jo();
2614
+ const r = new Xe({
2615
+ onClose() {
2616
+ de("modal closed"), r.remove(), t.onClose?.();
2617
+ },
2618
+ provider: t.provider,
2619
+ theme: t.theme
2620
+ });
2621
+ document.body.appendChild(r), r.showModal();
2622
+ }
2623
+ };
2624
+ export {
2625
+ Ho as ModalRoot,
2626
+ bo as OPENLV_ICON_128,
2627
+ Xe as OpenLVModalElement,
2628
+ Xe as default,
2629
+ Jo as registerOpenLVModal,
2630
+ ta as triggerOpenModal,
2631
+ $o as useConnectionState
2632
+ };
2633
+ //# sourceMappingURL=index.es.js.map