Files
pyMC_Repeater/repeater/web/html/assets/RoomServers-Bzn0ATce.js
T
2026-05-19 14:45:26 +01:00

1 line
42 KiB
JavaScript

import{B as e,Ct as t,E as n,R as r,V as i,Y as a,c as o,f as ee,g as te,i as s,j as c,k as l,l as u,m as d,o as f,p,r as m,s as h,u as g,xt as _}from"./runtime-core.esm-bundler-C5QBTNWE.js";import{l as ne,s as v,t as re,u as y}from"./runtime-dom.esm-bundler-fKU3dih-.js";import{t as b}from"./api-2atwkqmS.js";import{t as ie}from"./system-CTM04EjO.js";import{t as ae}from"./Spinner-CYvUNW0P.js";import{n as oe}from"./index-BSfX6DVt.js";import{t as se}from"./ConfirmDialog-XtZRdfP5.js";import{t as ce}from"./MessageDialog-Bs1UHPdw.js";import{t as le}from"./LocationPicker-Bar25pRo.js";import{n as ue,t as de}from"./preferences-6MHglq--.js";var fe={class:`p-6 space-y-6`},pe={key:0,class:`grid grid-cols-1 md:grid-cols-3 gap-4`},me={class:`glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5`},he={class:`flex items-center justify-between`},ge={class:`text-3xl font-bold text-content-primary dark:text-content-primary mb-1`},_e={class:`glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5`},ve={class:`flex items-center justify-between`},ye={class:`text-3xl font-bold text-primary mb-1`},be={class:`glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5`},xe={class:`flex items-center justify-between`},Se={key:0,class:`w-6 h-6 text-accent-green`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Ce={key:1,class:`w-6 h-6 text-accent-yellow`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},we={class:`glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6`},Te={key:0,class:`flex items-center justify-center py-12`},Ee={class:`text-center`},De={key:1,class:`flex items-center justify-center py-12`},Oe={class:`text-center`},ke={class:`text-content-secondary dark:text-content-muted text-sm mb-4`},Ae={key:2,class:`space-y-4`},je={class:`flex items-start justify-between`},Me={class:`flex-1`},Ne={class:`flex items-center gap-3 mb-4`},Pe={class:`relative`},Fe={key:0,class:`absolute inset-0 bg-accent-green/50 rounded-full animate-ping`},Ie={class:`text-xl font-bold text-content-primary dark:text-content-primary`},Le={key:0,class:`text-content-muted dark:text-content-muted text-sm`},Re={class:`grid grid-cols-1 md:grid-cols-2 gap-3 text-sm mb-3`},ze={class:`text-content-primary dark:text-content-primary/90 ml-2`},Be={class:`flex items-center gap-2`},Ve={key:0,class:`text-content-primary dark:text-content-primary/90 font-mono ml-2 text-xs`},He={key:1,class:`text-content-muted dark:text-content-muted ml-2 text-xs`},Ue=[`onClick`],We={class:`text-content-primary dark:text-content-primary/90 ml-2`},Ge={key:0},Ke={class:`text-content-primary dark:text-content-primary/90 ml-2`},qe={key:0,class:`text-accent-green`},Je={key:1,class:`text-content-muted dark:text-content-muted`},Ye={key:2,class:`text-primary`},Xe={key:0,class:`text-xs text-content-muted dark:text-content-muted font-mono`},Ze={class:`ml-4 flex flex-wrap gap-2`},Qe=[`onClick`,`disabled`,`title`],$e=[`onClick`,`disabled`,`title`],et=[`onClick`],tt=[`onClick`],nt={key:3,class:`text-center py-12 text-content-secondary dark:text-content-muted`},rt={class:`modal-card max-w-2xl w-full max-h-[90vh] overflow-y-auto`},it={class:`modal-field-label-row`},at={key:0},ot={key:1,class:`text-content-secondary dark:text-content-muted text-sm`},st={class:`grid grid-cols-2 gap-5`},ct={class:`grid grid-cols-2 gap-5`},lt={class:`modal-card max-w-2xl w-full max-h-[90vh] overflow-y-auto`},ut={class:`modal-field-label-row`},dt={key:0},ft={key:1,class:`text-content-secondary dark:text-content-muted text-sm`},pt={class:`grid grid-cols-2 gap-5`},mt={class:`grid grid-cols-2 gap-5`},ht={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 max-w-4xl w-full h-[85vh] flex flex-col shadow-2xl`},gt={class:`relative overflow-hidden rounded-[15px] mb-6 p-5 bg-white/50 dark:bg-white/5 border border-stroke-subtle dark:border-white/10`},_t={class:`relative flex items-center justify-between`},vt={class:`flex items-center gap-4`},yt={class:`text-content-secondary dark:text-content-muted text-sm flex items-center gap-2`},bt={class:`text-primary font-semibold`},xt={class:`flex items-center gap-2`},St={class:`bg-primary/30 px-1.5 py-0.5 rounded-full text-[10px]`},Ct={class:`flex-1 overflow-y-auto mb-4 space-y-3`},wt={key:0,class:`flex items-center justify-center py-12`},Tt={class:`text-center`},Et={key:1,class:`flex items-center justify-center py-12`},Dt={class:`text-center`},Ot={class:`text-content-secondary dark:text-content-muted text-sm mb-4`},kt={key:2,class:`space-y-3`},At={class:`relative flex items-start justify-between gap-3`},jt={class:`flex-1 min-w-0`},Mt={class:`flex items-center gap-2 mb-3`},Nt={class:`flex items-center gap-2 flex-wrap`},Pt={key:0,class:`text-primary text-sm font-bold`},Ft={key:1,class:`text-primary/80 text-xs font-mono bg-primary/10 px-2 py-1 rounded-md border border-primary/20`},It={key:2,class:`text-content-muted dark:text-content-muted text-xs`},Lt={class:`text-content-secondary dark:text-content-muted text-xs flex items-center gap-1`},Rt={key:3,class:`text-content-muted dark:text-content-muted/50 text-[10px] font-mono bg-background-mute dark:bg-white/5 px-1.5 py-0.5 rounded`},zt={class:`text-content-primary dark:text-content-primary/90 text-sm leading-relaxed break-words whitespace-pre-wrap bg-gray-50 dark:bg-white/5 p-3 rounded-[10px] border border-stroke-subtle dark:border-white/5`},Bt=[`onClick`],Vt={key:0,class:`text-center pt-4`},Ht={key:1,class:`text-center pt-4`},Ut={class:`flex items-center justify-center gap-2 text-content-secondary dark:text-content-muted text-sm`},Wt={key:3,class:`flex items-center justify-center h-full`},Gt={class:`relative overflow-hidden rounded-[15px] border-t border-stroke-subtle dark:border-white/20 pt-4 mt-4`},Kt={class:`relative space-y-3`},qt={class:`flex gap-3`},Jt={class:`flex-1 relative`},Yt=[`onKeydown`],Xt=[`disabled`],Zt={key:0,class:`fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-[350] p-4`},Qt={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-3xl w-full max-h-[80vh] flex flex-col`},$t={class:`flex items-center justify-between mb-4 pb-4 border-b border-stroke-subtle dark:border-white/10`},en={class:`text-content-secondary dark:text-content-primary/70 text-sm mt-1`},tn={class:`text-primary`},nn={class:`flex-1 overflow-y-auto space-y-3`},rn={key:0,class:`text-center py-12`},an={class:`space-y-2`},on={class:`flex items-center justify-between`},sn={class:`flex items-center gap-2`},cn={class:`text-content-primary dark:text-content-primary font-semibold`},ln={class:`flex items-center gap-2`},un={class:`text-content-secondary dark:text-content-muted text-xs`},dn=[`onClick`],fn={class:`space-y-1 text-xs`},pn={class:`flex items-center gap-2`},mn={class:`text-primary font-mono bg-primary/10 px-2 py-0.5 rounded`},hn={class:`flex items-center gap-2`},gn={class:`text-primary font-mono bg-primary/10 px-2 py-0.5 rounded text-[10px] break-all`},_n={class:`flex items-center justify-between text-xs text-content-secondary dark:text-content-muted`},vn={class:`flex items-center gap-4`},yn={key:0},bn={key:1},xn={key:0},x=te({name:`RoomServersView`,__name:`RoomServers`,setup(te){let x=ie(),Sn=f(()=>x.stats?.config?.repeater?.latitude??0),Cn=f(()=>x.stats?.config?.repeater?.longitude??0),S=a(!1),C=a(!1),w=a(!1),T=a(null),E=a(null),D=a(!1),O=a(!1),k=a(!1),A=a(null),j=a(``),M=a(!1),N=a(!1),P=a(new Set),wn=f(()=>E.value?.configured?.filter(e=>e.registered).length??0),Tn=f(()=>E.value?.configured?.length??0),F=f(()=>wn.value===Tn.value),I=a(!1),L=a(``),En=a(!1),Dn=a({message:``,variant:`success`}),R=a(!1),z=a(``),On=a(``),B=a([]),V=a(!1),H=a(null),U=a(``),W=a(de(`roomServers_messagesLimit`,50)),G=a(0),K=a(!0);r(W,e=>ue(`roomServers_messagesLimit`,e));let q=a([]),kn=a(!1),J=a({name:``,identity_key:``,type:`room_server`,settings:{node_name:``,latitude:0,longitude:0,admin_password:``,guest_password:``}});n(async()=>{await Y()});async function Y(){w.value=!0,T.value=null;try{let e=await b.getIdentities();e.success?E.value=e.data:T.value=e.error||`Failed to load identities`}catch(e){T.value=e instanceof Error?e.message:`Failed to load identities`}finally{w.value=!1}}function An(e){e.latitude=Math.round(e.latitude*1e6)/1e6,e.longitude=Math.round(e.longitude*1e6)/1e6}async function jn(){An(J.value.settings);try{let e=await b.createIdentity(J.value);e.success?(D.value=!1,await Y(),k.value=!0):X(`Failed to create identity: ${e.error}`,`error`)}catch(e){X(`Error creating identity: ${e}`,`error`)}}async function Mn(){let e={...A.value,settings:{...A.value.settings}};An(e.settings),e.name===j.value?delete e.new_name:(e.new_name=e.name,e.name=j.value);try{let t=await b.updateIdentity(e);t.success?(O.value=!1,A.value=null,await Y(),k.value=!0):X(`Failed to update identity: ${t.error}`,`error`)}catch(e){X(`Error updating identity: ${e}`,`error`)}}function Nn(e){L.value=e,I.value=!0}async function Pn(){let e=L.value;I.value=!1;try{let t=await b.deleteIdentity(e);t.success?(await Y(),X(t.message||`Identity deleted successfully!`,`success`)):X(`Failed to delete identity: ${t.error}`,`error`)}catch(e){X(`Error deleting identity: ${e}`,`error`)}finally{L.value=``}}function X(e,t){Dn.value={message:e,variant:t},En.value=!0}async function Fn(e){try{let t=await b.sendRoomServerAdvert(e);t.success?X(t.message||`Advert sent for '${e}'!`,`success`):X(`Failed to send advert: ${t.error}`,`error`)}catch(e){X(`Error sending advert: ${e}`,`error`)}}function In(e){A.value=JSON.parse(JSON.stringify(e)),j.value=A.value.name,delete A.value.new_name,A.value.settings||(A.value.settings={}),A.value.settings.admin_password||(A.value.settings.admin_password=``),A.value.settings.guest_password||(A.value.settings.guest_password=``),A.value.settings.latitude??(A.value.settings.latitude=0),A.value.settings.longitude??(A.value.settings.longitude=0),N.value=!1,O.value=!0}function Ln(){J.value={name:``,identity_key:``,type:`room_server`,settings:{node_name:``,latitude:Sn.value,longitude:Cn.value,admin_password:``,guest_password:``}},M.value=!1}function Rn(){Ln(),D.value=!0}function zn(e){J.value.settings.latitude=e.latitude,J.value.settings.longitude=e.longitude}function Bn(e){A.value&&(A.value.settings.latitude=e.latitude,A.value.settings.longitude=e.longitude)}function Z(){D.value=!1,O.value=!1,A.value=null,M.value=!1,N.value=!1}function Vn(e){P.value.has(e)?P.value.delete(e):P.value.add(e)}async function Hn(e){z.value=e,R.value=!0,G.value=0,K.value=!0,On.value=E.value?.configured.find(t=>t.name===e)?.hash||``,await Un(),await Q(!0)}async function Un(){try{let e=await b.getACLClients({identity_hash:On.value,identity_name:z.value});e.success&&e.data&&(q.value=e.data.clients||[])}catch(e){console.error(`Failed to fetch ACL clients:`,e)}}async function Q(e=!1){e&&(G.value=0,B.value=[]),V.value=!0,H.value=null;try{let t=await b.getRoomMessages({room_name:z.value,limit:W.value,offset:G.value});if(t.success&&t.data){let n=t.data.messages||[];e?B.value=n:B.value=[...B.value,...n],K.value=n.length===W.value}else H.value=t.error||`Failed to load messages`}catch(e){H.value=e instanceof Error?e.message:`Failed to load messages`}finally{V.value=!1}}async function Wn(){G.value+=W.value,await Q(!1)}async function $(){if(U.value.trim())try{let e=await b.postRoomMessage({room_name:z.value,message:U.value,author_pubkey:`server`});e.success?(U.value=``,await Q(!0)):X(`Failed to send message: ${e.error}`,`error`)}catch(e){X(`Error sending message: ${e}`,`error`)}}async function Gn(e){if(confirm(`Are you sure you want to delete this message?`))try{let t=await b.deleteRoomMessage({room_name:z.value,message_id:e});t.success?(await Q(!0),X(`Message deleted successfully`,`success`)):X(`Failed to delete message: ${t.error}`,`error`)}catch(e){X(`Error deleting message: ${e}`,`error`)}}function Kn(){R.value=!1,z.value=``,On.value=``,B.value=[],U.value=``,H.value=null,q.value=[]}function qn(e){return e?new Date(e*1e3).toLocaleString():`Unknown`}async function Jn(e,t){if(confirm(`Are you sure you want to remove this client from the ACL?`))try{let n=await b.removeACLClient({public_key:e,identity_hash:t});n.success?(await Un(),X(`Client removed successfully`,`success`)):X(`Failed to remove client: ${n.error}`,`error`)}catch(e){X(`Error removing client: ${e}`,`error`)}}return(n,r)=>(l(),g(m,null,[h(`div`,fe,[h(`div`,{class:`relative overflow-hidden rounded-[20px] p-6 mb-6 glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10`},[r[30]||=h(`div`,{class:`absolute inset-0 bg-gradient-to-br from-primary/20 via-secondary/10 to-accent-purple/20 opacity-50`},null,-1),r[31]||=h(`div`,{class:`absolute inset-0 bg-gradient-to-tl from-accent-green/10 via-transparent to-primary/10 animate-pulse`},null,-1),h(`div`,{class:`relative flex items-center justify-between`},[r[29]||=ee(`<div class="flex items-center gap-4"><div class="relative"><div class="absolute inset-0 bg-primary/30 blur-xl rounded-full"></div><div class="relative bg-primary/20 p-4 rounded-[15px] border border-primary/30"><svg class="w-8 h-8 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path></svg></div></div><div><h1 class="text-3xl font-bold text-content-primary dark:text-content-primary mb-1"> Room Servers </h1><p class="text-content-secondary dark:text-content-muted text-sm"> Manage room server identities and messages </p></div></div>`,1),h(`button`,{onClick:Rn,class:`group relative px-6 py-3 bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary rounded-[12px] border border-primary/50 transition-all hover:scale-105 hover:shadow-lg hover:shadow-primary/20`},[...r[28]||=[h(`span`,{class:`flex items-center gap-2`},[h(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4v16m8-8H4`})]),p(` Add Room Server `)],-1)]])])]),E.value&&E.value.total_configured>0?(l(),g(`div`,pe,[h(`div`,me,[h(`div`,he,[h(`div`,null,[r[32]||=h(`div`,{class:`text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide`},` Total Configured `,-1),h(`div`,ge,t(Tn.value),1)]),r[33]||=h(`div`,{class:`bg-background-mute dark:bg-white/10 p-3 rounded-[12px]`},[h(`svg`,{class:`w-6 h-6 text-content-secondary dark:text-content-primary/70`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10`})])],-1)])]),h(`div`,_e,[h(`div`,ve,[h(`div`,null,[r[34]||=h(`div`,{class:`text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide`},` Currently Registered `,-1),h(`div`,ye,t(wn.value),1)]),r[35]||=h(`div`,{class:`bg-primary/20 p-3 rounded-[12px]`},[h(`svg`,{class:`w-6 h-6 text-primary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 13l4 4L19 7`})])],-1)])]),h(`div`,be,[h(`div`,xe,[h(`div`,null,[r[36]||=h(`div`,{class:`text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide`},` Status `,-1),h(`div`,{class:_([`text-3xl font-bold`,F.value?`text-accent-green`:`text-accent-yellow`])},t(F.value?`Synced`:`Out of Sync`),3)]),h(`div`,{class:_([`p-3 rounded-[12px]`,F.value?`bg-accent-green/20`:`bg-accent-yellow/20`])},[F.value?(l(),g(`svg`,Se,[...r[37]||=[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`},null,-1)]])):(l(),g(`svg`,Ce,[...r[38]||=[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`},null,-1)]]))],2)])])])):u(``,!0),h(`div`,we,[w.value?(l(),g(`div`,Te,[h(`div`,Ee,[d(ae,{class:`mx-auto mb-4`}),r[39]||=h(`div`,{class:`text-content-secondary dark:text-content-primary/70`},` Loading room servers... `,-1)])])):T.value?(l(),g(`div`,De,[h(`div`,Oe,[r[40]||=h(`div`,{class:`text-red-600 dark:text-red-400 mb-2`},`Failed to load room servers`,-1),h(`div`,ke,t(T.value),1),h(`button`,{onClick:Y,class:`btn-primary`},` Retry `)])])):E.value&&E.value.configured.length>0?(l(),g(`div`,Ae,[(l(!0),g(m,null,c(E.value.configured,e=>(l(),g(`div`,{key:e.name,class:`glass-card backdrop-blur-xl rounded-[15px] p-5 border border-stroke-subtle dark:border-white/10`},[h(`div`,je,[h(`div`,Me,[h(`div`,Ne,[h(`div`,Pe,[e.registered?(l(),g(`div`,Fe)):u(``,!0),h(`div`,{class:_([`relative w-3 h-3 rounded-full`,e.registered?`bg-accent-green`:`bg-accent-red`])},null,2)]),h(`h3`,Ie,t(e.name),1),h(`span`,{class:_([`px-3 py-1 text-xs font-semibold rounded-full`,e.registered?`bg-accent-green/20 text-accent-green border border-accent-green/30`:`bg-accent-red/20 text-accent-red border border-accent-red/30`])},t(e.registered?`● Active`:`○ Inactive`),3),e.hash?(l(),g(`span`,Le,t(e.hash),1)):u(``,!0)]),h(`div`,Re,[h(`div`,null,[r[41]||=h(`span`,{class:`text-content-muted dark:text-content-muted`},`Node Name:`,-1),h(`span`,ze,t(e.settings?.node_name||`Not set`),1)]),h(`div`,Be,[r[42]||=h(`span`,{class:`text-content-muted dark:text-content-muted`},`Identity Key:`,-1),P.value.has(e.name)?(l(),g(`span`,Ve,t(e.identity_key),1)):(l(),g(`span`,He,` •••••••••••••••• `)),h(`button`,{onClick:t=>Vn(e.name),class:`text-primary/70 hover:text-primary text-xs underline`},t(P.value.has(e.name)?`Hide`:`Show`),9,Ue)]),h(`div`,null,[r[43]||=h(`span`,{class:`text-content-muted dark:text-content-muted`},`Location:`,-1),h(`span`,We,t(e.settings?.latitude||0)+`, `+t(e.settings?.longitude||0),1)]),e.settings?.admin_password||e.settings?.guest_password?(l(),g(`div`,Ge,[r[44]||=h(`span`,{class:`text-content-muted dark:text-content-muted`},`Passwords:`,-1),h(`span`,Ke,[e.settings?.admin_password?(l(),g(`span`,qe,`Admin`)):u(``,!0),e.settings?.admin_password&&e.settings?.guest_password?(l(),g(`span`,Je,` / `)):u(``,!0),e.settings?.guest_password?(l(),g(`span`,Ye,`Guest`)):u(``,!0)])])):u(``,!0)]),e.address?(l(),g(`div`,Xe,` Address: `+t(e.address),1)):u(``,!0)]),h(`div`,Ze,[h(`button`,{onClick:t=>Hn(e.name),disabled:!e.registered,class:_([`group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2`,e.registered?`bg-secondary/20 hover:bg-secondary/30 text-secondary border border-secondary/30 hover:scale-105 hover:shadow-lg hover:shadow-secondary/20`:`bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10`]),title:e.registered?`Manage messages for this room`:`Room server must be active to manage messages`},[...r[45]||=[h(`svg`,{class:`w-4 h-4 group-hover:rotate-12 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z`})],-1),p(` Messages `,-1)]],10,Qe),h(`button`,{onClick:t=>Fn(e.name),disabled:!e.registered,class:_([`group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2`,e.registered?`bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/30 hover:scale-105 hover:shadow-lg hover:shadow-accent-green/20`:`bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10`]),title:e.registered?`Send advert for this room server`:`Room server must be active to send advert`},[...r[46]||=[h(`svg`,{class:`w-4 h-4 group-hover:scale-110 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 10V3L4 14h7v7l9-11h-7z`})],-1),p(` Send Advert `,-1)]],10,$e),h(`button`,{onClick:t=>In(e),class:`btn-primary-xs`},` Edit `,8,et),h(`button`,{onClick:t=>Nn(e.name),class:`btn-danger-xs`},` Delete `,8,tt)])])]))),128))])):(l(),g(`div`,nt,[r[47]||=h(`svg`,{class:`w-16 h-16 mx-auto mb-4 text-content-muted dark:text-content-muted/60`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4`})],-1),r[48]||=h(`p`,{class:`text-lg mb-2`},`No room servers configured`,-1),r[49]||=h(`p`,{class:`text-sm mb-4`},`Add your first room server to get started`,-1),h(`button`,{onClick:Rn,class:`btn-primary`},` + Add Room Server `)]))]),(l(),o(s,{to:`body`},[d(re,{"enter-active-class":`transition-opacity duration-200`,"enter-from-class":`opacity-0`,"leave-active-class":`transition-opacity duration-200`,"leave-to-class":`opacity-0`},{default:e(()=>[D.value?(l(),g(`div`,{key:0,class:`modal-backdrop`,onClick:y(Z,[`self`])},[h(`div`,rt,[h(`div`,{class:`flex items-center justify-between mb-7`},[r[51]||=h(`div`,null,[h(`h3`,{class:`text-xl font-semibold text-content-primary dark:text-content-primary`},` Add Room Server `),h(`p`,{class:`text-content-secondary dark:text-content-muted text-sm mt-1`},` Configure a new room server identity `)],-1),h(`button`,{onClick:Z,class:`text-content-secondary dark:text-white/60 hover:text-content-primary dark:hover:text-white transition-colors`},[...r[50]||=[h(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),h(`form`,{onSubmit:y(jn,[`prevent`]),class:`modal-form`},[h(`div`,null,[r[52]||=h(`label`,{class:`modal-field-label`},[p(`Name `),h(`span`,{class:`text-red-500`},`*`)],-1),i(h(`input`,{"onUpdate:modelValue":r[0]||=e=>J.value.name=e,type:`text`,placeholder:`e.g., MainBBS`,class:`modal-input`},null,512),[[v,J.value.name]])]),h(`div`,null,[h(`div`,it,[r[53]||=h(`span`,{class:`text-xs font-medium text-content-secondary dark:text-content-muted`},`Identity Key (Optional)`,-1),h(`button`,{onClick:r[1]||=e=>M.value=!M.value,type:`button`,class:`text-primary/70 hover:text-primary text-xs underline`},t(M.value?`Hide`:`Show/Edit`),1)]),M.value?(l(),g(`div`,at,[i(h(`input`,{"onUpdate:modelValue":r[2]||=e=>J.value.identity_key=e,type:`text`,placeholder:`Leave empty to auto-generate`,class:`modal-input font-mono`},null,512),[[v,J.value.identity_key]]),r[54]||=h(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Leave empty to automatically generate a secure key `,-1)])):(l(),g(`div`,ot,` Will be auto-generated if not provided `))]),h(`div`,null,[r[55]||=h(`label`,{class:`modal-field-label`},`Node Name`,-1),i(h(`input`,{"onUpdate:modelValue":r[3]||=e=>J.value.settings.node_name=e,type:`text`,placeholder:`Display name for the room server`,class:`modal-input`},null,512),[[v,J.value.settings.node_name]])]),h(`div`,null,[r[59]||=h(`label`,{class:`modal-field-label`},`Location`,-1),h(`button`,{type:`button`,onClick:r[4]||=e=>S.value=!0,class:`flex items-center gap-1.5 px-2.5 py-1 mb-3 text-xs bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-secondary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors`,title:`Pick location on map`},[...r[56]||=[h(`svg`,{class:`w-3.5 h-3.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z`}),h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 11a3 3 0 11-6 0 3 3 0 016 0z`})],-1),p(` Pick on Map `,-1)]]),h(`div`,st,[h(`div`,null,[r[57]||=h(`label`,{class:`modal-field-label`},`Latitude`,-1),i(h(`input`,{"onUpdate:modelValue":r[5]||=e=>J.value.settings.latitude=e,type:`number`,step:`0.000001`,class:`modal-input`},null,512),[[v,J.value.settings.latitude,void 0,{number:!0}]])]),h(`div`,null,[r[58]||=h(`label`,{class:`modal-field-label`},`Longitude`,-1),i(h(`input`,{"onUpdate:modelValue":r[6]||=e=>J.value.settings.longitude=e,type:`number`,step:`0.000001`,class:`modal-input`},null,512),[[v,J.value.settings.longitude,void 0,{number:!0}]])])])]),h(`div`,ct,[h(`div`,null,[r[60]||=h(`label`,{class:`modal-field-label`},`Admin Password (Optional)`,-1),i(h(`input`,{"onUpdate:modelValue":r[7]||=e=>J.value.settings.admin_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`modal-input`},null,512),[[v,J.value.settings.admin_password]]),r[61]||=h(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},`Full access to room server`,-1)]),h(`div`,null,[r[62]||=h(`label`,{class:`modal-field-label`},`Guest Password (Optional)`,-1),i(h(`input`,{"onUpdate:modelValue":r[8]||=e=>J.value.settings.guest_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`modal-input`},null,512),[[v,J.value.settings.guest_password]]),r[63]||=h(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},`Read-only access`,-1)])]),h(`div`,{class:`modal-actions`},[h(`button`,{type:`button`,onClick:Z,class:`modal-btn-cancel`},`Cancel`),r[64]||=h(`button`,{type:`submit`,class:`modal-btn-primary`},`Create`,-1)])],32)])])):u(``,!0)]),_:1})])),d(le,{"is-open":S.value,latitude:J.value.settings.latitude,longitude:J.value.settings.longitude,onClose:r[9]||=e=>S.value=!1,onSelect:zn},null,8,[`is-open`,`latitude`,`longitude`]),(l(),o(s,{to:`body`},[d(re,{"enter-active-class":`transition-opacity duration-200`,"enter-from-class":`opacity-0`,"leave-active-class":`transition-opacity duration-200`,"leave-to-class":`opacity-0`},{default:e(()=>[O.value&&A.value?(l(),g(`div`,{key:0,class:`modal-backdrop`,onClick:y(Z,[`self`])},[h(`div`,lt,[h(`div`,{class:`flex items-center justify-between mb-7`},[r[66]||=h(`div`,null,[h(`h3`,{class:`text-xl font-semibold text-content-primary dark:text-content-primary`},` Edit Room Server `),h(`p`,{class:`text-content-secondary dark:text-content-muted text-sm mt-1`},` Update room server identity `)],-1),h(`button`,{onClick:Z,class:`text-content-secondary dark:text-white/60 hover:text-content-primary dark:hover:text-white transition-colors`},[...r[65]||=[h(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),h(`form`,{onSubmit:y(Mn,[`prevent`]),class:`modal-form`},[h(`div`,null,[r[67]||=h(`label`,{class:`modal-field-label`},[p(`Name `),h(`span`,{class:`text-red-500`},`*`)],-1),i(h(`input`,{"onUpdate:modelValue":r[10]||=e=>A.value.name=e,type:`text`,class:`modal-input`},null,512),[[v,A.value.name]])]),h(`div`,null,[h(`div`,ut,[r[68]||=h(`span`,{class:`text-xs font-medium text-content-secondary dark:text-content-muted`},`Identity Key (Optional)`,-1),h(`button`,{onClick:r[11]||=e=>N.value=!N.value,type:`button`,class:`text-primary/70 hover:text-primary text-xs underline`},t(N.value?`Hide`:`Show/Edit`),1)]),N.value?(l(),g(`div`,dt,[i(h(`input`,{"onUpdate:modelValue":r[12]||=e=>A.value.identity_key=e,type:`text`,placeholder:`Leave empty to keep current key`,class:`modal-input font-mono`},null,512),[[v,A.value.identity_key]]),r[69]||=h(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Leave empty to keep the current identity key `,-1)])):(l(),g(`div`,ft,` Click "Show/Edit" to change the identity key `))]),h(`div`,null,[r[70]||=h(`label`,{class:`modal-field-label`},`Node Name`,-1),i(h(`input`,{"onUpdate:modelValue":r[13]||=e=>A.value.settings.node_name=e,type:`text`,class:`modal-input`},null,512),[[v,A.value.settings.node_name]])]),h(`div`,null,[r[74]||=h(`label`,{class:`modal-field-label`},`Location`,-1),h(`button`,{type:`button`,onClick:r[14]||=e=>C.value=!0,class:`flex items-center gap-1.5 px-2.5 py-1 mb-3 text-xs bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-secondary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors`,title:`Pick location on map`},[...r[71]||=[h(`svg`,{class:`w-3.5 h-3.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z`}),h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 11a3 3 0 11-6 0 3 3 0 016 0z`})],-1),p(` Pick on Map `,-1)]]),h(`div`,pt,[h(`div`,null,[r[72]||=h(`label`,{class:`modal-field-label`},`Latitude`,-1),i(h(`input`,{"onUpdate:modelValue":r[15]||=e=>A.value.settings.latitude=e,type:`number`,step:`0.000001`,class:`modal-input`},null,512),[[v,A.value.settings.latitude,void 0,{number:!0}]])]),h(`div`,null,[r[73]||=h(`label`,{class:`modal-field-label`},`Longitude`,-1),i(h(`input`,{"onUpdate:modelValue":r[16]||=e=>A.value.settings.longitude=e,type:`number`,step:`0.000001`,class:`modal-input`},null,512),[[v,A.value.settings.longitude,void 0,{number:!0}]])])])]),h(`div`,mt,[h(`div`,null,[r[75]||=h(`label`,{class:`modal-field-label`},`Admin Password (Optional)`,-1),i(h(`input`,{"onUpdate:modelValue":r[17]||=e=>A.value.settings.admin_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`modal-input`},null,512),[[v,A.value.settings.admin_password]]),r[76]||=h(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},`Full access to room server`,-1)]),h(`div`,null,[r[77]||=h(`label`,{class:`modal-field-label`},`Guest Password (Optional)`,-1),i(h(`input`,{"onUpdate:modelValue":r[18]||=e=>A.value.settings.guest_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`modal-input`},null,512),[[v,A.value.settings.guest_password]]),r[78]||=h(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},`Read-only access`,-1)])]),h(`div`,{class:`modal-actions`},[h(`button`,{type:`button`,onClick:Z,class:`modal-btn-cancel`},`Cancel`),r[79]||=h(`button`,{type:`submit`,class:`modal-btn-primary`},`Update`,-1)])],32)])])):u(``,!0)]),_:1})])),d(le,{"is-open":C.value,latitude:A.value?.settings?.latitude,longitude:A.value?.settings?.longitude,onClose:r[19]||=e=>C.value=!1,onSelect:Bn},null,8,[`is-open`,`latitude`,`longitude`])]),d(se,{show:I.value,title:`Delete Room Server`,message:`Are you sure you want to delete '${L.value}'? This action cannot be undone.`,"confirm-text":`Delete`,"cancel-text":`Cancel`,variant:`danger`,onClose:r[20]||=e=>I.value=!1,onConfirm:Pn},null,8,[`show`,`message`]),d(ce,{show:En.value,message:Dn.value.message,variant:Dn.value.variant,onClose:r[21]||=e=>En.value=!1},null,8,[`show`,`message`,`variant`]),d(oe,{modelValue:k.value,"onUpdate:modelValue":r[22]||=e=>k.value=e,message:`Room server settings have been saved. A service restart is required for the changes to take effect.`},null,8,[`modelValue`]),(l(),o(s,{to:`body`},[R.value?(l(),g(`div`,{key:0,class:`fixed inset-0 bg-black/70 backdrop-blur-lg flex items-center justify-center z-[300] p-4`,onClick:r[26]||=y(e=>R.value=!1,[`self`])},[h(`div`,ht,[h(`div`,gt,[r[86]||=h(`div`,{class:`absolute inset-0 bg-gradient-to-r from-secondary/20 via-primary/20 to-accent-purple/20`},null,-1),r[87]||=h(`div`,{class:`absolute inset-0 bg-gradient-to-br from-transparent via-white/5 to-transparent`},null,-1),h(`div`,_t,[h(`div`,vt,[r[82]||=h(`div`,{class:`relative`},[h(`div`,{class:`absolute inset-0 bg-secondary/40 blur-xl rounded-full`}),h(`div`,{class:`relative bg-secondary/20 p-3 rounded-[12px] border border-secondary/30`},[h(`svg`,{class:`w-6 h-6 text-secondary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z`})])])],-1),h(`div`,null,[r[81]||=h(`h2`,{class:`text-2xl font-bold text-content-primary dark:text-content-primary mb-1`},` Room Messages `,-1),h(`p`,yt,[r[80]||=h(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z`})],-1),h(`span`,bt,t(z.value),1)])])]),h(`div`,xt,[h(`button`,{onClick:r[23]||=e=>kn.value=!0,class:`group px-3 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-[10px] text-xs font-medium transition-all hover:scale-105 border border-primary/30 flex items-center gap-2`,title:`View active sessions`},[r[83]||=h(`svg`,{class:`w-4 h-4 group-hover:scale-110 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z`})],-1),r[84]||=h(`span`,{class:`hidden sm:inline`},`Sessions`,-1),h(`span`,St,t(q.value.length),1)]),h(`button`,{onClick:Kn,class:`p-2 text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-[10px] transition-all`},[...r[85]||=[h(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])])])]),h(`div`,Ct,[V.value&&B.value.length===0?(l(),g(`div`,wt,[h(`div`,Tt,[d(ae,{class:`mx-auto mb-4`}),r[88]||=h(`div`,{class:`text-content-secondary dark:text-content-primary/70`},` Loading messages... `,-1)])])):H.value?(l(),g(`div`,Et,[h(`div`,Dt,[r[89]||=h(`div`,{class:`text-red-600 dark:text-red-400 mb-2`},`Failed to load messages`,-1),h(`div`,Ot,t(H.value),1),h(`button`,{onClick:r[24]||=e=>Q(!0),class:`btn-primary`},` Retry `)])])):B.value.length>0?(l(),g(`div`,kt,[(l(!0),g(m,null,c(B.value,(e,n)=>(l(),g(`div`,{key:e.id||n,class:`group relative overflow-hidden glass-card backdrop-blur-xl rounded-[12px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-secondary/30 transition-all duration-300 hover:shadow-lg hover:shadow-secondary/10`},[r[94]||=h(`div`,{class:`absolute inset-0 bg-gradient-to-r from-secondary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),h(`div`,At,[h(`div`,jt,[h(`div`,Mt,[h(`div`,Nt,[r[91]||=h(`div`,{class:`w-6 h-6 rounded-full bg-gradient-to-br from-primary/30 to-secondary/30 flex items-center justify-center`},[h(`svg`,{class:`w-3 h-3 text-content-secondary dark:text-content-primary/70`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})])],-1),e.author_name?(l(),g(`span`,Pt,t(e.author_name),1)):u(``,!0),e.author_pubkey?(l(),g(`span`,Ft,t(e.author_pubkey.substring(0,8))+`... `,1)):(l(),g(`span`,It,` Anonymous `)),r[92]||=h(`span`,{class:`text-content-muted dark:text-content-muted/60 text-xs`},``,-1),h(`span`,Lt,[r[90]||=h(`svg`,{class:`w-3 h-3`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})],-1),p(` `+t(qn(e.timestamp)),1)]),e.id?(l(),g(`span`,Rt,` #`+t(e.id),1)):u(``,!0)])]),h(`div`,zt,t(e.message_text),1)]),h(`button`,{onClick:t=>Gn(e.id),class:`group/delete flex-shrink-0 p-2 bg-accent-red/10 hover:bg-accent-red/20 text-accent-red rounded-[8px] transition-all hover:scale-110 border border-accent-red/20`,title:`Delete this message`},[...r[93]||=[h(`svg`,{class:`w-4 h-4 group-hover/delete:rotate-12 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})],-1)]],8,Bt)])]))),128)),K.value&&!V.value?(l(),g(`div`,Vt,[h(`button`,{onClick:Wn,class:`group px-6 py-2.5 bg-gradient-to-r from-gray-100 dark:from-white/5 to-gray-200 dark:to-white/10 hover:from-gray-200 dark:hover:from-white/10 hover:to-gray-300 dark:hover:to-white/15 text-content-primary dark:text-content-primary rounded-[10px] transition-all hover:scale-105 text-sm font-medium border border-stroke-subtle dark:border-stroke/10 flex items-center gap-2 mx-auto`},[...r[95]||=[h(`svg`,{class:`w-4 h-4 group-hover:translate-y-1 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 9l-7 7-7-7`})],-1),p(` Load More Messages `,-1)]])])):V.value?(l(),g(`div`,Ht,[h(`div`,Ut,[d(ae,{size:`sm`}),r[96]||=p(` Loading... `,-1)])])):u(``,!0)])):(l(),g(`div`,Wt,[...r[97]||=[h(`div`,{class:`text-center py-12`},[h(`div`,{class:`relative mb-6`},[h(`div`,{class:`absolute inset-0 bg-secondary/20 blur-3xl rounded-full`}),h(`div`,{class:`relative bg-gradient-to-br from-secondary/20 to-primary/20 p-6 rounded-[20px] inline-block border border-stroke-subtle dark:border-white/10`},[h(`svg`,{class:`w-16 h-16 text-content-muted dark:text-content-muted/70`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z`})])])]),h(`p`,{class:`text-xl font-bold text-content-primary dark:text-content-primary mb-2`},` No messages yet `),h(`p`,{class:`text-sm text-content-secondary dark:text-content-muted`},` Be the first to start the conversation `)],-1)]]))]),h(`div`,Gt,[r[100]||=h(`div`,{class:`absolute inset-0 bg-gradient-to-t from-primary/5 to-transparent pointer-events-none`},null,-1),h(`div`,Kt,[h(`div`,qt,[h(`div`,Jt,[i(h(`textarea`,{"onUpdate:modelValue":r[25]||=e=>U.value=e,onKeydown:[ne(y($,[`ctrl`]),[`enter`]),ne(y($,[`meta`]),[`enter`])],placeholder:`Type your message... (Ctrl+Enter to send)`,rows:`3`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-3 text-content-primary dark:text-content-primary text-sm placeholder-gray-500 dark:placeholder-white/30 focus:outline-none focus:border-primary/50 focus:bg-white dark:focus:bg-white/10 transition-all resize-none`},null,40,Yt),[[v,U.value]])]),h(`button`,{onClick:$,disabled:!U.value.trim(),class:_([`group px-6 py-3 rounded-[12px] transition-all duration-200 flex items-center justify-center gap-2 font-medium`,U.value.trim()?`bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary border border-primary/50 hover:scale-105 hover:shadow-lg hover:shadow-primary/20`:`bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10`])},[...r[98]||=[h(`svg`,{class:`w-5 h-5 group-hover:translate-x-1 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 19l9 2-9-18-9 18 9-2zm0 0v-8`})],-1),h(`span`,{class:`hidden sm:inline`},`Send`,-1)]],10,Xt)]),r[99]||=h(`p`,{class:`text-content-secondary dark:text-content-muted/60 text-xs flex items-center gap-2`},[h(`svg`,{class:`w-3 h-3`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})]),p(` Press Ctrl+Enter to send message quickly `)],-1)])])])])):u(``,!0)])),(l(),o(s,{to:`body`},[kn.value?(l(),g(`div`,Zt,[h(`div`,Qt,[h(`div`,$t,[h(`div`,null,[r[102]||=h(`h2`,{class:`text-xl font-bold text-content-primary dark:text-content-primary`},` Active Sessions `,-1),h(`p`,en,[r[101]||=p(` Room: `,-1),h(`span`,tn,t(z.value),1)])]),h(`button`,{onClick:r[27]||=e=>kn.value=!1,class:`text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary transition-colors`},[...r[103]||=[h(`svg`,{class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),h(`div`,nn,[q.value.length===0?(l(),g(`div`,rn,[...r[104]||=[h(`div`,{class:`text-content-secondary dark:text-content-muted`},`No active sessions found`,-1)]])):u(``,!0),(l(!0),g(m,null,c(q.value,(e,n)=>(l(),g(`div`,{key:e.public_key_full||n,class:`glass-card backdrop-blur-xl rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10`},[h(`div`,an,[h(`div`,on,[h(`div`,sn,[h(`span`,cn,t(e.identity_name||`Unknown`),1),h(`span`,{class:_([`px-2 py-0.5 text-xs font-medium rounded`,e.permissions===`admin`?`bg-accent-green/20 text-accent-green`:`bg-secondary/20 text-secondary`])},t(e.permissions),3)]),h(`div`,ln,[h(`span`,un,t(e.identity_type),1),h(`button`,{onClick:t=>Jn(e.public_key_full,e.identity_hash),class:`px-2 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors`,title:`Remove client from ACL`},` Remove `,8,dn)])]),h(`div`,fn,[h(`div`,pn,[r[105]||=h(`span`,{class:`text-content-secondary dark:text-content-muted`},`Short Key:`,-1),h(`code`,mn,t(e.public_key),1)]),h(`div`,hn,[r[106]||=h(`span`,{class:`text-content-secondary dark:text-content-muted`},`Full Key:`,-1),h(`code`,gn,t(e.public_key_full),1)])]),h(`div`,_n,[h(`div`,vn,[e.address?(l(),g(`span`,yn,`📍 `+t(e.address),1)):u(``,!0),e.last_login_success?(l(),g(`span`,bn,`Last Login: `+t(new Date(e.last_login_success*1e3).toLocaleString()),1)):u(``,!0)]),e.last_activity?(l(),g(`span`,xn,`Active: `+t(Math.floor((Date.now()/1e3-e.last_activity)/60))+`m ago`,1)):u(``,!0)])])]))),128))])])])):u(``,!0)]))],64))}});export{x as default};