From 3e3af0864477270714ca88a6a5ac578a3ef37e4e Mon Sep 17 00:00:00 2001 From: mleku Date: Sun, 21 Sep 2025 16:39:45 +0100 Subject: [PATCH] Remove unused JavaScript file `index-wnwvj11w.js` from `dist` directory. - Cleaned up the `app/web/dist/` directory by deleting an unreferenced and outdated build artifact. - Maintained a lean and organized repository structure. --- app/web/dist/{index-wnwvj11w.js => index-tha189jf.js} | 2 +- app/web/dist/index.html | 2 +- app/web/src/App.jsx | 2 +- pkg/version/version | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename app/web/dist/{index-wnwvj11w.js => index-tha189jf.js} (95%) diff --git a/app/web/dist/index-wnwvj11w.js b/app/web/dist/index-tha189jf.js similarity index 95% rename from app/web/dist/index-wnwvj11w.js rename to app/web/dist/index-tha189jf.js index a61bb85..8a5ef54 100644 --- a/app/web/dist/index-wnwvj11w.js +++ b/app/web/dist/index-tha189jf.js @@ -157,4 +157,4 @@ Check the top-level render call using <`+k+">."}return N}}function h(M,N){{if(!M <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; - <%s key={someKey} {...props} />`,C5,D8,l7,D8),a[D8+C5]=!0}}if(M===C1)G0(L1);else v(L1);return L1}}var Q1=J0;YP.Fragment=C1,YP.jsxDEV=Q1})()});var bq=j8(EZ(),1),Dq=j8(jq(),1);var p0=j8(EZ(),1),I=j8(uZ(),1);function zP(){let[e,Z1]=p0.useState(null),[C1,q1]=p0.useState("Ready to authenticate"),[$,F4]=p0.useState("info"),[R0,Z0]=p0.useState(null),[K1,X0]=p0.useState(!1),[F0,l]=p0.useState(!0),[N0,d1]=p0.useState([]),[w4,p4]=p0.useState(!1),[_1,Q0]=p0.useState(0),[B1,q0]=p0.useState(!0),[X1,V0]=p0.useState(null),[z4,W4]=p0.useState([]),[K4,i0]=p0.useState(!1),[I1,$1]=p0.useState(0),[b0,D0]=p0.useState(!0),[A1,$0]=p0.useState(null),[f0,Q8]=p0.useState({});async function G8(_){if(!_||f0[_])return f0[_]||null;try{let h=await V4(_);if(h)return Q8((x)=>({...x,[_]:{name:h.name||`user:${_.slice(0,8)}`,display_name:h.display_name,picture:h.picture,about:h.about}})),h}catch(h){console.log("Error fetching profile for",_.slice(0,8),":",h)}return null}async function O8(_){let x=[...new Set(_.map((v)=>v.author).filter(Boolean))].map((v)=>G8(v));await Promise.allSettled(x)}let[o0,I4]=p0.useState({welcome:!0,exportMine:!1,exportAll:!1,exportSpecific:!1,importEvents:!1,eventsLog:!1,allEventsLog:!1}),h1=p0.useRef(null),E4=p0.useRef(null),[R8,J8]=p0.useState(16);p0.useEffect(()=>{function _(){if(h1.current){let h=h1.current.offsetHeight||0;J8(Math.max(0,Math.round(h/2)))}}return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]),p0.useEffect(()=>{let _=window.matchMedia("(prefers-color-scheme: dark)");X0(_.matches);let h=(x)=>{X0(x.matches)};return _.addEventListener("change",h),()=>{_.removeEventListener("change",h)}},[]),p0.useEffect(()=>{(async()=>{await T1(),l(!1)})()},[]),p0.useEffect(()=>{if(e?.pubkey)j4(e.pubkey)},[e?.pubkey]),p0.useEffect(()=>{if(e?.pubkey){if(S8(!0),e.permission==="admin")D4(!0)}},[e?.pubkey,e?.permission]);function N4(){try{return window.location.protocol.replace("http","ws")+"//"+window.location.host}catch(_){return"ws://localhost:3333"}}async function T1(){try{let h=await(await fetch("/api/auth/status")).json();if(h.authenticated&&h.pubkey)try{let v=await(await fetch(`/api/permissions/${h.pubkey}`)).json();if(v&&v.permission){let G0={pubkey:h.pubkey,permission:v.permission};Z1(G0),G1(`Already authenticated as: ${h.pubkey.slice(0,16)}...`,"success"),j4(h.pubkey)}}catch(x){}}catch(_){}}function G1(_,h="info"){q1(_),F4(h)}function t1(){switch($){case"success":return"mt-5 mb-5 p-3 rounded "+c("bg-green-100 text-green-800","bg-green-900 text-green-100");case"error":return"mt-5 mb-5 p-3 rounded "+c("bg-red-100 text-red-800","bg-red-900 text-red-100");case"info":default:return"mt-5 mb-5 p-3 rounded "+c("bg-cyan-100 text-cyan-800","bg-cyan-900 text-cyan-100")}}async function o4(){try{return(await(await fetch("/api/auth/challenge")).json()).challenge}catch(_){throw G1("Failed to get authentication challenge: "+_.message,"error"),_}}async function P1(){if(!window.nostr){G1("No Nostr extension found. Please install a NIP-07 compatible extension like nos2x or Alby.","error");return}try{G1("Connecting to extension...","info");let _=await window.nostr.getPublicKey(),h=await o4(),x={kind:22242,created_at:Math.floor(Date.now()/1000),tags:[["relay",N4()],["challenge",h]],content:""},v=await window.nostr.signEvent(x);await S1(v)}catch(_){G1("Extension login failed: "+_.message,"error")}}async function V4(_,h=4000){return new Promise((x)=>{let v=!1,G0=[],a;try{a=new WebSocket(N4())}catch(M){x(null);return}let J0="profile-"+Math.random().toString(36).slice(2),Q1=setTimeout(()=>{if(a&&a.readyState===1)try{a.close()}catch(M){}if(!v)v=!0,x(null)},h);a.onopen=()=>{try{let M=["REQ",J0,{kinds:[0],authors:[_]}];a.send(JSON.stringify(M))}catch(M){}},a.onmessage=(M)=>{try{let N=JSON.parse(M.data),k=N[0];if(k==="EVENT"&&N[1]===J0){let p=N[2];if(p&&p.kind===0&&p.content)G0.push(p)}else if(k==="EOSE"&&N[1]===J0){try{a.send(JSON.stringify(["CLOSE",J0]))}catch(p){}try{a.close()}catch(p){}if(clearTimeout(Q1),!v)if(v=!0,G0.length){let p=G0.reduce((E,w0)=>E.created_at>w0.created_at?E:w0);try{let E=JSON.parse(p.content);x(E||null)}catch(E){x(null)}}else x(null)}}catch(N){}},a.onerror=()=>{try{a.close()}catch(M){}if(clearTimeout(Q1),!v)v=!0,x(null)},a.onclose=()=>{if(clearTimeout(Q1),!v)if(v=!0,G0.length){let M=G0.reduce((N,k)=>N.created_at>k.created_at?N:k);try{let N=JSON.parse(M.content);x(N||null)}catch(N){x(null)}}else x(null)}})}async function j4(_){try{let h={name:`user:${_.slice(0,8)}`,about:"No profile data available"};Z0(h);let x=null;try{x=await V4(_)}catch(v){}if(x){let v=typeof x==="string"?JSON.parse(x):x;return Z0({name:v.name||h.name,display_name:v.display_name,picture:v.picture,banner:v.banner,about:v.about||h.about}),v}if(window.nostr&&window.nostr.getPublicKey)try{if(window.nostr.getUserMetadata){let v=await window.nostr.getUserMetadata();if(v)try{let G0=typeof v==="string"?JSON.parse(v):v;return Z0({name:G0.name||h.name,display_name:G0.display_name,picture:G0.picture,banner:G0.banner,about:G0.about||h.about}),G0}catch(G0){console.log("Error parsing user metadata:",G0)}}}catch(v){console.log("Could not get profile from extension:",v)}return h}catch(h){return console.error("Error handling profile data:",h),null}}async function S1(_){try{let x=await(await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)})).json();if(x.success){Z1(x.pubkey),G1("Successfully authenticated as: "+x.pubkey.slice(0,16)+"...","success");let G0=await(await fetch(`/api/permissions/${x.pubkey}`)).json();if(G0&&G0.permission)Z1({pubkey:x.pubkey,permission:G0.permission}),await j4(x.pubkey)}else G1("Authentication failed: "+x.error,"error")}catch(h){G1("Authentication request failed: "+h.message,"error")}}async function M1(){try{await fetch("/api/auth/logout",{method:"POST"})}catch(_){}Z1(null),Z0(null),d1([]),Q0(0),q0(!0),V0(null),W4([]),$1(0),D0(!0),$0(null),G1("Logged out","info")}async function S4(_=!1,h=50,x=1e4){if(!e?.pubkey)return;if(w4)return;if(!_&&!B1)return;return console.log("DEBUG: fetchEventsFromRelay called, reset:",_,"offset:",_1),p4(!0),new Promise((v)=>{let G0=!1,a=[],J0;try{J0=new WebSocket(N4())}catch(N){console.error("Failed to create WebSocket:",N),p4(!1),v();return}let Q1="events-"+Math.random().toString(36).slice(2),M=setTimeout(()=>{if(J0&&J0.readyState===1)try{J0.close()}catch(N){}if(!G0)G0=!0,console.log("DEBUG: WebSocket timeout, received events:",a.length),b4(a,_),v()},x);J0.onopen=()=>{try{let N=["REQ",Q1,{authors:[e.pubkey]}];console.log("DEBUG: Sending WebSocket request:",N),J0.send(JSON.stringify(N))}catch(N){console.error("Failed to send WebSocket request:",N)}},J0.onmessage=(N)=>{try{let k=JSON.parse(N.data),p=k[0];if(console.log("DEBUG: WebSocket message:",p,k.length>2?"with event":""),p==="EVENT"&&k[1]===Q1){let E=k[2];if(E){let w0={id:E.id,kind:E.kind,created_at:E.created_at,content:E.content||"",raw_json:JSON.stringify(E)};a.push(w0)}}else if(p==="EOSE"&&k[1]===Q1){try{J0.send(JSON.stringify(["CLOSE",Q1]))}catch(E){}try{J0.close()}catch(E){}if(clearTimeout(M),!G0)G0=!0,console.log("DEBUG: EOSE received, processing events:",a.length),b4(a,_),v()}}catch(k){console.error("Error parsing WebSocket message:",k)}},J0.onerror=(N)=>{console.error("WebSocket error:",N);try{J0.close()}catch(k){}if(clearTimeout(M),!G0)G0=!0,b4(a,_),v()},J0.onclose=()=>{if(clearTimeout(M),!G0)G0=!0,console.log("DEBUG: WebSocket closed, processing events:",a.length),b4(a,_),v()}})}function b4(_,h){try{let x=_.sort((J0,Q1)=>Q1.created_at-J0.created_at),v=h?0:_1,G0=50,a=x.slice(v,v+50);if(console.log("DEBUG: Processing events - total:",x.length,"paginated:",a.length,"offset:",v),h)d1(a),Q0(a.length);else d1((J0)=>[...J0,...a]),Q0((J0)=>J0+a.length);q0(v+a.length{let G0=!1,a=[],J0;try{J0=new WebSocket(N4())}catch(N){console.error("Failed to create WebSocket:",N),i0(!1),v();return}let Q1="allevents-"+Math.random().toString(36).slice(2),M=setTimeout(()=>{if(J0&&J0.readyState===1)try{J0.close()}catch(N){}if(!G0)G0=!0,console.log("DEBUG: WebSocket timeout, received all events:",a.length),U4(a,_),v()},x);J0.onopen=()=>{try{let N=["REQ",Q1,{}];console.log("DEBUG: Sending WebSocket request for all events:",N),J0.send(JSON.stringify(N))}catch(N){console.error("Failed to send WebSocket request:",N)}},J0.onmessage=(N)=>{try{let k=JSON.parse(N.data),p=k[0];if(console.log("DEBUG: WebSocket message:",p,k.length>2?"with event":""),p==="EVENT"&&k[1]===Q1){let E=k[2];if(E){let w0={id:E.id,kind:E.kind,created_at:E.created_at,content:E.content||"",author:E.pubkey||"",raw_json:JSON.stringify(E)};a.push(w0)}}else if(p==="EOSE"&&k[1]===Q1){try{J0.send(JSON.stringify(["CLOSE",Q1]))}catch(E){}try{J0.close()}catch(E){}if(clearTimeout(M),!G0)G0=!0,console.log("DEBUG: EOSE received, processing all events:",a.length),U4(a,_),v()}}catch(k){console.error("Error parsing WebSocket message:",k)}},J0.onerror=(N)=>{console.error("WebSocket error:",N);try{J0.close()}catch(k){}if(clearTimeout(M),!G0)G0=!0,U4(a,_),v()},J0.onclose=()=>{if(clearTimeout(M),!G0)G0=!0,console.log("DEBUG: WebSocket closed, processing all events:",a.length),U4(a,_),v()}})}function U4(_,h){try{let x=_.sort((J0,Q1)=>Q1.created_at-J0.created_at),v=h?0:I1,G0=50,a=x.slice(v,v+50);if(console.log("DEBUG: Processing all events - total:",x.length,"paginated:",a.length,"offset:",v),h)W4(a),$1(a.length);else W4((J0)=>[...J0,...a]),$1((J0)=>J0+a.length);D0(v+a.lengthh===_?null:_)}function b1(_){$0((h)=>h===_?null:_)}function u4(_){try{navigator.clipboard.writeText(_)}catch(h){let x=document.createElement("textarea");x.value=_,document.body.appendChild(x),x.select(),document.execCommand("copy"),document.body.removeChild(x)}}function y1(_,h=100){if(!_||_.length<=h)return _;return _.substring(0,h)+"..."}function g1(_){return new Date(_*1000).toLocaleString()}function e1(_){I4((h)=>({...h,[_]:!h[_]}))}function A8(){try{E4?.current?.click()}catch(_){}}async function Y8(_){let h=_?.target?.files&&_.target.files[0];if(!h)return;try{G1("Uploading import file...","info");let x=new FormData;x.append("file",h);let v=await fetch("/api/import",{method:"POST",body:x});if(v.ok)G1("Import started. Processing will continue in the background.","success");else{let G0=await v.text();G1("Import failed: "+G0,"error")}}catch(x){G1("Import failed: "+(x?.message||String(x)),"error")}finally{if(_&&_.target)_.target.value=""}}let[m1,u]=p0.useState([{value:""}]);function n(_){if(!_)return!1;let h=String(_).trim();return/^[0-9a-fA-F]{64}$/.test(h)}function U0(_){return String(_||"").trim()}function u0(){u((_)=>[..._,{value:""}])}function e0(_){u((h)=>h.filter((x,v)=>v!==_))}function D1(_,h){let x=U0(h);u((v)=>v.map((G0,a)=>a===_?{value:x}:G0))}function J1(){return m1.map((_)=>U0(_.value)).filter((_)=>_.length>0&&n(_))}function E1(){if(!m1||m1.length===0)return!1;return m1.every((_)=>{let h=U0(_.value);return h.length===64&&n(h)})}function k0(){let _=J1();if(!_.length)return;let h=_.map((x)=>`pubkey=${encodeURIComponent(x)}`).join("&");try{window.location.href=`/api/export?${h}`}catch(x){}}function c(_,h){return K1?h:_}function c1(){return c("bg-gray-200","bg-gray-800")}function B0(){return c("text-gray-700","text-gray-300")}function s4(){return c("bg-gray-100","bg-gray-700")}function l8(){return c("text-gray-500","text-gray-300")}function b8(){return c("hover:text-gray-800","hover:text-gray-100")}if(F0)return null;return I.jsxDEV("div",{className:`min-h-screen ${c("bg-gray-100","bg-gray-900")}`,children:e?.permission?I.jsxDEV(I.Fragment,{children:[I.jsxDEV("div",{className:`sticky top-0 left-0 w-full ${c("bg-gray-100","bg-gray-900")} z-50 h-16 flex items-center overflow-hidden`,children:I.jsxDEV("div",{className:"flex items-center h-full w-full box-border",children:[I.jsxDEV("div",{className:"relative overflow-hidden flex flex-grow items-center justify-start h-full",children:[R0?.banner&&I.jsxDEV("div",{className:"absolute inset-0 opacity-70 bg-cover bg-center",style:{backgroundImage:`url(${R0.banner})`}},void 0,!1,void 0,this),I.jsxDEV("div",{className:"relative z-10 p-2 flex items-center h-full",children:[R0?.picture&&I.jsxDEV("img",{src:R0.picture,alt:"User Avatar",className:`w-8 h-8 rounded-full object-cover border-2 ${c("border-white","border-gray-600")} mr-2 shadow box-border`},void 0,!1,void 0,this),I.jsxDEV("div",{className:B0(),children:[I.jsxDEV("div",{className:"font-bold text-base block",children:[R0?.display_name||R0?.name||e.pubkey.slice(0,8),R0?.name&&R0?.display_name&&` (${R0.name})`]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"font-bold text-lg text-left",children:e.permission==="admin"?"Admin Dashboard":"Subscriber Dashboard"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"flex items-center justify-end shrink-0 h-full",children:I.jsxDEV("button",{className:`bg-transparent ${l8()} border-0 text-2xl cursor-pointer flex items-center justify-center h-full aspect-square shrink-0 hover:bg-transparent ${b8()}`,onClick:M1,children:"✕"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex-grow overflow-y-auto p-4",children:[I.jsxDEV("input",{type:"file",ref:E4,onChange:Y8,accept:".json,.jsonl,text/plain,application/x-ndjson,application/json",style:{display:"none"}},void 0,!1,void 0,this),I.jsxDEV("div",{className:`m-2 p-2 w-full ${c1()} rounded-lg`,children:[I.jsxDEV("div",{className:`text-lg font-bold flex items-center justify-between cursor-pointer p-2 ${B0()} ${c("hover:bg-gray-300","hover:bg-gray-700")} rounded`,onClick:()=>e1("welcome"),children:[I.jsxDEV("span",{children:"Welcome"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-xl",children:o0.welcome?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o0.welcome&&I.jsxDEV("div",{className:"p-2",children:I.jsxDEV("p",{className:B0(),children:"here you can configure all the things"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:`m-2 p-2 ${c1()} rounded-lg w-full`,children:[I.jsxDEV("div",{className:`text-lg font-bold flex items-center justify-between cursor-pointer p-2 ${B0()} ${c("hover:bg-gray-300","hover:bg-gray-700")} rounded`,onClick:()=>e1("exportMine"),children:[I.jsxDEV("span",{children:"Export My Events"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-xl",children:o0.exportMine?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o0.exportMine&&I.jsxDEV("div",{className:"w-full flex items-center justify-end p-2 bg-gray-900 rounded-lg mt-2",children:[I.jsxDEV("div",{className:"pr-2 m-2 w-full",children:I.jsxDEV("p",{className:`text-sm w-full ${B0()}`,children:"Download your own events as line-delimited JSON (JSONL/NDJSON). Only events you authored will be included."},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("button",{className:`${s4()} ${l8()} border-0 text-2xl cursor-pointer flex items-center justify-center h-full aspect-square shrink-0 hover:bg-transparent ${b8()}`,onClick:()=>{window.location.href="/api/export/mine"},"aria-label":"Download my events as JSONL",title:"Download my events",children:"⤓"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),e.permission==="admin"&&I.jsxDEV(I.Fragment,{children:[I.jsxDEV("div",{className:`m-2 p-2 ${c1()} rounded-lg w-full`,children:[I.jsxDEV("div",{className:`text-lg font-bold flex items-center justify-between cursor-pointer p-2 ${B0()} ${c("hover:bg-gray-300","hover:bg-gray-700")} rounded`,onClick:()=>e1("exportAll"),children:[I.jsxDEV("span",{children:"Export All Events (admin)"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-xl",children:o0.exportAll?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o0.exportAll&&I.jsxDEV("div",{className:"flex items-center justify-between p-2 m-4 bg-gray-900 round mt-2",children:[I.jsxDEV("div",{className:"pr-2 w-full",children:I.jsxDEV("p",{className:`text-sm ${B0()}`,children:"Download all stored events as line-delimited JSON (JSONL/NDJSON). This may take a while on large databases."},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("button",{className:`${s4()} ${l8()} border-0 text-2xl cursor-pointer flex m-2 items-center justify-center h-full aspect-square shrink-0 hover:bg-transparent ${b8()}`,onClick:()=>{window.location.href="/api/export"},"aria-label":"Download all events as JSONL",title:"Download all events",children:"⤓"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:`m-2 p-2 ${c1()} rounded-lg w-full`,children:[I.jsxDEV("div",{className:`text-lg font-bold flex items-center justify-between cursor-pointer p-2 ${B0()} ${c("hover:bg-gray-300","hover:bg-gray-700")} rounded`,onClick:()=>e1("exportSpecific"),children:[I.jsxDEV("span",{children:"Export Specific Pubkeys (admin)"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-xl",children:o0.exportSpecific?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o0.exportSpecific&&I.jsxDEV("div",{className:"w-full flex items-start justify-between gap-4 m-2 p-2 bg-gray-900 rounded-lg mt-2",children:I.jsxDEV("div",{className:"flex-1 pr-2 w-full",children:[I.jsxDEV("p",{className:`text-sm ${B0()}`,children:"Enter one or more author pubkeys (64-character hex). Only valid entries will be exported."},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex flex-col items-end gap-2 self-end justify-end p-2",children:I.jsxDEV("button",{className:`${s4()} ${B0()} text-base p-4 rounded m-2 ${c("hover:bg-gray-200","hover:bg-gray-600")}`,onClick:u0,title:"Add another pubkey",type:"button",children:"+ Add"},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex flex-col items-end gap-2 min-w-[320px] justify-end p-2",children:I.jsxDEV("div",{className:"gap-2 justify-end",children:m1.map((_,h)=>{let x=(_?.value||"").trim(),v=x.length===0?!0:n(x);return I.jsxDEV("div",{className:"flex items-center gap-2 ",children:[I.jsxDEV("input",{type:"text",inputMode:"text",autoComplete:"off",spellCheck:"false",className:`flex-1 text-sm px-2 py-1 border rounded outline-none ${v?c("border-gray-300 bg-white text-gray-900 focus:ring-2 focus:ring-blue-200","border-gray-600 bg-gray-700 text-gray-100 focus:ring-2 focus:ring-blue-500"):c("border-red-500 bg-red-50 text-red-800","border-red-700 bg-red-900 text-red-200")}`,placeholder:"e.g., 64-hex pubkey",value:x,onChange:(G0)=>D1(h,G0.target.value)},void 0,!1,void 0,this),I.jsxDEV("button",{className:`${s4()} ${B0()} px-2 py-1 rounded ${c("hover:bg-gray-200","hover:bg-gray-600")}`,onClick:()=>e0(h),title:"Remove this pubkey",type:"button",children:"✕"},void 0,!1,void 0,this)]},h,!0,void 0,this)})},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex justify-end items-end gap-2 self-end",children:I.jsxDEV("button",{className:`${c("bg-blue-600","bg-blue-500")} text-white px-3 py-1 rounded disabled:opacity-50 disabled:cursor-not-allowed ${E1()?c("hover:bg-blue-700","hover:bg-blue-600"):""}`,onClick:k0,disabled:!E1(),title:E1()?"Download events for specified pubkeys":"Enter a valid 64-character hex pubkey in every field",type:"button",children:"Export"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:`m-2 p-2 ${c1()} rounded-lg w-full`,children:[I.jsxDEV("div",{className:`text-lg font-bold flex items-center justify-between cursor-pointer p-2 ${B0()} ${c("hover:bg-gray-300","hover:bg-gray-700")} rounded`,onClick:()=>e1("importEvents"),children:[I.jsxDEV("span",{children:"Import Events (admin)"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-xl",children:o0.importEvents?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o0.importEvents&&I.jsxDEV("div",{className:"flex items-center justify-between p-2 bg-gray-900 rounded-lg mt-2",children:[I.jsxDEV("div",{className:"pr-2 w-full",children:I.jsxDEV("p",{className:`text-sm ${B0()}`,children:"Upload events in line-delimited JSON (JSONL/NDJSON) to import into the database."},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("button",{className:`${s4()} ${l8()} border-0 text-2xl cursor-pointer flex items-center justify-center h-full aspect-square shrink-0 hover:bg-transparent ${b8()}`,onClick:A8,"aria-label":"Import events from JSONL",title:"Import events",children:"↥"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:`m-2 p-2 ${c1()} rounded-lg w-full`,children:[I.jsxDEV("div",{className:`text-lg font-bold flex items-center justify-between cursor-pointer p-2 ${B0()} ${c("hover:bg-gray-300","hover:bg-gray-700")} rounded`,onClick:()=>e1("eventsLog"),children:[I.jsxDEV("span",{children:"My Events Log"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-xl",children:o0.eventsLog?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o0.eventsLog&&I.jsxDEV("div",{className:"p-2 bg-gray-900 rounded-lg mt-2",children:[I.jsxDEV("div",{className:"mb-4",children:I.jsxDEV("p",{className:`text-sm ${B0()}`,children:"View all your events in reverse chronological order. Click on any event to view its raw JSON."},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("div",{className:"block",style:{position:"relative"},children:N0.length===0&&!w4?I.jsxDEV("div",{className:`text-center py-4 ${B0()}`,children:"No events found"},void 0,!1,void 0,this):I.jsxDEV("div",{className:"space-y-2",children:[N0.map((_)=>I.jsxDEV("div",{className:`border rounded p-3 ${c("border-gray-300 bg-white","border-gray-600 bg-gray-800")}`,children:[I.jsxDEV("div",{className:"cursor-pointer",onClick:()=>f4(_.id),children:[I.jsxDEV("div",{className:"flex items-center justify-between",children:[I.jsxDEV("div",{className:"flex items-center gap-3",children:[I.jsxDEV("span",{className:`font-mono text-sm px-2 py-1 rounded ${c("bg-blue-100 text-blue-800","bg-blue-900 text-blue-200")}`,children:["Kind ",_.kind]},void 0,!0,void 0,this),I.jsxDEV("span",{className:`text-sm ${B0()}`,children:g1(_.created_at)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("span",{className:`text-lg ${B0()}`,children:X1===_.id?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_.content&&I.jsxDEV("div",{className:`mt-2 text-sm ${B0()}`,children:y1(_.content)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X1===_.id&&I.jsxDEV("div",{className:"mt-3 border-t pt-3",children:[I.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[I.jsxDEV("span",{className:`text-sm font-medium ${B0()}`,children:"Raw JSON:"},void 0,!1,void 0,this),I.jsxDEV("button",{className:`${c("bg-green-600 hover:bg-green-700","bg-green-500 hover:bg-green-600")} text-white text-xs px-2 py-1 rounded`,onClick:(h)=>{h.stopPropagation(),u4(_.raw_json)},title:"Copy minified JSON",children:"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("pre",{className:`text-xs p-2 rounded overflow-auto max-h-40 break-all whitespace-pre-wrap ${c1()} ${B0()}`,children:JSON.stringify(JSON.parse(_.raw_json),null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},_.id,!0,void 0,this)),w4&&I.jsxDEV("div",{className:`text-center py-4 ${B0()}`,children:I.jsxDEV("div",{className:"text-sm",children:"Loading more events..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),!w4&&B1&&I.jsxDEV("div",{className:"text-center py-4",children:I.jsxDEV("button",{className:`${c("bg-blue-600 hover:bg-blue-700","bg-blue-500 hover:bg-blue-600")} text-white px-4 py-2 rounded`,onClick:()=>S8(!1),children:"Load More"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),e.permission==="admin"&&I.jsxDEV("div",{className:`m-2 p-2 ${c1()} rounded-lg w-full`,children:[I.jsxDEV("div",{className:`text-lg font-bold flex items-center justify-between cursor-pointer p-2 ${B0()} ${c("hover:bg-gray-300","hover:bg-gray-700")} rounded`,onClick:()=>e1("allEventsLog"),children:[I.jsxDEV("span",{children:"All Events Log (admin)"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-xl",children:o0.allEventsLog?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o0.allEventsLog&&I.jsxDEV("div",{className:"p-2 bg-gray-900 rounded-lg mt-2",children:[I.jsxDEV("div",{className:"mb-4",children:I.jsxDEV("p",{className:`text-sm ${B0()}`,children:"View all events from all users in reverse chronological order. Click on any event to view its raw JSON."},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("div",{className:"block",style:{position:"relative"},children:z4.length===0&&!K4?I.jsxDEV("div",{className:`text-center py-4 ${B0()}`,children:"No events found"},void 0,!1,void 0,this):I.jsxDEV("div",{className:"space-y-2",children:[z4.map((_)=>I.jsxDEV("div",{className:`border rounded p-3 ${c("border-gray-300 bg-white","border-gray-600 bg-gray-800")}`,children:[I.jsxDEV("div",{className:"cursor-pointer",onClick:()=>b1(_.id),children:[I.jsxDEV("div",{className:"flex items-center justify-between",children:[I.jsxDEV("div",{className:"flex items-center gap-6",children:[I.jsxDEV("div",{className:"flex items-center gap-3 min-w-0",children:[_.author&&f0[_.author]&&I.jsxDEV(I.Fragment,{children:[f0[_.author].picture&&I.jsxDEV("img",{src:f0[_.author].picture,alt:f0[_.author].display_name||f0[_.author].name||"User avatar",className:`w-8 h-8 rounded-full object-cover border h-16 ${c("border-gray-300","border-gray-600")}`,onError:(h)=>{h.currentTarget.style.display="none"}},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex flex-col min-w-0",children:[I.jsxDEV("span",{className:`text-sm font-medium ${B0()}`,children:f0[_.author].display_name||f0[_.author].name||`${_.author.slice(0,8)}...`},void 0,!1,void 0,this),f0[_.author].display_name&&f0[_.author].name&&I.jsxDEV("span",{className:`text-xs ${B0()} opacity-70`,children:f0[_.author].name},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_.author&&!f0[_.author]&&I.jsxDEV("span",{className:`text-sm font-medium ${B0()}`,children:`${_.author.slice(0,8)}...`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"flex items-center gap-3",children:[I.jsxDEV("span",{className:`font-mono text-sm px-2 py-1 rounded ${c("bg-blue-100 text-blue-800","bg-blue-900 text-blue-200")}`,children:["Kind ",_.kind]},void 0,!0,void 0,this),I.jsxDEV("span",{className:`text-sm ${B0()}`,children:g1(_.created_at)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("span",{className:`text-lg ${B0()}`,children:A1===_.id?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_.content&&I.jsxDEV("div",{className:`mt-2 text-sm ${B0()}`,children:y1(_.content)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A1===_.id&&I.jsxDEV("div",{className:"mt-3 border-t pt-3",children:[I.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[I.jsxDEV("span",{className:`text-sm font-medium ${B0()}`,children:"Raw JSON:"},void 0,!1,void 0,this),I.jsxDEV("button",{className:`${c("bg-green-600 hover:bg-green-700","bg-green-500 hover:bg-green-600")} text-white text-xs px-2 py-1 rounded`,onClick:(h)=>{h.stopPropagation(),u4(_.raw_json)},title:"Copy minified JSON",children:"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("pre",{className:`text-xs p-2 rounded overflow-auto max-h-40 break-all whitespace-pre-wrap ${c1()} ${B0()}`,children:JSON.stringify(JSON.parse(_.raw_json),null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},_.id,!0,void 0,this)),K4&&I.jsxDEV("div",{className:`text-center py-4 ${B0()}`,children:I.jsxDEV("div",{className:"text-sm",children:"Loading more events..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),!K4&&b0&&I.jsxDEV("div",{className:"text-center py-4",children:I.jsxDEV("button",{className:`${c("bg-blue-600 hover:bg-blue-700","bg-blue-500 hover:bg-blue-600")} text-white px-4 py-2 rounded`,onClick:()=>D4(!1),children:"Load More"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:`flex-grow ${c("bg-gray-100","bg-gray-900")}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):I.jsxDEV("div",{className:"w-full h-full flex items-center justify-center",children:I.jsxDEV("div",{className:c("bg-gray-100","bg-gray-900"),style:{width:"800px",maxWidth:"100%",boxSizing:"border-box",padding:`${R8}px`},children:[I.jsxDEV("div",{className:"flex items-center gap-3 mb-3",children:[I.jsxDEV("img",{src:"/orly.png",alt:"Orly logo",className:"object-contain",style:{width:"4rem",height:"4rem"},onError:(_)=>{_.currentTarget.onerror=null,_.currentTarget.src="/docs/orly.png"}},void 0,!1,void 0,this),I.jsxDEV("h1",{ref:h1,className:`text-2xl font-bold p-2 ${B0()}`,children:"ORLY\uD83E\uDD89 Dashboard Login"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("p",{className:`mb-4 ${B0()}`,children:"Authenticate to this Nostr relay using your browser extension."},void 0,!1,void 0,this),I.jsxDEV("div",{className:t1(),children:C1},void 0,!1,void 0,this),I.jsxDEV("div",{className:"mb-5",children:I.jsxDEV("button",{className:`${c("bg-blue-600","bg-blue-500")} text-white px-5 py-3 rounded ${c("hover:bg-blue-700","hover:bg-blue-600")}`,onClick:P1,children:"Login with Browser Extension (NIP-07)"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var Sq=zP;var Bz=j8(uZ(),1),WP=Dq.createRoot(document.getElementById("root"));WP.render(Bz.jsxDEV(bq.default.StrictMode,{children:Bz.jsxDEV(Sq,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)); + <%s key={someKey} {...props} />`,C5,D8,l7,D8),a[D8+C5]=!0}}if(M===C1)G0(L1);else v(L1);return L1}}var Q1=J0;YP.Fragment=C1,YP.jsxDEV=Q1})()});var bq=j8(EZ(),1),Dq=j8(jq(),1);var p0=j8(EZ(),1),I=j8(uZ(),1);function zP(){let[e,Z1]=p0.useState(null),[C1,q1]=p0.useState("Ready to authenticate"),[$,F4]=p0.useState("info"),[R0,Z0]=p0.useState(null),[K1,X0]=p0.useState(!1),[F0,l]=p0.useState(!0),[N0,d1]=p0.useState([]),[w4,p4]=p0.useState(!1),[_1,Q0]=p0.useState(0),[B1,q0]=p0.useState(!0),[X1,V0]=p0.useState(null),[z4,W4]=p0.useState([]),[K4,i0]=p0.useState(!1),[I1,$1]=p0.useState(0),[b0,D0]=p0.useState(!0),[A1,$0]=p0.useState(null),[f0,Q8]=p0.useState({});async function G8(_){if(!_||f0[_])return f0[_]||null;try{let h=await V4(_);if(h)return Q8((x)=>({...x,[_]:{name:h.name||`user:${_.slice(0,8)}`,display_name:h.display_name,picture:h.picture,about:h.about}})),h}catch(h){console.log("Error fetching profile for",_.slice(0,8),":",h)}return null}async function O8(_){let x=[...new Set(_.map((v)=>v.author).filter(Boolean))].map((v)=>G8(v));await Promise.allSettled(x)}let[o0,I4]=p0.useState({welcome:!0,exportMine:!1,exportAll:!1,exportSpecific:!1,importEvents:!1,eventsLog:!1,allEventsLog:!1}),h1=p0.useRef(null),E4=p0.useRef(null),[R8,J8]=p0.useState(16);p0.useEffect(()=>{function _(){if(h1.current){let h=h1.current.offsetHeight||0;J8(Math.max(0,Math.round(h/2)))}}return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]),p0.useEffect(()=>{let _=window.matchMedia("(prefers-color-scheme: dark)");X0(_.matches);let h=(x)=>{X0(x.matches)};return _.addEventListener("change",h),()=>{_.removeEventListener("change",h)}},[]),p0.useEffect(()=>{(async()=>{await T1(),l(!1)})()},[]),p0.useEffect(()=>{if(e?.pubkey)j4(e.pubkey)},[e?.pubkey]),p0.useEffect(()=>{if(e?.pubkey){if(S8(!0),e.permission==="admin")D4(!0)}},[e?.pubkey,e?.permission]);function N4(){try{return window.location.protocol.replace("http","ws")+"//"+window.location.host}catch(_){return"ws://localhost:3333"}}async function T1(){try{let h=await(await fetch("/api/auth/status")).json();if(h.authenticated&&h.pubkey)try{let v=await(await fetch(`/api/permissions/${h.pubkey}`)).json();if(v&&v.permission){let G0={pubkey:h.pubkey,permission:v.permission};Z1(G0),G1(`Already authenticated as: ${h.pubkey.slice(0,16)}...`,"success"),j4(h.pubkey)}}catch(x){}}catch(_){}}function G1(_,h="info"){q1(_),F4(h)}function t1(){switch($){case"success":return"mt-5 mb-5 p-3 rounded "+c("bg-green-100 text-green-800","bg-green-900 text-green-100");case"error":return"mt-5 mb-5 p-3 rounded "+c("bg-red-100 text-red-800","bg-red-900 text-red-100");case"info":default:return"mt-5 mb-5 p-3 rounded "+c("bg-cyan-100 text-cyan-800","bg-cyan-900 text-cyan-100")}}async function o4(){try{return(await(await fetch("/api/auth/challenge")).json()).challenge}catch(_){throw G1("Failed to get authentication challenge: "+_.message,"error"),_}}async function P1(){if(!window.nostr){G1("No Nostr extension found. Please install a NIP-07 compatible extension like nos2x or Alby.","error");return}try{G1("Connecting to extension...","info");let _=await window.nostr.getPublicKey(),h=await o4(),x={kind:22242,created_at:Math.floor(Date.now()/1000),tags:[["relay",N4()],["challenge",h]],content:""},v=await window.nostr.signEvent(x);await S1(v)}catch(_){G1("Extension login failed: "+_.message,"error")}}async function V4(_,h=4000){return new Promise((x)=>{let v=!1,G0=[],a;try{a=new WebSocket(N4())}catch(M){x(null);return}let J0="profile-"+Math.random().toString(36).slice(2),Q1=setTimeout(()=>{if(a&&a.readyState===1)try{a.close()}catch(M){}if(!v)v=!0,x(null)},h);a.onopen=()=>{try{let M=["REQ",J0,{kinds:[0],authors:[_]}];a.send(JSON.stringify(M))}catch(M){}},a.onmessage=(M)=>{try{let N=JSON.parse(M.data),k=N[0];if(k==="EVENT"&&N[1]===J0){let p=N[2];if(p&&p.kind===0&&p.content)G0.push(p)}else if(k==="EOSE"&&N[1]===J0){try{a.send(JSON.stringify(["CLOSE",J0]))}catch(p){}try{a.close()}catch(p){}if(clearTimeout(Q1),!v)if(v=!0,G0.length){let p=G0.reduce((E,w0)=>E.created_at>w0.created_at?E:w0);try{let E=JSON.parse(p.content);x(E||null)}catch(E){x(null)}}else x(null)}}catch(N){}},a.onerror=()=>{try{a.close()}catch(M){}if(clearTimeout(Q1),!v)v=!0,x(null)},a.onclose=()=>{if(clearTimeout(Q1),!v)if(v=!0,G0.length){let M=G0.reduce((N,k)=>N.created_at>k.created_at?N:k);try{let N=JSON.parse(M.content);x(N||null)}catch(N){x(null)}}else x(null)}})}async function j4(_){try{let h={name:`user:${_.slice(0,8)}`,about:"No profile data available"};Z0(h);let x=null;try{x=await V4(_)}catch(v){}if(x){let v=typeof x==="string"?JSON.parse(x):x;return Z0({name:v.name||h.name,display_name:v.display_name,picture:v.picture,banner:v.banner,about:v.about||h.about}),v}if(window.nostr&&window.nostr.getPublicKey)try{if(window.nostr.getUserMetadata){let v=await window.nostr.getUserMetadata();if(v)try{let G0=typeof v==="string"?JSON.parse(v):v;return Z0({name:G0.name||h.name,display_name:G0.display_name,picture:G0.picture,banner:G0.banner,about:G0.about||h.about}),G0}catch(G0){console.log("Error parsing user metadata:",G0)}}}catch(v){console.log("Could not get profile from extension:",v)}return h}catch(h){return console.error("Error handling profile data:",h),null}}async function S1(_){try{let x=await(await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)})).json();if(x.success){Z1(x.pubkey),G1("Successfully authenticated as: "+x.pubkey.slice(0,16)+"...","success");let G0=await(await fetch(`/api/permissions/${x.pubkey}`)).json();if(G0&&G0.permission)Z1({pubkey:x.pubkey,permission:G0.permission}),await j4(x.pubkey)}else G1("Authentication failed: "+x.error,"error")}catch(h){G1("Authentication request failed: "+h.message,"error")}}async function M1(){try{await fetch("/api/auth/logout",{method:"POST"})}catch(_){}Z1(null),Z0(null),d1([]),Q0(0),q0(!0),V0(null),W4([]),$1(0),D0(!0),$0(null),G1("Logged out","info")}async function S4(_=!1,h=50,x=1e4){if(!e?.pubkey)return;if(w4)return;if(!_&&!B1)return;return console.log("DEBUG: fetchEventsFromRelay called, reset:",_,"offset:",_1),p4(!0),new Promise((v)=>{let G0=!1,a=[],J0;try{J0=new WebSocket(N4())}catch(N){console.error("Failed to create WebSocket:",N),p4(!1),v();return}let Q1="events-"+Math.random().toString(36).slice(2),M=setTimeout(()=>{if(J0&&J0.readyState===1)try{J0.close()}catch(N){}if(!G0)G0=!0,console.log("DEBUG: WebSocket timeout, received events:",a.length),b4(a,_),v()},x);J0.onopen=()=>{try{let N=["REQ",Q1,{authors:[e.pubkey]}];console.log("DEBUG: Sending WebSocket request:",N),J0.send(JSON.stringify(N))}catch(N){console.error("Failed to send WebSocket request:",N)}},J0.onmessage=(N)=>{try{let k=JSON.parse(N.data),p=k[0];if(console.log("DEBUG: WebSocket message:",p,k.length>2?"with event":""),p==="EVENT"&&k[1]===Q1){let E=k[2];if(E){let w0={id:E.id,kind:E.kind,created_at:E.created_at,content:E.content||"",raw_json:JSON.stringify(E)};a.push(w0)}}else if(p==="EOSE"&&k[1]===Q1){try{J0.send(JSON.stringify(["CLOSE",Q1]))}catch(E){}try{J0.close()}catch(E){}if(clearTimeout(M),!G0)G0=!0,console.log("DEBUG: EOSE received, processing events:",a.length),b4(a,_),v()}}catch(k){console.error("Error parsing WebSocket message:",k)}},J0.onerror=(N)=>{console.error("WebSocket error:",N);try{J0.close()}catch(k){}if(clearTimeout(M),!G0)G0=!0,b4(a,_),v()},J0.onclose=()=>{if(clearTimeout(M),!G0)G0=!0,console.log("DEBUG: WebSocket closed, processing events:",a.length),b4(a,_),v()}})}function b4(_,h){try{let x=_.sort((J0,Q1)=>Q1.created_at-J0.created_at),v=h?0:_1,G0=50,a=x.slice(v,v+50);if(console.log("DEBUG: Processing events - total:",x.length,"paginated:",a.length,"offset:",v),h)d1(a),Q0(a.length);else d1((J0)=>[...J0,...a]),Q0((J0)=>J0+a.length);q0(v+a.length{let G0=!1,a=[],J0;try{J0=new WebSocket(N4())}catch(N){console.error("Failed to create WebSocket:",N),i0(!1),v();return}let Q1="allevents-"+Math.random().toString(36).slice(2),M=setTimeout(()=>{if(J0&&J0.readyState===1)try{J0.close()}catch(N){}if(!G0)G0=!0,console.log("DEBUG: WebSocket timeout, received all events:",a.length),U4(a,_),v()},x);J0.onopen=()=>{try{let N=["REQ",Q1,{}];console.log("DEBUG: Sending WebSocket request for all events:",N),J0.send(JSON.stringify(N))}catch(N){console.error("Failed to send WebSocket request:",N)}},J0.onmessage=(N)=>{try{let k=JSON.parse(N.data),p=k[0];if(console.log("DEBUG: WebSocket message:",p,k.length>2?"with event":""),p==="EVENT"&&k[1]===Q1){let E=k[2];if(E){let w0={id:E.id,kind:E.kind,created_at:E.created_at,content:E.content||"",author:E.pubkey||"",raw_json:JSON.stringify(E)};a.push(w0)}}else if(p==="EOSE"&&k[1]===Q1){try{J0.send(JSON.stringify(["CLOSE",Q1]))}catch(E){}try{J0.close()}catch(E){}if(clearTimeout(M),!G0)G0=!0,console.log("DEBUG: EOSE received, processing all events:",a.length),U4(a,_),v()}}catch(k){console.error("Error parsing WebSocket message:",k)}},J0.onerror=(N)=>{console.error("WebSocket error:",N);try{J0.close()}catch(k){}if(clearTimeout(M),!G0)G0=!0,U4(a,_),v()},J0.onclose=()=>{if(clearTimeout(M),!G0)G0=!0,console.log("DEBUG: WebSocket closed, processing all events:",a.length),U4(a,_),v()}})}function U4(_,h){try{let x=_.sort((J0,Q1)=>Q1.created_at-J0.created_at),v=h?0:I1,G0=50,a=x.slice(v,v+50);if(console.log("DEBUG: Processing all events - total:",x.length,"paginated:",a.length,"offset:",v),h)W4(a),$1(a.length);else W4((J0)=>[...J0,...a]),$1((J0)=>J0+a.length);D0(v+a.lengthh===_?null:_)}function b1(_){$0((h)=>h===_?null:_)}function u4(_){try{navigator.clipboard.writeText(_)}catch(h){let x=document.createElement("textarea");x.value=_,document.body.appendChild(x),x.select(),document.execCommand("copy"),document.body.removeChild(x)}}function y1(_,h=100){if(!_||_.length<=h)return _;return _.substring(0,h)+"..."}function g1(_){return new Date(_*1000).toLocaleString()}function e1(_){I4((h)=>({...h,[_]:!h[_]}))}function A8(){try{E4?.current?.click()}catch(_){}}async function Y8(_){let h=_?.target?.files&&_.target.files[0];if(!h)return;try{G1("Uploading import file...","info");let x=new FormData;x.append("file",h);let v=await fetch("/api/import",{method:"POST",body:x});if(v.ok)G1("Import started. Processing will continue in the background.","success");else{let G0=await v.text();G1("Import failed: "+G0,"error")}}catch(x){G1("Import failed: "+(x?.message||String(x)),"error")}finally{if(_&&_.target)_.target.value=""}}let[m1,u]=p0.useState([{value:""}]);function n(_){if(!_)return!1;let h=String(_).trim();return/^[0-9a-fA-F]{64}$/.test(h)}function U0(_){return String(_||"").trim()}function u0(){u((_)=>[..._,{value:""}])}function e0(_){u((h)=>h.filter((x,v)=>v!==_))}function D1(_,h){let x=U0(h);u((v)=>v.map((G0,a)=>a===_?{value:x}:G0))}function J1(){return m1.map((_)=>U0(_.value)).filter((_)=>_.length>0&&n(_))}function E1(){if(!m1||m1.length===0)return!1;return m1.every((_)=>{let h=U0(_.value);return h.length===64&&n(h)})}function k0(){let _=J1();if(!_.length)return;let h=_.map((x)=>`pubkey=${encodeURIComponent(x)}`).join("&");try{window.location.href=`/api/export?${h}`}catch(x){}}function c(_,h){return K1?h:_}function c1(){return c("bg-gray-200","bg-gray-800")}function B0(){return c("text-gray-700","text-gray-300")}function s4(){return c("bg-gray-100","bg-gray-700")}function l8(){return c("text-gray-500","text-gray-300")}function b8(){return c("hover:text-gray-800","hover:text-gray-100")}if(F0)return null;return I.jsxDEV("div",{className:`min-h-screen ${c("bg-gray-100","bg-gray-900")}`,children:e?.permission?I.jsxDEV(I.Fragment,{children:[I.jsxDEV("div",{className:`sticky top-0 left-0 w-full ${c("bg-gray-100","bg-gray-900")} z-50 h-16 flex items-center overflow-hidden`,children:I.jsxDEV("div",{className:"flex items-center h-full w-full box-border",children:[I.jsxDEV("div",{className:"relative overflow-hidden flex flex-grow items-center justify-start h-full",children:[R0?.banner&&I.jsxDEV("div",{className:"absolute inset-0 opacity-70 bg-cover bg-center",style:{backgroundImage:`url(${R0.banner})`}},void 0,!1,void 0,this),I.jsxDEV("div",{className:"relative z-10 p-2 flex items-center h-full",children:[R0?.picture&&I.jsxDEV("img",{src:R0.picture,alt:"User Avatar",className:`w-16 h-16 rounded-full object-cover border-2 ${c("border-white","border-gray-600")} mr-2 shadow box-border`},void 0,!1,void 0,this),I.jsxDEV("div",{className:B0(),children:[I.jsxDEV("div",{className:"font-bold text-base block",children:[R0?.display_name||R0?.name||e.pubkey.slice(0,8),R0?.name&&R0?.display_name&&` (${R0.name})`]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"font-bold text-lg text-left",children:e.permission==="admin"?"Admin Dashboard":"Subscriber Dashboard"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"flex items-center justify-end shrink-0 h-full",children:I.jsxDEV("button",{className:`bg-transparent ${l8()} border-0 text-2xl cursor-pointer flex items-center justify-center h-full aspect-square shrink-0 hover:bg-transparent ${b8()}`,onClick:M1,children:"✕"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex-grow overflow-y-auto p-4",children:[I.jsxDEV("input",{type:"file",ref:E4,onChange:Y8,accept:".json,.jsonl,text/plain,application/x-ndjson,application/json",style:{display:"none"}},void 0,!1,void 0,this),I.jsxDEV("div",{className:`m-2 p-2 w-full ${c1()} rounded-lg`,children:[I.jsxDEV("div",{className:`text-lg font-bold flex items-center justify-between cursor-pointer p-2 ${B0()} ${c("hover:bg-gray-300","hover:bg-gray-700")} rounded`,onClick:()=>e1("welcome"),children:[I.jsxDEV("span",{children:"Welcome"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-xl",children:o0.welcome?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o0.welcome&&I.jsxDEV("div",{className:"p-2",children:I.jsxDEV("p",{className:B0(),children:"here you can configure all the things"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:`m-2 p-2 ${c1()} rounded-lg w-full`,children:[I.jsxDEV("div",{className:`text-lg font-bold flex items-center justify-between cursor-pointer p-2 ${B0()} ${c("hover:bg-gray-300","hover:bg-gray-700")} rounded`,onClick:()=>e1("exportMine"),children:[I.jsxDEV("span",{children:"Export My Events"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-xl",children:o0.exportMine?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o0.exportMine&&I.jsxDEV("div",{className:"w-full flex items-center justify-end p-2 bg-gray-900 rounded-lg mt-2",children:[I.jsxDEV("div",{className:"pr-2 m-2 w-full",children:I.jsxDEV("p",{className:`text-sm w-full ${B0()}`,children:"Download your own events as line-delimited JSON (JSONL/NDJSON). Only events you authored will be included."},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("button",{className:`${s4()} ${l8()} border-0 text-2xl cursor-pointer flex items-center justify-center h-full aspect-square shrink-0 hover:bg-transparent ${b8()}`,onClick:()=>{window.location.href="/api/export/mine"},"aria-label":"Download my events as JSONL",title:"Download my events",children:"⤓"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),e.permission==="admin"&&I.jsxDEV(I.Fragment,{children:[I.jsxDEV("div",{className:`m-2 p-2 ${c1()} rounded-lg w-full`,children:[I.jsxDEV("div",{className:`text-lg font-bold flex items-center justify-between cursor-pointer p-2 ${B0()} ${c("hover:bg-gray-300","hover:bg-gray-700")} rounded`,onClick:()=>e1("exportAll"),children:[I.jsxDEV("span",{children:"Export All Events (admin)"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-xl",children:o0.exportAll?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o0.exportAll&&I.jsxDEV("div",{className:"flex items-center justify-between p-2 m-4 bg-gray-900 round mt-2",children:[I.jsxDEV("div",{className:"pr-2 w-full",children:I.jsxDEV("p",{className:`text-sm ${B0()}`,children:"Download all stored events as line-delimited JSON (JSONL/NDJSON). This may take a while on large databases."},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("button",{className:`${s4()} ${l8()} border-0 text-2xl cursor-pointer flex m-2 items-center justify-center h-full aspect-square shrink-0 hover:bg-transparent ${b8()}`,onClick:()=>{window.location.href="/api/export"},"aria-label":"Download all events as JSONL",title:"Download all events",children:"⤓"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:`m-2 p-2 ${c1()} rounded-lg w-full`,children:[I.jsxDEV("div",{className:`text-lg font-bold flex items-center justify-between cursor-pointer p-2 ${B0()} ${c("hover:bg-gray-300","hover:bg-gray-700")} rounded`,onClick:()=>e1("exportSpecific"),children:[I.jsxDEV("span",{children:"Export Specific Pubkeys (admin)"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-xl",children:o0.exportSpecific?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o0.exportSpecific&&I.jsxDEV("div",{className:"w-full flex items-start justify-between gap-4 m-2 p-2 bg-gray-900 rounded-lg mt-2",children:I.jsxDEV("div",{className:"flex-1 pr-2 w-full",children:[I.jsxDEV("p",{className:`text-sm ${B0()}`,children:"Enter one or more author pubkeys (64-character hex). Only valid entries will be exported."},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex flex-col items-end gap-2 self-end justify-end p-2",children:I.jsxDEV("button",{className:`${s4()} ${B0()} text-base p-4 rounded m-2 ${c("hover:bg-gray-200","hover:bg-gray-600")}`,onClick:u0,title:"Add another pubkey",type:"button",children:"+ Add"},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex flex-col items-end gap-2 min-w-[320px] justify-end p-2",children:I.jsxDEV("div",{className:"gap-2 justify-end",children:m1.map((_,h)=>{let x=(_?.value||"").trim(),v=x.length===0?!0:n(x);return I.jsxDEV("div",{className:"flex items-center gap-2 ",children:[I.jsxDEV("input",{type:"text",inputMode:"text",autoComplete:"off",spellCheck:"false",className:`flex-1 text-sm px-2 py-1 border rounded outline-none ${v?c("border-gray-300 bg-white text-gray-900 focus:ring-2 focus:ring-blue-200","border-gray-600 bg-gray-700 text-gray-100 focus:ring-2 focus:ring-blue-500"):c("border-red-500 bg-red-50 text-red-800","border-red-700 bg-red-900 text-red-200")}`,placeholder:"e.g., 64-hex pubkey",value:x,onChange:(G0)=>D1(h,G0.target.value)},void 0,!1,void 0,this),I.jsxDEV("button",{className:`${s4()} ${B0()} px-2 py-1 rounded ${c("hover:bg-gray-200","hover:bg-gray-600")}`,onClick:()=>e0(h),title:"Remove this pubkey",type:"button",children:"✕"},void 0,!1,void 0,this)]},h,!0,void 0,this)})},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex justify-end items-end gap-2 self-end",children:I.jsxDEV("button",{className:`${c("bg-blue-600","bg-blue-500")} text-white px-3 py-1 rounded disabled:opacity-50 disabled:cursor-not-allowed ${E1()?c("hover:bg-blue-700","hover:bg-blue-600"):""}`,onClick:k0,disabled:!E1(),title:E1()?"Download events for specified pubkeys":"Enter a valid 64-character hex pubkey in every field",type:"button",children:"Export"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:`m-2 p-2 ${c1()} rounded-lg w-full`,children:[I.jsxDEV("div",{className:`text-lg font-bold flex items-center justify-between cursor-pointer p-2 ${B0()} ${c("hover:bg-gray-300","hover:bg-gray-700")} rounded`,onClick:()=>e1("importEvents"),children:[I.jsxDEV("span",{children:"Import Events (admin)"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-xl",children:o0.importEvents?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o0.importEvents&&I.jsxDEV("div",{className:"flex items-center justify-between p-2 bg-gray-900 rounded-lg mt-2",children:[I.jsxDEV("div",{className:"pr-2 w-full",children:I.jsxDEV("p",{className:`text-sm ${B0()}`,children:"Upload events in line-delimited JSON (JSONL/NDJSON) to import into the database."},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("button",{className:`${s4()} ${l8()} border-0 text-2xl cursor-pointer flex items-center justify-center h-full aspect-square shrink-0 hover:bg-transparent ${b8()}`,onClick:A8,"aria-label":"Import events from JSONL",title:"Import events",children:"↥"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:`m-2 p-2 ${c1()} rounded-lg w-full`,children:[I.jsxDEV("div",{className:`text-lg font-bold flex items-center justify-between cursor-pointer p-2 ${B0()} ${c("hover:bg-gray-300","hover:bg-gray-700")} rounded`,onClick:()=>e1("eventsLog"),children:[I.jsxDEV("span",{children:"My Events Log"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-xl",children:o0.eventsLog?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o0.eventsLog&&I.jsxDEV("div",{className:"p-2 bg-gray-900 rounded-lg mt-2",children:[I.jsxDEV("div",{className:"mb-4",children:I.jsxDEV("p",{className:`text-sm ${B0()}`,children:"View all your events in reverse chronological order. Click on any event to view its raw JSON."},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("div",{className:"block",style:{position:"relative"},children:N0.length===0&&!w4?I.jsxDEV("div",{className:`text-center py-4 ${B0()}`,children:"No events found"},void 0,!1,void 0,this):I.jsxDEV("div",{className:"space-y-2",children:[N0.map((_)=>I.jsxDEV("div",{className:`border rounded p-3 ${c("border-gray-300 bg-white","border-gray-600 bg-gray-800")}`,children:[I.jsxDEV("div",{className:"cursor-pointer",onClick:()=>f4(_.id),children:[I.jsxDEV("div",{className:"flex items-center justify-between",children:[I.jsxDEV("div",{className:"flex items-center gap-3",children:[I.jsxDEV("span",{className:`font-mono text-sm px-2 py-1 rounded ${c("bg-blue-100 text-blue-800","bg-blue-900 text-blue-200")}`,children:["Kind ",_.kind]},void 0,!0,void 0,this),I.jsxDEV("span",{className:`text-sm ${B0()}`,children:g1(_.created_at)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("span",{className:`text-lg ${B0()}`,children:X1===_.id?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_.content&&I.jsxDEV("div",{className:`mt-2 text-sm ${B0()}`,children:y1(_.content)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X1===_.id&&I.jsxDEV("div",{className:"mt-3 border-t pt-3",children:[I.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[I.jsxDEV("span",{className:`text-sm font-medium ${B0()}`,children:"Raw JSON:"},void 0,!1,void 0,this),I.jsxDEV("button",{className:`${c("bg-green-600 hover:bg-green-700","bg-green-500 hover:bg-green-600")} text-white text-xs px-2 py-1 rounded`,onClick:(h)=>{h.stopPropagation(),u4(_.raw_json)},title:"Copy minified JSON",children:"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("pre",{className:`text-xs p-2 rounded overflow-auto max-h-40 break-all whitespace-pre-wrap ${c1()} ${B0()}`,children:JSON.stringify(JSON.parse(_.raw_json),null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},_.id,!0,void 0,this)),w4&&I.jsxDEV("div",{className:`text-center py-4 ${B0()}`,children:I.jsxDEV("div",{className:"text-sm",children:"Loading more events..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),!w4&&B1&&I.jsxDEV("div",{className:"text-center py-4",children:I.jsxDEV("button",{className:`${c("bg-blue-600 hover:bg-blue-700","bg-blue-500 hover:bg-blue-600")} text-white px-4 py-2 rounded`,onClick:()=>S8(!1),children:"Load More"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),e.permission==="admin"&&I.jsxDEV("div",{className:`m-2 p-2 ${c1()} rounded-lg w-full`,children:[I.jsxDEV("div",{className:`text-lg font-bold flex items-center justify-between cursor-pointer p-2 ${B0()} ${c("hover:bg-gray-300","hover:bg-gray-700")} rounded`,onClick:()=>e1("allEventsLog"),children:[I.jsxDEV("span",{children:"All Events Log (admin)"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-xl",children:o0.allEventsLog?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o0.allEventsLog&&I.jsxDEV("div",{className:"p-2 bg-gray-900 rounded-lg mt-2",children:[I.jsxDEV("div",{className:"mb-4",children:I.jsxDEV("p",{className:`text-sm ${B0()}`,children:"View all events from all users in reverse chronological order. Click on any event to view its raw JSON."},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("div",{className:"block",style:{position:"relative"},children:z4.length===0&&!K4?I.jsxDEV("div",{className:`text-center py-4 ${B0()}`,children:"No events found"},void 0,!1,void 0,this):I.jsxDEV("div",{className:"space-y-2",children:[z4.map((_)=>I.jsxDEV("div",{className:`border rounded p-3 ${c("border-gray-300 bg-white","border-gray-600 bg-gray-800")}`,children:[I.jsxDEV("div",{className:"cursor-pointer",onClick:()=>b1(_.id),children:[I.jsxDEV("div",{className:"flex items-center justify-between",children:[I.jsxDEV("div",{className:"flex items-center gap-6",children:[I.jsxDEV("div",{className:"flex items-center gap-3 min-w-0",children:[_.author&&f0[_.author]&&I.jsxDEV(I.Fragment,{children:[f0[_.author].picture&&I.jsxDEV("img",{src:f0[_.author].picture,alt:f0[_.author].display_name||f0[_.author].name||"User avatar",className:`w-8 h-8 rounded-full object-cover border h-16 ${c("border-gray-300","border-gray-600")}`,onError:(h)=>{h.currentTarget.style.display="none"}},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex flex-col min-w-0",children:[I.jsxDEV("span",{className:`text-sm font-medium ${B0()}`,children:f0[_.author].display_name||f0[_.author].name||`${_.author.slice(0,8)}...`},void 0,!1,void 0,this),f0[_.author].display_name&&f0[_.author].name&&I.jsxDEV("span",{className:`text-xs ${B0()} opacity-70`,children:f0[_.author].name},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_.author&&!f0[_.author]&&I.jsxDEV("span",{className:`text-sm font-medium ${B0()}`,children:`${_.author.slice(0,8)}...`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"flex items-center gap-3",children:[I.jsxDEV("span",{className:`font-mono text-sm px-2 py-1 rounded ${c("bg-blue-100 text-blue-800","bg-blue-900 text-blue-200")}`,children:["Kind ",_.kind]},void 0,!0,void 0,this),I.jsxDEV("span",{className:`text-sm ${B0()}`,children:g1(_.created_at)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("span",{className:`text-lg ${B0()}`,children:A1===_.id?"▼":"▶"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_.content&&I.jsxDEV("div",{className:`mt-2 text-sm ${B0()}`,children:y1(_.content)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A1===_.id&&I.jsxDEV("div",{className:"mt-3 border-t pt-3",children:[I.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[I.jsxDEV("span",{className:`text-sm font-medium ${B0()}`,children:"Raw JSON:"},void 0,!1,void 0,this),I.jsxDEV("button",{className:`${c("bg-green-600 hover:bg-green-700","bg-green-500 hover:bg-green-600")} text-white text-xs px-2 py-1 rounded`,onClick:(h)=>{h.stopPropagation(),u4(_.raw_json)},title:"Copy minified JSON",children:"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("pre",{className:`text-xs p-2 rounded overflow-auto max-h-40 break-all whitespace-pre-wrap ${c1()} ${B0()}`,children:JSON.stringify(JSON.parse(_.raw_json),null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},_.id,!0,void 0,this)),K4&&I.jsxDEV("div",{className:`text-center py-4 ${B0()}`,children:I.jsxDEV("div",{className:"text-sm",children:"Loading more events..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),!K4&&b0&&I.jsxDEV("div",{className:"text-center py-4",children:I.jsxDEV("button",{className:`${c("bg-blue-600 hover:bg-blue-700","bg-blue-500 hover:bg-blue-600")} text-white px-4 py-2 rounded`,onClick:()=>D4(!1),children:"Load More"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:`flex-grow ${c("bg-gray-100","bg-gray-900")}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):I.jsxDEV("div",{className:"w-full h-full flex items-center justify-center",children:I.jsxDEV("div",{className:c("bg-gray-100","bg-gray-900"),style:{width:"800px",maxWidth:"100%",boxSizing:"border-box",padding:`${R8}px`},children:[I.jsxDEV("div",{className:"flex items-center gap-3 mb-3",children:[I.jsxDEV("img",{src:"/orly.png",alt:"Orly logo",className:"object-contain",style:{width:"4rem",height:"4rem"},onError:(_)=>{_.currentTarget.onerror=null,_.currentTarget.src="/docs/orly.png"}},void 0,!1,void 0,this),I.jsxDEV("h1",{ref:h1,className:`text-2xl font-bold p-2 ${B0()}`,children:"ORLY\uD83E\uDD89 Dashboard Login"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("p",{className:`mb-4 ${B0()}`,children:"Authenticate to this Nostr relay using your browser extension."},void 0,!1,void 0,this),I.jsxDEV("div",{className:t1(),children:C1},void 0,!1,void 0,this),I.jsxDEV("div",{className:"mb-5",children:I.jsxDEV("button",{className:`${c("bg-blue-600","bg-blue-500")} text-white px-5 py-3 rounded ${c("hover:bg-blue-700","hover:bg-blue-600")}`,onClick:P1,children:"Login with Browser Extension (NIP-07)"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var Sq=zP;var Bz=j8(uZ(),1),WP=Dq.createRoot(document.getElementById("root"));WP.render(Bz.jsxDEV(bq.default.StrictMode,{children:Bz.jsxDEV(Sq,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)); diff --git a/app/web/dist/index.html b/app/web/dist/index.html index 0563394..52f6722 100644 --- a/app/web/dist/index.html +++ b/app/web/dist/index.html @@ -5,7 +5,7 @@ Nostr Relay - +