// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0-or-later
// @source: https://gitlab.com/soapbox-pub/ditto/-/tree/f0a3877c
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Fn as t,S as n,Zr as r,lt as i,qi as a}from"./lucide-icons-BdRF0moN.js";import{t as o}from"./jsx-runtime-By8HlURe.js";import{t as s}from"./dist-DQ82bf9M.js";import{u as c}from"./esm-CRVqHnq2.js";import{t as l}from"./useAppContext-Ughdk2-Z.js";import{t as u}from"./button-Cs26nq0r.js";import{n as d}from"./useFollowActions-cve70R08.js";import{n as f,o as p,r as m,t as h}from"./avatar--oX_CTF4.js";import{n as g}from"./chunk-62JRHF6Z-yJW_vgm4.js";import{t as _}from"./skeleton-CVls4GW9.js";import{t as v}from"./useAuthors-DHw1W6Un.js";import{c as y}from"./LayoutContext-CjQBLGO-.js";import{w as b}from"./index-CYEZWNq6.js";import{n as x,t as S}from"./helpContent-D0r-ot2m.js";import{t as C}from"./PageHeader-CMi4aeE4.js";import{i as w,n as T,r as E,t as D}from"./accordion-eQY0IXGj.js";import{t as O}from"./FollowAllSplitButton-DhOswdlt.js";var k=e(a(),1),A=o();function j({className:e}){let{nostr:r}=s(),{data:i}=d(),[a,o]=(0,k.useState)(null),[l,_]=(0,k.useState)(!0);(0,k.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await r.query([{kinds:[S.kind],authors:[S.pubkey],"#d":[S.identifier],limit:1}],{signal:AbortSignal.timeout(8e3)});!e&&t.length>0&&o(t[0])}catch(e){console.warn(`Failed to fetch Team Soapbox pack:`,e)}finally{e||_(!1)}})(),()=>{e=!0}},[r]);let y=(0,k.useMemo)(()=>a?.tags.filter(([e])=>e===`p`).map(([,e])=>e)??[],[a]),b=(0,k.useMemo)(()=>y.slice(0,8),[y]),{data:x}=v(b),C=(0,k.useMemo)(()=>new Set(i?.pubkeys??[]),[i]),w=(0,k.useMemo)(()=>{if(!a)return;let e=a.tags.find(([e])=>e===`d`)?.[1]??``;return`/${c.naddrEncode({kind:a.kind,pubkey:a.pubkey,identifier:e})}`},[a]);return l?(0,A.jsx)(M,{className:e}):a?(0,A.jsx)(`div`,{className:e,children:(0,A.jsx)(`div`,{className:`rounded-2xl border border-primary/20 bg-primary/5 overflow-hidden`,children:(0,A.jsxs)(`div`,{className:`px-5 pt-5 pb-4 space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(`div`,{className:`flex items-center justify-center size-10 shrink-0 rounded-full bg-primary/15`,children:(0,A.jsx)(t,{className:`size-5 text-primary`})}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h3`,{className:`text-base font-bold leading-snug`,children:`Need help? Meet Team Soapbox`}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 leading-relaxed`,children:`These are real people who built this platform and are happy to help. Follow them and don't be shy — ask anything!`})]})]}),y.length>0&&(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`flex -space-x-2`,children:b.map(e=>{let t=x?.get(e),n=t?.metadata?.name||t?.metadata?.display_name||`Anonymous`;return(0,A.jsxs)(h,{shape:p(t?.metadata),className:`size-8 ring-2 ring-background`,children:[(0,A.jsx)(m,{src:t?.metadata?.picture,alt:n}),(0,A.jsx)(f,{className:`bg-primary/20 text-primary text-[10px]`,children:n[0]?.toUpperCase()})]},e)})}),(0,A.jsxs)(`span`,{className:`text-sm text-muted-foreground flex items-center gap-1.5`,children:[(0,A.jsx)(n,{className:`size-3.5`}),y.length,` member`,y.length===1?``:`s`]})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(O,{pubkeys:y,followedPubkeys:C,listNoun:`Team Soapbox`,followSuccessTitle:`Following Team Soapbox!`,className:`flex-1`}),w&&(0,A.jsx)(u,{variant:`outline`,asChild:!0,children:(0,A.jsx)(g,{to:w,children:`View Pack`})})]})]})})}):null}function M({className:e}){return(0,A.jsx)(`div`,{className:e,children:(0,A.jsx)(`div`,{className:`rounded-2xl border border-primary/20 bg-primary/5 overflow-hidden`,children:(0,A.jsxs)(`div`,{className:`px-5 pt-5 pb-4 space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(_,{className:`size-10 rounded-full shrink-0`}),(0,A.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,A.jsx)(_,{className:`h-5 w-48`}),(0,A.jsx)(_,{className:`h-4 w-full`}),(0,A.jsx)(_,{className:`h-4 w-3/4`})]})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`flex -space-x-2`,children:Array.from({length:6}).map((e,t)=>(0,A.jsx)(_,{className:`size-8 rounded-full ring-2 ring-background`},t))}),(0,A.jsx)(_,{className:`h-4 w-20`})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(_,{className:`h-10 flex-1 rounded-md`}),(0,A.jsx)(_,{className:`h-10 w-24 rounded-md`})]})]})})})}function N(e){let t=[],n=/\*\*(.+?)\*\*|\[([^\]]+)\]\(([^)]+)\)/g,r=0,i;for(;(i=n.exec(e))!==null;)i.index>r&&t.push(e.slice(r,i.index)),i[1]===void 0?i[2]!==void 0&&i[3]!==void 0&&t.push((0,A.jsx)(`a`,{href:i[3],target:`_blank`,rel:`noopener noreferrer`,className:`text-primary underline underline-offset-2 hover:text-primary/80 transition-colors`,children:i[2]},i.index)):t.push((0,A.jsx)(`strong`,{className:`font-semibold text-foreground`,children:i[1]},i.index)),r=i.index+i[0].length;return r<e.length&&t.push(e.slice(r)),t}function P({categories:e,items:t,hideHeadings:n,className:r}){let{config:i}=l(),a=(0,k.useMemo)(()=>{let n=x(i.appName);return e&&(n=n.filter(t=>e.includes(t.id))),t&&(n=n.map(e=>({...e,items:e.items.filter(e=>t.includes(e.id))})).filter(e=>e.items.length>0)),n},[e,t,i.appName]);return a.length===0?null:(0,A.jsx)(`div`,{className:r,children:a.map((e,t)=>(0,A.jsxs)(k.Fragment,{children:[!n&&(0,A.jsx)(`div`,{className:t===0?`pt-2 pb-2`:`pt-6 pb-2`,children:(0,A.jsx)(`h3`,{className:`text-sm font-bold uppercase tracking-wider text-primary bg-primary/10 rounded-full px-3.5 py-1.5 inline-block`,children:e.label})}),(0,A.jsx)(D,{type:`single`,collapsible:!0,className:`w-full pl-3`,children:e.items.map(e=>(0,A.jsx)(F,{item:e},e.id))})]},e.id))})}function F({item:e}){return(0,A.jsxs)(E,{value:e.id,children:[(0,A.jsx)(w,{className:`text-left text-base font-semibold leading-snug hover:no-underline gap-3`,children:e.question}),(0,A.jsx)(T,{className:`text-[14px] leading-relaxed text-foreground/80 space-y-3`,children:e.answer.map((e,t)=>(0,A.jsx)(`p`,{children:N(e)},t))})]})}function I(){let{config:e}=l();return y({}),b({title:`Help | ${e.appName}`,description:`Get help with ${e.appName} — Nostr 101, FAQs, and support`}),(0,A.jsxs)(`main`,{className:`min-h-screen pb-16 sidebar:pb-0`,children:[(0,A.jsx)(C,{title:`Help`,icon:(0,A.jsx)(r,{className:`size-5`})}),(0,A.jsx)(j,{className:`px-4 pt-2 pb-4`}),(0,A.jsxs)(`div`,{className:`px-4 pt-4 pb-1`,children:[(0,A.jsx)(`h2`,{className:`text-lg font-bold`,children:`Frequently Asked Questions`}),(0,A.jsxs)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:[`Everything you need to know about Nostr, `,e.appName,`, and how it all works.`]})]}),(0,A.jsx)(P,{className:`px-4 pb-8`}),(0,A.jsx)(`div`,{className:`px-4 pb-8`,children:(0,A.jsxs)(g,{to:`/privacy`,className:`flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors`,children:[(0,A.jsx)(i,{className:`size-4`}),(0,A.jsx)(`span`,{children:`Privacy Policy`})]})})]})}export{I as HelpPage};
// @license-end
