@openlv/modal 0.0.1-beta.7 → 0.0.1-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,9 @@
1
- export declare const Header: ({ title, view, onClose, onBack, }: {
1
+ import { Dispatch, StateUpdater } from 'preact/hooks';
2
+ import { ModalView } from './ModalRoot.js';
3
+ export declare const Header: ({ title, view, onClose, onBack, setView, }: {
2
4
  title: string;
3
- view: "start" | "uri" | "settings";
5
+ view: ModalView;
4
6
  onClose: () => void;
5
7
  onBack?: () => void;
8
+ setView: Dispatch<StateUpdater<ModalView>>;
6
9
  }) => import("preact").JSX.Element;
@@ -5,4 +5,5 @@ export interface ModalRootProps {
5
5
  onStartConnection?: () => void;
6
6
  onCopy?: (uri: string) => void;
7
7
  }
8
+ export type ModalView = "start" | "settings" | "info";
8
9
  export declare const ModalRoot: ({ onClose, onCopy }: ModalRootProps) => import("preact").JSX.Element;
package/dist/context.d.ts CHANGED
@@ -1,14 +1,9 @@
1
1
  import { OpenLVProvider } from '@openlv/provider';
2
2
  import { FC } from 'preact/compat';
3
- import { ThemeConfig } from './theme/index.js';
3
+ import { OpenLVModalElementProps } from './element.js';
4
4
  export type ProviderContextO = {
5
5
  provider: OpenLVProvider | undefined;
6
6
  };
7
7
  export declare const ModalContext: import('preact').Context<ProviderContextO>;
8
- export type ModalProviderProps = {
9
- provider: OpenLVProvider;
10
- theme?: ThemeConfig;
11
- onClose?: () => void;
12
- };
13
- export declare const ModalProvider: FC<ModalProviderProps>;
8
+ export declare const ModalProvider: FC<OpenLVModalElementProps>;
14
9
  export declare const useModalContext: () => ProviderContextO;
package/dist/element.d.ts CHANGED
@@ -1,13 +1,16 @@
1
1
  import { OpenLVProvider } from '@openlv/provider';
2
- import { ThemeConfig } from './theme/index.js';
2
+ import { ThemeConfig } from './theme/types.js';
3
3
  import { ModalConnectionInterface } from './types/connection.js';
4
- export declare class OpenLVModalElement extends HTMLElement implements ModalConnectionInterface {
5
- onClose?: () => void;
4
+ export type OpenLVModalElementProps = {
6
5
  provider: OpenLVProvider;
7
- theme: ThemeConfig;
6
+ onClose?: () => void;
7
+ theme?: ThemeConfig;
8
+ };
9
+ export declare class OpenLVModalElement extends HTMLElement implements ModalConnectionInterface {
8
10
  private readonly shadow;
9
11
  private renderRequested;
10
- constructor(_provider: OpenLVProvider, _theme?: ThemeConfig, _onClose?: () => void);
12
+ private readonly parameters;
13
+ constructor(parameters: OpenLVModalElementProps);
11
14
  connectedCallback(): void;
12
15
  disconnectedCallback(): void;
13
16
  showModal(): void;
@@ -0,0 +1 @@
1
+ export declare const InfoScreen: () => import("preact").JSX.Element;
package/dist/index.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";var Gt=Object.defineProperty;var Ht=(e,t,r)=>t in e?Gt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ne=(e,t,r)=>Ht(e,typeof t!="symbol"?t+"":t,r);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("preact/jsx-runtime"),d=require("preact/hooks"),p=require("preact"),Wt=require("qrcode-generator");function Kt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Ut=Kt(Wt),Jt=1,Xt=e=>{const t=new URLSearchParams;return t.set("h",e.h),t.set("k",e.k),e.p&&t.set("p",e.p),e.s&&t.set("s",e.s),`openlv://${e.sessionId}@${Jt}?${t.toString()}`};function qt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fe={exports:{}},Ze;function Qt(){return Ze||(Ze=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function o(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function a(c,u,f,v,N){if(typeof f!="function")throw new TypeError("The listener must be a function");var m=new o(f,v||c,N),C=r?r+u:u;return c._events[C]?c._events[C].fn?c._events[C]=[c._events[C],m]:c._events[C].push(m):(c._events[C]=m,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,v;if(this._eventsCount===0)return u;for(v in f=this._events)t.call(f,v)&&u.push(r?v.slice(1):v);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=r?r+u:u,v=this._events[f];if(!v)return[];if(v.fn)return[v.fn];for(var N=0,m=v.length,C=new Array(m);N<m;N++)C[N]=v[N].fn;return C},l.prototype.listenerCount=function(u){var f=r?r+u:u,v=this._events[f];return v?v.fn?1:v.length:0},l.prototype.emit=function(u,f,v,N,m,C){var T=r?r+u:u;if(!this._events[T])return!1;var h=this._events[T],B=arguments.length,R,b;if(h.fn){switch(h.once&&this.removeListener(u,h.fn,void 0,!0),B){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,f),!0;case 3:return h.fn.call(h.context,f,v),!0;case 4:return h.fn.call(h.context,f,v,N),!0;case 5:return h.fn.call(h.context,f,v,N,m),!0;case 6:return h.fn.call(h.context,f,v,N,m,C),!0}for(b=1,R=new Array(B-1);b<B;b++)R[b-1]=arguments[b];h.fn.apply(h.context,R)}else{var ae=h.length,O;for(b=0;b<ae;b++)switch(h[b].once&&this.removeListener(u,h[b].fn,void 0,!0),B){case 1:h[b].fn.call(h[b].context);break;case 2:h[b].fn.call(h[b].context,f);break;case 3:h[b].fn.call(h[b].context,f,v);break;case 4:h[b].fn.call(h[b].context,f,v,N);break;default:if(!R)for(O=1,R=new Array(B-1);O<B;O++)R[O-1]=arguments[O];h[b].fn.apply(h[b].context,R)}}return!0},l.prototype.on=function(u,f,v){return a(this,u,f,v,!1)},l.prototype.once=function(u,f,v){return a(this,u,f,v,!0)},l.prototype.removeListener=function(u,f,v,N){var m=r?r+u:u;if(!this._events[m])return this;if(!f)return s(this,m),this;var C=this._events[m];if(C.fn)C.fn===f&&(!N||C.once)&&(!v||C.context===v)&&s(this,m);else{for(var T=0,h=[],B=C.length;T<B;T++)(C[T].fn!==f||N&&!C[T].once||v&&C[T].context!==v)&&h.push(C[T]);h.length?this._events[m]=h.length===1?h[0]:h:s(this,m)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=r?r+u:u,this._events[f]&&s(this,f)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(Fe)),Fe.exports}Qt();const P=Symbol.for("@ts-pattern/matcher"),ht=Symbol.for("@ts-pattern/isVariadic"),we="@ts-pattern/anonymous-select-key",Re=e=>!!(e&&typeof e=="object"),be=e=>e&&!!e[P],E=(e,t,r)=>{if(be(e)){const n=e[P](),{matched:o,selections:a}=n.match(t);return o&&a&&Object.keys(a).forEach(s=>r(s,a[s])),o}if(Re(e)){if(!Re(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],o=[],a=[];for(const s of e.keys()){const l=e[s];be(l)&&l[ht]?a.push(l):a.length?o.push(l):n.push(l)}if(a.length){if(a.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+o.length)return!1;const s=t.slice(0,n.length),l=o.length===0?[]:t.slice(-o.length),c=t.slice(n.length,o.length===0?1/0:-o.length);return n.every((u,f)=>E(u,s[f],r))&&o.every((u,f)=>E(u,l[f],r))&&(a.length===0||E(a[0],c,r))}return e.length===t.length&&e.every((s,l)=>E(s,t[l],r))}return Reflect.ownKeys(e).every(n=>{const o=e[n];return(n in t||be(a=o)&&a[P]().matcherType==="optional")&&E(o,t[n],r);var a})}return Object.is(t,e)},D=e=>{var t,r,n;return Re(e)?be(e)?(t=(r=(n=e[P]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?de(e,D):de(Object.values(e),D):[]},de=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function Yt(...e){if(e.length===1){const[t]=e;return r=>E(t,r,()=>{})}if(e.length===2){const[t,r]=e;return E(t,r,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function F(e){return Object.assign(e,{optional:()=>Ge(e),and:t=>_(e,t),or:t=>gt(e,t),select:t=>t===void 0?fe(e):fe(t,e)})}function De(e){return Object.assign((t=>Object.assign(t,{[Symbol.iterator](){let r=0;const n=[{value:Object.assign(t,{[ht]:!0}),done:!1},{done:!0,value:void 0}];return{next:()=>{var o;return(o=n[r++])!=null?o:n.at(-1)}}}}))(e),{optional:()=>De(Ge(e)),select:t=>De(t===void 0?fe(e):fe(t,e))})}function Ge(e){return F({[P]:()=>({match:t=>{let r={};const n=(o,a)=>{r[o]=a};return t===void 0?(D(e).forEach(o=>n(o,void 0)),{matched:!0,selections:r}):{matched:E(e,t,n),selections:r}},getSelectionKeys:()=>D(e),matcherType:"optional"})})}const Zt=(e,t)=>{for(const r of e)if(!t(r))return!1;return!0},$t=(e,t)=>{for(const[r,n]of e.entries())if(!t(n,r))return!1;return!0},er=(e,t)=>{const r=Reflect.ownKeys(e);for(const n of r)if(!t(n,e[n]))return!1;return!0};function _(...e){return F({[P]:()=>({match:t=>{let r={};const n=(o,a)=>{r[o]=a};return{matched:e.every(o=>E(o,t,n)),selections:r}},getSelectionKeys:()=>de(e,D),matcherType:"and"})})}function gt(...e){return F({[P]:()=>({match:t=>{let r={};const n=(o,a)=>{r[o]=a};return de(e,D).forEach(o=>n(o,void 0)),{matched:e.some(o=>E(o,t,n)),selections:r}},getSelectionKeys:()=>de(e,D),matcherType:"or"})})}function g(e){return{[P]:()=>({match:t=>({matched:!!e(t)})})}}function fe(...e){const t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return F({[P]:()=>({match:n=>{let o={[t??we]:n};return{matched:r===void 0||E(r,n,(a,s)=>{o[a]=s}),selections:o}},getSelectionKeys:()=>[t??we].concat(r===void 0?[]:D(r))})})}function mt(e){return!0}function L(e){return typeof e=="number"}function X(e){return typeof e=="string"}function q(e){return typeof e=="bigint"}const bt=F(g(mt)),tr=F(g(mt)),rr=bt,Q=e=>Object.assign(F(e),{startsWith:t=>{return Q(_(e,(r=t,g(n=>X(n)&&n.startsWith(r)))));var r},endsWith:t=>{return Q(_(e,(r=t,g(n=>X(n)&&n.endsWith(r)))));var r},minLength:t=>Q(_(e,(r=>g(n=>X(n)&&n.length>=r))(t))),length:t=>Q(_(e,(r=>g(n=>X(n)&&n.length===r))(t))),maxLength:t=>Q(_(e,(r=>g(n=>X(n)&&n.length<=r))(t))),includes:t=>{return Q(_(e,(r=t,g(n=>X(n)&&n.includes(r)))));var r},regex:t=>{return Q(_(e,(r=t,g(n=>X(n)&&!!n.match(r)))));var r}}),$e=Q(g(X)),z=e=>Object.assign(F(e),{between:(t,r)=>z(_(e,((n,o)=>g(a=>L(a)&&n<=a&&o>=a))(t,r))),lt:t=>z(_(e,(r=>g(n=>L(n)&&n<r))(t))),gt:t=>z(_(e,(r=>g(n=>L(n)&&n>r))(t))),lte:t=>z(_(e,(r=>g(n=>L(n)&&n<=r))(t))),gte:t=>z(_(e,(r=>g(n=>L(n)&&n>=r))(t))),int:()=>z(_(e,g(t=>L(t)&&Number.isInteger(t)))),finite:()=>z(_(e,g(t=>L(t)&&Number.isFinite(t)))),positive:()=>z(_(e,g(t=>L(t)&&t>0))),negative:()=>z(_(e,g(t=>L(t)&&t<0)))}),nr=z(g(L)),Y=e=>Object.assign(F(e),{between:(t,r)=>Y(_(e,((n,o)=>g(a=>q(a)&&n<=a&&o>=a))(t,r))),lt:t=>Y(_(e,(r=>g(n=>q(n)&&n<r))(t))),gt:t=>Y(_(e,(r=>g(n=>q(n)&&n>r))(t))),lte:t=>Y(_(e,(r=>g(n=>q(n)&&n<=r))(t))),gte:t=>Y(_(e,(r=>g(n=>q(n)&&n>=r))(t))),positive:()=>Y(_(e,g(t=>q(t)&&t>0))),negative:()=>Y(_(e,g(t=>q(t)&&t<0)))}),or=Y(g(q)),ar=F(g(function(e){return typeof e=="boolean"})),ir=F(g(function(e){return typeof e=="symbol"})),sr=F(g(function(e){return e==null})),lr=F(g(function(e){return e!=null}));var yt={__proto__:null,matcher:P,optional:Ge,array:function(...e){return De({[P]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const r=e[0];let n={};if(t.length===0)return D(r).forEach(a=>{n[a]=[]}),{matched:!0,selections:n};const o=(a,s)=>{n[a]=(n[a]||[]).concat([s])};return{matched:t.every(a=>E(r,a,o)),selections:n}},getSelectionKeys:()=>e.length===0?[]:D(e[0])})})},set:function(...e){return F({[P]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};if(e.length===0)return{matched:!0};const n=(a,s)=>{r[a]=(r[a]||[]).concat([s])},o=e[0];return{matched:Zt(t,a=>E(o,a,n)),selections:r}},getSelectionKeys:()=>e.length===0?[]:D(e[0])})})},map:function(...e){return F({[P]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};const n=(l,c)=>{r[l]=(r[l]||[]).concat([c])};if(e.length===0)return{matched:!0};var o;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(o=e[0])==null?void 0:o.toString()}`);const[a,s]=e;return{matched:$t(t,(l,c)=>{const u=E(a,c,n),f=E(s,l,n);return u&&f}),selections:r}},getSelectionKeys:()=>e.length===0?[]:[...D(e[0]),...D(e[1])]})})},record:function(...e){return F({[P]:()=>({match:t=>{if(t===null||typeof t!="object"||Array.isArray(t))return{matched:!1};var r;if(e.length===0)throw new Error(`\`P.record\` wasn't given enough arguments. Expected (value) or (key, value), received ${(r=e[0])==null?void 0:r.toString()}`);let n={};const o=(l,c)=>{n[l]=(n[l]||[]).concat([c])},[a,s]=e.length===1?[$e,e[0]]:e;return{matched:er(t,(l,c)=>{const u=typeof l!="string"||Number.isNaN(Number(l))?null:Number(l),f=u!==null&&E(a,u,o),v=E(a,l,o),N=E(s,c,o);return(v||f)&&N}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...D(e[0]),...D(e[1])]})})},intersection:_,union:gt,not:function(e){return F({[P]:()=>({match:t=>({matched:!E(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:g,select:fe,any:bt,unknown:tr,_:rr,string:$e,number:nr,bigint:or,boolean:ar,symbol:ir,nullish:sr,nonNullable:lr,instanceOf:function(e){return F(g((function(t){return r=>r instanceof t})(e)))},shape:function(e){return F(g(Yt(e)))}};let cr=class extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}};const Pe={matched:!1,value:void 0};function K(e){return new ur(e,Pe)}let ur=class Ie{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;const r=t[t.length-1],n=[t[0]];let o;t.length===3&&typeof t[1]=="function"?o=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let a=!1,s={};const l=(u,f)=>{a=!0,s[u]=f},c=!n.some(u=>E(u,this.input,l))||o&&!o(this.input)?Pe:{matched:!0,value:r(a?we in s?s[we]:s:this.input,this.input)};return new Ie(this.input,c)}when(t,r){if(this.state.matched)return this;const n=!!t(this.input);return new Ie(this.input,n?{matched:!0,value:r(this.input,this.input)}:Pe)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(t=dr){return this.state.matched?this.state.value:t(this.input)}run(){return this.exhaustive()}returnType(){return this}narrow(){return this}};function dr(e){throw new cr(e)}const oe={STANDBY:"standby",CONNECTING:"connecting",READY:"ready",HANDSHAKE:"handshake",HANDSHAKE_PARTIAL:"handshake-partial",ENCRYPTED:"encrypted"},le={CREATED:"created",SIGNALING:"signaling",READY:"ready",CONNECTED:"connected",DISCONNECTED:"disconnected"},$={STANDBY:"standby",CREATING:"creating",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error"};var Oe={exports:{}};var et;function fr(){return et||(et=1,(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var a="",s=0;s<arguments.length;s++){var l=arguments[s];l&&(a=o(a,n(l)))}return a}function n(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return r.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var s="";for(var l in a)t.call(a,l)&&a[l]&&(s=o(s,l));return s}function o(a,s){return s?a?a+" "+s:a+s:a}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Oe)),Oe.exports}var pr=fr();const ee=qt(pr),He={light:{font:{family:"Inter, sans-serif"},body:{color:"#0F172A",background:"#FFFFFF"},border:{radius:"16px"},overlay:{background:"rgba(0, 0, 0, 0.10)",backdrop:{filter:"blur(6px)"}},modal:{shadow:"0px 12px 32px rgba(15,23,42,0.10)"},control:{input:{background:"#FFFFFF",border:"#E2E8F0",text:"#0F172A"},button:{primary:{background:"#FF6A00",color:"#FFFFFF",padding:"8px 16px",hoverBackground:"#FF7D1F",activeBackground:"#E76200",disabledBackground:"#CBD5E1",disabledColor:"#475569",border:"#FF6A00"},secondary:{background:"#E2E8F0",color:"#0F172A",hoverBackground:"#CBD5E1",activeBackground:"#94A3B8",disabledBackground:"#F1F5F9",disabledColor:"#94A3B8",border:"#E2E8F0"},tertiary:{color:"#475569",hoverBackground:"#F1F5F9",activeBackground:"#E2E8F0",disabledColor:"#94A3B8"}}},qr:{background:"#FFFFFF",color:"#0F172A"},card:{background:"#F5F5F5"},text:{primary:"#0F172A",secondary:"#475569",muted:"#94A3B8"}},dark:{font:{family:"Inter, sans-serif"},body:{color:"#F3F4F6",background:"#16181D"},border:{radius:"16px",color:"#2F343C",width:"1px"},overlay:{background:"rgba(0,0,0,0.55)",backdrop:{filter:"blur(8px)"}},modal:{shadow:"0px 22px 60px rgba(0,0,0,0.55)"},control:{input:{background:"#12151A",border:"#2F343C",text:"#E8EAED"},button:{primary:{background:"#FF6A00",color:"#0D0E12",padding:"8px 16px",hoverBackground:"#FF7D1F",activeBackground:"#E76200",disabledBackground:"#2A2F36",disabledColor:"#8E949C",border:"#FF6A00"},secondary:{background:"#262A31",color:"#E8EAED",hoverBackground:"#2D323A",activeBackground:"#23272E",disabledBackground:"#1D2026",disabledColor:"#8E949C",border:"#333843"},tertiary:{color:"#A4A9B1",hoverBackground:"#20242A",activeBackground:"#1B1F24",disabledColor:"#6F747B"}}},qr:{background:"#FFFFFF",color:"#0D0E12"},card:{background:"#1E2127"},text:{primary:"#F3F4F6",secondary:"#C8CCD2",muted:"#9AA0A9"}}},vr={light:{font:{family:"sans-serif"},body:{color:"#1E293B",background:"#FFFFFF"},border:{radius:"16px"},overlay:{background:"rgba(0, 0, 0, 0.3)",backdrop:{filter:"blur(8px)"}},modal:{shadow:"0px 12px 32px rgba(0, 0, 0, 0.25)"},control:{input:{background:"#FFFFFF",border:"#D1D5DC",text:"#111827"},button:{primary:{background:"#3B82F6",color:"#FFFFFF",padding:"8px 16px",hoverBackground:"#2563EB",activeBackground:"#1D4ED8",disabledBackground:"#E5E7EB",disabledColor:"#9CA3AF",border:"#3B82F6"},secondary:{background:"#E5E7EB",color:"#374151",hoverBackground:"#D1D5DC",activeBackground:"#D1D5DB",disabledBackground:"#F9FAFB",disabledColor:"#9CA3AF",border:"#D1D5DC",selectedBackground:"#EFF6FF",selectedColor:"#155dfc"},tertiary:{color:"#6B7280",hoverBackground:"#E5E5E5",activeBackground:"#D1D5DB",disabledColor:"#9CA3AF"}}},qr:{background:"#F9FAFB",color:"#111827"},card:{background:"#F5F5F5"},text:{primary:"#111827",secondary:"#374151",muted:"#6B7280",heading:"#111827",body:"#6a7282"}}},wt=(e,t,r)=>{for(const[n,o]of Object.entries(r))o&&typeof o=="object"?wt(e,[...t,n],o):typeof o=="string"&&e.set(`--lv-${[...t,n].join("-")}`,o)},We=e=>{const t=new Map;e&&wt(t,[],e);const r=(a,s)=>{const l=t.get(a);l!==void 0&&!t.has(s)&&t.set(s,l)},n=["primary","secondary","tertiary"],o=["background","color","border","hoverBackground","activeBackground","disabledBackground","disabledColor","selectedBackground","selectedColor"];for(const a of n)for(const s of o)r(`--lv-control-button-${a}-${s}`,`--lv-button-${a}-${s}`),r(`--lv-button-${a}-${s}`,`--lv-control-button-${a}-${s}`);return Object.fromEntries(t.entries())},pe={theme:"openlv",tokens:He,mode:"system"},hr={openlv:He,simple:vr},gr=e=>hr[e],mr=()=>typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",br=(e,t)=>{const r=e==="system"?[mr(),"light","dark"]:[e,"light","dark"];for(const n of r){const o=t[n];if(o)return{tokens:o,mode:n}}},Ke=e=>{const{theme:t,tokens:r}=e,n=r??gr(t),o=br(e.mode,n);if(!o)throw new Error("Invalid theme configuration: mode does not match tokens");return o},yr=({children:e,...t})=>{const{tokens:r,mode:n}=Ke(t);return i.jsx("div",{style:We(r),id:"root","data-openlv-theme":t.theme,"data-openlv-mode":n,children:e})},xt=p.createContext({provider:void 0}),wr=({provider:e,theme:t,onClose:r})=>{const n=t??pe;return i.jsx(xt.Provider,{value:{provider:e},children:i.jsx(yr,{...n,children:i.jsx(Lt,{onClose:r})})})},xr=()=>{const e=d.useContext(xt);if(!e.provider)throw new Error("Provider not found");return e},ve=()=>{const{provider:e}=xr(),[t,r]=d.useState(e?.getState().status||$.ERROR);if(d.useEffect(()=>{const n=o=>{r(o)};return e?.on("status_change",n),()=>{e?.off("status_change",n)}},[e]),!e)throw new Error("Provider not found");return{provider:e,status:t}},Ue=(...e)=>console.log("%c[modal]%c","color: yellow; font-weight: bold","color: inherit; font-weight: normal",...e),kt=(e,t,r)=>{d.useEffect(()=>(e?.on(t,r),()=>{e?.off(t,r)}),[e,t])},Je=()=>{const{provider:e}=ve(),[t,r]=d.useState(e?.storage.getSettings());kt(e?.storage.emitter,"settings_change",l=>{r(l)});const n=l=>{if(!t||t.signaling?.p===l)return;const c={...t,signaling:{...t.signaling,p:l}};r(c),e?.storage.setSettings(c)},o=l=>{if(!t||t.signaling?.s[t.signaling?.p]===l)return;const c={...t,signaling:{...t.signaling,s:{...t.signaling.s,[t.signaling.p]:l}}};r(c),e?.storage.setSettings(c)},a=l=>{t&&(r({...t,retainHistory:l}),e?.storage.setSettings({...t,retainHistory:l}))},s=l=>{t&&(r({...t,autoReconnect:l}),e?.storage.setSettings({...t,autoReconnect:l}))};if(!t)throw new Error("Settings not found");return{settings:t,updateSignalingProtocol:n,updateSignalingServer:o,updateRetainHistory:a,updateAutoReconnect:s}},he=()=>{const{provider:e}=ve(),[t,r]=d.useState(e?.getSession()),n=t?.getHandshakeParameters(),o=n?Xt(n):void 0,[a,s]=d.useState(t?.getState());return kt(t?.emitter,"state_change",l=>{Ue("session state change: ",l),s(l)}),d.useEffect(()=>{const l=()=>{const c=e?.getSession();c&&r(c)};return e?.on("status_change",l),()=>{e?.off("status_change",l)}},[e]),d.useEffect(()=>{const l=c=>{r(c),s(c.getState())};return e?.on("session_started",l),()=>{e?.off("session_started",l)}},[e]),d.useEffect(()=>{t&&s(t.getState())},[t]),{uri:o,status:a}},kr=()=>{const{provider:e}=ve(),{settings:t}=Je();return{start:()=>{const r=t?.signaling?.p,n=t?.signaling?.s[r];if(!r||!n)throw new Error("Invalid protocol or server");return e?.createSession({p:r,s:n})}}},Ve=({state:e})=>{const{status:t,uri:r}=he(),{status:n}=ve();return console.error("Unknown state: ",{state:e,sessionStatus:t,providerStatus:n}),i.jsxs("div",{className:"rounded-md p-2",style:{backgroundColor:"var(--lv-button-secondary-background)",color:"var(--lv-text-muted)"},children:[i.jsxs("div",{children:["Unknown state: ",JSON.stringify(e)]}),i.jsxs("div",{children:["URI: ",r]}),i.jsxs("div",{children:["Session Status: ",JSON.stringify(t)]}),i.jsxs("div",{children:["Provider Status: ",JSON.stringify(n)]})]})},Cr=({onCopy:e})=>{const{uri:t}=he(),r=d.useCallback(()=>{t&&e(t)},[t,e]),n=d.useCallback(l=>{const c=Ut.default,u=c(0,"M");return u.addData(l),u.make(),u.createSvgTag({cellSize:5,margin:0,scalable:!0})},[]),o="var(--lv-button-secondary-border)",a="var(--lv-qr-background)";return i.jsxs("div",{className:"flex flex-col items-center gap-4 px-2",children:[i.jsxs("div",{className:"w-full space-y-4 rounded-md p-4",style:{background:"var(--lv-card-background)",border:`1px solid ${o}`},children:[t&&i.jsx("div",{className:"relative mx-auto flex w-fit items-center justify-center rounded-lg p-4",style:{background:a,border:`1px solid ${o}`},children:i.jsx("button",{className:"h-[200px] w-[200px] cursor-pointer rounded",onClick:r,title:"Click to copy connection URL",dangerouslySetInnerHTML:{__html:n(t)},style:{background:a,color:"var(--lv-qr-color)"}})}),i.jsx("div",{className:"w-full",children:i.jsx("button",{type:"button",onClick:r,className:"w-full cursor-pointer rounded-lg px-4 py-2 text-sm transition bg-(--lv-button-secondary-background) hover:bg-(--lv-button-secondary-hoverBackground) active:bg-(--lv-button-secondary-activeBackground)",style:{color:"var(--lv-text-primary)",border:`1px solid ${o}`},children:"Copy Connection URL"})})]}),i.jsxs("div",{className:"w-full text-sm",style:{color:"var(--lv-text-secondary)"},children:[i.jsx("span",{children:"Scan the code above using your mobile wallet."}),i.jsx("br",{}),i.jsx("span",{children:"Or copy the link and paste it into your wallet."})]})]})},_r=()=>typeof document<"u"&&"startViewTransition"in document,Nr=e=>{_r()?document.startViewTransition(e):e()},tt=()=>i.jsx("div",{className:"flex items-center justify-center",children:i.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-blue-500 border-t-transparent"})}),A={CREATING:"creating",CONNECTING:"connecting",READY:"ready",CONFIRMING:"confirming",CONNECTED:"connected",DISCONNECTED:"disconnected",ERROR:"error"},Sr=e=>{const[t,r]=d.useState(e),n=d.useRef(e);return d.useEffect(()=>{e!==n.current&&Nr(()=>{r(e),n.current=e})},[e]),{displayState:t}},jr=e=>e?K(e).with({status:le.CREATED},()=>A.CREATING).with({status:le.SIGNALING,signaling:yt.select()},t=>K(t).with({state:oe.STANDBY},()=>A.CONNECTING).with({state:oe.CONNECTING},()=>A.CONNECTING).with({state:oe.READY},()=>A.READY).with({state:oe.HANDSHAKE},()=>A.CONFIRMING).with({state:oe.HANDSHAKE_PARTIAL},()=>A.CONFIRMING).with({state:oe.ENCRYPTED},()=>A.CONNECTED).otherwise(()=>A.CONNECTING)).with({status:le.READY},()=>A.READY).with({status:le.CONNECTED},()=>A.CONNECTED).with({status:le.DISCONNECTED},()=>A.DISCONNECTED).otherwise(()=>A.ERROR):A.CONNECTING,Er=({onClose:e,onCopy:t})=>{const{status:r}=he(),{displayState:n}=Sr(jr(r));return i.jsx("div",{style:{viewTransitionName:"connection-flow"},className:"w-full",children:K(n).with(A.CREATING,()=>i.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[i.jsx(tt,{}),i.jsxs("div",{className:"text-center",children:[i.jsx("h3",{className:"mb-2 font-semibold text-[var(--lv-text-primary)] text-lg",children:"Preparing connection"}),i.jsx("p",{className:"text-[var(--lv-text-muted)] text-sm",children:"Generating keys…"})]})]})).with(A.CONNECTING,()=>i.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[i.jsx(tt,{}),i.jsxs("div",{className:"text-center",children:[i.jsx("h3",{className:"mb-2 font-semibold text-[var(--lv-text-primary)] text-lg",children:"Connecting"}),i.jsx("p",{className:"text-[var(--lv-text-muted)] text-sm",children:"Waiting for network connection..."})]})]})).with(A.READY,()=>i.jsx(Cr,{onCopy:t})).with(A.CONFIRMING,()=>i.jsx("div",{className:"flex flex-col items-center gap-4 p-6",children:i.jsx("div",{className:"text-center",children:i.jsx("h3",{className:"mb-2 font-semibold text-[var(--lv-text-primary)] text-lg",children:"Establishing e2e encryption..."})})})).with(A.CONNECTED,()=>i.jsx("div",{className:"flex flex-col items-center gap-4 p-6",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mb-4 text-4xl",children:"✅"}),i.jsx("h3",{className:"mb-2 font-semibold text-[var(--lv-text-primary)] text-lg",children:"Connected Successfully!"}),i.jsx("p",{className:"text-[var(--lv-text-muted)] text-sm",children:"Your wallet is now connected and ready to use."})]})})).with(A.DISCONNECTED,()=>i.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mb-4 text-4xl",children:"🔌"}),i.jsx("h3",{className:"mb-2 font-semibold text-[var(--lv-text-primary)] text-lg",children:"Disconnected"}),i.jsx("p",{className:"mb-4 text-[var(--lv-text-muted)] text-sm",children:"The connection has been closed."})]}),i.jsx("button",{type:"button",onClick:e,className:"w-full rounded-lg bg-[var(--lv-button-secondary-background)] px-4 py-2 font-semibold text-[var(--lv-text-primary)] text-sm transition hover:bg-[var(--lv-button-primary-background-hover)]",children:"Close"})]})).otherwise(()=>i.jsx(Ve,{state:r}))})};function Ct(e,t){for(var r in t)e[r]=t[r];return e}function Me(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function _t(e,t){var r=t(),n=d.useState({t:{__:r,u:t}}),o=n[0].t,a=n[1];return d.useLayoutEffect(function(){o.__=r,o.u=t,Te(o)&&a({t:o})},[e,r,t]),d.useEffect(function(){return Te(o)&&a({t:o}),e(function(){Te(o)&&a({t:o})})},[e]),r}function Te(e){var t,r,n=e.u,o=e.__;try{var a=n();return!((t=o)===(r=a)&&(t!==0||1/t==1/r)||t!=t&&r!=r)}catch{return!0}}function Nt(e){e()}function St(e){return e}function jt(){return[!1,Nt]}var Et=d.useLayoutEffect;function Le(e,t){this.props=e,this.context=t}function Ar(e,t){function r(o){var a=this.props.ref,s=a==o.ref;return!s&&a&&(a.call?a(null):a.current=null),t?!t(this.props,o)||!s:Me(this.props,o)}function n(o){return this.shouldComponentUpdate=r,p.createElement(e,o)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n.type=e,n}(Le.prototype=new p.Component).isPureReactComponent=!0,Le.prototype.shouldComponentUpdate=function(e,t){return Me(this.props,e)||Me(this.state,t)};var rt=p.options.__b;p.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),rt&&rt(e)};var Fr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Or(e){function t(r){var n=Ct({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=Fr,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var nt=function(e,t){return e==null?null:p.toChildArray(p.toChildArray(e).map(t))},Tr={map:nt,forEach:nt,count:function(e){return e?p.toChildArray(e).length:0},only:function(e){var t=p.toChildArray(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:p.toChildArray},Br=p.options.__e;p.options.__e=function(e,t,r,n){if(e.then){for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),o.__c(e,t)}Br(e,t,r,n)};var ot=p.options.unmount;function At(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=Ct({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return At(n,t,r)})),e}function Ft(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Ft(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function ye(){this.__u=0,this.o=null,this.__b=null}function Ot(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Rr(e){var t,r,n,o=null;function a(s){if(t||(t=e()).then(function(l){l&&(o=l.default||l),n=!0},function(l){r=l,n=!0}),r)throw r;if(!n)throw t;return o?p.createElement(o,s):null}return a.displayName="Lazy",a.__f=!0,a}function ce(){this.i=null,this.l=null}p.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),ot&&ot(e)},(ye.prototype=new p.Component).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var o=Ot(n.__v),a=!1,s=function(){a||(a=!0,r.__R=null,o?o(l):l())};r.__R=s;var l=function(){if(!--n.__u){if(n.state.__a){var c=n.state.__a;n.__v.__k[0]=Ft(c,c.__c.__P,c.__c.__O)}var u;for(n.setState({__a:n.__b=null});u=n.o.pop();)u.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(s,s)},ye.prototype.componentWillUnmount=function(){this.o=[]},ye.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=At(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&p.createElement(p.Fragment,null,e.fallback);return o&&(o.__u&=-33),[p.createElement(p.Fragment,null,t.__a?null:e.children),o]};var at=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};function Dr(e){return this.getChildContext=function(){return e.context},e.children}function Pr(e){var t=this,r=e.h;if(t.componentWillUnmount=function(){p.render(null,t.v),t.v=null,t.h=null},t.h&&t.h!==r&&t.componentWillUnmount(),!t.v){for(var n=t.__v;n!==null&&!n.__m&&n.__!==null;)n=n.__;t.h=r,t.v={nodeType:1,parentNode:r,childNodes:[],__k:{__m:n.__m},contains:function(){return!0},insertBefore:function(o,a){this.childNodes.push(o),t.h.insertBefore(o,a)},removeChild:function(o){this.childNodes.splice(this.childNodes.indexOf(o)>>>1,1),t.h.removeChild(o)}}}p.render(p.createElement(Dr,{context:t.context},e.__v),t.v)}function Ir(e,t){var r=p.createElement(Pr,{__v:e,h:t});return r.containerInfo=t,r}(ce.prototype=new p.Component).__a=function(e){var t=this,r=Ot(t.__v),n=t.l.get(e);return n[0]++,function(o){var a=function(){t.props.revealOrder?(n.push(o),at(t,e,n)):o()};r?r(a):a()}},ce.prototype.render=function(e){this.i=null,this.l=new Map;var t=p.toChildArray(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},ce.prototype.componentDidUpdate=ce.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){at(e,r,t)})};var Tt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Vr=/^(?: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]/,Mr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Lr=/[A-Z0-9]/g,zr=typeof document<"u",Gr=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Hr(e,t,r){return t.__k==null&&(t.textContent=""),p.render(e,t),typeof r=="function"&&r(),e?e.__c:null}function Wr(e,t,r){return p.hydrate(e,t),typeof r=="function"&&r(),e?e.__c:null}p.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(p.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var it=p.options.event;function Kr(){}function Ur(){return this.cancelBubble}function Jr(){return this.defaultPrevented}p.options.event=function(e){return it&&(e=it(e)),e.persist=Kr,e.isPropagationStopped=Ur,e.isDefaultPrevented=Jr,e.nativeEvent=e};var Xe,Xr={enumerable:!1,configurable:!0,get:function(){return this.class}},st=p.options.vnode;p.options.vnode=function(e){typeof e.type=="string"&&(function(t){var r=t.props,n=t.type,o={},a=n.indexOf("-")===-1;for(var s in r){var l=r[s];if(!(s==="value"&&"defaultValue"in r&&l==null||zr&&s==="children"&&n==="noscript"||s==="class"||s==="className")){var c=s.toLowerCase();s==="defaultValue"&&"value"in r&&r.value==null?s="value":s==="download"&&l===!0?l="":c==="translate"&&l==="no"?l=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?s="ondblclick":c!=="onchange"||n!=="input"&&n!=="textarea"||Gr(r.type)?c==="onfocus"?s="onfocusin":c==="onblur"?s="onfocusout":Mr.test(s)&&(s=c):c=s="oninput":a&&Vr.test(s)?s=s.replace(Lr,"-$&").toLowerCase():l===null&&(l=void 0),c==="oninput"&&o[s=c]&&(s="oninputCapture"),o[s]=l}}n=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=p.toChildArray(r.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=p.toChildArray(r.children).forEach(function(u){u.props.selected=o.multiple?o.defaultValue.indexOf(u.props.value)!=-1:o.defaultValue==u.props.value})),r.class&&!r.className?(o.class=r.class,Object.defineProperty(o,"className",Xr)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),t.props=o})(e),e.$$typeof=Tt,st&&st(e)};var lt=p.options.__r;p.options.__r=function(e){lt&&lt(e),Xe=e.__c};var ct=p.options.diffed;p.options.diffed=function(e){ct&&ct(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),Xe=null};var qr={ReactCurrentDispatcher:{current:{readContext:function(e){return Xe.__n[e.__c].props.value},useCallback:d.useCallback,useContext:d.useContext,useDebugValue:d.useDebugValue,useDeferredValue:St,useEffect:d.useEffect,useId:d.useId,useImperativeHandle:d.useImperativeHandle,useInsertionEffect:Et,useLayoutEffect:d.useLayoutEffect,useMemo:d.useMemo,useReducer:d.useReducer,useRef:d.useRef,useState:d.useState,useSyncExternalStore:_t,useTransition:jt}}};function Qr(e){return p.createElement.bind(null,e)}function Ne(e){return!!e&&e.$$typeof===Tt}function Yr(e){return Ne(e)&&e.type===p.Fragment}function Zr(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function $r(e){return Ne(e)?p.cloneElement.apply(null,arguments):e}function en(e){return!!e.__k&&(p.render(null,e),!0)}function tn(e){return e&&(e.base||e.nodeType===1&&e)||null}var rn=function(e,t){return e(t)},nn=function(e,t){return e(t)},on=p.Fragment,an=Ne,te={useState:d.useState,useId:d.useId,useReducer:d.useReducer,useEffect:d.useEffect,useLayoutEffect:d.useLayoutEffect,useInsertionEffect:Et,useTransition:jt,useDeferredValue:St,useSyncExternalStore:_t,startTransition:Nt,useRef:d.useRef,useImperativeHandle:d.useImperativeHandle,useMemo:d.useMemo,useCallback:d.useCallback,useContext:d.useContext,useDebugValue:d.useDebugValue,version:"18.3.1",Children:Tr,render:Hr,hydrate:Wr,unmountComponentAtNode:en,createPortal:Ir,createElement:p.createElement,createContext:p.createContext,createFactory:Qr,cloneElement:$r,createRef:p.createRef,Fragment:p.Fragment,isValidElement:Ne,isElement:an,isFragment:Yr,isMemo:Zr,findDOMNode:tn,Component:p.Component,PureComponent:Le,memo:Ar,forwardRef:Or,flushSync:nn,unstable_batchedUpdates:rn,StrictMode:on,Suspense:ye,SuspenseList:ce,lazy:Rr,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:qr},Bt={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ut=te.createContext&&te.createContext(Bt),sn=["attr","size","title"];function ln(e,t){if(e==null)return{};var r=cn(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cn(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function xe(){return xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xe.apply(this,arguments)}function dt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ke(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dt(Object(r),!0).forEach(function(n){un(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function un(e,t,r){return t=dn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dn(e){var t=fn(e,"string");return typeof t=="symbol"?t:t+""}function fn(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rt(e){return e&&e.map((t,r)=>te.createElement(t.tag,ke({key:r},t.attr),Rt(t.child)))}function Se(e){return t=>te.createElement(pn,xe({attr:ke({},e.attr)},t),Rt(e.child))}function pn(e){var t=r=>{var{attr:n,size:o,title:a}=e,s=ln(e,sn),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),te.createElement("svg",xe({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:ke(ke({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&te.createElement("title",null,a),e.children)};return ut!==void 0?te.createElement(ut.Consumer,null,r=>t(r)):t(Bt)}function vn(e){return Se({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:[]}]})(e)}var hn=/\s+/g,gn=e=>typeof e!="string"||!e?e:e.replace(hn," ").trim(),Ce=(...e)=>{const t=[],r=n=>{if(!n&&n!==0&&n!==0n)return;if(Array.isArray(n)){for(let a=0,s=n.length;a<s;a++)r(n[a]);return}const o=typeof n;if(o==="string"||o==="number"||o==="bigint"){if(o==="number"&&n!==n)return;t.push(String(n))}else if(o==="object"){const a=Object.keys(n);for(let s=0,l=a.length;s<l;s++){const c=a[s];n[c]&&t.push(c)}}};for(let n=0,o=e.length;n<o;n++){const a=e[n];a!=null&&r(a)}return t.length>0?gn(t.join(" ")):void 0},ft=e=>e===!1?"false":e===!0?"true":e===0?"0":e,I=e=>{if(!e||typeof e!="object")return!0;for(const t in e)return!1;return!0},mn=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let o=0;o<r.length;o++){const a=r[o];if(!n.includes(a)||e[a]!==t[a])return!1}return!0},bn=(e,t)=>{for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const n=t[r];r in e?e[r]=Ce(e[r],n):e[r]=n}return e},Dt=(e,t)=>{for(let r=0;r<e.length;r++){const n=e[r];Array.isArray(n)?Dt(n,t):n&&t.push(n)}},Pt=(...e)=>{const t=[];Dt(e,t);const r=[];for(let n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r},ze=(e,t)=>{const r={};for(const n in e){const o=e[n];if(n in t){const a=t[n];Array.isArray(o)||Array.isArray(a)?r[n]=Pt(a,o):typeof o=="object"&&typeof a=="object"&&o&&a?r[n]=ze(o,a):r[n]=a+" "+o}else r[n]=o}for(const n in t)n in e||(r[n]=t[n]);return r},yn={twMerge:!0,twMergeConfig:{}};function wn(){let e=null,t={},r=!1;return{get cachedTwMerge(){return e},set cachedTwMerge(n){e=n},get cachedTwMergeConfig(){return t},set cachedTwMergeConfig(n){t=n},get didTwMergeConfigChange(){return r},set didTwMergeConfigChange(n){r=n},reset(){e=null,t={},r=!1}}}var Be=wn(),xn=e=>{const t=(n,o)=>{const{extend:a=null,slots:s={},variants:l={},compoundVariants:c=[],compoundSlots:u=[],defaultVariants:f={}}=n,v={...yn,...o},N=a?.base?Ce(a.base,n?.base):n?.base,m=a?.variants&&!I(a.variants)?ze(l,a.variants):l,C=a?.defaultVariants&&!I(a.defaultVariants)?{...a.defaultVariants,...f}:f;!I(v.twMergeConfig)&&!mn(v.twMergeConfig,Be.cachedTwMergeConfig)&&(Be.didTwMergeConfigChange=!0,Be.cachedTwMergeConfig=v.twMergeConfig);const T=I(a?.slots),h=I(s)?{}:{base:Ce(n?.base,T&&a?.base),...s},B=T?h:bn({...a?.slots},I(h)?{base:n?.base}:h),R=I(a?.compoundVariants)?c:Pt(a?.compoundVariants,c),b=O=>{if(I(m)&&I(s)&&T)return e(N,O?.class,O?.className)(v);if(R&&!Array.isArray(R))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof R}`);if(u&&!Array.isArray(u))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof u}`);const U=(w,k=m,x=null,S=null)=>{const y=k[w];if(!y||I(y))return null;const j=S?.[w]??O?.[w];if(j===null)return null;const V=ft(j);if(typeof V=="object")return null;const J=C?.[w],M=V??ft(J);return y[M||"false"]},Z=()=>{if(!m)return null;const w=Object.keys(m),k=[];for(let x=0;x<w.length;x++){const S=U(w[x],m);S&&k.push(S)}return k},Ee=(w,k)=>{if(!m||typeof m!="object")return null;const x=[];for(const S in m){const y=U(S,m,w,k),j=w==="base"&&typeof y=="string"?y:y&&y[w];j&&x.push(j)}return x},ie={};for(const w in O){const k=O[w];k!==void 0&&(ie[w]=k)}const G=(w,k)=>{const x=typeof O?.[w]=="object"?{[w]:O[w]?.initial}:{};return{...C,...ie,...x,...k}},se=(w=[],k)=>{const x=[],S=w.length;for(let y=0;y<S;y++){const{class:j,className:V,...J}=w[y];let M=!0;const H=G(null,k);for(const re in J){const W=J[re],me=H[re];if(Array.isArray(W)){if(!W.includes(me)){M=!1;break}}else{if((W==null||W===!1)&&(me==null||me===!1))continue;if(me!==W){M=!1;break}}}M&&(j&&x.push(j),V&&x.push(V))}return x},Ae=w=>{const k=se(R,w);if(!Array.isArray(k))return k;const x={},S=e;for(let y=0;y<k.length;y++){const j=k[y];if(typeof j=="string")x.base=S(x.base,j)(v);else if(typeof j=="object")for(const V in j)x[V]=S(x[V],j[V])(v)}return x},ge=w=>{if(u.length<1)return null;const k={},x=G(null,w);for(let S=0;S<u.length;S++){const{slots:y=[],class:j,className:V,...J}=u[S];if(!I(J)){let M=!0;for(const H in J){const re=x[H],W=J[H];if(re===void 0||(Array.isArray(W)?!W.includes(re):W!==re)){M=!1;break}}if(!M)continue}for(let M=0;M<y.length;M++){const H=y[M];k[H]||(k[H]=[]),k[H].push([j,V])}}return k};if(!I(s)||!T){const w={};if(typeof B=="object"&&!I(B)){const k=e;for(const x in B)w[x]=S=>{const y=Ae(S),j=ge(S);return k(B[x],Ee(x,S),y?y[x]:void 0,j?j[x]:void 0,S?.class,S?.className)(v)}}return w}return e(N,Z(),se(R),O?.class,O?.className)(v)},ae=()=>{if(!(!m||typeof m!="object"))return Object.keys(m)};return b.variantKeys=ae(),b.extend=a,b.base=N,b.slots=B,b.variants=m,b.defaultVariants=C,b.compoundSlots=u,b.compoundVariants=R,b};return{tv:t,createTV:n=>(o,a)=>t(o,a?ze(n,a):n)}},kn=(...e)=>t=>Ce(e)||void 0,{tv:It}=xn(kn);const pt=It({base:"lv-button flex items-center justify-center rounded-lg transition-colors cursor-pointer active:scale-95 transition-transform",variants:{$variant:{primary:"font-semibold text-sm bg-[var(--lv-button-primary-background)] text-[var(--lv-button-primary-color)] border-[var(--lv-button-primary-border)] hover:bg-[var(--lv-button-primary-hoverBackground,var(--lv-button-primary-background))] active:bg-[var(--lv-button-primary-activeBackground,var(--lv-button-primary-hoverBackground,var(--lv-button-primary-background)))] disabled:bg-[var(--lv-button-primary-disabledBackground,var(--lv-button-primary-background))] disabled:text-[var(--lv-button-primary-disabledColor,var(--lv-button-primary-color))]",secondary:"border bg-[var(--lv-button-secondary-background)] text-[var(--lv-button-secondary-color)] border-[var(--lv-button-secondary-border,var(--lv-button-secondary-background))] hover:bg-[var(--lv-button-secondary-hoverBackground,var(--lv-button-secondary-background))] active:bg-[var(--lv-button-secondary-activeBackground,var(--lv-button-secondary-hoverBackground,var(--lv-button-secondary-background)))] disabled:bg-[var(--lv-button-secondary-disabledBackground,var(--lv-button-secondary-background))] disabled:text-[var(--lv-button-secondary-disabledColor,var(--lv-button-secondary-color))]",tertiary:"bg-transparent text-[var(--lv-text-muted)] hover:bg-[var(--lv-control-button-tertiary-hoverBackground,transparent)] active:bg-[var(--lv-control-button-tertiary-activeBackground,var(--lv-control-button-tertiary-hoverBackground,transparent))] disabled:text-[var(--lv-control-button-tertiary-disabledColor,var(--lv-text-muted))]"},$size:{sm:"h-6",md:"h-8",lg:"h-11"},$aspect:{square:"aspect-square",auto:""}},defaultVariants:{$size:"md",$variant:"primary",$aspect:"auto"}});function ue(e){const{children:t,className:r,$variant:n,$size:o,$aspect:a,...s}=e,{href:l,onClick:c}=e;if(l){const f={href:l,onClick:c,className:ee(pt({$variant:n,$size:o,$aspect:a}),r),...s};return p.createElement("a",f,t)}const u={onClick:c,className:ee(pt({$variant:n,$size:o,$aspect:a}),r),...s};return p.createElement("button",u,t)}const Cn=({isApple:e})=>i.jsxs("div",{className:"flex h-full w-full justify-between",children:[i.jsx("div",{className:"grow py-1 pl-1",children:i.jsx("div",{className:"h-full rounded-sm border border-gray-300 bg-gray-400"})}),i.jsx("div",{className:"flex h-full w-3 flex-col items-center justify-center gap-0.5 pr-0.5",children:Array.from({length:e?1:3}).map((t,r)=>i.jsx("div",{className:"h-1.5 w-1.5 rounded-full border border-gray-500"},"dot-t-"+r))})]}),_n=({isApple:e})=>i.jsxs("div",{className:"flex h-full w-full flex-col justify-between",children:[i.jsx("div",{className:"grow px-1 pt-1",children:i.jsx("div",{className:"h-full rounded-sm border border-gray-200 bg-gray-300"})}),i.jsx("div",{className:"flex h-3 w-full items-center justify-center gap-0.5 pb-0.5",children:Array.from({length:e?1:3}).map((t,r)=>i.jsx("div",{className:"h-1.5 w-1.5 rounded-full border border-gray-400"},"dot-p-"+r))})]}),Nn=()=>i.jsxs("div",{className:"-space-x-4 flex items-end",children:[i.jsx("div",{className:"h-38 w-48 overflow-hidden rounded-lg bg-gray-300",children:i.jsx(Cn,{isApple:!0})}),i.jsx("div",{className:"h-18 w-12 overflow-hidden rounded-lg bg-gray-200",children:i.jsx(_n,{isApple:!0})})]}),Sn=({onSettings:e})=>{const{start:t}=kr();return i.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[i.jsx(Nn,{}),i.jsx("div",{className:"text-center",children:i.jsx("p",{className:"text-sm",style:{color:"var(--lv-text-secondary)"},children:"Click the button below to start a connection"})}),i.jsxs("div",{className:"flex items-center",children:[i.jsx(ue,{type:"button",onClick:t,className:"z-10 px-6 py-3",$variant:"primary",$size:"lg",children:"Generate QR"}),i.jsx(ue,{type:"button","aria-label":"Connection settings","aria-pressed":!1,onClick:e,className:"-ml-1 rounded-l-none px-3",$aspect:"square",$size:"lg",$variant:"secondary",children:i.jsx(vn,{className:"h-5 w-5",style:{color:"var(--lv-text-muted)"}})})]})]})},jn=async e=>{if(!e)return!1;try{if(navigator?.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();const r=document.execCommand("copy");return document.body.removeChild(t),r}catch{return!1}},vt=(e,{duration:t=200}={})=>{const[r,n]=d.useState(e),[o,a]=d.useState(null),s=d.useRef(),l=d.useRef(e);return d.useEffect(()=>{if(!Object.is(e,l.current))return s.current&&window.clearTimeout(s.current),a(l.current),n(e),l.current=e,s.current=window.setTimeout(()=>{a(null),s.current=void 0},t),()=>{s.current&&window.clearTimeout(s.current)}},[e,t]),{current:r,previous:o,isTransitioning:o!==null}},Vt="data:image/webp;base64,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",En=()=>{const{status:e}=he(),t=e?.status,r=e?.signaling?.state,n=K({sessionState:t,signalState:r}).with({sessionState:"connected"},()=>({icon:"✅",text:"Connected Successfully!"})).with({sessionState:"signaling",signalState:"standby"},()=>({icon:"🫥",text:"Connecting"})).with({sessionState:"signaling",signalState:"connecting"},()=>({icon:"↗️",text:"Connecting"})).with({sessionState:"signaling",signalState:"ready"},()=>({icon:"👋",text:"Ready"})).with({sessionState:"signaling",signalState:"handshake"},()=>({icon:"🤝",text:"Handshake Closed"})).with({sessionState:"signaling",signalState:"handshake-partial"},()=>({icon:"🤝",text:"Handshake Partial"})).with({sessionState:"signaling",signalState:"encrypted"},()=>({icon:"🔒",text:"Encrypted"})).with({sessionState:"signaling",signalState:"error"},()=>({icon:"❌",text:"Signal Error"})).otherwise(()=>{});if(!n)return i.jsx(i.Fragment,{});const{icon:o,text:a}=n;return i.jsxs("div",{className:"group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-[var(--lv-button-secondary-background)]",children:[i.jsx("div",{className:"pointer-events-none whitespace-nowrap rounded-md text-xs opacity-0 group-hover:opacity-100",children:a}),i.jsx("div",{children:o})]})},An=()=>{const e="var(--lv-text-muted)";return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-11 w-full"}),i.jsxs("div",{className:"absolute inset-x-0 bottom-0 flex items-end justify-between gap-2 px-3 py-2",style:{color:e},children:[i.jsxs("a",{href:"https://github.com/v3xlabs/open-lavatory",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 p-1 font-semibold text-sm",style:{color:e},children:[i.jsx("img",{src:Vt,alt:"Open Lavatory Logo",width:20,height:20,className:"rounded","data-openlv-brand-logo":!0}),i.jsx("span",{children:"openlv"})]}),i.jsx("div",{className:"text-sm",style:{color:e},children:i.jsx(En,{})})]})]})};function Fn(e){return Se({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:[]}]})(e)}function Mt(e){return Se({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:[]}]})(e)}function On(e){return Se({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:[]}]})(e)}const Tn=({title:e,view:t,onClose:r,onBack:n})=>i.jsxs("div",{className:"flex items-center justify-between px-2 py-2",children:[n?i.jsx(ue,{onClick:n,"aria-label":t==="settings"?"Back to QR":"Close modal",$variant:"tertiary",$aspect:"square",$size:"md",children:i.jsx(Fn,{className:"h-6 w-6",style:{color:"var(--lv-text-muted)"}})}):i.jsx(ue,{type:"button",href:"https://openlv.sh",target:"_blank",$variant:"tertiary",$aspect:"square",$size:"md",children:i.jsx(Mt,{className:"h-5 w-5"})}),i.jsx("h2",{className:"flex items-center justify-center gap-2 font-semibold text-lg",style:{color:"var(--lv-text-primary)"},children:e}),i.jsx(ue,{type:"button","aria-label":"close","aria-pressed":!1,onClick:r,$variant:"tertiary",$aspect:"square",$size:"md",children:i.jsx(On,{className:"h-6 w-6",style:{color:"var(--lv-text-muted)"}})})]}),Bn=It({slots:{root:"group relative",box:"cursor-pointer rounded-md transition-colors flex items-center justify-center hover:[background-color:var(--lv-button-tertiary-hoverBackground)]",popover:"-translate-x-1/2 absolute top-full left-1/2 z-10 hidden rounded-md shadow-sm group-hover:block",icon:""},variants:{size:{sm:{box:"h-5 w-5 p-1",icon:"h-3 w-3"},md:{box:"h-6 w-6 p-1",icon:"h-4 w-4"},lg:{box:"h-8 w-8 p-1.5",icon:"h-4 w-4"}},variant:{icon:"",text:""}},defaultVariants:{size:"lg"}}),qe=({variant:e="icon",children:t,size:r="lg"})=>{const{root:n,box:o,popover:a,icon:s}=Bn({size:r,variant:e});return i.jsxs("div",{className:n(),children:[i.jsx("div",{className:o(),style:{color:"var(--lv-text-muted)"},children:K(e).with("icon",()=>i.jsx(Mt,{className:s()})).with("text",()=>i.jsx("div",{children:"Text"})).exhaustive()}),i.jsx("div",{className:a(),style:{backgroundColor:"var(--lv-body-background)",color:"var(--lv-text-primary)",padding:"6px 8px",border:"1px solid var(--lv-button-secondary-border)"},children:t})]})},Qe=({title:e,right:t,children:r})=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-end justify-between px-2 py-1",children:[i.jsx("div",{className:"font-medium text-sm",style:{color:"var(--lv-text-primary)"},children:e}),i.jsx("div",{children:t})]}),i.jsx("div",{className:"flex flex-col gap-1 rounded-md p-2 border",style:{backgroundColor:"transparent",borderColor:"var(--lv-button-secondary-background)"},children:r})]}),_e=({label:e,children:t})=>i.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[i.jsx("div",{className:"text-sm",style:{color:"var(--lv-text-secondary)"},children:e}),i.jsx("div",{children:t})]}),Ye=({options:e,value:t,onChange:r})=>{const n="var(--lv-button-secondary-border)";return i.jsx("div",{className:"flex overflow-hidden rounded-md border",style:{borderColor:n},children:e.map(([o,a])=>i.jsx("button",{type:"button",onClick:()=>r(o),"aria-pressed":o===t,className:ee("px-4 py-2 font-semibold text-xs transition border-l first:border-l-0",o!==t&&"cursor-pointer"),style:o===t?{backgroundColor:"var(--lv-button-secondary-selectedBackground, var(--lv-button-secondary-background))",color:"var(--lv-button-secondary-selectedColor, var(--lv-text-primary))",borderColor:n}:{backgroundColor:"transparent",color:"var(--lv-text-secondary)",borderColor:n},children:a},o))})},Rn=({value:e,onChange:t})=>i.jsx(Ye,{options:[["true","Yes"],["false","No"]],value:e?"true":"false",onChange:r=>t(r==="true")}),Dn=()=>{const{settings:e,updateRetainHistory:t,updateAutoReconnect:r}=Je();return i.jsx(Qe,{title:"Connection preferences",right:i.jsx(qe,{variant:"icon",children:"Something something very cool"}),children:[["Retain session history","retainHistory",e?.retainHistory??!1,t],["Auto reconnect","autoReconnect",e?.autoReconnect??!1,r]].map(([n,o,a,s])=>i.jsx(_e,{label:n,children:i.jsx(Rn,{label:n,value:a,onChange:s})},o))})},Pn="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",In=({id:e,value:t,placeholder:r,ariaLabel:n,readOnly:o=!0,onChange:a})=>i.jsx("input",{id:e,className:Pn,style:{color:"var(--lv-text-primary)",backgroundColor:"var(--lv-body-background)",borderColor:"var(--lv-control-input-border)"},value:t,placeholder:r,"aria-label":n,readOnly:o,onChange:s=>{s.target instanceof HTMLInputElement&&a?.(s.target.value)}}),Vn=["MQTT","NTFY","GUN"],Mn=()=>{const{settings:e,updateSignalingProtocol:t,updateSignalingServer:r}=Je();return i.jsx("div",{children:i.jsxs(Qe,{title:"Signaling",right:i.jsx(qe,{variant:"icon",children:"Something something very cool"}),children:[i.jsx(_e,{label:"Protocol",children:i.jsx(Ye,{options:Vn.map(n=>[n.toLowerCase(),n]),value:e?.signaling.p||"",onChange:t})}),i.jsx(_e,{label:"Server",children:i.jsx(In,{id:"server",value:e?.signaling.s[e?.signaling.p||""]||"",onChange:n=>r(n),placeholder:"Server URL",ariaLabel:"Server URL",readOnly:!1})})]})})},Ln=["WebRTC"],zn=()=>{const[e,t]=d.useState("WebRTC");return i.jsx(Qe,{title:"Transport",right:i.jsx(qe,{variant:"icon",children:"Something something very cool"}),children:i.jsx(_e,{label:"Protocol",children:i.jsx(Ye,{options:Ln.map(r=>[r,r]),value:e,onChange:r=>t(r)})})})},Gn=()=>i.jsxs("div",{className:"px-4 pb-2",children:[i.jsx(Mn,{}),i.jsx(zn,{}),i.jsx(Dn,{})]}),Hn=()=>{const[e,t]=d.useState("start"),[r,n]=d.useState(!1);return d.useEffect(()=>{if(!r)return;const o=window.setTimeout(()=>n(!1),2e3);return()=>window.clearTimeout(o)},[r]),{view:e,setView:t,copied:r,setCopied:n}},Wn=e=>{d.useEffect(()=>{const t=r=>{r.key==="Escape"&&e()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e])},Kn=()=>{const e=d.useRef(null),[t,r]=d.useState(0),n=d.useRef(!1),o=d.useCallback((a,s=!1)=>{const l=a||e.current;if(!l)return;const c=s?l.scrollHeight:l.getBoundingClientRect().height;c>0&&(r(u=>typeof u=="number"&&Math.abs(u-c)<.5?u:c),n.current=!0)},[]);return d.useLayoutEffect(()=>{const a=e.current;if(!a||typeof ResizeObserver>"u")return;const s=new ResizeObserver(()=>{o()});return s.observe(a),()=>s.disconnect()},[o]),d.useEffect(()=>{if(typeof window>"u")return;const a=()=>{o()};return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[o]),{contentRef:e,height:t,measureHeight:o,setHeight:r}},Lt=({onClose:e=()=>{},onCopy:t})=>{const{view:r,setView:n,copied:o,setCopied:a}=Hn(),{uri:s}=he(),{status:l,provider:c}=ve(),{contentRef:u,height:f,measureHeight:v}=Kn(),{current:N,previous:m,isTransitioning:C}=vt(r),{current:T,previous:h,isTransitioning:B}=vt(l),R=d.useCallback(()=>n("settings"),[n]),b=K(r).with("start",()=>"Connect Wallet").with("settings",()=>"Settings").exhaustive();Wn(e),d.useEffect(()=>{l===$.CONNECTED&&e()},[l,e]);const ae=d.useCallback(async()=>{s&&await jn(s)&&a(!0)},[s,a]),O=d.useRef(!0),U=d.useRef(),Z=d.useRef(void 0),[Ee,ie]=d.useState(!1),G=d.useRef();d.useLayoutEffect(()=>{if(u.current)return O.current?(U.current&&window.clearTimeout(U.current),U.current=window.setTimeout(()=>{u.current&&(v(void 0,!0),O.current=!1)},0)):v(),()=>{U.current&&window.clearTimeout(U.current)}},[v,T,N]),d.useEffect(()=>(Z.current!==void 0&&f!==Z.current&&f>0&&Z.current>0&&Math.abs(f-Z.current)>.5&&(ie(!0),G.current&&window.clearTimeout(G.current),G.current=window.setTimeout(()=>{ie(!1),G.current=void 0},200)),Z.current=f,()=>{G.current&&window.clearTimeout(G.current)}),[f]);const se=()=>{c?.closeSession()},Ae=K({view:r,status:l}).with({view:"start",status:$.STANDBY},()=>{}).with({view:"start"},()=>se).with({view:"settings"},()=>()=>n("start")).otherwise(()=>()=>{se(),e()}),ge=y=>K(y).with("start",()=>i.jsx(Sn,{onSettings:R})).with("settings",()=>i.jsx(Gn,{})).otherwise(()=>i.jsx(Ve,{state:y})),w=()=>i.jsxs("div",{className:"modal-transition__container",children:[m&&i.jsx("div",{className:"modal-transition__layer modal-transition__layer--outgoing",children:ge(m)}),i.jsx("div",{className:ee("modal-transition__layer",C&&"modal-transition__layer--incoming"),children:ge(N)})]}),k=y=>K(y).with($.STANDBY,()=>w()).with(yt.union($.CREATING,$.CONNECTING,$.CONNECTED),()=>i.jsx(Er,{onClose:e,onCopy:t||ae})).otherwise(j=>i.jsx(Ve,{state:j||"unknown status"}));Ue("view",r);const x={background:"var(--lv-overlay-background, rgba(0,0,0,0.3))",backdropFilter:"var(--lv-overlay-backdrop-filter, blur(4px))"},S={background:"var(--lv-body-background)",color:"var(--lv-body-color, var(--lv-text-primary))",borderRadius:"var(--lv-border-radius, 16px)",boxShadow:"var(--lv-modal-shadow, 0px 12px 32px rgba(0,0,0,0.25))"};return i.jsx("div",{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",onClick:e,role:"presentation","data-openlv-modal-root":!0,style:x,children:i.jsxs("div",{className:ee("relative w-full max-w-[400px] animate-[fade-in_0.15s_ease-in-out] transition-[height] duration-200 ease-out",Ee||h?"overflow-hidden":void 0),role:"dialog","aria-modal":"true","aria-label":b,onClick:y=>y.stopPropagation(),style:{...typeof f=="number"&&f>0?{height:`${f}px`}:{},...S},children:[i.jsxs("div",{ref:u,children:[i.jsx(Tn,{title:b,view:r,onClose:e,onBack:Ae}),i.jsxs("div",{className:"modal-transition__container",children:[h&&i.jsx("div",{className:"modal-transition__layer modal-transition__layer--outgoing absolute",children:i.jsx("div",{className:"flex flex-col text-center",children:k(h)})}),i.jsx("div",{className:ee("modal-transition__layer",B&&"modal-transition__layer--incoming"),children:i.jsx("div",{className:"flex flex-col text-center",children:k(T)})})]}),i.jsx(An,{})]}),i.jsx("div",{className:ee("absolute top-5 right-5 rounded-lg bg-blue-500 px-4 py-3 font-medium text-sm text-white transition-all",o?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:"📋 Connection URL copied to clipboard!"})]})})},Un='@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%}.right-5{right:calc(var(--spacing)*5)}.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)}.-ml-1{margin-left:calc(var(--spacing)*-1)}.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%}.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}.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)}.translate-x-full{--tw-translate-x:100%;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}.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-4{gap:calc(var(--spacing)*4)}: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)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.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-\\[var\\(--lv-button-primary-border\\)\\]{border-color:var(--lv-button-primary-border)}.border-\\[var\\(--lv-button-secondary-border\\,var\\(--lv-button-secondary-background\\)\\)\\]{border-color:var(--lv-button-secondary-border,var(--lv-button-secondary-background))}.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-button-secondary-background\\){background-color:var(--lv-button-secondary-background)}.bg-\\[var\\(--lv-button-primary-background\\)\\]{background-color:var(--lv-button-primary-background)}.bg-\\[var\\(--lv-button-secondary-background\\)\\]{background-color:var(--lv-button-secondary-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)}.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-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.pt-1{padding-top:calc(var(--spacing)*1)}.pr-0\\.5{padding-right:calc(var(--spacing)*.5)}.pb-0\\.5{padding-bottom:calc(var(--spacing)*.5)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pl-1{padding-left:calc(var(--spacing)*1)}.text-center{text-align:center}.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-\\[var\\(--lv-button-primary-color\\)\\]{color:var(--lv-button-primary-color)}.text-\\[var\\(--lv-button-secondary-color\\)\\]{color:var(--lv-button-secondary-color)}.text-\\[var\\(--lv-text-muted\\)\\]{color:var(--lv-text-muted)}.text-\\[var\\(--lv-text-primary\\)\\]{color:var(--lv-text-primary)}.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))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.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\\:border-l-0:first-child{border-left-style:var(--tw-border-style);border-left-width:0}@media(hover:hover){.hover\\:\\[background-color\\:var\\(--lv-button-tertiary-hoverBackground\\)\\]:hover{background-color:var(--lv-button-tertiary-hoverBackground)}.hover\\:bg-\\(--lv-button-secondary-hoverBackground\\):hover{background-color:var(--lv-button-secondary-hoverBackground)}.hover\\:bg-\\[var\\(--lv-button-primary-background-hover\\)\\]:hover{background-color:var(--lv-button-primary-background-hover)}.hover\\:bg-\\[var\\(--lv-button-primary-hoverBackground\\,var\\(--lv-button-primary-background\\)\\)\\]:hover{background-color:var(--lv-button-primary-hoverBackground,var(--lv-button-primary-background))}.hover\\:bg-\\[var\\(--lv-button-secondary-background\\)\\]:hover{background-color:var(--lv-button-secondary-background)}.hover\\:bg-\\[var\\(--lv-button-secondary-hoverBackground\\,var\\(--lv-button-secondary-background\\)\\)\\]:hover{background-color:var(--lv-button-secondary-hoverBackground,var(--lv-button-secondary-background))}.hover\\:bg-\\[var\\(--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-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-button-secondary-activeBackground\\):active{background-color:var(--lv-button-secondary-activeBackground)}.active\\:bg-\\[var\\(--lv-button-primary-activeBackground\\,var\\(--lv-button-primary-hoverBackground\\,var\\(--lv-button-primary-background\\)\\)\\)\\]:active{background-color:var(--lv-button-primary-activeBackground,var(--lv-button-primary-hoverBackground,var(--lv-button-primary-background)))}.active\\:bg-\\[var\\(--lv-button-secondary-activeBackground\\,var\\(--lv-button-secondary-hoverBackground\\,var\\(--lv-button-secondary-background\\)\\)\\)\\]:active{background-color:var(--lv-button-secondary-activeBackground,var(--lv-button-secondary-hoverBackground,var(--lv-button-secondary-background)))}.active\\:bg-\\[var\\(--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-\\[var\\(--lv-button-primary-disabledBackground\\,var\\(--lv-button-primary-background\\)\\)\\]:disabled{background-color:var(--lv-button-primary-disabledBackground,var(--lv-button-primary-background))}.disabled\\:bg-\\[var\\(--lv-button-secondary-disabledBackground\\,var\\(--lv-button-secondary-background\\)\\)\\]:disabled{background-color:var(--lv-button-secondary-disabledBackground,var(--lv-button-secondary-background))}.disabled\\:text-\\[var\\(--lv-button-primary-disabledColor\\,var\\(--lv-button-primary-color\\)\\)\\]:disabled{color:var(--lv-button-primary-disabledColor,var(--lv-button-primary-color))}.disabled\\:text-\\[var\\(--lv-button-secondary-disabledColor\\,var\\(--lv-button-secondary-color\\)\\)\\]:disabled{color:var(--lv-button-secondary-disabledColor,var(--lv-button-secondary-color))}.disabled\\:text-\\[var\\(--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)}}}: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-mode=dark] 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)}}',Jn=async(e,t)=>{if(e){if(e.querySelector("style[data-openlv-modal]"))return;const n=document.createElement("style");n.setAttribute("data-openlv-modal","true");const{tokens:o}=Ke(t??pe),a=We(o),s=`:root, :host {
2
- ${Object.entries(a).map(([l,c])=>`${l}: ${c};`).join(`
3
- `)}
4
- }`;n.textContent=`${s}
5
- ${Un}`,e.appendChild(n)}};class je extends HTMLElement{constructor(r,n=pe,o=()=>{}){super();ne(this,"onClose");ne(this,"provider");ne(this,"theme");ne(this,"shadow");ne(this,"renderRequested",!1);this.provider=r,this.theme=n,this.onClose=o,this.shadow=this.attachShadow({mode:"open"}),Jn(this.shadow,this.theme)}connectedCallback(){this.requestRender()}disconnectedCallback(){p.render(null,this.shadow)}showModal(){this.style.display="block"}hideModal(){this.style.display="none"}requestRender(){this.renderRequested||(this.renderRequested=!0,queueMicrotask(()=>{this.renderRequested=!1,this.performRender()}))}performRender(){p.render(p.h(wr,{onClose:this.onClose??(()=>this.remove()),provider:this.provider,theme:this.theme}),this.shadow)}}const Xn=(e="idle")=>{const[t,r]=d.useState({state:e}),n=d.useCallback((s,l)=>{r(c=>({...c,state:s,...l}))},[]),o=d.useCallback(s=>{r(s)},[]),a=d.useCallback(()=>{r({state:"idle"})},[]);return{connectionInfo:t,updateState:n,updateConnectionInfo:o,reset:a}},zt=(e="openlv-modal")=>{if(typeof window>"u")return e;const t=window.customElements;return t?(t.get(e)||t.define(e,je),e):(console.warn("OpenLV modal: custom elements are not supported in this environment."),e)},qn=(e,t=pe,r)=>{const n=document.querySelector("openlv-modal");if(n&&n.remove(),!n){zt();const o=new je(e,t,()=>{Ue("modal closed"),o.remove(),r?.()});document.body.appendChild(o),o.showModal()}};exports.DEFAULT_THEME_CONFIG=pe;exports.ModalRoot=Lt;exports.OPENLV_ICON_128=Vt;exports.OpenLVModalElement=je;exports.buildTheme=We;exports.default=je;exports.openlvThemeTokens=He;exports.registerOpenLVModal=zt;exports.resolveTheme=Ke;exports.triggerOpenModal=qn;exports.useConnectionState=Xn;
1
+ "use strict";var zt=Object.defineProperty;var Ft=(e,t,r)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ge=(e,t,r)=>Ft(e,typeof t!="symbol"?t+"":t,r);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("preact/jsx-runtime"),d=require("preact/hooks"),p=require("preact"),Wt=require("qrcode-generator");function Gt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Ht=Gt(Wt),Kt=1,Ut=e=>{const t=new URLSearchParams;return t.set("h",e.h),t.set("k",e.k),e.p&&t.set("p",e.p),e.s&&t.set("s",e.s),`openlv://${e.sessionId}@${Kt}?${t.toString()}`};function Jt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ee={exports:{}},Xe;function qt(){return Xe||(Xe=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function o(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function a(c,u,f,h,N){if(typeof f!="function")throw new TypeError("The listener must be a function");var m=new o(f,h||c,N),_=r?r+u:u;return c._events[_]?c._events[_].fn?c._events[_]=[c._events[_],m]:c._events[_].push(m):(c._events[_]=m,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,h;if(this._eventsCount===0)return u;for(h in f=this._events)t.call(f,h)&&u.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=r?r+u:u,h=this._events[f];if(!h)return[];if(h.fn)return[h.fn];for(var N=0,m=h.length,_=new Array(m);N<m;N++)_[N]=h[N].fn;return _},l.prototype.listenerCount=function(u){var f=r?r+u:u,h=this._events[f];return h?h.fn?1:h.length:0},l.prototype.emit=function(u,f,h,N,m,_){var T=r?r+u:u;if(!this._events[T])return!1;var v=this._events[T],P=arguments.length,B,b;if(v.fn){switch(v.once&&this.removeListener(u,v.fn,void 0,!0),P){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,f),!0;case 3:return v.fn.call(v.context,f,h),!0;case 4:return v.fn.call(v.context,f,h,N),!0;case 5:return v.fn.call(v.context,f,h,N,m),!0;case 6:return v.fn.call(v.context,f,h,N,m,_),!0}for(b=1,B=new Array(P-1);b<P;b++)B[b-1]=arguments[b];v.fn.apply(v.context,B)}else{var oe=v.length,R;for(b=0;b<oe;b++)switch(v[b].once&&this.removeListener(u,v[b].fn,void 0,!0),P){case 1:v[b].fn.call(v[b].context);break;case 2:v[b].fn.call(v[b].context,f);break;case 3:v[b].fn.call(v[b].context,f,h);break;case 4:v[b].fn.call(v[b].context,f,h,N);break;default:if(!B)for(R=1,B=new Array(P-1);R<P;R++)B[R-1]=arguments[R];v[b].fn.apply(v[b].context,B)}}return!0},l.prototype.on=function(u,f,h){return a(this,u,f,h,!1)},l.prototype.once=function(u,f,h){return a(this,u,f,h,!0)},l.prototype.removeListener=function(u,f,h,N){var m=r?r+u:u;if(!this._events[m])return this;if(!f)return s(this,m),this;var _=this._events[m];if(_.fn)_.fn===f&&(!N||_.once)&&(!h||_.context===h)&&s(this,m);else{for(var T=0,v=[],P=_.length;T<P;T++)(_[T].fn!==f||N&&!_[T].once||h&&_[T].context!==h)&&v.push(_[T]);v.length?this._events[m]=v.length===1?v[0]:v:s(this,m)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=r?r+u:u,this._events[f]&&s(this,f)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(Ee)),Ee.exports}qt();const D=Symbol.for("@ts-pattern/matcher"),ft=Symbol.for("@ts-pattern/isVariadic"),ye="@ts-pattern/anonymous-select-key",Pe=e=>!!(e&&typeof e=="object"),me=e=>e&&!!e[D],A=(e,t,r)=>{if(me(e)){const n=e[D](),{matched:o,selections:a}=n.match(t);return o&&a&&Object.keys(a).forEach(s=>r(s,a[s])),o}if(Pe(e)){if(!Pe(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],o=[],a=[];for(const s of e.keys()){const l=e[s];me(l)&&l[ft]?a.push(l):a.length?o.push(l):n.push(l)}if(a.length){if(a.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+o.length)return!1;const s=t.slice(0,n.length),l=o.length===0?[]:t.slice(-o.length),c=t.slice(n.length,o.length===0?1/0:-o.length);return n.every((u,f)=>A(u,s[f],r))&&o.every((u,f)=>A(u,l[f],r))&&(a.length===0||A(a[0],c,r))}return e.length===t.length&&e.every((s,l)=>A(s,t[l],r))}return Reflect.ownKeys(e).every(n=>{const o=e[n];return(n in t||me(a=o)&&a[D]().matcherType==="optional")&&A(o,t[n],r);var a})}return Object.is(t,e)},V=e=>{var t,r,n;return Pe(e)?me(e)?(t=(r=(n=e[D]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?ue(e,V):ue(Object.values(e),V):[]},ue=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function Xt(...e){if(e.length===1){const[t]=e;return r=>A(t,r,()=>{})}if(e.length===2){const[t,r]=e;return A(t,r,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function O(e){return Object.assign(e,{optional:()=>We(e),and:t=>C(e,t),or:t=>pt(e,t),select:t=>t===void 0?de(e):de(t,e)})}function Be(e){return Object.assign((t=>Object.assign(t,{[Symbol.iterator](){let r=0;const n=[{value:Object.assign(t,{[ft]:!0}),done:!1},{done:!0,value:void 0}];return{next:()=>{var o;return(o=n[r++])!=null?o:n.at(-1)}}}}))(e),{optional:()=>Be(We(e)),select:t=>Be(t===void 0?de(e):de(t,e))})}function We(e){return O({[D]:()=>({match:t=>{let r={};const n=(o,a)=>{r[o]=a};return t===void 0?(V(e).forEach(o=>n(o,void 0)),{matched:!0,selections:r}):{matched:A(e,t,n),selections:r}},getSelectionKeys:()=>V(e),matcherType:"optional"})})}const Qt=(e,t)=>{for(const r of e)if(!t(r))return!1;return!0},Yt=(e,t)=>{for(const[r,n]of e.entries())if(!t(n,r))return!1;return!0},Zt=(e,t)=>{const r=Reflect.ownKeys(e);for(const n of r)if(!t(n,e[n]))return!1;return!0};function C(...e){return O({[D]:()=>({match:t=>{let r={};const n=(o,a)=>{r[o]=a};return{matched:e.every(o=>A(o,t,n)),selections:r}},getSelectionKeys:()=>ue(e,V),matcherType:"and"})})}function pt(...e){return O({[D]:()=>({match:t=>{let r={};const n=(o,a)=>{r[o]=a};return ue(e,V).forEach(o=>n(o,void 0)),{matched:e.some(o=>A(o,t,n)),selections:r}},getSelectionKeys:()=>ue(e,V),matcherType:"or"})})}function g(e){return{[D]:()=>({match:t=>({matched:!!e(t)})})}}function de(...e){const t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return O({[D]:()=>({match:n=>{let o={[t??ye]:n};return{matched:r===void 0||A(r,n,(a,s)=>{o[a]=s}),selections:o}},getSelectionKeys:()=>[t??ye].concat(r===void 0?[]:V(r))})})}function ht(e){return!0}function z(e){return typeof e=="number"}function q(e){return typeof e=="string"}function X(e){return typeof e=="bigint"}const vt=O(g(ht)),$t=O(g(ht)),er=vt,Q=e=>Object.assign(O(e),{startsWith:t=>{return Q(C(e,(r=t,g(n=>q(n)&&n.startsWith(r)))));var r},endsWith:t=>{return Q(C(e,(r=t,g(n=>q(n)&&n.endsWith(r)))));var r},minLength:t=>Q(C(e,(r=>g(n=>q(n)&&n.length>=r))(t))),length:t=>Q(C(e,(r=>g(n=>q(n)&&n.length===r))(t))),maxLength:t=>Q(C(e,(r=>g(n=>q(n)&&n.length<=r))(t))),includes:t=>{return Q(C(e,(r=t,g(n=>q(n)&&n.includes(r)))));var r},regex:t=>{return Q(C(e,(r=t,g(n=>q(n)&&!!n.match(r)))));var r}}),Qe=Q(g(q)),F=e=>Object.assign(O(e),{between:(t,r)=>F(C(e,((n,o)=>g(a=>z(a)&&n<=a&&o>=a))(t,r))),lt:t=>F(C(e,(r=>g(n=>z(n)&&n<r))(t))),gt:t=>F(C(e,(r=>g(n=>z(n)&&n>r))(t))),lte:t=>F(C(e,(r=>g(n=>z(n)&&n<=r))(t))),gte:t=>F(C(e,(r=>g(n=>z(n)&&n>=r))(t))),int:()=>F(C(e,g(t=>z(t)&&Number.isInteger(t)))),finite:()=>F(C(e,g(t=>z(t)&&Number.isFinite(t)))),positive:()=>F(C(e,g(t=>z(t)&&t>0))),negative:()=>F(C(e,g(t=>z(t)&&t<0)))}),tr=F(g(z)),Y=e=>Object.assign(O(e),{between:(t,r)=>Y(C(e,((n,o)=>g(a=>X(a)&&n<=a&&o>=a))(t,r))),lt:t=>Y(C(e,(r=>g(n=>X(n)&&n<r))(t))),gt:t=>Y(C(e,(r=>g(n=>X(n)&&n>r))(t))),lte:t=>Y(C(e,(r=>g(n=>X(n)&&n<=r))(t))),gte:t=>Y(C(e,(r=>g(n=>X(n)&&n>=r))(t))),positive:()=>Y(C(e,g(t=>X(t)&&t>0))),negative:()=>Y(C(e,g(t=>X(t)&&t<0)))}),rr=Y(g(X)),nr=O(g(function(e){return typeof e=="boolean"})),or=O(g(function(e){return typeof e=="symbol"})),ar=O(g(function(e){return e==null})),ir=O(g(function(e){return e!=null}));var gt={__proto__:null,matcher:D,optional:We,array:function(...e){return Be({[D]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const r=e[0];let n={};if(t.length===0)return V(r).forEach(a=>{n[a]=[]}),{matched:!0,selections:n};const o=(a,s)=>{n[a]=(n[a]||[]).concat([s])};return{matched:t.every(a=>A(r,a,o)),selections:n}},getSelectionKeys:()=>e.length===0?[]:V(e[0])})})},set:function(...e){return O({[D]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};if(e.length===0)return{matched:!0};const n=(a,s)=>{r[a]=(r[a]||[]).concat([s])},o=e[0];return{matched:Qt(t,a=>A(o,a,n)),selections:r}},getSelectionKeys:()=>e.length===0?[]:V(e[0])})})},map:function(...e){return O({[D]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};const n=(l,c)=>{r[l]=(r[l]||[]).concat([c])};if(e.length===0)return{matched:!0};var o;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(o=e[0])==null?void 0:o.toString()}`);const[a,s]=e;return{matched:Yt(t,(l,c)=>{const u=A(a,c,n),f=A(s,l,n);return u&&f}),selections:r}},getSelectionKeys:()=>e.length===0?[]:[...V(e[0]),...V(e[1])]})})},record:function(...e){return O({[D]:()=>({match:t=>{if(t===null||typeof t!="object"||Array.isArray(t))return{matched:!1};var r;if(e.length===0)throw new Error(`\`P.record\` wasn't given enough arguments. Expected (value) or (key, value), received ${(r=e[0])==null?void 0:r.toString()}`);let n={};const o=(l,c)=>{n[l]=(n[l]||[]).concat([c])},[a,s]=e.length===1?[Qe,e[0]]:e;return{matched:Zt(t,(l,c)=>{const u=typeof l!="string"||Number.isNaN(Number(l))?null:Number(l),f=u!==null&&A(a,u,o),h=A(a,l,o),N=A(s,c,o);return(h||f)&&N}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...V(e[0]),...V(e[1])]})})},intersection:C,union:pt,not:function(e){return O({[D]:()=>({match:t=>({matched:!A(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:g,select:de,any:vt,unknown:$t,_:er,string:Qe,number:tr,bigint:rr,boolean:nr,symbol:or,nullish:ar,nonNullable:ir,instanceOf:function(e){return O(g((function(t){return r=>r instanceof t})(e)))},shape:function(e){return O(g(Xt(e)))}};let sr=class extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}};const Ve={matched:!1,value:void 0};function K(e){return new lr(e,Ve)}let lr=class De{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;const r=t[t.length-1],n=[t[0]];let o;t.length===3&&typeof t[1]=="function"?o=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let a=!1,s={};const l=(u,f)=>{a=!0,s[u]=f},c=!n.some(u=>A(u,this.input,l))||o&&!o(this.input)?Ve:{matched:!0,value:r(a?ye in s?s[ye]:s:this.input,this.input)};return new De(this.input,c)}when(t,r){if(this.state.matched)return this;const n=!!t(this.input);return new De(this.input,n?{matched:!0,value:r(this.input,this.input)}:Ve)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(t=cr){return this.state.matched?this.state.value:t(this.input)}run(){return this.exhaustive()}returnType(){return this}narrow(){return this}};function cr(e){throw new sr(e)}const re={STANDBY:"standby",CONNECTING:"connecting",READY:"ready",HANDSHAKE:"handshake",HANDSHAKE_PARTIAL:"handshake-partial",ENCRYPTED:"encrypted"},se={CREATED:"created",SIGNALING:"signaling",READY:"ready",CONNECTED:"connected",DISCONNECTED:"disconnected"},$={STANDBY:"standby",CREATING:"creating",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error"};var Oe={exports:{}};var Ye;function ur(){return Ye||(Ye=1,(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var a="",s=0;s<arguments.length;s++){var l=arguments[s];l&&(a=o(a,n(l)))}return a}function n(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return r.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var s="";for(var l in a)t.call(a,l)&&a[l]&&(s=o(s,l));return s}function o(a,s){return s?a?a+" "+s:a+s:a}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Oe)),Oe.exports}var dr=ur();const ne=Jt(dr),mt=p.createContext({provider:void 0}),fr=({provider:e,onClose:t})=>i.jsx(mt.Provider,{value:{provider:e},children:i.jsx(Dt,{onClose:t})}),pr=()=>{const e=d.useContext(mt);if(!e.provider)throw new Error("Provider not found");return e},fe=()=>{const{provider:e}=pr(),[t,r]=d.useState(e?.getState().status||$.ERROR);if(d.useEffect(()=>{const n=a=>{r(a)};e?.on("status_change",n);const o=e?.getState().status;return o&&r(o),()=>{e?.off("status_change",n)}},[e]),!e)throw new Error("Provider not found");return{provider:e,status:t}},Ge=(...e)=>console.log("%c[modal]%c","color: yellow; font-weight: bold","color: inherit; font-weight: normal",...e),bt=(e,t,r)=>{d.useEffect(()=>(e?.on(t,r),()=>{e?.off(t,r)}),[e,t])},He=()=>{const{provider:e}=fe(),[t,r]=d.useState(e?.storage.getSettings());bt(e?.storage.emitter,"settings_change",l=>{r(l)});const n=l=>{if(!t||t.signaling?.p===l)return;const c={...t,signaling:{...t.signaling,p:l}};r(c),e?.storage.setSettings(c)},o=l=>{if(!t||t.signaling?.s[t.signaling?.p]===l)return;const c={...t,signaling:{...t.signaling,s:{...t.signaling.s,[t.signaling.p]:l}}};r(c),e?.storage.setSettings(c)},a=l=>{t&&(r({...t,retainHistory:l}),e?.storage.setSettings({...t,retainHistory:l}))},s=l=>{t&&(r({...t,autoReconnect:l}),e?.storage.setSettings({...t,autoReconnect:l}))};if(!t)throw new Error("Settings not found");return{settings:t,updateSignalingProtocol:n,updateSignalingServer:o,updateRetainHistory:a,updateAutoReconnect:s}},pe=()=>{const{provider:e}=fe(),[t,r]=d.useState(e?.getSession()),n=t?.getHandshakeParameters(),o=n?Ut(n):void 0,[a,s]=d.useState(t?.getState());return bt(t?.emitter,"state_change",l=>{Ge("session state change: ",l),s(l)}),d.useEffect(()=>{const l=()=>{const u=e?.getSession();u&&r(u)};e?.on("status_change",l);const c=e?.getSession();return c&&r(c),()=>{e?.off("status_change",l)}},[e]),d.useEffect(()=>{const l=c=>{r(c),s(c.getState())};return e?.on("session_started",l),()=>{e?.off("session_started",l)}},[e]),d.useEffect(()=>{t&&s(t.getState())},[t]),{uri:o,status:a}},hr=()=>{const{provider:e}=fe(),{settings:t}=He();return{start:()=>{const r=t?.signaling?.p,n=t?.signaling?.s[r];if(!r||!n)throw new Error("Invalid protocol or server");return e?.createSession({p:r,s:n})}}},Ie=({state:e})=>{const{status:t,uri:r}=pe(),{status:n}=fe();return console.error("Unknown state: ",{state:e,sessionStatus:t,providerStatus:n}),i.jsxs("div",{className:"rounded-md bg-(--lv-control-button-secondary-background) p-2 text-(--lv-text-muted)",children:[i.jsxs("div",{children:["Unknown state: ",JSON.stringify(e)]}),i.jsxs("div",{children:["URI: ",r]}),i.jsxs("div",{children:["Session Status: ",JSON.stringify(t)]}),i.jsxs("div",{children:["Provider Status: ",JSON.stringify(n)]})]})},vr=({onCopy:e})=>{const{uri:t}=pe(),r=d.useCallback(()=>{t&&e(t)},[t,e]),n=d.useCallback(o=>{const a=Ht.default,s=a(0,"M");return s.addData(o),s.make(),s.createSvgTag({cellSize:5,margin:0,scalable:!0})},[]);return i.jsxs("div",{className:"flex flex-col items-center gap-4 px-2",children:[i.jsxs("div",{className:"w-full space-y-4 rounded-md border border-(--lv-control-button-secondary-border) bg-(--lv-card-background) p-4",children:[t&&i.jsx("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:i.jsx("button",{className:"h-[200px] w-[200px] cursor-pointer rounded bg-(--lv-qr-background) text-(--lv-qr-color)",onClick:r,title:"Click to copy connection URL",dangerouslySetInnerHTML:{__html:n(t)}})}),i.jsx("div",{className:"w-full",children:i.jsx("button",{type:"button",onClick:r,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)",children:"Copy Connection URL"})})]}),i.jsxs("div",{className:"w-full text-sm text-(--lv-text-secondary)",children:[i.jsx("span",{children:"Scan the code above using your mobile wallet."}),i.jsx("br",{}),i.jsx("span",{children:"Or copy the link and paste it into your wallet."})]})]})},gr=()=>typeof document<"u"&&"startViewTransition"in document,mr=e=>{gr()?document.startViewTransition(e):e()},Ze=()=>i.jsx("div",{className:"flex items-center justify-center",children:i.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-blue-500 border-t-transparent"})}),E={CREATING:"creating",CONNECTING:"connecting",READY:"ready",CONFIRMING:"confirming",CONNECTED:"connected",DISCONNECTED:"disconnected",ERROR:"error"},br=e=>{const[t,r]=d.useState(e),n=d.useRef(e);return d.useEffect(()=>{e!==n.current&&mr(()=>{r(e),n.current=e})},[e]),{displayState:t}},yr=e=>e?K(e).with({status:se.CREATED},()=>E.CREATING).with({status:se.SIGNALING,signaling:gt.select()},t=>K(t).with({state:re.STANDBY},()=>E.CONNECTING).with({state:re.CONNECTING},()=>E.CONNECTING).with({state:re.READY},()=>E.READY).with({state:re.HANDSHAKE},()=>E.CONFIRMING).with({state:re.HANDSHAKE_PARTIAL},()=>E.CONFIRMING).with({state:re.ENCRYPTED},()=>E.CONNECTED).otherwise(()=>E.CONNECTING)).with({status:se.READY},()=>E.READY).with({status:se.CONNECTED},()=>E.CONNECTED).with({status:se.DISCONNECTED},()=>E.DISCONNECTED).otherwise(()=>E.ERROR):E.CONNECTING,wr=({onClose:e,onCopy:t})=>{const{status:r}=pe(),{displayState:n}=br(yr(r));return i.jsx("div",{style:{viewTransitionName:"connection-flow"},className:"w-full",children:K(n).with(E.CREATING,()=>i.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[i.jsx(Ze,{}),i.jsxs("div",{className:"text-center",children:[i.jsx("h3",{className:"mb-2 font-semibold text-(--lv-text-primary) text-lg",children:"Preparing connection"}),i.jsx("p",{className:"text-(--lv-text-muted) text-sm",children:"Generating keys…"})]})]})).with(E.CONNECTING,()=>i.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[i.jsx(Ze,{}),i.jsxs("div",{className:"text-center",children:[i.jsx("h3",{className:"mb-2 font-semibold text-(--lv-text-primary) text-lg",children:"Connecting"}),i.jsx("p",{className:"text-(--lv-text-muted) text-sm",children:"Waiting for network connection..."})]})]})).with(E.READY,()=>i.jsx(vr,{onCopy:t})).with(E.CONFIRMING,()=>i.jsx("div",{className:"flex flex-col items-center gap-4 p-6",children:i.jsx("div",{className:"text-center",children:i.jsx("h3",{className:"mb-2 font-semibold text-(--lv-text-primary) text-lg",children:"Establishing e2e encryption..."})})})).with(E.CONNECTED,()=>i.jsx("div",{className:"flex flex-col items-center gap-4 p-6",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mb-4 text-4xl",children:"✅"}),i.jsx("h3",{className:"mb-2 font-semibold text-(--lv-text-primary) text-lg",children:"Connected Successfully!"}),i.jsx("p",{className:"text-(--lv-text-muted) text-sm",children:"Your wallet is now connected and ready to use."})]})})).with(E.DISCONNECTED,()=>i.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mb-4 text-4xl",children:"🔌"}),i.jsx("h3",{className:"mb-2 font-semibold text-(--lv-text-primary) text-lg",children:"Disconnected"}),i.jsx("p",{className:"mb-4 text-(--lv-text-muted) text-sm",children:"The connection has been closed."})]}),i.jsx("button",{type:"button",onClick:e,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)",children:"Close"})]})).otherwise(()=>i.jsx(Ie,{state:r}))})};function yt(e,t){for(var r in t)e[r]=t[r];return e}function Me(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function wt(e,t){var r=t(),n=d.useState({t:{__:r,u:t}}),o=n[0].t,a=n[1];return d.useLayoutEffect(function(){o.__=r,o.u=t,Re(o)&&a({t:o})},[e,r,t]),d.useEffect(function(){return Re(o)&&a({t:o}),e(function(){Re(o)&&a({t:o})})},[e]),r}function Re(e){var t,r,n=e.u,o=e.__;try{var a=n();return!((t=o)===(r=a)&&(t!==0||1/t==1/r)||t!=t&&r!=r)}catch{return!0}}function xt(e){e()}function kt(e){return e}function _t(){return[!1,xt]}var Ct=d.useLayoutEffect;function Le(e,t){this.props=e,this.context=t}function xr(e,t){function r(o){var a=this.props.ref,s=a==o.ref;return!s&&a&&(a.call?a(null):a.current=null),t?!t(this.props,o)||!s:Me(this.props,o)}function n(o){return this.shouldComponentUpdate=r,p.createElement(e,o)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n.type=e,n}(Le.prototype=new p.Component).isPureReactComponent=!0,Le.prototype.shouldComponentUpdate=function(e,t){return Me(this.props,e)||Me(this.state,t)};var $e=p.options.__b;p.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),$e&&$e(e)};var kr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function _r(e){function t(r){var n=yt({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=kr,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var et=function(e,t){return e==null?null:p.toChildArray(p.toChildArray(e).map(t))},Cr={map:et,forEach:et,count:function(e){return e?p.toChildArray(e).length:0},only:function(e){var t=p.toChildArray(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:p.toChildArray},Nr=p.options.__e;p.options.__e=function(e,t,r,n){if(e.then){for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),o.__c(e,t)}Nr(e,t,r,n)};var tt=p.options.unmount;function Nt(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=yt({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Nt(n,t,r)})),e}function St(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return St(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function be(){this.__u=0,this.o=null,this.__b=null}function jt(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Sr(e){var t,r,n,o=null;function a(s){if(t||(t=e()).then(function(l){l&&(o=l.default||l),n=!0},function(l){r=l,n=!0}),r)throw r;if(!n)throw t;return o?p.createElement(o,s):null}return a.displayName="Lazy",a.__f=!0,a}function le(){this.i=null,this.l=null}p.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),tt&&tt(e)},(be.prototype=new p.Component).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var o=jt(n.__v),a=!1,s=function(){a||(a=!0,r.__R=null,o?o(l):l())};r.__R=s;var l=function(){if(!--n.__u){if(n.state.__a){var c=n.state.__a;n.__v.__k[0]=St(c,c.__c.__P,c.__c.__O)}var u;for(n.setState({__a:n.__b=null});u=n.o.pop();)u.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(s,s)},be.prototype.componentWillUnmount=function(){this.o=[]},be.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Nt(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&p.createElement(p.Fragment,null,e.fallback);return o&&(o.__u&=-33),[p.createElement(p.Fragment,null,t.__a?null:e.children),o]};var rt=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};function jr(e){return this.getChildContext=function(){return e.context},e.children}function Ar(e){var t=this,r=e.h;if(t.componentWillUnmount=function(){p.render(null,t.v),t.v=null,t.h=null},t.h&&t.h!==r&&t.componentWillUnmount(),!t.v){for(var n=t.__v;n!==null&&!n.__m&&n.__!==null;)n=n.__;t.h=r,t.v={nodeType:1,parentNode:r,childNodes:[],__k:{__m:n.__m},contains:function(){return!0},insertBefore:function(o,a){this.childNodes.push(o),t.h.insertBefore(o,a)},removeChild:function(o){this.childNodes.splice(this.childNodes.indexOf(o)>>>1,1),t.h.removeChild(o)}}}p.render(p.createElement(jr,{context:t.context},e.__v),t.v)}function Er(e,t){var r=p.createElement(Ar,{__v:e,h:t});return r.containerInfo=t,r}(le.prototype=new p.Component).__a=function(e){var t=this,r=jt(t.__v),n=t.l.get(e);return n[0]++,function(o){var a=function(){t.props.revealOrder?(n.push(o),rt(t,e,n)):o()};r?r(a):a()}},le.prototype.render=function(e){this.i=null,this.l=new Map;var t=p.toChildArray(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},le.prototype.componentDidUpdate=le.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){rt(e,r,t)})};var At=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Or=/^(?: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]/,Rr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Tr=/[A-Z0-9]/g,Pr=typeof document<"u",Br=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Vr(e,t,r){return t.__k==null&&(t.textContent=""),p.render(e,t),typeof r=="function"&&r(),e?e.__c:null}function Dr(e,t,r){return p.hydrate(e,t),typeof r=="function"&&r(),e?e.__c:null}p.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(p.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var nt=p.options.event;function Ir(){}function Mr(){return this.cancelBubble}function Lr(){return this.defaultPrevented}p.options.event=function(e){return nt&&(e=nt(e)),e.persist=Ir,e.isPropagationStopped=Mr,e.isDefaultPrevented=Lr,e.nativeEvent=e};var Ke,zr={enumerable:!1,configurable:!0,get:function(){return this.class}},ot=p.options.vnode;p.options.vnode=function(e){typeof e.type=="string"&&(function(t){var r=t.props,n=t.type,o={},a=n.indexOf("-")===-1;for(var s in r){var l=r[s];if(!(s==="value"&&"defaultValue"in r&&l==null||Pr&&s==="children"&&n==="noscript"||s==="class"||s==="className")){var c=s.toLowerCase();s==="defaultValue"&&"value"in r&&r.value==null?s="value":s==="download"&&l===!0?l="":c==="translate"&&l==="no"?l=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?s="ondblclick":c!=="onchange"||n!=="input"&&n!=="textarea"||Br(r.type)?c==="onfocus"?s="onfocusin":c==="onblur"?s="onfocusout":Rr.test(s)&&(s=c):c=s="oninput":a&&Or.test(s)?s=s.replace(Tr,"-$&").toLowerCase():l===null&&(l=void 0),c==="oninput"&&o[s=c]&&(s="oninputCapture"),o[s]=l}}n=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=p.toChildArray(r.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=p.toChildArray(r.children).forEach(function(u){u.props.selected=o.multiple?o.defaultValue.indexOf(u.props.value)!=-1:o.defaultValue==u.props.value})),r.class&&!r.className?(o.class=r.class,Object.defineProperty(o,"className",zr)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),t.props=o})(e),e.$$typeof=At,ot&&ot(e)};var at=p.options.__r;p.options.__r=function(e){at&&at(e),Ke=e.__c};var it=p.options.diffed;p.options.diffed=function(e){it&&it(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),Ke=null};var Fr={ReactCurrentDispatcher:{current:{readContext:function(e){return Ke.__n[e.__c].props.value},useCallback:d.useCallback,useContext:d.useContext,useDebugValue:d.useDebugValue,useDeferredValue:kt,useEffect:d.useEffect,useId:d.useId,useImperativeHandle:d.useImperativeHandle,useInsertionEffect:Ct,useLayoutEffect:d.useLayoutEffect,useMemo:d.useMemo,useReducer:d.useReducer,useRef:d.useRef,useState:d.useState,useSyncExternalStore:wt,useTransition:_t}}};function Wr(e){return p.createElement.bind(null,e)}function Ce(e){return!!e&&e.$$typeof===At}function Gr(e){return Ce(e)&&e.type===p.Fragment}function Hr(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function Kr(e){return Ce(e)?p.cloneElement.apply(null,arguments):e}function Ur(e){return!!e.__k&&(p.render(null,e),!0)}function Jr(e){return e&&(e.base||e.nodeType===1&&e)||null}var qr=function(e,t){return e(t)},Xr=function(e,t){return e(t)},Qr=p.Fragment,Yr=Ce,ee={useState:d.useState,useId:d.useId,useReducer:d.useReducer,useEffect:d.useEffect,useLayoutEffect:d.useLayoutEffect,useInsertionEffect:Ct,useTransition:_t,useDeferredValue:kt,useSyncExternalStore:wt,startTransition:xt,useRef:d.useRef,useImperativeHandle:d.useImperativeHandle,useMemo:d.useMemo,useCallback:d.useCallback,useContext:d.useContext,useDebugValue:d.useDebugValue,version:"18.3.1",Children:Cr,render:Vr,hydrate:Dr,unmountComponentAtNode:Ur,createPortal:Er,createElement:p.createElement,createContext:p.createContext,createFactory:Wr,cloneElement:Kr,createRef:p.createRef,Fragment:p.Fragment,isValidElement:Ce,isElement:Yr,isFragment:Gr,isMemo:Hr,findDOMNode:Jr,Component:p.Component,PureComponent:Le,memo:xr,forwardRef:_r,flushSync:Xr,unstable_batchedUpdates:qr,StrictMode:Qr,Suspense:be,SuspenseList:le,lazy:Sr,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Fr},Et={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},st=ee.createContext&&ee.createContext(Et),Zr=["attr","size","title"];function $r(e,t){if(e==null)return{};var r=en(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function en(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function we(){return we=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},we.apply(this,arguments)}function lt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function xe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lt(Object(r),!0).forEach(function(n){tn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tn(e,t,r){return t=rn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rn(e){var t=nn(e,"string");return typeof t=="symbol"?t:t+""}function nn(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ot(e){return e&&e.map((t,r)=>ee.createElement(t.tag,xe({key:r},t.attr),Ot(t.child)))}function Ne(e){return t=>ee.createElement(on,we({attr:xe({},e.attr)},t),Ot(e.child))}function on(e){var t=r=>{var{attr:n,size:o,title:a}=e,s=$r(e,Zr),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),ee.createElement("svg",we({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:xe(xe({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&ee.createElement("title",null,a),e.children)};return st!==void 0?ee.createElement(st.Consumer,null,r=>t(r)):t(Et)}function an(e){return Ne({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:[]}]})(e)}var sn=/\s+/g,ln=e=>typeof e!="string"||!e?e:e.replace(sn," ").trim(),ke=(...e)=>{const t=[],r=n=>{if(!n&&n!==0&&n!==0n)return;if(Array.isArray(n)){for(let a=0,s=n.length;a<s;a++)r(n[a]);return}const o=typeof n;if(o==="string"||o==="number"||o==="bigint"){if(o==="number"&&n!==n)return;t.push(String(n))}else if(o==="object"){const a=Object.keys(n);for(let s=0,l=a.length;s<l;s++){const c=a[s];n[c]&&t.push(c)}}};for(let n=0,o=e.length;n<o;n++){const a=e[n];a!=null&&r(a)}return t.length>0?ln(t.join(" ")):void 0},ct=e=>e===!1?"false":e===!0?"true":e===0?"0":e,I=e=>{if(!e||typeof e!="object")return!0;for(const t in e)return!1;return!0},cn=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let o=0;o<r.length;o++){const a=r[o];if(!n.includes(a)||e[a]!==t[a])return!1}return!0},un=(e,t)=>{for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const n=t[r];r in e?e[r]=ke(e[r],n):e[r]=n}return e},Rt=(e,t)=>{for(let r=0;r<e.length;r++){const n=e[r];Array.isArray(n)?Rt(n,t):n&&t.push(n)}},Tt=(...e)=>{const t=[];Rt(e,t);const r=[];for(let n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r},ze=(e,t)=>{const r={};for(const n in e){const o=e[n];if(n in t){const a=t[n];Array.isArray(o)||Array.isArray(a)?r[n]=Tt(a,o):typeof o=="object"&&typeof a=="object"&&o&&a?r[n]=ze(o,a):r[n]=a+" "+o}else r[n]=o}for(const n in t)n in e||(r[n]=t[n]);return r},dn={twMerge:!0,twMergeConfig:{}};function fn(){let e=null,t={},r=!1;return{get cachedTwMerge(){return e},set cachedTwMerge(n){e=n},get cachedTwMergeConfig(){return t},set cachedTwMergeConfig(n){t=n},get didTwMergeConfigChange(){return r},set didTwMergeConfigChange(n){r=n},reset(){e=null,t={},r=!1}}}var Te=fn(),pn=e=>{const t=(n,o)=>{const{extend:a=null,slots:s={},variants:l={},compoundVariants:c=[],compoundSlots:u=[],defaultVariants:f={}}=n,h={...dn,...o},N=a?.base?ke(a.base,n?.base):n?.base,m=a?.variants&&!I(a.variants)?ze(l,a.variants):l,_=a?.defaultVariants&&!I(a.defaultVariants)?{...a.defaultVariants,...f}:f;!I(h.twMergeConfig)&&!cn(h.twMergeConfig,Te.cachedTwMergeConfig)&&(Te.didTwMergeConfigChange=!0,Te.cachedTwMergeConfig=h.twMergeConfig);const T=I(a?.slots),v=I(s)?{}:{base:ke(n?.base,T&&a?.base),...s},P=T?v:un({...a?.slots},I(v)?{base:n?.base}:v),B=I(a?.compoundVariants)?c:Tt(a?.compoundVariants,c),b=R=>{if(I(m)&&I(s)&&T)return e(N,R?.class,R?.className)(h);if(B&&!Array.isArray(B))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof B}`);if(u&&!Array.isArray(u))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof u}`);const U=(w,k=m,x=null,S=null)=>{const y=k[w];if(!y||I(y))return null;const j=S?.[w]??R?.[w];if(j===null)return null;const M=ct(j);if(typeof M=="object")return null;const J=_?.[w],L=M??ct(J);return y[L||"false"]},Z=()=>{if(!m)return null;const w=Object.keys(m),k=[];for(let x=0;x<w.length;x++){const S=U(w[x],m);S&&k.push(S)}return k},je=(w,k)=>{if(!m||typeof m!="object")return null;const x=[];for(const S in m){const y=U(S,m,w,k),j=w==="base"&&typeof y=="string"?y:y&&y[w];j&&x.push(j)}return x},ae={};for(const w in R){const k=R[w];k!==void 0&&(ae[w]=k)}const W=(w,k)=>{const x=typeof R?.[w]=="object"?{[w]:R[w]?.initial}:{};return{..._,...ae,...x,...k}},ie=(w=[],k)=>{const x=[],S=w.length;for(let y=0;y<S;y++){const{class:j,className:M,...J}=w[y];let L=!0;const G=W(null,k);for(const te in J){const H=J[te],ve=G[te];if(Array.isArray(H)){if(!H.includes(ve)){L=!1;break}}else{if((H==null||H===!1)&&(ve==null||ve===!1))continue;if(ve!==H){L=!1;break}}}L&&(j&&x.push(j),M&&x.push(M))}return x},Ae=w=>{const k=ie(B,w);if(!Array.isArray(k))return k;const x={},S=e;for(let y=0;y<k.length;y++){const j=k[y];if(typeof j=="string")x.base=S(x.base,j)(h);else if(typeof j=="object")for(const M in j)x[M]=S(x[M],j[M])(h)}return x},he=w=>{if(u.length<1)return null;const k={},x=W(null,w);for(let S=0;S<u.length;S++){const{slots:y=[],class:j,className:M,...J}=u[S];if(!I(J)){let L=!0;for(const G in J){const te=x[G],H=J[G];if(te===void 0||(Array.isArray(H)?!H.includes(te):H!==te)){L=!1;break}}if(!L)continue}for(let L=0;L<y.length;L++){const G=y[L];k[G]||(k[G]=[]),k[G].push([j,M])}}return k};if(!I(s)||!T){const w={};if(typeof P=="object"&&!I(P)){const k=e;for(const x in P)w[x]=S=>{const y=Ae(S),j=he(S);return k(P[x],je(x,S),y?y[x]:void 0,j?j[x]:void 0,S?.class,S?.className)(h)}}return w}return e(N,Z(),ie(B),R?.class,R?.className)(h)},oe=()=>{if(!(!m||typeof m!="object"))return Object.keys(m)};return b.variantKeys=oe(),b.extend=a,b.base=N,b.slots=P,b.variants=m,b.defaultVariants=_,b.compoundSlots=u,b.compoundVariants=B,b};return{tv:t,createTV:n=>(o,a)=>t(o,a?ze(n,a):n)}},hn=(...e)=>t=>ke(e)||void 0,{tv:Ue}=pn(hn);const ut=Ue({base:"flex items-center justify-center rounded-lg transition-all duration-100 cursor-pointer active:scale-95",variants:{$variant:{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))",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))",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))"},$size:{sm:"h-6",md:"h-8",lg:"h-11"},$aspect:{square:"aspect-square",auto:""}},defaultVariants:{$size:"md",$variant:"primary",$aspect:"auto"}});function ce(e){const{children:t,className:r,$variant:n,$size:o,$aspect:a,...s}=e,{href:l,onClick:c}=e;if(l){const f={href:l,onClick:c,className:ne(ut({$variant:n,$size:o,$aspect:a}),r),...s};return p.createElement("a",f,t)}const u={onClick:c,className:ne(ut({$variant:n,$size:o,$aspect:a}),r),...s};return p.createElement("button",u,t)}const vn=({isApple:e})=>i.jsxs("div",{className:"flex h-full w-full justify-between",children:[i.jsx("div",{className:"grow py-1 pl-1",children:i.jsx("div",{className:"h-full rounded-sm border border-gray-300 bg-gray-400"})}),i.jsx("div",{className:"flex h-full w-3 flex-col items-center justify-center gap-0.5 pr-0.5",children:Array.from({length:e?1:3}).map((t,r)=>i.jsx("div",{className:"h-1.5 w-1.5 rounded-full border border-gray-500"},"dot-t-"+r))})]}),gn=({isApple:e})=>i.jsxs("div",{className:"flex h-full w-full flex-col justify-between",children:[i.jsx("div",{className:"grow px-1 pt-1",children:i.jsx("div",{className:"h-full rounded-sm border border-gray-200 bg-gray-300"})}),i.jsx("div",{className:"flex h-3 w-full items-center justify-center gap-0.5 pb-0.5",children:Array.from({length:e?1:3}).map((t,r)=>i.jsx("div",{className:"h-1.5 w-1.5 rounded-full border border-gray-400"},"dot-p-"+r))})]}),mn=()=>i.jsxs("div",{className:"-space-x-4 flex items-end",children:[i.jsx("div",{className:"h-38 w-48 overflow-hidden rounded-lg bg-gray-300",children:i.jsx(vn,{isApple:!0})}),i.jsx("div",{className:"h-18 w-12 overflow-hidden rounded-lg bg-gray-200",children:i.jsx(gn,{isApple:!0})})]}),bn=({onSettings:e})=>{const{start:t}=hr();return i.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[i.jsx(mn,{}),i.jsx("div",{className:"text-center",children:i.jsx("p",{className:"text-sm text-(--lv-text-secondary)",children:"Click the button below to start a connection"})}),i.jsxs("div",{className:"flex items-center",children:[i.jsx(ce,{type:"button",onClick:t,className:"z-10 px-6 py-3",$variant:"primary",$size:"lg",children:"Generate QR"}),i.jsx(ce,{type:"button","aria-label":"Connection settings","aria-pressed":!1,onClick:e,className:"-ml-1 rounded-l-none px-3",$aspect:"square",$size:"lg",$variant:"secondary",children:i.jsx(an,{className:"h-5 w-5 text-(--lv-text-muted)"})})]})]})},yn=async e=>{if(!e)return!1;try{if(navigator?.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();const r=document.execCommand("copy");return document.body.removeChild(t),r}catch{return!1}},dt=(e,{duration:t=200}={})=>{const[r,n]=d.useState(e),[o,a]=d.useState(null),s=d.useRef(),l=d.useRef(e);return d.useEffect(()=>{if(!Object.is(e,l.current))return s.current&&window.clearTimeout(s.current),a(l.current),n(e),l.current=e,s.current=window.setTimeout(()=>{a(null),s.current=void 0},t),()=>{s.current&&window.clearTimeout(s.current)}},[e,t]),{current:r,previous:o,isTransitioning:o!==null}},Pt="data:image/webp;base64,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",wn=()=>{const{status:e}=pe(),t=e?.status,r=e?.signaling?.state,n=K({sessionState:t,signalState:r}).with({sessionState:"connected"},()=>({icon:"✅",text:"Connected Successfully!"})).with({sessionState:"signaling",signalState:"standby"},()=>({icon:"🫥",text:"Connecting"})).with({sessionState:"signaling",signalState:"connecting"},()=>({icon:"↗️",text:"Connecting"})).with({sessionState:"signaling",signalState:"ready"},()=>({icon:"👋",text:"Ready"})).with({sessionState:"signaling",signalState:"handshake"},()=>({icon:"🤝",text:"Handshake Closed"})).with({sessionState:"signaling",signalState:"handshake-partial"},()=>({icon:"🤝",text:"Handshake Partial"})).with({sessionState:"signaling",signalState:"encrypted"},()=>({icon:"🔒",text:"Encrypted"})).with({sessionState:"signaling",signalState:"error"},()=>({icon:"❌",text:"Signal Error"})).otherwise(()=>{});if(!n)return i.jsx(i.Fragment,{});const{icon:o,text:a}=n;return i.jsxs("div",{className:"group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-(--lv-control-button-secondary-background)",children:[i.jsx("div",{className:"pointer-events-none whitespace-nowrap rounded-md text-xs opacity-0 group-hover:opacity-100",children:a}),i.jsx("div",{children:o})]})},xn=()=>i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-11 w-full"}),i.jsxs("div",{className:"absolute inset-x-0 bottom-0 flex items-end justify-between gap-2 px-3 py-2 text-(--lv-text-muted)",children:[i.jsxs("a",{href:"https://github.com/v3xlabs/open-lavatory",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 p-1 font-semibold text-sm text-(--lv-text-muted)",children:[i.jsx("img",{src:Pt,alt:"Open Lavatory Logo",width:20,height:20,className:"rounded","data-openlv-brand-logo":!0}),i.jsx("span",{children:"openlv"})]}),i.jsx("div",{className:"text-sm text-(--lv-text-muted)",children:i.jsx(wn,{})})]})]});function kn(e){return Ne({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:[]}]})(e)}function Bt(e){return Ne({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:[]}]})(e)}function _n(e){return Ne({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:[]}]})(e)}const Cn=({title:e,view:t,onClose:r,onBack:n,setView:o})=>i.jsxs("div",{className:"flex items-center justify-between px-2 py-2",children:[n?i.jsx(ce,{onClick:n,"aria-label":t==="settings"?"Back to QR":"Close modal",$variant:"tertiary",$aspect:"square",$size:"md",children:i.jsx(kn,{className:"h-6 w-6 text-(--lv-text-muted)"})}):i.jsx(ce,{type:"button",onClick:()=>o("info"),$variant:"tertiary",$aspect:"square",$size:"md",children:i.jsx(Bt,{className:"h-5 w-5"})}),i.jsx("h2",{className:"flex items-center justify-center gap-2 font-semibold text-lg text-(--lv-text-primary)",children:e}),i.jsx(ce,{type:"button","aria-label":"close","aria-pressed":!1,onClick:r,$variant:"tertiary",$aspect:"square",$size:"md",children:i.jsx(_n,{className:"h-6 w-6 text-(--lv-text-muted)"})})]}),Je=({title:e,right:t,children:r})=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-end justify-between py-1 pl-2",children:[i.jsx("div",{className:"font-medium text-(--lv-text-primary) text-sm",children:e}),i.jsx("div",{children:t})]}),i.jsx("div",{className:"flex flex-col gap-1 rounded-md bg-(--lv-card-background) p-2",children:r})]}),_e=({label:e,children:t})=>i.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[i.jsx("div",{className:"text-sm text-(--lv-text-secondary)",children:e}),i.jsx("div",{children:t})]}),Nn=Ue({slots:{root:"flex overflow-hidden rounded-md border border-(--lv-control-button-secondary-border)",box:"px-4 py-2 font-semibold text-xs transition border-l first:border-l-0 border-(--lv-control-button-secondary-border)"},variants:{active:{on:{box:"bg-(--lv-control-button-secondary-background) text-(--lv-text-primary)"},off:{box:"bg-transparent text-(--lv-text-secondary) cursor-pointer"}}},defaultVariants:{active:"off"}}),qe=({options:e,value:t,onChange:r})=>{const{root:n,box:o}=Nn({});return i.jsx("div",{className:n(),children:e.map(([a,s])=>i.jsx("button",{type:"button",onClick:()=>r(a),"aria-pressed":a===t,className:o({active:a===t?"on":"off"}),children:s},a))})},Sn=({value:e,onChange:t})=>i.jsx(qe,{options:[["true","Yes"],["false","No"]],value:e?"true":"false",onChange:r=>t(r==="true")}),jn=()=>{const{settings:e,updateRetainHistory:t,updateAutoReconnect:r}=He();return i.jsx(Je,{title:"Connection preferences",children:[["Retain session history","retainHistory",e?.retainHistory??!1,t],["Auto reconnect","autoReconnect",e?.autoReconnect??!1,r]].map(([n,o,a,s])=>i.jsx(_e,{label:n,children:i.jsx(Sn,{label:n,value:a,onChange:s})},o))})},An=Ue({slots:{root:"group relative",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)",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",icon:""},variants:{size:{sm:{box:"h-5 w-5 p-1",icon:"h-3 w-3"},md:{box:"h-6 w-6 p-1",icon:"h-4 w-4"},lg:{box:"h-8 w-8 p-1.5",icon:"h-4 w-4"}},variant:{icon:"",text:""}},defaultVariants:{size:"lg"}}),Vt=({variant:e="icon",children:t,size:r="lg"})=>{const{root:n,box:o,popover:a,icon:s}=An({size:r,variant:e});return i.jsxs("div",{className:n(),children:[i.jsx("div",{className:o(),children:K(e).with("icon",()=>i.jsx(Bt,{className:s()})).with("text",()=>i.jsx("div",{children:"Text"})).exhaustive()}),i.jsx("div",{className:a(),children:t})]})},En="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)",On=({id:e,value:t,placeholder:r,ariaLabel:n,readOnly:o=!0,onChange:a})=>i.jsx("input",{id:e,className:En,value:t,placeholder:r,"aria-label":n,readOnly:o,onChange:s=>{s.target instanceof HTMLInputElement&&a?.(s.target.value)}}),Rn=["MQTT","NTFY","GUN"],Tn=()=>{const{settings:e,updateSignalingProtocol:t,updateSignalingServer:r}=He();return i.jsx("div",{children:i.jsxs(Je,{title:"Signaling",right:i.jsx(Vt,{variant:"icon",children:"Signaling is the handshake protocol used to establish a connection."}),children:[i.jsx(_e,{label:"Protocol",children:i.jsx(qe,{options:Rn.map(n=>[n.toLowerCase(),n]),value:e?.signaling.p||"",onChange:t})}),i.jsx(_e,{label:"Server",children:i.jsx(On,{id:"server",value:e?.signaling.s[e?.signaling.p||""]||"",onChange:n=>r(n),placeholder:"Server URL",ariaLabel:"Server URL",readOnly:!1})})]})})},Pn=["WebRTC"],Bn=()=>{const[e,t]=d.useState("WebRTC");return i.jsx(Je,{title:"Transport",right:i.jsx(Vt,{variant:"icon",children:"This is how the connection is maintained."}),children:i.jsx(_e,{label:"Protocol",children:i.jsx(qe,{options:Pn.map(r=>[r,r]),value:e,onChange:r=>t(r)})})})},Vn=()=>i.jsxs("div",{className:"px-4 pb-2",children:[i.jsx(Tn,{}),i.jsx(Bn,{}),i.jsx(jn,{})]}),Dn=()=>i.jsxs("div",{className:"flex flex-col space-y-2 px-4",children:[i.jsx("div",{className:"min-h-32 w-full rounded-md border border-(--lv-control-button-secondary-border) p-2",children:"Scan QR Code"}),i.jsx("div",{className:"w-full rounded-md border border-border p-2",children:"Approve on device"}),i.jsx("div",{className:"w-full rounded-md border border-border p-2",children:"You're connected!"})]}),In=()=>{const[e,t]=d.useState("start"),[r,n]=d.useState(!1);return d.useEffect(()=>{if(!r)return;const o=window.setTimeout(()=>n(!1),2e3);return()=>window.clearTimeout(o)},[r]),{view:e,setView:t,copied:r,setCopied:n}},Mn=e=>{d.useEffect(()=>{const t=r=>{r.key==="Escape"&&e()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e])},Ln=()=>{const e=d.useRef(null),[t,r]=d.useState(0),n=d.useRef(!1),o=d.useCallback((a,s=!1)=>{const l=a||e.current;if(!l)return;const c=s?l.scrollHeight:l.getBoundingClientRect().height;c>0&&(r(u=>typeof u=="number"&&Math.abs(u-c)<.5?u:c),n.current=!0)},[]);return d.useLayoutEffect(()=>{const a=e.current;if(!a||typeof ResizeObserver>"u")return;const s=new ResizeObserver(()=>{o()});return s.observe(a),()=>s.disconnect()},[o]),d.useEffect(()=>{if(typeof window>"u")return;const a=()=>{o()};return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[o]),{contentRef:e,height:t,measureHeight:o,setHeight:r}},Dt=({onClose:e=()=>{},onCopy:t})=>{const{view:r,setView:n,copied:o,setCopied:a}=In(),{uri:s}=pe(),{status:l,provider:c}=fe(),{contentRef:u,height:f,measureHeight:h}=Ln(),{current:N,previous:m,isTransitioning:_}=dt(r),{current:T,previous:v,isTransitioning:P}=dt(l),B=d.useCallback(()=>n("settings"),[n]),b=K(r).with("start",()=>"Connect Wallet").with("settings",()=>"Settings").with("info",()=>"What is openlv?").exhaustive();Mn(e),d.useEffect(()=>{l===$.CONNECTED&&e()},[l,e]);const oe=d.useCallback(async()=>{s&&await yn(s)&&a(!0)},[s,a]),R=d.useRef(!0),U=d.useRef(),Z=d.useRef(void 0),[je,ae]=d.useState(!1),W=d.useRef();d.useLayoutEffect(()=>{if(u.current)return R.current?(U.current&&window.clearTimeout(U.current),U.current=window.setTimeout(()=>{u.current&&(h(void 0,!0),R.current=!1)},0)):h(),()=>{U.current&&window.clearTimeout(U.current)}},[h,T,N]),d.useEffect(()=>(Z.current!==void 0&&f!==Z.current&&f>0&&Z.current>0&&Math.abs(f-Z.current)>.5&&(ae(!0),W.current&&window.clearTimeout(W.current),W.current=window.setTimeout(()=>{ae(!1),W.current=void 0},200)),Z.current=f,()=>{W.current&&window.clearTimeout(W.current)}),[f]);const ie=()=>{c?.closeSession()},Ae=K({view:r,status:l}).with({view:"start",status:$.STANDBY},()=>{}).with({view:"start"},()=>ie).with({view:"settings"},()=>()=>n("start")).with({view:"info"},()=>()=>n("start")).otherwise(()=>()=>{ie(),e()}),he=y=>K(y).with("start",()=>i.jsx(bn,{onSettings:B})).with("settings",()=>i.jsx(Vn,{})).with("info",()=>i.jsx(Dn,{})).otherwise(()=>i.jsx(Ie,{state:y})),w=()=>i.jsxs("div",{className:"modal-transition__container",children:[m&&i.jsx("div",{className:"modal-transition__layer modal-transition__layer--outgoing",children:he(m)}),i.jsx("div",{className:ne("modal-transition__layer",_&&"modal-transition__layer--incoming"),children:he(N)})]}),k=y=>K(y).with($.STANDBY,()=>w()).with(gt.union($.CREATING,$.CONNECTING,$.CONNECTED),()=>i.jsx(wr,{onClose:e,onCopy:t||oe})).otherwise(j=>i.jsx(Ie,{state:j||"unknown status"}));Ge("view",r);const x={background:"var(--lv-overlay-background, rgba(0,0,0,0.3))",backdropFilter:"var(--lv-overlay-backdrop-filter, blur(4px))"},S={background:"var(--lv-body-background)",color:"var(--lv-body-color, var(--lv-text-primary))",borderRadius:"var(--lv-border-radius, 16px)",boxShadow:"var(--lv-modal-shadow, 0px 12px 32px rgba(0,0,0,0.25))"};return i.jsx("div",{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",onClick:e,role:"presentation","data-openlv-modal-root":!0,style:x,children:i.jsxs("div",{className:ne("relative w-full max-w-[400px] animate-[fade-in_0.15s_ease-in-out] transition-[height] duration-200 ease-out",je||v?"overflow-hidden":void 0),role:"dialog","aria-modal":"true","aria-label":b,onClick:y=>y.stopPropagation(),style:{...typeof f=="number"&&f>0?{height:`${f}px`}:{},...S},children:[i.jsxs("div",{ref:u,children:[i.jsx(Cn,{title:b,view:r,onClose:e,onBack:Ae,setView:n}),i.jsxs("div",{className:"modal-transition__container",children:[v&&i.jsx("div",{className:"modal-transition__layer modal-transition__layer--outgoing absolute",children:i.jsx("div",{className:"flex flex-col text-center",children:k(v)})}),i.jsx("div",{className:ne("modal-transition__layer",P&&"modal-transition__layer--incoming"),children:i.jsx("div",{className:"flex flex-col text-center",children:k(T)})})]}),i.jsx(xn,{})]}),i.jsx("div",{className:ne("absolute top-5 right-5 rounded-lg bg-blue-500 px-4 py-3 font-medium text-sm text-white transition-all",o?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:"📋 Connection URL copied to clipboard!"})]})})},zn=async e=>{if(typeof e=="string"){if(e==="simple")return await Promise.resolve().then(()=>require("./simple-DJcIRSvc.cjs")).then(t=>t.simpleTheme);if(e==="openlv")return await Promise.resolve().then(()=>require("./openlv-SMG3Trx9.cjs")).then(t=>t.openlvTheme);throw new Error(`Unknown theme: ${e}`)}return e};function Fe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const It=(e,t=[],r={})=>{for(const[n,o]of Object.entries(e)){const a=[...t,n];Fe(o)?It(o,a,r):r[`--lv-${a.join("-")}`]=o}return r},Fn=e=>e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,Mt=(e,t)=>{const r={...e};for(const n of Object.keys(t)){const o=e[n],a=t[n];r[n]=Fe(o)&&Fe(a)?Mt(o,a):a}return r},Wn=async e=>{const t=await zn(e.theme),r=Fn(e.mode),n=t[r];if(!n)return"";const o=t.common?Mt(t.common,n):n,a=It(o);return Object.entries(a).map(([s,l])=>`${s}: ${l};`).join(`
2
+ `)},Gn='@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%}.right-5{right:calc(var(--spacing)*5)}.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)}.-ml-1{margin-left:calc(var(--spacing)*-1)}.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}.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)}.translate-x-full{--tw-translate-x:100%;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}.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-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)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.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-\\(--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)}.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)}.pt-1{padding-top:calc(var(--spacing)*1)}.pr-0\\.5{padding-right:calc(var(--spacing)*.5)}.pb-0\\.5{padding-bottom:calc(var(--spacing)*.5)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-2{padding-left:calc(var(--spacing)*2)}.text-center{text-align:center}.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\\:border-l-0:first-child{border-left-style:var(--tw-border-style);border-left-width:0}@media(hover:hover){.hover\\:\\[background-color\\:var\\(--lv-control-button-tertiary-hoverBackground\\)\\]:hover{background-color:var(--lv-control-button-tertiary-hoverBackground)}.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\\,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-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)}}}: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-mode=dark] 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)}}',Hn=async(e,t)=>{if(e){if(e.querySelector("style[data-openlv-modal]"))return;const n=document.createElement("style");n.setAttribute("data-openlv-modal","true");let o=Gn;t&&(o=`:root, :host {
3
+ ${await Wn(t)}
4
+ }
5
+ `+o),n.textContent=o,e.appendChild(n)}};class Se extends HTMLElement{constructor(r){super();ge(this,"shadow");ge(this,"renderRequested",!1);ge(this,"parameters");this.parameters=r,this.shadow=this.attachShadow({mode:"open"}),Hn(this.shadow,this.parameters.theme)}connectedCallback(){this.requestRender()}disconnectedCallback(){p.render(null,this.shadow)}showModal(){this.style.display="block"}hideModal(){this.style.display="none"}requestRender(){this.renderRequested||(this.renderRequested=!0,queueMicrotask(()=>{this.renderRequested=!1,this.performRender()}))}performRender(){p.render(p.h(fr,this.parameters),this.shadow)}}const Kn=(e="idle")=>{const[t,r]=d.useState({state:e}),n=d.useCallback((s,l)=>{r(c=>({...c,state:s,...l}))},[]),o=d.useCallback(s=>{r(s)},[]),a=d.useCallback(()=>{r({state:"idle"})},[]);return{connectionInfo:t,updateState:n,updateConnectionInfo:o,reset:a}},Lt=(e="openlv-modal")=>{if(typeof window>"u")return e;const t=window.customElements;return t?(t.get(e)||t.define(e,Se),e):(console.warn("OpenLV modal: custom elements are not supported in this environment."),e)},Un=e=>{const t=document.querySelector("openlv-modal");if(t&&t.remove(),!t){Lt();const r=new Se({onClose(){Ge("modal closed"),r.remove(),e.onClose?.()},provider:e.provider,theme:e.theme});document.body.appendChild(r),r.showModal()}};exports.ModalRoot=Dt;exports.OPENLV_ICON_128=Pt;exports.OpenLVModalElement=Se;exports.default=Se;exports.registerOpenLVModal=Lt;exports.triggerOpenModal=Un;exports.useConnectionState=Kn;
6
6
  //# sourceMappingURL=index.cjs.js.map