re(`roomServers_messagesLimit`,e));let W=m([]),G=m(!1),K=m({name:``,identity_key:``,type:`room_server`,settings:{node_name:``,latitude:0,longitude:0,admin_password:``,guest_password:``}});t(async()=>{await q()});async function q(){x.value=!0,S.value=null;try{let e=await h.getIdentities();e.success?C.value=e.data:S.value=e.error||`Failed to load identities`}catch(e){S.value=e instanceof Error?e.message:`Failed to load identities`}finally{x.value=!1}}async function vn(){try{let e=await h.createIdentity(K.value);e.success?(w.value=!1,Y(),await q(),J(e.message||`Identity created successfully!`,`success`)):J(`Failed to create identity: ${e.error}`,`error`)}catch(e){J(`Error creating identity: ${e}`,`error`)}}async function yn(){try{let e=await h.updateIdentity(E.value);e.success?(T.value=!1,E.value=null,await q(),J(e.message||`Identity updated successfully!`,`success`)):J(`Failed to update identity: ${e.error}`,`error`)}catch(e){J(`Error updating identity: ${e}`,`error`)}}function bn(e){j.value=e,A.value=!0}async function xn(){let e=j.value;A.value=!1;try{let t=await h.deleteIdentity(e);t.success?(await q(),J(t.message||`Identity deleted successfully!`,`success`)):J(`Failed to delete identity: ${t.error}`,`error`)}catch(e){J(`Error deleting identity: ${e}`,`error`)}finally{j.value=``}}function J(e,t){N.value={message:e,variant:t},M.value=!0}async function Sn(e){try{let t=await h.sendRoomServerAdvert(e);t.success?J(t.message||`Advert sent for '${e}'!`,`success`):J(`Failed to send advert: ${t.error}`,`error`)}catch(e){J(`Error sending advert: ${e}`,`error`)}}function Cn(e){E.value=JSON.parse(JSON.stringify(e)),E.value.settings||(E.value.settings={}),E.value.settings.admin_password||(E.value.settings.admin_password=``),E.value.settings.guest_password||(E.value.settings.guest_password=``),O.value=!1,T.value=!0}function Y(){K.value={name:``,identity_key:``,type:`room_server`,settings:{node_name:``,latitude:0,longitude:0,admin_password:``,guest_password:``}},D.value=!1}function X(){w.value=!1,T.value=!1,E.value=null,D.value=!1,O.value=!1,Y()}function wn(e){k.value.has(e)?k.value.delete(e):k.value.add(e)}async function Tn(e){F.value=e,P.value=!0,H.value=0,U.value=!0,I.value=C.value?.configured.find(t=>t.name===e)?.hash||``,await Z(),await Q(!0)}async function Z(){try{let e=await h.getACLClients({identity_hash:I.value,identity_name:F.value});e.success&&e.data&&(W.value=e.data.clients||[])}catch(e){console.error(`Failed to fetch ACL clients:`,e)}}async function Q(e=!1){e&&(H.value=0,L.value=[]),R.value=!0,z.value=null;try{let t=await h.getRoomMessages({room_name:F.value,limit:V.value,offset:H.value});if(t.success&&t.data){let n=t.data.messages||[];e?L.value=n:L.value=[...L.value,...n],U.value=n.length===V.value}else z.value=t.error||`Failed to load messages`}catch(e){z.value=e instanceof Error?e.message:`Failed to load messages`}finally{R.value=!1}}async function En(){H.value+=V.value,await Q(!1)}async function $(){if(B.value.trim())try{let e=await h.postRoomMessage({room_name:F.value,message:B.value,author_pubkey:`server`});e.success?(B.value=``,await Q(!0)):J(`Failed to send message: ${e.error}`,`error`)}catch(e){J(`Error sending message: ${e}`,`error`)}}async function Dn(e){if(confirm(`Are you sure you want to delete this message?`))try{let t=await h.deleteRoomMessage({room_name:F.value,message_id:e});t.success?(await Q(!0),J(`Message deleted successfully`,`success`)):J(`Failed to delete message: ${t.error}`,`error`)}catch(e){J(`Error deleting message: ${e}`,`error`)}}function On(){P.value=!1,F.value=``,I.value=``,L.value=[],B.value=``,z.value=null,W.value=[]}function kn(e){return e?new Date(e*1e3).toLocaleString():`Unknown`}async function An(e,t){if(confirm(`Are you sure you want to remove this client from the ACL?`))try{let n=await h.removeACLClient({public_key:e,identity_hash:t});n.success?(await Z(),J(`Client removed successfully`,`success`)):J(`Failed to remove client: ${n.error}`,`error`)}catch(e){J(`Error removing client: ${e}`,`error`)}}return(t,i)=>(p(),f(u,null,[d(`div`,ae,[d(`div`,oe,[i[26]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-primary/20 via-secondary/10 to-accent-purple/20 opacity-50`},null,-1),i[27]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-tl from-accent-green/10 via-transparent to-primary/10 animate-pulse`},null,-1),d(`div`,se,[i[25]||=r(`
Room Servers Manage room server identities and messages
`,1),d(`button`,{onClick:i[0]||=e=>w.value=!0,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`},[...i[24]||=[d(`span`,{class:`flex items-center gap-2`},[d(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4v16m8-8H4`})]),l(` Add Room Server `)],-1)]])])]),C.value&&C.value.total_configured>0?(p(),f(`div`,ce,[d(`div`,le,[i[30]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,ue,[d(`div`,null,[i[28]||=d(`div`,{class:`text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide`},` Total Configured `,-1),d(`div`,de,n(C.value.total_configured),1)]),i[29]||=d(`div`,{class:`bg-background-mute dark:bg-white/10 p-3 rounded-[12px] group-hover:bg-background-mute dark:group-hover:bg-stroke/20 transition-colors`},[d(`svg`,{class:`w-6 h-6 text-content-secondary dark:text-content-primary/70`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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)])]),d(`div`,fe,[i[33]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-primary/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,pe,[d(`div`,null,[i[31]||=d(`div`,{class:`text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide`},` Currently Registered `,-1),d(`div`,me,n(C.value.total_registered),1)]),i[32]||=d(`div`,{class:`bg-primary/20 p-3 rounded-[12px] group-hover:bg-primary/30 transition-colors`},[d(`svg`,{class:`w-6 h-6 text-primary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 13l4 4L19 7`})])],-1)])]),d(`div`,he,[i[37]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-accent-green/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,ge,[d(`div`,null,[i[34]||=d(`div`,{class:`text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide`},` Status `,-1),d(`div`,{class:s([`text-3xl font-bold`,C.value.total_registered===C.value.total_configured?`text-accent-green`:`text-accent-yellow`])},n(C.value.total_registered===C.value.total_configured?`Synced`:`Out of Sync`),3)]),d(`div`,{class:s([`p-3 rounded-[12px] transition-colors`,C.value.total_registered===C.value.total_configured?`bg-accent-green/20 group-hover:bg-accent-green/30`:`bg-accent-yellow/20 group-hover:bg-accent-yellow/30`])},[C.value.total_registered===C.value.total_configured?(p(),f(`svg`,_e,[...i[35]||=[d(`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)]])):(p(),f(`svg`,ve,[...i[36]||=[d(`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)])])])):o(``,!0),d(`div`,ye,[x.value?(p(),f(`div`,be,[...i[38]||=[d(`div`,{class:`text-center`},[d(`div`,{class:`animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4`}),d(`div`,{class:`text-content-secondary dark:text-content-primary/70`},` Loading room servers... `)],-1)]])):S.value?(p(),f(`div`,xe,[d(`div`,Se,[i[39]||=d(`div`,{class:`text-red-600 dark:text-red-400 mb-2`},`Failed to load room servers`,-1),d(`div`,Ce,n(S.value),1),d(`button`,{onClick:q,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors`},` Retry `)])])):C.value&&C.value.configured.length>0?(p(),f(`div`,we,[(p(!0),f(u,null,e(C.value.configured,e=>(p(),f(`div`,{key:e.name,class:`group relative overflow-hidden glass-card backdrop-blur-xl rounded-[15px] p-5 border border-stroke-subtle dark:border-white/10 hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300`},[i[46]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-r from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,Te,[d(`div`,Ee,[d(`div`,De,[d(`div`,Oe,[e.registered?(p(),f(`div`,ke)):o(``,!0),d(`div`,{class:s([`relative w-3 h-3 rounded-full`,e.registered?`bg-accent-green`:`bg-accent-red`])},null,2)]),d(`h3`,Ae,n(e.name),1),d(`span`,{class:s([`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`])},n(e.registered?`● Active`:`○ Inactive`),3),e.hash?(p(),f(`span`,je,n(e.hash),1)):o(``,!0)]),d(`div`,Me,[d(`div`,null,[i[40]||=d(`span`,{class:`text-content-muted dark:text-content-muted`},`Node Name:`,-1),d(`span`,Ne,n(e.settings?.node_name||`Not set`),1)]),d(`div`,Pe,[i[41]||=d(`span`,{class:`text-content-muted dark:text-content-muted`},`Identity Key:`,-1),k.value.has(e.name)?(p(),f(`span`,y,n(e.identity_key),1)):(p(),f(`span`,Fe,` •••••••••••••••• `)),d(`button`,{onClick:t=>wn(e.name),class:`text-primary/70 hover:text-primary text-xs underline`},n(k.value.has(e.name)?`Hide`:`Show`),9,Ie)]),d(`div`,null,[i[42]||=d(`span`,{class:`text-content-muted dark:text-content-muted`},`Location:`,-1),d(`span`,Le,n(e.settings?.latitude||0)+`, `+n(e.settings?.longitude||0),1)]),e.settings?.admin_password||e.settings?.guest_password?(p(),f(`div`,Re,[i[43]||=d(`span`,{class:`text-content-muted dark:text-content-muted`},`Passwords:`,-1),d(`span`,ze,[e.settings?.admin_password?(p(),f(`span`,Be,`Admin`)):o(``,!0),e.settings?.admin_password&&e.settings?.guest_password?(p(),f(`span`,Ve,` / `)):o(``,!0),e.settings?.guest_password?(p(),f(`span`,He,`Guest`)):o(``,!0)])])):o(``,!0)]),e.address?(p(),f(`div`,Ue,` Address: `+n(e.address),1)):o(``,!0)]),d(`div`,We,[d(`button`,{onClick:t=>Tn(e.name),disabled:!e.registered,class:s([`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`},[...i[44]||=[d(`svg`,{class:`w-4 h-4 group-hover:rotate-12 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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),l(` Messages `,-1)]],10,Ge),d(`button`,{onClick:t=>Sn(e.name),disabled:!e.registered,class:s([`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`},[...i[45]||=[d(`svg`,{class:`w-4 h-4 group-hover:scale-110 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 10V3L4 14h7v7l9-11h-7z`})],-1),l(` Send Advert `,-1)]],10,Ke),d(`button`,{onClick:t=>Cn(e),class:`px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors`},` Edit `,8,qe),d(`button`,{onClick:t=>bn(e.name),class:`px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors`},` Delete `,8,Je)])])]))),128))])):(p(),f(`div`,Ye,[i[47]||=d(`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`},[d(`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),i[48]||=d(`p`,{class:`text-lg mb-2`},`No room servers configured`,-1),i[49]||=d(`p`,{class:`text-sm mb-4`},`Add your first room server to get started`,-1),d(`button`,{onClick:i[1]||=e=>w.value=!0,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors`},` + Add Room Server `)]))]),w.value?(p(),f(`div`,Xe,[d(`div`,Ze,[i[60]||=d(`h2`,{class:`text-xl font-bold text-content-primary dark:text-content-primary mb-4`},` Add Room Server `,-1),d(`div`,Qe,[d(`div`,null,[i[50]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Name *`,-1),a(d(`input`,{"onUpdate:modelValue":i[2]||=e=>K.value.name=e,type:`text`,placeholder:`e.g., MainBBS`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.name]])]),d(`div`,null,[d(`label`,$e,[i[51]||=l(` Identity Key (Optional) `,-1),d(`button`,{onClick:i[3]||=e=>D.value=!D.value,type:`button`,class:`ml-2 text-primary/70 hover:text-primary text-xs underline`},n(D.value?`Hide`:`Show/Edit`),1)]),D.value?(p(),f(`div`,et,[a(d(`input`,{"onUpdate:modelValue":i[4]||=e=>K.value.identity_key=e,type:`text`,placeholder:`Leave empty to auto-generate`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.identity_key]]),i[52]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Leave empty to automatically generate a secure key `,-1)])):(p(),f(`div`,tt,` Will be auto-generated if not provided `))]),d(`div`,null,[i[53]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Node Name`,-1),a(d(`input`,{"onUpdate:modelValue":i[5]||=e=>K.value.settings.node_name=e,type:`text`,placeholder:`Display name for the room server`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.node_name]])]),d(`div`,nt,[d(`div`,null,[i[54]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Latitude`,-1),a(d(`input`,{"onUpdate:modelValue":i[6]||=e=>K.value.settings.latitude=e,type:`number`,step:`0.000001`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.latitude,void 0,{number:!0}]])]),d(`div`,null,[i[55]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Longitude`,-1),a(d(`input`,{"onUpdate:modelValue":i[7]||=e=>K.value.settings.longitude=e,type:`number`,step:`0.000001`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.longitude,void 0,{number:!0}]])])]),d(`div`,rt,[d(`div`,null,[i[56]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Admin Password (Optional)`,-1),a(d(`input`,{"onUpdate:modelValue":i[8]||=e=>K.value.settings.admin_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.admin_password]]),i[57]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Full access to room server `,-1)]),d(`div`,null,[i[58]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Guest Password (Optional)`,-1),a(d(`input`,{"onUpdate:modelValue":i[9]||=e=>K.value.settings.guest_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.guest_password]]),i[59]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Read-only access `,-1)])])]),d(`div`,{class:`flex justify-end gap-3 mt-6`},[d(`button`,{onClick:X,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors`},` Cancel `),d(`button`,{onClick:vn,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors`},` Create `)])])])):o(``,!0),T.value&&E.value?(p(),f(`div`,it,[d(`div`,at,[i[72]||=d(`h2`,{class:`text-xl font-bold text-content-primary dark:text-content-primary mb-4`},` Edit Room Server `,-1),d(`div`,ot,[d(`div`,null,[i[61]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Current Name`,-1),d(`input`,{value:E.value.name,disabled:``,type:`text`,class:`w-full bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-muted dark:text-content-muted cursor-not-allowed`},null,8,st)]),d(`div`,null,[i[62]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`New Name (optional)`,-1),a(d(`input`,{"onUpdate:modelValue":i[10]||=e=>E.value.new_name=e,type:`text`,placeholder:`Leave empty to keep current name`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.new_name]])]),d(`div`,null,[d(`label`,ct,[i[63]||=l(` Identity Key (Optional) `,-1),d(`button`,{onClick:i[11]||=e=>O.value=!O.value,type:`button`,class:`ml-2 text-primary/70 hover:text-primary text-xs underline`},n(O.value?`Hide`:`Show/Edit`),1)]),O.value?(p(),f(`div`,lt,[a(d(`input`,{"onUpdate:modelValue":i[12]||=e=>E.value.identity_key=e,type:`text`,placeholder:`Leave empty to keep current key`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.identity_key]]),i[64]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Leave empty to keep the current identity key `,-1)])):(p(),f(`div`,ut,` Click "Show/Edit" to change the identity key `))]),d(`div`,null,[i[65]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Node Name`,-1),a(d(`input`,{"onUpdate:modelValue":i[13]||=e=>E.value.settings.node_name=e,type:`text`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.node_name]])]),d(`div`,dt,[d(`div`,null,[i[66]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Latitude`,-1),a(d(`input`,{"onUpdate:modelValue":i[14]||=e=>E.value.settings.latitude=e,type:`number`,step:`0.000001`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.latitude,void 0,{number:!0}]])]),d(`div`,null,[i[67]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Longitude`,-1),a(d(`input`,{"onUpdate:modelValue":i[15]||=e=>E.value.settings.longitude=e,type:`number`,step:`0.000001`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.longitude,void 0,{number:!0}]])])]),d(`div`,ft,[d(`div`,null,[i[68]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Admin Password`,-1),a(d(`input`,{"onUpdate:modelValue":i[16]||=e=>E.value.settings.admin_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.admin_password]]),i[69]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Full access to room server `,-1)]),d(`div`,null,[i[70]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Guest Password`,-1),a(d(`input`,{"onUpdate:modelValue":i[17]||=e=>E.value.settings.guest_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.guest_password]]),i[71]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Read-only access `,-1)])])]),d(`div`,{class:`flex justify-end gap-3 mt-6`},[d(`button`,{onClick:X,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors`},` Cancel `),d(`button`,{onClick:yn,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors`},` Update `)])])])):o(``,!0)]),c(te,{show:A.value,title:`Delete Room Server`,message:`Are you sure you want to delete '${j.value}'? This action cannot be undone.`,"confirm-text":`Delete`,"cancel-text":`Cancel`,variant:`danger`,onClose:i[18]||=e=>A.value=!1,onConfirm:xn},null,8,[`show`,`message`]),c(ne,{show:M.value,message:N.value.message,variant:N.value.variant,onClose:i[19]||=e=>M.value=!1},null,8,[`show`,`message`,`variant`]),P.value?(p(),f(`div`,pt,[d(`div`,mt,[d(`div`,ht,[i[79]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-r from-secondary/20 via-primary/20 to-accent-purple/20`},null,-1),i[80]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-transparent via-white/5 to-transparent`},null,-1),d(`div`,gt,[d(`div`,_t,[i[75]||=r(`
`,1),d(`div`,null,[i[74]||=d(`h2`,{class:`text-2xl font-bold text-content-primary dark:text-content-primary mb-1`},` Room Messages `,-1),d(`p`,vt,[i[73]||=d(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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),d(`span`,yt,n(F.value),1)])])]),d(`div`,bt,[d(`button`,{onClick:i[20]||=e=>G.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`},[i[76]||=d(`svg`,{class:`w-4 h-4 group-hover:scale-110 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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),i[77]||=d(`span`,{class:`hidden sm:inline`},`Sessions`,-1),d(`span`,xt,n(W.value.length),1)]),d(`button`,{onClick:On,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`},[...i[78]||=[d(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])])])]),d(`div`,St,[R.value&&L.value.length===0?(p(),f(`div`,Ct,[...i[81]||=[d(`div`,{class:`text-center`},[d(`div`,{class:`animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4`}),d(`div`,{class:`text-content-secondary dark:text-content-primary/70`},` Loading messages... `)],-1)]])):z.value?(p(),f(`div`,wt,[d(`div`,Tt,[i[82]||=d(`div`,{class:`text-red-600 dark:text-red-400 mb-2`},`Failed to load messages`,-1),d(`div`,Et,n(z.value),1),d(`button`,{onClick:i[21]||=e=>Q(!0),class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors`},` Retry `)])])):L.value.length>0?(p(),f(`div`,Dt,[(p(!0),f(u,null,e(L.value,(e,t)=>(p(),f(`div`,{key:e.id||t,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`},[i[87]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-r from-secondary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,Ot,[d(`div`,kt,[d(`div`,At,[d(`div`,jt,[i[84]||=d(`div`,{class:`w-6 h-6 rounded-full bg-gradient-to-br from-primary/30 to-secondary/30 flex items-center justify-center`},[d(`svg`,{class:`w-3 h-3 text-content-secondary dark:text-content-primary/70`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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?(p(),f(`span`,Mt,n(e.author_name),1)):o(``,!0),e.author_pubkey?(p(),f(`span`,Nt,n(e.author_pubkey.substring(0,8))+`... `,1)):(p(),f(`span`,Pt,` Anonymous `)),i[85]||=d(`span`,{class:`text-content-muted dark:text-content-muted/60 text-xs`},`•`,-1),d(`span`,Ft,[i[83]||=d(`svg`,{class:`w-3 h-3`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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),l(` `+n(kn(e.timestamp)),1)]),e.id?(p(),f(`span`,It,` #`+n(e.id),1)):o(``,!0)])]),d(`div`,Lt,n(e.message_text),1)]),d(`button`,{onClick:t=>Dn(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`},[...i[86]||=[d(`svg`,{class:`w-4 h-4 group-hover/delete:rotate-12 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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,Rt)])]))),128)),U.value&&!R.value?(p(),f(`div`,zt,[d(`button`,{onClick:En,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`},[...i[88]||=[d(`svg`,{class:`w-4 h-4 group-hover:translate-y-1 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 9l-7 7-7-7`})],-1),l(` Load More Messages `,-1)]])])):R.value?(p(),f(`div`,Bt,[...i[89]||=[d(`div`,{class:`flex items-center justify-center gap-2 text-content-secondary dark:text-content-muted text-sm`},[d(`div`,{class:`animate-spin w-4 h-4 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full`}),l(` Loading... `)],-1)]])):o(``,!0)])):(p(),f(`div`,Vt,[...i[90]||=[r(`
No messages yet
Be the first to start the conversation
`,1)]]))]),d(`div`,Ht,[i[93]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-t from-primary/5 to-transparent pointer-events-none`},null,-1),d(`div`,Ut,[d(`div`,Wt,[d(`div`,Gt,[a(d(`textarea`,{"onUpdate:modelValue":i[22]||=e=>B.value=e,onKeydown:[v(_($,[`ctrl`]),[`enter`]),v(_($,[`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,Kt),[[g,B.value]])]),d(`button`,{onClick:$,disabled:!B.value.trim(),class:s([`group px-6 py-3 rounded-[12px] transition-all duration-200 flex items-center justify-center gap-2 font-medium`,B.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`])},[...i[91]||=[d(`svg`,{class:`w-5 h-5 group-hover:translate-x-1 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 19l9 2-9-18-9 18 9-2zm0 0v-8`})],-1),d(`span`,{class:`hidden sm:inline`},`Send`,-1)]],10,qt)]),i[92]||=d(`p`,{class:`text-content-secondary dark:text-content-muted/60 text-xs flex items-center gap-2`},[d(`svg`,{class:`w-3 h-3`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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`})]),l(` Press Ctrl+Enter to send message quickly `)],-1)])])])])):o(``,!0),G.value?(p(),f(`div`,Jt,[d(`div`,Yt,[d(`div`,Xt,[d(`div`,null,[i[95]||=d(`h2`,{class:`text-xl font-bold text-content-primary dark:text-content-primary`},` Active Sessions `,-1),d(`p`,Zt,[i[94]||=l(` Room: `,-1),d(`span`,Qt,n(F.value),1)])]),d(`button`,{onClick:i[23]||=e=>G.value=!1,class:`text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary transition-colors`},[...i[96]||=[d(`svg`,{class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),d(`div`,b,[W.value.length===0?(p(),f(`div`,$t,[...i[97]||=[d(`div`,{class:`text-content-secondary dark:text-content-muted`},`No active sessions found`,-1)]])):o(``,!0),(p(!0),f(u,null,e(W.value,(e,t)=>(p(),f(`div`,{key:e.public_key_full||t,class:`glass-card backdrop-blur-xl rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10`},[d(`div`,en,[d(`div`,tn,[d(`div`,nn,[d(`span`,rn,n(e.identity_name||`Unknown`),1),d(`span`,{class:s([`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`])},n(e.permissions),3)]),d(`div`,an,[d(`span`,on,n(e.identity_type),1),d(`button`,{onClick:t=>An(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,sn)])]),d(`div`,cn,[d(`div`,ln,[i[98]||=d(`span`,{class:`text-content-secondary dark:text-content-muted`},`Short Key:`,-1),d(`code`,un,n(e.public_key),1)]),d(`div`,dn,[i[99]||=d(`span`,{class:`text-content-secondary dark:text-content-muted`},`Full Key:`,-1),d(`code`,fn,n(e.public_key_full),1)])]),d(`div`,pn,[d(`div`,mn,[e.address?(p(),f(`span`,hn,`📍 `+n(e.address),1)):o(``,!0),e.last_login_success?(p(),f(`span`,gn,`Last Login: `+n(new Date(e.last_login_success*1e3).toLocaleString()),1)):o(``,!0)]),e.last_activity?(p(),f(`span`,_n,`Active: `+n(Math.floor((Date.now()/1e3-e.last_activity)/60))+`m ago`,1)):o(``,!0)])])]))),128))])])])):o(``,!0)],64))}});export{x as default};
\ No newline at end of file
+import{E as e,S as t,dt as n,f as r,g as i,j as a,k as ee,l as o,lt as s,m as c,p as l,r as u,s as d,u as f,w as p,z as m}from"./runtime-core.esm-bundler-IofF4kUm.js";import{t as h}from"./api-CiSov_eM.js";import{d as g,m as _,p as v}from"./index-BPH8UrxU.js";import{t as te}from"./ConfirmDialog-BafURQpE.js";import{t as ne}from"./MessageDialog-D2OlpbZ7.js";import{n as re,t as ie}from"./preferences-N3Pls1rF.js";var ae={class:`p-6 space-y-6`},oe={class:`relative overflow-hidden rounded-[20px] p-6 mb-6 glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10`},se={class:`relative flex items-center justify-between`},ce={key:0,class:`grid grid-cols-1 md:grid-cols-3 gap-4`},le={class:`group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer`},ue={class:`relative flex items-center justify-between`},de={class:`text-3xl font-bold text-content-primary dark:text-content-primary mb-1`},fe={class:`group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer`},pe={class:`relative flex items-center justify-between`},me={class:`text-3xl font-bold text-primary mb-1`},he={class:`group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer`},ge={class:`relative flex items-center justify-between`},_e={key:0,class:`w-6 h-6 text-accent-green`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},ve={key:1,class:`w-6 h-6 text-accent-yellow`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},ye={class:`glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6`},be={key:0,class:`flex items-center justify-center py-12`},xe={key:1,class:`flex items-center justify-center py-12`},Se={class:`text-center`},Ce={class:`text-content-secondary dark:text-content-muted text-sm mb-4`},we={key:2,class:`space-y-4`},Te={class:`relative flex items-start justify-between`},Ee={class:`flex-1`},De={class:`flex items-center gap-3 mb-4`},Oe={class:`relative`},ke={key:0,class:`absolute inset-0 bg-accent-green/50 rounded-full animate-ping`},Ae={class:`text-xl font-bold text-content-primary dark:text-content-primary group-hover:text-primary transition-colors`},je={key:0,class:`text-content-muted dark:text-content-muted text-sm`},Me={class:`grid grid-cols-1 md:grid-cols-2 gap-3 text-sm mb-3`},Ne={class:`text-content-primary dark:text-content-primary/90 ml-2`},Pe={class:`flex items-center gap-2`},y={key:0,class:`text-content-primary dark:text-content-primary/90 font-mono ml-2 text-xs`},Fe={key:1,class:`text-content-muted dark:text-content-muted ml-2 text-xs`},Ie=[`onClick`],Le={class:`text-content-primary dark:text-content-primary/90 ml-2`},Re={key:0},ze={class:`text-content-primary dark:text-content-primary/90 ml-2`},Be={key:0,class:`text-accent-green`},Ve={key:1,class:`text-content-muted dark:text-content-muted`},He={key:2,class:`text-primary`},Ue={key:0,class:`text-xs text-content-muted dark:text-content-muted font-mono`},We={class:`ml-4 flex flex-wrap gap-2`},Ge=[`onClick`,`disabled`,`title`],Ke=[`onClick`,`disabled`,`title`],qe=[`onClick`],Je=[`onClick`],Ye={key:3,class:`text-center py-12 text-content-secondary dark:text-content-muted`},Xe={key:1,class:`fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4`},Ze={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto`},Qe={class:`space-y-4`},$e={class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},et={key:0},tt={key:1,class:`text-content-secondary dark:text-content-muted text-sm`},nt={class:`grid grid-cols-2 gap-4`},rt={class:`grid grid-cols-2 gap-4`},it={key:2,class:`fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4`},at={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto`},ot={class:`space-y-4`},st=[`value`],ct={class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},lt={key:0},ut={key:1,class:`text-content-secondary dark:text-content-muted text-sm`},dt={class:`grid grid-cols-2 gap-4`},ft={class:`grid grid-cols-2 gap-4`},pt={key:0,class:`fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-50 p-4`},mt={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`},ht={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`},gt={class:`relative flex items-center justify-between`},_t={class:`flex items-center gap-4`},vt={class:`text-content-secondary dark:text-content-muted text-sm flex items-center gap-2`},yt={class:`text-primary font-semibold`},bt={class:`flex items-center gap-2`},xt={class:`bg-primary/30 px-1.5 py-0.5 rounded-full text-[10px]`},St={class:`flex-1 overflow-y-auto mb-4 space-y-3`},Ct={key:0,class:`flex items-center justify-center py-12`},wt={key:1,class:`flex items-center justify-center py-12`},Tt={class:`text-center`},Et={class:`text-content-secondary dark:text-content-muted text-sm mb-4`},Dt={key:2,class:`space-y-3`},Ot={class:`relative flex items-start justify-between gap-3`},kt={class:`flex-1 min-w-0`},At={class:`flex items-center gap-2 mb-3`},jt={class:`flex items-center gap-2 flex-wrap`},Mt={key:0,class:`text-primary text-sm font-bold`},Nt={key:1,class:`text-primary/80 text-xs font-mono bg-primary/10 px-2 py-1 rounded-md border border-primary/20`},Pt={key:2,class:`text-content-muted dark:text-content-muted text-xs`},Ft={class:`text-content-secondary dark:text-content-muted text-xs flex items-center gap-1`},It={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`},Lt={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`},Rt=[`onClick`],zt={key:0,class:`text-center pt-4`},Bt={key:1,class:`text-center pt-4`},Vt={key:3,class:`flex items-center justify-center h-full`},Ht={class:`relative overflow-hidden rounded-[15px] border-t border-stroke-subtle dark:border-white/20 pt-4 mt-4`},Ut={class:`relative space-y-3`},Wt={class:`flex gap-3`},Gt={class:`flex-1 relative`},Kt=[`onKeydown`],qt=[`disabled`],Jt={key:1,class:`fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-[60] p-4`},Yt={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`},Xt={class:`flex items-center justify-between mb-4 pb-4 border-b border-stroke-subtle dark:border-white/10`},Zt={class:`text-content-secondary dark:text-content-primary/70 text-sm mt-1`},Qt={class:`text-primary`},b={class:`flex-1 overflow-y-auto space-y-3`},$t={key:0,class:`text-center py-12`},en={class:`space-y-2`},tn={class:`flex items-center justify-between`},nn={class:`flex items-center gap-2`},rn={class:`text-content-primary dark:text-content-primary font-semibold`},an={class:`flex items-center gap-2`},on={class:`text-content-secondary dark:text-content-muted text-xs`},sn=[`onClick`],cn={class:`space-y-1 text-xs`},ln={class:`flex items-center gap-2`},un={class:`text-primary font-mono bg-primary/10 px-2 py-0.5 rounded`},dn={class:`flex items-center gap-2`},fn={class:`text-primary font-mono bg-primary/10 px-2 py-0.5 rounded text-[10px] break-all`},pn={class:`flex items-center justify-between text-xs text-content-secondary dark:text-content-muted`},mn={class:`flex items-center gap-4`},hn={key:0},gn={key:1},_n={key:0},x=i({name:`RoomServersView`,__name:`RoomServers`,setup(i){let x=m(!1),S=m(null),C=m(null),w=m(!1),T=m(!1),E=m(null),D=m(!1),O=m(!1),k=m(new Set),A=m(!1),j=m(``),M=m(!1),N=m({message:``,variant:`success`}),P=m(!1),F=m(``),I=m(``),L=m([]),R=m(!1),z=m(null),B=m(``),V=m(ie(`roomServers_messagesLimit`,50)),H=m(0),U=m(!0);ee(V,e=>re(`roomServers_messagesLimit`,e));let W=m([]),G=m(!1),K=m({name:``,identity_key:``,type:`room_server`,settings:{node_name:``,latitude:0,longitude:0,admin_password:``,guest_password:``}});t(async()=>{await q()});async function q(){x.value=!0,S.value=null;try{let e=await h.getIdentities();e.success?C.value=e.data:S.value=e.error||`Failed to load identities`}catch(e){S.value=e instanceof Error?e.message:`Failed to load identities`}finally{x.value=!1}}async function vn(){try{let e=await h.createIdentity(K.value);e.success?(w.value=!1,Y(),await q(),J(e.message||`Identity created successfully!`,`success`)):J(`Failed to create identity: ${e.error}`,`error`)}catch(e){J(`Error creating identity: ${e}`,`error`)}}async function yn(){try{let e=await h.updateIdentity(E.value);e.success?(T.value=!1,E.value=null,await q(),J(e.message||`Identity updated successfully!`,`success`)):J(`Failed to update identity: ${e.error}`,`error`)}catch(e){J(`Error updating identity: ${e}`,`error`)}}function bn(e){j.value=e,A.value=!0}async function xn(){let e=j.value;A.value=!1;try{let t=await h.deleteIdentity(e);t.success?(await q(),J(t.message||`Identity deleted successfully!`,`success`)):J(`Failed to delete identity: ${t.error}`,`error`)}catch(e){J(`Error deleting identity: ${e}`,`error`)}finally{j.value=``}}function J(e,t){N.value={message:e,variant:t},M.value=!0}async function Sn(e){try{let t=await h.sendRoomServerAdvert(e);t.success?J(t.message||`Advert sent for '${e}'!`,`success`):J(`Failed to send advert: ${t.error}`,`error`)}catch(e){J(`Error sending advert: ${e}`,`error`)}}function Cn(e){E.value=JSON.parse(JSON.stringify(e)),E.value.settings||(E.value.settings={}),E.value.settings.admin_password||(E.value.settings.admin_password=``),E.value.settings.guest_password||(E.value.settings.guest_password=``),O.value=!1,T.value=!0}function Y(){K.value={name:``,identity_key:``,type:`room_server`,settings:{node_name:``,latitude:0,longitude:0,admin_password:``,guest_password:``}},D.value=!1}function X(){w.value=!1,T.value=!1,E.value=null,D.value=!1,O.value=!1,Y()}function wn(e){k.value.has(e)?k.value.delete(e):k.value.add(e)}async function Tn(e){F.value=e,P.value=!0,H.value=0,U.value=!0,I.value=C.value?.configured.find(t=>t.name===e)?.hash||``,await Z(),await Q(!0)}async function Z(){try{let e=await h.getACLClients({identity_hash:I.value,identity_name:F.value});e.success&&e.data&&(W.value=e.data.clients||[])}catch(e){console.error(`Failed to fetch ACL clients:`,e)}}async function Q(e=!1){e&&(H.value=0,L.value=[]),R.value=!0,z.value=null;try{let t=await h.getRoomMessages({room_name:F.value,limit:V.value,offset:H.value});if(t.success&&t.data){let n=t.data.messages||[];e?L.value=n:L.value=[...L.value,...n],U.value=n.length===V.value}else z.value=t.error||`Failed to load messages`}catch(e){z.value=e instanceof Error?e.message:`Failed to load messages`}finally{R.value=!1}}async function En(){H.value+=V.value,await Q(!1)}async function $(){if(B.value.trim())try{let e=await h.postRoomMessage({room_name:F.value,message:B.value,author_pubkey:`server`});e.success?(B.value=``,await Q(!0)):J(`Failed to send message: ${e.error}`,`error`)}catch(e){J(`Error sending message: ${e}`,`error`)}}async function Dn(e){if(confirm(`Are you sure you want to delete this message?`))try{let t=await h.deleteRoomMessage({room_name:F.value,message_id:e});t.success?(await Q(!0),J(`Message deleted successfully`,`success`)):J(`Failed to delete message: ${t.error}`,`error`)}catch(e){J(`Error deleting message: ${e}`,`error`)}}function On(){P.value=!1,F.value=``,I.value=``,L.value=[],B.value=``,z.value=null,W.value=[]}function kn(e){return e?new Date(e*1e3).toLocaleString():`Unknown`}async function An(e,t){if(confirm(`Are you sure you want to remove this client from the ACL?`))try{let n=await h.removeACLClient({public_key:e,identity_hash:t});n.success?(await Z(),J(`Client removed successfully`,`success`)):J(`Failed to remove client: ${n.error}`,`error`)}catch(e){J(`Error removing client: ${e}`,`error`)}}return(t,i)=>(p(),f(u,null,[d(`div`,ae,[d(`div`,oe,[i[26]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-primary/20 via-secondary/10 to-accent-purple/20 opacity-50`},null,-1),i[27]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-tl from-accent-green/10 via-transparent to-primary/10 animate-pulse`},null,-1),d(`div`,se,[i[25]||=r(`
Room Servers Manage room server identities and messages
`,1),d(`button`,{onClick:i[0]||=e=>w.value=!0,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`},[...i[24]||=[d(`span`,{class:`flex items-center gap-2`},[d(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4v16m8-8H4`})]),l(` Add Room Server `)],-1)]])])]),C.value&&C.value.total_configured>0?(p(),f(`div`,ce,[d(`div`,le,[i[30]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,ue,[d(`div`,null,[i[28]||=d(`div`,{class:`text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide`},` Total Configured `,-1),d(`div`,de,n(C.value.total_configured),1)]),i[29]||=d(`div`,{class:`bg-background-mute dark:bg-white/10 p-3 rounded-[12px] group-hover:bg-background-mute dark:group-hover:bg-stroke/20 transition-colors`},[d(`svg`,{class:`w-6 h-6 text-content-secondary dark:text-content-primary/70`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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)])]),d(`div`,fe,[i[33]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-primary/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,pe,[d(`div`,null,[i[31]||=d(`div`,{class:`text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide`},` Currently Registered `,-1),d(`div`,me,n(C.value.total_registered),1)]),i[32]||=d(`div`,{class:`bg-primary/20 p-3 rounded-[12px] group-hover:bg-primary/30 transition-colors`},[d(`svg`,{class:`w-6 h-6 text-primary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 13l4 4L19 7`})])],-1)])]),d(`div`,he,[i[37]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-accent-green/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,ge,[d(`div`,null,[i[34]||=d(`div`,{class:`text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide`},` Status `,-1),d(`div`,{class:s([`text-3xl font-bold`,C.value.total_registered===C.value.total_configured?`text-accent-green`:`text-accent-yellow`])},n(C.value.total_registered===C.value.total_configured?`Synced`:`Out of Sync`),3)]),d(`div`,{class:s([`p-3 rounded-[12px] transition-colors`,C.value.total_registered===C.value.total_configured?`bg-accent-green/20 group-hover:bg-accent-green/30`:`bg-accent-yellow/20 group-hover:bg-accent-yellow/30`])},[C.value.total_registered===C.value.total_configured?(p(),f(`svg`,_e,[...i[35]||=[d(`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)]])):(p(),f(`svg`,ve,[...i[36]||=[d(`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)])])])):o(``,!0),d(`div`,ye,[x.value?(p(),f(`div`,be,[...i[38]||=[d(`div`,{class:`text-center`},[d(`div`,{class:`animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4`}),d(`div`,{class:`text-content-secondary dark:text-content-primary/70`},` Loading room servers... `)],-1)]])):S.value?(p(),f(`div`,xe,[d(`div`,Se,[i[39]||=d(`div`,{class:`text-red-600 dark:text-red-400 mb-2`},`Failed to load room servers`,-1),d(`div`,Ce,n(S.value),1),d(`button`,{onClick:q,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors`},` Retry `)])])):C.value&&C.value.configured.length>0?(p(),f(`div`,we,[(p(!0),f(u,null,e(C.value.configured,e=>(p(),f(`div`,{key:e.name,class:`group relative overflow-hidden glass-card backdrop-blur-xl rounded-[15px] p-5 border border-stroke-subtle dark:border-white/10 hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300`},[i[46]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-r from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,Te,[d(`div`,Ee,[d(`div`,De,[d(`div`,Oe,[e.registered?(p(),f(`div`,ke)):o(``,!0),d(`div`,{class:s([`relative w-3 h-3 rounded-full`,e.registered?`bg-accent-green`:`bg-accent-red`])},null,2)]),d(`h3`,Ae,n(e.name),1),d(`span`,{class:s([`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`])},n(e.registered?`● Active`:`○ Inactive`),3),e.hash?(p(),f(`span`,je,n(e.hash),1)):o(``,!0)]),d(`div`,Me,[d(`div`,null,[i[40]||=d(`span`,{class:`text-content-muted dark:text-content-muted`},`Node Name:`,-1),d(`span`,Ne,n(e.settings?.node_name||`Not set`),1)]),d(`div`,Pe,[i[41]||=d(`span`,{class:`text-content-muted dark:text-content-muted`},`Identity Key:`,-1),k.value.has(e.name)?(p(),f(`span`,y,n(e.identity_key),1)):(p(),f(`span`,Fe,` •••••••••••••••• `)),d(`button`,{onClick:t=>wn(e.name),class:`text-primary/70 hover:text-primary text-xs underline`},n(k.value.has(e.name)?`Hide`:`Show`),9,Ie)]),d(`div`,null,[i[42]||=d(`span`,{class:`text-content-muted dark:text-content-muted`},`Location:`,-1),d(`span`,Le,n(e.settings?.latitude||0)+`, `+n(e.settings?.longitude||0),1)]),e.settings?.admin_password||e.settings?.guest_password?(p(),f(`div`,Re,[i[43]||=d(`span`,{class:`text-content-muted dark:text-content-muted`},`Passwords:`,-1),d(`span`,ze,[e.settings?.admin_password?(p(),f(`span`,Be,`Admin`)):o(``,!0),e.settings?.admin_password&&e.settings?.guest_password?(p(),f(`span`,Ve,` / `)):o(``,!0),e.settings?.guest_password?(p(),f(`span`,He,`Guest`)):o(``,!0)])])):o(``,!0)]),e.address?(p(),f(`div`,Ue,` Address: `+n(e.address),1)):o(``,!0)]),d(`div`,We,[d(`button`,{onClick:t=>Tn(e.name),disabled:!e.registered,class:s([`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`},[...i[44]||=[d(`svg`,{class:`w-4 h-4 group-hover:rotate-12 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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),l(` Messages `,-1)]],10,Ge),d(`button`,{onClick:t=>Sn(e.name),disabled:!e.registered,class:s([`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`},[...i[45]||=[d(`svg`,{class:`w-4 h-4 group-hover:scale-110 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 10V3L4 14h7v7l9-11h-7z`})],-1),l(` Send Advert `,-1)]],10,Ke),d(`button`,{onClick:t=>Cn(e),class:`px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors`},` Edit `,8,qe),d(`button`,{onClick:t=>bn(e.name),class:`px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors`},` Delete `,8,Je)])])]))),128))])):(p(),f(`div`,Ye,[i[47]||=d(`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`},[d(`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),i[48]||=d(`p`,{class:`text-lg mb-2`},`No room servers configured`,-1),i[49]||=d(`p`,{class:`text-sm mb-4`},`Add your first room server to get started`,-1),d(`button`,{onClick:i[1]||=e=>w.value=!0,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors`},` + Add Room Server `)]))]),w.value?(p(),f(`div`,Xe,[d(`div`,Ze,[i[60]||=d(`h2`,{class:`text-xl font-bold text-content-primary dark:text-content-primary mb-4`},` Add Room Server `,-1),d(`div`,Qe,[d(`div`,null,[i[50]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Name *`,-1),a(d(`input`,{"onUpdate:modelValue":i[2]||=e=>K.value.name=e,type:`text`,placeholder:`e.g., MainBBS`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.name]])]),d(`div`,null,[d(`label`,$e,[i[51]||=l(` Identity Key (Optional) `,-1),d(`button`,{onClick:i[3]||=e=>D.value=!D.value,type:`button`,class:`ml-2 text-primary/70 hover:text-primary text-xs underline`},n(D.value?`Hide`:`Show/Edit`),1)]),D.value?(p(),f(`div`,et,[a(d(`input`,{"onUpdate:modelValue":i[4]||=e=>K.value.identity_key=e,type:`text`,placeholder:`Leave empty to auto-generate`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.identity_key]]),i[52]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Leave empty to automatically generate a secure key `,-1)])):(p(),f(`div`,tt,` Will be auto-generated if not provided `))]),d(`div`,null,[i[53]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Node Name`,-1),a(d(`input`,{"onUpdate:modelValue":i[5]||=e=>K.value.settings.node_name=e,type:`text`,placeholder:`Display name for the room server`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.node_name]])]),d(`div`,nt,[d(`div`,null,[i[54]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Latitude`,-1),a(d(`input`,{"onUpdate:modelValue":i[6]||=e=>K.value.settings.latitude=e,type:`number`,step:`0.000001`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.latitude,void 0,{number:!0}]])]),d(`div`,null,[i[55]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Longitude`,-1),a(d(`input`,{"onUpdate:modelValue":i[7]||=e=>K.value.settings.longitude=e,type:`number`,step:`0.000001`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.longitude,void 0,{number:!0}]])])]),d(`div`,rt,[d(`div`,null,[i[56]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Admin Password (Optional)`,-1),a(d(`input`,{"onUpdate:modelValue":i[8]||=e=>K.value.settings.admin_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.admin_password]]),i[57]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Full access to room server `,-1)]),d(`div`,null,[i[58]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Guest Password (Optional)`,-1),a(d(`input`,{"onUpdate:modelValue":i[9]||=e=>K.value.settings.guest_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.guest_password]]),i[59]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Read-only access `,-1)])])]),d(`div`,{class:`flex justify-end gap-3 mt-6`},[d(`button`,{onClick:X,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors`},` Cancel `),d(`button`,{onClick:vn,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors`},` Create `)])])])):o(``,!0),T.value&&E.value?(p(),f(`div`,it,[d(`div`,at,[i[72]||=d(`h2`,{class:`text-xl font-bold text-content-primary dark:text-content-primary mb-4`},` Edit Room Server `,-1),d(`div`,ot,[d(`div`,null,[i[61]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Current Name`,-1),d(`input`,{value:E.value.name,disabled:``,type:`text`,class:`w-full bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-muted dark:text-content-muted cursor-not-allowed`},null,8,st)]),d(`div`,null,[i[62]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`New Name (optional)`,-1),a(d(`input`,{"onUpdate:modelValue":i[10]||=e=>E.value.new_name=e,type:`text`,placeholder:`Leave empty to keep current name`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.new_name]])]),d(`div`,null,[d(`label`,ct,[i[63]||=l(` Identity Key (Optional) `,-1),d(`button`,{onClick:i[11]||=e=>O.value=!O.value,type:`button`,class:`ml-2 text-primary/70 hover:text-primary text-xs underline`},n(O.value?`Hide`:`Show/Edit`),1)]),O.value?(p(),f(`div`,lt,[a(d(`input`,{"onUpdate:modelValue":i[12]||=e=>E.value.identity_key=e,type:`text`,placeholder:`Leave empty to keep current key`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.identity_key]]),i[64]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Leave empty to keep the current identity key `,-1)])):(p(),f(`div`,ut,` Click "Show/Edit" to change the identity key `))]),d(`div`,null,[i[65]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Node Name`,-1),a(d(`input`,{"onUpdate:modelValue":i[13]||=e=>E.value.settings.node_name=e,type:`text`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.node_name]])]),d(`div`,dt,[d(`div`,null,[i[66]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Latitude`,-1),a(d(`input`,{"onUpdate:modelValue":i[14]||=e=>E.value.settings.latitude=e,type:`number`,step:`0.000001`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.latitude,void 0,{number:!0}]])]),d(`div`,null,[i[67]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Longitude`,-1),a(d(`input`,{"onUpdate:modelValue":i[15]||=e=>E.value.settings.longitude=e,type:`number`,step:`0.000001`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.longitude,void 0,{number:!0}]])])]),d(`div`,ft,[d(`div`,null,[i[68]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Admin Password`,-1),a(d(`input`,{"onUpdate:modelValue":i[16]||=e=>E.value.settings.admin_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.admin_password]]),i[69]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Full access to room server `,-1)]),d(`div`,null,[i[70]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Guest Password`,-1),a(d(`input`,{"onUpdate:modelValue":i[17]||=e=>E.value.settings.guest_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.guest_password]]),i[71]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Read-only access `,-1)])])]),d(`div`,{class:`flex justify-end gap-3 mt-6`},[d(`button`,{onClick:X,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors`},` Cancel `),d(`button`,{onClick:yn,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors`},` Update `)])])])):o(``,!0)]),c(te,{show:A.value,title:`Delete Room Server`,message:`Are you sure you want to delete '${j.value}'? This action cannot be undone.`,"confirm-text":`Delete`,"cancel-text":`Cancel`,variant:`danger`,onClose:i[18]||=e=>A.value=!1,onConfirm:xn},null,8,[`show`,`message`]),c(ne,{show:M.value,message:N.value.message,variant:N.value.variant,onClose:i[19]||=e=>M.value=!1},null,8,[`show`,`message`,`variant`]),P.value?(p(),f(`div`,pt,[d(`div`,mt,[d(`div`,ht,[i[79]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-r from-secondary/20 via-primary/20 to-accent-purple/20`},null,-1),i[80]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-transparent via-white/5 to-transparent`},null,-1),d(`div`,gt,[d(`div`,_t,[i[75]||=r(`
`,1),d(`div`,null,[i[74]||=d(`h2`,{class:`text-2xl font-bold text-content-primary dark:text-content-primary mb-1`},` Room Messages `,-1),d(`p`,vt,[i[73]||=d(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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),d(`span`,yt,n(F.value),1)])])]),d(`div`,bt,[d(`button`,{onClick:i[20]||=e=>G.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`},[i[76]||=d(`svg`,{class:`w-4 h-4 group-hover:scale-110 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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),i[77]||=d(`span`,{class:`hidden sm:inline`},`Sessions`,-1),d(`span`,xt,n(W.value.length),1)]),d(`button`,{onClick:On,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`},[...i[78]||=[d(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])])])]),d(`div`,St,[R.value&&L.value.length===0?(p(),f(`div`,Ct,[...i[81]||=[d(`div`,{class:`text-center`},[d(`div`,{class:`animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4`}),d(`div`,{class:`text-content-secondary dark:text-content-primary/70`},` Loading messages... `)],-1)]])):z.value?(p(),f(`div`,wt,[d(`div`,Tt,[i[82]||=d(`div`,{class:`text-red-600 dark:text-red-400 mb-2`},`Failed to load messages`,-1),d(`div`,Et,n(z.value),1),d(`button`,{onClick:i[21]||=e=>Q(!0),class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors`},` Retry `)])])):L.value.length>0?(p(),f(`div`,Dt,[(p(!0),f(u,null,e(L.value,(e,t)=>(p(),f(`div`,{key:e.id||t,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`},[i[87]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-r from-secondary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,Ot,[d(`div`,kt,[d(`div`,At,[d(`div`,jt,[i[84]||=d(`div`,{class:`w-6 h-6 rounded-full bg-gradient-to-br from-primary/30 to-secondary/30 flex items-center justify-center`},[d(`svg`,{class:`w-3 h-3 text-content-secondary dark:text-content-primary/70`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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?(p(),f(`span`,Mt,n(e.author_name),1)):o(``,!0),e.author_pubkey?(p(),f(`span`,Nt,n(e.author_pubkey.substring(0,8))+`... `,1)):(p(),f(`span`,Pt,` Anonymous `)),i[85]||=d(`span`,{class:`text-content-muted dark:text-content-muted/60 text-xs`},`•`,-1),d(`span`,Ft,[i[83]||=d(`svg`,{class:`w-3 h-3`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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),l(` `+n(kn(e.timestamp)),1)]),e.id?(p(),f(`span`,It,` #`+n(e.id),1)):o(``,!0)])]),d(`div`,Lt,n(e.message_text),1)]),d(`button`,{onClick:t=>Dn(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`},[...i[86]||=[d(`svg`,{class:`w-4 h-4 group-hover/delete:rotate-12 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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,Rt)])]))),128)),U.value&&!R.value?(p(),f(`div`,zt,[d(`button`,{onClick:En,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`},[...i[88]||=[d(`svg`,{class:`w-4 h-4 group-hover:translate-y-1 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 9l-7 7-7-7`})],-1),l(` Load More Messages `,-1)]])])):R.value?(p(),f(`div`,Bt,[...i[89]||=[d(`div`,{class:`flex items-center justify-center gap-2 text-content-secondary dark:text-content-muted text-sm`},[d(`div`,{class:`animate-spin w-4 h-4 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full`}),l(` Loading... `)],-1)]])):o(``,!0)])):(p(),f(`div`,Vt,[...i[90]||=[r(`
No messages yet
Be the first to start the conversation
`,1)]]))]),d(`div`,Ht,[i[93]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-t from-primary/5 to-transparent pointer-events-none`},null,-1),d(`div`,Ut,[d(`div`,Wt,[d(`div`,Gt,[a(d(`textarea`,{"onUpdate:modelValue":i[22]||=e=>B.value=e,onKeydown:[v(_($,[`ctrl`]),[`enter`]),v(_($,[`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,Kt),[[g,B.value]])]),d(`button`,{onClick:$,disabled:!B.value.trim(),class:s([`group px-6 py-3 rounded-[12px] transition-all duration-200 flex items-center justify-center gap-2 font-medium`,B.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`])},[...i[91]||=[d(`svg`,{class:`w-5 h-5 group-hover:translate-x-1 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 19l9 2-9-18-9 18 9-2zm0 0v-8`})],-1),d(`span`,{class:`hidden sm:inline`},`Send`,-1)]],10,qt)]),i[92]||=d(`p`,{class:`text-content-secondary dark:text-content-muted/60 text-xs flex items-center gap-2`},[d(`svg`,{class:`w-3 h-3`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`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`})]),l(` Press Ctrl+Enter to send message quickly `)],-1)])])])])):o(``,!0),G.value?(p(),f(`div`,Jt,[d(`div`,Yt,[d(`div`,Xt,[d(`div`,null,[i[95]||=d(`h2`,{class:`text-xl font-bold text-content-primary dark:text-content-primary`},` Active Sessions `,-1),d(`p`,Zt,[i[94]||=l(` Room: `,-1),d(`span`,Qt,n(F.value),1)])]),d(`button`,{onClick:i[23]||=e=>G.value=!1,class:`text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary transition-colors`},[...i[96]||=[d(`svg`,{class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),d(`div`,b,[W.value.length===0?(p(),f(`div`,$t,[...i[97]||=[d(`div`,{class:`text-content-secondary dark:text-content-muted`},`No active sessions found`,-1)]])):o(``,!0),(p(!0),f(u,null,e(W.value,(e,t)=>(p(),f(`div`,{key:e.public_key_full||t,class:`glass-card backdrop-blur-xl rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10`},[d(`div`,en,[d(`div`,tn,[d(`div`,nn,[d(`span`,rn,n(e.identity_name||`Unknown`),1),d(`span`,{class:s([`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`])},n(e.permissions),3)]),d(`div`,an,[d(`span`,on,n(e.identity_type),1),d(`button`,{onClick:t=>An(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,sn)])]),d(`div`,cn,[d(`div`,ln,[i[98]||=d(`span`,{class:`text-content-secondary dark:text-content-muted`},`Short Key:`,-1),d(`code`,un,n(e.public_key),1)]),d(`div`,dn,[i[99]||=d(`span`,{class:`text-content-secondary dark:text-content-muted`},`Full Key:`,-1),d(`code`,fn,n(e.public_key_full),1)])]),d(`div`,pn,[d(`div`,mn,[e.address?(p(),f(`span`,hn,`📍 `+n(e.address),1)):o(``,!0),e.last_login_success?(p(),f(`span`,gn,`Last Login: `+n(new Date(e.last_login_success*1e3).toLocaleString()),1)):o(``,!0)]),e.last_activity?(p(),f(`span`,_n,`Active: `+n(Math.floor((Date.now()/1e3-e.last_activity)/60))+`m ago`,1)):o(``,!0)])])]))),128))])])])):o(``,!0)],64))}});export{x as default};
\ No newline at end of file
diff --git a/repeater/web/html/assets/Sessions-B4giR55K.js b/repeater/web/html/assets/Sessions-B8ZVRIGt.js
similarity index 99%
rename from repeater/web/html/assets/Sessions-B4giR55K.js
rename to repeater/web/html/assets/Sessions-B8ZVRIGt.js
index d600dda..a938e64 100644
--- a/repeater/web/html/assets/Sessions-B4giR55K.js
+++ b/repeater/web/html/assets/Sessions-B8ZVRIGt.js
@@ -1 +1 @@
-import{E as e,S as t,dt as n,g as r,j as ee,l as i,lt as a,o,p as te,r as s,s as c,u as l,w as u,z as d}from"./runtime-core.esm-bundler-IofF4kUm.js";import{t as f}from"./api-CrUX-ZnK.js";import{u as ne}from"./index-CPWfwDmA.js";var re={class:`p-6 space-y-6`},ie={key:0,class:`grid grid-cols-1 md:grid-cols-4 gap-4`},ae={class:`glass-card rounded-[15px] p-4`},oe={class:`text-2xl font-bold text-content-primary dark:text-content-primary`},se={class:`glass-card rounded-[15px] p-4`},ce={class:`text-2xl font-bold text-cyan-500 dark:text-primary`},le={class:`glass-card rounded-[15px] p-4`},ue={class:`text-2xl font-bold text-green-700 dark:text-green-500 dark:text-accent-green`},de={class:`glass-card rounded-[15px] p-4`},fe={class:`text-2xl font-bold text-yellow-500 dark:text-secondary`},pe={class:`glass-card rounded-[15px] p-6`},me={class:`flex flex-wrap border-b border-stroke-subtle dark:border-stroke/10 mb-6`},he=[`onClick`],p={class:`flex items-center gap-2`},m={key:0,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},h={key:1,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},g={key:2,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},_={class:`min-h-[400px]`},v={key:0,class:`flex items-center justify-center py-12`},y={key:1,class:`flex items-center justify-center py-12`},b={class:`text-center`},x={class:`text-content-secondary dark:text-content-muted text-sm mb-4`},S={key:2,class:`space-y-4`},C={key:0,class:`text-center py-12 text-content-secondary dark:text-content-muted`},w={key:1,class:`space-y-4`},T={class:`flex items-start justify-between`},E={class:`flex-1 min-w-0`},D={class:`flex items-center gap-2 flex-wrap mb-3`},O={class:`text-lg font-semibold text-content-primary dark:text-content-primary truncate`},k={class:`flex flex-wrap items-center gap-x-4 gap-y-2 text-sm`},A={key:0,class:`flex items-center gap-1.5`},j={class:`text-content-secondary dark:text-content-muted`},M={key:1,class:`flex items-center gap-1.5`},N={class:`text-content-secondary dark:text-content-muted`},P={key:2,class:`text-content-secondary dark:text-content-muted font-mono text-xs`},F={key:3,class:`text-content-muted dark:text-content-muted font-mono text-xs`},I={key:0,class:`text-content-muted dark:text-content-muted text-xs mt-2 mb-0`},L={class:`grid grid-cols-2 md:grid-cols-4 gap-4 mt-4`},R={class:`text-content-primary dark:text-content-primary font-medium`},ge={class:`text-cyan-500 dark:text-primary font-medium`},_e={class:`mt-3 flex items-center gap-2`},ve={key:3,class:`space-y-4`},ye={key:0,class:`text-center py-12 text-content-secondary dark:text-content-muted`},be={key:1,class:`overflow-x-auto`},xe={class:`w-full`},Se={class:`py-3`},Ce={class:`font-mono text-sm text-content-primary dark:text-content-primary`},we={class:`py-3`},Te={class:`font-mono text-xs text-content-secondary dark:text-content-muted`},Ee={class:`py-3`},De={class:`text-sm text-content-primary dark:text-content-primary`},z={class:`text-xs text-content-muted dark:text-content-muted`},Oe={class:`py-3`},ke={class:`py-3`},Ae={class:`text-sm text-content-secondary dark:text-content-muted`},je={class:`py-3`},Me=[`onClick`],Ne={key:4,class:`space-y-4`},Pe={class:`mb-4`},Fe=[`value`],Ie={key:0,class:`text-center py-12 text-content-secondary dark:text-content-muted`},Le={key:1,class:`grid grid-cols-1 gap-4`},Re={class:`flex items-start justify-between`},ze={class:`flex-1`},Be={class:`flex items-center gap-3 mb-3`},Ve={class:`text-content-primary dark:text-content-primary font-mono text-sm`},He={class:`grid grid-cols-1 md:grid-cols-2 gap-3 text-sm`},Ue={class:`text-content-primary dark:text-content-primary/90 font-mono ml-2`},We={class:`text-content-primary dark:text-content-primary/90 ml-2`},Ge={class:`text-content-primary dark:text-content-primary/90 ml-2`},Ke={class:`text-content-primary dark:text-content-primary/90 ml-2`},qe=[`onClick`],Je={class:`flex justify-end`},Ye=[`disabled`],B=r({name:`SessionsView`,__name:`Sessions`,setup(r){let B=d(`overview`),V=d(!1),H=d(!1),U=d(null),W=d(null),G=d([]),K=d(null),q=d(null),Xe=[{id:`overview`,label:`Overview`,icon:`overview`},{id:`clients`,label:`Authenticated Clients`,icon:`clients`},{id:`identities`,label:`By Identity`,icon:`identities`}];t(async()=>{await J(),V.value=!0});async function J(){H.value=!0,U.value=null;try{let e=await f.getACLInfo();e.success&&(W.value=e.data);let t=await f.getACLClients();t.success&&t.data&&(G.value=t.data.clients||[]);let n=await f.getACLStats();n.success&&(K.value=n.data)}catch(e){U.value=e instanceof Error?e.message:`Failed to load ACL data`,console.error(`Error fetching ACL data:`,e)}finally{H.value=!1}}async function Y(e,t){if(confirm(`Are you sure you want to remove this client from the ACL?`))try{let n=await f.removeACLClient({public_key:e,identity_hash:t});n.success?await J():alert(`Failed to remove client: ${n.error}`)}catch(e){alert(`Error removing client: ${e}`)}}function X(e){return e?new Date(e*1e3).toLocaleString():`Never`}function Ze(e){B.value=e}let Z=o(()=>q.value?G.value.filter(e=>e.identity_name===q.value):G.value),Q=o(()=>W.value&&W.value.acls||[]);function Qe(e){return e?.type===`companion`}function $e(e){return e===`repeater`?`bg-cyan-500/20 dark:bg-primary/20 text-cyan-700 dark:text-primary`:e===`companion`?`bg-violet-500/20 dark:bg-violet-400/20 text-violet-700 dark:text-violet-300`:`bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary`}function $(e){return e==null?`N/A`:typeof e==`boolean`?e?`✓`:`✗`:String(e)}return(t,r)=>(u(),l(`div`,re,[r[22]||=c(`div`,null,[c(`h1`,{class:`text-2xl font-bold text-content-primary dark:text-content-primary`},` Sessions & Access Control `),c(`p`,{class:`text-content-secondary dark:text-content-muted mt-2`},` Manage authenticated clients and access control lists `),c(`p`,{class:`text-content-muted dark:text-content-muted text-sm mt-1`},` Repeater, room servers, and companion identities; companions do not accept client logins. `)],-1),K.value?(u(),l(`div`,ie,[c(`div`,ae,[r[1]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-1`},` Total Identities `,-1),c(`div`,oe,n(K.value.total_identities),1)]),c(`div`,se,[r[2]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-1`},` Authenticated Clients `,-1),c(`div`,ce,n(K.value.total_clients),1)]),c(`div`,le,[r[3]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-1`},`Admin Clients`,-1),c(`div`,ue,n(K.value.admin_clients),1)]),c(`div`,de,[r[4]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-1`},`Guest Clients`,-1),c(`div`,fe,n(K.value.guest_clients),1)])])):i(``,!0),c(`div`,pe,[c(`div`,me,[(u(),l(s,null,e(Xe,e=>c(`button`,{key:e.id,onClick:t=>Ze(e.id),class:a([`px-4 py-2 text-sm font-medium transition-colors duration-200 border-b-2 mr-6 mb-2`,B.value===e.id?`text-cyan-500 dark:text-primary border-cyan-500 dark:border-primary`:`text-content-secondary dark:text-content-muted border-transparent hover:text-content-primary dark:hover:text-content-primary hover:border-stroke-subtle dark:hover:border-stroke/30`])},[c(`div`,p,[e.icon===`overview`?(u(),l(`svg`,m,[...r[5]||=[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z`},null,-1)]])):e.icon===`clients`?(u(),l(`svg`,h,[...r[6]||=[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z`},null,-1)]])):e.icon===`identities`?(u(),l(`svg`,g,[...r[7]||=[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2`},null,-1)]])):i(``,!0),te(` `+n(e.label),1)])],10,he)),64))]),c(`div`,_,[H.value&&!V.value?(u(),l(`div`,v,[...r[8]||=[c(`div`,{class:`text-center`},[c(`div`,{class:`animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full mx-auto mb-4`}),c(`div`,{class:`text-content-secondary dark:text-content-muted`},`Loading ACL data...`)],-1)]])):U.value?(u(),l(`div`,y,[c(`div`,b,[r[9]||=c(`div`,{class:`text-red-500 dark:text-red-400 mb-2`},`Failed to load ACL data`,-1),c(`div`,x,n(U.value),1),c(`button`,{onClick:J,class:`px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors`},` Retry `)])])):B.value===`overview`?(u(),l(`div`,S,[Q.value.length===0?(u(),l(`div`,C,` No identities configured `)):(u(),l(`div`,w,[(u(!0),l(s,null,e(Q.value,e=>(u(),l(`div`,{key:e.hash,class:`glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-cyan-400 dark:hover:border-primary/30 transition-colors`},[c(`div`,T,[c(`div`,E,[c(`div`,D,[c(`h3`,O,n(e.name),1),c(`span`,{class:a([`px-2 py-0.5 text-xs font-medium rounded shrink-0`,$e(e.type)])},n(e.type),3)]),Qe(e)?(u(),l(s,{key:0},[c(`div`,k,[e.registered===void 0?i(``,!0):(u(),l(`span`,A,[c(`span`,{class:a([`w-2 h-2 rounded-full shrink-0`,e.registered?`bg-accent-green`:`bg-accent-red`]),"aria-hidden":``},null,2),c(`span`,j,`Registered: `+n(e.registered?`Active`:`Inactive`),1)])),e.active===void 0?i(``,!0):(u(),l(`span`,M,[c(`span`,{class:a([`w-2 h-2 rounded-full shrink-0`,e.active?`bg-accent-green`:`bg-accent-red`]),"aria-hidden":``},null,2),c(`span`,N,`Bridge: `+n(e.active?`Connected`:`Disconnected`),1)])),e.client_ip?(u(),l(`span`,P,` Client: `+n(e.client_ip),1)):i(``,!0),e.hash?(u(),l(`span`,F,` Hash: `+n(e.hash),1)):i(``,!0)]),e.last_seen==null?i(``,!0):(u(),l(`p`,I,` Last seen: `+n(X(e.last_seen)),1))],64)):(u(),l(s,{key:1},[c(`div`,L,[c(`div`,null,[r[10]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` Max Clients `,-1),c(`div`,R,n($(e.max_clients)),1)]),c(`div`,null,[r[11]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` Authenticated `,-1),c(`div`,ge,n($(e.authenticated_clients)),1)]),c(`div`,null,[r[12]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` Admin Password `,-1),c(`div`,{class:a(e.has_admin_password?`text-green-700 dark:text-green-500 dark:text-accent-green`:`text-red-500 dark:text-accent-red`)},n(e.has_admin_password==null?`N/A`:e.has_admin_password?`✓ Set`:`✗ Not Set`),3)]),c(`div`,null,[r[13]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` Guest Password `,-1),c(`div`,{class:a(e.has_guest_password?`text-green-700 dark:text-green-500 dark:text-accent-green`:`text-red-500 dark:text-accent-red`)},n(e.has_guest_password==null?`N/A`:e.has_guest_password?`✓ Set`:`✗ Not Set`),3)])]),c(`div`,_e,[r[14]||=c(`span`,{class:`text-content-secondary dark:text-content-muted text-xs`},`Read-Only Access:`,-1),c(`span`,{class:a(e.allow_read_only?`text-green-700 dark:text-green-500 dark:text-accent-green`:`text-red-500 dark:text-accent-red`)},n(e.allow_read_only==null?`N/A`:e.allow_read_only?`Allowed`:`Disabled`),3)])],64))])])]))),128))]))])):B.value===`clients`?(u(),l(`div`,ve,[G.value.length===0?(u(),l(`div`,ye,` No authenticated clients `)):(u(),l(`div`,be,[c(`table`,xe,[r[15]||=c(`thead`,null,[c(`tr`,{class:`border-b border-stroke-subtle dark:border-stroke/10`},[c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Client `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Address `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Identity `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Permissions `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Last Activity `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Actions `)])],-1),c(`tbody`,null,[(u(!0),l(s,null,e(G.value,e=>(u(),l(`tr`,{key:e.public_key_full,class:`border-b border-stroke-subtle dark:border-white/5 hover:bg-gray-100/50 dark:hover:bg-white/5 transition-colors`},[c(`td`,Se,[c(`div`,Ce,n(e.public_key),1)]),c(`td`,we,[c(`div`,Te,n(e.address),1)]),c(`td`,Ee,[c(`div`,De,n(e.identity_name),1),c(`div`,z,n(e.identity_hash),1)]),c(`td`,Oe,[c(`span`,{class:a([`px-2 py-1 text-xs font-medium rounded`,e.permissions===`admin`?`bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green`:`bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary`])},n(e.permissions),3)]),c(`td`,ke,[c(`div`,Ae,n(X(e.last_activity)),1)]),c(`td`,je,[c(`button`,{onClick:t=>Y(e.public_key_full,e.identity_hash),class:`px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors`},` Remove `,8,Me)])]))),128))])])]))])):B.value===`identities`?(u(),l(`div`,Ne,[c(`div`,Pe,[r[17]||=c(`label`,{class:`block text-content-secondary dark:text-content-muted text-sm mb-2`},`Filter by Identity`,-1),ee(c(`select`,{"onUpdate:modelValue":r[0]||=e=>q.value=e,class:`bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-cyan-500 dark:focus:border-primary/50 transition-colors`},[r[16]||=c(`option`,{value:null},`All Identities`,-1),(u(!0),l(s,null,e(Q.value,e=>(u(),l(`option`,{key:e.name,value:e.name},n(e.name)+` (`+n(e.authenticated_clients??0)+` clients) `,9,Fe))),128))],512),[[ne,q.value]])]),Z.value.length===0?(u(),l(`div`,Ie,` No clients for selected identity `)):(u(),l(`div`,Le,[(u(!0),l(s,null,e(Z.value,e=>(u(),l(`div`,{key:e.public_key_full,class:`glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10`},[c(`div`,Re,[c(`div`,ze,[c(`div`,Be,[c(`span`,{class:a([`px-2 py-1 text-xs font-medium rounded`,e.permissions===`admin`?`bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green`:`bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary`])},n(e.permissions),3),c(`span`,Ve,n(e.public_key),1)]),c(`div`,He,[c(`div`,null,[r[18]||=c(`span`,{class:`text-content-secondary dark:text-content-muted`},`Address:`,-1),c(`span`,Ue,n(e.address),1)]),c(`div`,null,[r[19]||=c(`span`,{class:`text-content-secondary dark:text-content-muted`},`Identity:`,-1),c(`span`,We,n(e.identity_name)+` (`+n(e.identity_hash)+`)`,1)]),c(`div`,null,[r[20]||=c(`span`,{class:`text-content-secondary dark:text-content-muted`},`Last Activity:`,-1),c(`span`,Ge,n(X(e.last_activity)),1)]),c(`div`,null,[r[21]||=c(`span`,{class:`text-content-secondary dark:text-content-muted`},`Last Login:`,-1),c(`span`,Ke,n(X(e.last_login_success)),1)])])]),c(`button`,{onClick:t=>Y(e.public_key_full,e.identity_hash),class:`ml-4 px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors`},` Remove `,8,qe)])]))),128))]))])):i(``,!0)])]),c(`div`,Je,[c(`button`,{onClick:J,disabled:H.value,class:`px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-primary rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors disabled:opacity-50`},n(H.value?`Refreshing...`:`Refresh Data`),9,Ye)])]))}});export{B as default};
\ No newline at end of file
+import{E as e,S as t,dt as n,g as r,j as ee,l as i,lt as a,o,p as te,r as s,s as c,u as l,w as u,z as d}from"./runtime-core.esm-bundler-IofF4kUm.js";import{t as f}from"./api-CiSov_eM.js";import{u as ne}from"./index-BPH8UrxU.js";var re={class:`p-6 space-y-6`},ie={key:0,class:`grid grid-cols-1 md:grid-cols-4 gap-4`},ae={class:`glass-card rounded-[15px] p-4`},oe={class:`text-2xl font-bold text-content-primary dark:text-content-primary`},se={class:`glass-card rounded-[15px] p-4`},ce={class:`text-2xl font-bold text-cyan-500 dark:text-primary`},le={class:`glass-card rounded-[15px] p-4`},ue={class:`text-2xl font-bold text-green-700 dark:text-green-500 dark:text-accent-green`},de={class:`glass-card rounded-[15px] p-4`},fe={class:`text-2xl font-bold text-yellow-500 dark:text-secondary`},pe={class:`glass-card rounded-[15px] p-6`},me={class:`flex flex-wrap border-b border-stroke-subtle dark:border-stroke/10 mb-6`},he=[`onClick`],p={class:`flex items-center gap-2`},m={key:0,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},h={key:1,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},g={key:2,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},_={class:`min-h-[400px]`},v={key:0,class:`flex items-center justify-center py-12`},y={key:1,class:`flex items-center justify-center py-12`},b={class:`text-center`},x={class:`text-content-secondary dark:text-content-muted text-sm mb-4`},S={key:2,class:`space-y-4`},C={key:0,class:`text-center py-12 text-content-secondary dark:text-content-muted`},w={key:1,class:`space-y-4`},T={class:`flex items-start justify-between`},E={class:`flex-1 min-w-0`},D={class:`flex items-center gap-2 flex-wrap mb-3`},O={class:`text-lg font-semibold text-content-primary dark:text-content-primary truncate`},k={class:`flex flex-wrap items-center gap-x-4 gap-y-2 text-sm`},A={key:0,class:`flex items-center gap-1.5`},j={class:`text-content-secondary dark:text-content-muted`},M={key:1,class:`flex items-center gap-1.5`},N={class:`text-content-secondary dark:text-content-muted`},P={key:2,class:`text-content-secondary dark:text-content-muted font-mono text-xs`},F={key:3,class:`text-content-muted dark:text-content-muted font-mono text-xs`},I={key:0,class:`text-content-muted dark:text-content-muted text-xs mt-2 mb-0`},L={class:`grid grid-cols-2 md:grid-cols-4 gap-4 mt-4`},R={class:`text-content-primary dark:text-content-primary font-medium`},ge={class:`text-cyan-500 dark:text-primary font-medium`},_e={class:`mt-3 flex items-center gap-2`},ve={key:3,class:`space-y-4`},ye={key:0,class:`text-center py-12 text-content-secondary dark:text-content-muted`},be={key:1,class:`overflow-x-auto`},xe={class:`w-full`},Se={class:`py-3`},Ce={class:`font-mono text-sm text-content-primary dark:text-content-primary`},we={class:`py-3`},Te={class:`font-mono text-xs text-content-secondary dark:text-content-muted`},Ee={class:`py-3`},De={class:`text-sm text-content-primary dark:text-content-primary`},z={class:`text-xs text-content-muted dark:text-content-muted`},Oe={class:`py-3`},ke={class:`py-3`},Ae={class:`text-sm text-content-secondary dark:text-content-muted`},je={class:`py-3`},Me=[`onClick`],Ne={key:4,class:`space-y-4`},Pe={class:`mb-4`},Fe=[`value`],Ie={key:0,class:`text-center py-12 text-content-secondary dark:text-content-muted`},Le={key:1,class:`grid grid-cols-1 gap-4`},Re={class:`flex items-start justify-between`},ze={class:`flex-1`},Be={class:`flex items-center gap-3 mb-3`},Ve={class:`text-content-primary dark:text-content-primary font-mono text-sm`},He={class:`grid grid-cols-1 md:grid-cols-2 gap-3 text-sm`},Ue={class:`text-content-primary dark:text-content-primary/90 font-mono ml-2`},We={class:`text-content-primary dark:text-content-primary/90 ml-2`},Ge={class:`text-content-primary dark:text-content-primary/90 ml-2`},Ke={class:`text-content-primary dark:text-content-primary/90 ml-2`},qe=[`onClick`],Je={class:`flex justify-end`},Ye=[`disabled`],B=r({name:`SessionsView`,__name:`Sessions`,setup(r){let B=d(`overview`),V=d(!1),H=d(!1),U=d(null),W=d(null),G=d([]),K=d(null),q=d(null),Xe=[{id:`overview`,label:`Overview`,icon:`overview`},{id:`clients`,label:`Authenticated Clients`,icon:`clients`},{id:`identities`,label:`By Identity`,icon:`identities`}];t(async()=>{await J(),V.value=!0});async function J(){H.value=!0,U.value=null;try{let e=await f.getACLInfo();e.success&&(W.value=e.data);let t=await f.getACLClients();t.success&&t.data&&(G.value=t.data.clients||[]);let n=await f.getACLStats();n.success&&(K.value=n.data)}catch(e){U.value=e instanceof Error?e.message:`Failed to load ACL data`,console.error(`Error fetching ACL data:`,e)}finally{H.value=!1}}async function Y(e,t){if(confirm(`Are you sure you want to remove this client from the ACL?`))try{let n=await f.removeACLClient({public_key:e,identity_hash:t});n.success?await J():alert(`Failed to remove client: ${n.error}`)}catch(e){alert(`Error removing client: ${e}`)}}function X(e){return e?new Date(e*1e3).toLocaleString():`Never`}function Ze(e){B.value=e}let Z=o(()=>q.value?G.value.filter(e=>e.identity_name===q.value):G.value),Q=o(()=>W.value&&W.value.acls||[]);function Qe(e){return e?.type===`companion`}function $e(e){return e===`repeater`?`bg-cyan-500/20 dark:bg-primary/20 text-cyan-700 dark:text-primary`:e===`companion`?`bg-violet-500/20 dark:bg-violet-400/20 text-violet-700 dark:text-violet-300`:`bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary`}function $(e){return e==null?`N/A`:typeof e==`boolean`?e?`✓`:`✗`:String(e)}return(t,r)=>(u(),l(`div`,re,[r[22]||=c(`div`,null,[c(`h1`,{class:`text-2xl font-bold text-content-primary dark:text-content-primary`},` Sessions & Access Control `),c(`p`,{class:`text-content-secondary dark:text-content-muted mt-2`},` Manage authenticated clients and access control lists `),c(`p`,{class:`text-content-muted dark:text-content-muted text-sm mt-1`},` Repeater, room servers, and companion identities; companions do not accept client logins. `)],-1),K.value?(u(),l(`div`,ie,[c(`div`,ae,[r[1]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-1`},` Total Identities `,-1),c(`div`,oe,n(K.value.total_identities),1)]),c(`div`,se,[r[2]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-1`},` Authenticated Clients `,-1),c(`div`,ce,n(K.value.total_clients),1)]),c(`div`,le,[r[3]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-1`},`Admin Clients`,-1),c(`div`,ue,n(K.value.admin_clients),1)]),c(`div`,de,[r[4]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-1`},`Guest Clients`,-1),c(`div`,fe,n(K.value.guest_clients),1)])])):i(``,!0),c(`div`,pe,[c(`div`,me,[(u(),l(s,null,e(Xe,e=>c(`button`,{key:e.id,onClick:t=>Ze(e.id),class:a([`px-4 py-2 text-sm font-medium transition-colors duration-200 border-b-2 mr-6 mb-2`,B.value===e.id?`text-cyan-500 dark:text-primary border-cyan-500 dark:border-primary`:`text-content-secondary dark:text-content-muted border-transparent hover:text-content-primary dark:hover:text-content-primary hover:border-stroke-subtle dark:hover:border-stroke/30`])},[c(`div`,p,[e.icon===`overview`?(u(),l(`svg`,m,[...r[5]||=[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z`},null,-1)]])):e.icon===`clients`?(u(),l(`svg`,h,[...r[6]||=[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z`},null,-1)]])):e.icon===`identities`?(u(),l(`svg`,g,[...r[7]||=[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2`},null,-1)]])):i(``,!0),te(` `+n(e.label),1)])],10,he)),64))]),c(`div`,_,[H.value&&!V.value?(u(),l(`div`,v,[...r[8]||=[c(`div`,{class:`text-center`},[c(`div`,{class:`animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full mx-auto mb-4`}),c(`div`,{class:`text-content-secondary dark:text-content-muted`},`Loading ACL data...`)],-1)]])):U.value?(u(),l(`div`,y,[c(`div`,b,[r[9]||=c(`div`,{class:`text-red-500 dark:text-red-400 mb-2`},`Failed to load ACL data`,-1),c(`div`,x,n(U.value),1),c(`button`,{onClick:J,class:`px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors`},` Retry `)])])):B.value===`overview`?(u(),l(`div`,S,[Q.value.length===0?(u(),l(`div`,C,` No identities configured `)):(u(),l(`div`,w,[(u(!0),l(s,null,e(Q.value,e=>(u(),l(`div`,{key:e.hash,class:`glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-cyan-400 dark:hover:border-primary/30 transition-colors`},[c(`div`,T,[c(`div`,E,[c(`div`,D,[c(`h3`,O,n(e.name),1),c(`span`,{class:a([`px-2 py-0.5 text-xs font-medium rounded shrink-0`,$e(e.type)])},n(e.type),3)]),Qe(e)?(u(),l(s,{key:0},[c(`div`,k,[e.registered===void 0?i(``,!0):(u(),l(`span`,A,[c(`span`,{class:a([`w-2 h-2 rounded-full shrink-0`,e.registered?`bg-accent-green`:`bg-accent-red`]),"aria-hidden":``},null,2),c(`span`,j,`Registered: `+n(e.registered?`Active`:`Inactive`),1)])),e.active===void 0?i(``,!0):(u(),l(`span`,M,[c(`span`,{class:a([`w-2 h-2 rounded-full shrink-0`,e.active?`bg-accent-green`:`bg-accent-red`]),"aria-hidden":``},null,2),c(`span`,N,`Bridge: `+n(e.active?`Connected`:`Disconnected`),1)])),e.client_ip?(u(),l(`span`,P,` Client: `+n(e.client_ip),1)):i(``,!0),e.hash?(u(),l(`span`,F,` Hash: `+n(e.hash),1)):i(``,!0)]),e.last_seen==null?i(``,!0):(u(),l(`p`,I,` Last seen: `+n(X(e.last_seen)),1))],64)):(u(),l(s,{key:1},[c(`div`,L,[c(`div`,null,[r[10]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` Max Clients `,-1),c(`div`,R,n($(e.max_clients)),1)]),c(`div`,null,[r[11]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` Authenticated `,-1),c(`div`,ge,n($(e.authenticated_clients)),1)]),c(`div`,null,[r[12]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` Admin Password `,-1),c(`div`,{class:a(e.has_admin_password?`text-green-700 dark:text-green-500 dark:text-accent-green`:`text-red-500 dark:text-accent-red`)},n(e.has_admin_password==null?`N/A`:e.has_admin_password?`✓ Set`:`✗ Not Set`),3)]),c(`div`,null,[r[13]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` Guest Password `,-1),c(`div`,{class:a(e.has_guest_password?`text-green-700 dark:text-green-500 dark:text-accent-green`:`text-red-500 dark:text-accent-red`)},n(e.has_guest_password==null?`N/A`:e.has_guest_password?`✓ Set`:`✗ Not Set`),3)])]),c(`div`,_e,[r[14]||=c(`span`,{class:`text-content-secondary dark:text-content-muted text-xs`},`Read-Only Access:`,-1),c(`span`,{class:a(e.allow_read_only?`text-green-700 dark:text-green-500 dark:text-accent-green`:`text-red-500 dark:text-accent-red`)},n(e.allow_read_only==null?`N/A`:e.allow_read_only?`Allowed`:`Disabled`),3)])],64))])])]))),128))]))])):B.value===`clients`?(u(),l(`div`,ve,[G.value.length===0?(u(),l(`div`,ye,` No authenticated clients `)):(u(),l(`div`,be,[c(`table`,xe,[r[15]||=c(`thead`,null,[c(`tr`,{class:`border-b border-stroke-subtle dark:border-stroke/10`},[c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Client `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Address `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Identity `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Permissions `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Last Activity `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Actions `)])],-1),c(`tbody`,null,[(u(!0),l(s,null,e(G.value,e=>(u(),l(`tr`,{key:e.public_key_full,class:`border-b border-stroke-subtle dark:border-white/5 hover:bg-gray-100/50 dark:hover:bg-white/5 transition-colors`},[c(`td`,Se,[c(`div`,Ce,n(e.public_key),1)]),c(`td`,we,[c(`div`,Te,n(e.address),1)]),c(`td`,Ee,[c(`div`,De,n(e.identity_name),1),c(`div`,z,n(e.identity_hash),1)]),c(`td`,Oe,[c(`span`,{class:a([`px-2 py-1 text-xs font-medium rounded`,e.permissions===`admin`?`bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green`:`bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary`])},n(e.permissions),3)]),c(`td`,ke,[c(`div`,Ae,n(X(e.last_activity)),1)]),c(`td`,je,[c(`button`,{onClick:t=>Y(e.public_key_full,e.identity_hash),class:`px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors`},` Remove `,8,Me)])]))),128))])])]))])):B.value===`identities`?(u(),l(`div`,Ne,[c(`div`,Pe,[r[17]||=c(`label`,{class:`block text-content-secondary dark:text-content-muted text-sm mb-2`},`Filter by Identity`,-1),ee(c(`select`,{"onUpdate:modelValue":r[0]||=e=>q.value=e,class:`bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-cyan-500 dark:focus:border-primary/50 transition-colors`},[r[16]||=c(`option`,{value:null},`All Identities`,-1),(u(!0),l(s,null,e(Q.value,e=>(u(),l(`option`,{key:e.name,value:e.name},n(e.name)+` (`+n(e.authenticated_clients??0)+` clients) `,9,Fe))),128))],512),[[ne,q.value]])]),Z.value.length===0?(u(),l(`div`,Ie,` No clients for selected identity `)):(u(),l(`div`,Le,[(u(!0),l(s,null,e(Z.value,e=>(u(),l(`div`,{key:e.public_key_full,class:`glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10`},[c(`div`,Re,[c(`div`,ze,[c(`div`,Be,[c(`span`,{class:a([`px-2 py-1 text-xs font-medium rounded`,e.permissions===`admin`?`bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green`:`bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary`])},n(e.permissions),3),c(`span`,Ve,n(e.public_key),1)]),c(`div`,He,[c(`div`,null,[r[18]||=c(`span`,{class:`text-content-secondary dark:text-content-muted`},`Address:`,-1),c(`span`,Ue,n(e.address),1)]),c(`div`,null,[r[19]||=c(`span`,{class:`text-content-secondary dark:text-content-muted`},`Identity:`,-1),c(`span`,We,n(e.identity_name)+` (`+n(e.identity_hash)+`)`,1)]),c(`div`,null,[r[20]||=c(`span`,{class:`text-content-secondary dark:text-content-muted`},`Last Activity:`,-1),c(`span`,Ge,n(X(e.last_activity)),1)]),c(`div`,null,[r[21]||=c(`span`,{class:`text-content-secondary dark:text-content-muted`},`Last Login:`,-1),c(`span`,Ke,n(X(e.last_login_success)),1)])])]),c(`button`,{onClick:t=>Y(e.public_key_full,e.identity_hash),class:`ml-4 px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors`},` Remove `,8,qe)])]))),128))]))])):i(``,!0)])]),c(`div`,Je,[c(`button`,{onClick:J,disabled:H.value,class:`px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-primary rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors disabled:opacity-50`},n(H.value?`Refreshing...`:`Refresh Data`),9,Ye)])]))}});export{B as default};
\ No newline at end of file
diff --git a/repeater/web/html/assets/Setup-wQ-fEW9F.js b/repeater/web/html/assets/Setup-Cs8nXwGE.js
similarity index 99%
rename from repeater/web/html/assets/Setup-wQ-fEW9F.js
rename to repeater/web/html/assets/Setup-Cs8nXwGE.js
index 732875d..5d69139 100644
--- a/repeater/web/html/assets/Setup-wQ-fEW9F.js
+++ b/repeater/web/html/assets/Setup-Cs8nXwGE.js
@@ -1 +1 @@
-import{A as e,E as t,S as n,W as r,dt as i,f as a,g as o,j as s,l as c,lt as l,m as u,o as d,p as f,r as p,s as m,u as h,ut as g,w as _,x as v,z as y}from"./runtime-core.esm-bundler-IofF4kUm.js";import{n as b}from"./pinia-BrpcNUEi.js";import{i as x}from"./vue-router-BsDVl_JC.js";import{t as S}from"./_plugin-vue_export-helper-V-yks4gF.js";import{d as C,m as w,s as T,t as ee,u as E}from"./index-CPWfwDmA.js";var te=b(`setup`,()=>{let e=y(1),t=y(5),n=y(`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,`0`)}`),r=y(null),i=y(null),a=y(``),o=y(``),s=y(!1),c=y({frequency:`915.0`,spreading_factor:`7`,bandwidth:`125`,coding_rate:`5`}),l=y([]),u=y([]),f=y(!1),p=y(!1),m=y(null),h=d(()=>{switch(e.value){case 1:return!0;case 2:return n.value.trim().length>0;case 3:return r.value!==null;case 4:return s.value?c.value.frequency&&c.value.spreading_factor&&c.value.bandwidth&&c.value.coding_rate:i.value!==null;case 5:return a.value.length>=6&&a.value===o.value;default:return!1}}),g=d(()=>e.value>1),_=d(()=>e.value===t.value);async function v(){f.value=!0,m.value=null;try{let e=await(await fetch(`/api/hardware_options`)).json();if(e.error)throw Error(e.error);l.value=e.hardware||[]}catch(e){m.value=e instanceof Error?e.message:`Failed to load hardware options`,console.error(`Error fetching hardware options:`,e)}finally{f.value=!1}}async function b(){f.value=!0,m.value=null;try{let e=await(await fetch(`/api/radio_presets`)).json();if(e.error)throw Error(e.error);u.value=e.presets||[]}catch(e){m.value=e instanceof Error?e.message:`Failed to load radio presets`,console.error(`Error fetching radio presets:`,e)}finally{f.value=!1}}async function x(){if(!h.value)return{success:!1,error:`Please complete all required fields`};p.value=!0,m.value=null;try{let e=s.value?{title:`Custom Configuration`,description:`Custom radio settings`,frequency:c.value.frequency,spreading_factor:c.value.spreading_factor,bandwidth:c.value.bandwidth,coding_rate:c.value.coding_rate}:i.value,t=await(await fetch(`/api/setup_wizard`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({node_name:n.value.trim(),hardware_key:r.value?.key,radio_preset:e,admin_password:a.value})})).json();if(!t.success)throw Error(t.error||`Setup failed`);return{success:!0,data:t}}catch(e){let t=e instanceof Error?e.message:`Failed to complete setup`;return m.value=t,{success:!1,error:t}}finally{p.value=!1}}function S(){h.value&&e.value
=1&&n<=t.value&&(e.value=n)}function T(){e.value=1,n.value=`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,`0`)}`,r.value=null,i.value=null,s.value=!1,c.value={frequency:`915.0`,spreading_factor:`7`,bandwidth:`125`,coding_rate:`5`},a.value=``,o.value=``,m.value=null}return{currentStep:e,totalSteps:t,nodeName:n,selectedHardware:r,selectedRadioPreset:i,useCustomRadio:s,customRadio:c,adminPassword:a,confirmPassword:o,hardwareOptions:l,radioPresets:u,isLoading:f,isSubmitting:p,error:m,canGoNext:h,canGoBack:g,isLastStep:_,fetchHardwareOptions:v,fetchRadioPresets:b,completeSetup:x,nextStep:S,previousStep:C,goToStep:w,reset:T}}),ne={class:`min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-center justify-center p-4`},re={class:`absolute top-4 right-4 z-20`},ie={class:`w-full max-w-4xl relative z-10`},ae={class:`mb-8`},oe={class:`flex justify-between mb-2`},se={class:`text-content-secondary dark:text-content-muted text-sm`},ce={class:`text-content-secondary dark:text-content-muted text-sm`},D={class:`h-2 bg-stroke-subtle dark:bg-stroke/10 rounded-full overflow-hidden`},O={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 sm:p-8 md:p-12`},k={class:`flex justify-center mb-8`},A={class:`flex gap-2`},j={class:`mb-8`},M={class:`text-2xl sm:text-3xl font-bold text-content-primary dark:text-content-primary mb-2 text-center`},N={key:0,class:`space-y-6 mt-8`},P={key:1,class:`space-y-6 mt-8`},F={class:`max-w-md mx-auto`},I={key:2,class:`space-y-6 mt-8`},L={key:0,class:`text-center text-content-secondary dark:text-content-muted`},R={key:1,class:`text-center text-content-secondary dark:text-content-muted`},z={key:2,class:`grid grid-cols-1 md:grid-cols-2 gap-4 max-w-3xl mx-auto`},B=[`onClick`],V={class:`font-medium text-content-primary dark:text-content-primary mb-1`},H={class:`text-sm text-content-secondary dark:text-content-muted`},U={key:3,class:`space-y-6 mt-8`},W={key:0,class:`text-center text-content-secondary dark:text-content-muted`},G={key:1,class:`text-center text-content-secondary dark:text-content-muted`},le={key:2,class:`max-w-5xl mx-auto`},ue={class:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4`},de=[`onClick`],fe={class:`relative z-10`},pe={class:`font-medium text-content-primary dark:text-content-primary mb-1 flex items-start justify-between gap-2`},me={class:`flex items-center gap-2`},he={class:`text-2xl`},ge={key:0,class:`text-primary flex-shrink-0`},_e={class:`text-xs text-content-secondary dark:text-content-muted mb-3`},ve={class:`grid grid-cols-2 gap-2 text-xs`},ye={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},be={class:`text-content-primary dark:text-content-primary/80 font-medium`},xe={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},Se={class:`text-content-primary dark:text-content-primary/80 font-medium`},K={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},Ce={class:`text-content-primary dark:text-content-primary/80 font-medium`},we={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},Te={class:`text-content-primary dark:text-content-primary/80 font-medium`},Ee={class:`border-t border-stroke-subtle dark:border-stroke/10 pt-6`},De={class:`flex items-center justify-between mb-2`},Oe={key:0,class:`text-primary`},ke={key:0,class:`mt-4 grid grid-cols-2 gap-4`},Ae={key:4,class:`space-y-6 mt-8`},je={class:`max-w-md mx-auto space-y-4`},Me={key:0,class:`text-red-600 dark:text-red-400 text-sm`},Ne={key:0,class:`mb-6 bg-red-500/10 border border-red-500/30 rounded-lg p-4 text-red-600 dark:text-red-200`},Pe={class:`flex justify-between gap-4`},Fe={key:1},Ie=[`disabled`],Le={key:0,class:`w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin`},Re={key:1},ze={key:2},Be={key:3},Ve={key:4,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},He={class:`flex justify-center mb-6`},Ue={key:0,class:`w-16 h-16 rounded-full bg-green-100 dark:bg-green-500/20 flex items-center justify-center`},We={key:1,class:`w-16 h-16 rounded-full bg-red-100 dark:bg-red-500/20 flex items-center justify-center`},Ge={class:`text-2xl font-bold text-content-primary dark:text-content-primary text-center mb-4`},Ke={class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},q=S(o({name:`SetupView`,__name:`Setup`,setup(o){let b=te(),S=x(),q=y(!1),J=y(``),Y=y(``),X=y(`success`),Z=null,qe=e=>{let t=e.toLowerCase();return t.includes(`australia`)?`🇦🇺`:t.includes(`eu`)||t.includes(`uk`)?`🇪🇺`:t.includes(`czech`)?`🇨🇿`:t.includes(`new zealand`)?`🇳🇿`:t.includes(`portugal`)?`🇵🇹`:t.includes(`switzerland`)?`🇨🇭`:t.includes(`usa`)||t.includes(`canada`)?`🇺🇸`:t.includes(`vietnam`)?`🇻🇳`:`🌍`};n(async()=>{await Promise.all([b.fetchHardwareOptions(),b.fetchRadioPresets()])});let Q=d(()=>b.currentStep/b.totalSteps*100);async function Je(){if(b.isLastStep){let e=await b.completeSetup();e.success?(X.value=`success`,J.value=`Setup Complete!`,Y.value=`Your repeater has been configured successfully. The service is restarting now...`,q.value=!0,Xe()):(X.value=`error`,J.value=`Setup Failed`,Y.value=e.error||`An unknown error occurred`,q.value=!0)}else b.nextStep()}function Ye(){b.previousStep()}function $(){q.value=!1,X.value===`success`&&(Z||S.push(`/login`))}function Xe(){let e=0;function t(){e++,fetch(`/api/status`,{method:`GET`}).then(e=>{e.ok?(Z=null,q.value=!1,S.push(`/login`)):n()}).catch(()=>{n()})}function n(){e<30?Z=setTimeout(t,1e3):(Z=null,q.value=!1,S.push(`/login`))}Z=setTimeout(t,2e3)}v(()=>{Z&&=(clearTimeout(Z),null)});let Ze=[`Welcome`,`Repeater Name`,`Hardware Selection`,`Radio Configuration`,`Security Setup`];return(n,o)=>(_(),h(`div`,ne,[m(`div`,re,[u(ee)]),o[36]||=m(`div`,{class:`bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slow -top-[79px] left-[575px] mix-blend-multiply dark:mix-blend-screen pointer-events-none`},null,-1),o[37]||=m(`div`,{class:`bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-75 animate-pulse-slower -top-[94px] -left-[92px] mix-blend-multiply dark:mix-blend-screen pointer-events-none`},null,-1),o[38]||=m(`div`,{class:`bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slowest top-[373px] left-[246px] mix-blend-multiply dark:mix-blend-screen pointer-events-none`},null,-1),m(`div`,ie,[m(`div`,ae,[m(`div`,oe,[m(`span`,se,`Step `+i(r(b).currentStep)+` of `+i(r(b).totalSteps),1),m(`span`,ce,i(Math.round(Q.value))+`% Complete`,1)]),m(`div`,D,[m(`div`,{class:`h-full bg-gradient-to-r from-primary to-primary/80 transition-all duration-500`,style:g({width:`${Q.value}%`})},null,4)])]),m(`div`,O,[m(`div`,k,[m(`div`,A,[(_(!0),h(p,null,t(r(b).totalSteps,e=>(_(),h(`div`,{key:e,class:l([`w-10 h-10 rounded-full flex items-center justify-center text-sm font-medium transition-all`,e===r(b).currentStep?`bg-primary text-white`:e Welcome to your pyMC Repeater! Let's get you set up in just a few steps.
You'll configure:
Repeater name and identification Hardware board selection Radio frequency and settings Admin password for secure access `,1)]])):r(b).currentStep===2?(_(),h(`div`,P,[o[12]||=m(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Choose a unique name for your repeater. This will be used for identification on the mesh network. `,-1),m(`div`,F,[o[10]||=m(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Repeater Name`,-1),s(m(`input`,{"onUpdate:modelValue":o[0]||=e=>r(b).nodeName=e,type:`text`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent`,placeholder:`e.g., pyRpt0001`,maxlength:`32`},null,512),[[C,r(b).nodeName]]),o[11]||=m(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-2`},` Use letters, numbers, hyphens, or underscores (3-32 characters) `,-1)])])):r(b).currentStep===3?(_(),h(`div`,I,[o[13]||=m(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Select your hardware board type `,-1),r(b).isLoading?(_(),h(`div`,L,` Loading hardware options... `)):r(b).hardwareOptions.length===0?(_(),h(`div`,R,` No hardware options available `)):(_(),h(`div`,z,[(_(!0),h(p,null,t(r(b).hardwareOptions,e=>(_(),h(`button`,{key:e.key,onClick:t=>r(b).selectedHardware=e,class:l([`p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm`,r(b).selectedHardware?.key===e.key?`bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20`:`bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20`])},[m(`div`,V,i(e.name),1),m(`div`,H,i(e.description||e.key),1)],10,B))),128))]))])):r(b).currentStep===4?(_(),h(`div`,U,[o[28]||=m(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Choose a radio configuration preset for your region or create a custom configuration `,-1),r(b).isLoading?(_(),h(`div`,W,` Loading radio presets... `)):r(b).radioPresets.length===0?(_(),h(`div`,G,` No radio presets available `)):(_(),h(`div`,le,[m(`div`,ue,[(_(!0),h(p,null,t(r(b).radioPresets,e=>(_(),h(`button`,{key:e.title,onClick:t=>{r(b).selectedRadioPreset=e,r(b).useCustomRadio=!1},class:l([`p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm relative overflow-hidden`,!r(b).useCustomRadio&&r(b).selectedRadioPreset?.title===e.title?`bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20`:`bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20`])},[m(`div`,fe,[m(`div`,pe,[m(`span`,me,[m(`span`,he,i(qe(e.title)),1),m(`span`,null,i(e.title),1)]),!r(b).useCustomRadio&&r(b).selectedRadioPreset?.title===e.title?(_(),h(`div`,ge,[...o[14]||=[m(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`},[m(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z`,"clip-rule":`evenodd`})],-1)]])):c(``,!0)]),m(`div`,_e,i(e.description),1),m(`div`,ve,[m(`div`,ye,[o[15]||=m(`div`,{class:`text-content-muted dark:text-content-muted`},`Freq`,-1),m(`div`,be,i(e.frequency),1)]),m(`div`,xe,[o[16]||=m(`div`,{class:`text-content-muted dark:text-content-muted`},`BW`,-1),m(`div`,Se,i(e.bandwidth),1)]),m(`div`,K,[o[17]||=m(`div`,{class:`text-content-muted dark:text-content-muted`},`SF`,-1),m(`div`,Ce,i(e.spreading_factor),1)]),m(`div`,we,[o[18]||=m(`div`,{class:`text-content-muted dark:text-content-muted`},`CR`,-1),m(`div`,Te,i(e.coding_rate),1)])])])],10,de))),128))]),m(`div`,Ee,[m(`button`,{onClick:o[1]||=e=>{r(b).useCustomRadio=!r(b).useCustomRadio,r(b).useCustomRadio&&(r(b).selectedRadioPreset=null)},class:l([`w-full p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm`,r(b).useCustomRadio?`bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20`:`bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20`])},[m(`div`,De,[o[20]||=m(`div`,{class:`font-medium text-content-primary dark:text-content-primary flex items-center gap-2`},[m(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[m(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4`})]),f(` Custom Configuration `)],-1),r(b).useCustomRadio?(_(),h(`div`,Oe,[...o[19]||=[m(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`},[m(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z`,"clip-rule":`evenodd`})],-1)]])):c(``,!0)]),o[21]||=m(`div`,{class:`text-xs text-content-secondary dark:text-content-muted`},` Manually configure frequency, bandwidth, spreading factor, and coding rate `,-1)],2),u(T,{name:`slide`},{default:e(()=>[r(b).useCustomRadio?(_(),h(`div`,ke,[m(`div`,null,[o[22]||=m(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Frequency (MHz)`,-1),s(m(`input`,{"onUpdate:modelValue":o[2]||=e=>r(b).customRadio.frequency=e,type:`number`,step:`0.1`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all`,placeholder:`915.0`},null,512),[[C,r(b).customRadio.frequency]])]),m(`div`,null,[o[23]||=m(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Bandwidth (kHz)`,-1),s(m(`input`,{"onUpdate:modelValue":o[3]||=e=>r(b).customRadio.bandwidth=e,type:`number`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all`,placeholder:`125`},null,512),[[C,r(b).customRadio.bandwidth]])]),m(`div`,null,[o[25]||=m(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Spreading Factor`,-1),s(m(`select`,{"onUpdate:modelValue":o[4]||=e=>r(b).customRadio.spreading_factor=e,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all`},[...o[24]||=[m(`option`,{value:`7`},`7`,-1),m(`option`,{value:`8`},`8`,-1),m(`option`,{value:`9`},`9`,-1),m(`option`,{value:`10`},`10`,-1),m(`option`,{value:`11`},`11`,-1),m(`option`,{value:`12`},`12`,-1)]],512),[[E,r(b).customRadio.spreading_factor]])]),m(`div`,null,[o[27]||=m(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Coding Rate`,-1),s(m(`select`,{"onUpdate:modelValue":o[5]||=e=>r(b).customRadio.coding_rate=e,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all`},[...o[26]||=[m(`option`,{value:`5`},`4/5`,-1),m(`option`,{value:`6`},`4/6`,-1),m(`option`,{value:`7`},`4/7`,-1),m(`option`,{value:`8`},`4/8`,-1)]],512),[[E,r(b).customRadio.coding_rate]])])])):c(``,!0)]),_:1})])]))])):r(b).currentStep===5?(_(),h(`div`,Ae,[o[32]||=m(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Set a secure admin password to protect your repeater `,-1),m(`div`,je,[m(`div`,null,[o[29]||=m(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Admin Password`,-1),s(m(`input`,{"onUpdate:modelValue":o[6]||=e=>r(b).adminPassword=e,type:`password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent`,placeholder:`Enter password (min 6 characters)`,minlength:`6`},null,512),[[C,r(b).adminPassword]])]),m(`div`,null,[o[30]||=m(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Confirm Password`,-1),s(m(`input`,{"onUpdate:modelValue":o[7]||=e=>r(b).confirmPassword=e,type:`password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent`,placeholder:`Confirm password`},null,512),[[C,r(b).confirmPassword]])]),r(b).adminPassword&&r(b).confirmPassword&&r(b).adminPassword!==r(b).confirmPassword?(_(),h(`div`,Me,` Passwords do not match `)):c(``,!0),o[31]||=m(`div`,{class:`bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3 text-sm text-yellow-800 dark:text-yellow-200`},[m(`strong`,null,`Important:`),f(` Remember this password - you'll need it to access the dashboard. `)],-1)])])):c(``,!0)]),r(b).error?(_(),h(`div`,Ne,i(r(b).error),1)):c(``,!0),m(`div`,Pe,[r(b).canGoBack?(_(),h(`button`,{key:0,onClick:Ye,class:`px-6 py-3 rounded-[12px] bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 text-content-primary dark:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20 transition-all duration-300 font-medium`},` Back `)):(_(),h(`div`,Fe)),m(`button`,{onClick:Je,disabled:!r(b).canGoNext||r(b).isSubmitting,class:l([`px-8 py-3 rounded-[12px] font-semibold transition-all duration-300 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed`,r(b).canGoNext&&!r(b).isSubmitting?`bg-primary hover:bg-primary/90 text-white border border-primary hover:border-primary/80`:`bg-background-mute dark:bg-stroke/5 text-content-muted dark:text-content-muted border border-stroke-subtle dark:border-stroke/10`])},[r(b).isSubmitting?(_(),h(`div`,Le)):c(``,!0),r(b).isSubmitting?(_(),h(`span`,Re,`Setting up...`)):r(b).isLastStep?(_(),h(`span`,ze,`Complete Setup`)):(_(),h(`span`,Be,`Next`)),!r(b).isSubmitting&&!r(b).isLastStep?(_(),h(`svg`,Ve,[...o[33]||=[m(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 5l7 7-7 7`},null,-1)]])):c(``,!0)],10,Ie)])])]),u(T,{name:`modal`},{default:e(()=>[q.value?(_(),h(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm`,onClick:$},[m(`div`,{class:`bg-white dark:bg-surface-elevated backdrop-blur-xl max-w-md w-full p-8 rounded-[24px] border border-stroke-subtle dark:border-white/20 shadow-[0_8px_32px_0_rgba(0,0,0,0.37)]`,onClick:o[8]||=w(()=>{},[`stop`])},[m(`div`,He,[X.value===`success`?(_(),h(`div`,Ue,[...o[34]||=[m(`svg`,{class:`w-8 h-8 text-green-600 dark:text-green-400`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[m(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 13l4 4L19 7`})],-1)]])):(_(),h(`div`,We,[...o[35]||=[m(`svg`,{class:`w-8 h-8 text-red-600 dark:text-red-400`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[m(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]]))]),m(`h3`,Ge,i(J.value),1),m(`p`,Ke,i(Y.value),1),m(`button`,{onClick:$,class:l([`w-full px-6 py-3 rounded-lg font-medium transition-all`,X.value===`success`?`bg-primary hover:bg-primary/90 text-white`:`bg-accent-red hover:bg-accent-red/90 text-white`])},i(X.value===`success`?`Continue to Login`:`Close`),3)])])):c(``,!0)]),_:1})]))}}),[[`__scopeId`,`data-v-a201f2f2`]]);export{q as default};
\ No newline at end of file
+import{A as e,E as t,S as n,W as r,dt as i,f as a,g as o,j as s,l as c,lt as l,m as u,o as d,p as f,r as p,s as m,u as h,ut as g,w as _,x as v,z as y}from"./runtime-core.esm-bundler-IofF4kUm.js";import{n as b}from"./pinia-BrpcNUEi.js";import{i as x}from"./vue-router-BsDVl_JC.js";import{t as S}from"./_plugin-vue_export-helper-V-yks4gF.js";import{d as C,m as w,s as T,t as ee,u as E}from"./index-BPH8UrxU.js";var te=b(`setup`,()=>{let e=y(1),t=y(5),n=y(`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,`0`)}`),r=y(null),i=y(null),a=y(``),o=y(``),s=y(!1),c=y({frequency:`915.0`,spreading_factor:`7`,bandwidth:`125`,coding_rate:`5`}),l=y([]),u=y([]),f=y(!1),p=y(!1),m=y(null),h=d(()=>{switch(e.value){case 1:return!0;case 2:return n.value.trim().length>0;case 3:return r.value!==null;case 4:return s.value?c.value.frequency&&c.value.spreading_factor&&c.value.bandwidth&&c.value.coding_rate:i.value!==null;case 5:return a.value.length>=6&&a.value===o.value;default:return!1}}),g=d(()=>e.value>1),_=d(()=>e.value===t.value);async function v(){f.value=!0,m.value=null;try{let e=await(await fetch(`/api/hardware_options`)).json();if(e.error)throw Error(e.error);l.value=e.hardware||[]}catch(e){m.value=e instanceof Error?e.message:`Failed to load hardware options`,console.error(`Error fetching hardware options:`,e)}finally{f.value=!1}}async function b(){f.value=!0,m.value=null;try{let e=await(await fetch(`/api/radio_presets`)).json();if(e.error)throw Error(e.error);u.value=e.presets||[]}catch(e){m.value=e instanceof Error?e.message:`Failed to load radio presets`,console.error(`Error fetching radio presets:`,e)}finally{f.value=!1}}async function x(){if(!h.value)return{success:!1,error:`Please complete all required fields`};p.value=!0,m.value=null;try{let e=s.value?{title:`Custom Configuration`,description:`Custom radio settings`,frequency:c.value.frequency,spreading_factor:c.value.spreading_factor,bandwidth:c.value.bandwidth,coding_rate:c.value.coding_rate}:i.value,t=await(await fetch(`/api/setup_wizard`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({node_name:n.value.trim(),hardware_key:r.value?.key,radio_preset:e,admin_password:a.value})})).json();if(!t.success)throw Error(t.error||`Setup failed`);return{success:!0,data:t}}catch(e){let t=e instanceof Error?e.message:`Failed to complete setup`;return m.value=t,{success:!1,error:t}}finally{p.value=!1}}function S(){h.value&&e.value