@openlv/modal 0.0.1-beta.4 → 0.0.1-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ "use strict";var Ht=Object.defineProperty;var Ut=(e,t,r)=>t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ee=(e,t,r)=>Ut(e,typeof t!="symbol"?t+"":t,r);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("preact/jsx-runtime"),c=require("preact/hooks"),d=require("preact"),Kt=require("qrcode-generator");function Jt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ne={exports:{}};/*!
2
+ Copyright (c) 2018 Jed Watson.
3
+ Licensed under the MIT License (MIT), see
4
+ http://jedwatson.github.io/classnames
5
+ */var $e;function Xt(){return $e||($e=1,(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",s=0;s<arguments.length;s++){var l=arguments[s];l&&(o=i(o,n(l)))}return o}function n(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var l in o)t.call(o,l)&&o[l]&&(s=i(s,l));return s}function i(o,s){return s?o?o+" "+s:o+s:o}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Ne)),Ne.exports}var Qt=Xt();const te=Jt(Qt),E=Symbol.for("@ts-pattern/matcher"),gt=Symbol.for("@ts-pattern/isVariadic"),me="@ts-pattern/anonymous-select-key",Re=e=>!!(e&&typeof e=="object"),he=e=>e&&!!e[E],_=(e,t,r)=>{if(he(e)){const n=e[E](),{matched:i,selections:o}=n.match(t);return i&&o&&Object.keys(o).forEach(s=>r(s,o[s])),i}if(Re(e)){if(!Re(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],o=[];for(const s of e.keys()){const l=e[s];he(l)&&l[gt]?o.push(l):o.length?i.push(l):n.push(l)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;const s=t.slice(0,n.length),l=i.length===0?[]:t.slice(-i.length),u=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((v,y)=>_(v,s[y],r))&&i.every((v,y)=>_(v,l[y],r))&&(o.length===0||_(o[0],u,r))}return e.length===t.length&&e.every((s,l)=>_(s,t[l],r))}return Reflect.ownKeys(e).every(n=>{const i=e[n];return(n in t||he(o=i)&&o[E]().matcherType==="optional")&&_(i,t[n],r);var o})}return Object.is(t,e)},O=e=>{var t,r,n;return Re(e)?he(e)?(t=(r=(n=e[E]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?le(e,O):le(Object.values(e),O):[]},le=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function Gt(...e){if(e.length===1){const[t]=e;return r=>_(t,r,()=>{})}if(e.length===2){const[t,r]=e;return _(t,r,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function j(e){return Object.assign(e,{optional:()=>Ue(e),and:t=>x(e,t),or:t=>mt(e,t),select:t=>t===void 0?ce(e):ce(t,e)})}function Te(e){return Object.assign((t=>Object.assign(t,{[Symbol.iterator](){let r=0;const n=[{value:Object.assign(t,{[gt]:!0}),done:!1},{done:!0,value:void 0}];return{next:()=>{var i;return(i=n[r++])!=null?i:n.at(-1)}}}}))(e),{optional:()=>Te(Ue(e)),select:t=>Te(t===void 0?ce(e):ce(t,e))})}function Ue(e){return j({[E]:()=>({match:t=>{let r={};const n=(i,o)=>{r[i]=o};return t===void 0?(O(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:_(e,t,n),selections:r}},getSelectionKeys:()=>O(e),matcherType:"optional"})})}const Zt=(e,t)=>{for(const r of e)if(!t(r))return!1;return!0},qt=(e,t)=>{for(const[r,n]of e.entries())if(!t(n,r))return!1;return!0},Yt=(e,t)=>{const r=Reflect.ownKeys(e);for(const n of r)if(!t(n,e[n]))return!1;return!0};function x(...e){return j({[E]:()=>({match:t=>{let r={};const n=(i,o)=>{r[i]=o};return{matched:e.every(i=>_(i,t,n)),selections:r}},getSelectionKeys:()=>le(e,O),matcherType:"and"})})}function mt(...e){return j({[E]:()=>({match:t=>{let r={};const n=(i,o)=>{r[i]=o};return le(e,O).forEach(i=>n(i,void 0)),{matched:e.some(i=>_(i,t,n)),selections:r}},getSelectionKeys:()=>le(e,O),matcherType:"or"})})}function g(e){return{[E]:()=>({match:t=>({matched:!!e(t)})})}}function ce(...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 j({[E]:()=>({match:n=>{let i={[t??me]:n};return{matched:r===void 0||_(r,n,(o,s)=>{i[o]=s}),selections:i}},getSelectionKeys:()=>[t??me].concat(r===void 0?[]:O(r))})})}function vt(e){return!0}function z(e){return typeof e=="number"}function K(e){return typeof e=="string"}function J(e){return typeof e=="bigint"}const yt=j(g(vt)),$t=j(g(vt)),er=yt,X=e=>Object.assign(j(e),{startsWith:t=>{return X(x(e,(r=t,g(n=>K(n)&&n.startsWith(r)))));var r},endsWith:t=>{return X(x(e,(r=t,g(n=>K(n)&&n.endsWith(r)))));var r},minLength:t=>X(x(e,(r=>g(n=>K(n)&&n.length>=r))(t))),length:t=>X(x(e,(r=>g(n=>K(n)&&n.length===r))(t))),maxLength:t=>X(x(e,(r=>g(n=>K(n)&&n.length<=r))(t))),includes:t=>{return X(x(e,(r=t,g(n=>K(n)&&n.includes(r)))));var r},regex:t=>{return X(x(e,(r=t,g(n=>K(n)&&!!n.match(r)))));var r}}),et=X(g(K)),L=e=>Object.assign(j(e),{between:(t,r)=>L(x(e,((n,i)=>g(o=>z(o)&&n<=o&&i>=o))(t,r))),lt:t=>L(x(e,(r=>g(n=>z(n)&&n<r))(t))),gt:t=>L(x(e,(r=>g(n=>z(n)&&n>r))(t))),lte:t=>L(x(e,(r=>g(n=>z(n)&&n<=r))(t))),gte:t=>L(x(e,(r=>g(n=>z(n)&&n>=r))(t))),int:()=>L(x(e,g(t=>z(t)&&Number.isInteger(t)))),finite:()=>L(x(e,g(t=>z(t)&&Number.isFinite(t)))),positive:()=>L(x(e,g(t=>z(t)&&t>0))),negative:()=>L(x(e,g(t=>z(t)&&t<0)))}),tr=L(g(z)),Q=e=>Object.assign(j(e),{between:(t,r)=>Q(x(e,((n,i)=>g(o=>J(o)&&n<=o&&i>=o))(t,r))),lt:t=>Q(x(e,(r=>g(n=>J(n)&&n<r))(t))),gt:t=>Q(x(e,(r=>g(n=>J(n)&&n>r))(t))),lte:t=>Q(x(e,(r=>g(n=>J(n)&&n<=r))(t))),gte:t=>Q(x(e,(r=>g(n=>J(n)&&n>=r))(t))),positive:()=>Q(x(e,g(t=>J(t)&&t>0))),negative:()=>Q(x(e,g(t=>J(t)&&t<0)))}),rr=Q(g(J)),nr=j(g(function(e){return typeof e=="boolean"})),ir=j(g(function(e){return typeof e=="symbol"})),or=j(g(function(e){return e==null})),ar=j(g(function(e){return e!=null}));var Ke={__proto__:null,matcher:E,optional:Ue,array:function(...e){return Te({[E]:()=>({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 O(r).forEach(o=>{n[o]=[]}),{matched:!0,selections:n};const i=(o,s)=>{n[o]=(n[o]||[]).concat([s])};return{matched:t.every(o=>_(r,o,i)),selections:n}},getSelectionKeys:()=>e.length===0?[]:O(e[0])})})},set:function(...e){return j({[E]:()=>({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=(o,s)=>{r[o]=(r[o]||[]).concat([s])},i=e[0];return{matched:Zt(t,o=>_(i,o,n)),selections:r}},getSelectionKeys:()=>e.length===0?[]:O(e[0])})})},map:function(...e){return j({[E]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};const n=(l,u)=>{r[l]=(r[l]||[]).concat([u])};if(e.length===0)return{matched:!0};var i;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(i=e[0])==null?void 0:i.toString()}`);const[o,s]=e;return{matched:qt(t,(l,u)=>{const v=_(o,u,n),y=_(s,l,n);return v&&y}),selections:r}},getSelectionKeys:()=>e.length===0?[]:[...O(e[0]),...O(e[1])]})})},record:function(...e){return j({[E]:()=>({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 i=(l,u)=>{n[l]=(n[l]||[]).concat([u])},[o,s]=e.length===1?[et,e[0]]:e;return{matched:Yt(t,(l,u)=>{const v=typeof l!="string"||Number.isNaN(Number(l))?null:Number(l),y=v!==null&&_(o,v,i),D=_(o,l,i),S=_(s,u,i);return(D||y)&&S}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...O(e[0]),...O(e[1])]})})},intersection:x,union:mt,not:function(e){return j({[E]:()=>({match:t=>({matched:!_(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:g,select:ce,any:yt,unknown:$t,_:er,string:et,number:tr,bigint:rr,boolean:nr,symbol:ir,nullish:or,nonNullable:ar,instanceOf:function(e){return j(g((function(t){return r=>r instanceof t})(e)))},shape:function(e){return j(g(Gt(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 Pe={matched:!1,value:void 0};function V(e){return new lr(e,Pe)}let lr=class Me{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 i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let o=!1,s={};const l=(v,y)=>{o=!0,s[v]=y},u=!n.some(v=>_(v,this.input,l))||i&&!i(this.input)?Pe:{matched:!0,value:r(o?me in s?s[me]:s:this.input,this.input)};return new Me(this.input,u)}when(t,r){if(this.state.matched)return this;const n=!!t(this.input);return new Me(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=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 Je={font:{family:"Inter, sans-serif"},body:{color:"#373737",background:"#ffffff"},border:{radius:"16px"},overlay:{background:"#00000008",backdrop:{filter:"blur(2px)"}},modal:{shadow:"0px 2px 4px 0px #00000005"}},bt=(e,t,r)=>{for(const[n,i]of Object.entries(r))typeof i=="object"&&i!==null?bt(e,`${t}-${n}`,i):typeof i=="string"&&e.set(`--lv${t}-${n}`,i)},wt=(e,t=!0)=>{const r=new Map;return bt(r,"",e),Object.fromEntries(r.entries())},ur=({theme:e=Je,children:t})=>a.jsx("div",{style:wt(e),id:"root",children:t}),xt=d.createContext({provider:void 0}),dr=({provider:e,onClose:t})=>a.jsx(xt.Provider,{value:{provider:e},children:a.jsx(ur,{theme:Je,children:a.jsx(It,{onClose:t})})}),fr=()=>{const e=c.useContext(xt);if(!e.provider)throw new Error("Provider not found");return e},re=()=>{const{provider:e}=fr(),[t,r]=c.useState(e?.getState().status||"disconnected");if(c.useEffect(()=>{const n=i=>{r(i)};return e?.on("status_change",n),()=>{e?.off("status_change",n)}},[e]),!e)throw new Error("Provider not found");return{provider:e,status:t}},pr=1,hr=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}@${pr}?${t.toString()}`},ve=(...e)=>console.log("%c[modal]%c","color: yellow; font-weight: bold","color: inherit; font-weight: normal",...e),kt=(e,t,r)=>{c.useEffect(()=>(e?.on(t,r),()=>{e?.off(t,r)}),[e,t])},Xe=()=>{const{provider:e}=re(),[t,r]=c.useState(e?.storage.getSettings());kt(e?.storage.emitter,"settings_change",o=>{r(o)});const n=o=>{if(!t||t.signaling?.p===o)return;const s={...t,signaling:{...t.signaling,p:o}};r(s),e?.storage.setSettings(s)},i=o=>{if(!t||t.signaling?.s[t.signaling?.p]===o)return;const s={...t,signaling:{...t.signaling,s:{...t.signaling.s,[t.signaling.p]:o}}};r(s),e?.storage.setSettings(s)};if(!t)throw new Error("Settings not found");return{settings:t,updateSignalingProtocol:n,updateSignalingServer:i}},ue=()=>{const{provider:e}=re(),[t,r]=c.useState(e?.getSession()),n=t?.getHandshakeParameters(),i=n?hr(n):void 0,[o,s]=c.useState(t?.getState());return kt(t?.emitter,"state_change",l=>{ve("session state change: ",l),s(l)}),c.useEffect(()=>{const l=u=>{ve("session started: ",u),r(u),s(u.getState())};return e?.on("session_started",l),()=>{e?.off("session_started",l)}},[e]),c.useEffect(()=>{t&&s(t.getState())},[t]),{uri:i,status:o}},gr=()=>{const{provider:e}=re(),{settings:t}=Xe();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}=ue(),{status:n}=re();return console.error("Unknown state: ",{state:e,sessionStatus:t,providerStatus:n}),a.jsxs("div",{className:"rounded-md bg-gray-100 p-2 text-gray-500",children:[a.jsxs("div",{children:["Unknown state: ",JSON.stringify(e)]}),a.jsxs("div",{children:["URI: ",r]}),a.jsxs("div",{children:["Session Status: ",JSON.stringify(t)]}),a.jsxs("div",{children:["Provider Status: ",JSON.stringify(n)]})]})},mr=({onCopy:e})=>{const{uri:t}=ue(),r=c.useCallback(()=>{t&&e(t)},[t,e]),n=c.useCallback(i=>{const o=Kt(0,"M");return o.addData(i),o.make(),o.createSvgTag({cellSize:5,margin:0,scalable:!0})},[]);return a.jsxs("div",{className:"flex flex-col items-center gap-4 px-2",children:[a.jsxs("div",{className:"w-full space-y-4 rounded-md border border-neutral-200 bg-neutral-100 p-4",children:[t&&a.jsx("div",{className:"relative mx-auto flex w-fit items-center justify-center rounded-lg border-2 border-gray-200 bg-gray-50 p-4",children:a.jsx("button",{className:"flex h-[200px] w-[200px] cursor-pointer items-center justify-center",onClick:r,title:"Click to copy connection URL",dangerouslySetInnerHTML:{__html:n(t)}})}),a.jsx("div",{className:"w-full",children:a.jsx("button",{type:"button",onClick:r,className:"w-full cursor-pointer rounded-lg border border-gray-300 bg-gray-200 px-4 py-2 text-gray-700 text-sm transition hover:bg-gray-300",children:"Copy Connection URL"})})]}),a.jsxs("div",{className:"w-full",children:[a.jsx("span",{children:"Scan the link above using your mobile wallet."}),a.jsx("br",{}),a.jsx("span",{children:"Or copy the link and paste it into your wallet."})]})]})},vr=()=>typeof document<"u"&&"startViewTransition"in document,yr=e=>{vr()?document.startViewTransition(e):e()},br=()=>a.jsx("div",{className:"flex items-center justify-center",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-blue-500 border-t-transparent"})}),ze="connecting",Le="handshake-open",De="handshake-closed",Fe="xr-encrypted",oe="disconnected",Ae="unknown",wr=e=>e?V(e).with({status:oe},()=>oe).with({status:Ke.union("created","signaling","connected","ready")},t=>{const r="signaling"in t?t.signaling?.state:void 0;return V(r).with(ze,()=>ze).with(Le,()=>Le).with(De,()=>De).with(Fe,()=>Fe).with(oe,()=>oe).otherwise(()=>Ae)}).otherwise(()=>Ae):Ae,xr=e=>{const[t,r]=c.useState(e),n=c.useRef(e);return c.useEffect(()=>{e!==n.current&&yr(()=>{r(e),n.current=e})},[e]),{displayState:t}},kr=({onClose:e,onCopy:t})=>{const{status:r={status:"created"}}=ue(),n=wr(r),{displayState:i}=xr(n);return a.jsx("div",{style:{viewTransitionName:"connection-flow"},className:"w-full",children:V(i).with(ze,()=>a.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[a.jsx(br,{}),a.jsxs("div",{className:"text-center",children:[a.jsx("h3",{className:"mb-2 font-semibold text-gray-900 text-lg",children:"Connecting"}),a.jsx("p",{className:"text-gray-500 text-sm",children:"Waiting for wallet to connect..."})]})]})).with(Le,()=>a.jsx(mr,{onCopy:t})).with(De,()=>a.jsx("div",{className:"flex flex-col items-center gap-4 p-6",children:a.jsx("div",{className:"text-center",children:a.jsx("h3",{className:"mb-2 font-semibold text-gray-900 text-lg",children:"Establishing e2e encryption..."})})})).with(Fe,()=>a.jsx("div",{className:"flex flex-col items-center gap-4 p-6",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"mb-4 text-4xl",children:"✅"}),a.jsx("h3",{className:"mb-2 font-semibold text-gray-900 text-lg",children:"Connected Successfully!"}),a.jsx("p",{className:"text-gray-500 text-sm",children:"Your wallet is now connected and ready to use."})]})})).with(oe,()=>a.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"mb-4 text-4xl",children:"🔌"}),a.jsx("h3",{className:"mb-2 font-semibold text-gray-900 text-lg",children:"Disconnected"}),a.jsx("p",{className:"mb-4 text-gray-500 text-sm",children:"The connection has been closed."})]}),a.jsx("button",{type:"button",onClick:e,className:"w-full rounded-lg bg-gray-100 px-4 py-2 font-semibold text-gray-700 text-sm transition hover:bg-gray-200",children:"Close"})]})).otherwise(()=>a.jsx(Ve,{state:r}))})};function _t(e,t){for(var r in t)e[r]=t[r];return e}function Ie(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 jt(e,t){var r=t(),n=c.useState({t:{__:r,u:t}}),i=n[0].t,o=n[1];return c.useLayoutEffect(function(){i.__=r,i.u=t,Oe(i)&&o({t:i})},[e,r,t]),c.useEffect(function(){return Oe(i)&&o({t:i}),e(function(){Oe(i)&&o({t:i})})},[e]),r}function Oe(e){var t,r,n=e.u,i=e.__;try{var o=n();return!((t=i)===(r=o)&&(t!==0||1/t==1/r)||t!=t&&r!=r)}catch{return!0}}function St(e){e()}function Ct(e){return e}function Nt(){return[!1,St]}var At=c.useLayoutEffect;function Be(e,t){this.props=e,this.context=t}function _r(e,t){function r(i){var o=this.props.ref,s=o==i.ref;return!s&&o&&(o.call?o(null):o.current=null),t?!t(this.props,i)||!s:Ie(this.props,i)}function n(i){return this.shouldComponentUpdate=r,d.createElement(e,i)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n.type=e,n}(Be.prototype=new d.Component).isPureReactComponent=!0,Be.prototype.shouldComponentUpdate=function(e,t){return Ie(this.props,e)||Ie(this.state,t)};var tt=d.options.__b;d.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),tt&&tt(e)};var jr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Sr(e){function t(r){var n=_t({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=jr,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var rt=function(e,t){return e==null?null:d.toChildArray(d.toChildArray(e).map(t))},Cr={map:rt,forEach:rt,count:function(e){return e?d.toChildArray(e).length:0},only:function(e){var t=d.toChildArray(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:d.toChildArray},Nr=d.options.__e;d.options.__e=function(e,t,r,n){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}Nr(e,t,r,n)};var nt=d.options.unmount;function Ot(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=_t({},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 Ot(n,t,r)})),e}function Et(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Et(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 ge(){this.__u=0,this.o=null,this.__b=null}function Rt(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Ar(e){var t,r,n;function i(o){if(t||(t=e()).then(function(s){r=s.default||s},function(s){n=s}),n)throw n;if(!r)throw t;return d.createElement(r,o)}return i.displayName="Lazy",i.__f=!0,i}function ae(){this.i=null,this.l=null}d.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),nt&&nt(e)},(ge.prototype=new d.Component).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=Rt(n.__v),o=!1,s=function(){o||(o=!0,r.__R=null,i?i(l):l())};r.__R=s;var l=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=Et(u,u.__c.__P,u.__c.__O)}var v;for(n.setState({__a:n.__b=null});v=n.o.pop();)v.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(s,s)},ge.prototype.componentWillUnmount=function(){this.o=[]},ge.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]=Ot(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&d.createElement(d.Fragment,null,e.fallback);return i&&(i.__u&=-33),[d.createElement(d.Fragment,null,t.__a?null:e.children),i]};var it=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 Or(e){return this.getChildContext=function(){return e.context},e.children}function Er(e){var t=this,r=e.h;if(t.componentWillUnmount=function(){d.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(i,o){this.childNodes.push(i),t.h.insertBefore(i,o)},removeChild:function(i){this.childNodes.splice(this.childNodes.indexOf(i)>>>1,1),t.h.removeChild(i)}}}d.render(d.createElement(Or,{context:t.context},e.__v),t.v)}function Rr(e,t){var r=d.createElement(Er,{__v:e,h:t});return r.containerInfo=t,r}(ae.prototype=new d.Component).__a=function(e){var t=this,r=Rt(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),it(t,e,n)):i()};r?r(o):o()}},ae.prototype.render=function(e){this.i=null,this.l=new Map;var t=d.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},ae.prototype.componentDidUpdate=ae.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){it(e,r,t)})};var Tt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Tr=/^(?: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]/,Pr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Mr=/[A-Z0-9]/g,Vr=typeof document<"u",zr=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Lr(e,t,r){return t.__k==null&&(t.textContent=""),d.render(e,t),typeof r=="function"&&r(),e?e.__c:null}function Dr(e,t,r){return d.hydrate(e,t),typeof r=="function"&&r(),e?e.__c:null}d.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(d.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 ot=d.options.event;function Fr(){}function Ir(){return this.cancelBubble}function Br(){return this.defaultPrevented}d.options.event=function(e){return ot&&(e=ot(e)),e.persist=Fr,e.isPropagationStopped=Ir,e.isDefaultPrevented=Br,e.nativeEvent=e};var Qe,Wr={enumerable:!1,configurable:!0,get:function(){return this.class}},at=d.options.vnode;d.options.vnode=function(e){typeof e.type=="string"&&(function(t){var r=t.props,n=t.type,i={},o=n.indexOf("-")===-1;for(var s in r){var l=r[s];if(!(s==="value"&&"defaultValue"in r&&l==null||Vr&&s==="children"&&n==="noscript"||s==="class"||s==="className")){var u=s.toLowerCase();s==="defaultValue"&&"value"in r&&r.value==null?s="value":s==="download"&&l===!0?l="":u==="translate"&&l==="no"?l=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?s="ondblclick":u!=="onchange"||n!=="input"&&n!=="textarea"||zr(r.type)?u==="onfocus"?s="onfocusin":u==="onblur"?s="onfocusout":Pr.test(s)&&(s=u):u=s="oninput":o&&Tr.test(s)?s=s.replace(Mr,"-$&").toLowerCase():l===null&&(l=void 0),u==="oninput"&&i[s=u]&&(s="oninputCapture"),i[s]=l}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=d.toChildArray(r.children).forEach(function(v){v.props.selected=i.value.indexOf(v.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=d.toChildArray(r.children).forEach(function(v){v.props.selected=i.multiple?i.defaultValue.indexOf(v.props.value)!=-1:i.defaultValue==v.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",Wr)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i})(e),e.$$typeof=Tt,at&&at(e)};var st=d.options.__r;d.options.__r=function(e){st&&st(e),Qe=e.__c};var lt=d.options.diffed;d.options.diffed=function(e){lt&&lt(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),Qe=null};var Hr={ReactCurrentDispatcher:{current:{readContext:function(e){return Qe.__n[e.__c].props.value},useCallback:c.useCallback,useContext:c.useContext,useDebugValue:c.useDebugValue,useDeferredValue:Ct,useEffect:c.useEffect,useId:c.useId,useImperativeHandle:c.useImperativeHandle,useInsertionEffect:At,useLayoutEffect:c.useLayoutEffect,useMemo:c.useMemo,useReducer:c.useReducer,useRef:c.useRef,useState:c.useState,useSyncExternalStore:jt,useTransition:Nt}}};function Ur(e){return d.createElement.bind(null,e)}function ke(e){return!!e&&e.$$typeof===Tt}function Kr(e){return ke(e)&&e.type===d.Fragment}function Jr(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function Xr(e){return ke(e)?d.cloneElement.apply(null,arguments):e}function Qr(e){return!!e.__k&&(d.render(null,e),!0)}function Gr(e){return e&&(e.base||e.nodeType===1&&e)||null}var Zr=function(e,t){return e(t)},qr=function(e,t){return e(t)},Yr=d.Fragment,$r=ke,Z={useState:c.useState,useId:c.useId,useReducer:c.useReducer,useEffect:c.useEffect,useLayoutEffect:c.useLayoutEffect,useInsertionEffect:At,useTransition:Nt,useDeferredValue:Ct,useSyncExternalStore:jt,startTransition:St,useRef:c.useRef,useImperativeHandle:c.useImperativeHandle,useMemo:c.useMemo,useCallback:c.useCallback,useContext:c.useContext,useDebugValue:c.useDebugValue,version:"18.3.1",Children:Cr,render:Lr,hydrate:Dr,unmountComponentAtNode:Qr,createPortal:Rr,createElement:d.createElement,createContext:d.createContext,createFactory:Ur,cloneElement:Xr,createRef:d.createRef,Fragment:d.Fragment,isValidElement:ke,isElement:$r,isFragment:Kr,isMemo:Jr,findDOMNode:Gr,Component:d.Component,PureComponent:Be,memo:_r,forwardRef:Sr,flushSync:qr,unstable_batchedUpdates:Zr,StrictMode:Yr,Suspense:ge,SuspenseList:ae,lazy:Ar,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Hr},Pt={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ct=Z.createContext&&Z.createContext(Pt),en=["attr","size","title"];function tn(e,t){if(e==null)return{};var r=rn(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rn(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 ye(){return ye=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},ye.apply(this,arguments)}function ut(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function be(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ut(Object(r),!0).forEach(function(n){nn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nn(e,t,r){return t=on(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function on(e){var t=an(e,"string");return typeof t=="symbol"?t:t+""}function an(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 Mt(e){return e&&e.map((t,r)=>Z.createElement(t.tag,be({key:r},t.attr),Mt(t.child)))}function _e(e){return t=>Z.createElement(sn,ye({attr:be({},e.attr)},t),Mt(e.child))}function sn(e){var t=r=>{var{attr:n,size:i,title:o}=e,s=tn(e,en),l=i||r.size||"1em",u;return r.className&&(u=r.className),e.className&&(u=(u?u+" ":"")+e.className),Z.createElement("svg",ye({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:u,style:be(be({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),o&&Z.createElement("title",null,o),e.children)};return ct!==void 0?Z.createElement(ct.Consumer,null,r=>t(r)):t(Pt)}function ln(e){return _e({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 cn=/\s+/g,We=e=>typeof e!="string"||!e?e:e.replace(cn," ").trim(),we=(...e)=>{let t=[],r=n=>{if(!n&&n!==0&&n!==0n)return;if(Array.isArray(n)){for(let o=0,s=n.length;o<s;o++)r(n[o]);return}let i=typeof n;if(i==="string"||i==="number"||i==="bigint"){if(i==="number"&&n!==n)return;t.push(String(n))}else if(i==="object"){let o=Object.keys(n);for(let s=0,l=o.length;s<l;s++){let u=o[s];n[u]&&t.push(u)}}};for(let n=0,i=e.length;n<i;n++){let o=e[n];o!=null&&r(o)}return t.length>0?We(t.join(" ")):void 0},dt=e=>e===!1?"false":e===!0?"true":e===0?"0":e,T=e=>{if(!e||typeof e!="object")return!0;for(let t in e)return!1;return!0},un=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i=0;i<r.length;i++){let o=r[i];if(!n.includes(o)||e[o]!==t[o])return!1}return!0},ft=(e,t)=>{for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let n=t[r];r in e?e[r]=we(e[r],n):e[r]=n}return e},Vt=(e,t)=>{for(let r=0;r<e.length;r++){let n=e[r];Array.isArray(n)?Vt(n,t):n&&t.push(n)}},zt=(...e)=>{let t=[];Vt(e,t);let r=[];for(let n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r},He=(e,t)=>{let r={};for(let n in e){let i=e[n];if(n in t){let o=t[n];Array.isArray(i)||Array.isArray(o)?r[n]=zt(o,i):typeof i=="object"&&typeof o=="object"&&i&&o?r[n]=He(i,o):r[n]=o+" "+i}else r[n]=i}for(let n in t)n in e||(r[n]=t[n]);return r},dn={twMerge:!0,twMergeConfig:{},responsiveVariants:!1};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 Ee=fn(),pn=e=>{let t=(r,n)=>{let{extend:i=null,slots:o={},variants:s={},compoundVariants:l=[],compoundSlots:u=[],defaultVariants:v={}}=r,y={...dn,...n},D=i?.base?we(i.base,r?.base):r?.base,S=i?.variants&&!T(i.variants)?He(s,i.variants):s,q=i?.defaultVariants&&!T(i.defaultVariants)?{...i.defaultVariants,...v}:v;!T(y.twMergeConfig)&&!un(y.twMergeConfig,Ee.cachedTwMergeConfig)&&(Ee.didTwMergeConfigChange=!0,Ee.cachedTwMergeConfig=y.twMergeConfig);let Y=T(i?.slots),$=T(o)?{}:{base:we(r?.base,Y&&i?.base),...o},F=Y?$:ft({...i?.slots},T($)?{base:r?.base}:$),B=T(i?.compoundVariants)?l:zt(i?.compoundVariants,l),P=M=>{if(T(S)&&T(o)&&Y)return e(D,M?.class,M?.className)(y);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}`);let fe=(h,p,f=[],b)=>{let w=f;if(typeof p=="string"){let m=We(p).split(" ");for(let k=0;k<m.length;k++)w.push(`${h}:${m[k]}`)}else if(Array.isArray(p))for(let m=0;m<p.length;m++)w.push(`${h}:${p[m]}`);else if(typeof p=="object"&&typeof b=="string"&&b in p){let m=p[b];if(m&&typeof m=="string"){let k=We(m).split(" "),A=[];for(let N=0;N<k.length;N++)A.push(`${h}:${k[N]}`);w[b]=w[b]?w[b].concat(A):A}else if(Array.isArray(m)&&m.length>0){let k=[];for(let A=0;A<m.length;A++)k.push(`${h}:${m[A]}`);w[b]=k}}return w},W=(h,p=S,f=null,b=null)=>{let w=p[h];if(!w||T(w))return null;let m=b?.[h]??M?.[h];if(m===null)return null;let k=dt(m),A=Array.isArray(y.responsiveVariants)&&y.responsiveVariants.length>0||y.responsiveVariants===!0,N=q?.[h],C=[];if(typeof k=="object"&&A)for(let[U,Ye]of Object.entries(k)){let Wt=w[Ye];if(U==="initial"){N=Ye;continue}Array.isArray(y.responsiveVariants)&&!y.responsiveVariants.includes(U)||(C=fe(U,Wt,C,f))}let H=k!=null&&typeof k!="object"?k:dt(N),R=w[H||"false"];return typeof C=="object"&&typeof f=="string"&&C[f]?ft(C,R):C.length>0?(C.push(R),f==="base"?C.join(" "):C):R},G=()=>{if(!S)return null;let h=Object.keys(S),p=[];for(let f=0;f<h.length;f++){let b=W(h[f],S);b&&p.push(b)}return p},Se=(h,p)=>{if(!S||typeof S!="object")return null;let f=[];for(let b in S){let w=W(b,S,h,p),m=h==="base"&&typeof w=="string"?w:w&&w[h];m&&f.push(m)}return f},ne={};for(let h in M){let p=M[h];p!==void 0&&(ne[h]=p)}let I=(h,p)=>{let f=typeof M?.[h]=="object"?{[h]:M[h]?.initial}:{};return{...q,...ne,...f,...p}},ie=(h=[],p)=>{let f=[],b=h.length;for(let w=0;w<b;w++){let{class:m,className:k,...A}=h[w],N=!0,C=I(null,p);for(let H in A){let R=A[H],U=C[H];if(Array.isArray(R)){if(!R.includes(U)){N=!1;break}}else{if((R==null||R===!1)&&(U==null||U===!1))continue;if(U!==R){N=!1;break}}}N&&(m&&f.push(m),k&&f.push(k))}return f},Ce=h=>{let p=ie(B,h);if(!Array.isArray(p))return p;let f={},b=e;for(let w=0;w<p.length;w++){let m=p[w];if(typeof m=="string")f.base=b(f.base,m)(y);else if(typeof m=="object")for(let k in m)f[k]=b(f[k],m[k])(y)}return f},pe=h=>{if(u.length<1)return null;let p={},f=I(null,h);for(let b=0;b<u.length;b++){let{slots:w=[],class:m,className:k,...A}=u[b];if(!T(A)){let N=!0;for(let C in A){let H=f[C],R=A[C];if(H===void 0||(Array.isArray(R)?!R.includes(H):R!==H)){N=!1;break}}if(!N)continue}for(let N=0;N<w.length;N++){let C=w[N];p[C]||(p[C]=[]),p[C].push([m,k])}}return p};if(!T(o)||!Y){let h={};if(typeof F=="object"&&!T(F)){let p=e;for(let f in F)h[f]=b=>{let w=Ce(b),m=pe(b);return p(F[f],Se(f,b),w?w[f]:void 0,m?m[f]:void 0,b?.class,b?.className)(y)}}return h}return e(D,G(),ie(B),M?.class,M?.className)(y)},de=()=>{if(!(!S||typeof S!="object"))return Object.keys(S)};return P.variantKeys=de(),P.extend=i,P.base=D,P.slots=F,P.variants=S,P.defaultVariants=q,P.compoundSlots=u,P.compoundVariants=B,P};return{tv:t,createTV:r=>(n,i)=>t(n,i?He(r,i):r)}},hn=(...e)=>t=>we(e)||void 0,{tv:Lt}=pn(hn);const gn=Lt({base:"flex items-center justify-center rounded-lg transition-colors cursor-pointer active:scale-95 transition-transform",variants:{$variant:{primary:"bg-blue-500 font-semibold text-sm text-white hover:bg-blue-600",secondary:"border border-gray-300 text-gray-500 hover:bg-gray-200",tertiary:"text-gray-500 hover:text-gray-700 hover:bg-gray-200"},$size:{sm:"h-6",md:"h-8",lg:"h-11"},$aspect:{square:"aspect-square",auto:""}},defaultVariants:{$size:"md",$variant:"primary",$aspect:"auto"}}),se=({href:e,onClick:t,children:r,className:n,$variant:i,$size:o,$aspect:s,...l})=>d.createElement(e?"a":"button",{href:e??void 0,onClick:t,className:te(gn({$variant:i,$size:o,$aspect:s}),n),...l},r),mn=({isApple:e})=>a.jsxs("div",{className:"flex h-full w-full justify-between",children:[a.jsx("div",{className:"grow py-1 pl-1",children:a.jsx("div",{className:"h-full rounded-sm border border-gray-300 bg-gray-400"})}),a.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)=>a.jsx("div",{className:"h-1.5 w-1.5 rounded-full border border-gray-500"},"dot-t-"+r))})]}),vn=({isApple:e})=>a.jsxs("div",{className:"flex h-full w-full flex-col justify-between",children:[a.jsx("div",{className:"grow px-1 pt-1",children:a.jsx("div",{className:"h-full rounded-sm border border-gray-200 bg-gray-300"})}),a.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)=>a.jsx("div",{className:"h-1.5 w-1.5 rounded-full border border-gray-400"},"dot-p-"+r))})]}),yn=()=>a.jsxs("div",{className:"-space-x-4 flex items-end",children:[a.jsx("div",{className:"h-38 w-48 overflow-hidden rounded-lg bg-gray-300",children:a.jsx(mn,{isApple:!0})}),a.jsx("div",{className:"h-18 w-12 overflow-hidden rounded-lg bg-gray-200",children:a.jsx(vn,{isApple:!0})})]}),bn=({onSettings:e})=>{const{start:t}=gr();return a.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[a.jsx(yn,{}),a.jsx("div",{className:"text-center",children:a.jsx("p",{className:"text-gray-500 text-sm",children:"Click the button below to start a connection"})}),a.jsxs("div",{className:"flex items-center",children:[a.jsx(se,{type:"button",onClick:t,className:"z-10 px-6 py-3",$variant:"primary",$size:"lg",children:"Generate QR"}),a.jsx(se,{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:a.jsx(ln,{className:"h-5 w-5 text-gray-500"})})]})]})},wn=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}},pt=(e,{duration:t=200}={})=>{const[r,n]=c.useState(e),[i,o]=c.useState(null),s=c.useRef(),l=c.useRef(e);return c.useEffect(()=>{if(!Object.is(e,l.current))return s.current&&window.clearTimeout(s.current),o(l.current),n(e),l.current=e,s.current=window.setTimeout(()=>{o(null),s.current=void 0},t),()=>{s.current&&window.clearTimeout(s.current)}},[e,t]),{current:r,previous:i,isTransitioning:i!==null}},Dt="data:image/webp;base64,UklGRjYRAABXRUJ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ALRzTXzDHTMQkNZZY6QKRycJ2VCb8vNvQBmdev/CpTn1fgsVtGDJ0+c1iOBN0/f1DQMifz17Os7Oz1pKw7eOP9dtuyGwI7pYe0cEAHId4jKsr5WYfoSOIgXwE7bTm6l9ytV0zbma1KfNP/Ueaf86PTBrUXb3mh1wOj2xW9r5slTCunQPsdDHdZhtq/ldOBDSm/8BZs0vOj+BaStwJTUL6ShMniBq45fMXgBYhE0HCVgrmd8huP1g79tfH/sI40kXryAN0Id9OxWe8OtUDqd+hFn5Lea/0IyqEMOo1l6zdXzTvnn7ZMZQ13YXZ42HNbFrHSpaISyLIEnjorwZViflpTYJU5+TBcgDljbeiGSw9XFp1juoAWD7Du38M26w9QFezhy38ycpTOQI5qBb7hvaPBeGCI6FZxDSfGL8DLCIuXSPDU1wKHXgrR9dz8+Jzlm9rQs+FlQrh/TVOKrVVxQAAAA==",xn=()=>{const{status:e}=ue(),{status:t}=re(),r=V(t).with("disconnected",()=>{}).with(Ke.union("connected","connecting","error"),()=>V(e).with({status:"disconnected"},()=>({icon:"🫲",text:"Disconnected"})).with({status:"signaling"},n=>V(n.signaling).with({state:"handshake-open"},()=>({icon:"👋",text:"Handshake Open"})).with({state:"handshake-closed"},()=>({icon:"🤝",text:"Handshake Closed"})).otherwise(()=>({icon:"❓",text:"Unknown "+n.signaling?.state}))).otherwise(n=>({icon:"❓",text:"Unknown "+JSON.stringify(n)}))).otherwise(()=>({icon:"❓",text:"Unknown provider status "+JSON.stringify(t)}));return r?a.jsxs("div",{className:"group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-neutral-200",children:[a.jsx("div",{className:"text-gray-900 text-xs opacity-0 transition-opacity duration-300 group-hover:opacity-100",children:r.text}),a.jsx("div",{children:r.icon})]}):a.jsx(a.Fragment,{})},kn=()=>a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-11 w-full"}),a.jsxs("div",{className:"absolute inset-x-0 bottom-0 flex items-end justify-between gap-2 px-3 py-2 text-gray-500",children:[a.jsxs("a",{href:"https://github.com/v3xlabs/open-lavatory",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 p-1 font-semibold text-gray-500 text-sm",children:[a.jsx("img",{src:Dt,alt:"Open Lavatory Logo",width:20,height:20,className:"rounded"}),a.jsx("span",{children:"openlv"})]}),a.jsx("div",{className:"text-gray-500 text-sm",children:a.jsx(xn,{})})]})]});function _n(e){return _e({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 Ft(e){return _e({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 jn(e){return _e({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 Sn=({title:e,view:t,onClose:r,onBack:n})=>a.jsxs("div",{className:"flex items-center justify-between px-2 py-2",children:[n?a.jsx(se,{onClick:n,"aria-label":t==="settings"?"Back to QR":"Close modal",$variant:"tertiary",$aspect:"square",$size:"md",children:a.jsx(_n,{className:"h-6 w-6 text-gray-500"})}):a.jsx(se,{type:"button",href:"https://openlv.sh",target:"_blank",$variant:"tertiary",$aspect:"square",$size:"md",children:a.jsx(Ft,{className:"h-5 w-5"})}),a.jsx("h2",{className:"flex items-center justify-center gap-2 font-semibold text-gray-900 text-lg",children:e}),a.jsx(se,{type:"button","aria-label":"close","aria-pressed":!1,onClick:r,$variant:"tertiary",$aspect:"square",$size:"md",children:a.jsx(jn,{className:"h-6 w-6 text-gray-500"})})]}),Cn=Lt({slots:{root:"group relative",box:"cursor-pointer rounded-md transition-colors hover:bg-neutral-200 flex items-center justify-center",popover:"-translate-x-1/2 absolute top-full left-1/2 z-10 hidden rounded-md bg-neutral-100 p-2 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"}}),Ge=({variant:e="icon",children:t,size:r="lg"})=>{const{root:n,box:i,popover:o,icon:s}=Cn({size:r,variant:e});return a.jsxs("div",{className:n(),children:[a.jsx("div",{className:i(),children:V(e).with("icon",()=>a.jsx(Ft,{className:s()})).with("text",()=>a.jsx("div",{children:"Text"})).exhaustive()}),a.jsx("div",{className:o(),children:t})]})},Ze=({title:e,right:t,children:r})=>a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-end justify-between px-2 py-1",children:[a.jsx("div",{className:"font-medium text-gray-900 text-sm",children:e}),a.jsx("div",{children:t})]}),a.jsx("div",{className:"flex flex-col gap-1 rounded-md bg-[#F4F5F6] p-2",children:r})]}),xe=({label:e,children:t})=>a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("div",{className:"pl-1 text-sm",children:e}),a.jsx("div",{children:t})]}),qe=({options:e,value:t,onChange:r})=>a.jsx("div",{className:"flex divide-x rounded-md border border-gray-300",children:e.map(([n,i])=>a.jsx("button",{type:"button",onClick:()=>r(n),"aria-pressed":n===t,className:te("px-4 py-2 font-semibold text-xs transition first:rounded-l-md last:rounded-r-md",n===t?"border-blue-500 bg-blue-50 text-blue-600":"cursor-pointer border-gray-300 text-gray-600 hover:border-gray-400"),children:i},n))}),Nn=({label:e,value:t,onChange:r})=>a.jsx(qe,{options:[["true","Yes"],["false","No"]],value:t?"true":"false",onChange:n=>r(n==="true")}),An=()=>{const{settings:e,updateSettings:t}=Xe();return a.jsx(Ze,{title:"Connection preferences",right:a.jsx(Ge,{variant:"icon",children:"Something something very cool"}),children:[["Retain session history","retainHistory",e?.retainHistory??!1,r=>t({retainHistory:r})],["Auto reconnect","autoReconnect",e?.autoReconnect??!1,r=>t({autoReconnect:r})]].map(([r,n,i,o])=>a.jsx(xe,{label:r,children:a.jsx(Nn,{label:r,value:i,onChange:o})},n))})},On="h-9 w-full rounded-lg border border-gray-300 bg-white px-3 text-sm text-gray-700 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200",En=({id:e,value:t,placeholder:r,ariaLabel:n,readOnly:i=!0,onChange:o})=>a.jsx("input",{id:e,className:On,value:t,placeholder:r,"aria-label":n,readOnly:i,onChange:s=>{s.target instanceof HTMLInputElement&&o?.(s.target.value)}}),Rn=["MQTT","NTFY","GUN"],Tn=()=>{const{settings:e,updateSignalingProtocol:t,updateSignalingServer:r}=Xe();return a.jsx("div",{children:a.jsxs(Ze,{title:"Signaling",right:a.jsx(Ge,{variant:"icon",children:"Something something very cool"}),children:[a.jsx(xe,{label:"Protocol",children:a.jsx(qe,{options:Rn.map(n=>[n.toLowerCase(),n]),value:e?.signaling.p||"",onChange:t})}),a.jsx(xe,{label:"Server",children:a.jsx(En,{id:"server",value:e?.signaling.s[e?.signaling.p||""]||"",onChange:n=>r(n),placeholder:"Server URL",ariaLabel:"Server URL",readOnly:!1})})]})})},Pn=["WebRTC"],Mn=()=>{const[e,t]=c.useState("WebRTC");return a.jsx(Ze,{title:"Transport",right:a.jsx(Ge,{variant:"icon",children:"Something something very cool"}),children:a.jsx(xe,{label:"Protocol",children:a.jsx(qe,{options:Pn.map(r=>[r,r]),value:e,onChange:r=>t(r)})})})},Vn=()=>a.jsxs("div",{className:"px-4 pb-2",children:[a.jsx(Tn,{}),a.jsx(Mn,{}),a.jsx(An,{})]}),zn=()=>{const[e,t]=c.useState("start"),[r,n]=c.useState(!1);return c.useEffect(()=>{if(!r)return;const i=window.setTimeout(()=>n(!1),2e3);return()=>window.clearTimeout(i)},[r]),{view:e,setView:t,copied:r,setCopied:n}},Ln=e=>{c.useEffect(()=>{const t=r=>{r.key==="Escape"&&e()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e])},Dn=()=>{const e=c.useRef(null),[t,r]=c.useState(0),n=c.useRef(!1),i=c.useCallback((o,s=!1)=>{const l=o||e.current;if(!l)return;const u=s?l.scrollHeight:l.getBoundingClientRect().height;u>0&&(r(v=>typeof v=="number"&&Math.abs(v-u)<.5?v:u),n.current=!0)},[]);return c.useLayoutEffect(()=>{const o=e.current;if(!o||typeof ResizeObserver>"u")return;const s=new ResizeObserver(()=>{i()});return s.observe(o),()=>s.disconnect()},[i]),c.useEffect(()=>{if(typeof window>"u")return;const o=()=>{i()};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[i]),{contentRef:e,height:t,measureHeight:i,setHeight:r}},It=({onClose:e=()=>{},onCopy:t})=>{const{view:r,setView:n,copied:i,setCopied:o}=zn(),{uri:s}=ue(),{status:l,provider:u}=re(),{contentRef:v,height:y,measureHeight:D}=Dn(),{current:S,previous:q,isTransitioning:Y}=pt(r),{current:$,previous:F,isTransitioning:B}=pt(l),P=c.useCallback(()=>n("settings"),[n]),de=V(r).with("start",()=>"Connect Wallet").with("settings",()=>"Settings").exhaustive();Ln(e);const M=c.useCallback(async()=>{s&&await wn(s)&&o(!0)},[s,o]),fe=c.useRef(!0),W=c.useRef(),G=c.useRef(void 0),[Se,ne]=c.useState(!1),I=c.useRef();c.useLayoutEffect(()=>{if(v.current)return fe.current?(W.current&&window.clearTimeout(W.current),W.current=window.setTimeout(()=>{v.current&&(D(void 0,!0),fe.current=!1)},0)):D(),()=>{W.current&&window.clearTimeout(W.current)}},[D,$,S]),c.useEffect(()=>(G.current!==void 0&&y!==G.current&&y>0&&G.current>0&&Math.abs(y-G.current)>.5&&(ne(!0),I.current&&window.clearTimeout(I.current),I.current=window.setTimeout(()=>{ne(!1),I.current=void 0},200)),G.current=y,()=>{I.current&&window.clearTimeout(I.current)}),[y]);const ie=()=>{u?.closeSession()},Ce=V({view:r,status:l}).with({view:"start",status:"disconnected"},()=>{}).with({view:"start"},()=>ie).with({view:"settings"},()=>()=>n("start")).otherwise(()=>()=>{ie(),e()}),pe=f=>V(f).with("start",()=>a.jsx(bn,{onSettings:P})).with("settings",()=>a.jsx(Vn,{})).otherwise(()=>a.jsx(Ve,{state:f})),h=()=>a.jsxs("div",{className:"modal-transition__container",children:[q&&a.jsx("div",{className:"modal-transition__layer modal-transition__layer--outgoing",children:pe(q)}),a.jsx("div",{className:te("modal-transition__layer",Y&&"modal-transition__layer--incoming"),children:pe(S)})]}),p=f=>V(f).with("disconnected",()=>h()).with(Ke.union("connecting","connected"),()=>a.jsx(kr,{onClose:e,onCopy:t||M})).otherwise(b=>a.jsx(Ve,{state:b||"unknown status"}));return ve("view",r),a.jsx("div",{className:"fixed inset-0 z-[10000] flex animate-[bg-in_0.15s_ease-in-out] items-end justify-center bg-black/30 font-sans text-slate-800 backdrop-blur-sm md:items-center lg:p-4",onClick:e,role:"presentation","data-openlv-modal-root":!0,children:a.jsxs("div",{className:te("relative w-full max-w-[400px] animate-[fade-in_0.15s_ease-in-out] rounded-t-radius bg-body-background transition-[height] duration-[200ms] ease-out md:rounded-b-radius",Se||F?"overflow-hidden":void 0),role:"dialog","aria-modal":"true","aria-label":de,onClick:f=>f.stopPropagation(),style:typeof y=="number"&&y>0?{height:`${y}px`}:void 0,children:[a.jsxs("div",{ref:v,children:[a.jsx(Sn,{title:de,view:r,onClose:e,onBack:Ce}),a.jsxs("div",{className:"modal-transition__container",children:[F&&a.jsx("div",{className:"modal-transition__layer modal-transition__layer--outgoing absolute",children:a.jsx("div",{className:"flex flex-col text-center",children:p(F)})}),a.jsx("div",{className:te("modal-transition__layer",B&&"modal-transition__layer--incoming"),children:a.jsx("div",{className:"flex flex-col text-center",children:p($)})})]}),a.jsx(kn,{})]}),a.jsx("div",{className:te("absolute top-5 right-5 rounded-lg bg-blue-500 px-4 py-3 font-medium text-sm text-white transition-all",i?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:"📋 Connection URL copied to clipboard!"})]})})},ht='/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@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-divide-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-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia: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-50:oklch(97% .014 254.604);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-slate-800:oklch(27.9% .041 260.031);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--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-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-900:oklch(21% .034 264.665);--color-neutral-100:oklch(97% 0 0);--color-neutral-200:oklch(92.2% 0 0);--color-black:#000;--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;--blur-sm:8px;--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);--color-body-background:var(--lv-body-background);--radius-radius:var(--lv-border-radius)}}@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{.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)))}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-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-t-radius{border-top-left-radius:var(--radius-radius);border-top-right-radius:var(--radius-radius)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-lg{border-top-right-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-4{border-style:var(--tw-border-style);border-width:4px}.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-neutral-200{border-color:var(--color-neutral-200)}.border-t-transparent{border-top-color:#0000}.bg-\\[\\#F4F5F6\\]{background-color:#f4f5f6}.bg-black\\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-body-background{background-color:var(--color-body-background)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.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-neutral-100{background-color:var(--color-neutral-100)}.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)}.pr-3{padding-right:calc(var(--spacing)*3)}.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-4{padding-left:calc(var(--spacing)*4)}.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)}.text-blue-600{color:var(--color-blue-600)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-900{color:var(--color-gray-900)}.text-slate-800{color:var(--color-slate-800)}.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,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.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-opacity{transition-property:opacity;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-300{--tw-duration:.3s;transition-duration:.3s}.duration-\\[200ms\\]{--tw-duration:.2s;transition-duration:.2s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}@media (hover:hover){.group-hover\\:block:is(:where(.group):hover *){display:block}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.first\\:rounded-l-md:first-child{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.last\\:rounded-r-md:last-child{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}@media (hover:hover){.hover\\:border-gray-400:hover{border-color:var(--color-gray-400)}.hover\\:bg-blue-600:hover{background-color:var(--color-blue-600)}.hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\\:bg-gray-300:hover{background-color:var(--color-gray-300)}.hover\\:bg-neutral-200:hover{background-color:var(--color-neutral-200)}.hover\\:text-gray-700:hover{color:var(--color-gray-700)}}.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)}@media (min-width:48rem){.md\\:items-center{align-items:center}.md\\:rounded-b-radius{border-bottom-right-radius:var(--radius-radius);border-bottom-left-radius:var(--radius-radius)}}@media (min-width:64rem){.lg\\:p-4{padding:calc(var(--spacing)*4)}}}@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}@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-divide-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-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{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)}}',Fn=async(e,t)=>{if(e){if(e.querySelector("style[data-openlv-modal]"))return;const n=document.createElement("style");if(n.setAttribute("data-openlv-modal","true"),t){const i=wt(t),o=`:root, :host {${Object.entries(i).map(([s,l])=>`${s}: ${l};`).join(`
6
+ `)}}`;n.textContent=`${o}
7
+ ${ht}`}else n.textContent=ht;e.appendChild(n)}};class je extends HTMLElement{constructor(r,n=Je){super();ee(this,"onClose");ee(this,"provider");ee(this,"theme");ee(this,"shadow");ee(this,"renderRequested",!1);this.provider=r,this.theme=n,this.shadow=this.attachShadow({mode:"open"}),Fn(this.shadow,this.theme)}connectedCallback(){this.requestRender()}disconnectedCallback(){d.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(){d.render(d.h(dr,{onClose:this.onClose??(()=>this.remove()),provider:this.provider}),this.shadow)}}const In=(e="idle")=>{const[t,r]=c.useState({state:e}),n=c.useCallback((s,l)=>{r(u=>({...u,state:s,...l}))},[]),i=c.useCallback(s=>{r(s)},[]),o=c.useCallback(()=>{r({state:"idle"})},[]);return{connectionInfo:t,updateState:n,updateConnectionInfo:i,reset:o}},Bt=(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)},Bn=e=>{const t=document.querySelector("openlv-modal");if(t&&t.remove(),!t){Bt();const r=new je(e);document.body.appendChild(r),r.showModal(),r.onClose=()=>{ve("modal closed"),r.remove()}}};exports.ModalRoot=It;exports.OPENLV_ICON_128=Dt;exports.OpenLVModalElement=je;exports.default=je;exports.registerOpenLVModal=Bt;exports.triggerOpenModal=Bn;exports.useConnectionState=In;
8
+ //# sourceMappingURL=index.cjs.js.map