1var sm=Object.defineProperty;var tm=(s,t,a)=>t in s?sm(s,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[t]=a;var Kr=(s,t,a)=>tm(s,typeof t!="symbol"?t+"":t,a);import{r as i,t as am,c as rm,j as e,V as Tl,R as Al,A as Il,C as Ll,X as zs,T as zl,D as El,a as ir,P as nm,b as im,$ as om,d as Rl,e as lm,f as cm,g as dm,S as kr,O as Nn,h as wn,i as Pl,k as kn,l as Sn,m as Ml,n as Dl,o as Ol,u as ns,p as _i,M as Ti,q as Ns,s as Fl,v as Bl,L as Ls,w as St,x as rt,y as Zs,z as Fs,B as k,I as mm,H as xm,E as $l,F as nt,G as ql,J as um,K as Lt,U as Es,N as fa,Q as ft,W as es,Y as Na,Z as Hl,_ as Gl,a0 as Bt,a1 as hm,a2 as pm,a3 as gm,a4 as Ai,a5 as ks,a6 as ms,a7 as wa,a8 as bs,a9 as Ks,aa as Ga,ab as Et,ac as ws,ad as Ii,ae as Cs,af as Ul,ag as fm,ah as bm,ai as Wl,aj as jm,ak as Cn,al as Ra,am as ym,an as Vl,ao as vm,ap as Nm,aq as wm,ar as km,as as _n,at as $t,au as Sm,av as Ta,aw as Cm,ax as Yl,ay as Kl,az as _m,aA as Xl,aB as Ql,aC as Jl,aD as Zl,aE as ec,aF as Tn,aG as sc,aH as tc,aI as Tm,aJ as Am,aK as ka,aL as ac,aM as rc,aN as nc,aO as Im,aP as ic,aQ as Lm,aR as oc,aS as Gt,aT as lc,aU as zm,aV as cc,aW as Em,aX as dc,aY as mc,aZ as Rm,a_ as Pm,a$ as xc,b0 as Mm,b1 as Dm,b2 as uc,b3 as hc,b4 as pc,b5 as Om,b6 as Ua,b7 as ua,b8 as tr,b9 as Ut,ba as An,bb as st,bc as ha,bd as ys,be as Rt,bf as at,bg as Pe,bh as gc,bi as Fm,bj as fc,bk as Bm,bl as $m,bm as qm,bn as pa,bo as Hm,bp as Ts,bq as yr,br as or,bs as pi,bt as Ss,bu as Gm,bv as bc,bw as Um,bx as Lr,by as gi,bz as _t,bA as gs,bB as bt,bC as Tt,bD as jc,bE as Ys,bF as Ve,bG as qt,bH as Pa,bI as to,bJ as yc,bK as Wm,bL as vc,bM as Nc,bN as wc,bO as kc,bP as Sc,bQ as Cc,bR as _c,bS as Tc,bT as Ac,bU as Vm,bV as Ym,bW as Km,bX as Xm,bY as Qm,bZ as Jm,b_ as Ic,b$ as Li,c0 as wr,c1 as xa,c2 as vr,c3 as fi,c4 as Wa,c5 as At,c6 as ta,c7 as Mr,c8 as za,c9 as qr,ca as Sr,cb as Lc,cc as Zm,cd as Wt,ce as Va,cf as ln,cg as zi,ch as ga,ci as Nt,cj as ex,ck as cn,cl as $a,cm as In,cn as zc,co as Ec,cp as sx,cq as tx,cr as Gn,cs as Ei,ct as Rc,cu as bi,cv as Sa,cw as ea,cx as Pc,cy as ar,cz as rr,cA as nr,cB as ma,cC as sr,cD as zr,cE as Ri,cF as Nr,cG as dn,cH as mn,cI as Er,cJ as Mc,cK as Dc,cL as xn,cM as ax,cN as ao,cO as rx,cP as Un,cQ as nx,cR as ix,cS as Oc,cT as ox,cU as lx,cV as cx,cW as Wn,cX as Za,cY as Ea,cZ as dx,c_ as Pi,c$ as mx,d0 as ji,d1 as yi,d2 as xx,d3 as Mi,d4 as Fc,d5 as ux,d6 as ro,d7 as Di,d8 as Vn,d9 as Bc,da as hx,db as px,dc as lr,dd as gx,de as cr,df as $c,dg as vi,dh as fx,di as an,dj as bx,dk as jx,dl as Ca,dm as yx,dn as Dr,dp as er,dq as qa,dr as vx,ds as Nx,dt as Ht,du as wx,dv as qc,dw as kx,dx as Sx,dy as no,dz as Oi,dA as Cx,dB as _x,dC as io,dD as mr,dE as oo,dF as Or,dG as Tx,dH as Ax,dI as Ix,dJ as Lx,dK as zx,dL as Ex,dM as lo,dN as Hc,dO as Fi,dP as Bi,dQ as Rx,dR as Px,dS as Xr,dT as Mx,dU as co,dV as Dx,dW as Ox,dX as Fx,dY as Bx,dZ as mo,d_ as $x,d$ as qx,e0 as Hx,e1 as Gx,e2 as Ux,e3 as xo,e4 as $i,e5 as Wx,e6 as Vx,e7 as Yx,e8 as uo,e9 as ho,ea as Gc,eb as un,ec as Kx,ed as Xx,ee as Qx,ef as Jx,eg as Zx,eh as eu,ei as su,ej as Ln,ek as tu,el as au,em as ru,en as nu,eo as iu,ep as Uc,eq as ou,er as lu,es as xr,et as cu,eu as yt,ev as du,ew as mu,ex as xu,ey as Ni,ez as uu,eA as Wc,eB as Vc,eC as hu,eD as pu,eE as po,eF as Yn,eG as gu,eH as fu,eI as bu,eJ as ju,eK as yu,eL as vu,eM as Nu,eN as wu,eO as ku,eP as Su,eQ as Cu,eR as rs,eS as _u,eT as Tu,eU as Au}from"./BBPcU5_d.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const n of o)if(n.type==="childList")for(const l of n.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function a(o){const n={};return o.integrity&&(n.integrity=o.integrity),o.referrerPolicy&&(n.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?n.credentials="include":o.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function r(o){if(o.ep)return;o.ep=!0;const n=a(o);fetch(o.href,n)}})();const Iu=1,Lu=1e6;let Kn=0;function zu(){return Kn=(Kn+1)%Number.MAX_SAFE_INTEGER,Kn.toString()}const Xn=new Map,go=s=>{if(Xn.has(s))return;const t=setTimeout(()=>{Xn.delete(s),Rr({type:"REMOVE_TOAST",toastId:s}
1)},Lu);Xn.set(s,t)},Eu=(s,t)=>{switch(t.type){case"ADD_TOAST":return{...s,toasts:[t.toast,...s.toasts].slice(0,Iu)};case"UPDATE_TOAST":return{...s,toasts:s.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case"DISMISS_TOAST":{const{toastId:a}=t;return a?go(a):s.toasts.forEach(r=>{go(r.id)}),{...s,toasts:s.toasts.map(r=>r.id===a||a===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...s,toasts:[]}:{...s,toasts:s.toasts.filter(a=>a.id!==t.toastId)}}},rn=[];let nn={toasts:[]};function Rr(s){nn=Eu(nn,s),rn.forEach(t=>{t(nn)})}function pt({...s}){const t=zu(),a=o=>Rr({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Rr({type:"DISMISS_TOAST",toastId:t});return Rr({type:"ADD_TOAST",toast:{...s,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:a}}function zn(){const[s,t]=i.useState(nn);return i.useEffect(()=>(rn.push(t),()=>{const a=rn.indexOf(t);a>-1&&rn.splice(a,1)}),[s]),{...s,toast:pt,dismiss:a=>Rr({type:"DISMISS_TOAST",toastId:a})}}function Z(...s){return am(rm(s))}const Ru=nm,Yc=i.forwardRef(({className:s,...t},a)=>e.jsx(Tl,{ref:a,className:Z("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",s),...t}));Yc.displayName=Tl.displayName;const Pu=ir("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Kc=i.forwardRef(({className:s,variant:t,...a},r)=>e.jsx(Al,{ref:r,className:Z(Pu({variant:t}),s),...a}));Kc.displayName=Al.displayName;const Mu=i.forwardRef(({className:s,...t},a)=>e.jsx(Il,{ref:a,className:Z("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",s),...t}));Mu.displayName=Il.displayName;const Xc=i.forwardRef(({className:s,...t},a)=>e.jsx(Ll,{ref:a,className:Z("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",s),"toast-close":"",...t,children:e.jsx(zs,{className:"h-4 w-4"})}));Xc.displayName=Ll.displayName;const Qc=i.forwardRef(({className:s,...t},a)=>e.jsx(zl,{ref:a,className:Z("text-sm font-semibold",s),...t}));Qc.displayName=zl.displayName;const Jc=i.forwardRef(({className:s,...t},a)=>e.jsx(El,{ref:a,className:Z("text-sm opacity-90",s),...t}));Jc.displayName=El.displayName;function Du(){const{toasts:s}=zn();return e.jsxs(Ru,{children:[s.map(function({id:t,title:a,description:r,action:o,...n}){return e.jsxs(Kc,{...n,children:[e.jsxs("div",{className:"grid gap-1",children:[a&&e.jsx(Qc,{children:a}),r&&e.jsx(Jc,{children:r})]}),o,e.jsx(Xc,{})]},t)}),e.jsx(Yc,{})]})}const Ou=({...s})=>{const{theme:t="system"}=im();return e.jsx(om,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...s})},Ka=lm,la=cm,ca=dm,sa=i.forwardRef(({className:s,sideOffset:t=4,...a},r)=>
1e.jsx(Rl,{ref:r,sideOffset:t,className:Z("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...a}));sa.displayName=Rl.displayName;const Fr=ir("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-base font-semibold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 hover:scale-[1.02] transition-all duration-200",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 hover:scale-[1.02] transition-all duration-200",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 hover:scale-[1.02] transition-all duration-200",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3 text-sm font-medium",lg:"h-11 rounded-md px-8 text-base font-semibold",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),h=i.forwardRef(({className:s,variant:t,size:a,asChild:r=!1,...o},n)=>{const l=r?kr:"button";return e.jsx(l,{className:Z(Fr({variant:t,size:a,className:s})),ref:n,...o})});h.displayName="Button";const U=i.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:Z("rounded-lg border border-border/10 bg-card text-card-foreground shadow-sm",s),...t}));U.displayName="Card";const Be=i.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:Z("flex flex-col space-y-1.5 p-6",s),...t}));Be.displayName="CardHeader";const $e=i.forwardRef(({className:s,...t},a)=>e.jsx("h3",{ref:a,className:Z("text-2xl font-semibold leading-none tracking-tight",s),...t}));$e.displayName="CardTitle";const os=i.forwardRef(({className:s,...t},a)=>e.jsx("p",{ref:a,className:Z("text-sm text-muted-foreground",s),...t}));os.displayName="CardDescription";const ye=i.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:Z("p-6 pt-0",s),...t}));ye.displayName="CardContent";const Fu=i.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:Z("flex items-center p-6 pt-0",s),...t}));Fu.displayName="CardFooter";const Je=i.forwardRef(({className:s,type:t,...a},r)=>e.jsx("input",{type:t,className:Z("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:r,...a}));Je.displayName="Input";const En=Ml,Zc=Ol,Bu=Dl,ed=i.forwardRef(({className:s,...t},a)=>e.jsx(Nn,{className:Z("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...t,ref:a}));ed.displayName=Nn.displayName;const $u=ir("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Hr=i.forwardRef(({side:s="right",className:t,children:a,...r},o)=>e.jsxs(Bu,{children:[e.jsx(ed,{}),e.jsxs(wn,{ref:o,className:Z($u({side:s}),t),...r,children:[a,e.jsxs(Pl,{className:"absolute right-4 top-4 roun
1ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(zs,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Hr.displayName=wn.displayName;const sd=({className:s,...t})=>e.jsx("div",{className:Z("flex flex-col space-y-2 text-center sm:text-left",s),...t});sd.displayName="SheetHeader";const td=i.forwardRef(({className:s,...t},a)=>e.jsx(kn,{ref:a,className:Z("text-lg font-semibold text-foreground",s),...t}));td.displayName=kn.displayName;const qu=i.forwardRef(({className:s,...t},a)=>e.jsx(Sn,{ref:a,className:Z("text-sm text-muted-foreground",s),...t}));qu.displayName=Sn.displayName;const Ma=()=>{const s=ns(),t=_i(),[a,r]=i.useState(!1),o=[{label:"Playbooks",path:"/playbooks"},{label:"Safety",path:"/security"},{label:"Pricing",path:"/#pricing",isAnchor:!0},{label:"API",path:"/api-docs"},{label:"Academy",path:"/academy"}],n=(l,c)=>{var x;c?t.pathname==="/"?(x=document.getElementById("pricing"))==null||x.scrollIntoView({behavior:"smooth"}):s("/#pricing"):s(l)};return e.jsx("nav",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-50 w-[95%] max-w-5xl",children:e.jsx("div",{className:"bg-card/85 backdrop-blur-xl rounded-full border border-border/40 px-6 py-2.5 shadow-sm",children:e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("button",{onClick:()=>s("/"),className:"text-base font-semibold tracking-tight font-display hover:opacity-80 transition-opacity",children:"DESHILLER"}),e.jsxs("div",{className:"hidden md:flex items-center gap-1",children:[o.map(l=>e.jsx("button",{onClick:()=>n(l.path,l.isAnchor),className:`px-3.5 py-1.5 text-[13px] transition-colors rounded-full hover:bg-accent/8 ${t.pathname===l.path?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:l.label},l.label)),e.jsxs("button",{onClick:()=>s("/creative-studio"),className:`px-3.5 py-1.5 text-[13px] transition-colors rounded-full hover:bg-accent/8 flex items-center gap-1.5 ${t.pathname==="/creative-studio"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:["Studio",e.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium leading-none",children:"Soon"})]})]}),e.jsxs("div",{className:"hidden md:flex items-center gap-2",children:[e.jsx(h,{variant:"ghost",onClick:()=>s("/auth"),className:"text-[13px] rounded-full px-4 h-8 hover:bg-accent/8 text-muted-foreground hover:text-foreground",children:"Login"}),e.jsx(h,{variant:"ghost",onClick:()=>s("/onboarding"),className:"text-[13px] rounded-full px-4 h-8 hover:bg-accent/8 text-foreground",children:"Start setup"}),e.jsx(h,{onClick:()=>s("/lp"),className:"text-[13px] rounded-full px-4 h-8 bg-primary text-primary-foreground hover:bg-primary/90",children:"Book a demo"})]}),e.jsxs(En,{open:a,onOpenChange:r,children:[e.jsx(Zc,{asChild:!0,className:"md:hidden",children:e.jsx(h,{variant:"ghost",size:"icon",className:"hover:bg-accent/5 rounded-full",children:e.jsx(Ti,{className:"h-5 w-5"})})}),e.jsx(Hr,{side:"right",className:"w-[300px] sm:w-[400px] bg-card border-border/50",children:e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center justify-between pb-6 border-b border-border/50",children:[e.jsx("span",{className:"text-lg font-semibold tracking-tight",children:"DESHILLER"}),e.jsx(h,{variant:"ghost",size:"icon",onClick:()=>r(!1),className:"hover:bg-accent/5",children:e.jsx(zs,{className:"h-5 w-5"})})]}),e.jsxs("nav",{className:"flex flex-col gap-6 py-8",children:[o.map(l=>e.jsx("button",{onClick:()=>{r(!1),n(l.path,l.isAnchor)},className:"text-lg font-medium text-foreground hover:text-primary transition-colors text-left",children:l.label},l.label)),e.jsxs("button",{onClick:()=>{r(!1),s("/creative-studio")},className:"text-lg font-medium text-foreground hover:text-primary transition-colors text-left flex items-center gap-2",children:["Studio",e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-primary/10 text-primary font-medium",children:"Soon"})]})]}),e.jsxs("div",{className:"mt-auto space-y-3 pt-6 border-t border-border/50",children:[e.jsx(h,{variant:"outline",onClick:()=>{r(!1),s("/auth")},className:"w-full h-12 text-base rounded-full",children:"Sign in"}),e.jsxs(h,{onClick:()=>{r(!1),s("/auth")},className:"w-full h-12 text-base bg-primary text-primary-foreground hover:bg-primary/90 rounded-full",children:["Start free trial",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]})]})]})})]})]})})})},Hu=({onSwipeLeft:s,onSwipeRight:t,threshold:a=100})=>{const[{x:r},o]=Fl(()=>({x:0}));return{bind:Bl({onDrag:({down:l,movement:[c],direction:[x],cancel:d})=>{l&&Math.abs(c)>a&&(x>0&&t?(t(),d()):x<0&&s&&(s(),d())),o.start({x:l?c:0,immediate:l})}},{drag:{axis:"x",filterTaps:!0}}),style:{x:r}}},Gu="https://wa.me/34711079539",_s=()=>{const[s,t]=i.useState(""),[a,r]=i.useState(!1),o=async l=>{l.preventDefault(),r(!0),await new Promise(c=>setTimeout(c,1e3)),k.success("Subscribed",{description:"You'll receive updates and tips"}),t(""),r(!1)},n=[{label:"Playbooks",href:"/playbooks"},{label:"Safety",href:"/security"}
1,{label:"How it works",href:"/how-it-works"},{label:"About",href:"/about"},{label:"Privacy",href:"/privacy"},{label:"Terms",href:"/terms"},{label:"Anti-Spam",href:"/anti-spam"}];return e.jsx("footer",{className:"border-t border-border/50 bg-background",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:[e.jsxs("div",{className:"py-16 flex flex-col md:flex-row justify-between items-start gap-12",children:[e.jsxs("div",{className:"space-y-4 max-w-md",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"DESHILLER"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"The agent layer for B2B social selling. Pipeline from X, LinkedIn, Reddit, Quora, YouTube and Facebook â without account bans."})]}),e.jsxs("form",{onSubmit:o,className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Subscribe to our newsletter"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Je,{type:"email",placeholder:"Enter your email",value:s,onChange:l=>t(l.target.value),required:!0,disabled:a,className:"h-9 text-sm"}),e.jsx(h,{type:"submit",size:"sm",disabled:a,className:"bg-primary text-primary-foreground hover:bg-primary/90",children:"Subscribe"})]})]})]}),e.jsx("div",{className:"flex flex-wrap gap-4 sm:gap-6",children:n.map(l=>e.jsx(Ls,{to:l.href,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:l.label},l.label))})]}),e.jsxs("div",{className:"py-6 border-t border-border/50 flex flex-col md:flex-row justify-between items-center gap-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"© 2025 DESHILLER. All rights reserved."}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("a",{href:Gu,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-green-500 transition-colors",title:"Contact us on WhatsApp",children:e.jsx(St,{className:"h-5 w-5"})}),e.jsx("a",{href:"https://twitter.com/deshiller",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(rt,{className:"h-5 w-5"})}),e.jsx("a",{href:"https://linkedin.com/company/deshiller",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(Zs,{className:"h-5 w-5"})}),e.jsx("a",{href:"mailto:[email protected]",className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(Fs,{className:"h-5 w-5"})})]})]})]})})},ad=um,qi=i.forwardRef(({className:s,...t},a)=>e.jsx(mm,{ref:a,className:Z("border-b",s),...t}));qi.displayName="AccordionItem";const Hi=i.forwardRef(({className:s,children:t,...a},r)=>e.jsx(xm,{className:"flex",children:e.jsxs($l,{ref:r,className:Z("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",s),...a,children:[t,e.jsx(nt,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Hi.displayName=$l.displayName;const Gi=i.forwardRef(({className:s,children:t,...a},r)=>e.jsx(ql,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...a,children:e.jsx("div",{className:Z("pb-4 pt-0",s),children:t})}));Gi.displayName=ql.displayName;const Uu=({userCount:s,discoveredPostsCount:t})=>{const[a,r]=i.useState(null);return e.jsxs("section",{className:"relative max-w-7xl mx-auto px-6 lg:px-8 border-t border-border/50 overflow-hidden",style:{paddingTop:"120px",paddingBottom:"120px"},children:[e.jsx("div",{className:"absolute -top-32 left-1/4 w-[500px] h-[500px] rounded-full blur-3xl bg-primary/[0.07] pointer-events-none"}),e.jsx("div",{className:"absolute bottom-0 right-1/4 w-[420px] h-[420px] rounded-full blur-3xl bg-accent/[0.06] pointer-events-none"}),e.jsx("div",{className:"absolute inset-0 opacity-[0.025] pointer-events-none",style:{backgroundImage:"linear-gradient(hsl(var(--border)) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--border)) 1px, transparent 1px)",backgroundSize:"40px 40px"}}),e.jsxs("div",{className:"relative z-10",children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-primary/80 font-medium mb-4",children:"Who it's for"}),e.jsx("h2",{className:"text-4xl md:text-5xl font-display font-semibold mb-4",children:"Built for revenue teams, not hobbyists."}),e.jsx("p",{className:"text-muted-foreground text-base max-w-2xl mx-auto leading-relaxed",children:"A pipeline engine for B2B teams who treat social as a sales channel â not a vanity surface."})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5 mb-14",children:[{icon:Lt,title:"B2B founders selling solo",glow:"from-primary/20 via-primary/5 to-transparent",orb:"bg-primary/20",pains:["Hours lost scrolling X and Reddit for leads","Buyer posts found by competitors first"],scenario:{persona:"Maya, solo foun
1der of a Postgres tooling startup",steps:["Catches a CTO on X asking 'what are you using instead of pgAdmin?' within 4 minutes of the post","Replies in her real voice â no link drop, just a thoughtful answer with a soft mention","Books a demo by Friday without spending her morning doomscrolling"]}},{icon:Es,title:"Growth & demand-gen teams",glow:"from-accent/25 via-accent/5 to-transparent",orb:"bg-accent/25",pains:["Manual social listening doesn't scale past one ICP","No attribution from social touchpoint to meeting"],scenario:{persona:"Demand-gen team at a 30-person SaaS",steps:["Runs 6 ICP agents in parallel â RevOps leaders, HR ops, finance ops, etc.","Each reply is tagged to a campaign and pushed into HubSpot as a touchpoint","Pipeline dashboard shows which signal sources convert to booked meetings"]}},{icon:fa,title:"Agencies & GTM operators",glow:"from-primary/15 via-accent/10 to-transparent",orb:"bg-primary/15",pains:["Running social selling for several clients in parallel","Need brand-voice control and approval workflows"],scenario:{persona:"GTM agency managing 8 B2B clients",steps:["Each client gets isolated brand voice, ICP filters, and platform mix","Risky replies route to a per-client approval queue before posting","Weekly digest shows signals caught, replies sent, and meetings sourced per account"]}}].map((o,n)=>{const l=a===n;return e.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":l,onClick:()=>r(l?null:n),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),r(l?null:n))},onMouseEnter:()=>r(n),onMouseLeave:()=>r(c=>c===n?null:c),className:`group relative rounded-2xl border bg-gradient-to-br from-card/80 via-card/40 to-card/20 backdrop-blur-xl p-7 shadow-2xl shadow-black/20 hover:-translate-y-1 transition-all duration-300 overflow-hidden cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary/40 ${l?"border-primary/40":"border-white/[0.08] hover:border-primary/30"}`,children:[e.jsx("div",{className:`absolute -top-20 -right-20 w-64 h-64 rounded-full blur-3xl ${o.orb} opacity-60 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none`}),e.jsx("div",{className:`absolute inset-0 bg-gradient-to-br ${o.glow} opacity-40 pointer-events-none`}),e.jsx("div",{className:"absolute inset-0 opacity-[0.04] pointer-events-none",style:{backgroundImage:"radial-gradient(circle at 1px 1px, hsl(var(--foreground)) 1px, transparent 0)",backgroundSize:"20px 20px"}}),e.jsxs("div",{className:"relative z-10",children:[e.jsxs("div",{className:"flex items-start justify-between mb-5",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-gradient-to-br from-primary/30 to-primary/10 border border-primary/20 flex items-center justify-center shadow-lg shadow-primary/10",children:e.jsx(o.icon,{className:"h-6 w-6 text-primary"})}),e.jsx("div",{className:`w-7 h-7 rounded-full border border-primary/30 bg-primary/10 flex items-center justify-center transition-transform duration-300 ${l?"rotate-45":"rotate-0"}`,"aria-hidden":"true",children:e.jsx(ft,{className:"h-3.5 w-3.5 text-primary"})})]}),e.jsx("h3",{className:"font-display font-semibold text-xl mb-4",children:o.title}),e.jsx("ul",{className:"space-y-2.5",children:o.pains.map((c,x)=>e.jsxs("li",{className:"flex gap-2.5 text-sm text-muted-foreground leading-relaxed",children:[e.jsx("span",{className:"text-primary/60 mt-1.5 shrink-0",children:"·"}),e.jsx("span",{children:c})]},x))}),e.jsx("div",{className:`grid transition-all duration-500 ease-out ${l?"grid-rows-[1fr] opacity-100 mt-5":"grid-rows-[0fr] opacity-0 mt-0"}`,children:e.jsx("div",{className:"overflow-hidden",children:e.jsxs("div",{className:"rounded-xl border border-primary/15 bg-background/50 backdrop-blur-sm p-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(es,{className:"h-3 w-3 text-primary"}),e.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold text-primary",children:"In practice"})]}),e.jsx("p",{className:"text-xs font-medium text-foreground mb-2.5",children:o.scenario.persona}),e.jsx("ol",{className:"space-y-1.5",children:o.scenario.steps.map((c,x)=>e.jsxs("li",{className:"flex gap-2 text-xs text-muted-foreground leading-relaxed",children:[e.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full bg-primary/15 text-primary text-[10px] font-semibold flex items-center justify-center mt-0.5",children:x+1}),e.jsx("span",{children:c})]},x))})]})})}
1),!l&&e.jsx("p",{className:"text-[11px] text-muted-foreground/60 mt-4 italic",children:"Hover or tap to see a real scenario â"})]})]},n)})}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{value:t!==null?t.toLocaleString():"â",label:"Buying signals processed",orb:"bg-primary/25",glow:"from-primary/15 to-transparent"},{value:s?`${s}+`:"â",label:"Teams running agents",orb:"bg-accent/25",glow:"from-accent/15 to-transparent"},{value:"0",label:"Account bans reported",orb:"bg-emerald-400/20",glow:"from-emerald-400/10 to-transparent"}].map((o,n)=>e.jsxs("div",{className:"group relative rounded-2xl border border-white/[0.08] bg-gradient-to-br from-card/80 via-card/40 to-card/20 backdrop-blur-xl p-6 shadow-xl shadow-black/20 text-center overflow-hidden hover:border-primary/30 transition-all duration-300",children:[e.jsx("div",{className:`absolute -top-16 left-1/2 -translate-x-1/2 w-56 h-56 rounded-full blur-3xl ${o.orb} opacity-50 group-hover:opacity-80 transition-opacity duration-500 pointer-events-none`}),e.jsx("div",{className:`absolute inset-0 bg-gradient-to-b ${o.glow} pointer-events-none`}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"text-3xl md:text-4xl font-display font-semibold text-foreground mb-1",children:o.value}),e.jsx("div",{className:"text-sm text-muted-foreground",children:o.label})]})]},n))})]})]})},Wu=()=>e.jsx("section",{className:"border-t border-border/50",style:{paddingTop:"120px",paddingBottom:"120px"},children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"rounded-3xl border border-white/[0.08] bg-card/40 backdrop-blur-2xl p-8 md:p-14 shadow-2xl shadow-black/20 relative overflow-hidden",children:[e.jsx("div",{className:"absolute -top-32 -right-32 w-[400px] h-[400px] rounded-full blur-3xl bg-primary/[0.06] pointer-events-none"}),e.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",style:{backgroundImage:"linear-gradient(hsl(var(--border)) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--border)) 1px, transparent 1px)",backgroundSize:"32px 32px"}}),e.jsxs("div",{className:"relative z-10",children:[e.jsxs("div",{className:"max-w-3xl mb-12",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full border border-primary/20 bg-primary/5 mb-6",children:[e.jsx(Na,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"text-[11px] uppercase tracking-wider text-primary font-medium",children:"Safety layer"})]}),e.jsx("h2",{className:"text-4xl md:text-5xl font-display font-semibold mb-5 leading-[1.1]",children:"Built to scale without account bans."}),e.jsx("p",{className:"text-base md:text-lg text-muted-foreground leading-relaxed",children:"Every reply runs through your real browser session â same fingerprint, same cadence, same patterns the platform already trusts."})]}),e.jsx("div",{className:"grid md:grid-cols-4 gap-4",children:[{icon:Hl,title:"Device & UA fidelity",body:"Actions execute in your own browser via the extension. No headless bots, no proxy farms."},{icon:Gl,title:"Human-like cadence",body:"Throttled posting and randomized intervals stay under platform-safe thresholds."},{icon:Na,title:"Content risk policies",body:"Replies pass classifier checks for spam patterns and over-promotion before queuing."},{icon:Bt,title:"Review queue",body:"Risky classes always require approval. Safe classes can auto-post if you opt in."}].map((s,t)=>e.jsxs("div",{className:"rounded-xl border border-white/[0.06] bg-background/40 p-5",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 border border-primary/10 flex items-center justify-center mb-4",children:e.jsx(s.icon,{className:"h-5 w-5 text-primary"})}),e.jsx("h3",{className:"font-semibold text-sm mb-2",children:s.title}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:s.body})]},t))}),e.jsx("div",{className:"mt-10",children:e.jsxs(Ls,{to:"/security",className:"inline-flex items-center gap-1.5 text-sm text-primary hover:text-primary/80 transition-colors",children:["Read the full safety architecture",e.jsx(Ns,{className:"h-3.5 w-3.5"})]})})]})]})})}),Vu=()=>e.jsxs("section",{className:"max-w-3xl mx-auto px-6 lg:px-8 border-t border-border/50",style:{paddingTop:"120px",paddingBottom:"120px"},children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-primary/80 font-medium mb-4",children:"Common questions"}),e.jsx("h2",{className:"text-4xl md:text-5xl font-display font-semibold mb-4",children:"What teams ask first."})]}),e.jsx(ad,{type:"single",collapsible:!0,className:"space-y-3",children:[{q:"Will my accounts get banned?",a:"Every action runs inside your real browser session via the extension â same device, same fingerprint, same cadence as your manual usage. We pace replies under platform-safe thresholds and run content risk classifiers before anything posts."},{q:"Who actually controls the replies?",a:"You do. Risky-class replies always pass through a review queue. Safe-class replies (tone-matched, low-risk content) can auto-post if you opt in. Every action is logged and reversible."},{q:"Where does my data live?",a:"Profiles, queues and engagement data live in our managed backend. Social account credentials never leave your browser â the extension acts inside your own logged-in session."},{q:"How long until we see meetings?",a:"Most teams see the first qualified DM thread in week 1 and attributed meetings inside 2â3 weeks."}].map((s,t)=>e.jsxs(qi,{value:`faq-${t}`,className:"rounded-xl border border-white/[0.08] bg-card/40 backdrop-blur-xl px-5 shadow-lg shadow-black/5",children:[e.jsx(Hi,{className:"text-left text-base font-medium hover:no-underline py-5",children:s.q}),e.jsx(Gi,{className:"text-sm text-muted-foreground leading-relaxed pb-5",children:s.a})]},t))}),e.jsx("div",{className:"text-center mt-10",children:e.jsx(h,{asChild:!0,size:"lg",className:"rounded-full bg-primary text-primary-foreground hover:bg-primary/90",children:e.jsxs(Ls,{to:"/lp",children:["Talk to us",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]})})})]}),Yu="https://iqikbtfdddpbyxpztpbh.supabase.co",Ku="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImlxaWtidGZkZGRwYnl4cHp0cGJoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ0MDY4OTUsImV4cCI6MjA3OTk4Mjg5NX0.Ousbd6qOJMMRzWXeihaGZ0Lm_itZUKN3n2GKVujYEiQ",w=hm(Yu,Ku,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),Xu="https://deshiller.com",Qu="https://deshiller.com/favicon.png",Vt=({title:s,description:t,path:a,image:r=Qu,type:o="website",jsonLd:n})=>{const l=`${Xu}${a??(typeof window<"u"?window.location.pathname:"/")}`,c=n?Array.isArray(n)?n:[n]:[];return e.jsxs(pm,{children:[e.jsx("title",{children:s}),e.jsx("meta",{name:"description",content:t}),e.jsx("link",{rel:"canonical",href:l}),e.jsx("meta",{property:"og:title",content:s}),e.jsx("meta",{property:"og:description",content:t}),e.jsx("meta",{property:"og:url",content:l}),e.jsx("meta",{property:"og:type",content:o}),e.jsx("meta",{property:"og:image",content:r}),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:title",content:s}),e.jsx("meta",{name:"twitter:description",content:t}),e.jsx("meta",{name:"twitter:image",content:r}),c.map((x,d)=>e.jsx("script",{type:"application/ld+json",children:JSON.stringify(x)},d))]})},Ju=[{q:"Will my accounts get banned?",a:"Every action runs inside your real browser session via the extension â same device, same fingerprint, same cadence as your manual usage. We pace replies under platform-safe thresholds and run content risk classifiers before anything posts."},{q:"Who actually controls the replies?",a:"You do. Risky-class replies always pass through a review queue. Safe-class replies (tone-matched, low-risk content) can auto-post if you opt in. Every action is logged and reversible."},{q:"Where does my data live?",a:"Profiles, queues and engagement data live in our managed backend. Social account credentials never leave your browser â the extension acts inside your own logged-in session."},{q:"How long until we see meetings?",a:"Most teams see the first qualified DM thread in week 1 and attributed meetings inside 2â3 weeks."}],Zu=[{"@context":"https://schema.org","@type":"Organization",name:"deSHILLER",url:"https://deshiller.com",logo:"https://deshiller.com/favicon.png",sameAs:[],description:"AI agents that turn social conversations into qualified meetings on X, LinkedIn, Reddit, Quora, YouTube and Facebook."},{"@context":"https://schema.org","@type":"WebSite",name:"deSHILLER",url:"https://deshiller.com",potentialAction:{"@type":"SearchAction",target:"https://deshiller.com/academy?q={search_term_string}","query-input":"required name=search_term_string"}},{"@context":"https://schema.org","@type":"FAQPage",mainEntity:Ju.map(s=>
1({"@type":"Question",name:s.q,acceptedAnswer:{"@type":"Answer",text:s.a}}))}],eh=()=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-5 w-5 fill-current","aria-hidden":"true",children:e.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),sh=()=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-5 w-5 fill-current","aria-hidden":"true",children:e.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})}),th=()=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-5 w-5 fill-current","aria-hidden":"true",children:e.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"})}),ah=()=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-5 w-5 fill-current","aria-hidden":"true",children:e.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})}),rh=()=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-5 w-5 fill-current","aria-hidden":"true",children:e.jsx("path",{d:"M12.738 18.702c-.818-1.622-1.903-3.126-3.594-3.126-.59 0-1.237.246-1.686.613l-.645-1.113c.75-.772 1.963-1.327 3.438-1.327 2.403 0 3.695 1.254 4.73 2.794.346-1.028.534-2.248.534-3.66 0-5.013-2.19-8.42-6.215-8.42-4.025 0-6.215 3.407-6.215 8.42 0 4.987 2.19 8.395 6.215 8.395.889 0 1.688-.156 2.438-.576zM9.3 24c4.628 0 8.278-1.767 10.584-4.773l-1.422-1.098c.378-.633.786-1.29.786-2.04 0-1.046-.691-1.655-1.776-1.655-.846 0-1.537.354-2.085.903C16.834 12.51 17.7 9.412 17.7 6.6 17.7 2.348 14.352 0 9.3 0 4.248 0 .9 2.348.9 6.6c0 4.252 3.348 6.6 8.4 6.6.531 0 1.038-.03 1.52-.091-.273.548-.475 1.148-.475 1.791 0 1.276.609 2.243 1.543 2.935C6.738 18.24 3.6 20.286 3.6 22.8c0 .73.282 1.2.282 1.2H9.3z"})}),nh=()=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-5 w-5 fill-current","aria-hidden":"true",children:e.jsx("path",{d:"M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z"})}),ih=()=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-5 w-5 fill-current","aria-hidden":"true",children:e.jsx("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})}),oh=()=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-5 w-5 fill-current","aria-hidden":"true",children:e.jsx("path",{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08
1-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"})}),lh=()=>{const s=ns(),[t,a]=i.useState(null),[r,o]=i.useState(null),[n,l]=i.useState(""),[c,x]=i.useState(!1);i.useEffect(()=>{const M=()=>x(window.innerWidth<768);return M(),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]),i.useEffect(()=>{(async()=>{const[q,_]=await Promise.all([w.rpc("get_user_count"),w.rpc("get_discovered_posts_count")]);!q.error&&q.data&&a(q.data),!_.error&&_.data&&o(_.data)})()},[]);const{bind:d}=Hu({onSwipeLeft:()=>{},onSwipeRight:()=>{},threshold:100}),u=()=>{const M=new URLSearchParams;n.trim()&&M.set("url",n.trim()),s(`/get-started?${M.toString()}`)},m=["How do I get my product mentioned in AI search results?","Can AI write LinkedIn posts that don't sound like AI?","What's the best way to find warm leads on Reddit?","How do I build a content calendar without a designer?","Is there a tool that auto-replies to relevant tweets?","How do people get featured in ChatGPT recommendations?","How do I send cold DMs on LinkedIn without getting banned?","Can I automate social posting across platforms?","What tools help with AI overview rankings?","How do I track brand mentions across social media?","Best way to create branded visuals without Canva?","How do founders find their first 100 customers?","Is there a copilot for social media marketing?","How to prospect on X without spending hours scrolling?","Can AI generate social creatives from my product photos?","What's working for B2B lead gen on LinkedIn right now?","How do I monitor competitor mentions on Reddit?","Any tool that handles outreach and content creation together?"],[p,g]=i.useState(()=>m.slice(0,6)),[v,b]=i.useState(-1),z=i.useRef(6),C=i.useRef(0);i.useEffect(()=>{const M=setInterval(()=>{const q=C.current,_=z.current%m.length;b(q),setTimeout(()=>{g(A=>{const B=[...A];return B[q]=m[_],B}),b(-1),z.current=_+1,C.current=(q+1)%6},500)},3e3);return()=>clearInterval(M)},[]);const j=7,[y,N]=i.useState(0);i.useEffect(()=>{const M=setInterval(()=>{N(q=>(q+1)%j)},2400);return()=>clearInterval(M)},[]);const f=[{value:r!==null?r.toLocaleString():"...",label:"Posts discovered"},{value:t?`${t}+`:"...",label:"Active users"},{value:"73%",label:"Avg. engagement rate"}],R=[{name:"Starter",price:"8",description:"For individual founders",features:["50 discoveries per month","All platforms (X, LinkedIn, Reddit)","AI reply generation","1 product profile","Email support"]},{name:"Pro",price:"49",description:"For growing teams",features:["500 discoveries per month","All platforms (X, LinkedIn, Reddit)","AI reply generation","3 product profiles","Priority support","Analytics dashboard","Custom tone settings"],popular:!0},{name:"Enterprise",price:"Custom",description:"For organizations",features:["Unlimited discoveries","All platforms","Unlimited profiles","Dedicated support","Custom integrations","Team collaboration","White-label option"]}];return e.jsxs("div",{...c?d():{},className:"min-h-screen bg-background text-foreground relative overflow-hidden",style:{touchAction:"pan-y"},children:[e.jsx(Vt,{title:"deSHILLER â Pipeline from social, without account bans",description:"AI agents that turn social conversations into qualified meetings on X, LinkedIn, Reddit, Quora, YouTube and Facebook. Built for B2B teams. Zero account bans.",path:"/",jsonLd:Zu}),e.jsxs("div",{className:"fixed inset-0 pointer-events-none z-0",children:[e.jsx("div",{className:"absolute w-[600px] h-[600px] rounded-full blur-3xl animate-pulse bg-primary/[0.07] -top-40 -right-40"}),e.jsx("div",{className:"absolute w-[500px] h-[500px] rounded-full blur-3xl animate-pulse bg-accent/[0.05] -bottom-32 -left-32"}),e.jsx("div",{className:"absolute w-[300px] h-[300px] rounded-full blur-3xl animate-pulse bg-primary/[0.04] top-1/2 left-1/3"}),e.jsx("div",{className:"absolute w-[400px] h-[400px] rounded-full blur-3xl animate-pulse bg-accent/[0.03] top-[20%] right-[15%]",style:{animationDelay:"2s"}})]}),e.jsx("div",{className:"fixed inset-0 opacity-[0.015] pointer-events-none mix-blend-overlay z-0",children:e.jsxs("svg",{width:"100%",height:"100%",children:[e.jsx("filter",{id:"grain-home",children:e.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.8",numOctaves:"4",stitchTiles:"stitch"})}
1),e.jsx("rect",{width:"100%",height:"100%",filter:"url(#grain-home)"})]})}),e.jsx(Ma,{}),e.jsxs("section",{className:"relative min-h-[85vh] flex flex-col items-center justify-center px-6",children:[e.jsx("div",{className:"absolute inset-0 z-0",style:{backgroundImage:` 2 linear-gradient(to right, hsl(var(--border) / 0.15) 1px, transparent 1px), 3 linear-gradient(to bottom, hsl(var(--border) / 0.15) 1px, transparent 1px) 4 `,backgroundSize:"60px 60px"}}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-background/80 via-transparent via-40% to-transparent z-0"}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-[25%] bg-gradient-to-b from-transparent to-background z-[1]"}),e.jsx("div",{className:"absolute top-1/4 left-1/2 -translate-x-1/2 w-[700px] h-[400px] rounded-full blur-3xl bg-primary/[0.06] z-0 pointer-events-none"}),e.jsx("div",{className:"absolute top-[60%] left-1/3 w-[300px] h-[300px] rounded-full blur-3xl bg-accent/[0.04] z-0 pointer-events-none"}),e.jsxs("div",{className:"absolute inset-0 z-10 pointer-events-none hidden lg:block",children:[e.jsx("div",{className:"absolute left-4 xl:left-8 2xl:left-12 top-28 bottom-20 flex flex-col justify-around max-w-[220px] xl:max-w-[260px]",children:p.slice(0,3).map((M,q)=>e.jsx("div",{className:"bg-card/60 backdrop-blur-xl text-muted-foreground px-3.5 py-2 rounded-xl text-[11px] leading-relaxed font-medium border border-border/20 shadow-lg shadow-black/10",style:{animation:`badge-float-${q} 6s ease-in-out infinite`,transition:"opacity 0.5s ease, transform 0.5s ease",opacity:v===q?0:1,transform:v===q?"translateY(4px) scale(0.97)":"translateY(0) scale(1)"},children:M},`badge-left-${q}`))}),e.jsx("div",{className:"absolute right-4 xl:right-8 2xl:right-12 top-28 bottom-20 flex flex-col justify-around items-end max-w-[220px] xl:max-w-[260px]",children:p.slice(3,6).map((M,q)=>e.jsx("div",{className:"bg-card/60 backdrop-blur-xl text-muted-foreground px-3.5 py-2 rounded-xl text-[11px] leading-relaxed font-medium border border-border/20 shadow-lg shadow-black/10 text-right",style:{animation:`badge-float-${q} 6s ease-in-out infinite`,transition:"opacity 0.5s ease, transform 0.5s ease",opacity:v===q+3?0:1,transform:v===q+3?"translateY(4px) scale(0.97)":"translateY(0) scale(1)"},children:M},`badge-right-${q}`))})]}),e.jsx("style",{children:` 5 @keyframes badge-float-0 { 6 0%, 100% { transform: translateY(0px); } 7 50% { transform: translateY(-6px); } 8 } 9 @keyframes badge-float-1 { 10 0%, 100% { transform: translateY(0px); } 11 50% { transform: translateY(-5px); } 12 } 13 @keyframes badge-float-2 { 14 0%, 100% { transform: translateY(0px); } 15 50% { transform: translateY(-7px); } 16 } 17 @keyframes badge-enter { 18 from { opacity: 0; transform: translateY(8px) scale(0.97); } 19 to { opacity: 1; transform: translateY(0) scale(1); } 20 } 21 `}),e.jsx("div",{className:"relative z-20 text-center max-w-3xl mx-auto py-24 px-4",children:e.jsxs("div",{className:"rounded-3xl border border-primary/20 bg-background/45 backdrop-blur-2xl p-10 md:p-14 shadow-2xl shadow-primary/10 relative overflow-hidden ring-1 ring-accent/10",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-white/[0.04] via-transparent to-transparent pointer-events-none"}),e.jsx("div",{className:"absolute -top-24 left-1/2 -translate-x-1/2 w-[480px] h-[220px] rounded-full blur-3xl bg-accent/[0.12] pointer-events-none"}),e.jsxs("div",{className:"relative z-10",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full border border-primary/30 bg-primary/10 text-[11px] uppercase tracking-[0.18em] text-primary/90 mb-6",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary animate-pulse"}),"Your AI growth team"]}),e.jsxs("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-display font-semibold leading-[1.05] tracking-tight mb-6 text-balance",children:["Replace your"," ",e.jsx("span",{className:"inline-grid align-baseline",children:["growth team","SDR","copywriter","content team","social media manager","BDR","marketing agency","guerilla marketing","social outreach"].map((M,q)=>e.jsx("span",{className:"bg-gradient-to-r from-primary via-accent to-primary bg-clip-text text-transparent whitespace-nowrap transition-opacity duration-700 ease-in-out",style:{gridArea:"1 / 1",opacity:y===q?1:0},children:M},M))}),e.jsx("br",{className:"hidden md:block"}),"with one AI agent."]}),e.jsx("p",{className:"text-base md:text-lg text-muted-foreground leading-relaxed max-w-2xl mx-auto mb-6",children:"deSHILLER finds buyers talking about your problem, replies in your voice, sends DMs, books meetings, and posts your content â across X, LinkedIn, Reddit, Quora, YouTube and Facebook. From your real browser. Zero bans."}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-2 gap-y-1 text-[11px] uppercase tracking-wider text-muted-foreground
21/70 mb-9",children:[e.jsx("span",{className:"text-primary/90",children:"Discover"}),e.jsx("span",{className:"opacity-30",children:"·"}),e.jsx("span",{className:"text-primary/90",children:"Reply"}),e.jsx("span",{className:"opacity-30",children:"·"}),e.jsx("span",{className:"text-primary/90",children:"DM"}),e.jsx("span",{className:"opacity-30",children:"·"}),e.jsx("span",{className:"text-primary/90",children:"Cold reach"}),e.jsx("span",{className:"opacity-30",children:"·"}),e.jsx("span",{className:"text-primary/90",children:"Create"}),e.jsx("span",{className:"opacity-30",children:"·"}),e.jsx("span",{className:"text-primary/90",children:"Schedule"}),e.jsx("span",{className:"opacity-30",children:"·"}),e.jsx("span",{className:"text-primary/90",children:"Close"})]}),e.jsxs("div",{className:"max-w-md mx-auto",children:[e.jsxs("div",{className:"relative flex items-center bg-background/40 backdrop-blur-xl border border-white/[0.1] rounded-full p-1.5 pl-5 shadow-2xl shadow-black/30 ring-1 ring-white/[0.05]",children:[e.jsx(gm,{className:"h-4 w-4 text-muted-foreground mr-3 flex-shrink-0"}),e.jsx(Je,{type:"url",placeholder:"Enter your product URL...",value:n,onChange:M=>l(M.target.value),className:"flex-1 bg-transparent border-0 text-foreground placeholder:text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0 text-sm",onKeyDown:M=>{M.key==="Enter"&&u()}}),e.jsx(h,{onClick:u,size:"icon",className:"h-10 w-10 rounded-full bg-gradient-to-br from-primary to-accent text-primary-foreground hover:opacity-90 flex-shrink-0",children:e.jsx(Ns,{className:"h-4 w-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-3",children:"No credit card · 24-hour trial · Built for real accounts"}),e.jsxs("div",{className:"flex items-center justify-center gap-4 mt-5",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground/60 uppercase tracking-wide",children:"Works with"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"text-muted-foreground/60 hover:text-foreground transition-colors",title:"X (Twitter)",children:e.jsx(eh,{})}),e.jsx("div",{className:"text-muted-foreground/60 hover:text-foreground transition-colors",title:"LinkedIn",children:e.jsx(sh,{})}),e.jsx("div",{className:"text-muted-foreground/60 hover:text-foreground transition-colors",title:"Reddit",children:e.jsx(th,{})}),e.jsx("div",{className:"text-muted-foreground/60 hover:text-foreground transition-colors",title:"Quora",children:e.jsx(rh,{})}),e.jsx("div",{className:"text-muted-foreground/60 hover:text-foreground transition-colors",title:"Facebook",children:e.jsx(ah,{})}),e.jsx("div",{className:"text-muted-foreground/60 hover:text-foreground transition-colors",title:"YouTube",children:e.jsx(ih,{})})]}),e.jsx("span",{className:"text-[11px] text-muted-foreground/40 uppercase tracking-wide",children:"Soon"}),e.jsxs("div",{className:"flex items-center gap-3 opacity-40",children:[e.jsx("div",{className:"text-muted-foreground",title:"Instagram",children:e.jsx(nh,{})}),e.jsx("div",{className:"text-muted-foreground",title:"TikTok",children:e.jsx(oh,{})})]})]})]})]})]})}),e.jsx("div",{className:"relative z-20 w-full max-w-3xl mx-auto mt-10 mb-16",children:e.jsx("div",{className:"grid grid-cols-3 gap-1 rounded-2xl border border-white/[0.08] bg-card/30 backdrop-blur-2xl shadow-2xl shadow-black/10 overflow-hidden",children:f.map((M,q)=>e.jsxs("div",{className:"text-center py-6 px-4 relative",children:[q>0&&e.jsx("div",{className:"absolute left-0 top-1/4 bottom-1/4 w-px bg-white/[0.06]"}),e.jsx("div",{className:"text-2xl md:text-3xl font-semibold mb-1",children:M.value}),e.jsx("div",{className:"text-sm text-muted-foreground",children:M.label})]},q))})})]}),e.jsx(Uu,{userCount:t,discoveredPostsCount:r}),e.jsxs("section",{className:"max-w-7xl mx-auto px-6 lg:px-8 border-t border-border/50",style:{paddingTop:"80px",paddingBottom:"80px"},children:[e.jsxs("div",{className:"text-center mb-20",children:[e.jsx("h2",{className:"text-4xl md:text-5xl font-display font-semibold mb-4",children:"Here's how it works."}),e.jsx("p",{className:"text-muted-foreground text-base max-w-2xl mx-auto leading-relaxed",children:"From product registration to qualified leads â our AI handles the heavy lifting."})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-12 lg:gap-20 items-center mb-32",children:[e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center gap-4 mb-6",children:e.jsx("div",{className:"w-14 h-14 roun
21ded-2xl bg-primary/20 flex items-center justify-center text-primary font-bold text-2xl",children:"1"})}),e.jsx("h3",{className:"text-3xl font-display font-semibold mb-4",children:"Register your product."}),e.jsx("p",{className:"text-muted-foreground text-lg leading-relaxed",children:"Tell us about your product â name, value proposition, and ideal customer. Our AI learns everything about your brand to engage authentically."})]}),e.jsx("div",{className:"rounded-2xl border border-white/[0.08] bg-card/40 backdrop-blur-xl p-6 shadow-2xl shadow-black/10",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/20 flex items-center justify-center",children:e.jsx(Ai,{className:"h-4 w-4 text-primary"})}),e.jsx("span",{className:"font-semibold text-sm",children:"Product Profile"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"rounded-lg bg-background/60 border border-border/30 p-3",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground mb-1",children:"Product Name"}),e.jsx("p",{className:"text-sm font-medium",children:"Acme Analytics"})]}),e.jsxs("div",{className:"rounded-lg bg-background/60 border border-border/30 p-3",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground mb-1",children:"Value Proposition"}),e.jsx("p",{className:"text-sm font-medium",children:"Real-time analytics for SaaS teams that want to understand user behavior"})]}),e.jsxs("div",{className:"rounded-lg bg-background/60 border border-border/30 p-3",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground mb-1",children:"Ideal Customer"}),e.jsx("p",{className:"text-sm font-medium",children:"B2B SaaS founders, product managers, growth marketers"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"px-2.5 py-1 rounded-full bg-primary/10 text-primary text-xs font-medium",children:"analytics"}),e.jsx("div",{className:"px-2.5 py-1 rounded-full bg-primary/10 text-primary text-xs font-medium",children:"SaaS"}),e.jsx("div",{className:"px-2.5 py-1 rounded-full bg-primary/10 text-primary text-xs font-medium",children:"B2B"})]})]})]})})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-12 lg:gap-20 items-center mb-32",children:[e.jsx("div",{className:"order-2 md:order-1 rounded-2xl border border-white/[0.08] bg-card/40 backdrop-blur-xl p-6 shadow-2xl shadow-black/10",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-accent/20 flex items-center justify-center",children:e.jsx(ks,{className:"h-4 w-4 text-accent"})}),e.jsx("span",{className:"font-semibold text-sm",children:"Discovered Posts"}),e.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"12 new"})]}),[{platform:"Reddit",score:92,text:"Looking for a good analytics tool for our SaaS. Any recommendations?",sub:"r/SaaS"},{platform:"LinkedIn",score:87,text:"We're struggling with user retention metrics. Anyone solved this?",sub:"Product Management"},{platform:"X",score:78,text:"What analytics platform do you use for tracking product usage?",sub:"@pmleader"}].map((M,q)=>e.jsxs("div",{className:"rounded-lg bg-background/60 border border-border/30 p-3 flex items-start gap-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-[10px] font-bold shrink-0 ${M.score>85?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:M.score}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-[10px] font-medium text-primary",children:M.platform}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:M.sub})]}),e.jsx("p",{className:"text-xs text-foreground/80 line-clamp-2",children:M.text})]})]},q))]})}),e.jsxs("div",{className:"order-1 md:order-2",children:[e.jsx("div",{className:"flex items-center gap-4 mb-6",children:e.jsx("div",{className:"w-14 h-14 roun
21ded-2xl bg-accent/20 flex items-center justify-center text-accent font-bold text-2xl",children:"2"})}),e.jsx("h3",{className:"text-3xl font-display font-semibold mb-4",children:"Discover conversations."}),e.jsx("p",{className:"text-muted-foreground text-lg leading-relaxed",children:"Our AI scans X, LinkedIn, Reddit, and Quora in real-time, finding conversations where people are looking for exactly what you offer. Each post gets a relevance score."})]})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-12 lg:gap-20 items-center mb-32",children:[e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center gap-4 mb-6",children:e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-primary/20 flex items-center justify-center text-primary font-bold text-2xl",children:"3"})}),e.jsx("h3",{className:"text-3xl font-display font-semibold mb-4",children:"Engage naturally."}),e.jsx("p",{className:"text-muted-foreground text-lg leading-relaxed",children:"AI generates thoughtful, human-sounding replies that naturally mention your product. Review, edit, and approve â or let the Lead Machine auto-engage on your behalf."})]}),e.jsx("div",{className:"rounded-2xl border border-white/[0.08] bg-card/40 backdrop-blur-xl p-6 shadow-2xl shadow-black/10",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/20 flex items-center justify-center",children:e.jsx(ms,{className:"h-4 w-4 text-primary"})}),e.jsx("span",{className:"font-semibold text-sm",children:"AI-Generated Reply"})]}),e.jsxs("div",{className:"rounded-lg bg-background/60 border border-border/30 p-3",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground mb-2",children:"Original post on r/SaaS:"}),e.jsx("p",{className:"text-xs text-foreground/60 italic",children:'"Looking for a good analytics tool for our SaaS..."'})]}),e.jsxs("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3",children:[e.jsx("p",{className:"text-[11px] text-primary mb-2",children:"Generated reply:"}),e.jsx("p",{className:"text-xs text-foreground/80",children:'"We had the same challenge. Tried a few tools â Mixpanel was too complex for our team. We ended up using Acme Analytics which has a much simpler setup. The retention cohort view was really helpful for identifying drop-off points."'})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"px-3 py-1.5 rounded-full bg-primary text-primary-foreground text-xs font-medium",children:"Approve & Post"}),e.jsx("div",{className:"px-3 py-1.5 rounded-full bg-muted text-muted-foreground text-xs font-medium",children:"Edit"}),e.jsx("div",{className:"px-3 py-1.5 rounded-full bg-muted text-muted-foreground text-xs font-medium",children:"Regenerate"})]})]})})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-12 lg:gap-20 items-center",children:[e.jsx("div",{className:"order-2 md:order-1 rounded-2xl border border-white/[0.08] bg-card/40 backdrop-blur-xl p-6 shadow-2xl shadow-black/10",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-accent/20 flex items-center justify-center",children:e.jsx(wa,{className:"h-4 w-4 text-accent"})}),e.jsx("span",{className:"font-semibold text-sm",children:"Qualified Leads"}),e.jsx("span",{className:"ml-auto text-[10px] px-2 py-0.5 rounded-full bg-green-500/20 text-green-400 font-medium",children:"+23 this week"})]}),[{name:"Sarah Chen",role:"VP Product @ TechCorp",platform:"LinkedIn",status:"Replied"},{name:"Mike Rivera",role:"Founder @ StartupXYZ",platform:"X",status:"DM Sent"},{name:"Alex Kim",role:"Head of Growth @ Scale.io",platform:"Reddit",status:"Engaged"}].map((M,q)=>e.jsxs("div",{className:"rounded-lg bg-background/60 border border-border/30 p-3 flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary text-xs font-bold shrink-0",children:M.name.split(" ").map(_=>_[0]).join("")}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-xs font-medium truncate",children:M.name}),e.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:M.role})]}),e.jsxs("div",{className:"text-right shrink-0",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:M.platform}),e.jsx("p",{className:`text-[10px] font-medium ${M.status==="Replied"?"text-green-400":"text-primary"}`,children:M.status})]})]},q))]})}),e.jsxs("div",{className:"order-1 md:order-2",children:[e.jsx("div",{className:"flex items-center gap-4 mb-6",children:e.jsx("div",{className:"w-14 h-14 roun
21ded-2xl bg-accent/20 flex items-center justify-center text-accent font-bold text-2xl",children:"4"})}),e.jsx("h3",{className:"text-3xl font-display font-semibold mb-4",children:"Create leads."}),e.jsx("p",{className:"text-muted-foreground text-lg leading-relaxed",children:"Conversations turn into prospects. Cold Reach finds ideal buyers, sends personalized DMs, and tracks every interaction â building your pipeline on autopilot."})]})]})]}),e.jsx(Wu,{}),e.jsxs("section",{id:"pricing",className:"max-w-7xl mx-auto px-6 lg:px-8 border-t border-border/50",style:{paddingTop:"120px",paddingBottom:"120px"},children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("h2",{className:"text-4xl font-display font-semibold mb-4",children:"Simple, transparent pricing"}),e.jsx("p",{className:"text-muted-foreground text-base leading-relaxed",children:"Start with a 24-hour free trial. No credit card required."})]}),e.jsxs("div",{className:"max-w-3xl mx-auto mb-14 rounded-2xl border border-primary/20 bg-gradient-to-br from-primary/[0.06] via-card/40 to-card/40 backdrop-blur-xl p-5 md:p-6 flex flex-col md:flex-row md:items-center gap-4 md:gap-6 shadow-xl shadow-primary/5",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.2em] text-primary font-medium mb-1.5",children:"For teams · 4-week pilot"}),e.jsx("p",{className:"text-sm text-foreground/90 leading-relaxed",children:"Want a managed setup with weekly tuning sessions? We onboard your team, configure agents against your ICP, and prove pipeline in four weeks."})]}),e.jsxs(h,{onClick:()=>s("/lp"),className:"rounded-full bg-primary text-primary-foreground hover:bg-primary/90 shrink-0",children:["Talk about a pilot",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-8 max-w-6xl mx-auto",children:R.map((M,q)=>e.jsxs(U,{className:`p-8 relative hover:shadow-2xl transition-all backdrop-blur-xl ${M.popular?"border-primary/30 shadow-2xl shadow-primary/5 scale-105 bg-card/50":"border-white/[0.08] hover:border-primary/20 bg-card/40"}`,children:[M.popular&&e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2",children:e.jsx("span",{className:"bg-primary text-primary-foreground px-3 py-1 rounded-full text-xs font-medium",children:"Most Popular"})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-display font-semibold",children:M.name}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:M.description})]}),e.jsx("div",{className:"flex items-baseline",children:M.price!=="Custom"?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-4xl font-semibold",children:["$",M.price]}),e.jsx("span",{className:"text-muted-foreground ml-2",children:"/month"})]}):e.jsx("span",{className:"text-4xl font-semibold",children:M.price})}),e.jsx(h,{className:`w-full ${M.popular?"bg-primary text-primary-foreground hover:bg-primary/90":"bg-secondary text-secondary-foreground hover:bg-secondary/80"}`,onClick:()=>s("/auth"),children:M.price==="Custom"?"Contact Sales":"Start Trial"}),e.jsx("ul",{className:"space-y-3",children:M.features.map((_,A)=>e.jsxs("li",{className:"flex items-center gap-3 text-sm",children:[e.jsx(bs,{className:"h-4 w-4 text-primary flex-shrink-0"}),e.jsx("span",{children:_})]},A))})]})]},q))})]}),e.jsx(Vu,{}),e.jsx(_s,{})]})},ch=({d:s,label:t})=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-5 w-5 fill-current","aria-hidden":"true","aria-label":t,children:e.jsx("path",{d:s})}),dh=[{label:"X",d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z",status:"live"},{label:"LinkedIn",d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z",status:"live"},{label:"Reddit",d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z",status:"live"},{label:"Quora",d:"M12.738 18.702c-.818-1.622-1.903-3.126-3.594-3.126-.59 0-1.237.246-1.686.613l-.645-1.113c.75-.772 1.963-1.327 3.438-1.327 2.403 0 3.695 1.254 4.73 2.794.346-1.028.534-2.248.534-3.66 0-5.013-2.19-8.42-6.215-8.42-4.025 0-6.215 3.407-6.215 8.42 0 4.987 2.19 8.395 6.215 8.395.889 0 1.688-.156 2.438-.576zM9.3 24c4.628 0 8.278-1.767 10.584-4.773l-1.422-1.098c.378-.633.786-1.29.786-2.04 0-1.046-.691-1.655-1.776-1.655-.846 0-1.537.354-2.085.903C16.834 12.51 17.7 9.412 17.7 6.6 17.7 2.348 14.352 0 9.3 0 4.248 0 .9 2.348.9 6.6c0 4.252 3.348 6.6 8.4 6.6.531 0 1.038-.03
211.52-.091-.273.548-.475 1.148-.475 1.791 0 1.276.609 2.243 1.543 2.935C6.738 18.24 3.6 20.286 3.6 22.8c0 .73.282 1.2.282 1.2H9.3z",status:"live"},{label:"Facebook",d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z",status:"live"},{label:"YouTube",d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z",status:"live"},{label:"Instagram",d:"M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558a5.898 5.898 0 0 0 2.126-1.384c.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227a3.81 3.81 0 0 1-.899 1.382c-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421a3.716 3.716 0 0 1-1.379-.899 3.644 3.644 0 0 1-.9-1.38c-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 0 0 0-12.324zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405a1.441 1.441 0 1 1-2.88 0 1.441 1.441 0 0 1 2.88 0z",status:"soon"},{label:"TikTok",d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z",status:"soon"}],mh=()=>{const s=ns(),[t,a]=i.useState(0),r=[{icon:Ks,title:"Smart Discovery",desc:"AI scans all 6 platforms 24/7 to find conversations where your product solves a real problem.",detail:"Keyword monitoring, competitor mentions, question detection, and real-time relevance scoring â all automated.",mockup:e.jsx("div",{className:"space-y-2.5",children:[{platform:"r/SaaS",text:"Best analytics tool for early-stage startups?",score:94},{platform:"LinkedIn",text:"Looking for a Mixpanel alternative that's actually affordable",score:89},{platform:"X",text:"Anyone tried a tool that auto-finds leads on social?",score:86}].map((o,n)=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border border-border/20 bg-background/40",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx(Ks,{className:"h-3.5 w-3.5 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground",children:o.platform}),e.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary font-medium",children:[o.score,"% match"]})]}),e.jsx("p",{className:"text-xs text-foreground leading-snug",children:o.text})]})]},n))})},{icon:ms,title:"AI-Powered Replies",desc:"Generate human-sounding responses that naturally weave in your product â no spammy templates.",detail:"Tone of voice control, context-aware generation, multi-variant suggestions, and one-click approval.",mockup:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"p-3 rounded-lg border border-border/20 bg-background/40",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(es,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"text-[11px] font-medium",children:"AI-Generated Reply"})]}),e.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:["Great question! We switched from Mixpanel to ",e.jsx("span",{className:"text-foreground font-medium",children:"Acme Analytics"})," 3 months ago â the real-time dashboards and team features made it a no-brainer. Might be worth checking out if you want something more affordable with better collaboration."]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"px-2.5 py-1 rounded-lg bg-primary/10 text-primary text-[10px] font-medium",children:"Professional"}),e.jsx("div",{className:"px-2.5 py-1 rounded-lg bg-muted text-muted-foreground text-[10px]",children:"Casual"}),e.jsx("div",{className:"px-2.5 py-1 rounded-lg bg-muted text-muted-foreground text-[10px]",children:"Witty"})]})]})},{icon:wa,title:"Cold Reach",desc:"Find and message prospects with AI-personalized cold DMs across LinkedIn and X.",detail:"ICP-matched scoring, multi-step sequences, follow-up automation, and conversation tracking.",mockup:e.jsxs("div",{className:"space-y-2.5",children:[[{name:"Sarah Chen",role:"VP Product @ Str
21ipe",match:96},{name:"Marcus Rivera",role:"Growth Lead @ Notion",match:91}].map((o,n)=>e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-border/20 bg-background/40",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/15 flex items-center justify-center text-[11px] font-semibold text-primary",children:o.name[0]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-xs font-medium",children:o.name}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:o.role})]}),e.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary font-medium",children:[o.match,"%"]})]},n)),e.jsx("div",{className:"p-2.5 rounded-lg border border-dashed border-primary/30 bg-primary/5 text-center",children:e.jsx("span",{className:"text-[10px] text-primary font-medium",children:"+ 47 more prospects found"})})]})},{icon:Ga,title:"Social Pulse",desc:"Real-time brand monitoring with sentiment analysis, spike alerts, and competitor tracking.",detail:"Hourly mention stats, keyword tracking, sentiment history, and automated weekly digest reports.",mockup:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border border-border/20 bg-background/40",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium",children:"Brand Sentiment"}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Last 7 days"})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-lg font-semibold text-primary",children:"78%"}),e.jsx("p",{className:"text-[10px] text-primary",children:"+12% â"})]})]}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[{l:"Positive",v:"142",c:"text-primary"},{l:"Neutral",v:"58",c:"text-muted-foreground"},{l:"Negative",v:"11",c:"text-destructive"}].map((o,n)=>e.jsxs("div",{className:"p-2 rounded-lg bg-background/40 border border-border/20 text-center",children:[e.jsx("p",{className:`text-sm font-semibold ${o.c}`,children:o.v}),e.jsx("p",{className:"text-[9px] text-muted-foreground",children:o.l})]},n))})]})},{icon:Et,title:"Agent Builder",desc:"Visual workflow canvas to build custom automation agents â no code required.",detail:"Drag-and-drop nodes, schedule or event triggers, and discover â reply â post chains.",mockup:e.jsx("div",{className:"space-y-2",children:["Discover posts on Reddit","Filter by relevance > 80%","Generate AI reply","Queue for approval"].map((o,n)=>e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold ${n<3?"bg-primary/15 text-primary":"bg-muted text-muted-foreground"}`,children:n+1}),e.jsx("div",{className:"flex-1 h-px bg-border/40"}),e.jsx("span",{className:"text-[11px] text-foreground",children:o})]},n))})},{icon:ws,title:"Auto-Engage",desc:"Set it and forget it â auto-engage handles responses while you focus on closing deals.",detail:"Daily limits, platform-specific rules, cool-down periods, trust scoring, and pause anytime.",mockup:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-primary/5 border border-primary/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-primary animate-pulse"}),e.jsx("span",{className:"text-xs font-medium",children:"Auto-Engage Active"})]}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"24/50 today"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{l:"Replies sent",v:"127"},{l:"Leads generated",v:"18"},{l:"Avg. engagement",v:"4.2%"},{l:"Platforms active",v:"4"}].map((o,n)=>e.jsxs("div",{className:"p-2.5 rounded-lg bg-background/40 border border-border/20",children:[e.jsx("p",{className:"text-sm font-semibold",children:o.v}),e.jsx("p",{className:"text-[9px] text-muted-foreground",children:o.l})]},n))})]})},{icon:Bt,title:"AIO Visibility",desc:"Get your product mentioned in AI search results â ChatGPT, Perplexity, Google AI Overviews.",detail:"Strategic comment placement, social signal optimization, and AI overview mention tracking.",mockup:e.jsxs("div",{className:"p-3 rounded-lg border border-border/20 bg-background/40 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Bt,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"text-[11px] font-medium",children:"AI Overview Mention"})]}),e.jsxs("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-2.5",children:[e.jsxs("p",{className:"text-[10px] text-muted-foreground leading-relaxed",children:['"For startups looking for affordable analytics, ',e.jsx("span",{className:"text-primary font-medium",children:"Acme Analytics"}),' is frequently recommended in developer communities for its real-time dashboards and team features..."']}
21),e.jsx("p",{className:"text-[9px] text-muted-foreground/60 mt-1",children:"â Google AI Overview"})]})]})},{icon:Ii,title:"Enterprise API",desc:"Full API for Claude, Perplexity, Replit, n8n, and any HTTP-capable AI agent.",detail:"Discover posts, generate comments, manage engagement â all via REST API with usage-based pricing.",mockup:e.jsxs("div",{className:"p-3 rounded-lg border border-border/20 bg-background/40 font-mono text-[10px] space-y-1 text-muted-foreground",children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-primary",children:"POST"})," /enterprise-api"]}),e.jsxs("p",{children:["{",' "action": "discover",']}),e.jsxs("p",{children:[" ",'"platform": "linkedin",']}),e.jsxs("p",{children:[" ",'"keywords": ["saas", "analytics"] ',"}"]}),e.jsx("p",{className:"text-primary mt-2",children:"â 12 posts discovered"})]})}];return i.useEffect(()=>{const o=setInterval(()=>a(n=>(n+1)%r.length),5e3);return()=>clearInterval(o)},[]),e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(Vt,{title:"Features â discovery, AI replies, lead pipeline | deSHILLER",description:"Find buying-intent conversations across X, LinkedIn, Reddit, Quora, YouTube and Facebook, then engage them safely from your real browser session.",path:"/features"}),e.jsx(Ma,{}),e.jsx("section",{className:"pt-32 pb-16 px-6 lg:px-8",children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-16",children:[e.jsx("p",{className:"text-primary text-sm font-medium mb-4 tracking-wide uppercase",children:"The Platform"}),e.jsxs("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-display font-semibold leading-[1.1] tracking-tight mb-6",children:["Every tool a modern",e.jsx("br",{}),"marketer needs."]}),e.jsx("p",{className:"text-muted-foreground text-lg max-w-2xl mx-auto leading-relaxed mb-8",children:"Discovery, engagement, outreach, monitoring, creative production, and AI visibility â across 8 platforms, from one dashboard."}),e.jsxs(h,{size:"lg",onClick:()=>s("/auth"),className:"rounded-full px-8 bg-primary text-primary-foreground hover:bg-primary/90",children:["Start free trial ",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]})]}),e.jsx("div",{className:"flex flex-wrap items-center justify-center gap-3 mb-4",children:dh.map(o=>e.jsxs("div",{className:`flex items-center gap-2 px-3.5 py-2 rounded-full border text-sm ${o.status==="live"?"border-border/40 bg-card/60 text-foreground":"border-border/20 bg-card/30 text-muted-foreground/50"}`,children:[e.jsx(ch,{d:o.d,label:o.label}),e.jsx("span",{className:"text-[13px]",children:o.label}),o.status==="soon"&&e.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-muted text-muted-foreground",children:"Soon"})]},o.label))})]})}),e.jsx("section",{className:"py-20 px-6 lg:px-8 border-t border-border/50",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-3xl md:text-4xl font-display font-semibold mb-3",children:"8 core capabilities"}),e.jsx("p",{className:"text-muted-foreground max-w-xl mx-auto",children:"Click any capability to see it in action."})]}),e.jsxs("div",{className:"grid lg:grid-cols-[1fr_380px] gap-8 items-start",children:[e.jsx("div",{className:"grid sm:grid-cols-2 gap-3",children:r.map((o,n)=>e.jsx("button",{onClick:()=>a(n),className:`text-left p-4 rounded-xl border transition-all duration-300 ${t===n?"border-primary/40 bg-primary/5 shadow-sm":"border-border/30 bg-card/30 hover:border-border/60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center flex-shrink-0 ${t===n?"bg-primary/15":"bg-muted/50"}`,children:e.jsx(o.icon,{className:`h-4.5 w-4.5 ${t===n?"text-primary":"text-muted-foreground"}`})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold mb-0.5",children:o.title}),e.jsx("p",{className:"text-[11px] text-muted-foreground leading-snug",children:o.desc})]})]})},n))}),e.jsx("div",{className:"sticky top-24",children:e.jsxs("div",{className:"rounded-2xl border border-border/40 bg-card/80 backdrop-blur-sm overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border/30 flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-primary/40"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-muted"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-muted"}),e.jsx("span",{className:"text-[11px] text-muted-foreground ml-2",children:r[t].title})]}),e.jsx("div",{className:"p-4",children:r[t].mockup}),e.jsx("div",{className:"px-4 py-3 border-t border-border/30 bg-muted/20",children:e.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:r[t].detail})})]})})]})]})}),e.jsx("section",{className:"py-20 px-6 lg:px-8 border-t border-border/50 bg-card/20",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsx("div",{className:"text-center mb-14",children:e.jsx("h2",{className:"text-3xl md:text-4xl font-display font-semibold mb-3",children:"What you can do on each platform"})}),e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[{name:"X (Twitter)",actions:["Reply to tweets & threads","Monitor hashtags & keywords","Track competitor mentions","Auto-engage with followers","Cold DM prospects"]},{name:"LinkedIn",actions:["Comment on feed posts","Find decision makers","B2B lead generation","Professional tone matching","DM sequence automation"]},{name:"Reddit",actions:["Monitor subreddits","Answer questions naturally","Community engagement","Competitor tracking","Authentic discu
21ssions"]},{name:"Quora",actions:["Find relevant questions","Generate expert answers","Topic monitoring","Authority building","Link placement"]},{name:"Facebook",actions:["Group discovery & joining","Post monitoring","Comment engagement","Trust score tracking","Warm-up automation"]},{name:"YouTube",actions:["Comment thread replies","Video topic monitoring","Channel tracking","Engagement automation","Creator outreach"]}].map((o,n)=>e.jsxs("div",{className:"p-5 rounded-xl border border-border/30 bg-card/40",children:[e.jsx("h3",{className:"font-semibold text-sm mb-3",children:o.name}),e.jsx("ul",{className:"space-y-1.5",children:o.actions.map((l,c)=>e.jsxs("li",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(bs,{className:"h-3 w-3 text-primary flex-shrink-0"}),l]},c))})]},n))}),e.jsx("div",{className:"flex items-center justify-center gap-6 mt-8 text-sm text-muted-foreground",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Cs,{className:"h-4 w-4"})," Instagram & TikTok coming soon"]})})]})}),e.jsx("section",{className:"py-16 px-6 lg:px-8 border-t border-border/50",children:e.jsx("div",{className:"max-w-4xl mx-auto grid grid-cols-2 md:grid-cols-4 gap-8 text-center",children:[{v:"6",l:"Platforms supported"},{v:"8",l:"Core capabilities"},{v:"73%",l:"Avg. engagement rate"},{v:"24/7",l:"Automated monitoring"}].map((o,n)=>e.jsxs("div",{children:[e.jsx("p",{className:"text-3xl md:text-4xl font-semibold mb-1",children:o.v}),e.jsx("p",{className:"text-sm text-muted-foreground",children:o.l})]},n))})}),e.jsx("section",{className:"py-20 px-6 lg:px-8 border-t border-border/50",children:e.jsxs("div",{className:"max-w-2xl mx-auto text-center",children:[e.jsx("h2",{className:"text-3xl md:text-4xl font-display font-semibold mb-4",children:"Ready to stop doing marketing manually?"}),e.jsx("p",{className:"text-muted-foreground mb-8 text-lg",children:"Start your free trial. No credit card needed."}),e.jsxs(h,{size:"lg",onClick:()=>s("/auth"),className:"rounded-full px-10 bg-primary text-primary-foreground hover:bg-primary/90 text-base",children:["Get Started Free ",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]})]})}),e.jsx(_s,{})]})};function xh(s,t){var c;const a=new Map,r=new Map;for(const x of s)a.set(x.id,[]),r.set(x.id,0);for(const x of t)(c=a.get(x.source))==null||c.push(x.target),r.set(x.target,(r.get(x.target)||0)+1);const o=[];for(const[x,d]of r)d===0&&o.push(x);const n=[];for(;o.length;){const x=o.shift();n.push(x);for(const d of a.get(x)||[]){const u=(r.get(d)||1)-1;r.set(d,u),u===0&&o.push(d)}}const l=new Map(s.map(x=>[x.id,x]));return n.map(x=>l.get(x)).filter(Boolean)}function rd(s){return new Promise((t,a)=>{const r=n=>{var l;((l=n.data)==null?void 0:l.type)===s._responseType&&(window.removeEventListener("message",r),clearTimeout(o),t(n.data))};window.addEventListener("message",r);const o=setTimeout(()=>{window.removeEventListener("message",r),a(new Error("Extension bridge timeout (30s)"))},3e4);window.postMessage(s,"*")})}async function uh(s,t){const a=Array.isArray(t)?t:(t==null?void 0:t.posts)||(t==null?void 0:t.items)||[t],r=[];for(const o of a.slice(0,s.max_per_day||50)){if(!o.post_url&&!o.url)continue;const n=o.generated_reply||o.reply_text||o.content||"";if(!n)continue;const l=await rd({type:"SOCIALPILOT_OPEN_POST_URL",url:o.post_url||o.url,replyText:n,platform:o.platform||s.platform||"twitter",queueItemId:o.id||`agent-${Date.now()}`,_responseType:"SOCIALPILOT_OPEN_POST_URL_ACK"});r.push(l);const c=(s.delay_seconds||2)*1e3;await new Promise(x=>setTimeout(x,c))}return{posted:r.length,results:r}}async function hh(s,t){const a=Array.isArray(t)?t:(t==null?void 0:t.prospects)||[t],r=[];for(const o of a.slice(0,s.max_per_day||15)){const n=o.profile_url||o.linkedin_url||o.url||"",l=o.outreach_message||o.message||s.template||"";if(!n||!l)continue;const c=await rd({type:"DESHILLER_SEND_DM",platform:s.platform||"linkedin",profileUrl:n,message:l,prospectId:o.id||`prospect-${Date.now()}`,_responseType:"DESHILLER_SEND_DM_RESPONSE"});r.push(c),await new Promise(x=>setTimeout(x,3e3))}return{sent:r.length,results:r}}async function ph(s,t){const{data:a,error:r}=await w.functions.invoke(s,{body:t});if(r)throw new Error(`Edge function ${s} failed: ${r.message}`);return a}const gh={"Discover Posts":"ef:discover-posts","Social Pulse Monitor":"ef:social-pulse","Scan Facebook Groups":"ef:scan-facebook-groups","Find Prospects":"ef:find-prospects","Track Conversations":"ef:track-conversations","Suggest LinkedIn Targets":"ef:suggest-linkedin-targets","Analyze Website":"ef:analyze-website","Monitor Competitors":"ef:social-pulse","Track Hashtags":"ef:discover-posts","Generate Reply":"ef:generate-reply","Generate Comment":"ef:generate-comment","Generate Outreach Message":"ef:generate-outreach-messages","Analyze Tone":"ef:analyze-tone","Analyze Sentiment":"ef:social-pulse","Creative Generate":"ef:creative-generate","Score Relevance":"local:score-relevance","Summarize Content":"local:pass","Qualify Lead":"local:qualify-lead","Post via Extension":"ext:post","Post Comment":"ext:post","Send Cold Email":"ef:send-cold-emails","Send DM":"ext:dm","Send Alert Email"
21:"ef:send-notification-email","Send Notification":"ef:send-notification-email","Queue Reply":"local:queue-reply","Add to CRM":"local:add-to-crm","Save to Library":"local:save-library","Filter by Sentiment":"local:filter-sentiment","Filter by Score":"local:filter-score","Filter by Platform":"local:filter-platform","Filter by Time":"local:filter-time","Keyword Match":"local:keyword-match",Deduplicate:"local:deduplicate","A/B Split":"local:ab-split","Rate Limiter":"local:rate-limiter",Delay:"local:delay",Condition:"local:condition",Loop:"local:loop",Stop:"local:stop"};function fh(s,t,a){const r=Array.isArray(a)?a:(a==null?void 0:a.posts)||(a==null?void 0:a.items)||(a==null?void 0:a.prospects)||[a];switch(s){case"filter-sentiment":{const o=t.sentiment||"positive";return r.filter(n=>(n.sentiment||"").toLowerCase()===o)}case"filter-score":{const o=t.min_score??0,n=t.max_score??100;return r.filter(l=>{const c=l.relevance_score??l.score??0;return c>=o&&c<=n})}case"filter-platform":{const o=t.platforms||[],n=t.exclude_platforms||[];return r.filter(l=>!(o.length&&!o.includes(l.platform)||n.length&&n.includes(l.platform)))}case"filter-time":{const o=(t.max_age_hours||24)*36e5,n=Date.now();return r.filter(l=>{const c=new Date(l.posted_at||l.created_at||0).getTime();return n-c<=o})}case"keyword-match":{const o=(t.include_keywords||[]).map(c=>c.toLowerCase()),n=(t.exclude_keywords||[]).map(c=>c.toLowerCase()),l=t.match_mode||"any";return r.filter(c=>{const x=((c.post_content||c.content||c.title||"")+" "+(c.author_name||"")).toLowerCase();return n.some(u=>x.includes(u))?!1:o.length?l==="all"?o.every(u=>x.includes(u)):o.some(u=>x.includes(u)):!0})}case"deduplicate":{const o=new Set;return r.filter(n=>{const l=n.post_url||n.url||n.id||JSON.stringify(n);return o.has(l)?!1:(o.add(l),!0)})}case"ab-split":{const o=(t.split_ratio||50)/100;return r.filter(()=>Math.random()<o)}case"rate-limiter":{const o=t.max_per_hour||10;return r.slice(0,o)}case"delay":return a;case"condition":{const o=t.condition_type||"score",n=t.operator||"greater_than",l=t.value??50;return r.filter(c=>{const x=c[o]??c.relevance_score??c.score??0;return n==="greater_than"?x>l:n==="less_than"?x<l:n==="equals"?x===l:!0})}case"score-relevance":return r;case"qualify-lead":{const o=t.min_score||60;return r.filter(n=>(n.relevance_score||n.score||0)>=o)}case"queue-reply":return a;case"add-to-crm":return a;case"save-library":return a;case"pass":return a;case"loop":return a;case"stop":return null;default:return a}}async function bh(s,t){const a=t.filter(r=>r.post_url&&(r.generated_reply||r.reply_text)).map(r=>({user_id:s,platform:r.platform||"twitter",post_url:r.post_url||r.url,reply_text:r.generated_reply||r.reply_text,discovered_post_id:r.id||null,status:"pending"}));return a.length&&await w.from("engagement_queue").insert(a),{queued:a.length}}async function jh(s){const{userId:t,runId:a,nodes:r,edges:o,onLog:n,onStatusChange:l}=s,c=[],x=new Map,d=xh(r,o);function u(m){c.push(m),n(m)}try{for(const m of d){const p=m.data.label,g=m.data.config||{},v=gh[p];u({timestamp:new Date().toISOString(),node_id:m.id,status:"started",message:`Starting: ${p}`});const b=o.filter(C=>C.target===m.id);let z=null;if(b.length===1?z=x.get(b[0].source):b.length>1&&(z=b.map(j=>x.get(j.source)).filter(Boolean).flat()),z===null&&b.length>0){u({timestamp:new Date().toISOString(),node_id:m.id,status:"skipped",message:"Skipped: no input data from upstream"}),x.set(m.id,null);continue}try{let C;if(!v)C=z;else if(v.startsWith("ef:")){const y=v.slice(3),N={...g,...z?{input:z}:{}};C=await ph(y,N)}else if(v==="ext:post")C=await uh(g,z);else if(v==="ext:dm")C=await hh(g,z);else if(v.startsWith("local:")){const y=v.slice(6);if(y==="delay"){const N=g.delay_seconds||60;await new Promise(f=>setTimeout(f,N*1e3)),C=z}else y==="queue-reply"?C=await bh(t,Array.isArray(z)?z:[z]):C=fh(y,g,z)}else C=z;if(v==="local:stop"){u({timestamp:new Date().toISOString(),node_id:m.id,status:"completed",message:"Stop node reached"});break}const j=Array.isArray(C)?C.length:(C==null?void 0:C.posted)||(C==null?void 0:C.sent)||(C==null?void 0:C.queued)||(C?1:0);x.set(m.id,C),u({timestamp:new Date().toISOString(),node_id:m.id,status:"completed",message:`Completed: ${p} (${j} items)`,data:{itemCount:j}})}catch(C){u({timestamp:new Date().toISOString(),node_id:m.id,status:"failed",message:`Failed: ${p} â ${C.message||String(C)}`}),x.set(m.id,null)}await w.from("agent_runs").update({execution_log:c}).eq("id",a)}return l("completed"),{status:"completed",logs:c}}catch(m){return u({timestamp:new Date().toISOString(),node_id:"engine",status:"failed",message:`Engine error: ${m.message||String(m)}`}),l("failed"),{status:"failed",logs:c}}}const yh=ir("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function W({className:s,variant:t,...a}){return e.jsx("div",{className:Z(yh({variant:t}),s),...a}
21)}const jt=i.forwardRef(({className:s,children:t,...a},r)=>e.jsxs(Ul,{ref:r,className:Z("relative overflow-hidden",s),...a,children:[e.jsx(fm,{className:"h-full w-full rounded-[inherit]",children:t}),e.jsx(nd,{}),e.jsx(bm,{})]}));jt.displayName=Ul.displayName;const nd=i.forwardRef(({className:s,orientation:t="vertical",...a},r)=>e.jsx(Wl,{ref:r,orientation:t,className:Z("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",s),...a,children:e.jsx(jm,{className:"relative flex-1 rounded-full bg-border"})}));nd.displayName=Wl.displayName;const fo={discovery:"#10b981",ai:"#8b5cf6",action:"#f59e0b",filter:"#06b6d4",control:"#ec4899",custom:"#6366f1"},vh=({node:s,isSelected:t,isConnecting:a,zoom:r,onClick:o,onDragAbsolute:n,onConnect:l,onDelete:c})=>{const x=i.useRef(null),[d,u]=i.useState(!1),m=i.useRef({startX:0,startY:0,nodeStartX:0,nodeStartY:0}),p=Cn[s.data.icon]||Ra,g=fo[s.data.category]||fo.custom,v=i.useCallback(C=>{if(C.button!==0)return;C.stopPropagation(),o(),m.current={startX:C.clientX,startY:C.clientY,nodeStartX:s.position.x,nodeStartY:s.position.y};const j=C.currentTarget;j.setPointerCapture(C.pointerId);const y=f=>{const R=(f.clientX-m.current.startX)/r,M=(f.clientY-m.current.startY)/r;!d&&(Math.abs(R)>3||Math.abs(M)>3)&&u(!0),n(m.current.nodeStartX+R,m.current.nodeStartY+M)},N=()=>{u(!1),j.removeEventListener("pointermove",y),j.removeEventListener("pointerup",N)};j.addEventListener("pointermove",y),j.addEventListener("pointerup",N)},[o,s.position.x,s.position.y,r,n,d]),z=Object.keys(s.data.config).slice(0,3).map(C=>{const j=s.data.config[C],y=typeof j=="boolean"?j?"â":"â":Array.isArray(j)?`${j.length}`:String(j).slice(0,14);return{key:C.replace(/_/g," "),value:y}});return e.jsxs("div",{ref:x,className:Z("absolute w-[280px] rounded-xl border transition-all duration-150 select-none","backdrop-blur-md",t?"border-primary/60 shadow-[0_0_24px_-4px_hsl(38_92%_50%/0.25)] z-50":"border-border/60 hover:border-border z-10",d?"cursor-grabbing scale-[1.03] shadow-2xl z-50":"cursor-grab hover:shadow-lg"),style:{left:s.position.x,top:s.position.y,background:"hsl(222 47% 14% / 0.92)"},onPointerDown:v,children:[e.jsx("div",{className:"absolute left-0 top-3 bottom-3 w-[3px] rounded-full",style:{backgroundColor:g}}),e.jsx("button",{className:Z("absolute -left-[10px] top-1/2 -translate-y-1/2 w-5 h-5 rounded-full","border-2 flex items-center justify-center transition-all","hover:scale-125",a?"border-primary bg-primary/20 shadow-[0_0_8px_hsl(38_92%_50%/0.4)]":"border-border bg-card"),onClick:C=>{C.stopPropagation(),l("target")}}),e.jsx("button",{className:Z("absolute -right-[10px] top-1/2 -translate-y-1/2 w-5 h-5 rounded-full","border-2 flex items-center justify-center transition-all","hover:scale-125",a?"border-primary bg-primary/20 shadow-[0_0_8px_hsl(38_92%_50%/0.4)]":"border-border bg-card"),onClick:C=>{C.stopPropagation(),l("source")},children:e.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:g}})}),e.jsxs("div",{className:"p-4 pl-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0",style:{backgroundColor:`${g}18`,boxShadow:`0 0 12px ${g}20`},children:e.jsx(p,{className:"w-5 h-5",style:{color:g}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-semibold text-sm text-foreground truncate",children:s.data.label}),e.jsx("p",{className:"text-[11px] uppercase tracking-wider font-medium mt-0.5",style:{color:g},children:s.data.category})]})]}),z.length>0&&e.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:z.map(C=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium bg-muted/50 text-muted-foreground border border-border/50",children:[e.jsxs("span",{className:"opacity-60",children:[C.key,":"]}),e.jsx("span",{className:"text-foreground/80",children:C.value})]},C.key))})]})]})},Nh=({edge:s,sourcePos:t,targetPos:a,sourceColor:r="#f59e0b",targetColor:o="#10b981",onDelete:n})=>{const l=a.x-t.x,c=Math.min(Math.max(Math.abs(l)*.4,40),180),x=`M ${t.x} ${t.y} C ${t.x+c} ${t.y}, ${a.x-c} ${a.y}, ${a.x} ${a.y}`,d=(t.x+a.x)/2,u=(t.y+a.y)/2,m=`grad-${s.id}`,p=`flow-${s.id}`;return e.jsxs("g",{className:"group",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:m,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[e.jsx("stop",{offset:"0%",stopColor:r,stopOpacity:"0.7"}),e.jsx("stop",{offset:"100%",stopColor:o,stopOpacity:"0.7"})]})}),e.jsx("path",{d:x,fill:"none",stroke:"transparent",strokeWidth:"20",className:"cursor-pointer"}),e.jsx("path",{d:x,fill:"none",stroke:`url(#${m})`,strokeWidth:"6",opacity:"0.1",className:"group-hover:opacity-0.2 transition-opacity"}),e.jsx("path",{d:x,fill:"none",stroke:`url(#${m})`,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("circle",{r:"3.5",fill:r,opacity:"0.8",children:e.jsx("animateMotion",{dur:"2.5s",repeatCount:"indef
21inite",children:e.jsx("mpath",{href:`#${p}`})})}),e.jsx("path",{id:p,d:x,fill:"none"}),e.jsx("foreignObject",{x:d-10,y:u-10,width:"20",height:"20",className:"opacity-0 group-hover:opacity-100 transition-opacity pointer-events-auto",children:e.jsx("button",{onClick:g=>{g.stopPropagation(),n()},className:"w-5 h-5 bg-destructive text-destructive-foreground rounded-full flex items-center justify-center hover:scale-110 transition-transform",children:e.jsx(zs,{className:"w-2.5 h-2.5"})})}),s.label&&e.jsx("text",{x:d,y:u-14,textAnchor:"middle",className:"text-[10px] fill-muted-foreground font-medium",children:s.label})]})},Da=24,wh=({nodes:s,edges:t,templates:a,onNodesChange:r,onEdgesChange:o,selectedNodeId:n,onSelectNode:l})=>{const c=i.useRef(null),[x,d]=i.useState(1),[u,m]=i.useState({x:80,y:80}),[p,g]=i.useState(!1),[v,b]=i.useState({x:0,y:0}),[z,C]=i.useState({x:0,y:0}),[j,y]=i.useState(null),[N,f]=i.useState(!1),[R,M]=i.useState(!0),[q,_]=i.useState({x:0,y:0}),A=(L,K)=>R?{x:Math.round(L/Da)*Da,y:Math.round(K/Da)*Da}:{x:L,y:K},B=i.useCallback(L=>{var ke;L.preventDefault();const K=L.dataTransfer.getData("application/json");if(!K)return;const ue=JSON.parse(K),Ne=(ke=c.current)==null?void 0:ke.getBoundingClientRect();if(!Ne)return;const fe=(L.clientX-Ne.left-u.x)/x,me=(L.clientY-Ne.top-u.y)/x,{x:Ie,y:Q}=A(fe,me),ne={id:`node-${Date.now()}`,type:"component",position:{x:Math.max(0,Ie),y:Math.max(0,Q)},data:{templateId:ue.id,label:ue.name,category:ue.category,icon:ue.icon||"Puzzle",color:ue.color||"#8b5cf6",config:{...ue.default_config}}};r([...s,ne]),l(ne.id)},[s,u,x,r,l,R]),P=L=>{L.preventDefault(),L.dataTransfer.dropEffect="copy"},I=i.useCallback((L,K,ue)=>{const{x:Ne,y:fe}=A(K,ue);r(s.map(me=>me.id===L?{...me,position:{x:Ne,y:fe}}:me))},[s,r,R]),$=i.useCallback(L=>{r(s.filter(K=>K.id!==L)),o(t.filter(K=>K.source!==L&&K.target!==L)),l(null)},[s,t,r,o,l]),be=(L,K)=>{if(j){if(j.nodeId!==L){const ue={id:`edge-${Date.now()}`,source:j.type==="source"?j.nodeId:L,target:j.type==="target"?j.nodeId:L};t.some(fe=>fe.source===ue.source&&fe.target===ue.target)||o([...t,ue])}y(null)}else y({nodeId:L,type:K})},Y=L=>{var K,ue;L.button===1||L.button===0&&(L.altKey||N)?(g(!0),b({x:L.clientX,y:L.clientY}),C({x:u.x,y:u.y}),(ue=(K=L.target).setPointerCapture)==null||ue.call(K,L.pointerId)):(L.target===c.current||L.target.classList.contains("canvas-bg"))&&(l(null),y(null))},O=L=>{if(p&&m({x:z.x+(L.clientX-v.x),y:z.y+(L.clientY-v.y)}),j&&c.current){const K=c.current.getBoundingClientRect();_({x:(L.clientX-K.left-u.x)/x,y:(L.clientY-K.top-u.y)/x})}}
21,he=()=>{g(!1)},re=L=>{d(K=>Math.min(2,Math.max(.25,K+L)))},oe=i.useCallback(L=>{if(L.ctrlKey||L.metaKey){L.preventDefault();const K=L.deltaY>0?-.1:.1;d(ue=>Math.min(2,Math.max(.25,ue+K)))}else m(K=>({x:K.x-L.deltaX*.5,y:K.y-L.deltaY*.5}))},[]),T=()=>{var ke;if(s.length===0){d(1),m({x:80,y:80});return}const L=(ke=c.current)==null?void 0:ke.getBoundingClientRect();if(!L)return;const K=120,ue=Math.min(...s.map(ee=>ee.position.x)),Ne=Math.max(...s.map(ee=>ee.position.x+280)),fe=Math.min(...s.map(ee=>ee.position.y)),me=Math.max(...s.map(ee=>ee.position.y+120)),Ie=Ne-ue+K*2,Q=me-fe+K*2,ne=Math.min(1.5,Math.max(.25,Math.min(L.width/Ie,L.height/Q)));d(ne),m({x:(L.width-Ie*ne)/2-ue*ne+K*ne,y:(L.height-Q*ne)/2-fe*ne+K*ne})};i.useEffect(()=>{const L=K=>{var ue;if((K.key==="Delete"||K.key==="Backspace")&&n){const Ne=(ue=document.activeElement)==null?void 0:ue.tagName;if(Ne==="INPUT"||Ne==="TEXTAREA")return;$(n)}K.key==="Escape"&&(y(null),l(null)),(K.metaKey||K.ctrlKey)&&K.key==="0"&&(K.preventDefault(),T())};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[n,$,l]);const ce=.06,le=160,F=100;return e.jsxs("div",{className:"relative w-full h-full overflow-hidden",style:{background:"hsl(222 47% 9%)"},children:[e.jsx(Ka,{children:e.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 z-10 flex items-center gap-1 bg-card/95 backdrop-blur-md rounded-full border border-border px-2 py-1.5 shadow-lg",children:[e.jsxs(la,{children:[e.jsx(ca,{asChild:!0,children:e.jsx(h,{variant:N?"secondary":"ghost",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>f(!N),children:N?e.jsx(ym,{className:"w-4 h-4"}):e.jsx(Vl,{className:"w-4 h-4"})})}),e.jsx(sa,{children:N?"Pan mode":"Select mode"})]}),e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs(la,{children:[e.jsx(ca,{asChild:!0,children:e.jsx(h,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>re(.15),children:e.jsx(vm,{className:"w-4 h-4"})})}),e.jsx(sa,{children:"Zoom in"})]}),e.jsxs("span",{className:"text-xs text-muted-foreground w-10 text-center font-mono select-none",children:[Math.round(x*100),"%"]}),e.jsxs(la,{children:[e.jsx(ca,{asChild:!0,children:e.jsx(h,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>re(-.15),children:e.jsx(Nm,{className:"w-4 h-4"})})}),e.jsx(sa,{children:"Zoom out"})]}),e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs(la,{children:[e.jsx(ca,{asChild:!0,children:e.jsx(h,{variant:R?"secondary":"ghost",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>M(!R),children:e.jsx(wm,{className:"w-4 h-4"})})}),e.jsx(sa,{children:"Snap to grid"})]}),e.jsxs(la,{children:[e.jsx(ca,{asChild:!0,children:e.jsx(h,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full",onClick:T,children:e.jsx(km,{className:"w-4 h-4"})})}),e.jsx(sa,{children:"Fit view"})]})]})}),j&&e.jsx("div",{className:"absolute top-16 left-1/2 -translate-x-1/2 z-10 bg-primary text-primary-foreground px-4 py-2 rounded-full text-sm font-medium shadow-lg animate-fade-in",children:"Click a connector to complete the link"}),e.jsxs("div",{ref:c,className:Z("w-full h-full canvas-bg touch-none",p?"cursor-grabbing":N?"cursor-grab":"cursor-default"),onDrop:B,onDragOver:P,onPointerDown:Y,onPointerMove:O,onPointerUp:he,onWheel:oe,tabIndex:0,children:[e.jsxs("svg",{className:"absolute inset-0 w-full h-full pointer-events-none",children:[e.jsx("defs",{children:e.jsx("pattern",{id:"grid-dots",width:Da*x,height:Da*x,patternUnits:"userSpaceOnUse",x:u.x%(Da*x),y:u.y%(Da*x),children:e.jsx("circle",{cx:"1",cy:"1",r:"0.8",fill:"hsl(215 16% 28%)",opacity:"0.5"})})}),e.jsx("rect",{width:"100%",height:"100%",fill:"url(#grid-dots)"})]}),e.jsxs("svg",{className:"absolute inset-0 w-full h-full pointer-events-none",style:{transform:`translate(${u.x}px, ${u.y}px) scale(${x})`,transformOrigin:"0 0"},children:[t.map(L=>{const K=s.find(Ne=>Ne.id===L.source),ue=s.find(Ne=>Ne.id===L.target);return!K||!ue?null:e.jsx(Nh,{edge:L,sourcePos:{x:K.position.x+280,y:K.position.y+56},targetPos:{x:ue.position.x,y:ue.position.y+56},sourceColor:K.data.color,targetColor:ue.data.color,onDelete:()=>o(t.filter(Ne=>
21Ne.id!==L.id))},L.id)}),j&&(()=>{const L=s.find(me=>me.id===j.nodeId);if(!L)return null;const K=j.type==="source"?L.position.x+280:L.position.x,ue=L.position.y+56,Ne=q.x-K,fe=Math.min(Math.abs(Ne)*.5,120);return e.jsx("path",{d:`M ${K} ${ue} C ${K+fe} ${ue}, ${q.x-fe} ${q.y}, ${q.x} ${q.y}`,fill:"none",stroke:"hsl(38 92% 50%)",strokeWidth:"2",strokeDasharray:"6 4",opacity:"0.6"})})()]}),e.jsx("div",{className:"absolute inset-0",style:{transform:`translate(${u.x}px, ${u.y}px) scale(${x})`,transformOrigin:"0 0"},children:s.map(L=>e.jsx(vh,{node:L,isSelected:n===L.id,isConnecting:j!==null,zoom:x,onClick:()=>!N&&l(L.id),onDragAbsolute:(K,ue)=>I(L.id,K,ue),onConnect:K=>be(L.id,K),onDelete:()=>$(L.id)},L.id))}),s.length===0&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:e.jsxs("div",{className:"text-center max-w-md mx-auto p-8 animate-fade-in",children:[e.jsx("div",{className:"w-20 h-20 rounded-2xl bg-primary/10 border border-primary/20 flex items-center justify-center mx-auto mb-6",children:e.jsx(_n,{className:"w-10 h-10 text-primary/60"})}),e.jsx("h3",{className:"text-xl font-semibold mb-2 text-foreground",children:"Build Your Workflow"}),e.jsx("p",{className:"text-muted-foreground mb-6 text-sm",children:"Drag components from the palette and connect them to create powerful automation agents"}),e.jsxs("div",{className:"flex flex-wrap gap-3 justify-center",children:[e.jsx("span",{className:"px-3 py-1.5 bg-emerald-500/10 text-emerald-400 rounded-full text-xs font-medium border border-emerald-500/20",children:"ð Discover"}),e.jsx("span",{className:"text-muted-foreground/40",children:"â"}),e.jsx("span",{className:"px-3 py-1.5 bg-violet-500/10 text-violet-400 rounded-full text-xs font-medium border border-violet-500/20",children:"ð¤ AI Process"}),e.jsx("span",{className:"text-muted-foreground/40",children:"â"}),e.jsx("span",{className:"px-3 py-1.5 bg-amber-500/10 text-amber-400 rounded-full text-xs font-medium border border-amber-500/20",children:"â¡ Execute"})]})]})})]}),s.length>0&&e.jsx("div",{className:"absolute bottom-4 left-4 z-10 rounded-lg border border-border bg-card/80 backdrop-blur-sm overflow-hidden shadow-lg",style:{width:le,height:F},children:e.jsxs("svg",{width:le,height:F,children:[s.map(L=>e.jsx("rect",{x:L.position.x*ce+10,y:L.position.y*ce+10,width:280*ce,height:80*ce,rx:"2",fill:L.data.color,opacity:n===L.id?.9:.4},L.id)),t.map(L=>{const K=s.find(Ne=>Ne.id===L.source),ue=s.find(Ne=>Ne.id===L.target);return!K||!ue?null:e.jsx("line",{x1:(K.position.x+280)*ce+10,y1:(K.position.y+40)*ce+10,x2:ue.position.x*ce+10,y2:(ue.position.y+40)*ce+10,stroke:"hsl(215 16% 40%)",strokeWidth:"1"},L.id)})]})}),e.jsxs("div",{className:"absolute bottom-4 right-4 z-10 flex items-center gap-2 text-[11px] text-muted-foreground/50 select-none",children:[e.jsx("span",{children:"Scroll to pan"}),e.jsx("span",{children:"â¢"}),e.jsx("span",{children:"â+Scroll zoom"}),e.jsx("span",{children:"â¢"}),e.jsx("span",{children:"Del to remove"})]})]})},Qn={discovery:{label:"Discovery",icon:Sm,color:"text-emerald-400",accent:"#10b981"},ai:{label:"AI Processing",icon:es,color:"text-violet-400",accent:"#8b5cf6"},action:{label:"Actions",icon:ws,color:"text-amber-400",accent:"#f59e0b"},filter:{label:"Filters",icon:Ta,color:"text-cyan-400",accent:"#06b6d4"},control:{label:"Control Flow",icon:Cm,color:"text-pink-400",accent:"#ec4899"},custom:{label:"Custom",icon:Ra,color:"text-indigo-400",accent:"#6366f1"}},kh=({templates:s,onDragStart:t,onQuickAdd:a})=>{const[r,o]=i.useState(""),[n,l]=i.useState(new Set(Object.keys(Qn))),c=s.filter(m=>{var p;return m.name.toLowerCase().includes(r.toLowerCase())||((p=m.description)==null?void 0:p.toLowerCase().includes(r.toLowerCase()))}),x=c.reduce((m,p)=>{const g=p.category;return m[g]||(m[g]=[]),m[g].push(p),m},{}),d=m=>{const p=new Set(n);p.has(m)?p.delete(m):p.add(m),l(p)},u=m=>Cn[m]||Ra;return e.jsxs("div",{className:"w-72 border-r border-border flex flex-col",style:{background:"hsl(222 47% 10%)"},children:[e.jsxs("div",{className:"p-4 border-b border-border space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"font-semibold text-sm text-foreground tracking-tight",children:"Components"}),e.jsx(W,{variant:"secondary",className:"text-[10px] px-1.5 py-0 font-mono",children:s.length})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ks,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground"}),e.jsx(Je,{placeholder:"Search... âK",value:r,onChange:m=>o(m.target.value),className:"pl-8 pr-8 h-8 text-xs bg-muted/30 border-border/50"}),r&&e.jsx(h,{variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6",onClick:()=>o(""),children:e.jsx(zs,{className:"w-3 h-3"})})]})]}),e.jsx(jt,{className:"flex-1",children:e.jsxs("div",{className:"p-2 space-y-0.5",children:[Object.keys(Qn).map(m=>{const p=Qn[m],g=x[m]||[],v=n.has(m);return g.length===0&&r?null:e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>d(m),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-muted/30 transition-colors rounded-lg group",children:[v?e.jsx(nt,{className:"w-3.5 h-3.5 text-muted-foreground"}):e.jsx($t,{className:"w-3.5 h-3.5 text-muted-foreground"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:p.accent}}),e.jsx("span",{className:Z("text-xs font-semibold flex-1 text-left",p.color),children:p.label}
21),e.jsx("span",{className:"text-[10px] text-muted-foreground/60 font-mono",children:g.length})]}),v&&g.length>0&&e.jsx("div",{className:"pl-3 pr-1 pb-1.5 space-y-0.5",children:g.map(b=>{const z=u(b.icon||"Puzzle");return e.jsxs("div",{draggable:!0,onDragStart:C=>{C.dataTransfer.setData("application/json",JSON.stringify(b)),C.dataTransfer.effectAllowed="copy",t(b)},className:Z("flex items-center gap-2.5 px-2.5 py-2 rounded-lg cursor-grab select-none","hover:bg-muted/40 transition-all group/item","active:cursor-grabbing active:scale-[0.97]"),children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0",style:{backgroundColor:`${b.color||p.accent}15`},children:e.jsx(z,{className:"w-3.5 h-3.5",style:{color:b.color||p.accent}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:b.name}),b.description&&e.jsx("p",{className:"text-[10px] text-muted-foreground/70 truncate leading-tight",children:b.description})]}),a&&e.jsx(h,{variant:"ghost",size:"icon",className:"h-5 w-5 opacity-0 group-hover/item:opacity-100 transition-opacity shrink-0",onClick:C=>{C.stopPropagation(),a(b)},children:e.jsx(ft,{className:"w-3 h-3"})})]},b.id)})})]},m)}),c.length===0&&r&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Ks,{className:"w-6 h-6 mx-auto text-muted-foreground/20 mb-2"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"No components found"})]})]})}),e.jsx("div",{className:"p-3 border-t border-border/50",children:e.jsx("p",{className:"text-[10px] text-muted-foreground/50 text-center",children:"Drag to canvas or click + to add"})})]})},Ui=Tm,Wi=Am,Sh=i.forwardRef(({className:s,inset:t,children:a,...r},o)=>e.jsxs(Yl,{ref:o,className:Z("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",s),...r,children:[a,e.jsx($t,{className:"ml-auto h-4 w-4"})]}));Sh.displayName=Yl.displayName;const Ch=i.forwardRef(({className:s,...t},a)=>e.jsx(Kl,{ref:a,className:Z("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...t}));Ch.displayName=Kl.displayName;const Rn=i.forwardRef(({className:s,sideOffset:t=4,...a},r)=>e.jsx(_m,{children:e.jsx(Xl,{ref:r,sideOffset:t,className:Z("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...a})}));Rn.displayName=Xl.displayName;const Zt=i.forwardRef(({className:s,inset:t,...a},r)=>e.jsx(Ql,{ref:r,className:Z("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",s),...a}));Zt.displayName=Ql.displayName;const _h=i.forwardRef(({className:s,children:t,checked:a,...r},o)=>e.jsxs(Jl,{ref:o,className:Z("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",s),checked:a,...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Zl,{children:e.jsx(bs,{className:"h-4 w-4"})})}),t]}));_h.displayName=Jl.displayName;const Th=i.forwardRef(({className:s,children:t,...a},r)=>e.jsxs(ec,{ref:r,className:Z("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",s),...a,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Zl,{children:e.jsx(Tn,{className:"h-2 w-2 fill-current"})})}),t]}));Th.displayName=ec.displayName;const id=i.forwardRef(({className:s,inset:t,...a},r)=>e.jsx(sc,{ref:r,className:Z("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",s),...a}
21));id.displayName=sc.displayName;const Br=i.forwardRef(({className:s,...t},a)=>e.jsx(tc,{ref:a,className:Z("-mx-1 my-1 h-px bg-muted",s),...t}));Br.displayName=tc.displayName;const bo={draft:"bg-muted text-muted-foreground",active:"bg-emerald-500/20 text-emerald-600",paused:"bg-amber-500/20 text-amber-600",archived:"bg-gray-500/20 text-gray-600"},Ah=({agent:s,agents:t,onSelect:a,onCreate:r,onUpdate:o})=>{const[n,l]=i.useState(!1),[c,x]=i.useState(""),d=()=>{s&&(x(s.name),l(!0))},u=async()=>{if(s&&c.trim()){const{error:m}=await w.from("user_agents").update({name:c.trim()}).eq("id",s.id);m||o({name:c.trim()})}l(!1)};return s?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Et,{className:"w-5 h-5 text-primary"}),n?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Je,{value:c,onChange:m=>x(m.target.value),className:"h-8 w-48",autoFocus:!0,onKeyDown:m=>{m.key==="Enter"&&u(),m.key==="Escape"&&l(!1)}}),e.jsx(h,{size:"sm",variant:"ghost",onClick:u,children:e.jsx(bs,{className:"w-4 h-4"})})]}):e.jsxs(Ui,{children:[e.jsx(Wi,{asChild:!0,children:e.jsxs(h,{variant:"ghost",className:"h-8 gap-2 font-medium",children:[e.jsx("span",{className:"max-w-40 truncate",children:s.name}),e.jsx(nt,{className:"w-4 h-4 opacity-50"})]})}),e.jsxs(Rn,{align:"start",className:"w-64",children:[t.map(m=>e.jsxs(Zt,{onClick:()=>a(m),className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate",children:m.name}),m.id===s.id&&e.jsx(bs,{className:"w-4 h-4 text-primary"})]},m.id)),e.jsx(Br,{}),e.jsxs(Zt,{onClick:r,children:[e.jsx(ft,{className:"w-4 h-4 mr-2"}),"Create New Agent"]})]})]}),!n&&e.jsx(h,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:d,children:e.jsx(ka,{className:"w-3 h-3"})}),e.jsx(W,{className:Z("capitalize",bo[s.status]||bo.draft),children:s.status})]}):e.jsxs(h,{variant:"outline",size:"sm",onClick:r,children:[e.jsx(ft,{className:"w-4 h-4 mr-2"}),"Create Agent"]})},gt=Ml,Cr=Ol,Ih=Dl,od=i.forwardRef(({className:s,...t},a)=>e.jsx(Nn,{ref:a,className:Z("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...t}));od.displayName=Nn.displayName;const dt=i.forwardRef(({className:s,children:t,...a},r)=>e.jsxs(Ih,{children:[e.jsx(od,{}),e.jsxs(wn,{ref:r,className:Z("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...a,children:[t,e.jsxs(Pl,{className:"absolute right-4 top-4 roun
21ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(zs,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));dt.displayName=wn.displayName;const mt=({className:s,...t})=>e.jsx("div",{className:Z("flex flex-col space-y-1.5 text-center sm:text-left",s),...t});mt.displayName="DialogHeader";const Ft=({className:s,...t})=>e.jsx("div",{className:Z("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...t});Ft.displayName="DialogFooter";const xt=i.forwardRef(({className:s,...t},a)=>e.jsx(kn,{ref:a,className:Z("text-lg font-semibold leading-none tracking-tight",s),...t}));xt.displayName=kn.displayName;const Mt=i.forwardRef(({className:s,...t},a)=>e.jsx(Sn,{ref:a,className:Z("text-sm text-muted-foreground",s),...t}));Mt.displayName=Sn.displayName;const Lh=ir("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ce=i.forwardRef(({className:s,...t},a)=>e.jsx(ac,{ref:a,className:Z(Lh(),s),...t}));Ce.displayName=ac.displayName;const Vs=i.forwardRef(({className:s,...t},a)=>e.jsx("textarea",{className:Z("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
21ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),ref:a,...t}));Vs.displayName="Textarea";const Gr=i.forwardRef(({className:s,...t},a)=>e.jsx(rc,{className:Z("grid gap-2",s),...t,ref:a}));Gr.displayName=rc.displayName;const ba=i.forwardRef(({className:s,...t},a)=>e.jsx(nc,{ref:a,className:Z("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...t,children:e.jsx(Im,{className:"flex items-center justify-center",children:e.jsx(Tn,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ba.displayName=nc.displayName;const Gs=Mm,Us=Dm,qs=i.forwardRef(({className:s,children:t,...a},r)=>e.jsxs(ic,{ref:r,className:Z("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
21ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...a,children:[t,e.jsx(Lm,{asChild:!0,children:e.jsx(nt,{className:"h-4 w-4 opacity-50"})})]}));qs.displayName=ic.displayName;const ld=i.forwardRef(({className:s,...t},a)=>e.jsx(oc,{ref:a,className:Z("flex cursor-default items-center justify-center py-1",s),...t,children:e.jsx(Gt,{className:"h-4 w-4"})}));ld.displayName=oc.displayName;const cd=i.forwardRef(({className:s,...t},a)=>e.jsx(lc,{ref:a,className:Z("flex cursor-default items-center justify-center py-1",s),...t,children:e.jsx(nt,{className:"h-4 w-4"})}));cd.displayName=lc.displayName;const Hs=i.forwardRef(({className:s,children:t,position:a="popper",...r},o)=>e.jsx(zm,{children:e.jsxs(cc,{ref:o,className:Z("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:a,...r,children:[e.jsx(ld,{}),e.jsx(Em,{className:Z("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),e.jsx(cd,{})]})}));Hs.displayName=cc.displayName;const zh=i.forwardRef(({className:s,...t},a)=>e.jsx(dc,{ref:a,className:Z("py-1.5 pl-8 pr-2 text-sm font-semibold",s),...t}));zh.displayName=dc.displayName;const Te=i.forwardRef(({className:s,children:t,...a},r)=>e.jsxs(mc,{ref:r,className:Z("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",s),...a,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Rm,{children:e.jsx(bs,{className:"h-4 w-4"})})}),e.jsx(Pm,{children:t})]}));Te.displayName=mc.displayName;const Eh=i.forwardRef(({className:s,...t},a)=>e.jsx(xc,{ref:a,className:Z("-mx-1 my-1 h-px bg-muted",s),...t}));Eh.displayName=xc.displayName;const Ct=Om,wt=i.forwardRef(({className:s,...t},a)=>e.jsx(uc,{ref:a,className:Z("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...t}));wt.displayName=uc.displayName;const cs=i.forwardRef(({className:s,...t},a)=>e.jsx(hc,{ref:a,className:Z("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...t}));cs.displayName=hc.displayName;const us=i.forwardRef(({className:s,...t},a)=>e.jsx(pc,{ref:a,className:Z("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...t}));us.displayName=pc.displayName;const Rh=({open:s,onOpenChange:t,agent:a,onSave:r})=>{const[o,n]=i.useState(""),[l,c]=i.useState(""),[x,d]=i.useState("draft"),[u,m]=i.useState("manual"),[p,g]=i.useState("daily"),[v,b]=i.useState("09:00"),[z,C]=i.useState("new_discovery"),[j,y]=i.useState(!1);i.useEffect(()=>{var f,R,M;a&&(n(a.name||""),c(a.description||""),d(a.status||"draft"),m(a.trigger_type||"manual"),g(((f=a.schedule_config)==null?void 0:f.interval)||"daily"),b(((R=a.schedule_config)==null?void 0:R.time)||"09:00"),C(((M=a.event_config)==null?void 0:M.event_type)||"new_discovery"))},[a]);const N=async()=>{y(!0),await r({name:o,description:l,status:x,trigger_type:u,schedule_config:u==="scheduled"?{interval:p,time:v}
21:null,event_config:u==="event"?{event_type:z}:null}),y(!1),t(!1)};return e.jsx(gt,{open:s,onOpenChange:t,children:e.jsxs(dt,{className:"max-w-lg",children:[e.jsx(mt,{children:e.jsx(xt,{children:"Agent Settings"})}),e.jsxs(Ct,{defaultValue:"general",className:"mt-4",children:[e.jsxs(wt,{className:"grid w-full grid-cols-3",children:[e.jsx(cs,{value:"general",children:"General"}),e.jsx(cs,{value:"trigger",children:"Trigger"}),e.jsx(cs,{value:"advanced",children:"Advanced"})]}),e.jsxs(us,{value:"general",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{children:"Agent Name"}),e.jsx(Je,{value:o,onChange:f=>n(f.target.value),placeholder:"My awesome agent"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{children:"Description"}),e.jsx(Vs,{value:l,onChange:f=>c(f.target.value),placeholder:"What does this agent do?",rows:3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{children:"Status"}),e.jsxs(Gs,{value:x,onValueChange:d,children:[e.jsx(qs,{children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"draft",children:"Draft"}),e.jsx(Te,{value:"active",children:"Active"}),e.jsx(Te,{value:"paused",children:"Paused"}),e.jsx(Te,{value:"archived",children:"Archived"})]})]})]})]}),e.jsxs(us,{value:"trigger",className:"space-y-4 mt-4",children:[e.jsx(Ce,{children:"How should this agent be triggered?"}),e.jsxs(Gr,{value:u,onValueChange:m,className:"space-y-3",children:[e.jsxs("div",{className:Z("flex items-start gap-3 p-4 rounded-lg border-2 cursor-pointer transition-colors",u==="manual"?"border-primary bg-primary/5":"border-border"),onClick:()=>m("manual"),children:[e.jsx(ba,{value:"manual",id:"manual",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ua,{className:"w-4 h-4 text-emerald-500"}),e.jsx(Ce,{htmlFor:"manual",className:"font-medium cursor-pointer",children:"Manual"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Run this agent manually whenever you want"})]})]}),e.jsxs("div",{className:Z("flex items-start gap-3 p-4 rounded-lg border-2 cursor-pointer transition-colors",u==="scheduled"?"border-primary bg-primary/5":"border-border"),onClick:()=>m("scheduled"),children:[e.jsx(ba,{value:"scheduled",id:"scheduled",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Cs,{className:"w-4 h-4 text-blue-500"}),e.jsx(Ce,{htmlFor:"scheduled",className:"font-medium cursor-pointer",children:"Scheduled"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Run on a schedule automatically"}),u==="scheduled"&&e.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[e.jsxs(Gs,{value:p,onValueChange:g,children:[e.jsx(qs,{className:"w-32",children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"hourly",children:"Hourly"}),e.jsx(Te,{value:"daily",children:"Daily"}),e.jsx(Te,{value:"weekly",children:"Weekly"})]})]}),p!=="hourly"&&e.jsx(Je,{type:"time",value:v,onChange:f=>b(f.target.value),className:"w-28"})]})]})]}),e.jsxs("div",{className:Z("flex items-start gap-3 p-4 rounded-lg border-2 cursor-pointer transition-colors",u==="event"?"border-primary bg-primary/5":"border-border"),onClick:()=>m("event"),children:[e.jsx(ba,{value:"event",id:"event",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ws,{className:"w-4 h-4 text-amber-500"}),e.jsx(Ce,{htmlFor:"event",className:"font-medium cursor-pointer",children:"Event-based"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Trigger when specific events occur"}),u==="event"&&e.jsxs(Gs,{value:z,onValueChange:C,children:[e.jsx(qs,{className:"mt-3",children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"new_discovery",children:"New post discovered"}),e.jsx(Te,{value:"new_mention",children:"New brand mention"}),e.jsx(Te,{value:"sentiment_change",children:"Sentiment changes"})]})]})]})]})]})]}
21),e.jsx(us,{value:"advanced",className:"space-y-4 mt-4",children:e.jsxs("div",{className:"p-4 bg-destructive/10 rounded-lg border border-destructive/20",children:[e.jsxs("div",{className:"flex items-center gap-2 text-destructive font-medium",children:[e.jsx(ua,{className:"w-4 h-4"}),"Danger Zone"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Delete this agent permanently. This action cannot be undone."}),e.jsx(h,{variant:"destructive",size:"sm",className:"mt-3",children:"Delete Agent"})]})})]}),e.jsxs(Ft,{className:"mt-6",children:[e.jsx(h,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),e.jsx(h,{onClick:N,disabled:j,children:j?"Saving...":"Save Settings"})]})]})})},Ph={discovery:"bg-emerald-500/20 text-emerald-600",ai:"bg-violet-500/20 text-violet-600",action:"bg-amber-500/20 text-amber-600",filter:"bg-cyan-500/20 text-cyan-600",control:"bg-pink-500/20 text-pink-600",custom:"bg-indigo-500/20 text-indigo-600"},Mh=({open:s,onOpenChange:t,onImport:a})=>{const{toast:r}=zn(),[o,n]=i.useState(""),[l,c]=i.useState([]),[x,d]=i.useState([]),[u,m]=i.useState(!0);i.useEffect(()=>{s&&(p(),g())},[s]);const p=async()=>{const{data:j,error:y}=await w.from("agent_component_templates").select("*").eq("is_published",!0).eq("is_system",!1).order("downloads_count",{ascending:!1});!y&&j&&c(j),m(!1)},g=async()=>{const{data:{user:j}}=await w.auth.getUser();if(!j)return;const{data:y,error:N}=await w.from("user_custom_components").select("*").eq("user_id",j.id);!N&&y&&d(y)},v=async j=>{await w.from("agent_component_templates").update({downloads_count:(j.downloads_count||0)+1}).eq("id",j.id),a(j),r({title:"Component imported!",description:`${j.name} is now available in your palette.`})},b=async j=>{const{error:y}=await w.from("agent_component_templates").insert({user_id:j.user_id,name:j.name,description:j.description,category:j.category,icon:j.icon,color:j.color,config_schema:j.config_schema,default_config:j.default_config,is_published:!0});y||(r({title:"Published to marketplace!",description:"Your component is now available to others."}),p())},z=j=>Cn[j]||Ra,C=l.filter(j=>{var y;return j.name.toLowerCase().includes(o.toLowerCase())||((y=j.description)==null?void 0:y.toLowerCase().includes(o.toLowerCase()))});return e.jsx(gt,{open:s,onOpenChange:t,children:e.jsxs(dt,{className:"max-w-3xl max-h-[80vh]",children:[e.jsx(mt,{children:e.jsxs(xt,{className:"flex items-center gap-2",children:[e.jsx(tr,{className:"w-5 h-5 text-amber-500"}),"Component Marketplace"]})}),e.jsxs(Ct,{defaultValue:"browse",className:"mt-4",children:[e.jsxs(wt,{children:[e.jsx(cs,{value:"browse",children:"Browse"}),e.jsx(cs,{value:"my-components",children:"My Components"}),e.jsx(cs,{value:"create",children:"Create New"})]}),e.jsxs(us,{value:"browse",className:"mt-4",children:[e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Ks,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(Je,{placeholder:"Search community components...",value:o,onChange:j=>n(j.target.value),className:"pl-9"})]}),e.jsx(jt,{className:"h-[400px]",children:u?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):C.length===0?e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[e.jsx(tr,{className:"w-12 h-12 mx-auto mb-4 opacity-20"}),e.jsx("p",{className:"font-medium",children:"No community components yet"}),e.jsx("p",{className:"text-sm",children:"Be the first to publish!"})]}):e.jsx("div",{className:"grid grid-cols-2 gap-4",children:C.map(j=>{const y=z(j.icon);return e.jsx("div",{className:"p-4 rounded-xl border border-border bg-card hover:border-primary/50 transition-colors",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center flex-shrink-0",style:{backgroundColor:`${j.color}20`},children:e.jsx(y,{className:"w-6 h-6",style:{color:j.color}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h4",{className:"font-medium truncate",children:j.name}),e.jsx(W,{className:Z("text-xs",Ph[j.category]),children:j.category})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:j.description||"No description"}),e.jsxs("div",{className:"flex items-center justify-between mt-3",children:[e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(Ut,{className:"w-3 h-3"}),j.downloads_count," downloads"]}),e.jsxs(h,{size:"sm",variant:"outline",onClick:()=>v(j),children:[e.jsx(Ut,{className:"w-3 h-3 mr-1"}),"Import"]})]})]})]})},j.id)})})})]}),e.jsx(us,{value:"my-components",className:"mt-4",children:e.jsx(jt,{className:"h-[400px]",children:x.length===0?e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[e.jsx(Ra,{className:"w-12 h-12 mx-auto mb-4 opacity-20"}),e.jsx("p",{className:"font-medium",children:"No custom components yet"}),e.jsx("p",{className:"text-sm",children:"Create your first reusable component"})]}):e.jsx("div",{className:"space-y-3",children:x.map(j=>{const y=z(j.icon);return e.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg border border-border",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center",style:{backgroundColor:`${j.color}20`},children:e.jsx(y,{className:"w-5 h-5",style:{color:j.color}})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium",children:j.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:j.description||"No description"})]}),e.jsxs(h,{size:"sm",variant:"outline",onClick:()=>b(j),children:[e.jsx(An,{className:"w-3 h-3 mr-1"}),"Publish"]})]},j.id)})})})}),e.jsx(us,{value:"create",className:"mt-4",children:e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(ft,{className:"w-8 h-8 text-primary"})}),e.jsx("h3",{className:"font-medium text-lg",children:"Create Custom Component"}),e.jsx("p",{className:"text-muted-foreground mt-2 max-w-md mx-auto",children:"Build reusable components by combining existing blocks with custom logic. Save them to your library or share with the community."}),e.jsxs(h,{className:"mt-6",children:[e.jsx(ft,{className:"w-4 h-4 mr-2"}),"Start Creating"]})]})})]})]})})},Dh=({open:s,onOpenChange:t,agentId:a,runs:r,onRefresh:o})=>{const[n,l]=i.useState(null),c=d=>{switch(d){case"running":return e.jsxs(W,{className:"bg-blue-500/20 text-blue-600 gap-1",children:[e.jsx(Pe,{className:"w-3 h-3 animate-spin"}),"Running"]});case"completed":return e.jsxs(W,{className:"bg-emerald-500/20 text-emerald-600 gap-1",children:[e.jsx(ys,{className:"w-3 h-3"}),"Completed"]});case"failed":return e.jsxs(W,{className:"bg-destructive/20 text-destructive gap-1",children:[e.jsx(Rt,{className:"w-3 h-3"}),"Failed"]});default:return e.jsxs(W,{variant:"secondary",className:"gap-1",children:[e.jsx(Cs,{className:"w-3 h-3"}),d]})}},x=(d,u)=>{const m=new Date(d).getTime(),g=(u?new Date(u).getTime():Date.now())-m;return g<1e3?`${g}ms`:g<6e4?`${Math.round(g/1e3)}s`:`${Math.round(g/6e4)}m`};return e.jsx(En,{open:s,onOpenChange:t,children:e.jsxs(Hr,{className:"w-[400px] sm:w-[540px]",children:[e.jsx(sd,{className:"pb-4 border-b border-border",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(td,{children:"Agent Runs"}),e.jsxs(h,{variant:"outline",size:"sm",onClick:o,className:"gap-2",children:[e.jsx(st,{className:"w-4 h-4"}),"Refresh"]})]})}),e.jsx(jt,{className:"h-[calc(100vh-120px)] mt-4",children:e.jsx("div",{className:"space-y-3 pr-4",children:r.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Cs,{className:"w-12 h-12 mx-auto text-muted-foreground
21/30 mb-4"}),e.jsx("h3",{className:"font-medium text-muted-foreground",children:"No runs yet"}),e.jsx("p",{className:"text-sm text-muted-foreground/60 mt-1",children:'Click "Run" to execute your agent'})]}):r.map(d=>{const u=n===d.id,m=d.execution_log||[];return e.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[e.jsxs("button",{onClick:()=>l(u?null:d.id),className:"w-full p-4 flex items-center justify-between hover:bg-muted/30 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[u?e.jsx(nt,{className:"w-4 h-4 text-muted-foreground"}):e.jsx($t,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("div",{className:"text-left",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[c(d.status),e.jsxs("span",{className:"text-xs text-muted-foreground capitalize",children:[d.trigger_type," trigger"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:ha(new Date(d.started_at),{addSuffix:!0})})]})]}),e.jsx("div",{className:"text-right",children:e.jsx("p",{className:"text-sm font-mono",children:x(d.started_at,d.finished_at)})})]}),e.jsx("div",{className:Z("border-t border-border bg-muted/20 overflow-hidden transition-all duration-200",u?"max-h-[1000px] opacity-100 p-4":"max-h-0 opacity-0 p-0"),style:{height:u?"auto":0},children:e.jsxs("div",{className:"space-y-2",children:[d.error_message&&e.jsx("div",{className:"p-3 rounded-md bg-destructive/10 border border-destructive/20 text-sm text-destructive",children:d.error_message}),m.length>0?e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Execution Log"}),m.map((p,g)=>e.jsxs("div",{className:Z("flex items-start gap-2 p-2 rounded-md text-sm",p.status==="completed"&&"bg-emerald-500/10",p.status==="failed"&&"bg-destructive/10",p.status==="skipped"&&"bg-muted"),children:[p.status==="completed"&&e.jsx(ys,{className:"w-4 h-4 text-emerald-500 mt-0.5 shrink-0"}),p.status==="failed"&&e.jsx(Rt,{className:"w-4 h-4 text-destructive mt-0.5 shrink-0"}),p.status==="skipped"&&e.jsx(Cs,{className:"w-4 h-4 text-muted-foreground mt-0.5 shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:p.message}),e.jsx("p",{className:"text-xs text-muted-foreground",children:at(new Date(p.timestamp),"HH:mm:ss")})]})]},g))]}):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No execution logs available"})]})})]},d.id)})})})]})})},Js=i.forwardRef(({className:s,...t},a)=>e.jsx(gc,{className:Z("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",s),...t,ref:a,children:e.jsx(Fm,{className:Z("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Js.displayName=gc.displayName;const Kt=i.forwardRef(({className:s,...t},a)=>e.jsxs(fc,{ref:a,className:Z("relative flex w-full touch-none select-none items-center",s),...t,children:[e.jsx(Bm,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:e.jsx($m,{className:"absolute h-full bg-primary"})}),e.jsx(qm,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Kt.displayName=fc.displayName;const Oh=["professional","casual","friendly","witty","formal","empathetic"],jo=["twitter","linkedin","reddit","facebook","youtube"],Fh=["positive","negative","neutral","all"],Bh={discovery:"#10b981",ai:"#8b5cf6",action:"#f59e0b",filter:"#06b6d4",control:"#ec4899",custom:"#6366f1"},$h=({node:s,onConfigChange:t,onDelete:a})=>{const r=Cn[s.data.icon]||Ra,o=Bh[s.data.category]||"#6366f1",n=Object.keys(s.data.config),l=(x,d)=>{t({...s.data.config,[x]:d})},c=(x,d)=>{const u=x.replace(/_/g," ").replace(/([A-Z])/g," $1").trim(),m=typeof d;if(x==="platform"||x==="platforms")return Array.isArray(d)?e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs capitalize",children:u}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:jo.map(g=>{const v=d.includes(g);return e.jsx("button",{onClick:()=>{const b=v?d.filter(z=>z!==g):[...d,g];l(x,b)},className:Z("px-2.5 py-1 rounded-full text-[11px] font-medium border transition-all capitalize",v?"bg-primary/20 border-primary/40 text-primary":"bg-muted/30 border-border/50 text-muted-foreground hover:border-border"),children:g},g)})})]},x):e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs capitalize",children:u}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:jo.map(g=>e.jsx("button",{onClick:()=>l(x,g),className:Z("px-2.5 py-1 rounded-full text-[11px] font-medium border transition-all capitalize",d===g?"bg-primary/20 border-primary/40 text-primary":"bg-muted/30 border-border/50 text-muted-foreground hover:border-border"),children:g},g))})]},x);if(x==="tone"||x==="target_tone"||x==="brand_voice")return e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs capitalize",children:u}),e.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:Oh.map(p=>e.jsx("button",{onClick:()=>l(x,p),className:Z("px-2 py-1.5 rounded-lg text-[11px] font-medium border transition-all capitalize text-center",d===p?"bg-primary/15 border-primary/40 text-primary":"bg-muted/20 border-border/40 text-muted-foreground hover:border-border"),children:p},p))})]},x);if(x==="sentiment")return e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs capitalize",children:u}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Fh.map(p=>e.jsx("button",{onClick:()=>l(x,p),className:Z("px-2.5 py-1 rounded-full text-[11px] font-medium border transition-all capitalize",d===p?"bg-primary/20 border-primary/40 text-primary":"bg-muted/30 border-border/50 text-muted-foreground hover:border-border"),children:p},p))})]},x);if(m==="boolean")return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Ce,{className:"text-xs capitalize",children:u}),e.jsx(Js,{checked:d,onCheckedChange:p=>l(x,p)})]},x);if(m==="number"){const p=x.includes("score")||x.includes("confidence")||x.includes("ratio")?100:x.includes("per_hour")?60:x.includes("per_day")||x.includes("limit")||x.includes("results")||x.includes("suggestions")||x.includes("groups")?200:x.includes("length")?1e3:x.includes("hours")?168:x.includes("seconds")||x.includes("delay")?300:x.includes("iterations")?50:100;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Ce,{className:"text-xs capitalize",children:u}),e.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:d})]}),e.jsx(Kt,{value:[d],onValueChange:([g])=>l(x,g),min:0,max:p,step:1,className:"w-full"})]},x)}if(Array.isArray(d))return e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs capitalize",children:u}),e.jsx("div",{className:"flex flex-wrap gap-1 mb-1.5",children:d.map((p,g)=>e.jsxs(W,{variant:"secondary",className:"text-[10px] gap-1 px-1.5 py-0",children:[p,e.jsx("button",{onClick:()=>l(x,d.filter((v,b)=>b!==g)),children:e.jsx(zs,{className:"w-2.5 h-2.5"})})]},g))}),e.jsx(Je,{placeholder:"Type and press Enter",className:"h-7 text-xs",onKeyDown:p=>{p.key==="Enter"&&p.target.value.trim()&&(l(x,[...d,p.target.value.trim()]),p.target.value="")}})]},x);if(x==="content_type"||x==="match_mode"||x==="operator"||x==="condition_type"||x==="format"||x==="urgency"||x==="group_size"||x==="company_
21size"){const g={content_type:["caption","image","carousel","story"],match_mode:["any","all","exact"],operator:["greater_than","less_than","equals","not_equals"],condition_type:["score","platform","sentiment","keyword"],format:["bullet","paragraph","tldr"],urgency:["low","medium","high","critical"],group_size:["small","medium","large","any"],company_size:["startup","small","medium","enterprise","any"]}[x]||["option1"];return e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs capitalize",children:u}),e.jsxs(Gs,{value:d,onValueChange:v=>l(x,v),children:[e.jsx(qs,{className:"h-8 text-xs",children:e.jsx(Us,{})}),e.jsx(Hs,{children:g.map(v=>e.jsx(Te,{value:v,className:"text-xs capitalize",children:v.replace(/_/g," ")},v))})]})]},x)}return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Ce,{className:"text-xs capitalize",children:u}),String(d).length>50?e.jsx(Vs,{value:d,onChange:p=>l(x,p.target.value),rows:3,className:"text-xs"}):e.jsx(Je,{value:d,onChange:p=>l(x,p.target.value),className:"h-8 text-xs"})]},x)};return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("div",{className:"p-4 border-b border-border",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center",style:{backgroundColor:`${o}18`,boxShadow:`0 0 12px ${o}15`},children:e.jsx(r,{className:"w-4 h-4",style:{color:o}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-semibold text-sm truncate",children:s.data.label}),e.jsx("p",{className:"text-[10px] uppercase tracking-wider font-medium",style:{color:o},children:s.data.category})]})]})}),e.jsx(jt,{className:"flex-1",children:e.jsx("div",{className:"p-4 space-y-4",children:n.length===0?e.jsx("p",{className:"text-xs text-muted-foreground text-center py-6",children:"No configuration options"}):n.map(x=>c(x,s.data.config[x]))})}),e.jsxs("div",{className:"p-4 border-t border-border space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground/60",children:[e.jsx(pa,{className:"w-3 h-3"}),e.jsx("span",{children:"Execution runs via your browser extension"})]}),e.jsxs(h,{variant:"ghost",size:"sm",className:"w-full text-destructive hover:text-destructive hover:bg-destructive/10 text-xs",onClick:a,children:[e.jsx(ua,{className:"w-3 h-3 mr-1.5"}),"Delete Node"]})]})]})},qh=()=>{const s=ns(),{toast:t}=zn(),[a,r]=i.useState(!0),[o,n]=i.useState(!1),[l,c]=i.useState(!1),[x,d]=i.useState([]),[u,m]=i.useState([]),[p,g]=i.useState(null),[v,b]=i.useState([]),[z,C]=i.useState([]),[j,y]=i.useState(!1),[N,f]=i.useState(!1),[R,M]=i.useState(!1),[q,_]=i.useState([]),[A,B]=i.useState(null),P=v.find(F=>F.id===A)||null;i.useEffect(()=>{I(),$(),be()},[]),i.useEffect(()=>{p&&Y()},[p]);const I=async()=>{const{data:{user:F}}=await w.auth.getUser();if(!F){s("/auth");return}const{hasEarlyAccess:L}=await Hm(async()=>{const{hasEarlyAccess:K}=await Promise.resolve().then(()=>qb);return{hasEarlyAccess:K}},void 0);if(!L(F.email)){t({title:"Agent Builder is in early access",description:"Contact [email protected] to request access."}),s("/dashboard");return}r(!1)},$=async()=>{const{data:F}=await w.from("agent_component_templates").select("*").or("is_system.eq.true,is_published.eq.true");F&&d(F)},be=async()=>{const{data:{user:F}}=await w.auth.getUser();if(!F)return;const{data:L}=await w.from("user_agents").select("*").eq("user_id",F.id).order("updated_at",{ascending:!1});L&&(m(L),L.length>0&&!p&&O(L[0]))},Y=async()=>{if(!p)return;const{data:F}=await w.from("agent_runs").select("*").eq("agent_id",p.id).order("started_at",{ascending:!1}).limit(5);F&&_(F)},O=F=>{g(F);const L=F.canvas_data;b((L==null?void 0:L.nodes)||[]),C((L==null?void 0:L.edges)||[]),B(null)},he=async()=>{const{data:{user:F}}=await w.auth.getUser();if(!F)return;const{data:L}=await w.from("user_agents").insert({user_id:F.id,name:"Untitled Agent",canvas_data:{nodes:[],edges:[]}}).select().single();L&&(m([L,...u]),O(L),t({title:"Agent created"}))},re=async()=>{p&&(n(!0),await w.from("user_agents").update({canvas_data:{nodes:v,edges:z},updated_at:new Date().toISOString()}).eq("id",p.id),n(!1),t({title:"Saved"}))},oe=async()=>{var K;if(!p||v.length===0)return;c(!0);const{data:{user:F}}=await w.auth.getUser();if(!F){c(!1);return}await w.from("user_agents").update({canvas_data:{nodes:v,edges:z},updated_at:new Date().toISOString()}).eq("id",p.id);const{data:L}=await w.from("agent_runs").insert({agent_id:p.id,user_id:F.id,trigger_type:"manual",status:"running",execution_log:[]}).select().single();if(!L){c(!1);return}t({title:"Agent started",description:"Executing workflow via extension & backend..."});try{const ue=await jh({userId:F.id,runId:L.id,agentId:p.id,nodes:v,edges:z,onLog:me=>{},onStatusChange:me=>{}});await w.from("agent_runs").update({status:ue.status,finished_at:new Date().toISOString(),execution_log:ue.logs,error_message:ue.status==="failed"?(K=ue.logs.find(me=>me.status==="failed"))==null?void 0:K.message:null}).eq("id",L.id),await w.from("user_agents").update({last_run_at:new Date().toISOString(),run_count:(p.run_count||0)+1}).eq("id",p.id);const Ne=ue.logs.filter(me=>me.status==="failed").length,fe=ue.logs.filter(me=>me.status==="completed").length;t({title:ue.status==="completed"?"Agent completed":"Agent finished with errors",description:`${fe}
21 steps completed${Ne>0?`, ${Ne} failed`:""}`,variant:Ne>0?"destructive":"default"})}catch(ue){await w.from("agent_runs").update({status:"failed",finished_at:new Date().toISOString(),error_message:ue.message}).eq("id",L.id),t({title:"Agent failed",description:ue.message,variant:"destructive"})}finally{c(!1),Y()}},T=i.useCallback(F=>{const L=200+v.length*40,K=150+v.length*30,ue={id:`node-${Date.now()}`,type:"component",position:{x:L,y:K},data:{templateId:F.id,label:F.name,category:F.category,icon:F.icon||"Puzzle",color:F.color||"#8b5cf6",config:{...F.default_config}}};b([...v,ue]),B(ue.id)},[v]),ce=i.useCallback(F=>{A&&b(v.map(L=>L.id===A?{...L,data:{...L.data,config:F}}:L))},[A,v]),le=F=>{switch(F){case"running":return e.jsx(Pe,{className:"w-3 h-3 animate-spin text-blue-400"});case"completed":return e.jsx(ys,{className:"w-3 h-3 text-emerald-400"});case"failed":return e.jsx(Rt,{className:"w-3 h-3 text-destructive"});default:return e.jsx(Ss,{className:"w-3 h-3 text-amber-400"})}};return a?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-4",children:[e.jsxs("div",{className:"relative w-16 h-16 mx-auto",children:[e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary/20"}),e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary border-t-transparent animate-spin"})]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading Agent Builder..."})]})}):e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx(Vt,{title:"Agent Builder â visual workflows for social engagement | deSHILLER",description:"Compose multi-step engagement agents on a visual canvas: discovery, scoring, AI replies, follow-ups and DMs. Run them via the deSHILLER browser extension.",path:"/agent-builder"}),e.jsx("div",{className:"border-b border-border bg-card/80 backdrop-blur-md sticky top-0 z-50",children:e.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(h,{variant:"ghost",size:"sm",onClick:()=>s("/dashboard"),className:"gap-1.5 h-8",children:[e.jsx(Ts,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline text-xs",children:"Dashboard"})]}),e.jsx("div",{className:"h-5 w-px bg-border"}),e.jsx(Ah,{agent:p,agents:u,onSelect:O,onCreate:he,onUpdate:F=>
21{if(p){const L={...p,...F};g(L),m(u.map(K=>K.id===L.id?L:K))}}}),e.jsxs(W,{variant:"secondary",className:"text-[10px] gap-1 px-2 py-0.5 hidden md:flex",children:[e.jsx(pa,{className:"w-3 h-3"}),"Extension Required"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs(h,{variant:"ghost",size:"sm",onClick:()=>M(!0),className:"h-8 gap-1.5 hidden sm:flex",children:[e.jsx(yr,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"text-xs",children:"Runs"})]}),e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>y(!0),className:"h-8 gap-1.5",children:e.jsx(or,{className:"w-3.5 h-3.5"})}),e.jsxs(h,{variant:"outline",size:"sm",onClick:re,disabled:o,className:"h-8 gap-1.5",children:[e.jsx(pi,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"text-xs hidden sm:inline",children:o?"...":"Save"})]}),e.jsxs(h,{size:"sm",onClick:oe,disabled:!p||v.length===0||l,className:"h-8 gap-1.5",children:[l?e.jsx(Pe,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Ua,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"text-xs",children:l?"Running":"Run"})]})]})]})}),e.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e.jsx(kh,{templates:x,onDragStart:()=>{},onQuickAdd:T}),e.jsx("div",{className:"flex-1 relative",children:e.jsx(wh,{nodes:v,edges:z,templates:x,onNodesChange:b,onEdgesChange:C,selectedNodeId:A,onSelectNode:B})}),e.jsx("div",{className:"w-72 border-l border-border flex flex-col hidden lg:flex",style:{background:"hsl(222 47% 10%)"},children:P?e.jsx($h,{node:P,onConfigChange:ce,onDelete:()=>{b(v.filter(F=>F.id!==A)),C(z.filter(F=>F.source!==A&&F.target!==A)),B(null)}}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-4 border-b border-border",children:e.jsxs("h3",{className:"font-medium text-xs flex items-center gap-2 uppercase tracking-wider text-muted-foreground",children:[e.jsx(Et,{className:"w-3.5 h-3.5 text-primary"}),"Agent Status"]})}),e.jsx(jt,{className:"flex-1",children:e.jsx("div",{className:"p-4 space-y-4",children:p?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:"Status"}),e.jsx(W,{variant:p.status==="active"?"default":"secondary",className:"capitalize text-[10px]",children:p.status||"draft"})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:"Nodes"}),e.jsx("span",{className:"font-mono",children:v.length})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:"Connections"}),e.jsx("span",{className:"font-mono",children:z.length})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:"Total Runs"}),e.jsx("span",{className:"font-mono",children:p.run_count||0})]}),q.length>0&&e.jsxs("div",{className:"pt-3 border-t border-border space-y-2",children:[e.jsx("h4",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Recent Runs"}),q.slice(0,3).map(F=>e.jsxs("div",{className:"flex items-center justify-between p-2 rounded-md bg-muted/20 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[le(F.status),e.jsx("span",{className:"capitalize",children:F.status})]}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:new Date(F.started_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]},F.id)),e.jsxs(h,{variant:"ghost",size:"sm",className:"w-full text-[10px]",onClick:()=>M(!0),children:["View All ",e.jsx($t,{className:"w-3 h-3 ml-1"})]})]})]}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Et,{className:"w-10 h-10 mx-auto text-muted-foreground/20 mb-3"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"No agent selected"}),e.jsx(h,{size:"sm",variant:"outline",className:"mt-3 text-xs",onClick:he,children:"Create Agent"})]})})})]})})]}),e.jsx(Rh,{open:j,onOpenChange:y,agent:p,onSave:async F=>{if(!p)return;await w.from("user_agents").update(F).eq("id",p.id);const L={...p,...F};g(L),m(u.map(K=>K.id===L.id?L:K)),t({title:"Settings saved"})}}),e.jsx(Mh,{open:N,onOpenChange:f,onImport:F=>{d([...x,F]),t({title:"Imported",description:`${F.name} added.`})}}),e.jsx(Dh,{open:R,onOpenChange:M,agentId:p==null?void 0:p.id,runs:q,onRefresh:Y})]})},Hh=Gm(),dd={auth:{signInWithOAuth:async(s,t)=>{const a=await Hh.signInWithOAuth(s,{redirect_uri:t==null?void 0:t.redirect_uri,extraParams:{...t==null?void 0:t.extraParams}});if(a.redirected||a.error)return a;try{await w.auth.setSession(a.tokens)}catch(r){return{error:r instanceof Error?r:new Error(String(r))}}return a}}},Ot=i.forwardRef(({className:s,...t},a)=>e.jsx(bc,{ref:a,className:Z("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...t,children:e.jsx(Um,{className:Z("flex items-center justify-center text-current"),children:e.jsx(bs,{className:"h-4 w-4"})})}));Ot.displayName=bc.displayName;const Gh=Lr().min(8,"At least 8 characters").regex(/[A-Z]/,"At least one uppercase letter").regex(/[a-z]/,"At least one lowercase letter").regex(/[0-9]/,"At least one number"),Uh=s=>{const t={length:s.length>=8,uppercase:/[A-Z]/.test(s),lowercase:/[a-z]/.test(s),number:/[0-9]/.test(s)}
21,a=Object.values(t).filter(Boolean).length;return{checks:t,passed:a,total:4}},Wh=({className:s="h-4 w-4"})=>e.jsxs("svg",{className:s,viewBox:"0 0 48 48","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{fill:"#FFC107",d:"M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z"}),e.jsx("path",{fill:"#FF3D00",d:"M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z"}),e.jsx("path",{fill:"#4CAF50",d:"M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z"}),e.jsx("path",{fill:"#1976D2",d:"M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.5
2171c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z"})]}),Vh=()=>{const s=ns(),[t,a]=i.useState(!1),[r,o]=i.useState(!1),[n,l]=i.useState(""),[c,x]=i.useState(""),[d,u]=i.useState(""),[m,p]=i.useState(!0),[g,v]=i.useState(!1),[b,z]=i.useState(!0),[C,j]=i.useState(!1),[y,N]=i.useState(!1),[f,R]=i.useState(!1),[M,q]=i.useState(null),[_,A]=i.useState(!1);i.useEffect(()=>{A(!0)},[]);const B=Uh(c),P=B.passed===B.total,I=re=>{const oe=Gh.safeParse(re);return oe.success?(q(null),!0):(q(oe.error.errors[0].message),!1)},$=async()=>{o(!0);try{const re=await dd.auth.signInWithOAuth("google",{redirect_uri:window.location.origin+"/dashboard"});if(re.error){k.error(re.error.message||"Google sign-in failed"),o(!1);return}if(re.redirected)return;s("/dashboard")}catch(re){k.error((re==null?void 0:re.message)||"Google sign-in failed"),o(!1)}},be=async re=>{if(re.preventDefault(),!n){k.error("Please enter your email address");return}a(!0);try{const{error:oe}=await w.auth.resetPasswordForEmail(n,{redirectTo:`${window.location.origin}/auth`});oe?k.error(oe.message):(k.success("Password reset email sent. Check your inbox."),v(!1))}catch(oe){k.error(oe.message||"An error occurred")}finally{a(!1)}},Y=C&&y&&f,O=async re=>{if(re.preventDefault(),!m&&!Y){k.error("Please agree to all policies before signing up");return}if(!m&&!I(c)){k.error("Please fix password requirements");return}a(!0);try{if(m){const{error:oe}=await w.auth.signInWithPassword({email:n,password:c});if(oe){k.error(oe.message);return}if(b){const T=new Date;T.setDate(T.getDate()+30),localStorage.setItem("deshiller_remember_expiry",T.toISOString()),localStorage.removeItem("deshiller_session_temporary")}else localStorage.setItem("deshiller_session_temporary","true"),localStorage.removeItem("deshiller_remember_expiry");k.success("Welcome back"),s("/dashboard")}else{const{data:oe,error:T}=await w.auth.signUp({email:n,password:c,options:{emailRedirectTo:`${window.location.origin}/dashboard`,data:{full_name:d}}});if(T){k.error(T.message);return}if(oe!=null&&oe.user)try{await w.functions.invoke("send-notification-email",{body:{type:"welcome",to:n,data:{name:d||n.split("@")[0],userId:oe.user.id}}})}catch{}typeof window<"u"&&window.gtag_report_conversion&&window.gtag_report_conversion(),k.success("Account created â your 24h free trial just started."),s("/dashboard")}}catch(oe){k.error(oe.message||"An error occurred")}finally{a(!1)}},he=[{icon:ws,title:"AI replies in seconds",desc:"Drafted in your voice across X, LinkedIn, Reddit, YouTube."},{icon:gs,title:"Auto-discover hot posts",desc:"We surface high-intent leads while you sleep."},{icon:bt,title:"6+ platforms, one place",desc:"Engage everywhere from a single dashboard."},{icon:Tt,title:"Cancel anytime",desc:"No lock-in, no contracts, no card to start."}];return e.jsxs("div",{className:"min-h-screen bg-background flex flex-col relative overflow-hidden",children:[e.jsx("div",{className:"absolute -top-40 -right-40 w-[700px] h-[700px] rounded-full bg-primary/[0.10] blur-3xl animate-[pulse_8s_ease-in-out_infinite]"}),e.jsx("div",{className:"absolute -bottom-40 -left-40 w-[600px] h-[600px] rounded-full bg-accent/[0.08] blur-3xl animate-[pulse_10s_ease-in-out_infinite]"}),e.jsx("div",{className:"absolute top-1/3 left-1/2 -translate-x-1/2 w-[400px] h-[400px] rounded-full bg-primary/[0.05] blur-3xl animate-[pulse_12s_ease-in-out_infinite]"}),e.jsx("div",{className:"fixed inset-0 opacity-[0.018] pointer-events-none mix-blend-overlay",children:e.jsxs("svg",{width:"100%",height:"100%",children:[e.jsx("filter",{id:"grain",children:e.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.85",numOctaves:"3",stitchTiles:"stitch"})}),e.jsx("rect",{width:"100%",height:"100%",filter:"url(#grain)"})]})}),e.jsx("div",{className:"relative z-10 border-b border-border/30 backdrop-blur-sm bg-background/40",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-14",children:[e.jsxs(h,{variant:"ghost",size:"sm",onClick:()=>s("/"),className:"text-muted-foreground hover:text-foreground",children:[e.jsx(Ts,{className:"h-4 w-4 mr-2"}),"Home"]}),e.jsx("a",{href:"https://wa.me/34711079539",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Need help?"})]})})}),e.jsxs("div",{className:"flex-1 flex relative z-10",children:[e.jsx("div",{className:"hidden lg:flex flex-1 items-center justify-center p-12 relative",children:e.jsxs("div",{className:`max-w-md
21space-y-8 transition-all duration-700 ease-out ${_?"opacity-100 translate-y-0":"opacity-0 translate-y-8"}`,children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-emerald-500/10 border border-emerald-500/30 text-emerald-500 text-xs font-semibold tracking-wide animate-[fade-in_0.6s_ease-out]",children:[e.jsx(gi,{className:"h-3.5 w-3.5"}),"FREE for 24 hours · No credit card"]}),e.jsxs("div",{className:"space-y-4 animate-[fade-in_0.4s_ease-out]",children:[e.jsx("h2",{className:"font-display text-5xl font-semibold leading-[1.05] text-foreground tracking-tight",children:m?e.jsxs(e.Fragment,{children:["Your leads",e.jsx("br",{}),"are ",e.jsx("span",{className:"text-primary italic",children:"waiting."})]}):e.jsxs(e.Fragment,{children:["Turn scrolling",e.jsx("br",{}),"into ",e.jsx("span",{className:"text-primary italic",children:"revenue."})]})}),e.jsx("p",{className:"text-muted-foreground text-base leading-relaxed",children:m?"Pick up where you left off. Your AI agents are still working.":"AI finds buyers across X, LinkedIn, Reddit & more â and replies for you."})]},m?"pitch-in":"pitch-up"),e.jsx("div",{className:"space-y-2.5",children:he.map((re,oe)=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-xl bg-white/[0.03] border border-white/[0.06] backdrop-blur-sm transition-all duration-300 hover:bg-white/[0.06] hover:border-primary/20 hover:translate-x-1",style:{animation:`fade-in 0.5s ease-out ${.2+oe*.08}s both`},children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-gradient-to-br from-primary/20 to-primary/5 border border-primary/20 flex items-center justify-center flex-shrink-0",children:e.jsx(re.icon,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:re.title}),e.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:re.desc})]})]},oe))}),e.jsxs("div",{className:"pt-4 border-t border-border/30 flex items-center gap-3",children:[e.jsx("div",{className:"flex -space-x-2",children:[...Array(4)].map((re,oe)=>e.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-background bg-gradient-to-br from-primary/40 to-accent/40"},oe))}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-foreground/90 font-semibold",children:"44 marketers shipping leads"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"already growing with DESHILLER"})]})]})]})}),e.jsx("div",{className:"flex-1 flex items-center justify-center p-6 sm:p-8 lg:p-12",children:e.jsxs("div",{className:`w-full max-w-[440px] transition-all duration-500 ease-out ${_?"opacity-100 translate-y-0":"opacity-0 translate-y-4"}`,children:[e.jsx("div",{className:"lg:hidden mb-4 flex justify-center",children:e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-emerald-500/10 border border-emerald-500/30 text-emerald-500 text-xs font-semibold",children:[e.jsx(gi,{className:"h-3.5 w-3.5"}),"FREE 24h trial · No card"]})}),e.jsxs("div",{className:"rounded-2xl border border-border/50 bg-card/70 backdrop-blur-xl p-7 sm:p-8 shadow-2xl shadow-black/30 relative overflow-hidden",children:[e.jsx("div",{className:"absolute -top-px left-1/2 -translate-x-1/2 h-px w-3/4 bg-gradient-to-r from-transparent via-primary/40 to-transparent"}),e.jsxs("div",{className:"space-y-1.5 mb-6 animate-[fade-in_0.3s_ease-out]",children:[e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight",children:g?"Reset password":m?"Welcome back":"Start free"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:g?"We'll email you a reset link.":m?"Sign in to your dashboard.":e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-emerald-500 font-medium",children:"Free for 24 hours."})," ","No credit card required."]})})]},g?"hdr-forgot":m?"hdr-in":"hdr-up"),!g&&e.jsxs(e.Fragment,{children:[e.jsx(h,{type:"button",variant:"outline",onClick:$,disabled:r||t,className:"w-full h-11 bg-background/60 hover:bg-background border-border/60 hover:border-border transition-all duration-200 group",children:r?e.jsx("div",{className:"w-4 h-4 border-2 border-foreground
21/30 border-t-foreground rounded-full animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(Wh,{className:"h-4 w-4 mr-2.5"}),e.jsx("span",{className:"font-medium",children:"Continue with Google"})]})}),e.jsxs("div",{className:"relative my-5",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-border/40"})}),e.jsx("div",{className:"relative flex justify-center text-[11px] uppercase tracking-wider",children:e.jsx("span",{className:"bg-card/70 px-2 text-muted-foreground",children:"or with email"})})]})]}),g?e.jsxs("form",{onSubmit:be,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"reset-email",className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(Fs,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground/50"}),e.jsx(Je,{id:"reset-email",type:"email",placeholder:"[email protected]",value:n,onChange:re=>l(re.target.value),required:!0,disabled:t,className:"h-11 pl-9 bg-background/50 border-border/60 focus:border-primary/50"})]})]}),e.jsx(h,{type:"submit",className:"w-full h-11 bg-primary text-primary-foreground hover:bg-primary/90",disabled:t,children:t?"Sending...":"Send reset link"}),e.jsx("button",{type:"button",onClick:()=>v(!1),className:"w-full text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Back to sign in"})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("form",{onSubmit:O,className:"space-y-4",children:[!m&&e.jsxs("div",{className:"space-y-2 animate-[fade-in_0.3s_ease-out]",children:[e.jsx(Ce,{htmlFor:"fullname",className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Full name"}),e.jsx(Je,{id:"fullname",type:"text",placeholder:"John Doe",value:d,onChange:re=>u(re.target.value),required:!m,disabled:t,className:"h-11 bg-background/50 border-border/60 focus:border-primary/50"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"email",className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(Fs,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground/50"}),e.jsx(Je,{id:"email",type:"email",placeholder:"[email protected]",value:n,onChange:re=>l(re.target.value),required:!0,disabled:t,className:"h-11 pl-9 bg-background/50 border-border/60 focus:border-primary/50"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"password",className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(_t,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground/50"}),e.jsx(Je,{id:"password",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:c,onChange:re=>{x(re.target.value),m||I(re.target.value)},required:!0,disabled:t,minLength:8,className:`h-11 pl-9 bg-background/50 border-border/60 focus:border-primary/50 ${!m&&c&&!P?"border-destructive/50":""}`})]}),!m&&c&&e.jsxs("div",{className:"space-y-2 pt-1 animate-[fade-in_0.2s_ease-out]",children:[e.jsx("div",{className:"grid grid-cols-2 gap-1.5 text-xs",children:[{check:B.checks.length,label:"8+ characters"},{check:B.checks.uppercase,label:"Uppercase"},{check:B.checks.lowercase,label:"Lowercase"},{check:B.checks.number,label:"Number"}].map(({check:re,label:oe})=>e.jsxs("div",{className:`flex items-center gap-1.5 transition-colors ${re?"text-emerald-500":"text-muted-foreground/50"}`,children:[re?e.jsx(bs,{className:"h-3 w-3"}):e.jsx(zs,{className:"h-3 w-3"}),oe]},oe))}),e.jsx("div",{className:"flex gap-1",children:[1,2,3,4].map(re=>e.jsx("div",{className:`h-1 flex-1 rounded-full transition-all duration-300 ${B.passed>=re?B.passed<=2?"bg-destructive":B.passed===3?"bg-yellow-500":"bg-emerald-500":"bg-muted"}`},re))})]}),m&&e.jsxs("div",{className:"flex items-center justify-between pt-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ot,{id:"remember",checked:b,onCheckedChange:re=>z(re===!0)}),e.jsx("label",{htmlFor:"remember",className:"text-xs text-muted-foreground cursor-pointer",children:"Remember me"})]}),e.jsx("button",{type:"button",onClick:()=>v(!0),className:"text-xs text-muted-foreground hover:text-primary transition-colors",children:"Forgot password?"})]})]}),!m&&e.jsxs("div",{className:"space-y-3 animate-[fade-in_0.3s_ease-out]",children:[e.jsxs("div",{className:"flex items-center gap-2 p-2.5 rounded-lg bg-emerald-500/5 border border-emerald-500/15",children:[e.jsx(Cs,{className:"h-4 w-4 text-emerald-500 flex-shrink-0"}
21),e.jsxs("p",{className:"text-xs text-foreground/80",children:[e.jsx("span",{className:"font-semibold text-emerald-500",children:"24 hours free."})," ",e.jsx("span",{className:"text-muted-foreground",children:"Cancel anytime, no card needed."})]})]}),e.jsx("div",{className:"space-y-2",children:[{id:"terms",checked:C,onChange:j,label:"Terms of Service",to:"/terms"},{id:"privacy",checked:y,onChange:N,label:"Privacy Policy",to:"/privacy"},{id:"antispam",checked:f,onChange:R,label:"Anti-Spam Policy",to:"/anti-spam",suffix:" and platform rules"}].map(({id:re,checked:oe,onChange:T,label:ce,to:le,suffix:F})=>e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(Ot,{id:re,checked:oe,onCheckedChange:L=>T(L===!0),className:"mt-0.5"}),e.jsxs("label",{htmlFor:re,className:"text-xs text-muted-foreground leading-tight cursor-pointer",children:["I agree to the"," ",e.jsx(Ls,{to:le,target:"_blank",className:"text-foreground hover:text-primary underline",children:ce}),F]})]},re))})]}),e.jsx(h,{type:"submit",className:"w-full h-11 bg-primary text-primary-foreground hover:bg-primary/90 hover:shadow-lg hover:shadow-primary/30 transition-all duration-200 font-semibold group",disabled:t||!m&&(!Y||!P),children:t?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 border-2 border-primary-foreground/30 border-t-primary-foreground rounded-full animate-spin"}),m?"Signing in...":"Creating account..."]}):e.jsxs("span",{className:"flex items-center gap-2",children:[m?"Sign in":"Start my 24h free trial",e.jsx(es,{className:"h-4 w-4 opacity-0 group-hover:opacity-100 transition-opacity"})]})})]}),e.jsx("div",{className:"text-center",children:e.jsx("button",{onClick:()=>{p(!m),l(""),x(""),u(""),q(null)},className:"text-sm text-muted-foreground hover:text-foreground transition-colors",type:"button",children:m?e.jsxs(e.Fragment,{children:["New here? ",e.jsx("span",{className:"font-semibold text-primary",children:"Start free â"})]}):e.jsxs(e.Fragment,{children:["Already have an account? ",e.jsx("span",{className:"font-semibold text-primary",children:"Sign in"})]})})})]})]}),!g&&e.jsxs("p",{className:"text-[11px] text-muted-foreground/60 text-center mt-4 leading-relaxed",children:[m?"By signing in":"By signing up",", you agree to our"," ",e.jsx(Ls,{to:"/terms",className:"hover:text-foreground transition-colors underline",children:"Terms"}),", ",e.jsx(Ls,{to:"/privacy",className:"hover:text-foreground transition-colors underline",children:"Privacy"})," & ",e.jsx(Ls,{to:"/anti-spam",className:"hover:text-foreground transition-colors underline",children:"Anti-Spam"}),"."]})]})})]}),e.jsx("footer",{className:"relative z-10 border-t border-border/20 py-4",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-center gap-3 text-xs text-muted-foreground/50",children:[e.jsx("span",{children:"© 2025 DESHILLER"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(Ls,{to:"/terms",className:"hover:text-foreground transition-colors",children:"Terms"}),e.jsx(Ls,{to:"/privacy",className:"hover:text-foreground transition-colors",children:"Privacy"}),e.jsx(Ls,{to:"/anti-spam",className:"hover:text-foreground transition-colors",children:"Anti-Spam"})]})]})})})]})},Yh=()=>{const s=ns(),[t]=jc(),a=t.get("url")||"",[r,o]=i.useState("signup"),[n,l]=i.useState(!1),[c,x]=i.useState(""),[d,u]=i.useState(""),[m,p]=i.useState(!1),[g,v]=i.useState(a);i.useEffect(()=>{(async()=>{const{data:{session:j}}=await w.auth.getSession();j&&o("extension")})()},[]);const b=async C=>{if(C.preventDefault(),!m){k.error("Please agree to the terms to continue");return}if(d.length<6){k.error("Password must be at least 6 characters");return}l(!0);try{const{data:j,error:y}=await w.auth.signUp({email:c,password:d,options:{emailRedirectTo:`${window.location.origin}/dashboard`,data:{website_url:g}}});if(y)if(y.message.includes("already registered")){const{error:N}=await w.auth.signInWithPassword({email:c,password:d});if(N){k.error("Account exists. Please check your password or sign in.");return}}else{k.error(y.message);return}if(g&&(j!=null&&j.user))try{await w.from("product_profiles").upsert({user_id:j.user.id,product_name:new URL(g).hostname.replace("www.",""),value_proposition:`Website: ${g}
21`,benefits:"To be analyzed",ideal_customer_profile:"To be analyzed"},{onConflict:"user_id"})}catch{}typeof window<"u"&&window.gtag_report_conversion&&window.gtag_report_conversion(),k.success("Account created! Now install the extension."),s("/install-extension")}catch(j){k.error(j.message||"An error occurred")}finally{l(!1)}},z=()=>{k.success("You're all set! Enjoy your 24-hour trial."),s("/dashboard")};return e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx("div",{className:"fixed inset-0 opacity-[0.02] pointer-events-none",children:e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, hsl(var(--foreground)) 1px, transparent 0)",backgroundSize:"40px 40px"}})}),e.jsx("div",{className:"relative z-10 border-b border-border/50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/"),className:"text-sm",children:[e.jsx(Ts,{className:"h-4 w-4 mr-2"}),"Back"]}),e.jsx("span",{className:"text-lg font-semibold tracking-tight",children:"DESHILLER"}),e.jsx("div",{className:"w-20"})," "]})})}),e.jsx("div",{className:"flex-1 flex items-center justify-center p-6 relative z-10",children:e.jsxs("div",{className:"w-full max-w-lg",children:[e.jsxs("div",{className:"flex items-center justify-center gap-4 mb-8",children:[e.jsxs("div",{className:`flex items-center gap-2 ${r==="signup"?"text-primary":"text-muted-foreground"}`,children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium ${r==="signup"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:r==="extension"?e.jsx(bs,{className:"h-4 w-4"}):"1"}),e.jsx("span",{className:"text-sm font-medium hidden sm:inline",children:"Create Account"})]}),e.jsx("div",{className:"w-12 h-0.5 bg-border"}),e.jsxs("div",{className:`flex items-center gap-2 ${r==="extension"?"text-primary":"text-muted-foreground"}`,children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium ${r==="extension"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:"2"}),e.jsx("span",{className:"text-sm font-medium hidden sm:inline",children:"Get Extension"})]})]}),r==="signup"?e.jsx(U,{className:"border-border/50 bg-card/50 backdrop-blur-sm",children:e.jsxs(ye,{className:"pt-8 pb-8 px-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-primary/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(es,{className:"h-8 w-8 text-primary"})}),e.jsx("h1",{className:"text-2xl font-semibold mb-2",children:"Start your free trial"}),e.jsx("p",{className:"text-muted-foreground",children:"Get 24 hours of full access. No credit card required."})]}),e.jsxs("form",{onSubmit:b,className:"space-y-4",children:[g&&e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-primary/5 border border-primary/10 mb-4",children:[e.jsx(bt,{className:"h-4 w-4 text-primary flex-shrink-0"}),e.jsx("span",{className:"text-sm truncate",children:g}),e.jsx("button",{type:"button",onClick:()=>v(""),className:"ml-auto text-xs text-muted-foreground hover:text-foreground",children:"Change"})]}),!g&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"website",children:"Your website (optional)"}),e.jsxs("div",{className:"relative",children:[e.jsx(bt,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(Je,{id:"website",type:"url",placeholder:"https://yourproduct.com",value:g,onChange:C=>v(C.target.value),className:"pl-10 h-11"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"email",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(Fs,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(Je,{id:"email",type:"email",placeholder:"[email protected]",value:c,onChange:C=>x(C.target.value),required:!0,disabled:n,className:"pl-10 h-11"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"password",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(_t,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(Je,{id:"password",type:"password",placeholder:"At least 6 characters",value:d,onChange:C=>u(C.target.value),required:!0,disabled:n,minLength:6,className:"pl-10 h-11"})]})]}),e.jsxs("div",{className:"flex items-start gap-3 pt-2",children:[e.jsx(Ot,{id:"terms",checked:m,onCheckedChange:C=>p(C===!0),className:"mt-0.5"}),e.jsxs("label",{htmlFor:"terms",className:"text-sm text-muted-foreground leading-tight cursor-pointer",children:["I agree to the"," ",e.jsx(Ls,{to:"/terms",target:"_blank",className:"text-foreground hover:text-primary underline",children:"Terms"})," ","and"," ",e.jsx(Ls,{to:"/privacy",target:"_blank",className:"text-foreground hover:text-primary underline",children:"Privacy Policy"})]})]}),e.jsxs(h,{type:"submit",className:"w-full h-12 text-base gap-2",disabled:n||!m,children:[n?"Creating account...":"Continue",e.jsx(Ns,{className:"h-4 w-4"})]})]}),e.jsxs("p",{className:"text-center text-sm text-muted-foreground mt-6",children:["Already have an account?"," ",e.jsx("button",{onClick:()=>s("/auth"),className:"text-primary hover:underline",children:"Sign in"})]})]})}):e.jsx(U,{className:"border-border/50 bg-card/50 backdrop-blur-sm",children:e.jsxs(ye,{className:"pt-8 pb-8 px-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-green-500/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(bs,{className:"h-8 w-8 text-green-500"})}),e.jsx("h1",{className:"text-2xl font-semibold mb-2",children:"Account created!"}),e.jsx("p",{className:"text-muted-foreground",children:"Install our Chrome extension to start engaging."})]}),e.jsxs("div",{className:"flex items-center justify-center gap-2 p-3 rounded-lg bg-primary/10 border border-primary/20 mb-6",children:[e.jsx(Cs,{className:"h-5 w-5 text-primary"}),e.jsx("span",{className:"font-medium text-primary",children:"24-hour free trial activated"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs(h,{onClick:()=>window.open("https://chrome.google.com/webstore/detail/deshiller","_blank"),className:"w-full h-14 text-base gap-3 bg-gradient-to-r from-primary to-primary/80",children:[e.jsx(Ut,{className:"h-5 w-5"}),"Install Chrome Extension",e.jsx(Ys,{className:"h-4 w-4 ml-auto opacity-50"})]}),e.jsx("div",{className:"text-center text-sm text-muted-foreground",children:e.jsx("p",{children:"The extension lets you:"})}),e.jsx("div",{className:"space-y-3",children:["Discover relevant posts on X, LinkedIn & Reddit","Generate AI-
21powered replies in one click","Auto-post comments while you work"].map((C,j)=>e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsx("div",{className:"w-5 h-5 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(bs,{className:"h-3 w-3 text-primary"})}),e.jsx("span",{children:C})]},j))})]}),e.jsxs("div",{className:"border-t border-border/50 mt-6 pt-6",children:[e.jsxs(h,{variant:"outline",onClick:z,className:"w-full h-11",children:["I've installed it â Go to Dashboard",e.jsx(Ns,{className:"h-4 w-4 ml-2"})]}),e.jsx("button",{onClick:()=>s("/dashboard"),className:"w-full text-sm text-muted-foreground hover:text-foreground mt-3 py-2",children:"Skip for now"})]})]})})]})})]})},Kh=ir("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Xt=i.forwardRef(({className:s,variant:t,...a},r)=>e.jsx("div",{ref:r,role:"alert",className:Z(Kh({variant:t}),s),...a}));Xt.displayName="Alert";const _a=i.forwardRef(({className:s,...t},a)=>e.jsx("h5",{ref:a,className:Z("mb-1 font-medium leading-none tracking-tight",s),...t}));_a.displayName="AlertTitle";const Qt=i.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:Z("text-sm [&_p]:leading-relaxed",s),...t}));Qt.displayName="AlertDescription";async function Ha(s){var r;const t=(()=>{const o=(s||"").trim();return o?o.startsWith("http://")||o.startsWith("https://")?o:o.startsWith("//")?`https:${o}`:`https://${o}`:""})();if(!t){k.error("Invalid link");return}const a=window.open(t,"_blank","noopener,noreferrer");if(a){try{a.focus()}catch{}return}try{if((r=navigator.clipboard)!=null&&r.writeText&&window.isSecureContext)await navigator.clipboard.writeText(t);else{const o=document.createElement("textarea");o.value=t,o.setAttribute("readonly",""),o.style.position="fixed",o.style.top="-1000px",o.style.left="-1000px",document.body.appendChild(o),o.select();const n=document.execCommand("copy");if(document.body.removeChild(o),!n)throw new Error("copy_failed")}k.info("Link copied",{description:"Popups are blocked here â paste the link into a new tab."})}catch{k.error("Couldn't open link",{description:t})}}const Xh="https://chromewebstore.google.com/detail/deshiller/afepbcbadpmfpnphkoehlomkabeimbho",Qh=[{icon:pa,title:"Open the Chrome Web Store listing",description:"Click the button below â it opens deSHILLER on the Chrome Web Store in a new tab."},{icon:Ra,title:'Click "Add to Chrome"',description:"Confirm the install when Chrome asks. The extension will appear in your toolbar."},{icon:st,title:"Refresh this page",description:"Come back and reload â the dashboard will detect the extension and sign it in automatically."}],Pn=({onComplete:s,showCompleteButton:t=!0})=>e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Xt,{className:"border-green-500/50 bg-green-500/10",children:[e.jsx(Tt,{className:"h-5 w-5 text-green-600"}),e.jsx(_a,{className:"text-green-700 dark:text-green-400 font-semibold",children:"Why we use a browser extension"}),e.jsxs(Qt,{className:"text-green-600 dark:text-green-300 mt-2 space-y-2",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Your account safety is our priority."})," Unlike tools that ask for your login credentials or use server-side bots, our extension works directly in YOUR browser with YOUR active session."]}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 mt-2 text-sm",children:[e.jsxs("li",{children:[e.jsx(_t,{className:"inline h-3.5 w-3.5 mr-1"}),"We ",e.jsx("strong",{children:"never"})," see or store your social media passwords"]}),e.jsxs("li",{children:[e.jsx(Tt,{className:"inline h-3.5 w-3.5 mr-1"}),"No risk of bans from suspicious server logins"]}),e.jsxs("li",{children:[e.jsx(Ve,{className:"inline h-3.5 w-3.5 mr-1"}),"Actions happen as YOU, from YOUR device and IP"]}),e.jsxs("li",{children:[e.jsx(qt,{className:"inline h-3.5 w-3.5 mr-1"}),"Platforms can't detect automation â it's just you using your browser"]})]})]})]}),e.jsxs(U,{className:"border-primary/30 overflow-hidden",children:[e.jsxs(Be,{children:[e.jsxs($e,{className:"flex items-center gap-2",children:[e.jsx(Ra,{className:"h-5 w-5 text-primary"}),"Install in 3 quick steps"]}),e.jsx(os,{children:"One-click install from the Chrome Web Store â auto-updates included."})]}),e.jsxs(ye,{className:"space-y-3",children:[Qh.map((a,r)=>
21{const o=a.icon;return e.jsxs("div",{className:"flex items-start gap-4 p-4 rounded-xl border border-border/40 bg-card/50",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(o,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:["Step ",r+1]}),e.jsx("h4",{className:"font-semibold mt-0.5",children:a.title}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:a.description})]})]},r)}),e.jsxs("div",{className:"pt-2 flex flex-col sm:flex-row gap-2",children:[e.jsxs(h,{size:"lg",className:"gap-2 flex-1",onClick:()=>Ha(Xh),children:[e.jsx(pa,{className:"h-4 w-4"}),"Install from Chrome Web Store",e.jsx(Ys,{className:"h-3.5 w-3.5 opacity-70"})]}),t&&s&&e.jsxs(h,{onClick:s,variant:"outline",className:"gap-2 flex-1",children:[e.jsx(Ve,{className:"h-4 w-4"}),"I've installed it"]})]})]})]}),e.jsxs("div",{className:"text-center text-sm text-muted-foreground space-y-1",children:[e.jsx("p",{children:"After installation, refresh this page and log into your social accounts normally."}),e.jsx("p",{children:"The extension auto-updates from the Chrome Web Store â no manual reinstall needed."})]})]}),Jh={twitter:"X / Twitter",linkedin:"LinkedIn",reddit:"Reddit",youtube:"YouTube",facebook:"Facebook",quora:"Quora"},Zh=()=>{const s=ns(),[t,a]=i.useState([]),[r,o]=i.useState(!0);return i.useEffect(()=>{let n=!0;return(async()=>{const{data:l}=await w.from("hype_requests").select("id, platform, comment_url, comment_preview, target_count, completed_count, created_at").eq("status","active").order("created_at",{ascending:!1}).limit(4);n&&(a(l||[]),o(!1))})(),()=>{n=!1}},[]),e.jsxs(U,{className:"border-primary/20 bg-gradient-to-br from-primary/5 via-background to-background overflow-hidden relative animate-in fade-in slide-in-from-bottom-4 duration-500",children:[e.jsx("div",{className:"absolute -top-24 -right-24 h-48 w-48 rounded-full bg-primary/10 blur-3xl pointer-events-none"}),e.jsxs(Be,{className:"relative",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"h-9 w-9 rounded-lg bg-primary/15 flex items-center justify-center",children:e.jsx(es,{className:"h-5 w-5 text-primary"})}),e.jsx(W,{variant:"secondary",className:"bg-primary/10 text-primary border-primary/20",children:"Welcome to Mutual Hype"})]}),e.jsx($e,{className:"text-2xl",children:"Boost real posts. Get boosted back."}),e.jsx(os,{className:"text-base leading-relaxed",children:"Mutual Hype is a community where members upvote, like and reply to each other's comments to amplify reach. Below is a peek at posts already waiting for support â and your own posts will appear here automatically as soon as you start engaging."})]}),e.jsxs(ye,{className:"relative space-y-5",children:[e.jsxs("div",{className:"rounded-lg border border-emerald-600/20 bg-emerald-600/5 p-4 flex gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-emerald-600 shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"font-medium text-foreground mb-1",children:["What does ",e.jsx("span",{className:"text-emerald-700",children:'"Already engaged"'})," mean?"]}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"When you see this badge on a post, it means our system has already replied or commented on it for you. We never engage twice on the same URL â keeping your presence natural and your account safe."})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(Es,{className:"h-4 w-4 text-primary"}),"Active boosts from the community"]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.length," ready"]})]}),r?e.jsx("div",{className:"space-y-2",children:[0,1,2].map(n=>e.jsx("div",{className:"h-16 rounded-lg bg-muted/40 animate-pulse"},n))}):t.length===0?e.jsx("div",{className:"rounded-lg border border-dashed border-border/40 p-6 text-center text-sm text-muted-foreground",children:"No active boosts right now â be the first to post and the community will hype you."}):e.jsx("ul",{className:"space-y-2",children:t.map(n=>e.jsxs("li",{className:"rounded-lg border border-border/40 bg-card p-3 flex items-start gap-3 hover:border-primary/30 transition-colors",children:[e.jsx("div",{className:"h-8 w-8 rounded-md bg-primary/10 flex items-center justify-center shrink-0",children:e.jsx(Pa,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(W,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:Jh[n.platform]||n.platform}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.completed_count,"/",n.target_count," boosts"]})]}
21),e.jsx("p",{className:"text-sm text-foreground/80 line-clamp-2",children:n.comment_preview||"Community member is requesting boosts on their post."})]}),e.jsx("a",{href:n.comment_url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-primary shrink-0","aria-label":"Open post",children:e.jsx(Ys,{className:"h-4 w-4"})})]},n.id))})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 pt-1",children:[e.jsxs(h,{onClick:()=>s("/dashboard?tab=mutual-hype"),className:"gap-2 flex-1",children:["Open Mutual Hype",e.jsx(Ns,{className:"h-4 w-4"})]}),e.jsx(h,{variant:"outline",onClick:()=>s("/dashboard"),className:"flex-1",children:"Continue to Dashboard"})]})]})]})},ep=()=>{const s=ns(),[t,a]=i.useState(!0);return i.useEffect(()=>{(async()=>{const{data:{session:o}}=await w.auth.getSession();if(!o){s("/auth");return}a(!1)})()},[s]),t?null:e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-2xl space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 p-3 rounded-lg bg-primary/10 border border-primary/20",children:[e.jsx(Cs,{className:"h-5 w-5 text-primary"}),e.jsx("span",{className:"font-medium text-primary",children:"24-hour free trial activated"})]}),e.jsx(Pn,{showCompleteButton:!0,onComplete:()=>s("/dashboard")}),e.jsx(Zh,{}),e.jsx("div",{className:"text-center",children:e.jsxs(h,{variant:"ghost",onClick:()=>s("/dashboard"),className:"gap-2 text-muted-foreground",children:["Skip for now",e.jsx(Ns,{className:"h-4 w-4"})]})})]})})},sp=({onRefresh:s,threshold:t=80})=>{const[a,r]=i.useState(!1),[{y:o,rotate:n},l]=Fl(()=>({y:0,rotate:0}));return{bind:Bl({onDrag:async({down:x,movement:[,d],direction:[,u],cancel:m})=>{if(!(d<0||window.scrollY>0))if(x&&d>t&&!a){r(!0),m(),l.start({y:t,rotate:360,config:{tension:200,friction:20}});try{await s()}finally{r(!1),l.start({y:0,rotate:0,config:{tension:200,friction:20}})}}else{const p=x?Math.min(d*.5,t*1.2):0,g=x?p/t*180:0;l.start({y:p,rotate:g,immediate:x,config:{tension:200,friction:20}})}}},{drag:{axis:"y",filterTaps:!0}}),style:{y:o,rotate:n},isRefreshing:a}},tp=({y:s,rotate:t,isRefreshing:a})=>e.jsx(to.div,{style:{position:"absolute",top:-60,left:"50%",transform:s.to(r=>`translate(-50%, ${r}px)`),zIndex:100},className:"flex items-center justify-center",children:e.jsx(to.div,{style:{rotate:a?t:t.to(r=>`${r}deg`)},className:`w-8 h-8 flex items-center justify-center rounded-full bg-primary text-primary-foreground ${a?"animate-spin":""}`,children:e.jsx(st,{className:"h-5 w-5"})})}),Jn=768;function ap(){const[s,t]=i.useState(void 0);return i.useEffect(()=>{const a=window.matchMedia(`(max-width: ${Jn-1}px)`),r=()=>{t(window.innerWidth<Jn)};return a.addEventListener("change",r),t(window.innerWidth<Jn),()=>a.removeEventListener("change",r)},[]),!!s}const da=i.forwardRef(({className:s,orientation:t="horizontal",decorative:a=!0,...r},o)=>e.jsx(yc,{ref:o,decorative:a,orientation:t,className:Z("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",s),...r}));da.displayName=yc.displayName;function Ws({className:s,...t}){return e.jsx("div",{className:Z("animate-pulse rounded-md bg-muted",s),...t})}const rp="sidebar:state",np=60*60*24*7,ip="16rem",op="18rem",lp="3rem",cp="b",md=i.createContext(null);function Mn(){const s=i.useContext(md);if(!s)throw new Error("useSidebar must be used within a SidebarProvider.");return s}const xd=i.forwardRef(({defaultOpen:s=!0,open:t,onOpenChange:a,className:r,style:o,children:n,...l},c)=>{const x=ap(),[d,u]=i.useState(!1),[m,p]=i.useState(s),g=t??m,v=i.useCallback(j=>{const y=typeof j=="function"?j(g):j;a?a(y):p(y),document.cookie=`${rp}=${y}; path=/; max-age=${np}`},[a,g]),b=i.useCallback(()=>x?u(j=>!j):v(j=>!j),[x,v,u]);i.useEffect(()=>{const j=y=>{y.key===cp&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),b())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[b]);const z=g?"expanded":"collapsed",C=i.useMemo(()=>({state:z,open:g,setOpen:v,isMobile:x,openMobile:d,setOpenMobile:u,toggleSidebar:b}),[z,g,v,x,d,u,b]);return e.jsx(md.Provider,{value:C,children:e.jsx(Ka,{delayDuration:0,
21children:e.jsx("div",{style:{"--sidebar-width":ip,"--sidebar-width-icon":lp,...o},className:Z("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...l,children:n})})})});xd.displayName="SidebarProvider";const ud=i.forwardRef(({side:s="left",variant:t="sidebar",collapsible:a="offcanvas",className:r,children:o,...n},l)=>{const{isMobile:c,state:x,openMobile:d,setOpenMobile:u}=Mn();return a==="none"?e.jsx("div",{className:Z("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:l,...n,children:o}):c?e.jsx(En,{open:d,onOpenChange:u,...n,children:e.jsx(Hr,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":op},side:s,children:e.jsx("div",{className:"flex h-full w-full flex-col",children:o})})}):e.jsxs("div",{ref:l,className:"group peer hidden text-sidebar-foreground md:block","data-state":x,"data-collapsible":x==="collapsed"?a:"","data-variant":t,"data-side":s,children:[e.jsx("div",{className:Z("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),e.jsx("div",{className:Z("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",s==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...n,children:e.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:o})})]})});ud.displayName="Sidebar";const hd=i.forwardRef(({className:s,onClick:t,...a},r)=>{const{toggleSidebar:o}=Mn();return e.jsxs(h,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Z("h-7 w-7",s),onClick:n=>{t==null||t(n),o()},...a,children:[e.jsx(Wm,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});hd.displayName="SidebarTrigger";const dp=i.forwardRef(({className:s,...t},a)=>{const{toggleSidebar:r}=Mn();return e.jsx("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:Z("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",s),...t})});dp.displayName="SidebarRail";const mp=i.forwardRef(({className:s,...t},a)=>e.jsx("main",{ref:a,className:Z("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",s),...t}));mp.displayName="SidebarInset";const xp=i.forwardRef(({className:s,...t},a)=>e.jsx(Je,{ref:a,"data-sidebar":"input",className:Z("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",s),...t}));xp.displayName="SidebarInput";const up=i.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,"data-sidebar":"header",className:Z("flex flex-col gap-2 p-2",s),...t}));up.displayName="SidebarHeader";const hp=i.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,"data-sidebar":"footer",className:Z("flex flex-col gap-2 p-2",s),...t}));hp.displayName="SidebarFooter";const pp=i.forwardRef(({className:s,...t},a)=>e.jsx(da,{ref:a,"data-sidebar":"separator",className:Z("mx-2 w-auto bg-sidebar-border",s),...t}));pp.displayName="SidebarSeparator";const pd=i.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,"data-sidebar":"content",className:Z("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),...t}));pd.displayName="SidebarContent";const gd=i.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,"data-sidebar":"group",className:Z("relative flex w-full min-w-0 flex-col p-2",s),...t}));gd.displayName="SidebarGroup";const fd=i.forwardRef(({className:s,asChild:t=!1,...a},r)=>{const o=t?kr:"div";return e.jsx(o,{ref:r,"data-sidebar":"group-label",className:Z("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground
21/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",s),...a})});fd.displayName="SidebarGroupLabel";const gp=i.forwardRef(({className:s,asChild:t=!1,...a},r)=>{const o=t?kr:"button";return e.jsx(o,{ref:r,"data-sidebar":"group-action",className:Z("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",s),...a})});gp.displayName="SidebarGroupAction";const bd=i.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,"data-sidebar":"group-content",className:Z("w-full text-sm",s),...t}));bd.displayName="SidebarGroupContent";const jd=i.forwardRef(({className:s,...t},a)=>e.jsx("ul",{ref:a,"data-sidebar":"menu",className:Z("flex w-full min-w-0 flex-col gap-1",s),...t}));jd.displayName="SidebarMenu";const yd=i.forwardRef(({className:s,...t},a)=>e.jsx("li",{ref:a,"data-sidebar":"menu-item",className:Z("group/menu-item relative",s),...t}));yd.displayName="SidebarMenuItem";const fp=ir("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[active=true]:border-l-4 data-[active=true]:border-primary data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),vd=i.forwardRef(({asChild:s=!1,isActive:t=!1,variant:a="default",size:r="default",tooltip:o,className:n,...l},c)=>{const x=s?kr:"button",{isMobile:d,state:u}=Mn(),m=e.jsx(x,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:Z(fp({variant:a,size:r}),n),...l});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(la,{children:[e.jsx(ca,{asChild:!0,children:m}),e.jsx(sa,{side:"right",align:"center",hidden:u!=="collapsed"||d,...o})]})):m});vd.displayName="SidebarMenuButton";const bp=i.forwardRef(({className:s,asChild:t=!1,showOnHover:a=!1,...r},o)=>{const n=t?kr:"button";return e.jsx(n,{ref:o,"data-sidebar":"menu-action",className:Z("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",s),...r})});bp.displayName="SidebarMenuAction";const jp=i.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,"data-sidebar":"menu-badge",className:Z("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",s),...t}));jp.displayName="SidebarMenuBadge";const yp=i.forwardRef(({className:s,showIcon:t=!1,...a},r)=>{const o=i.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:Z("flex h-8 items-center gap-2 rounded-md px-2",s),...a,children:[t&&e.jsx(Ws,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),e.jsx(Ws,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});yp.displayName="SidebarMenuSkeleton";const vp=i.forwardRef(({className:s,...t},a)=>e.jsx("ul",{ref:a,"data-sidebar":"menu-sub",className:Z("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",s),...t}));vp.displayName="SidebarMenuSub";const Np=i.forwardRef(({...s},t)=>e.jsx("li",{ref:t,...s}));Np.displayName="SidebarMenuSubItem";const wp=i.forwardRef(({asChild:s=!1,size:t="md",isActive:a,className:r,...o},n)=>{const l=s?kr:"a";return e.jsx(l,{ref:n,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:Z("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...o})});wp.displayName="SidebarMenuSubButton";const Ur=i.forwardRef(({className:s,...t},a)=>e.jsx(vc,{ref:a,className:Z("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",s),...t}));Ur.displayName=vc.displayName;const Vi=i.forwardRef(({className:s,...t},a)=>e.jsx(Nc,{ref:a,className:Z("aspect-square h-full w-full",s),...t}));Vi.displayName=Nc.displayName;const Wr=i.forwardRef(({className:s,...t},a)=>e.jsx(wc,{ref:a,className:Z("flex h-full w-full items-center justify-center rounded-full bg-muted",s),...t}));Wr.displayName=wc.displayName;
21const kp={maxRetries:3,baseDelay:1e3,maxDelay:1e4,showRetryToast:!0,shouldRetry:s=>{var t;return!!((s==null?void 0:s.name)==="TypeError"&&s.message.includes("fetch")||(t=s==null?void 0:s.message)!=null&&t.includes("timeout")||(s==null?void 0:s.status)>=500&&(s==null?void 0:s.status)<600||(s==null?void 0:s.status)===408||(s==null?void 0:s.status)===429)}};class Sp extends Error{constructor(a,r,o){super(a);Kr(this,"code");Kr(this,"details");Kr(this,"timestamp");this.name="AppError",this.code=r,this.details=o,this.timestamp=new Date().toISOString()}}const kt=(s,t,a=!0)=>{var x,d,u;let r=(s==null?void 0:s.message)||(s==null?void 0:s.error)||"";if(typeof r=="string"){const m=r.indexOf("{"),p=r.lastIndexOf("}");if(m!==-1&&p>m)try{const g=JSON.parse(r.slice(m,p+1));g!=null&&g.error&&(r=String(g.error))}catch{}if(r.includes("serviceErrorMessage:")){const g=r.match(/serviceErrorMessage:\s*(.+?)(?:\s*",|$)/);g&&(r=g[1].trim())}}let o=r||"An error occurred",n=(s==null?void 0:s.code)||"UNKNOWN_ERROR";if(typeof o=="string"){const m=o.match(/^([A-Z_]+)\s*:\s*(.+)$/);m&&(n=m[1],o=m[2])}let l={};if(s!=null&&s.code){switch(s.code){case"23505":o="This record already exists",n="DUPLICATE_RECORD";break;case"23503":o="Related record not found",n="FOREIGN_KEY_VIOLATION";break;case"42501":o="Permission denied",n="PERMISSION_DENIED";break;case"PGRST116":o="No data found",n="NOT_FOUND";break;case"23502":o="Required field is missing",n="MISSING_REQUIRED_FIELD";break;default:o=s.message||"Database operation failed",n=s.code}l={hint:s.hint,detail:s.details}}else(s==null?void 0:s.name)==="TypeError"&&s.message.includes("fetch")?(o="Network connection failed",n="NETWORK_ERROR"):(x=s==null?void 0:s.message)!=null&&x.includes("FunctionsHttpError")?(o="Service request failed",n="FUNCTION_ERROR",l={functionError:s.message}):(d=s==null?void 0:s.message)!=null&&d.includes("JWT")||(u=s==null?void 0:s.message)!=null&&u.includes("auth")?(o="Authentication failed",n="AUTH_ERROR"):s!=null&&s.message&&(o=s.message);const c=new Sp(o,n,l);if(a){const m=n!=="UNKNOWN_ERROR"?`${t} - ${n}`:t;k.error(o,{description:m,duration:8e3})}return c},Ia=(s,t)=>{k.success(s,{description:t})},Dt=(s,t,a)=>{},Cp=s=>new Promise(t=>setTimeout(t,s)),_p=(s,t,a)=>{const r=t*Math.pow(2,s),o=Math.random()*.3*r;return Math.min(r+o,a)};async function La(s,t={}){const{maxRetries:a,baseDelay:r,maxDelay:o,shouldRetry:n,onRetry:l,showRetryToast:c,context:x}={...kp,...t};let d,u;for(let m=0;m<=a;m++)try{return u&&m>0&&(k.dismiss(u),k.success("Operation completed",{description:x?`${x} succeeded after ${m} ${m===1?"retry":"retries"}`:void 0,duration:2e3})),await s()}
21catch(p){d=p;const g=m===a;if(!n(p)||g)throw u&&k.dismiss(u),p;const b=_p(m,r,o),z=a-m;if(c){const C=x||"Operation",j=`Attempt ${m+1} failed. Retrying in ${Math.round(b/1e3)}s... (${z} ${z===1?"retry":"retries"} remaining)`;u&&k.dismiss(u),u=k.loading(C,{description:j,duration:b+1e3})}l&&l(m+1,a,p),await Cp(b)}throw d}const wi=Ym,ki=Km,Tp=Vm,Nd=i.forwardRef(({className:s,...t},a)=>e.jsx(kc,{className:Z("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...t,ref:a}));Nd.displayName=kc.displayName;const hn=i.forwardRef(({className:s,...t},a)=>e.jsxs(Tp,{children:[e.jsx(Nd,{}),e.jsx(Sc,{ref:a,className:Z("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...t})]}));hn.displayName=Sc.displayName;const pn=({className:s,...t})=>e.jsx("div",{className:Z("flex flex-col space-y-2 text-center sm:text-left",s),...t});pn.displayName="AlertDialogHeader";const gn=({className:s,...t})=>e.jsx("div",{className:Z("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...t});gn.displayName="AlertDialogFooter";const fn=i.forwardRef(({className:s,...t},a)=>e.jsx(Cc,{ref:a,className:Z("text-lg font-semibold",s),...t}));fn.displayName=Cc.displayName;const bn=i.forwardRef(({className:s,...t},a)=>e.jsx(_c,{ref:a,className:Z("text-sm text-muted-foreground",s),...t}));bn.displayName=_c.displayName;const jn=i.forwardRef(({className:s,...t},a)=>e.jsx(Tc,{ref:a,className:Z(Fr(),s),...t}));jn.displayName=Tc.displayName;const yn=i.forwardRef(({className:s,...t},a)=>e.jsx(Ac,{ref:a,className:Z(Fr({variant:"outline"}),"mt-2 sm:mt-0",s),...t}));yn.displayName=Ac.displayName;const Zn=()=>e.jsx(U,{className:"p-6 animate-pulse",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-1/4"}),e.jsx("div",{className:"h-8 bg-muted rounded w-1/2"}),e.jsx("div",{className:"h-3 bg-muted rounded w-3/4"})]})}),Ap=()=>e.jsx(U,{className:"p-6 animate-pulse",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-1/3 mb-6"}),[1,2,3,4,5].map(s=>e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"h-12 bg-muted rounded flex-1"}),e.jsx("div",{className:"h-12 bg-muted rounded flex-1"}),e.jsx("div",{className:"h-12 bg-muted rounded flex-1"})]},s))]})}),Ip=()=>e.jsx("div",{className:"grid md:grid-cols-4 gap-6",children:[1,2,3,4].map(s=>e.jsx(U,{className:"p-6 animate-pulse",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-1/2"}),e.jsx("div",{className:"h-8 bg-muted rounded w-3/4"})]})},s))}),Yi=({icon:s,title:t,description:a,action:r})=>e.jsx(U,{className:"p-12 text-center",children:e.jsxs("div",{className:"max-w-md mx-auto space-y-6",children:[e.jsx("div",{className:"w-20 h-20 rounded-full bg-primary/10 flex items-center justify-center mx-auto",children:e.jsx(s,{className:"h-10 w-10 text-primary"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xl font-semibold",children:t}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:a})]}),r&&e.jsx(h,{onClick:r.onClick,className:"bg-primary text-primary-foreground hover:bg-primary/90",children:r.label})]})}),na=Xm,ia=Qm,oa=Jm,Lp=["aria-pressed flips false â true","counter delta (when exposed)","URL anchor match on resolved node"];function zp(s){const t=(s||"").toLowerCase();return t==="x"?"twitter":t}function Ep(s,t,a={}){const r=zp(s),o=!!(a.hasSnippet||a.hasAuthor),n=(()=>{try{return new URL(t)}catch{return null}})(),l=n==null?void 0:n.searchParams,c=(n==null?void 0:n.pathname)||"",x=(d,u,m)=>({mode:d,reason:u,anchor:m,checks:Lp});
21if(r==="linkedin"){const d=(l==null?void 0:l.get("commentUrn"))||"",u=(l==null?void 0:l.get("hypeCommentId"))||"";return/urn:li:(comment|fsd_comment):/i.test(d)&&/\d{6,}/.test(d)?x("strict","linkedin commentUrn in URL",d):/^\d{6,}$/.test(u)?x("strict","hypeCommentId in URL",u):o?x("fallback","no commentUrn â phrase/author scoring","phrase + author"):x("unsafe","no commentUrn and no snippet/author")}if(r==="youtube"){const d=(l==null?void 0:l.get("lc"))||"";return d.length>=16&&/^[\w.-]+$/.test(d)?x("strict","YouTube lc= in URL",`lc=${d.slice(0,12)}â¦`):o?x("fallback","no lc= â phrase/author scoring","phrase + author"):x("unsafe","no lc= and no snippet/author")}if(r==="facebook"){const d=(l==null?void 0:l.get("comment_id"))||(l==null?void 0:l.get("reply_comment_id"))||"";return/^\d{6,}$/.test(d)?x("strict","Facebook comment_id in URL",d):o?x("fallback","no comment_id â phrase/author scoring","phrase + author"):x("unsafe","no comment_id and no snippet/author")}if(r==="reddit"){const d=c.match(/\/comment\/([a-z0-9]+)/i)||c.match(/\/comments\/[^/]+\/[^/]+\/([a-z0-9]+)\/?$/i);return d!=null&&d[1]?x("strict","Reddit /comment/<id>",d[1]):/\/comments\/[^/]+\/[^/]+\/?$/.test(c)&&o?x("fallback","single-thread permalink"):x("unsafe","no comment id")}return r==="twitter"?a.hasSnippet?x("fallback","X never carries a comment id â phrase match","phrase"):x("unsafe","X needs the posted reply snippet"):r==="quora"?o?x("fallback","Quora â scoped phrase/author match"):x("unsafe","no snippet/author"):x("unsafe","unknown platform")}function ei(s){if(!s)return"";try{const t=new URL(s);return`${t.hostname.replace(/^www\./,"")}${t.pathname.replace(/\/$/,"")}`.toLowerCase()}catch{return s.toLowerCase()}}async function Rp(s,t,a=5){if(!s||!t)return[];const r=ei(t),o=[],{data:n}=await w.from("hype_actions").select("status, performed_at, created_at, platform, verification_proof, error_message").order("created_at",{ascending:!1}).limit(50);for(const c of n||[]){const x=c.verification_proof||{},d=x==null?void 0:x.verified_url;d&&ei(d)===r&&o.push({source:"hype",at:c.performed_at||c.created_at,platform:c.platform,verifiedBy:x==null?void 0:x.verified_by,alreadyPressed:(x==null?void 0:x.already_pressed)===!0,url:d,status:c.status,detail:c.error_message||void 0})}const{data:l}=await w.from("automation_logs").select("status, created_at, platform, details, error_message, action_type").eq("user_id",s).order("created_at",{ascending:!1}).limit(50);for(const c of l||[]){const x=c.details||{},d=x.postUrl||x.post_url||x.url;d&&ei(d)===r&&o.push({source:"log",at:c.created_at,platform:c.platform,url:d,status:c.status,detail:c.error_message||(c.action_type?`${c.action_type}`:void 0)})}return o.sort((c,x)=>c.at<x.at?1:-1),o.slice(0,a)}const Pp={strict:{label:"Strict targeting",cls:"bg-emerald-500/10 text-emerald-500 border-emerald-500/20",Icon:Na},fallback:{label:"Fallback targeting",cls:"bg-amber-500/10 text-amber-500 border-amber-500/20",Icon:Ic},unsafe:{label:"Unsafe â won't post",cls:"bg-red-500/10 text-red-500 border-red-500/20",Icon:Li}},yo=s=>s==="verified"||s==="success"?e.jsx(ys,{className:"h-3 w-3 text-emerald-500"}):s==="failed"||s==="error"?e.jsx(Rt,{className:"h-3 w-3 text-red-500"}):e.jsx(Cs,{className:"h-3 w-3 text-amber-500"}),Mp=s=>{switch(s){case"aria_pressed_flip":return"aria-pressed flipped falseâtrue";case"count_delta":return"like/upvote counter incremented";case"already_pressed":return"already liked previously (no-op)";default:return s||"â"}},wd=({userId:s,platform:t,postUrl:a,hasSnippet:r,hasAuthor:o,variant:n="card",className:l})=>{const c=Ep(t,a,{hasSnippet:r,hasAuthor:o}),x=Pp[c.mode],[d,u]=i.useState(null),[m,p]=i.useState(!1);return i.useEffect(()=>{let g=!1;return Rp(s,a,5).then(v=>{g||(u(v),p(!0))}).catch(()=>{g||(u([]),p(!0))}),()=>{g=!0}},[s,a]),e.jsxs(na,{className:Z(n==="card"?"rounded-md border border-border/40 bg-background/40 px-3 py-2":"",l),children:[e.jsxs(ia,{className:"w-full flex items-center justify-between gap-2 text-xs group",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(W,{variant:"outline",className:Z("text-[10px] gap-1 px-1.5 py-0.5 border",x.cls),children:[e.jsx(x.Icon,{className:"h-3 w-3"}),x.label]}),e.jsx("span",{className:"text-muted-foreground truncate",children:c.reason}),m&&d&&d.length>0&&e.jsxs("span",{className:"text-muted-foreground inline-flex items-center gap-1",children:["· ",yo(d[0].status),e.jsxs("span",{children:["last attempt ",ha(new Date(d[0].at),{addSuffix:!0})]})]})]}),e.jsx(nt,{className:"h-3.5 w-3.5 text-muted-foreground transition-transform group-data-[state=open]:rotate-180 flex-shrink-0"})]}
21),e.jsxs(oa,{className:"mt-2 space-y-3 text-xs",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium mb-1",children:"Pre-flight"}),e.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-muted-foreground",children:[e.jsxs("li",{children:["Anchor: ",e.jsx("span",{className:"font-mono text-foreground/80",children:c.anchor||"â"})]}),c.checks.map(g=>e.jsxs("li",{children:["Verifies: ",g]},g))]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium mb-1",children:"Recent verifications on this URL"}),!m&&e.jsx("p",{className:"text-muted-foreground",children:"Loadingâ¦"}),m&&((d==null?void 0:d.length)??0)===0&&e.jsx("p",{className:"text-muted-foreground",children:"No prior posting attempts recorded."}),m&&d&&d.length>0&&e.jsx("ul",{className:"space-y-1",children:d.map((g,v)=>e.jsxs("li",{className:"flex items-start gap-2",children:[yo(g.status),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{className:"capitalize",children:g.status}),e.jsx("span",{className:"text-muted-foreground",children:"·"}),e.jsx("span",{className:"text-muted-foreground",children:Mp(g.verifiedBy)}),g.alreadyPressed&&e.jsx(W,{variant:"outline",className:"text-[10px] px-1 py-0",children:"already-pressed"}),e.jsx("span",{className:"text-muted-foreground",children:"·"}),e.jsx("span",{className:"text-muted-foreground",children:ha(new Date(g.at),{addSuffix:!0})})]}),g.detail&&e.jsx("p",{className:"text-muted-foreground/80 truncate",title:g.detail,children:g.detail})]})]},v))})]})]})]})};function Dp(s){const t=s.match(/[?&]v=([a-zA-Z0-9_-]{11})/);return t?t[1]:null}function vo(s){return/[?&]lc=/.test(s)}const Dn=({userId:s,platform:t,onApprovedForEngagement:a})=>{const[r,o]=i.useState([]),[n,l]=i.useState(!0),[c,x]=i.useState(!1),[d,u]=i.useState(new Set);i.useEffect(()=>{m();const f=w.channel("discovered_posts_changes").on("postgres_changes",{event:"*",schema:"public",table:"discovered_posts",filter:`user_id=eq.${s}`},()=>{m()}).subscribe();return()=>{w.removeChannel(f)}},[s,t]);const m=async()=>{try{Dt("discovered_posts","SELECT",{userId:s,platform:t,status:"pending"});const f=await La(async()=>{let R=w.from("discovered_posts").select("id, platform, post_url, post_content, author_username, author_name, author_role, relevance_score, relevance_reason, status, competitor_mentioned").eq("user_id",s).eq("status","pending");R=t==="x"?R.in("platform",["x","twitter"]):R.eq("platform",t);const{data:M,error:q}=await R.order("relevance_score",{ascending:!1}).limit(50);if(q)throw q;return M||[]},{context:"Loading posts"});o(f)}catch(f){kt(f,"Loading discovered posts")}finally{l(!1)}},p=async f=>{try{if(Dt("discovered_posts","UPDATE",{postId:f.id,status:"approved"}),await La(async()=>{const{error:R}=await w.from("discovered_posts").update({status:"approved"}).eq("id",f.id);if(R)throw R},{context:"Approving post"}),f.platform==="youtube"&&!vo(f.post_url)){Ia("Video approved","Open Ready to Engage to add comment threads"),a==null||a(f.platform);return}Ia("Post approved",'Switch to "Ready to Engage" tab to comment')}catch(R){kt(R,"Approving post")}},g=async f=>{try{Dt("discovered_posts","UPDATE",{postId:f,status:"rejected"}),await La(async()=>{const{error:R}=await w.from("discovered_posts").update({status:"rejected"}).eq("id",f);if(R)throw R},{context:"Rejecting post"}),Ia("Post rejected")}catch(R){kt(R,"Rejecting post")}},v=async()=>{x(!0);try{Dt("discovered_posts","DELETE",{userId:s,platform:t}),await La(async()=>{let f=w.from("discovered_posts").delete().eq("user_id",s);f=t==="x"?f.in("platform",["x","twitter"]):f.eq("platform",t);const{error:R}=await f;if(R)throw R},{context:"Clearing posts"}),Ia("All posts cleared","Discovery queue reset. Run discovery again to find fresh posts."),o([])}catch(f){kt(f,"Clearing posts")}finally{x(!1)}},b=f=>{u(R=>{const M=new Set(R);return M.has(f)?M.delete(f):M.add(f),M})},{youtubeGroups:z,nonYoutubePosts:C}=i.useMemo(()=>{var _;if(!(t==="youtube"))return{youtubeGroups:[],nonYoutubePosts:r};const R=new Map,M=[];for(const A of r){if(A.platform!=="youtube"){M.push(A);continue}const B=Dp(A.post_url);if(!B){M.push(A);continue}if(!R.has(B)){const I=A.post_content.match(/ð¬\s*(?:Video:\s*)?"([^"]+)"\s*by\s*(.+?)(?:\n|$)/);R.set(B,{videoId:B,videoUrl:`https://www.youtube.com/watch?v=${B}`,videoTitle:(I==null?void 0:I[1])||"YouTube Video",channelName:((_=I==null?void 0:I[2])==null?void 0:_.trim())||"YouTube Channel",comments:[],videoPost:null,bestScore:0})}const P=R.get(B);vo(A.post_url)?P.comments.push(A):P.videoPost=A,P.bestScore=Math.max(P.bestScore,A.relevance_score)}return{youtubeGroups:Array.from(R.values()).sort((A,B)=>B.bestScore-A.bestScore),nonYoutubePosts:M}},[r,t]);if(n)return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Zn,{}),e.jsx(Zn,{}),e.jsx(Zn,{})]});
21if(r.length===0)return e.jsx(Yi,{icon:wr,title:"No posts discovered yet",description:"Click 'Start Discovery' to find relevant conversations where you can engage and showcase your expertise.",action:{label:"Learn More",onClick:()=>k.info("Discovery helps you find relevant posts automatically")}});const j=f=>{var R;return e.jsxs(U,{className:"border-border/50 bg-card/30 backdrop-blur-sm shadow-lg animate-fade-in hover:shadow-xl transition-all",children:[e.jsx(Be,{children:e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx($e,{className:"text-sm font-display",children:f.author_name}),e.jsxs(W,{variant:"secondary",className:"text-xs",children:["@",f.author_username]}),((R=f.relevance_reason)==null?void 0:R.toLowerCase().includes("group"))&&e.jsx(W,{className:"text-xs bg-primary/20 text-primary border border-primary/30",children:"Group Post"}),e.jsxs(W,{className:"text-xs bg-gradient-to-r from-primary to-accent text-white",children:[f.relevance_score,"% match"]}),f.competitor_mentioned&&e.jsxs(W,{className:"text-xs bg-accent/20 text-accent border border-accent/30 flex items-center gap-1",children:[e.jsx(ks,{className:"h-3 w-3"}),"Competitor: ",f.competitor_mentioned]})]}),f.author_role&&e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:f.author_role}),e.jsx(os,{className:"text-xs",children:f.relevance_reason}),f.competitor_mentioned&&e.jsxs("div",{className:"mt-2 p-2 bg-accent/5 border border-accent/20 rounded text-xs text-accent flex items-start gap-2",children:[e.jsx(ks,{className:"h-3 w-3 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Competitor Alert:"})," This post mentions ",f.competitor_mentioned,". Great opportunity to showcase your product's advantages."]})]})]})})}),e.jsxs(ye,{className:"space-y-4",children:[e.jsxs("div",{onClick:()=>Ha(f.post_url),className:"block p-3 rounded-lg bg-muted/30 border border-border/30 hover:bg-muted/50 hover:border-primary/30 transition-all cursor-pointer group",children:[e.jsx("p",{className:"text-sm leading-relaxed group-hover:text-primary transition-colors whitespace-pre-line",children:f.post_content.length>250?f.post_content.substring(0,250)+"...":f.post_content}),e.jsxs("span",{className:"text-xs text-muted-foreground mt-2 inline-flex items-center gap-1 group-hover:text-primary",children:[e.jsx(Ys,{className:"h-3 w-3"}),"View on ",f.platform==="x"||f.platform==="twitter"?"X":f.platform==="youtube"?"YouTube":f.platform==="linkedin"?"LinkedIn":f.platform.charAt(0).toUpperCase()+f.platform.slice(1)]})]}),e.jsx(wd,{userId:s,platform:f.platform,postUrl:f.post_url,hasAuthor:!!(f.author_name||f.author_username),hasSnippet:!0}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsxs(h,{size:"sm",onClick:()=>p(f),className:"flex-1 bg-gradient-to-r from-primary to-accent hover:opacity-90",children:[e.jsx(xa,{className:"h-3 w-3 mr-2"}),"Approve"]}),e.jsxs(h,{size:"sm",variant:"outline",onClick:()=>g(f.id),className:"flex-1 border-destructive/50 hover:bg-destructive/10 hover:text-destructive",children:[e.jsx(vr,{className:"h-3 w-3 mr-2"}),"Reject"]})]})]})]},f.id)},y=f=>{const R=f.match(/ð¬\s*(.+?)(?:commented|said):\s*\n?"?(.+)/s);if(R)return R[2].replace(/^"|"$/g,"").trim();const M=f.split(` 22 23`);return M.length>1?M.slice(1).join(` 24 25`).trim():f},N=f=>{const R=d.has(f.videoId),M=f.comments.length,q=!!f.videoPost;return e.jsxs(U,{className:"border-border/50 bg-card/30 backdrop-blur-sm shadow-lg animate-fade-in hover:shadow-xl transition-all overflow-hidden",children:[e.jsx(Be,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsxs(W,{variant:"secondary",className:"text-xs",children:[e.jsx(Ua,{className:"h-2.5 w-2.5 mr-1 fill-current"}),"Video"]}),e.jsxs(W,{className:"text-xs bg-gradient-to-r from-primary to-accent text-white",children:[f.bestScore,"% match"]}),M>0&&e.jsxs(W,{variant:"secondary",className:"text-xs",children:[e.jsx(ms,{className:"h-2.5 w-2.5 mr-1"}),M]})]})}),e.jsxs(ye,{className:"pt-0 space-y-3",children:[e.jsxs("div",{onClick:()=>Ha(f.videoUrl),className:"block p-3 rounded-lg bg-muted/30 border border-border/30 hover:bg-muted/50 hover:border-primary/30 transition-all cursor-pointer group",children:[e.jsx("p",{className:"text-sm font-medium leading-snug group-hover:text-primary transition-colors",children:f.videoTitle}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["by ",f.channelName]}),f.videoPost&&(()=>{let A=f.videoPost.post_content.replace(/^ð¬[^\n]*\n\n?/,"").trim();
25if(A=A.replace(/Active video discussion related to your keywords\.\s*Join the comment section to engage with viewers\.?\s*/gi,"").trim(),A=A.replace(/'/g,"'").replace(/'/g,"'").replace(/"/g,'"').replace(/"/g,'"').replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/&#(\d+);/g,(B,P)=>String.fromCharCode(parseInt(P))).replace(/&#x([0-9a-fA-F]+);/g,(B,P)=>String.fromCharCode(parseInt(P,16))),A=A.replace(/\n*ð·ï¸\s*Keywords:.*$/i,"").trim(),!A||A.length<10){const P=(f.videoPost.relevance_reason||"").match(/Matches?:\s*(.+?)(?:\s*â¢|$)/i);P&&(A=`ð·ï¸ Keywords: ${P[1].trim()}`)}return A?e.jsx("p",{className:"text-xs text-muted-foreground mt-2 leading-relaxed",children:A.length>150?A.substring(0,150)+"...":A}):null})(),e.jsxs("span",{className:"text-xs text-muted-foreground mt-2 inline-flex items-center gap-1 group-hover:text-primary",children:[e.jsx(Ys,{className:"h-3 w-3"}),"View on YouTube"]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[q&&e.jsxs(e.Fragment,{children:[e.jsxs(h,{size:"sm",onClick:()=>p(f.videoPost),className:"h-7 px-3 text-xs bg-gradient-to-r from-primary to-accent hover:opacity-90",children:[e.jsx(xa,{className:"h-3 w-3 mr-1.5"}),"Approve Video"]}),e.jsx(h,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>g(f.videoPost.id),children:e.jsx(vr,{className:"h-3 w-3"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Approve this video first, then add comment threads from Ready to Engage."})]}),M>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"w-full flex items-center justify-between py-2 px-3 -mx-0 rounded-md text-xs text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors",onClick:()=>b(f.videoId),children:[e.jsxs("span",{className:"flex items-center gap-1.5 font-medium",children:[e.jsx(ms,{className:"h-3 w-3"}),M," comment thread",M!==1?"s":""," to reply to"]}),R?e.jsx(Gt,{className:"h-3.5 w-3.5"}):e.jsx(nt,{className:"h-3.5 w-3.5"})]}),R&&e.jsx("div",{className:"space-y-1 border-t border-border/30 pt-2",children:f.comments.map(_=>{const A=y(_.post_content);return e.jsx("div",{className:"group/comment rounded-lg p-3 hover:bg-muted/20 transition-colors",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-xs font-medium text-foreground",children:_.author_name}),e.jsxs(W,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:[_.relevance_score,"%"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed line-clamp-2 cursor-pointer hover:text-foreground transition-colors",onClick:()=>Ha(_.post_url),children:A.length>180?A.substring(0,180)+"...":A})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0 opacity-0 group-hover/comment:opacity-100 transition-opacity",children:[e.jsxs(h,{size:"sm",className:"h-7 px-2.5 text-xs bg-gradient-to-r from-primary to-accent hover:opacity-90",onClick:()=>p(_),children:[e.jsx(xa,{className:"h-3 w-3 mr-1"}),"Reply"]}),e.jsx(h,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>g(_.id),children:e.jsx(vr,{className:"h-3 w-3"})})]})]})},_.id)})})]})]})]},f.videoId)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-end",children:e.jsxs(wi,{children:[e.jsx(ki,{asChild:!0,children:e.jsxs(h,{variant:"outline",size:"sm",className:"text-destructive hover:bg-destructive/10",children:[e.jsx(ua,{className:"h-4 w-4 mr-2"}),"Clear All Posts"]})}),e.jsxs(hn,{children:[e.jsxs(pn,{children:[e.jsx(fn,{children:"Clear all discovered posts?"}),e.jsxs(bn,{children:["This will permanently delete all ",r.length," discovered posts for ",t,". You can run discovery again to find fresh content."]})]}),e.jsxs(gn,{children:[e.jsx(yn,{children:"Cancel"}),e.jsx(jn,{onClick:v,disabled:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:c?"Clearing...":"Clear All"})]})]})]})}),z.map(f=>N(f)),C.map(f=>j(f))]})};async function kd(s){var a;const t=(s||"").trim();if(!t)return!1;try{if((a=navigator.clipboard)!=null&&a.writeText&&window.isSecureContext)return await navigator.clipboard.writeText(t),!0}catch{}try{const r=document.createElement("textarea");r.value=t,r.setAttribute("readonly",""),r.style.position="fixed",r.style.top="-1000px",r.style.left="-1000px",document.body.appendChild(r),r.select();const o=document.execCommand("copy");return document.body.removeChild(r),o}catch{return!1}}const Op="BUILD_2026_05_28_LINKEDIN_VISIBLE_COMMENT_BUTTON",No=[{value:"professional",label:"Professional",description:"Formal, expert-level tone"},{value:"friendly",label:"Friendly",description:"Warm, conversational tone"},{value:"witty",label:"Witty",description:"Clever, playful tone"},{value:"empathetic",label:"Empathetic",description:"Understanding, caring tone"},{value:"direct",label:"Direct",description:"Concise, no-nonsense tone"}],Fp=["labs","inc","io","hq","team","official","global","group","media","tech","ai","agency","studio","digital","solutions","software","corp"],On=s=>(s||"").replace(/^@/,"").trim(),Sd=s=>{const t=On(s).toLowerCase();return t.startsWith("activity-")||t.startsWith("urn:li:activity:")},Bp=s=>{const t=On(s).toLowerCase();return!t||Sd(t)?!1:!!Fp.some(a=>t.endsWith(a)||t.startsWith(a))},Cd=s=>{const t=On(s.author_username);return t?Sd(t)?{profileUrl:"",reason:"invalid_activity_slug"}:Bp(t)?{profileUrl:"",reason:"company_page"}:{profileUrl:`https://www.linkedin.com/in/${t}`}:{profileUrl:"",reason:"missing_author"}},$p=s=>{const t=On(s.author_username);switch(s.platform){case"twitter":case"x":return`https://x.com/${t}`;case"linkedin":return Cd(s).profileUrl;case"reddit":return`https://reddit.com/user/${t}`;case"facebook":return`https://facebook.com/${t}`;case"youtube":return`https://youtube.com/@${t}`;default:return`https://${s.platform}.com/${t}`}},ra=s=>s==="x"||s==="twitter",si=s=>
25{const t=s.match(/[?&]v=([a-zA-Z0-9_-]{11})/);return t?t[1]:null},ti=s=>/[?&]lc=/.test(s),qp=s=>/[?&]reply=1/.test(s),wo=s=>ra(s.platform)&&!qp(s.post_url),ko=s=>{const t=s.match(/status\/(\d+)/);return t?t[1]:null},So=s=>{const t=s.match(/[?&]parent=(\d+)/);return t?t[1]:null},on=s=>s==="linkedin",Si=s=>/[?&]commentId=/.test(s),Co=s=>{const t=s.match(/\/posts\/[^/?#]+-(\d{10,})(?:[/?#]|$)/i);if(t)return t[1];const a=s.match(/activity[:\-](\d{10,})/i);if(a)return a[1];const r=s.match(/\/posts\/([^/?#]+)/i);return r?r[1]:null},Hp=s=>on(s.platform)&&!Si(s.post_url),_o=s=>{const t=s.posted_at||s.created_at;if(!t)return 0;const a=Date.parse(t);return Number.isFinite(a)?a:0},Gp=s=>{if(!s)return null;const t=Date.parse(s);if(!Number.isFinite(t))return null;const a=Date.now()-t;if(a<0)return"just now";const r=6e4,o=36e5,n=864e5;return a<o?`${Math.max(1,Math.round(a/r))}m ago`:a<n?`${Math.round(a/o)}h ago`:a<30*n?`${Math.round(a/n)}d ago`:a<365*n?`${Math.round(a/(30*n))}mo ago`:`${Math.round(a/(365*n))}y ago`},Fn=({userId:s,platform:t,onFirstComment:a})=>{const[r,o]=i.useState([]),[n,l]=i.useState(!0),[c,x]=i.useState({}),[d,u]=i.useState({}),[m,p]=i.useState({}),[g,v]=i.useState({}),[b,z]=i.useState(null),[C,j]=i.useState({}),[y,N]=i.useState({}),[f,R]=i.useState({}),[M,q]=i.useState({}),[_,A]=i.useState({}),[B,P]=i.useState({}),[I,$]=i.useState({}),[be,Y]=i.useState("professional"),[O,he]=i.useState(null),[re,oe]=i.useState(!1),[T,ce]=i.useState({}),[le,F]=i.useState({}),[L,K]=i.useState({}),[ue,Ne]=i.useState({}),[fe,me]=i.useState({}),[Ie,Q]=i.useState({}),ne=i.useRef(fe),ke=i.useRef(r),ee=i.useRef({}),E=i.useRef({}),[xe,ve]=i.useState(null);ne.current=fe,ke.current=r;const S=O?[...No,{value:"custom",label:"Custom",description:O.slice(0,40)+(O.length>40?"...":"")}]:No;i.useEffect(()=>{const de=te=>{var X,ie;((X=te.data)==null?void 0:X.type)==="SOCIALPILOT_PONG"&&((ie=te.data)!=null&&ie.extensionBuildId)&&ve(te.data.extensionBuildId)};window.addEventListener("message",de);const D=Math.random().toString(36).slice(2);return window.postMessage({type:"SOCIALPILOT_PING",nonce:D},"*"),()=>window.removeEventListener("message",de)},[]),i.useEffect(()=>{(async()=>{const{data:D}=await w.from("user_preferences").select("tone_of_voice, tone_description").eq("user_id",s).maybeSingle();D!=null&&D.tone_of_voice&&Y(D.tone_of_voice),D!=null&&D.tone_description&&he(D.tone_description)})()},[s]);const J=async de=>{var D;Y(de),oe(!0);try{const{error:te}=await w.from("user_preferences").upsert({user_id:s,tone_of_voice:de,updated_at:new Date().toISOString()},{onConflict:"user_id"});if(te)throw te;k.success(`Tone changed to ${(D=S.find(X=>X.value===de))==null?void 0:D.label}`),u({})}catch(te){kt(te,"Updating tone")}finally{oe(!1)}};i.useEffect(()=>{(async()=>{const{data:D}=await w.from("engagement_queue").select("discovered_post_id, status").eq("user_id",s).in("status",["pending","in_progress"]);if(D){const te={};D.forEach(X=>{X.discovered_post_id&&(te[X.discovered_post_id]=!0)}),v(te)}})()},[s]),i.useEffect(()=>{const de=X=>{var Me,Ge,G;const ie=X==null?void 0:X.dm_config;if(!(ie!=null&&ie.message))return null;const _e=ke.current.find(Fe=>Fe.id===X.discovered_post_id);return{targets:{author:!!((Me=ie==null?void 0:ie.targets)!=null&&Me.author),commentators:!!((Ge=ie==null?void 0:ie.targets)!=null&&Ge.commentators),likers:!!((G=ie==null?void 0:ie.targets)!=null&&G.likers)},message:ie.message,post:_e||{id:X.discovered_post_id||X.id,platform:X.platform,post_url:X.post_url||ie.post_url||"",post_content:"",author_username:ie.author_username||"",author_name:ie.author_name||ie.author_username||"",relevance_score:0,relevance_reason:"",status:"approved"},queueItemId:X.id}},D=async(X,ie)=>{if(ie&&E.current[ie])return;ie&&(E.current[ie]=!0);const _e=X.post.id;if(ra(X.post.platform)){Q(Me=>({...Me,[_e]:"sent"})),me(Me=>{const Ge={...Me};return delete Ge[_e],Ge}),ie&&delete ee.current[ie];return}Q(Me=>({...Me,[_e]:"sending"}));try{await $s(X),Q(Me=>({...Me,[_e]:"sent"}))}finally{me(Me=>{const Ge={...Me};return delete Ge[_e],Ge}),ie&&delete ee.current[ie]}},te=w.channel("eq_dm_sequencing").on("postgres_changes",{event:"UPDATE",schema:"public",table:"engagement_queue",filter:`user_id=eq.${s}`},X=>{var Fe;const ie=X.new,_e=ie.discovered_post_id;if(!_e)return;const Me=(Fe=ie.platform)==null?void 0:Fe.toLowerCase();if(Me==="x"||Me==="twitter"){ie.status==="completed"&&(Q(He=>({...He,[_e]:"sent"})),me(He=>{const ts={...He};return delete ts[_e],ts}));return}const Ge=ie.dm_config;if(Ge!=null&&Ge._dm_handled_by_extension){ie.status==="completed"&&(Q(He=>({...He,[_e]:"sent"})),me(He=>{const ts={...He};return delete ts[_e],ts}));return}const G=ne.current[_e]||de(ie);G&&(ie.status==="completed"?D(G,ie.id):ie.status==="failed"&&(k.error("Comment failed to post â DMs skipped",{description:`Post by @${G.post.author_username}`}),Q(He=>({...He,[_e]:"skipped"})),me(He=>{const ts={...He};return delete ts[_e],ts}),ie.id&&(delete ee.current[ie.id],delete E.current[ie.id])))}).subscribe();return()=>{w.removeChannel(te)}},[s]),i.useEffect(()=>{const de=[];return Object.entries(fe).forEach(([D,te])=>{if(ra(te.post.platform))return;const X=setTimeout(()=>
25{ne.current[D]&&(Q(ie=>({...ie,[D]:"timeout_sending"})),$s(te).then(()=>{Q(ie=>({...ie,[D]:"sent"})),me(ie=>{const _e={...ie};return delete _e[D],_e})}))},6e4);de.push(X)}),()=>de.forEach(clearTimeout)},[Object.keys(fe).join(",")]);const je=i.useCallback((de,D)=>{if(!de||ee.current[de])return;ee.current[de]=!0;const te=Date.now(),X=async()=>{if(E.current[de]){delete ee.current[de];return}try{const{data:ie,error:_e}=await w.from("engagement_queue").select("id, status, dm_config, discovered_post_id, platform, post_url").eq("id",de).maybeSingle();if(_e)throw _e;if(!ie){delete ee.current[de];return}const Me=ie.dm_config&&typeof ie.dm_config=="object"&&!Array.isArray(ie.dm_config)?ie.dm_config:null;if(Me!=null&&Me._dm_handled_by_extension){Q(Ge=>({...Ge,[D.post.id]:"sent"})),me(Ge=>{const G={...Ge};return delete G[D.post.id],G}),E.current[de]=!0,delete ee.current[de];return}if(ie.status==="completed"){if(!E.current[de]){if(E.current[de]=!0,ra(D.post.platform)){Q(Ge=>({...Ge,[D.post.id]:"sent"})),me(Ge=>{const G={...Ge};return delete G[D.post.id],G}),delete ee.current[de];return}Q(Ge=>({...Ge,[D.post.id]:"sending"})),await $s(D),Q(Ge=>({...Ge,[D.post.id]:"sent"})),me(Ge=>{const G={...Ge};return delete G[D.post.id],G})}delete ee.current[de];return}if(ie.status==="failed"){k.error("Comment failed to post â DMs skipped",{description:`Post by @${D.post.author_username}`}),Q(Ge=>({...Ge,[D.post.id]:"skipped"})),me(Ge=>{const G={...Ge};return delete G[D.post.id],G}),delete ee.current[de];return}if(Date.now()-te>65e3){delete ee.current[de];return}window.setTimeout(X,2500)}catch{Date.now()-te<=65e3?window.setTimeout(X,4e3):delete ee.current[de]}};X()},[$s]);i.useEffect(()=>{(async()=>{const{data:D,error:te}=await w.from("engagement_queue").select("id, status, dm_config, discovered_post_id, platform, post_url").eq("user_id",s).not("dm_config","is",null).in("status",["pending","in_progress"]).order("created_at",{ascending:!1}).limit(10);te||!(D!=null&&D.length)||D.forEach(X=>{var Me,Ge,G;const ie=X.dm_config;if(!(ie!=null&&ie.message)||ie!=null&&ie._dm_handled_by_extension)return;const _e={targets:{author:!!((Me=ie==null?void 0:ie.targets)!=null&&Me.author),commentators:!!((Ge=ie==null?void 0:ie.targets)!=null&&Ge.commentators),likers:!!((G=ie==null?void 0:ie.targets)!=null&&G.likers)},message:ie.message,post:{id:X.discovered_post_id||X.id,platform:X.platform,post_url:X.post_url||ie.post_url||"",post_content:"",author_username:ie.author_username||"",author_name:ie.author_name||ie.author_username||"",relevance_score:0,relevance_reason:"",status:"approved"},queueItemId:X.id};me(Fe=>({...Fe,[_e.post.id]:Fe[_e.post.id]||_e})),Q(Fe=>({...Fe,[_e.post.id]:Fe[_e.post.id]||"waiting"})),je(X.id,_e)})})()},[s,je]),i.useEffect(()=>{se();const de=w.channel("engagement_queue_changes").on("postgres_changes",{event:"*",schema:"public",table:"discovered_posts",filter:`user_id=eq.${s}`},()=>{se()}).subscribe();return()=>{w.removeChannel(de)}},[s,t]);const se=async()=>{try{const de=await La(async()=>{let D=w.from("discovered_posts").select("*").eq("user_id",s).eq("status","approved");D=t==="x"?D.in("platform",["x","twitter"]):D.eq("platform",t);const{data:te,error:X}=await D.order("updated_at",{ascending:!1});if(X)throw X;const ie=te||[];return ie.sort((_e,Me)=>_o(Me)-_o(_e)),ie},{context:"Loading engagement queue"});o(de)}catch(de){kt(de,"Loading engagement queue")}finally{l(!1)}},Oe=async de=>{p(D=>({...D,[de.id]:!0}));try{const{data:{session:D}}=await w.auth.getSession();if(!D){k.error("Please log in to generate suggestions");return}const{data:te,error:X}=await w.functions.invoke("generate-comment",{body:{postContent:de.post_content,authorUsername:de.author_username,platform:de.platform},headers:{Authorization:`Bearer ${D.access_token}`}});if(X)throw X;if(te!=null&&te.error)throw new Error(te.error);te!=null&&te.suggestions&&u(ie=>({...ie,[de.id]:te.suggestions}))}catch(D){const te=(D==null?void 0:D.message)||"Failed to generate suggestions";te.includes("Rate limit")?k.error("Too many requests",{description:"Please wait a moment and try again"}):te.includes("credits")?k.error("AI credits needed",{description:"Add credits to continue using AI suggestions"}):k.error("Could not generate suggestions")}finally{p(D=>({...D,[de.id]:!1}))}},We=(de,D)=>{x(te=>({...te,[de]:D}))},H=async de=>{try{await La(async()=>{const{error:D}=await w.from("discovered_posts").update({status:"skipped"}).eq("id",de);if(D)throw D},{context:"Skipping post"}),await w.from("automation_logs").insert({user_id:s,platform:t,post_id:de,action_type:"comment_skipped",status:"skipped",details:{reason:"user_skipped"}}
25),k.success("Post skipped"),x(D=>({...D,[de]:""})),u(D=>({...D,[de]:[]}))}catch(D){kt(D,"Skipping post")}},ae=async de=>{var te;if(!si(de.post_url)){k.error("Invalid YouTube video URL");return}j(X=>({...X,[de.id]:!0}));try{const{data:{session:X}}=await w.auth.getSession();if(!X){k.error("Please sign in");return}const{data:ie,error:_e}=await w.functions.invoke("discover-posts",{body:{platform:"youtube",targetVideoUrl:de.post_url,skipHistory:!0,initialStatus:"approved"},headers:{Authorization:`Bearer ${X.access_token}`}});if(_e)throw _e;const Me=((te=ie==null?void 0:ie.posts)==null?void 0:te.length)||(ie==null?void 0:ie.postsDiscovered)||0;Me>0?(await se(),k.success(`Added ${Me} YouTube comment thread${Me===1?"":"s"} to Ready to Engage`)):k.info((ie==null?void 0:ie.message)||((ie==null?void 0:ie.reason)==="comments_disabled"?"Comments are turned off on this video.":"No replyable public comments were found for this video."))}catch(X){k.error((X==null?void 0:X.message)||"Failed to load YouTube comments")}finally{j(X=>({...X,[de.id]:!1}))}},ze=async de=>{var D;if(on(de.platform)){P(te=>({...te,[de.id]:!0}));try{const{data:{session:te}}=await w.auth.getSession();if(!te){k.error("Please sign in");return}const{data:X,error:ie}=await w.functions.invoke("discover-posts",{body:{platform:"linkedin",targetLinkedInPostUrl:de.post_url,skipHistory:!0,initialStatus:"approved"},headers:{Authorization:`Bearer ${te.access_token}`}});if(ie)throw ie;const _e=((D=X==null?void 0:X.posts)==null?void 0:D.length)||(X==null?void 0:X.postsDiscovered)||0;_e>0?(await se(),k.success(`Added ${_e} LinkedIn comment thread${_e===1?"":"s"} to Ready to Engage`)):k.info((X==null?void 0:X.reason)==="comments_already_loaded"?"Comments for this LinkedIn post are already loaded.":(X==null?void 0:X.message)||"LinkedIn hides comments from logged-out viewers, so we couldn't pull them. Open the post and reply directly, or use the composer below.",{duration:6e3})}catch(te){k.error((te==null?void 0:te.message)||"Failed to load LinkedIn comments")}finally{P(te=>({...te,[de.id]:!1}))}}},pe=async de=>{var D,te,X,ie;if(ra(de.platform)){N(_e=>({..._e,[de.id]:!0})),A(_e=>({..._e,[de.id]:0}));try{const{data:{session:_e}}=await w.auth.getSession();if(!_e){k.error("Please sign in");return}const Me=((D=de.post_url.match(/status\/(\d+)/))==null?void 0:D[1])||"",Ge=Me?r.filter(De=>{var Re;return(Re=De.post_url)==null?void 0:Re.includes(`parent=${Me}`)}).length:0,G=new Promise(De=>{const Re=window.setTimeout(()=>{window.removeEventListener("message",Le),De({error:"Extension reply retrieval timed out",postsFound:0,timedOut:!0})},18e4),Le=Ke=>{var hs;const qe=Ke.origin===window.location.origin||Ke.origin==="null",ds=Ke.source===window;!qe&&!ds||((hs=Ke.data)==null?void 0:hs.type)==="SOCIALPILOT_DISCOVER_TWITTER_REPLIES_RESPONSE"&&(window.clearTimeout(Re),window.removeEventListener("message",Le),De(Ke.data))};window.addEventListener("message",Le),window.postMessage({type:"SOCIALPILOT_DISCOVER_TWITTER_REPLIES",targetTweetUrl:de.post_url,initialStatus:"approved",maxReplies:15},"*")}),Fe=w.functions.invoke("discover-posts",{body:{platform:"x",targetTweetUrl:de.post_url,skipHistory:!0,initialStatus:"approved"},headers:{Authorization:`Bearer ${_e.access_token}`}}).catch(De=>({error:De,data:null}));let He=!1,ts=Ge;const As=Date.now(),Rs=(async()=>{for(;!He&&Date.now()-As<185e3&&(await new Promise(De=>setTimeout(De,4e3)),!(He||!Me));)try{const{count:De}=await w.from("discovered_posts").select("id",{count:"exact",head:!0}).eq("platform","x").ilike("post_url",`%parent=${Me}%`),Re=De||0;if(Re>ts){ts=Re;const Le=Math.max(0,Re-Ge);A(Ke=>({...Ke,[de.id]:Le})),await se()}}catch{}})(),ge=await G,Ue=(ge==null?void 0:ge.postsFound)||0,vs=Math.max(0,ts-Ge),Qs=Math.max(Ue,vs);if(Qs>0){He=!0,await se(),k.success(`Added ${Qs} reply thread${Qs===1?"":"s"} to Ready to Engage`);return}const V=await Fe;He=!0;const we=((X=(te=V==null?void 0:V.data)==null?void 0:te.posts)==null?void 0:X.length)||((ie=V==null?void 0:V.data)==null?void 0:ie.postsDiscovered)||0;if(we>0){await se(),k.success(`Added ${we} reply thread${we===1?"":"s"} to Ready to Engage`);return}if(Me)try{const{count:De}=await w.from("discovered_posts").select("id",{count:"exact",head:!0}).eq("platform","x").ilike("post_url",`%parent=${Me}%`),Re=Math.max(0,(De||0)-Ge);if(Re>0){await se(),k.success(`Added ${Re} reply thread${Re===1?"":"s"} to Ready to Engage`);return}}catch{}await se(),k.info("No replies could be retrieved for this tweet right now. Try again in a moment.")}catch(_e){k.error((_e==null?void 0:_e.message)||"Failed to load tweet replies")}finally{N(_e=>({..._e,[de.id]:!1})),A(_e=>{const Me={..._e};return delete Me[de.id],Me})}}},Ae=async de=>{var D,te;Ne(X=>({...X,[de.id]:!0}));try{const{data:{session:X}}=await w.auth.getSession();if(!X)return;const{data:ie,error:_e}=await w.functions.invoke("generate-outreach-messages",{body:{prospects:[{name:de.author_name||de.author_username,username:de.author_username,platform:de.platform,context:de.post_content.slice(0,500)}
25],messageType:"dm",tone:be},headers:{Authorization:`Bearer ${X.access_token}`}});if(_e)throw _e;const Me=((te=(D=ie==null?void 0:ie.messages)==null?void 0:D[0])==null?void 0:te.message)||`Hey ${de.author_name||de.author_username}, saw your post â been working on something related actually. Would it be useful for you?`;K(Ge=>({...Ge,[de.id]:Me}))}catch{K(ie=>({...ie,[de.id]:`Hey ${de.author_name||de.author_username}, saw your post â been working on something related actually. Would it be useful for you?`}))}finally{Ne(X=>({...X,[de.id]:!1}))}},Ee=(de,D)=>{const te=!T[de];ce(X=>({...X,[de]:te})),te&&(le[de]||F(X=>({...X,[de]:{author:!0,commentators:!1,likers:!1}})),!L[de]&&!ue[de]&&Ae(D))},ls=(de,D,te)=>{F(X=>({...X,[de]:{...X[de]||{author:!1,commentators:!1,likers:!1},[D]:te}}))},ss=de=>{const D=le[de];return!!D&&(D.author||D.commentators||D.likers)};async function $s(de){const{targets:D,message:te,post:X}=de;if(te!=null&&te.trim())try{const{data:{session:ie}}=await w.auth.getSession();if(!ie)return;const _e=[],Me=[];if(D.author&&X.author_username){const Ge=$p(X),G=X.platform==="linkedin"?Cd(X):null;if(Ge){const{data:Fe,error:He}=await w.from("dm_threads").insert({user_id:s,platform:X.platform,prospect_name:X.author_name||X.author_username,prospect_username:X.author_username,prospect_profile_url:Ge,status:"pending",automation_enabled:!0,last_message_at:new Date().toISOString()}).select("id").single();if(!He&&Fe){await w.from("dm_messages").insert({thread_id:Fe.id,user_id:s,content:te,direction:"outbound",sent_at:new Date().toISOString(),automation_source:"intent_dm"});const ts=X.platform==="x"?"twitter":X.platform,As=new Promise(Rs=>{const ge=Ue=>{var vs,Qs,V,we;((vs=Ue.data)==null?void 0:vs.type)==="DESHILLER_SEND_DM_RESPONSE"&&((Qs=Ue.data)==null?void 0:Qs.prospectId)===Fe.id&&(window.removeEventListener("message",ge),(V=Ue.data)!=null&&V.requiresPremium?Rs("premium_required"):((we=Ue.data)==null?void 0:we.success)!==!1?Rs(!0):Rs(!1))};window.addEventListener("message",ge),setTimeout(()=>{window.removeEventListener("message",ge),Rs(!1)},8e3)});window.postMessage({type:"DESHILLER_SEND_DM",platform:ts,profileUrl:Ge,message:te,prospectId:Fe.id},"*"),As.then(Rs=>{Rs==="premium_required"?k.error("LinkedIn Premium is required to send DMs. Please upgrade your LinkedIn account to use the DM feature.",{duration:1e4}):Rs||k.warning("DM may not have been sent â please reload the extension and try again",{duration:6e3})}),_e.push("author")}}else{const He=(G==null?void 0:G.reason)==="company_page"?`Skipped DM to @${X.author_username} â appears to be a company page`:"Skipped LinkedIn DM â could not identify a valid personal profile from this post";k.info(He)}}if(D.commentators&&(await w.from("dm_threads").insert({user_id:s,platform:X.platform,prospect_name:`Commentators on ${X.author_username}'s post`,prospect_username:`commentators_${X.id.slice(0,8)}`,prospect_profile_url:X.post_url,status:"pending_extension",automation_enabled:!1,last_message_at:new Date().toISOString()}),Me.push("commentators")),D.likers&&(await w.from("dm_threads").insert({user_id:s,platform:X.platform,prospect_name:`Likers of ${X.author_username}'s post`,prospect_username:`likers_${X.id.slice(0,8)}`,prospect_profile_url:X.post_url,status:"pending_extension",automation_enabled:!1,last_message_at:new Date().toISOString()}),Me.push("likers")),_e.length||Me.length){const Ge=[_e.length?`sent for ${_e.join(", ")}`:"",Me.length?`saved ${Me.join(", ")} for review`:""].filter(Boolean).join(" · ");k.success("DM flow processed",{description:Ge,duration:5e3})}}catch{k.error("Failed to send some DMs",{description:"Comment was still posted successfully."})}}if(n)return e.jsx(U,{className:"border-border/50 bg-card/30 backdrop-blur-sm shadow-lg",children:e.jsxs(ye,{className:"p-8 text-center",children:[e.jsxs("div",{className:"relative w-12 h-12 mx-auto mb-4",children:[e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary/20"}),e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary border-t-transparent animate-spin"})]}),e.jsx("p",{className:"text-muted-foreground",children:"Loading engagement queue..."})]})});const Xs=async(de,D=!0)=>{var X,ie;const te=(X=c[de.id])==null?void 0:X.trim();if(!te){k.error("Please write a comment first");return}z(de.id);try{D&&ra(de.platform);const{data:{user:_e}}=await w.auth.getUser();if(!_e){k.error("Please log in to queue posts");return}const Me=le[de.id],Ge=de.platform!=="youtube"&&T[de.id]&&ss(de.id),G=((ie=L[de.id])==null?void 0:ie.trim())||`Hey ${de.author_name||de.author_username||"there"}, saw your post â I'm working on something called deSHILLER that helps with exactly this. Would it be useful for you?`,Fe=Ge?{targets:Me,message:G,author_username:de.author_username,author_name:de.author_name,post_url:de.post_url}:null,He={user_id:_e.id,discovered_post_id:de.id,platform:de.platform,post_url:de.post_url,reply_text:te,status:"pending",priority:0};Fe&&(He.dm_config=Fe);const{data:ts,error:As}=await w.from("engagement_queue").insert(He).select("id").single();if(As)throw As;if(await w.from("discovered_posts").update({status:"queued",updated_at:new Date().toISOString()}).eq("id",de.id).eq("user_id",_e.id),v(Rs=>({...Rs,[de.id]:!0})),Ge&&G){const Rs={targets:Me,message:G,post:de,queueItemId:ts==null?void 0:ts.id};me(ge=>({...ge,[de.id]:Rs})),Q(ge=>({...ge,[de.id]:"waiting"})),ts!=null&&ts.id&&je(ts.id,Rs)}if(o(Rs=>Rs.filter(ge=>ge.id!==de.id)),x(Rs=>({...Rs,[de.id]:""})),u(Rs=>({...Rs,[de.id]:[]})),D){k.success("Queued & opening post...",{description:Ge?"Extension will post your comment, then DMs will be sent.":"The extension will post your comment automatically.",duration:4e3});const Rs=(ts==null?void 0:ts.id)||de.id;setTimeout(()=>{let ge=!1,Ue=!1;const vs=we=>{ge||Ue||(ge=!0,Ue=!0,window.removeEventListener("message",V),w.from("engagement_queue").update({status:"failed",error_message:`Extension bridge rejected: ${we}`,updated_at:new Date().toISOString()}).eq("id",Rs).eq("user_id",_e.id),w.from("discovered_posts").update({status:"approved",updated_at:new Date().toISOString()}).eq("id",de.id).eq("user_id",_e.id),v(De=>{const Re={...De};return delete Re[de.id],Re}),o(De=>De.some(Re=>
25Re.id===de.id)?De:[de,...De]),me(De=>{const Re={...De};return delete Re[de.id],Re}),Q(De=>{const Re={...De};return delete Re[de.id],Re}),k.error("X extension bridge rejected the post",{description:"The extension reported it could not open this URL. Reinstall the latest extension package and try again.",duration:1e4}))},Qs=()=>{ge||Ue||(Ue=!0,window.removeEventListener("message",V),Ha(de.post_url))},V=we=>{var De,Re,Le;((De=we.data)==null?void 0:De.type)==="SOCIALPILOT_OPEN_POST_URL_ACK"&&((Re=we.data)!=null&&Re.ok?(ge=!0,window.removeEventListener("message",V)):Ue||(ra(de.platform)?vs(((Le=we.data)==null?void 0:Le.error)||"unknown"):Qs()))};window.addEventListener("message",V);try{window.postMessage({type:"SOCIALPILOT_OPEN_POST_URL",url:de.post_url,queueItemId:Rs,replyText:te,platform:de.platform},"*")}catch{ra(de.platform)?vs("postMessage threw"):Qs()}setTimeout(()=>{if(!ge&&!Ue){if(ra(de.platform)||de.platform==="youtube"){ge=!0,window.removeEventListener("message",V);return}Qs()}},6e3)},300)}else k.success("Queued for auto-posting!",{description:"Post removed from discovery. Open the platform to trigger posting.",duration:5e3})}catch{k.error("Failed to add to queue")}finally{z(null)}},xs=async de=>{var te;const D=(te=c[de.id])==null?void 0:te.trim();D&&(await kd(D)?k.success("Comment copied to clipboard!",{duration:3e3}):k.info("Copy your comment before posting")),Ha(de.post_url)};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-emerald-500/25 bg-gradient-to-br from-emerald-500/[0.08] via-emerald-500/[0.04] to-transparent p-4 backdrop-blur-sm",children:[e.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top_left,hsl(var(--primary)/0.06),transparent_60%)]"}),e.jsxs("div",{className:"relative flex items-start gap-3",children:[e.jsxs("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-emerald-500/15 ring-1 ring-emerald-500/30",children:[e.jsx("span",{className:"absolute h-2 w-2 rounded-full bg-emerald-500 animate-ping opacity-60"}),e.jsx(es,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Auto-posting active"}),e.jsxs(W,{variant:"outline",className:"h-5 text-[10px] border-emerald-500/30 text-emerald-600 dark:text-emerald-400 bg-emerald-500/10",children:[e.jsx("span",{className:"mr-1 h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"live"]})]}),e.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground leading-relaxed",children:"Approved replies are delivered through your Chrome extension â no manual action needed."})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap rounded-lg border border-border/40 bg-card/30 backdrop-blur-sm px-3 py-2",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"flex h-7 items-center gap-1.5 rounded-full border border-border/50 bg-background/60 px-2.5 text-xs font-medium",children:[e.jsx(Cs,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"tabular-nums",children:r.length}),e.jsxs("span",{className:"text-muted-foreground",children:[r.length===1?"post":"posts"," queued"]})]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(or,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground hidden sm:inline",children:"Reply tone"}),e.jsxs(Gs,{value:be,onValueChange:J,disabled:re,children:[e.jsx(qs,{className:"w-[140px] h-8 text-xs bg-background/60",children:e.jsx(Us,{})}),e.jsx(Hs,{children:S.map(de=>e.jsx(Te,{value:de.value,className:"text-xs",children:e.jsx("div",{className:"flex flex-col",children:e.jsx("span",{children:de.label})})},de.value))})]})]})]}),(()=>{const de=new Map,D=new Map,te=new Map,X=new Map,ie=new Map,_e=new Map;for(const ge of r)if(ge.platform==="youtube"){const Ue=si(ge.post_url);if(!Ue)continue;if(ti(ge.post_url)){const vs=D.get(Ue)||[];vs.push(ge),D.set(Ue,vs)}else de.set(Ue,ge)}else if(ra(ge.platform)){const Ue=So(ge.post_url);if(Ue){const vs=X.get(Ue)||[];vs.push(ge),X.set(Ue,vs)}else{const vs=ko(ge.post_url);vs&&te.set(vs,ge)}}else if(on(ge.platform)){const Ue=Co(ge.post_url);if(!Ue)continue;if(Si(ge.post_url)){const vs=_e.get(Ue)||[];vs.push(ge),_e.set(Ue,vs)}else ie.set(Ue,ge)}const Me=[],Ge=new Set,G=new Set,Fe=new Set,He=new Set,ts=new Set,As=new Set;for(const ge of r){if(ge.platform==="youtube"){const Ue=si(ge.post_url);if(!Ue){Me.push({kind:"post",post:ge});continue}if(ti(ge.post_url)){if(de.has(Ue)||G.has(Ue))continue;G.add(Ue);const vs=D.get(Ue)||[];Me.push({kind:"yt-orphan-comments",videoId:Ue,videoTitle:"YouTube Video",comments:vs})}else{if(Ge.has(Ue))continue;Ge.add(Ue);const vs=(ge.post_content||"").split(` 26`)[0].replace(/^ð¬\s*/,"").slice(0,80)||"YouTube Video",Qs=D.get(Ue)||[];Me.push({kind:"yt-group",videoId:Ue,videoTitle:vs,video:ge,comments:Qs})}continue}if(ra(ge.platform)){const Ue=So(ge.post_url);if(Ue){if(te.has(Ue)||He.has(Ue))continue;He.add(Ue);const vs=X.get(Ue)||[];Me.push({kind:"tw-orphan-replies",tweetId:Ue,tweetTitle:"Tweet",replies:vs})}else{const vs=ko(ge.post_url);if(!vs){Me.push({kind:"post",post:ge});continue}if(Fe.has(vs))continue;Fe.add(vs);const Qs=(ge.post_content||"").split(` 27`)[0].slice(0,80)||"Tweet",V=X.get(vs)||[];Me.push({kind:"tw-group",tweetId:vs,tweetTitle:Qs,tweet:ge,replies:V})}continue}if(on(ge.platform)){const Ue=Co(ge.post_url);if(!Ue){Me.push({kind:"post",post:ge});continue}if(Si(ge.post_url)){if(ie.has(Ue)||As.has(Ue))continue;As.add(Ue);const vs=_e.get(Ue)||[];Me.push({kind:"li-orphan-comments",postId:Ue,postTitle:"LinkedIn Post",comments:vs})}else{if(ts.has(Ue))continue;ts.add(Ue);const vs=(ge.post_content||"").split(` 28`)[0].slice(0,80)||"LinkedIn Post",Qs=_e.get(Ue)||[];Me.push({kind:"li-group",postId:Ue,postTitle:vs,post:ge,comments:Qs})}continue}
28Me.push({kind:"post",post:ge})}const Rs=(ge,Ue)=>{var V,we,De,Re,Le,Ke,qe,ds,hs,js,Bs,et;const vs=ge.platform==="youtube"&&!ti(ge.post_url),Qs=!!(Ue!=null&&Ue.isComment);return e.jsxs("div",{className:Qs?"relative pl-8 ml-4 border-l-2 border-red-500/40 -mt-2":"",children:[Qs&&e.jsx("div",{className:"absolute -left-[1px] top-0 h-3 w-px bg-transparent","aria-hidden":!0}),Qs&&e.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs text-muted-foreground",children:[e.jsx("svg",{viewBox:"0 0 24 24",className:"h-3.5 w-3.5 text-red-500 fill-current","aria-hidden":!0,children:e.jsx("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})}),e.jsx("span",{children:"Replying to a comment on"}),e.jsx("span",{className:"font-medium text-foreground/80 truncate max-w-[280px]",children:Ue==null?void 0:Ue.videoTitle}),typeof(Ue==null?void 0:Ue.commentIndex)=="number"&&((Ue==null?void 0:Ue.totalComments)??0)>1&&e.jsxs(W,{variant:"outline",className:"text-[10px] h-4",children:[Ue.commentIndex+1," of ",Ue.totalComments]})]}),e.jsxs(U,{className:`group/card border-border/50 bg-card/40 backdrop-blur-sm shadow-md hover:shadow-xl hover:border-border hover:bg-card/60 animate-fade-in transition-all duration-200 ${Qs?"border-l-4 border-l-red-500/60":""}`,children:[e.jsx(Be,{children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[e.jsx($e,{className:"text-sm font-display",children:ge.author_name}),e.jsxs(W,{variant:"secondary",className:"text-xs",children:["@",ge.author_username]}),e.jsxs(W,{className:"text-xs bg-green-500/20 text-green-600 border-green-500/30",children:[e.jsx(Ve,{className:"h-3 w-3 mr-1"}),"Approved"]}),["commented","posted","completed"].includes(ge.status)&&e.jsxs(W,{className:"text-xs bg-emerald-600/15 text-emerald-700 dark:text-emerald-400 border-emerald-600/30 flex items-center gap-1",title:ge.posted_at?`Engaged ${new Date(ge.posted_at).toLocaleString()} â auto-engage will not act on this post again`:"Already engaged â auto-engage will not act on this post again",children:[e.jsx(Ve,{className:"h-3 w-3"}),"Already engaged"]}),vs&&e.jsx(W,{className:"text-xs bg-red-500/20 text-red-600 border-red-500/30",children:"Video Container"}),Qs&&e.jsx(W,{className:"text-xs bg-red-500/15 text-red-600 border-red-500/30",children:"YouTube Comment"}),ge.competitor_mentioned&&e.jsxs(W,{className:"text-xs bg-amber-500 hover:bg-amber-600 text-white flex items-center gap-1",children:[e.jsx(ks,{className:"h-3 w-3"}),ge.competitor_mentioned]}),(()=>{const Se=Gp(ge.posted_at||ge.created_at);if(!Se)return null;const Is=ge.posted_at?Date.now()-Date.parse(ge.posted_at)<30*864e5:!1;return e.jsx(W,{variant:"outline",className:`text-[10px] h-5 ${Is?"border-emerald-500/40 text-emerald-600 dark:text-emerald-400":"border-border/50 text-muted-foreground"}`,title:ge.posted_at?`Posted ${new Date(ge.posted_at).toLocaleString()}`:`Discovered ${new Date(ge.created_at).toLocaleString()}`,children:ge.posted_at?`Posted ${Se}`:`Discovered ${Se}`})})()]}),e.jsx(os,{className:"text-xs",children:ge.relevance_reason})]}),e.jsx(h,{size:"sm",variant:"ghost",onClick:()=>window.open(ge.post_url,"_blank"),title:"View original post",children:e.jsx(Ys,{className:"h-4 w-4"})})]})}),e.jsxs(ye,{className:"space-y-4",children:[e.jsx("div",{className:"p-3 rounded-lg bg-muted/30 border border-border/30",children:e.jsx("p",{className:"text-sm leading-relaxed",children:ge.post_content})}),(vs||wo(ge)||Hp(ge))&&(()=>{const Se=vs?{accent:"text-red-600 dark:text-red-400",ring:"border-red-500/20 hover:border-red-500/40 hover:bg-red-500/5",label:"Pull comments from this video",loadingLabel:"Loading commentsâ¦",loading:!!C[ge.id],onClick:()=>ae(ge),extra:e.jsxs(h,{size:"sm",variant:"ghost",onClick:()=>H(ge.id),disabled:C[ge.id],className:"h-8 px-2 text-xs text-muted-foreground hover:text-foreground",children:[e.jsx(Rt,{className:"h-3.5 w-3.5 mr-1"}),"Remove"]})}:wo(ge)?{accent:"text-sky-600 dark:text-sky-400",ring:"border-sky-500/20 hover:border-sky-500/40 hover:bg-sky-500/5",label:"Pull replies from this tweet",loadingLabel:_[ge.i
28d]&&_[ge.id]>0?`Loading replies⦠${_[ge.id]} found`:"Loading replies⦠up to 2 min",loading:!!y[ge.id],onClick:()=>pe(ge),extra:null}:{accent:"text-blue-600 dark:text-blue-400",ring:"border-blue-500/20 hover:border-blue-500/40 hover:bg-blue-500/5",label:"Pull comments from this post",loadingLabel:"Loading commentsâ¦",loading:!!B[ge.id],onClick:()=>ze(ge),extra:null};return e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("button",{type:"button",onClick:Se.onClick,disabled:Se.loading,className:`inline-flex items-center gap-2 h-8 px-3 rounded-full border bg-background/40 transition-colors text-xs font-medium ${Se.ring} ${Se.accent} disabled:opacity-70 disabled:cursor-not-allowed`,children:[Se.loading?e.jsx(Pe,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ms,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:Se.loading?Se.loadingLabel:Se.label})]}),Se.extra]})})(),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"AI Suggestions"}),e.jsx(h,{size:"sm",variant:"ghost",onClick:()=>Oe(ge),disabled:m[ge.id],className:"h-7 text-xs gap-1",children:m[ge.id]?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"h-3 w-3 animate-spin"}),"Generating..."]}):(V=d[ge.id])!=null&&V.length?e.jsxs(e.Fragment,{children:[e.jsx(st,{className:"h-3 w-3"}),"Refresh"]}):e.jsxs(e.Fragment,{children:[e.jsx(es,{className:"h-3 w-3"}),"Generate"]})})]}),((we=d[ge.id])==null?void 0:we.length)>0&&e.jsx("div",{className:"space-y-2",children:d[ge.id].map((Se,Is)=>e.jsx("button",{onClick:()=>We(ge.id,Se),className:"w-full text-left p-2 rounded-md bg-secondary/50 hover:bg-secondary/80 border border-border/30 hover:border-primary/30 transition-all text-xs leading-relaxed",children:Se},Is))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(Vs,{placeholder:"Write your comment or select a suggestion above...",value:c[ge.id]||"",onChange:Se=>x(Is=>({...Is,[ge.id]:Se.target.value})),className:"min-h-[80px] resize-none bg-background text-sm",disabled:b===ge.id}),ge.platform!=="youtube"&&ge.author_username&&e.jsxs(na,{open:T[ge.id]||!1,onOpenChange:()=>Ee(ge.id,ge),children:[e.jsx(ia,{asChild:!0,children:e.jsxs("button",{className:"flex items-center gap-2 w-full px-3 py-2 rounded-lg border border-border/40 bg-muted/20 hover:bg-muted/40 transition-colors text-left",children:[e.jsx(fi,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"text-xs font-medium text-foreground flex-1",children:"Also DM people from this post"}),ss(ge.id)&&e.jsx(W,{variant:"secondary",className:"text-[10px] h-5",children:[((De=le[ge.id])==null?void 0:De.author)&&"Author",((Re=le[ge.id])==null?void 0:Re.commentators)&&"Commentators",((Le=le[ge.id])==null?void 0:Le.likers)&&"Likers"].filter(
28Boolean).join(", ")}),T[ge.id]?e.jsx(Gt,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(nt,{className:"h-4 w-4 text-muted-foreground"})]})}),e.jsxs(oa,{className:"mt-2 space-y-3 px-3 py-3 rounded-lg border border-border/30 bg-muted/10",children:[(ge.platform==="x"||ge.platform==="twitter")&&e.jsxs("div",{className:"flex items-start gap-2 p-2.5 rounded-md bg-amber-500/10 border border-amber-500/20",children:[e.jsx(Wa,{className:"h-4 w-4 text-amber-500 mt-0.5 shrink-0"}),e.jsx("p",{className:"text-xs text-amber-700 dark:text-amber-400",children:"X Premium is required to send DMs to people you don't follow. Make sure your account has an active Premium subscription."})]}),ge.platform==="linkedin"&&e.jsxs("div",{className:"flex items-start gap-2 p-2.5 rounded-md bg-amber-500/10 border border-amber-500/20",children:[e.jsx(Wa,{className:"h-4 w-4 text-amber-500 mt-0.5 shrink-0"}),e.jsx("p",{className:"text-xs text-amber-700 dark:text-amber-400",children:"LinkedIn Premium is required to send DMs to people outside your network. Make sure your account has an active Premium subscription."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"DM Targets"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",children:[e.jsx(Ot,{checked:((Ke=le[ge.id])==null?void 0:Ke.author)||!1,onCheckedChange:Se=>ls(ge.id,"author",!!Se)}),e.jsx(fi,{className:"h-3.5 w-3.5 text-muted-foreground group-hover:text-primary transition-colors"}),e.jsxs("span",{className:"text-xs text-muted-foreground group-hover:text-foreground transition-colors",children:["Post author â @",ge.author_username]})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",children:[e.jsx(Ot,{checked:((qe=le[ge.id])==null?void 0:qe.commentators)||!1,onCheckedChange:Se=>ls(ge.id,"commentators",!!Se)}),e.jsx(Es,{className:"h-3.5 w-3.5 text-muted-foreground group-hover:text-primary transition-colors"}),e.jsx("span",{className:"text-xs text-muted-foreground group-hover:text-foreground transition-colors",children:"Commentators on this post"}),e.jsx(W,{variant:"outline",className:"text-[10px] h-4 ml-1",children:"Saved for review"})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",children:[e.jsx(Ot,{checked:((ds=le[ge.id])==null?void 0:ds.likers)||!1,onCheckedChange:Se=>ls(ge.id,"likers",!!Se)}),e.jsx(Pa,{className:"h-3.5 w-3.5 text-muted-foreground group-hover:text-primary transition-colors"}),e.jsx("span",{className:"text-xs text-muted-foreground group-hover:text-foreground transition-colors",children:"Likers / reactors"}),e.jsx(W,{variant:"outline",className:"text-[10px] h-4 ml-1",children:"Saved for review"})]})]}),(((hs=le[ge.id])==null?void 0:hs.commentators)||((js=le[ge.id])==null?void 0:js.likers))&&e.jsx("p",{className:"text-[10px] text-muted-foreground italic mt-1",children:"Commentator & liker DMs will be saved to your DM Threads for review and manual sending."})]}),ss(ge.id)&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"DM Preview"}),e.jsx(h,{size:"sm",variant:"ghost",onClick:()=>Ae(ge),disabled:ue[ge.id],className:"h-6 text-[10px] gap-1",children:ue[ge.id]?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(st,{className:"h-3 w-3"}),"Regenerate"]})})]}),ue[ge.id]&&!L[ge.id]?e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-md bg-background border border-border/30",children:[e.jsx(Pe,{className:"h-3 w-3 animate-spin text-primary"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Generating personalized DM..."})]}):e.jsx(Vs,{value:L[ge.id]||"",onChange:Se=>K(Is=>({...Is,[ge.id]:Se.target.value}
28)),className:"min-h-[60px] resize-none bg-background text-xs",placeholder:"DM message will appear here..."})]})]})]}),Ie[ge.id]==="waiting"&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-md bg-amber-500/10 border border-amber-500/20",children:[e.jsx(Pe,{className:"h-3 w-3 animate-spin text-amber-600"}),e.jsx("span",{className:"text-[11px] text-amber-700 dark:text-amber-400",children:"Waiting for comment to post before sending DMs..."})]}),Ie[ge.id]==="sending"&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-md bg-blue-500/10 border border-blue-500/20",children:[e.jsx(Pe,{className:"h-3 w-3 animate-spin text-blue-600"}),e.jsx("span",{className:"text-[11px] text-blue-700 dark:text-blue-400",children:"Comment posted! Sending DMs now..."})]}),Ie[ge.id]==="sent"&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-md bg-green-500/10 border border-green-500/20",children:[e.jsx(Ve,{className:"h-3 w-3 text-green-600"}),e.jsx("span",{className:"text-[11px] text-green-700 dark:text-green-400",children:"Comment posted & DMs sent!"})]}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[g[ge.id]?e.jsxs(h,{disabled:!0,className:"flex-1 bg-green-600 hover:bg-green-600",children:[e.jsx(Ve,{className:"h-4 w-4 mr-2"}),"Queued for Extension"]}):e.jsx(h,{onClick:()=>Xs(ge),disabled:b===ge.id||!((Bs=c[ge.id])!=null&&Bs.trim()),className:"flex-1 bg-gradient-to-r from-indigo-600 to-purple-600 hover:opacity-90",children:b===ge.id?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"h-4 w-4 mr-2 animate-spin"}),"Queuing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(pa,{className:"h-4 w-4 mr-2"}),e.jsx(At,{className:"h-4 w-4 mr-2"}),"Send to Extension",T[ge.id]&&ss(ge.id)&&e.jsx("span",{className:"ml-1 text-[10px] opacity-80",children:"+ DMs"})]})}),e.jsxs(h,{size:"sm",variant:"secondary",onClick:()=>xs(ge),disabled:!((et=c[ge.id])!=null&&et.trim()),title:"Copy comment and open post to paste manually",children:[e.jsx(ta,{className:"h-4 w-4 mr-2"}),"Copy & Open"]}),e.jsxs(h,{size:"sm",variant:"outline",onClick:()=>H(ge.id),disabled:b===ge.id,children:[e.jsx(Rt,{className:"h-4 w-4 mr-2"}),"Skip"]})]})]})]})]})]})]},ge.id)};return Me.map(ge=>{if(ge.kind==="post")return e.jsx("div",{children:Rs(ge.post)},ge.post.id);if(ge.kind==="yt-group"){const{videoId:V,videoTitle:we,video:De,comments:Re}=ge,Le=f[V]??!1;return e.jsxs("div",{className:"space-y-2",children:[Rs(De,{videoId:V,videoTitle:we,isComment:!1}),Re.length>0&&e.jsxs(na,{open:!Le,onOpenChange:Ke=>R(qe=>({...qe,[V]:!Ke})),className:"ml-4",children:[e.jsxs(ia,{className:"w-full flex items-center gap-2 px-3 py-2 rounded-md border border-red-500/30 bg-red-500/5 hover:bg-red-500/10 transition-colors text-xs font-medium text-red-600",children:[Le?e.jsx(nt,{className:"h-4 w-4"}):e.jsx(Gt,{className:"h-4 w-4"}),e.jsx(ms,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:[Le?"Show":"Hide"," ",Re.length," comment",Re.length===1?"":"s"," on this video"]})]}),e.jsx(oa,{className:"space-y-3 pt-3",children:Re.map((Ke,qe)=>e.jsx("div",{children:Rs(Ke,{videoId:V,videoTitle:we,isComment:!0,commentIndex:qe,totalComments:Re.length})},Ke.id))})]})]},`yt-group-${V}`)}if(ge.kind==="yt-orphan-comments"){const{videoId:V,videoTitle:we,comments:De}=ge,Re=f[V]??!1;return e.jsx("div",{children:e.jsxs(na,{open:!Re,onOpenChange:Le=>R(Ke=>({...Ke,[V]:!Le})),children:[e.jsxs(ia,{className:"w-full flex items-center gap-2 px-3 py-2 rounded-md border border-red-500/30 bg-red-500/5 hover:bg-red-500/10 transition-colors text-xs font-medium text-red-600",children:[Re?e.jsx(nt,{className:"h-4 w-4"}):e.jsx(Gt,{className:"h-4 w-4"}),e.jsx(ms,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:[Re?"Show":"Hide"," ",De.length," YouTube comment",De.length===1?"":"s"]})]}),e.jsx(oa,{className:"space-y-3 pt-3",children:De.map((Le,Ke)=>e.jsx("div",{children:Rs(Le,{videoId:V,videoTitle:we,isComment:!0,commentIndex:Ke,totalComments:De.length})},Le.id))})]})},`yt-orphan-${V}`)}if(ge.kind==="tw-group"){const{tweetId:V,tweet:we,replies:De}=ge,Re=M[V]??!1,Le=_[we.id],Ke=!!y[we.id];return e.jsxs("div",{className:"space-y-2",children:[Rs(we),(De.length>0||Ke)&&e.jsxs(na,{open:!Re,onOpenChange:qe=>q(ds=>({...ds,[V]:!qe})),className:"ml-4",children:[e.jsxs(ia,{className:"w-full flex items-center gap-2 px-3 py-2 rounded-md border border-sky-500/30 bg-sky-500/5 hover:bg-sky-500/10 transition-colors text-xs font-medium text-sky-600 dark:text-sky-400",children:[Re?e.jsx(nt,{className:"h-4 w-4"}):e.jsx(Gt,{className:"h-4 w-4"}),Ke?e.jsx(Pe,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ms,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:Ke?`Loading replies⦠${De.length||Le||0} found so far`:`${Re?"Show":"Hide"} ${De.length} reply thread${De.length===1?"":"s"} on this tweet`})]}
28),e.jsxs(oa,{className:"space-y-3 pt-3",children:[De.length===0&&Ke&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-4 text-xs text-muted-foreground",children:[e.jsx(Pe,{className:"h-3.5 w-3.5 animate-spin"}),"Pulling reply threads from X. Replies will appear here as they're found."]}),De.map(qe=>e.jsx("div",{children:Rs(qe)},qe.id))]})]})]},`tw-group-${V}`)}if(ge.kind==="tw-orphan-replies"){const{tweetId:V,replies:we}=ge,De=M[V]??!1;return e.jsx("div",{children:e.jsxs(na,{open:!De,onOpenChange:Re=>q(Le=>({...Le,[V]:!Re})),children:[e.jsxs(ia,{className:"w-full flex items-center gap-2 px-3 py-2 rounded-md border border-sky-500/30 bg-sky-500/5 hover:bg-sky-500/10 transition-colors text-xs font-medium text-sky-600 dark:text-sky-400",children:[De?e.jsx(nt,{className:"h-4 w-4"}):e.jsx(Gt,{className:"h-4 w-4"}),e.jsx(ms,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:[De?"Show":"Hide"," ",we.length," reply thread",we.length===1?"":"s"]})]}),e.jsx(oa,{className:"space-y-3 pt-3",children:we.map(Re=>e.jsx("div",{children:Rs(Re)},Re.id))})]})},`tw-orphan-${V}`)}if(ge.kind==="li-group"){const{postId:V,post:we,comments:De}=ge,Re=I[V]??!1,Le=!!B[we.id];return e.jsxs("div",{className:"space-y-2",children:[Rs(we),(De.length>0||Le)&&e.jsxs(na,{open:!Re,onOpenChange:Ke=>$(qe=>({...qe,[V]:!Ke})),className:"ml-4",children:[e.jsxs(ia,{className:"w-full flex items-center gap-2 px-3 py-2 rounded-md border border-blue-500/30 bg-blue-500/5 hover:bg-blue-500/10 transition-colors text-xs font-medium text-blue-600 dark:text-blue-400",children:[Re?e.jsx(nt,{className:"h-4 w-4"}):e.jsx(Gt,{className:"h-4 w-4"}),Le?e.jsx(Pe,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ms,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:Le?`Loading comments⦠${De.length} found so far`:`${Re?"Show":"Hide"} ${De.length} comment${De.length===1?"":"s"} on this post`})]}),e.jsx(oa,{className:"space-y-3 pt-3",children:De.map(Ke=>e.jsx("div",{children:Rs(Ke)},Ke.id))})]})]},`li-group-${V}`)}const{postId:Ue,comments:vs}=ge,Qs=I[Ue]??!1;return e.jsx("div",{children:e.jsxs(na,{open:!Qs,onOpenChange:V=>$(we=>({...we,[Ue]:!V})),children:[e.jsxs(ia,{className:"w-full flex items-center gap-2 px-3 py-2 rounded-md border border-blue-500/30 bg-blue-500/5 hover:bg-blue-500/10 transition-colors text-xs font-medium text-blue-600 dark:text-blue-400",children:[Qs?e.jsx(nt,{className:"h-4 w-4"}):e.jsx(Gt,{className:"h-4 w-4"}),e.jsx(ms,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:[Qs?"Show":"Hide"," ",vs.length," LinkedIn comment",vs.length===1?"":"s"]})]}),e.jsx(oa,{className:"space-y-3 pt-3",children:vs.map(V=>e.jsx("div",{children:Rs(V)},V.id))})]})},`li-orphan-${Ue}`)})})()]})},Bn=({userId:s,platform:t})=>{const[a,r]=i.useState([]),[o,n]=i.useState(""),[l,c]=i.useState(!0),[x,d]=i.useState([]);i.useEffect(()=>{u(),m()},[s,t]);const u=async()=>{c(!0);try{const{data:y}=await w.from("platform_preferences").select("keywords").eq("user_id",s).eq("platform",t).maybeSingle();r((y==null?void 0:y.keywords)||[])}catch{}finally{c(!1)}},m=async()=>{try{const{data:y}=await w.from("product_profiles").select("product_name, value_proposition, benefits, ideal_customer_profile").eq("user_id",s).maybeSingle();if(!y)return;const N=new Set;y.product_name&&y.product_name.toLowerCase().split(/\s+/).forEach(f=>{f.length>3&&!p.has(f)&&N.add(f)}),y.value_proposition&&g(y.value_proposition).forEach(f=>{N.add(f)}),y.benefits&&g(y.benefits).forEach(f=>{N.add(f)}),y.ideal_customer_profile&&g(y.ideal_customer_profile).forEach(f=>{N.add(f)}),d(Array.from(N).slice(0,8))}catch{}},p=new Set(["the","and","for","that","with","are","this","from","have","your","they","will","can","all","their","been","has","more","when","who","what","how","our","you","about","into","than","them","also","just","help","make","want","need","like","use","using","used","helps"]),g=y=>{const N=[];y.toLowerCase().replace(/[^\w\s-]/g," ").split(/\s+/).filter(q=>q.length>3&&!p.has(q)).slice(0,5).forEach(q=>{q.length>4&&N.push(q)});const R=y.toLowerCase();return[/social media/gi,/content marketing/gi,/lead generation/gi,/customer service/gi,/brand awareness/gi,/email marketing/gi,/digital marketing/gi,/growth hacking/gi,/sales automation/gi,/community management/gi,/influencer marketing/gi].forEac
28h(q=>{const _=R.match(q);_&&N.push(_[0])}),N},v=async y=>{try{const{error:N}=await w.from("platform_preferences").upsert({user_id:s,platform:t,keywords:y,enabled:!0},{onConflict:"user_id,platform"});if(N)throw N;r(y)}catch(N){throw N}},b=async y=>{const N=(y||o).trim().toLowerCase();if(!N)return;if(a.includes(N)){k.error("Keyword already exists");return}const f=[...a,N];try{await v(f),y||n(""),k.success(`Added "${N}"`)}catch{k.error("Failed to add keyword")}},z=async y=>{const N=a.filter(f=>f!==y);try{await v(N),k.success(`Removed "${y}"`)}catch{k.error("Failed to remove keyword")}},C=y=>{y.key==="Enter"&&(y.preventDefault(),b())},j=x.filter(y=>!a.includes(y.toLowerCase()));return l?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Mr,{className:"h-4 w-4 animate-pulse"}),"Loading tags..."]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Mr,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(Ce,{className:"text-sm font-medium",children:"Discovery Tags"})]}),a.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map(y=>e.jsxs(W,{variant:"secondary",className:"pl-2 pr-1 py-1 flex items-center gap-1 bg-secondary/80 hover:bg-secondary",children:[e.jsx("span",{className:"text-xs",children:y}),e.jsx("button",{onClick:()=>z(y),className:"ml-1 hover:bg-destructive/20 rounded-full p-0.5 transition-colors",title:"Remove tag",children:e.jsx(zs,{className:"h-3 w-3"})})]},y))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Je,{placeholder:"Add keyword...",value:o,onChange:y=>n(y.target.value),onKeyDown:C,className:"h-8 text-sm bg-background/50"}),e.jsx(h,{size:"sm",variant:"outline",onClick:()=>b(),disabled:!o.trim(),className:"h-8 px-2",children:e.jsx(ft,{className:"h-4 w-4"})})]}),a.length===0&&j.length>0&&e.jsxs("div",{className:"space-y-2 pt-2 border-t border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(za,{className:"h-3 w-3"}),e.jsx("span",{children:"Suggestions from your product profile:"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:j.map(y=>e.jsxs("button",{onClick:()=>b(y),className:"px-2 py-1 text-xs rounded-md border border-dashed border-primary/40 bg-primary/5 hover:bg-primary/10 hover:border-primary/60 text-primary transition-colors",children:["+ ",y]},y))})]}),a.length===0&&j.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"Add keywords to improve discovery results"})]})},_d=({userId:s,onFirstComment:t})=>{const a=ns(),[r,o]=i.useState("posts"),[n,l]=i.useState(!1),[c,x]=i.useState(""),[d,u]=i.useState(!1),[m,p]=i.useState([]),[g,v]=i.useState([]),[b,z]=i.useState(""),[C,j]=i.useState(""),[y,N]=i.useState([]),[f,R]=i.useState([]),[M,q]=i.useState([]),[_,A]=i.useState(!1),[B,P]=i.useState(!1);i.useState(!1);const[I,$]=i.useState(null),[be,Y]=i.useState(!0),[O,he]=i.useState(!1),[re,oe]=i.useState(!1);i.useEffect(()=>{ce(),T()},[s]);const T=async()=>{Y(!0);try{const{data:Q,error:ne}=await w.from("user_credentials").select("platform, credentials").eq("user_id",s).eq("platform","linkedin").maybeSingle();if(ne)throw ne;if(A(!!Q),Q!=null&&Q.credentials){const ke=Q.credentials;$(ke);const ee=!!ke.accessToken&&(!ke.expiresAt||Date.now()<ke.expiresAt);P(ee)}else P(!1),$(null)}catch{A(!1),P(!1)}finally{Y(!1)}},ce=async()=>{try{const{data:Q}=await w.from("platform_preferences").select("keywords, competitors").eq("user_id",s).eq("platform","linkedin").maybeSingle();Q&&N(Q.keywords||[])}catch{}},le=async()=>{u(!0);try{const{data:{session:Q}}=await w.auth.getSession();if(!Q){k.error("Please log in to load suggestions");return}const{data:ne,error:ke}=await w.functions.invoke("suggest-linkedin-targets",{headers:{Authorization:`Bearer ${Q.access_token}`}});if(ke)throw ke;if(ne!=null&&ne.error)throw new Error(ne.error);const ee=m.filter(S=>S.added).map(S=>S.name.toLowerCase()),E=g.filter(S=>S.joined).map(S=>S.name.toLowerCase()),xe=(ne.companies||[]).map(S=>({...S,added:ee.includes(S.name.toLowerCase())})),ve=(ne.groups||[]).map(S=>({...S,joined:E.includes(S.name.toLowerCase())}));p(xe),v(ve),k.success(`Found ${xe.length} companies and ${ve.length} groups`)}catch(Q){kt(Q,"Loading suggestions")}finally{u(!1)}},F=Q=>[/linkedin\.com\/posts\//i,/linkedin\.com\/feed\/update\/urn:li:activity:/i,/linkedin\.com\/feed\/update\/urn:li:ugcPost:/i].some(ke=>ke.test(Q)),L=Q=>{const ne=Q.match(/activity[:\-](\d+)/i);if(ne)return ne[1];const ke=Q.match(/ugcPost[:\-](\d+)/i);return ke?ke[1]:null},K=async()=>{const Q=c.trim();if(!Q){k.error("Please enter a LinkedIn post URL");return}if(!F(Q)){k.error("Invalid URL format",{description:"Please enter a valid LinkedIn post URL (e.g., linkedin.com/posts/...)"});return}const ne=L(Q);if(!ne){k.error("Could not extract post ID",{description:"Make sure you copied the full URL from the LinkedIn post."});return}l(!0);try{const{data:ke}=await w.from("discovered_posts").select("id").eq("user_id",s).eq("post_url",Q).maybeSingle();if(ke){k.error("Post already added",{description:"This LinkedIn post is already in your queue."}),l(!1);return}const{error:ee}=await w.from("discovered_posts").insert({user_id:s,platform:"linkedin",post_url:Q,post_content:`LinkedIn post (Activity ID: ${ne})`,status:"pending",relevance_score:100,relevance_reason:"Manually added"});if(ee)throw ee;k.success("Post added to your queue"),x(""),he(!1)}catch(ke){kt(ke,"Adding post")}finally{l(!1)}},ue=async()=>{var Q,ne,ke,ee,E;oe(!0);try{const{data:{session:xe}}=await w.auth.getSession();if(!xe){k.error("Please log in to discover posts");return}const{data:ve}=await w.from("platform_preferences").select("keywords").eq("user_id",s).eq("platform","linkedin").maybeSingle(),S=(ve==null?void 0:ve.keywords)||[];N(S);const J=m.filter(H=>H.added).map(H=>H.name),je=[...new Set([...f,...J])],{data:se,error:Oe}=await w.functions.invoke("discover-posts",{body:{platform:"linkedin",keywords:S.length>0?S:void 0,targetCompanies:je.length>0?je:void 0,targetRoles:M.length>0?M:void 0},headers:{Authorization:`Bearer ${xe.access_token}`}});if(Oe){if((Q=Oe.message)!=null&&Q.includes("NO_KEYWORDS")||(ne=Oe.message)!=null&&ne.includes("No search terms")){k.info("Add keywords in the Discovery Tags section above to improve results.");return}throw Oe}if(se!=null&&se.error){if(se.error.includes("NO_KEYWORDS")||se.error.includes("No search terms")){k.info("Add keywords in the Discovery Tags section above to improve results.");return}k.error("Discovery failed",{description:se.error});return}const We=(se==null?void 0:se.postsDiscovered)||((ke=se==null?void 0:se.posts)==null?void 0:ke.length)||0;We>0?k.success(`Found ${We} new posts`):k.info("No new posts found. Try adding more keywords above.")}catch(xe){if((ee=xe==null?void 0:xe.message)!=null&&ee.includes("NO_KEYWORDS")||(E=xe==null?void 0:xe.message)!=null&&E.includes("No search terms")){k.info("Add keywords in the Discovery Tags section above to find posts.");return}kt(xe,"LinkedIn discovery")}finally{oe(!1)}},Ne=async Q=>{const ne=!Q.added;p(ee=>ee.map(E=>E.id===Q.id?{...E,added:ne}:E));const ke=m.filter(ee=>ee.id===Q.id?ne:ee.added).map(ee=>ee.name);try{await w.from("platform_preferences").upsert({user_id:s,platform:"linkedin",competitors:ke,enabled:!0},{onConflict:"user_id,platform"}),k.success(ne?`Added ${Q.name} to tracking`:`Removed ${Q.name}`)}catch{}},fe=Q=>{v(ne=>ne.map(ke=>ke.id===Q.id?{...ke,joined:!ke.joined}:ke)),k.success(Q.joined?`Left ${Q.name}`:`Joined ${Q.name}`)},me=m.filter(Q=>Q.name.toLowerCase().includes(b.toLowerCase())||Q.industry.toLowerCase().includes(b.toLowerCase())),Ie=g.filter(Q=>Q.name.toLowerCase().includes(C.toLowerCase())||Q.category.toLowerCase().includes(C.toLowerCase()));return e.jsxs("div",{className:"space-y-6",children:[!be&&!_&&e.jsxs(Xt,{variant:"destructive",className:"bg-destructive/10 border-destructive/30",children:[e.jsx(Ss,{className:"h-4 w-4"}),e.jsx(_a,{children:"API Credentials Required"}),e.jsxs(Qt,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Add your LinkedIn API credentials to start discovering posts. Discovery requires valid credentials to search for relevant conversations."}),e.jsxs(h,{variant:"outline",size:"sm",onClick:()=>a("/dashboard?tab=settings"),className:"ml-4 shrink-0",children:[e.jsx(qr,{className:"h-4 w-4 mr-2"}),"Go to Settings"]})]})]}),e.jsxs(Ct,{value:r,onValueChange:Q=>o(Q),className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(wt,{className:"bg-secondary/50 p-1",children:[e.jsxs(cs,{value:"posts",className:"data-[state=active]:bg-background gap-2",children:[e.jsx(Ks,{className:"h-4 w-4"}),"Discover Posts"]}),e.jsxs(cs,{value:"engage",className:"data-[state=active]:bg-background gap-2",children:[e.jsx(ms,{className:"h-4 w-4"}),"Ready to Engage"]}),e.jsxs(cs,{value:"targeting",className:"data-[state=active]:bg-background gap-2",children:[e.jsx(ks,{className:"h-4 w-4"}),"Targeting"]})]}),r==="posts"&&e.jsx(h,{onClick:ue,disabled:re||be||!_,className:"bg-gradient-to-r from-primary to-accent hover:opacity-90 disabled:opacity-50",children:re?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"mr-2 h-4 w-4 animate-spin"}),"Discovering..."]}):e.jsxs(e.Fragment,{children:[e.jsx(es,{className:"mr-2 h-4 w-4"}),"Start Discovery"]})})]}),e.jsxs(us,{value:"posts",className:"mt-4 space-y-4",children:[e.jsx("div",{className:"p-4 bg-secondary/30 rounded-lg border border-border/50",children:e.jsx(Bn,{userId:s,platform:"linkedin"})}),e.jsx(Dn,{userId:s,platform:"linkedin"})]}),e.jsx(us,{value:"engage",className:"mt-4",children:e.jsx(Fn,{userId:s,platform:"linkedin",onFirstComment:t})}),e.jsxs(us,{value:"targeting",className:"mt-4",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"AI-generated suggestions based on your product profile and industry"}),e.jsx(h,{onClick:le,disabled:d,variant:"outline",children:d?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):e.jsxs(e.Fragment,{children:[e.jsx(st,{className:"mr-2 h-4 w-4"}),m.length===0?"Get Suggestions":"Refresh"]})})]}),e.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsxs($e,{className:"flex items-center gap-2",children:[e.jsx(fa,{className:"h-5 w-5"}),"Companies to Track"]}),e.jsx(os,{children:"Monitor competitor pages and industry leaders for engagement opportunities"})]}),e.jsxs(ye,{className:"space-y-4",children:[e.jsx(Je,{placeholder:"Search companies...",value:b,onChange:Q=>z(Q.target.value),className:"w-full"}),e.jsx(jt,{className:"h-[300px]",children:m.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-4",children:[e.jsx(fa,{className:"h-10 w-10 text-muted-foreground
28/50 mb-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Click "Get Suggestions" to discover relevant companies'})]}):e.jsx("div",{className:"space-y-3",children:me.map(Q=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-secondary/30 hover:bg-secondary/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(fa,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:Q.name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[Q.industry," ⢠",(Q.followers/1e3).toFixed(0),"K followers"]}),Q.reason&&e.jsx("p",{className:"text-xs text-primary/80 mt-0.5",children:Q.reason})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[Q.added&&e.jsx(W,{variant:"outline",className:"bg-green-500/10 text-green-700 border-green-500/20",children:"Tracking"}),e.jsx(h,{size:"sm",variant:Q.added?"outline":"default",onClick:()=>Ne(Q),children:Q.added?"Remove":e.jsxs(e.Fragment,{children:[e.jsx(ft,{className:"h-4 w-4 mr-1"}),"Add"]})})]})]},Q.id))})}),e.jsx("div",{className:"pt-2 border-t",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsx(gs,{className:"h-3 w-3 inline mr-1"}),"Posts from tracked companies will appear in your discovery feed"]})})]})]}),e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsxs($e,{className:"flex items-center gap-2",children:[e.jsx(Es,{className:"h-5 w-5"}),"LinkedIn Groups"]}),e.jsx(os,{children:"Join industry groups to find engagement opportunities"})]}),e.jsxs(ye,{className:"space-y-4",children:[e.jsx(Je,{placeholder:"Search groups...",value:C,onChange:Q=>j(Q.target.value),className:"w-full"}),e.jsx(jt,{className:"h-[300px]",children:g.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-4",children:[e.jsx(Es,{className:"h-10 w-10 text-muted-foreground/50 mb-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Click "Get Suggestions" to discover relevant groups'})]}):e.jsx("div",{className:"space-y-3",children:Ie.map(Q=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-secondary/30 hover:bg-secondary/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:e.jsx(Es,{className:"h-5 w-5 text-blue-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:Q.name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[Q.category," ⢠",(Q.members/1e3).toFixed(0),"K members"]}),Q.reason&&e.jsx("p",{className:"text-xs text-primary/80 mt-0.5",children:Q.reason})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[Q.joined&&e.jsx(W,{variant:"outline",className:"bg-blue-500/10 text-blue-700 border-blue-500/20",children:"Joined"}),e.jsx(h,{size:"sm",variant:Q.joined?"outline":"default",onClick:()=>fe(Q),children:Q.joined?"Leave":e.jsxs(e.Fragment,{children:[e.jsx(wa,{className:"h-4 w-4 mr-1"}),"Join"]})})]})]},Q.id))})}),e.jsx("div",{className:"pt-2 border-t",children:e.jsx(h,{variant:"link",size:"sm",className:"p-0 h-auto",asChild:!0,children:e.jsxs("a",{href:"https://www.linkedin.com/groups/",target:"_blank",rel:"noopener noreferrer",children:[e.jsx(bt,{className:"h-3 w-3 mr-1"}),"Find more groups on LinkedIn",e.jsx(Ys,{className:"h-3 w-3 ml-1"})]})})})]})]})]}),e.jsxs(U,{className:"mt-6",children:[e.jsx(Be,{children:e.jsxs($e,{className:"flex items-center gap-2",children:[e.jsx(Sr,{className:"h-5 w-5"}),"LinkedIn Engagement Strategy"]})}),e.jsx(ye,{children:e.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-4 rounded-lg bg-secondary/30",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Company Pages"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Comment on posts from competitors and industry leaders. Provide value-ad
28ding insights to get noticed."})]}),e.jsxs("div",{className:"p-4 rounded-lg bg-secondary/30",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Groups"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Answer questions and share expertise in relevant groups. Build authority before promoting."})]}),e.jsxs("div",{className:"p-4 rounded-lg bg-secondary/30",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Best Practices"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Engage consistently (3-5 comments/day). Be helpful first, promotional second. Use professional tone."})]})]})})]})]})]}),e.jsx(gt,{open:O,onOpenChange:he,children:e.jsxs(dt,{className:"sm:max-w-[500px]",children:[e.jsxs(mt,{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"p-2 rounded-full bg-primary/10",children:e.jsx(Lc,{className:"h-5 w-5 text-primary"})}),e.jsx(xt,{children:"Add LinkedIn Post"})]}),e.jsx(Mt,{className:"text-base",children:"Paste a LinkedIn post URL to add it to your engagement queue."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"post-url",className:"text-sm font-medium",children:"LinkedIn Post URL"}),e.jsx(Je,{id:"post-url",placeholder:"https://www.linkedin.com/posts/username_...",value:c,onChange:Q=>x(Q.target.value),onKeyDown:Q=>{Q.key==="Enter"&&(Q.preventDefault(),K())},className:"bg-background"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Copy the URL from a LinkedIn post you want to engage with"})]}),e.jsxs("div",{className:"p-3 bg-accent/10 border border-accent/20 rounded-lg text-sm",children:[e.jsx("p",{className:"font-medium mb-1",children:"How to get a LinkedIn post URL:"}),e.jsxs("ol",{className:"space-y-1 text-xs text-muted-foreground ml-4 list-decimal",children:[e.jsx("li",{children:"Find a post on LinkedIn you want to engage with"}),e.jsx("li",{children:'Click the "..." menu on the post'}),e.jsx("li",{children:'Select "Copy link to post"'}),e.jsx("li",{children:"Paste the URL here"})]})]})]}),e.jsxs(Ft,{className:"gap-2",children:[e.jsx(h,{variant:"outline",onClick:()=>he(!1),children:"Cancel"}),e.jsx(h,{onClick:K,disabled:!c.trim()||n,className:"bg-gradient-to-r from-primary to-accent",children:n?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"mr-2 h-4 w-4 animate-spin"}),"Adding..."]}):"Add Post"})]})]})})]})},Td=({className:s})=>{var M;const[t,a]=i.useState(!1),[r,o]=i.useState(null),[n,l]=i.useState(null),[c,x]=i.useState(null),[d,u]=i.useState(null),[m,p]=i.useState(null),[g,v]=i.useState(null),[b,z]=i.useState([]),C=i.useCallback(q=>{z(_=>[..._.slice(-19),{...q,timestamp:new Date}])},[]),j=i.useCallback(()=>{try{const q=document.documentElement.dataset.socialpilotBridge==="1";return o(q),q}catch{return o(!1),!1}},[]);i.useEffect(()=>{j();const q=_=>{var I,$,be,Y,O,he,re;const A=_.origin===window.location.origin||_.origin==="null",B=_.source===window;if(!A&&!B||!(($=(I=_.data)==null?void 0:I.type)!=null&&$.startsWith("SOCIALPILOT_")))return;const P=_.data.type;P==="SOCIALPILOT_PING"?(l(new Date),C({type:"PING",direction:"sent",data:{nonce:_.data.nonce}})):P==="SOCIALPILOT_PONG"?(x(new Date),C({type:"PONG",direction:"received",data:_.data})):P==="SOCIALPILOT_BRIDGE_READY"?(C({type:"BRIDGE_READY",direction:"received",data:_.data}),j()):P==="SOCIALPILOT_EXTENSION_CONNECTED"?C({type:"EXTENSION_CONNECTED",direction:"received",data:_.data}):P==="SOCIALPILOT_DISCOVER_REQUEST"?(p(new Date),C({type:"DISCOVER_REQUEST",direction:"sent",data:{platform:_.data.platform,keywords:(be=_.data.keywords)==null?void 0:be.length}})):P==="SOCIALPILOT_DISCOVER_RESPONSE"?(v({time:new Date,data:_.data}),C({type:"DISCOVER_RESPONSE",direction:"received",data:_.data,error:(Y=_.data)==null?void 0:Y.error}),(O=_.data)!=null&&O.error&&u(_.data.error)):P==="SOCIALPILOT_RUNTIME_ERROR"&&(u(((he=_.data)==null?void 0:he.error)||"Unknown runtime error"),C({type:"RUNTIME_ERROR",direction:"received",error:(re=_.data)==null?void 0:re.error}))};return window.addEventListener("message",q),()=>window.removeEventListener("message",q)},[C,j]);const y=q=>q?q.toLocaleTimeString():"Never",N=q=>{if(!q)return"";const _=Math.floor((Date.now()-q.getTime())/1e3);return _<60?`${_}s ago`:_<3600?`${Math.floor(_/60)}m ago`:`${Math.floor(_/3600)}h ago`},f=()=>{const q=`debug-${Date.now()}`;window.postMessage({type:"SOCIALPILOT_PING",nonce:q},"*"),l(new Date),C({type:"PING (manual)",direction:"sent",data:{nonce:q}})},R=()=>{z([]),u(null)};return e.jsx(na,{open:t,onOpenChange:a,className:Z("",s),children:e.jsxs(U,{className:"border-border/50 bg-card/30 backdrop-blur",children:[e.jsx(ia,{asChild:!0,children:e.jsx(Be,{className:"cursor-pointer hover:bg-secondary/20 transition-colors py-3",children:e.jsxs($e,{className:"text-sm font-medium flex items-center justify-between",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Zm,{className:"h-4 w-4 text-muted-foreground"}),"Extension Debug Panel",r&&e.jsx(W,{variant:"outline",className:"text-xs bg-green-500/10 text-green-500 border-green-500/30",children:"Bridge Active"}),d&&e.jsx(W,{variant:"outline",className:"text-xs bg-destructive/10 text-destructive border-destructive/30",children:"Error"})]}),t?e.jsx(Gt,{className:"h-4 w-4"}):e.jsx(nt,{className:"h-4 w-4"})]})})}),e.jsx(oa,{children:e.jsxs(ye,{className:"pt-0 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsxs("div",{className:"p-3 bg-secondary/30 rounded-lg border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r?e.jsx(bs,{className:"h-4 w-4 text-green-500"}):e.jsx(zs,{className:"h-4 w-4 text-destructive"}),e.jsx("span",{className:"text-xs font-medium",children:"DOM Marker"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r?"Present":"Not found"})]}),e.jsxs("div",{className:"p-3 bg-secondary/30 rounded-lg border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Cs,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"text-xs font-medium",children:"Last PING"})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[y(n),n&&e.jsxs("span",{className:"ml-1 opacity-60",children:["(",N(n),")"]})]})]}),e.jsxs("div",{className:"p-3 bg-secondary/30 rounded-lg border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Cs,{className:"h-4 w-4 text-accent"}),e.jsx("span",{className:"text-xs font-medium",children:"Last PONG"})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[y(c),c&&e.jsxs("span",{className:"ml-1 opacity-60",children:["(",N(c),")"]})]})]}),e.jsxs("div",{className:"p-3 bg-secondary/30 rounded-lg border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Cs,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-xs font-medium",children:"Discovery"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:g?e.jsxs(e.Fragment,{children:[((M=g.data)==null?void 0:M.postsFound)??0," posts",e.jsxs("span",{className:"ml-1 opacity-60",children:["(",N(g.time),")"]})]}):m?e.jsxs(e.Fragment,{children:["Pending (",N(m),")"]}):"None"})]})]}),d&&e.jsxs("div",{className:"p-3 bg-destructive/10 rounded-lg border border-destructive/30",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(qt,{className:"h-4 w-4 text-destructive"}),e.jsx("span",{className:"text-xs font-medium text-destructive",children:"Last Runtime Error"})]}),e.jsx("p",{className:"text-xs text-destructive/80 font-mono break-all",children:d})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(h,{variant:"outline",size:"sm",onClick:f,className:"text-xs h-7",children:[e.jsx(st,{className:"h-3 w-3 mr-1"}),"Send Test PING"]}),e.jsx(h,{variant:"outline",size:"sm",onClick:j,className:"text-xs h-7",children:"Check Marker"}),e.jsx(h,{variant:"ghost",size:"sm",onClick:R,className:"text-xs h-7 ml-auto",children:"Clear Log"})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs font-medium mb-2 text-muted-foreground",children:["Event Log (",b.length,")"]}),e.jsx(jt,{className:"h-32 rounded border border-border/50 bg-background/50",children:e.jsx("div",{className:"p-2 space-y-1 font-mono text-xs",children:b.length===0?e.jsx("p",{className:"text-muted-foreground text-center py-4",children:"No events captured yet"}):b.slice().reverse().map((q,_)=>e.jsxs("div",{className:Z("flex items-start gap-2 py-1 px-2 rounded",q.error?"bg-destructive/10":q.direction==="sent"?"bg-primary/5":"bg-accent/5"),children:[e.jsx("span",{className:"text-muted-foreground shrink-0",children:q.timestamp.toLocaleTimeString()}),e.jsx("span",{className:Z("shrink-0",q.direction==="sent"?"text-primary":"text-accent"),children:q.direction==="sent"?"â":"â"}),e.jsx("span",{className:"font-semibold",children:q.type}),q.data&&e.jsx("span",{className:"text-muted-foreground truncate",children:JSON.stringify(q.data).slice(0,50)}),q.error&&e.jsx("span",{className:"text-destructive truncate",children:q.error})]},_))})})]})]})})]})})},Yt=1,Up="v2-verified-only",Ki=s=>
28typeof s!="number"||Number.isNaN(s)?"":`${s.toLocaleString()} members`,br=s=>{if(!s)return"";const t=s.match(/facebook\.com\/groups\/([^/?&#]+)/i);return t?t[1].toLowerCase():""},ai=s=>br(s.groupUrl)||(s.slug||"").toLowerCase()||s.id,Ci=s=>({...s,memberEstimate:s.memberEstimate||Ki(s.memberCount)}),ur=s=>`fb_group_suggestions_${Up}_${s}`,Wp=(s,t)=>{const a=new Map;return t.forEach(r=>{a.set(r.id,r),a.set(r.groupUrl,r)}),s.map(r=>{const o=a.get(r.id)||a.get(r.groupUrl);return o?Ci({...r,...o,memberCount:o.memberCount??r.memberCount,memberEstimate:o.memberEstimate||r.memberEstimate||Ki(o.memberCount??r.memberCount)}):null}).filter(r=>!!r)},Ad=({userId:s,onFirstComment:t})=>{const[a,r]=i.useState([]),[o,n]=i.useState(!1),[l,c]=i.useState(!1),[x,d]=i.useState({}),[u,m]=i.useState({}),[p,g]=i.useState(0),[v,b]=i.useState("groups"),[z,C]=i.useState(!1),[j,y]=i.useState(!1),[N,f]=i.useState(null),[R,M]=i.useState(null),q=i.useCallback(O=>{const he=ai(O);return u[he]||x[he]||x[O.id]},[x,u]);i.useEffect(()=>{(async()=>{const O=await _(),he=localStorage.getItem(ur(s));if(he)try{const oe=JSON.parse(he).map(Ci).filter(T=>!O[br(T.groupUrl)]);if(oe.length>0){r(oe);return}}catch{}A(O)})()},[s]),i.useEffect(()=>{const O=he=>{var ce;if(((ce=he.data)==null?void 0:ce.type)!=="SOCIALPILOT_FB_PROGRESS")return;const{step:re,total:oe,label:T}=he.data;M({step:re,total:oe,label:T}),re>=oe&&setTimeout(()=>M(null),1800)};return window.addEventListener("message",O),()=>window.removeEventListener("message",O)},[]);const _=async()=>{try{const{data:O}=await w.from("facebook_group_memberships").select("group_id, join_status, group_url").eq("user_id",s).in("join_status",["approved","pending"]);if(O){const he=O.reduce((oe,T)=>{if(T.join_status==="approved"||T.join_status==="pending"){oe[T.group_id]=T.join_status;const ce=br(T.group_url);ce&&(oe[ce]=T.join_status)}return oe},{}),re=O.reduce((oe,T)=>{const ce=br(T.group_url);return ce&&(T.join_status==="approved"||T.join_status==="pending")&&(oe[ce]=T.join_status),oe},{});return d(he),m(re),g(O.filter(oe=>oe.join_status==="approved"||oe.join_status==="pending").length),re}}catch{}return{}},A=async O=>{n(!0),c(!0),r([]);try{const{data:{session:he}}=await w.auth.getSession();if(!he){k.error("Please log in to load suggestions");return}const{data:re,error:oe}=await w.functions.invoke("suggest-facebook-groups",{headers:{Authorization:`Bearer ${he.access_token}`}});if(oe)throw oe;if(re!=null&&re.facebookGroups){const T=O||u,ce=re.facebookGroups.map(Ci).filter(K=>{const ue=br(K.groupUrl);return!ue||!T[ue]});if(ce.length===0){localStorage.removeItem(ur(s)),r([]);return}let le=[],F=!1;try{le=await new Promise((K,ue)=>{let me=setTimeout(Q,12e4);const Ie=setTimeout(()=>{ne(),ue(new Error("Facebook verification timed out"))},48e4);function Q(){ne(),ue(new Error("Facebook verification timed out"))}const ne=()=>{clearTimeout(me),clearTimeout(Ie),window.removeEventListener("message",xe),window.removeEventListener("message",E),window.removeEventListener("message",ee)},ke=()=>{clearTimeout(me),me=setTimeout(Q,12e4)},ee=ve=>{var S;((S=ve.data)==null?void 0:S.type)==="SOCIALPILOT_FB_PROGRESS"&&ke()},E=ve=>{var S,J,je;((S=ve.data)==null?void 0:S.type)==="SOCIALPILOT_RUNTIME_ERROR"&&((J=ve.data)==null?void 0:J.context)==="VERIFY_FACEBOOK_GROUPS"&&(ne(),ue(new Error(((je=ve.data)==null?void 0:je.error)||"Extension verification failed")))},xe=ve=>{var S,J,je;if(((S=ve.data)==null?void 0:S.type)==="SOCIALPILOT_VERIFY_FACEBOOK_GROUPS_RESPONSE"){if(ne(),(J=ve.data)!=null&&J.error){ue(new Error(ve.data.error));return}K(((je=ve.data)==null?void 0:je.groups)||[])}};window.addEventListener("message",xe),window.addEventListener("message",E),window.addEventListener("message",ee),window.postMessage({type:"SOCIALPILOT_VERIFY_FACEBOOK_GROUPS",groups:ce},"*")})}catch(K){F=!0;const ue=String((K==null?void 0:K.message)||"");/context invalidated/i.test(ue)?k.error("Extension was updated. Please refresh this page to re-verify groups."):k.message("Showing AI suggestions (extension verification skipped)")}if(F){r([]),localStorage.removeItem(ur(s));return}const L=Wp(ce,le);r(L),L.length>0?localStorage.setItem(ur(s),JSON.stringify(L)):localStorage.removeItem(ur(s))}}catch{localStorage.removeItem(ur(s)),r([]),k.error("Failed to load group suggestions")}finally{n(!1),c(!1)}},B=async O=>{try{f(O.id);const he=await new Promise((L,K)=>{const ue=setTimeout(()=>{Ne(),K(new Error("Facebook join request timed out"))},45e3),Ne=()=>{clearTimeout(ue),window.removeEventListener("message",me),window.removeEventListener("message",fe)},fe=Ie=>{var Q,ne,ke;((Q=Ie.data)==null?void 0:Q.type)==="SOCIALPILOT_RUNTIME_ERROR"&&((ne=Ie.data)==null?void 0:ne.context)==="JOIN_FACEBOOK_GROUP"&&(Ne(),K(new Error(((ke=Ie.data)==null?void 0:ke.error)||"Extension join failed")))},me=Ie=>{var Q;((Q=Ie.data)==null?void 0:Q.type)==="SOCIALPILOT_JOIN_FACEBOOK_GROUP_RESPONSE"&&(Ne(),L(Ie.data))};window.addEventListener("message",me),window.addEventListener("message",fe),window.postMessage({type:"SOCIALPILOT_JOIN_FACEBOOK_GROUP",group:O},"*")});if(he!=null&&he.error||!(he!=null&&he.success))throw new Error((he==null?void 0:he.error)||"Facebook join failed");const re=he.status==="joined"||he.status==="already_joined"?"approved":"pending",oe=he.status==="manual_required",{error:T}=await w.rpc("save_facebook_group_membership",{p_group_id:ai(O),p_group_name:O.name,p_group_url:O.groupUrl,p_join_status:re,p_member_count:he.memberCount??O.memberCount??null,p_activity_level:he.activityLevel||O.activityLevel||"unknown",p_privacy_level:he.privacyLabel||O.privacyLabel||"public"});if(T)throw T;const ce=x[O.id],le=ai(O);d(L=>({...L,[O.id]:re,[le]:re}));const F=br(O.groupUrl);F&&m(L=>({...L,[F]:re})),g(L=>ce===re?L:ce==="approved"&&re!=="approved"?Math.max(0,L-1):ce!=="approved"&&re==="approved"?L+1:L),r(L=>L.map(K=>
28{if(K.id!==O.id)return K;const ue=he.memberCount??K.memberCount;return{...K,memberCount:ue,memberEstimate:ue?Ki(ue):K.memberEstimate,privacyLabel:he.privacyLabel||K.privacyLabel,activityLevel:he.activityLevel||K.activityLevel}})),oe?k.message(`Finish joining "${O.name}" in the opened tab`,{description:"Facebook took too long to load in the background â I opened the group for you. Click Join there and the status will update on the next refresh."}):re==="approved"?k.success(`Joined "${O.name}"`,{description:`${Math.max(0,Yt-(p+(ce==="approved"?0:1)))} more groups needed to unlock discovery`}):k.success(`Join request sent for "${O.name}"`,{description:he.status==="questions_required"?"Facebook opened the membership flow. Finish any required questions in the opened tab.":"Facebook marked this group as pending approval."})}catch{k.error("Could not join the Facebook group automatically",{description:"I opened the group for you â please finish the join flow in that tab if Facebook requires extra confirmation."}),Ha(O.groupUrl)}finally{f(null)}},[P,I]=i.useState(!1),$=async()=>{const O=Yt-p;if(O<=0)return;const he=a.filter(re=>!q(re)).slice(0,Math.min(8,O));if(he.length===0){k.info("No new groups to join from the current suggestions");return}I(!0);try{for(const re of he)await B(re)}finally{I(!1)}},be=p>=Yt,Y=i.useCallback(async()=>{if(!be){k.error(`Join at least ${Yt} groups first`,{description:`You've joined ${p}. Need ${Yt-p} more.`});return}C(!0);try{const{data:{session:O}}=await w.auth.getSession();if(!O)return;const{data:he}=await w.from("platform_preferences").select("keywords").eq("user_id",s).eq("platform","facebook").maybeSingle(),re=(he==null?void 0:he.keywords)||[];Dt("discover-posts-facebook-extension","HYBRID",{userId:s,keywordsCount:re.length});const oe=await new Promise(le=>{const F=setTimeout(()=>le({postsFound:0,timedOut:!0}),12e4),L=ue=>{var Ne,fe;((Ne=ue.data)==null?void 0:Ne.type)==="SOCIALPILOT_RUNTIME_ERROR"&&(clearTimeout(F),window.removeEventListener("message",K),window.removeEventListener("message",L),le({postsFound:0,error:((fe=ue.data)==null?void 0:fe.error)||"Extension error"}))},K=ue=>{var Ne;((Ne=ue.data)==null?void 0:Ne.type)==="SOCIALPILOT_DISCOVER_RESPONSE"&&(clearTimeout(F),window.removeEventListener("message",K),window.removeEventListener("message",L),le(ue.data))};window.addEventListener("message",K),window.addEventListener("message",L),window.postMessage({type:"SOCIALPILOT_DISCOVER_REQUEST",platform:"facebook",keywords:re},"*")}),T=(oe==null?void 0:oe.postsFound)||0,ce=oe==null?void 0:oe.error;y(!0),T===0?ce!=null&&ce.includes("No Facebook groups")?k.error("No joined groups found by extension",{description:"Make sure you actually joined the groups on Facebook."}):ce?k.error("Facebook discovery failed",{description:ce}):k.info("No new posts found. Try different keywords or check back later."):k.success(`Discovered ${T} relevant posts from your Facebook groups!`)}catch{k.error("Discovery failed")}finally{C(!1)}},[be,p,s]);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-secondary/50 border",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex items-center justify-center w-12 h-12 rounded-full bg-primary/10",children:e.jsx(ks,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"font-semibold",children:[p," of ",Yt," Groups Joined"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:be?"You're ready to discover posts! Switch to the Discover tab.":`Join ${Yt-p} more groups to unlock post discovery`})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-32 h-2 bg-secondary rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-primary to-green-500 transition-all duration-500",style:{width:`${Math.min(100,p/Yt*100)}%`}})}),e.jsxs("span",{className:"text-sm font-medium",children:[Math.min(100,Math.round(p/Yt*100)),"%"]})]})]}),R&&e.jsxs("div",{className:"p-4 rounded-lg border border-primary/30 bg-primary/5 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(Pe,{className:"h-4 w-4 animate-spin text-primary shrink-0"}),e.jsx("p",{className:"text-sm font-medium truncate",children:R.label})]}),e.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[R.step," / ",R.total]})]}),e.jsx("div",{className:"w-full h-1.5 bg-secondary rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary transition-all duration-300",style:{width:`${Math.min(100,R.step/Math.max(1,R.total)*100)}%`}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"deSHILLER uses one hidden Facebook tab â it stays in the background and closes when finished."})]}),e.jsxs(Ct,{value:v,onValueChange:O=>b(O),className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(wt,{className:"bg-secondary/50 p-1",children:[e.jsxs(cs,{value:"groups",className:"data-[state=active]:bg-background data-[state=active]:shadow-sm gap-2",children:[e.jsx(Es,{className:"h-4 w-4"}),"Group Recommendations"]}),e.jsxs(cs,{value:"discover",disabled:!be,className:"data-[state=active]:bg-background data-[state=active]:shadow-sm gap-2",children:[!be&&e.jsx(_t,{className:"h-3.5 w-3.5"}),e.jsx(Ks,{className:"h-4 w-4"}),"Discover Posts"]}),e.jsxs(cs,{value:"engage",disabled:!be,className:"data-[state=active]:bg-background data-[state=active]:shadow-sm gap-2",children:[!be&&e.jsx(_t,{className:"h-3.5 w-3.5"}),e.jsx(St,{className:"h-4 w-4"}),"Ready to Engage"]})]}),v==="discover"&&be&&e.jsx(h,{onClick:Y,disabled:z,className:"bg-gradient-to-r from-primary to-accent hover:opacity-90 disabled:opacity-50",children:z?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"mr-2 h-4 w-4 animate-spin"}),"Discovering..."]}):e.jsxs(e.Fragment,{children:[e.jsx(es,{className:"mr-2 h-4 w-4"}),"Start Discovery"]})})]}),e.jsx(us,{value:"groups",className:"space-y-4",children:e.jsxs(U,{children:[e.jsx(Be,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs($e,{className:"flex items-center gap-2",children:[e.jsx(es,{className:"h-5 w-5 text-primary"}),"AI-Recommended Groups for Your Niche",(o||l)&&e.jsx(Pe,{className:"h-4 w-4 animate-spin ml-2"})]}),e.jsx(os,{className:"mt-1",children:l?"Verifying live group details before showing suggestions":`Join at least ${Yt} groups to unlock Facebook post discovery`})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!be&&a.length>0&&e.jsx(h,{variant:"default",size:"sm",onClick:$,disabled:P||!!N||o,children:P?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"h-4 w-4 mr-2 animate-spin"}),"Joiningâ¦"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ns,{className:"h-4 w-4 mr-2"}),"Join recommended"]})}),e.jsxs(h,{variant:"outline",size:"sm",onClick:()=>A(),disabled:o||l,children:[e.jsx(es,{className:"h-4 w-4 mr-2"}),l?"Verifying...":"Refresh"]})]})]})}),e.jsx(ye,{children:o?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(Pe,{className:"h-8 w-8 animate-spin text-primary mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Finding groups for your product..."})]}):a.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Es,{className:"h-12 w-12 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"font-medium",children:"No suggestions yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1 mb-4",children:"Open Facebook in this browser, then refresh to load verified groups with real member counts"}),e.jsxs(h,{variant:"outline",onClick:()=>A(),children:[e.jsx(es,{className:"h-4 w-4 mr-2"}),"Generate Suggestions"]})]}):e.jsx(jt,{className:"h-[500px] pr-4",children:e.jsx("div",{className:"space-y-4",children:a.map(O=>{const he=q(O),re=he==="approved",oe=he==="pending",T=N===O.id;return e.jsx("div",{className:`p-4 rounded-lg border transition-all ${he?"bg-green-500/5 border-green-500/30":"bg-card hover:bg-muted/50 border-border"}`,children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h4",{className:"font-semibold text-base truncate",children:O.name}),re&&e.jsxs(W,{className:"bg-green-600 text-white text-xs",children:[e.jsx(ys,{className:"h-3 w-3 mr-1"}),"Joined"]}),oe&&e.jsx(W,{variant:"outline",className:"text-xs",children:"Pending"})]}),e.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground mb-2",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Es,{className:"h-3.5 w-3.5"}
28),typeof O.memberCount=="number"?`${O.memberCount.toLocaleString()} members`:O.memberEstimate||"Members unknown"]}),O.privacyLabel&&e.jsx(W,{variant:"outline",className:"text-xs",children:O.privacyLabel}),O.activityLevel&&O.activityLevel!=="unknown"&&e.jsxs(W,{variant:"outline",className:"text-xs capitalize",children:[O.activityLevel," activity"]})]}),e.jsxs("p",{className:"text-sm text-foreground/80 mb-2",children:[e.jsx(tr,{className:"h-3.5 w-3.5 inline mr-1 text-amber-500"}),O.whyRelevant]}),e.jsxs("div",{className:"flex items-start gap-1.5 text-xs text-muted-foreground bg-secondary/50 p-2 rounded",children:[e.jsx(za,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-amber-500"}),e.jsx("span",{children:O.engagementTip})]})]}),e.jsx(h,{size:"sm",variant:he?"outline":"default",onClick:()=>B(O),className:re?"border-green-500/50 text-green-700":"",disabled:T,children:T?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}),"Joining..."]}):re?e.jsxs(e.Fragment,{children:[e.jsx(Ys,{className:"h-3.5 w-3.5 mr-1.5"}),"Open"]}):oe?e.jsxs(e.Fragment,{children:[e.jsx(Ys,{className:"h-3.5 w-3.5 mr-1.5"}),"Open Request"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ns,{className:"h-3.5 w-3.5 mr-1.5"}),"Join Group"]})})]})},O.id)})})})})]})}),e.jsx(us,{value:"discover",className:"space-y-4",children:be?e.jsxs(e.Fragment,{children:[e.jsx(Td,{className:"mt-2"}),e.jsx("div",{className:"p-4 bg-secondary/30 rounded-lg border border-border/50",children:e.jsx(Bn,{userId:s,platform:"facebook"})}),e.jsx(Dn,{userId:s,platform:"facebook"})]}):e.jsxs(Xt,{className:"border-amber-500/30 bg-amber-500/10",children:[e.jsx(_t,{className:"h-5 w-5 text-amber-600"}),e.jsxs(_a,{children:["Join ",Yt," Groups to Unlock"]}),e.jsxs(Qt,{children:["You need to join at least ",Yt,' Facebook groups before you can discover posts. Go to the "Group Recommendations" tab to find and join relevant groups.']})]})}),e.jsx(us,{value:"engage",className:"mt-4",children:be?e.jsx(Fn,{userId:s,platform:"facebook",onFirstComment:t}):e.jsxs(Xt,{className:"border-amber-500/30 bg-amber-500/10",children:[e.jsx(_t,{className:"h-5 w-5 text-amber-600"}),e.jsxs(_a,{children:["Join ",Yt," Groups to Unlock"]}),e.jsx(Qt,{children:"Complete the group joining requirement first."})]})})]})]})},Id=({userId:s,onSubredditsChange:t})=>{const[a,r]=i.useState([]),[o,n]=i.useState(!1),[l,c]=i.useState(new Set);i.useEffect(()=>{x(),u()},[s]),i.useEffect(()=>{if(t){const g=[...l].filter(v=>a.some(b=>b.name===v));t(g)}},[l,a]);const x=async()=>{try{const g=localStorage.getItem(`reddit_joined_${s}`);g&&c(new Set(JSON.parse(g)))}catch{}},d=g=>{try{localStorage.setItem(`reddit_joined_${s}`,JSON.stringify([...g]))}catch{}},u=async()=>{n(!0);try{const{data:{session:g}}=await w.auth.getSession();if(!g){k.error("Please log in to load suggestions");return}const v=[...l],{data:b,error:z}=await w.functions.invoke("suggest-facebook-groups",{headers:{Authorization:`Bearer ${g.access_token}`},body:{excludeSubreddits:v}});if(z)throw z;if(b!=null&&b.subreddits){const C=b.subreddits.filter(j=>!l.has(j.name));r(C)}}catch{k.error("Failed to load subreddit suggestions")}finally{n(!1)}},m=g=>{window.open(g.url,"_blank");const v=new Set(l);v.add(g.name),c(v),d(v),k.success(`Marked "r/${g.name}" as joined`,{description:"Make sure to click 'Join' on Reddit!"})},p=[...l].filter(g=>a.some(v=>v.name===g)).length;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Xt,{className:"border-orange-500/30 bg-gradient-to-r from-orange-500/10 to-red-500/10",children:[e.jsx(Wa,{className:"h-5 w-5 text-orange-600"}),e.jsxs(_a,{className:"text-lg font-semibold text-orange-700 flex items-center gap-2",children:["Subreddits = Ultimate Intent-Based Engagement",e.jsx(W,{className:"bg-orange-600 text-white",children:"HIGH INTENT"})]}),e.jsxs(Qt,{className:"text-orange-800/80 mt-2",children:[e.jsxs("p",{className:"mb-2",children:["Reddit users actively ",e.jsx("strong",{children:"ask for recommendations"})," and ",e.jsx("strong",{children:"share honest opinions"}),". Perfect for establishing expertise and driving qualified traffic."]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm font-medium",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ys,{className:"h-4 w-4"})," Genuine Q&A format"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ys,{className:"h-4 w-4"})," Problem-solution threads"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ys,{className:"h-4 w-4"})," High Google ranking"]})]})]})]}),a.length>0&&e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-secondary/50 border",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex items-center justify-center w-12 h-12 rounded-full bg-orange-500/10",children:e.jsx(ks,{className:"h-6 w-6 text-orange-600"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"font-semibold",children:[p," of ",a.length," Subreddits Joined"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:p===0?"Join these communities to find opportunities":p<a.length?"More subreddits = more conversations to engage":"Great! Now run discovery to find relevant posts"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-32 h-2 bg-secondary rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-orange-500 to-red-500 transition-all duration-500",style:{width:`${p/a.length*100}%`}})}),e.jsxs("span",{className:"text-sm font-medium",children:[Math.round(p/a.length*100),"%"]})]})]}),e.jsxs(U,{children:[e.jsx(Be,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs($e,{className:"flex items-center gap-2",children:[e.jsx(es,{className:"h-5 w-5 text-orange-500"}),"AI-Recommended Subreddits for Your Niche",o&&e.jsx(Pe,{className:"h-4 w-4 animate-spin ml-2"})]}),e.jsx(os,{className:"mt-1",children:"Communities where your target audience asks questions and seeks recommendations"})]}),e.jsxs(h,{variant:"outline",size:"sm",onClick:u,disabled:o,children:[e.jsx(es,{className:"h-4 w-4 mr-2"}),"Refresh"]})]})}),e.jsx(ye,{children:o?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(Pe,{className:"h-8 w-8 animate-spin text-orange-500 mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Finding perfect subreddits for your product..."})]}):a.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Es,{className:"h-12 w-12 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"font-medium",children:"No suggestions yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1 mb-4",children:"Set up your product profile to get personalized subreddit suggestions"}),e.jsxs(h,{variant:"outline",onClick:u,children:[e.jsx(es,{className:"h-4 w-4 mr-2"}),"Generate Suggestions"]})]}):e.jsx(jt,{className:"h-[500px] pr-4",children:e.jsx("div",{className:"space-y-4",children:a.map(g=>{const v=l.has(g.name);return e.jsx("div",{className:`p-4 rounded-lg border transition-all ${v?"bg-orange-500/5 border-orange-500/30":"bg-card hover:bg-muted/50 border-border"}`,children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsxs("h4",{className:"font-semibold text-base",children:["r/",g.name]}),v&&e.jsxs(W,{className:"bg-orange-600 text-white text-xs",children:[e.jsx(ys,{className:"h-3 w-3 mr-1"}),"Joined"]})]}),e.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground mb-2",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Es,{className:"h-3.5 w-3.5"}),"~",g.memberEstimate," members"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ms,{className:"h-3.5 w-3.5"}),g.postTypes]})]}
28),e.jsxs("p",{className:"text-sm text-foreground/80 mb-2",children:[e.jsx(tr,{className:"h-3.5 w-3.5 inline mr-1 text-amber-500"}),g.whyRelevant]}),e.jsxs("div",{className:"flex items-start gap-1.5 text-xs text-muted-foreground bg-secondary/50 p-2 rounded",children:[e.jsx(za,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-amber-500"}),e.jsx("span",{children:g.engagementTip})]})]}),e.jsx(h,{size:"sm",variant:v?"outline":"default",onClick:()=>m(g),className:v?"border-orange-500/50 text-orange-700":"bg-orange-600 hover:bg-orange-700",children:v?e.jsxs(e.Fragment,{children:[e.jsx(Ys,{className:"h-3.5 w-3.5 mr-1.5"}),"Open"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ns,{className:"h-3.5 w-3.5 mr-1.5"}),"Join Subreddit"]})})]})},g.id)})})})})]})]})},Ld=({userId:s,onFirstComment:t})=>{const a=ns(),[r,o]=i.useState("x"),[n,l]=i.useState("discover"),[c,x]=i.useState(!1),[d,u]=i.useState(!1),[m,p]=i.useState({}),[g,v]=i.useState(!0);i.useState(!1);const[b,z]=i.useState(""),[C,j]=i.useState(null),y=i.useCallback((_=1500)=>{const A=`${Date.now()}-${Math.random().toString(16).slice(2)}`;return new Promise(B=>{const P=$=>{const be=$.origin===window.location.origin||$.origin==="null",Y=$.source===window;if(!be&&!Y||!$.data||$.data.type!=="SOCIALPILOT_PONG")return;const O=$.data;if(O.nonce===A){if(window.removeEventListener("message",P),clearTimeout(I),O.authenticated===!0&&O.connectedUserId&&O.connectedUserId!==s)try{window.postMessage({type:"SOCIALPILOT_FORCE_SESSION_SYNC",userId:s},"*")}catch{}B({installed:O.installed===!0,authenticated:O.authenticated===!0})}},I=window.setTimeout(()=>{window.removeEventListener("message",P),B(null)},_);window.addEventListener("message",P),window.postMessage({type:"SOCIALPILOT_PING",nonce:A},"*")})},[s]),N=i.useCallback(async(_=5)=>{for(let A=0;A<_;A++){const B=await y(1200);if(B!=null&&B.installed)return B;await new Promise(P=>setTimeout(P,1e3))}return null},[y]);i.useEffect(()=>{let _=!1;try{document.documentElement.dataset.socialpilotBridge==="1"&&j(P=>P??{installed:!0,authenticated:!1})}catch{}const A=P=>{var be;const I=P.origin===window.location.origin||P.origin==="null",$=P.source===window;!I&&!$||((be=P.data)==null?void 0:be.type)==="SOCIALPILOT_BRIDGE_READY"&&j(Y=>Y??{installed:!0,authenticated:!1})},B=P=>{var be;const I=P.origin===window.location.origin||P.origin==="null",$=P.source===window;!I&&!$||((be=P.data)==null?void 0:be.type)==="SOCIALPILOT_EXTENSION_CONNECTED"&&j({installed:!0,authenticated:!0})};return window.addEventListener("message",A),window.addEventListener("message",B),(async()=>{const P=await N(5);if(!_)if(P)j(P);else{const I=(()=>{try{return document.documentElement.dataset.socialpilotBridge==="1"}catch{return!1}})();j(I?{installed:!0,authenticated:!1}:{installed:!1,authenticated:!1})}})(),()=>{_=!0,window.removeEventListener("message",A),window.removeEventListener("message",B)}},[N]);const f=[{id:"x",name:"X (Twitter)",icon:rt,url:"https://x.com",description:"Find and engage with conversations on X"},{id:"linkedin",name:"LinkedIn",icon:Zs,url:"https://linkedin.com",description:"Connect with professionals on LinkedIn"},{id:"reddit",name:"Reddit",icon:ms,url:"https://reddit.com",description:"Engage in Reddit communities"},{id:"facebook",name:"Facebook",icon:Wt,url:"https://facebook.com",description:"Join and engage in Facebook Groups"},{id:"quora",name:"Quora",icon:Va,url:"https://quora.com",description:"Answer questions and showcase expertise"},{id:"youtube",name:"YouTube",icon:({className:_})=>
28e.jsx("svg",{viewBox:"0 0 24 24",className:_,fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})}),url:"https://youtube.com",description:"Reply to comment threads on YouTube videos"}];i.useEffect(()=>{(async()=>{v(!0);try{const{data:A,error:B}=await w.from("browser_profiles").select("platform, status").eq("user_id",s);if(B)throw B;const P={};(A||[]).forEach(I=>{const $=I.platform==="twitter"?"x":I.platform;P[$]=I.status==="connected"}),p(P)}catch{}finally{v(!1)}})()},[s]);const R=_=>m[_]===!0,M=async()=>{var _;x(!0);try{const{data:{session:A},error:B}=await w.auth.getSession();if(B||!A){k.error("Please log in to use discovery");return}Dt("platform_preferences","SELECT",{userId:s,platform:r});const{data:P}=await w.from("platform_preferences").select("keywords").eq("user_id",s).eq("platform",r).maybeSingle(),I=(P==null?void 0:P.keywords)||[],$=r==="reddit"&&b.trim()?b.split(",").map(Y=>Y.trim().replace(/^r\//,"")).filter(Boolean):void 0,be=q(r);if(k.info(`Discovering posts on ${be}...`,{duration:3e3}),r==="x"){Dt("discover-posts-x-hybrid","HYBRID",{userId:s,platform:r,keywordsCount:I.length});const Y=new Promise(F=>{const L=setTimeout(()=>{F({postsFound:0,timedOut:!0})},9e4),K=Ne=>{var fe,me,Ie,Q;if((((fe=Ne.data)==null?void 0:fe.type)==="SOCIALPILOT_RUNTIME_ERROR"||((me=Ne.data)==null?void 0:me.type)==="SOCIALPILOT_DISCOVER_RESPONSE")&&((Ie=Ne.data)==null?void 0:Ie.type)==="SOCIALPILOT_RUNTIME_ERROR"){clearTimeout(L),window.removeEventListener("message",ue),window.removeEventListener("message",K),F({postsFound:0,error:((Q=Ne.data)==null?void 0:Q.error)||"Extension context invalidated"});return}},ue=Ne=>{var fe;((fe=Ne.data)==null?void 0:fe.type)==="SOCIALPILOT_DISCOVER_RESPONSE"&&(clearTimeout(L),window.removeEventListener("message",ue),window.removeEventListener("message",K),F(Ne.data))};window.addEventListener("message",ue),window.addEventListener("message",K),window.postMessage({type:"SOCIALPILOT_DISCOVER_REQUEST",platform:r,keywords:I},"*")}),O=w.functions.invoke("discover-posts",{body:{platform:r,keywords:I},headers:{Authorization:`Bearer ${A.access_token}`}}).then(({data:F,error:L})=>L||F!=null&&F.error?{postsDiscovered:0}:F).catch(F=>({postsDiscovered:0})),[he,re]=await Promise.all([Y,O]),oe=(he==null?void 0:he.postsFound)||0,T=he==null?void 0:he.error,ce=(re==null?void 0:re.postsDiscovered)||0,le=oe+ce;u(!0),le===0?T!=null&&T.includes("invalidated")||T!=null&&T.includes("Extension context")?k.error("Extension needs a refresh",{description:"Please refresh this page (F5) and try discovery again. The extension was recently updated.",duration:1e4}):k.info(`No new posts found on ${be}. All previously discovered posts may have already been shown. Try adding different keywords.`):k.success(`Discovered ${le} relevant posts from ${be}!`)}else{Dt("discover-posts","INVOKE",{userId:s,platform:r,keywordsCount:I.length});const{data:Y,error:O}=await w.functions.invoke("discover-posts",{body:{platform:r,keywords:I,subreddits:$},headers:{Authorization:`Bearer ${A.access_token}`}});if(O)throw O;if(Y!=null&&Y.error)throw new Error(Y.error);u(!0),Y.postsDiscovered===0?k.info(`No posts found on ${be}. Try adding more keywords in the Discovery Tags section.`):k.success(`Discovered ${Y.postsDiscovered} relevant posts from ${be}!`)}}catch(A){const B=((_=A==null?void 0:A.context)==null?void 0:_.body)||(A==null?void 0:A.body)||A,P=(B==null?void 0:B.message)||(A==null?void 0:A.message)||(A==null?void 0:A.error)||"Failed to discover posts";(B==null?void 0:B.requiresPurchase)||P.includes("Discovery limit")||P.includes("used all")?k.error("Discovery Limit Reached",{description:"You have used all free discoveries. Purchase a Discovery Pack to continue.",duration:1e4,action:{label:"Get More",onClick:()=>window.location.href="/payment?pack=discovery"}}):P.includes("credentials")||P.includes("invalid")||P.includes("expired")?k.error("Discovery failed",{description:`Make sure the extension is installed and you're logged into ${q(r)}.`,duration:8e3}):P.includes("Unauthorized")||P.includes("auth")?k.error("Authentication issue. Please try logging out and back in."):kt(A,"Post discovery")}finally{x(!1)}},q=_=>{switch(_){case"x":return"X (Twitter)";case"linkedin":return"LinkedIn";case"reddit":return"Reddit";case"facebook":return"Facebook";case"quora":return"Quora";case"youtube":return"YouTube";default:return _}};return e.jsxs("div",{className:"space-y-6 relative",children:[e.jsx("div",{className:"absolute -top-12 left-1/4 w-96 h-96 rounded-full bg-primary/10 blur-3xl pointer-events-none -z-10"}),e.jsx("div",{className:"absolute top-32 right-0 w-72 h-72 rounded-full bg-accent/10 blur-3xl pointer-events-none -z-10"}),e.jsxs(Ct,{value:r,onValueChange:_=>o(_),className:"w-full space-y-6",children:[e.jsx("div",{className:"sticky top-16 z-30 -mx-1 px-1 pt-1 pb-1",children:e.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-border/50 bg-card/70 backdrop-blur-xl shadow-[0_8px_32px_-12px_hsl(var(--primary)/0.25)]",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/[0.06] via-trans
28parent to-accent/[0.05] pointer-events-none"}),e.jsxs("div",{className:"relative flex items-start gap-4 p-5 md:p-6",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-gradient-to-br from-primary/25 to-accent/20 flex items-center justify-center border border-primary/20 shadow-md shadow-primary/10 shrink-0",children:e.jsx(Ks,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/80 font-medium",children:"Discover & Reply"}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-muted-foreground/40"}),e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-primary/80 font-medium",children:"All platforms"})]}),e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold tracking-tight text-foreground",children:"Find conversations worth replying to"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 max-w-2xl leading-relaxed",children:"Discover relevant posts across the major social networks and generate AI-personalized replies that feel human."})]})]}),e.jsx("div",{className:"relative h-px bg-gradient-to-r from-transparent via-border/60 to-transparent"}),e.jsx("div",{className:"relative px-3 md:px-4 py-3",children:e.jsx("div",{className:"overflow-x-auto -mx-1 px-1",children:e.jsx(wt,{className:"h-auto w-full bg-transparent p-0 gap-1.5 inline-flex sm:flex",children:f.map(_=>{const A=_.icon;R(_.id);const B=r===_.id;return e.jsx(cs,{value:_.id,className:"group flex-1 min-w-[140px] h-auto justify-start text-left px-3 py-2.5 rounded-xl border border-transparent data-[state=active]:border-primary/25 data-[state=active]:bg-gradient-to-br data-[state=active]:from-primary/15 data-[state=active]:to-accent/10 data-[state=active]:shadow-sm hover:border-border/50 hover:bg-card/40 transition-all",children:e.jsxs("div",{className:"flex items-center gap-2.5 w-full min-w-0",children:[e.jsx("div",{className:`h-8 w-8 rounded-lg flex items-center justify-center border shrink-0 transition-colors ${B?"bg-primary/15 border-primary/25 text-primary":"bg-muted/40 border-border/40 text-muted-foreground group-hover:text-foreground"}`,children:e.jsx(A,{className:"h-4 w-4"})}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsx("span",{className:`text-sm font-medium truncate ${B?"text-foreground":"text-foreground/80"}`,children:_.name})})})]})},_.id)})})})})]})}),e.jsx(U,{className:"border-border/50 bg-card/60 backdrop-blur-xl shadow-[0_4px_24px_-8px_hsl(var(--primary)/0.15)] rounded-2xl",children:e.jsx(ye,{className:"p-5 md:p-6",children:f.map(_=>e.jsxs(us,{value:_.id,className:"space-y-4",children:[_.id==="reddit"&&e.jsx(Id,{userId:s,onSubredditsChange:A=>z(A.join(", "))}),_.id==="linkedin"?e.jsx(_d,{userId:s,onFirstComment:t}):_.id==="facebook"?e.jsx(Ad,{userId:s,onFirstComment:t}):e.jsx(e.Fragment,{children:e.jsxs(Ct,{value:n,onValueChange:A=>l(A),className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(wt,{className:"h-9 p-1 rounded-xl bg-muted/50 border border-border/30",children:[e.jsxs(cs,{value:"discover",className:"rounded-lg data-[state=active]:bg-card data-[state=active]:shadow-sm gap-2 text-sm",children:[e.jsx(Ks,{className:"h-4 w-4"}),"Discover Posts"]}),e.jsxs(cs,{value:"engage",className:"rounded-lg data-[state=active]:bg-card data-[state=active]:shadow-sm gap-2 text-sm",children:[e.jsx(St,{className:"h-4 w-4"}),"Ready to Engage"]})]}),n==="discover"&&e.jsx(h,{"data-tour":"start-discovery",onClick:()=>M(),disabled:c,className:"bg-gradient-to-r from-primary to-accent hover:opacity-90 disabled:opacity-50",children:c?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"mr-2 h-4 w-4 animate-spin"}),"Discovering..."]}):e.jsxs(e.Fragment,{children:[e.jsx(es,{className:"mr-2 h-4 w-4"}),"Start Discovery"]})})]}),e.jsxs(us,{value:"discover",className:"mt-4 space-y-4",children:[(_.id==="x"||_.id==="reddit")&&C!==null&&!(C!=null&&C.installed)&&e.jsxs(Xt,{className:"border-yellow-500/50 bg-yellow-500/10",children:[e.jsx(Ss,{className:"h-4 w-4"}),e.jsx(_a,{children:"Extension Required for Posting"}),e.jsxs(Qt,{className:"flex items-center gap-2",children:[e.jsxs("span",{children:["Install the browser extension to post comments on ",q(_.id),"."]}),e.jsx(h,{variant:"link",size:"sm",className:"h-auto p-0 text-primary underline",onClick:()=>a("/dashboard",{state:{activeView:"settings"}}),children:"Go to Settings â Extension"})]})]}),e.jsx(Td,{className:"mt-2"}),(_.id==="x"||_.id==="quora"||_.id==="youtube")&&e.jsx("div",{className:"p-4 bg-secondary/30 rounded-lg border border-border/50",children:e.jsx(Bn,{userId:s,platform:_.id})}),e.jsx("div",{"data-tour":"discovered-posts",children:e.jsx(Dn,{userId:s,platform:_.id,onApprovedForEngagement:A=>{A==="youtube"&&l("engage")}})})]}),e.jsx(us,{value:"engage",className:"mt-4",children:e.jsx(Fn,{userId:s,platform:_.id,onFirstComment:t})})]})})]},_.id))})})]})]})},Aa=[{key:"intake",label:"Intel Briefing",icon:ln,description:"Product name & core positioning"},{key:"positioning",label:"Market Position",icon:gs,description:"Value prop & competitive edge"},{key:"audience",label:"Target Audience",icon:zi,description:"ICP & key benefits"},{key:"defense",label:"Objection Map",icon:Tt,description:"Anticipate & neutralize concerns"},{key:"voice",label:"Brand Voice",icon:ms,description:"Tone & communication style"}],zd=({userId:s,onComplete:t})=>{const[a,r]=i.useState(!1),[o,n]=i.useState(""),[l,c]=i.useState(""),[x,d]=i.useState(""),[u,m]=i.useState(""),[p,g]=i.useState(""),[v,b]=i.useState(""),[z,C]=i.useState(null),[j,y]=i.useState(""),[N,f]=i.useState(!1),[R,M]=i.useState("intake"),[q,_]=i.useState(!1);i.useEffect(()=>{A()},[s]);const A=async()=>{try{Dt("product_profiles","SELECT",{userId:s});const{data:Y,error:O}=await w.from("product_profiles").select("*").eq("user_id",s).maybeSingle();if(O)throw O;Y&&(C(Y.id),n(Y.product_name||""),c(Y.value_proposition||""),d(Y.benefits||""),m(Y.ideal_customer_profile||""),g(Y.common_objections||""),b(Y.tone_guidelines||""))}catch(Y){kt(Y,"Loading product profile",!1)}},B=async()=>{var Y;if(!j.trim()){k.error("Enter a website URL to analyze");return}f(!0);try{Dt("analyze-website","INVOKE",{url:j});const{data:O,error:he}=await w.functions.invoke("analyze-website",{body:{url:j}});if(he)throw he;if(O!=null&&O.error){O.error.includes("GROQ_API_KEY")?kt(new Error("AI service not configured. Please add GROQ_API_KEY in project settings"),"Website analysis"):k.error(O.error);return}O.productName&&n(O.productName),O.valueProposition&&c(O.valueProposition),O.benefits&&d(O.benefits),O.idealCustomerProfile&&m(O.idealCustomerProfile),O.commonObjections&&g(O.commonObjections),O.toneGuidelines&&b(O.toneGuidelines),_(!0),Ia("Strategy intel extracted from website"),M("positioning")}catch(O){(Y=O.message)!=null&&Y.includes("GROQ_API_KEY")?kt(new Error("AI service not configured. Please add GROQ_API_KEY in project settings"),"Website analysis"):kt(O,"Analyzing website")}finally{f(!1)}}
28,P=async Y=>{Y.preventDefault(),r(!0);try{const O={user_id:s,product_name:o,value_proposition:l,benefits:x,ideal_customer_profile:u,common_objections:p,tone_guidelines:v,updated_at:new Date().toISOString()};if(Dt("product_profiles",z?"UPDATE":"INSERT",{userId:s,productName:o}),z){const{error:he}=await w.from("product_profiles").update(O).eq("id",z);if(he)throw he;Ia("Strategy profile updated")}else{const{data:he,error:re}=await w.from("product_profiles").insert([O]).select().single();if(re)throw re;C(he.id),Ia("Strategy profile created")}t&&setTimeout(()=>t(),500)}catch(O){kt(O,"Saving strategy profile")}finally{r(!1)}},I=Y=>{switch(Y){case"intake":return!!o.trim();case"positioning":return!!l.trim();case"audience":return!!x.trim()&&!!u.trim();case"defense":return!!p.trim();case"voice":return!!v.trim()}},$=Aa.filter(Y=>I(Y.key)).length,be=()=>{const Y=Aa.findIndex(O=>O.key===R);Y<Aa.length-1&&M(Aa[Y+1].key)};return e.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[e.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-border/50 bg-gradient-to-br from-card via-card to-secondary/20 p-8 md:p-10",children:[e.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-primary/5 rounded-full blur-3xl -translate-y-1/2 translate-x-1/2"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-48 h-48 bg-accent/5 rounded-full blur-3xl translate-y-1/2 -translate-x-1/2"}),e.jsxs("div",{className:"relative z-10",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-xl bg-primary/10 border border-primary/20",children:e.jsx(ln,{className:"w-5 h-5 text-primary"})}),e.jsx(W,{variant:"outline",className:"border-primary/30 text-primary font-mono text-xs tracking-wider uppercase",children:"CMO Strategist"})]}),e.jsx("h2",{className:"font-display text-3xl md:text-4xl font-semibold text-foreground mb-2",children:"Go-to-Market Intelligence"}),e.jsx("p",{className:"text-muted-foreground text-lg max-w-2xl",children:"Build the strategic foundation that powers every reply, outreach, and discovery. The sharper this brief, the better your AI performs."}),e.jsxs("div",{className:"mt-6 flex items-center gap-3",children:[e.jsx("div",{className:"flex gap-1.5",children:Aa.map(Y=>e.jsx("div",{className:Z("h-1.5 w-10 rounded-full transition-all duration-500",I(Y.key)?"bg-primary":"bg-border")},Y.key))}),e.jsxs("span",{className:"text-sm text-muted-foreground font-mono",children:[$,"/",Aa.length]})]})]})]}),e.jsxs("div",{className:"rounded-2xl border border-primary/20 bg-gradient-to-r from-primary/[0.03] via-card to-accent/[0.03] p-6 md:p-8",children:[e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("div",{className:"flex items-center justify-center w-12 h-12 rounded-xl bg-gradient-to-br from-primary/20 to-accent/20 border border-primary/10 shrink-0",children:e.jsx(bt,{className:"w-6 h-6 text-primary"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-display text-xl font-semibold text-foreground",children:"Instant Website Analysis"}),e.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Drop your URL and let the strategist extract your positioning, audience, and competitive angles automatically."})]}),q&&e.jsxs(W,{className:"bg-accent/10 text-accent border-accent/20 ml-auto shrink-0",children:[e.jsx(bs,{className:"w-3 h-3 mr-1"})," Analyzed"]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(Je,{type:"url",value:j,onChange:Y=>y(Y.target.value),placeholder:"yourcompany.com",className:"flex-1 h-12 bg-background/50 border-border/50 text-base",disabled:N,onKeyDown:Y=>Y.key==="Enter"&&B()}),e.jsx(h,{type:"button",onClick:B,disabled:N||!j.trim(),className:"h-12 px-6 bg-gradient-to-r from-primary to-primary/80 hover:opacity-90 transition-opacity text-primary-foreground font-semibold",children:N?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Pe,{className:"w-4 h-4 animate-spin"}),"Analyzing..."]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(es,{className:"w-4 h-4"}),"Analyze"]})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[260px_1fr] gap-6",children:[e.jsx("nav",{className:"space-y-1.5",children:Aa.map(Y=>{const O=Y.icon,he=R===Y.key,re=I(Y.key);return e.jsxs("button",{onClick:()=>M(Y.key),className:Z("w-full flex items-center gap-3 px-4 py-3.5 rounded-xl text-left transition-all duration-200 group",he?"bg-primary/10 border border-primary/20":"hover:bg-muted/50 border border-transparent"),children:[e.jsx("div",{className:Z("flex items-center justify-center w-9 h-9 rounded-lg shrink-0 transition-colors",re?"bg-primary/15 text-primary":he?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:re?e.jsx(bs,{className:"w-4 h-4"}):e.jsx(O,{className:"w-4 h-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:Z("text-sm font-semibold truncate",he?"text-foreground":"text-muted-foreground group-hover:text-foreground"),children:Y.label}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:Y.description})]}),he&&e.jsx($t,{className:"w-4 h-4 text-primary ml-auto shrink-0"})]},Y.key)})}),e.jsx("form",{onSubmit:P,children:e.jsxs("div",{className:"rounded-2xl border border-border/50 bg-card/50 backdrop-blur-sm p-6 md:p-8 min-h-[420px] flex flex-col",children:[R==="intake"&&e.jsx(_r,{title:"Intel Briefing",subt
28itle:"Start with the basics. What are we working with?",icon:ln,children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"product-name",className:"text-foreground font-semibold",children:"Product or Service Name"}),e.jsx(Je,{id:"product-name",value:o,onChange:Y=>n(Y.target.value),placeholder:"e.g., Acme Analytics",required:!0,className:"h-12 text-base bg-background/50"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This anchors all generated replies and outreach messaging."})]})}),R==="positioning"&&e.jsx(_r,{title:"Market Position",subtitle:"Define your competitive edge. What makes you the clear choice?",icon:gs,children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"value-prop",className:"text-foreground font-semibold",children:"Value Proposition"}),e.jsx(Vs,{id:"value-prop",value:l,onChange:Y=>c(Y.target.value),placeholder:"What problem do you solve better than anyone else? What's the outcome your customers get?",rows:5,required:!0,className:"text-base bg-background/50 resize-none"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The sharper this is, the more persuasive your AI-generated replies become."})]})}),R==="audience"&&e.jsx(_r,{title:"Target Audience",subtitle:"Who are we reaching? The more specific, the higher the conversion.",icon:zi,children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"ideal-customer",className:"text-foreground font-semibold",children:"Ideal Customer Profile"}),e.jsx(Vs,{id:"ideal-customer",value:u,onChange:Y=>m(Y.target.value),placeholder:"Job titles, company size, industry, pain points, buying triggers...",rows:4,required:!0,className:"text-base bg-background/50 resize-none"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"benefits",className:"text-foreground font-semibold",children:"Key Benefits"}),e.jsx(Vs,{id:"benefits",value:x,onChange:Y=>d(Y.target.value),placeholder:"List the outcomes that matter most to your ICP (one per line)",rows:4,required:!0,className:"text-base bg-background/50 resize-none"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"These get woven into engagement replies to make them feel relevant, not generic."})]})]})}),R==="defense"&&e.jsx(_r,{title:"Objection Map",subtitle:"Anticipate resistance. What holds prospects back from converting?",icon:Tt,children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"objections",className:"text-foreground font-semibold",children:"Common Objections & Concerns"}),e.jsx(Vs,{id:"objections",value:p,onChange:Y=>g(Y.target.value),placeholder:"Price concerns, switching costs, trust issues, feature gaps, competitor comparisons...",rows:5,className:"text-base bg-background/50 resize-none"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Knowing objections lets the AI address concerns subtly instead of ignoring them."})]})}),R==="voice"&&e.jsx(_r,{title:"Brand Voice",subtitle:"How should your outreach sound? Set the tone for every interaction.",icon:ms,children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"tone",className:"text-foreground font-semibold",children:"Tone & Voice Guidelines"}),e.jsx(Vs,{id:"tone",value:v,onChange:Y=>b(Y.target.value),placeholder:"e.g., Direct and data-driven. Confident but not arrogant. Use short sentences. Avoid jargon. Sound like a smart peer, not a salesperson.",rows:5,className:"text-base bg-background/50 resize-none"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This shapes every reply and cold message the AI generates on your behalf."})]})}),e.jsx("div",{className:"mt-auto pt-6 flex items-center justify-between border-t border-border/30",children:R!=="voice"?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Aa.findIndex(Y=>Y.key===R)+1," of ",Aa.length]}),e.jsxs(h,{type:"button",onClick:be,variant:"ghost",className:"text-primary hover:text-primary hover:bg-primary/10",children:["Next phase ",e.jsx(Ns,{className:"w-4 h-4 ml-1"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"All phases reviewed â ready to deploy."}),e.jsx(h,{type:"submit",className:"h-11 px-8 bg-gradient-to-r from-primary to-primary/80 hover:opacity-90 transition-opacity text-primary-foreground font-semibold",disabled:a||!o.trim(),children:a?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Pe,{className:"w-4 h-4 animate-spin"}),"Deploying..."]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ws,{className:"w-4 h-4"}),z?"Update Strategy":"Deploy Strategy"]}
28)})]})})]})})]})]})};function _r({title:s,subtitle:t,icon:a,children:r}){return e.jsxs("div",{className:"animate-fade-in space-y-6 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-xl bg-primary/10 border border-primary/20",children:e.jsx(a,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-display text-xl font-semibold text-foreground",children:s}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t})]})]}),r]})}const Ed=({userId:s,onComplete:t})=>{i.useState(!1);const[a,r]=i.useState([]),[o,n]=i.useState(!1),[l,c]=i.useState({});i.useEffect(()=>{x()},[s]);const x=async()=>{try{Dt("media_library","SELECT",{userId:s});const m=await La(async()=>{const{data:g,error:v}=await w.from("media_library").select("*").eq("user_id",s).order("created_at",{ascending:!1});if(v)throw v;return g||[]},{context:"Loading media"});r(m);const p={};for(const g of m){const{data:v}=await w.storage.from("product-media").createSignedUrl(g.file_url,3600);v!=null&&v.signedUrl&&(p[g.id]=v.signedUrl)}c(p)}catch(m){kt(m,"Loading media files",!1)}},d=async m=>{if(!m.target.files||m.target.files.length===0)return;const p=m.target.files[0];n(!0);try{const g=p.name.split(".").pop(),v=`${s}/${Date.now()}.${g}`;Dt("storage/product-media","UPLOAD",{fileName:v,fileType:p.type});const{error:b}=await w.storage.from("product-media").upload(v,p);if(b)throw b;const{data:z,error:C}=await w.storage.from("product-media").createSignedUrl(v,3600);if(C)throw C;Dt("media_library","INSERT",{userId:s,fileName:p.name}),await La(async()=>{const{error:j}=await w.from("media_library").insert([{user_id:s,file_name:p.name,file_url:v,file_type:p.type}]);if(j)throw j},{context:"Saving media"}),Ia("File uploaded"),x(),t&&setTimeout(()=>t(),500)}catch(g){kt(g,"Uploading file")}finally{n(!1)}},u=async(m,p)=>{try{Dt("storage/product-media","DELETE",{filePath:p});const{error:g}=await w.storage.from("product-media").remove([p]);if(g)throw g;Dt("media_library","DELETE",{id:m}),await La(async()=>{const{error:v}=await w.from("media_library").delete().eq("id",m);if(v)throw v},{context:"Deleting media"}),Ia("File deleted"),x()}catch(g){kt(g,"Deleting file")}};return e.jsxs(U,{className:"max-w-4xl mx-auto border-border/50 bg-card/50 backdrop-blur-xl shadow-xl",children:[e.jsx(Be,{children:e.jsx($e,{className:"text-2xl font-display",children:"Media Library"})}),e.jsxs(ye,{className:"space-y-6",children:[e.jsxs("div",{className:"border-2 border-dashed border-primary/30 rounded-xl p-8 text-center bg-primary/5 hover:bg-primary/10 hover:border-primary/50 transition-all",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-primary to-accent mx-auto flex items-center justify-center mb-4 shadow-glow",children:e.jsx(An,{className:"h-8 w-8 text-white"})}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Upload screenshots and images of your product"}),e.jsx(Je,{type:"file",accept:"image/*",onChange:d,disabled:o,className:"max-w-xs mx-auto bg-background/50"})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:a.map(m=>e.jsxs("div",{className:"relative group rounded-xl overflow-hidden border border-border/50 bg-card/30 backdrop-blur-sm hover:border-primary/50 transition-all shadow-md hover:shadow-glow",children:[m.file_type.startsWith("image/")&&l[m.id]?e.jsx("img",{src:l[m.id],alt:m.file_name,className:"w-full h-40 object-cover"}):e.jsx("div",{className:"w-full h-40 flex items-center justify-center bg-muted",children:e.jsx(ga,{className:"h-12 w-12 text-muted-foreground"})}),e.jsx(h,{size:"icon",variant:"destructive",className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>u(m.id,m.file_url),children:e.jsx(zs,{className:"h-4 w-4"})}),e.jsx("div",{className:"p-2 bg-card/80 backdrop-blur-sm",children:e.jsx("p",{className:"text-xs truncate",children:m.file_name})})]},m.id))}),a.length===0&&e.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No media uploaded yet. Add screenshots and images to enhance AI replies."})]})]})},Vp=({userId:s})=>{const[t,a]=i.useState([]),[r,o]=i.useState(!0);i.useEffect(()=>{n();const d=w.channel("automation_logs_changes").on("postgres_changes",{event:"*",schema:"public",table:"automation_logs",filter:`user_id=eq.${s}`},()=>{n()}).subscribe();return()=>{w.removeChannel(d)}},[s]);const n=async()=>{try{const{data:d,error:u}=await w.from("automation_logs").select("*").eq("user_id",s).order("created_at",{ascending:!1}).limit(50);if(u)throw u;a(d||[])}catch{k.error("Failed to load automation logs")}finally{o(!1)}},l=d=>{switch(d){case"success":return e.jsx(Ve,{className:"h-4 w-4 text-green-500"});case"error":return e.jsx(Rt,{className:"h-4 w-4 text-red-500"});
28case"pending":return e.jsx(Cs,{className:"h-4 w-4 text-yellow-500"});default:return e.jsx(Nt,{className:"h-4 w-4"})}},c=d=>{switch(d){case"success":return"bg-green-500/10 text-green-500 border-green-500/20";case"error":return"bg-red-500/10 text-red-500 border-red-500/20";case"pending":return"bg-yellow-500/10 text-yellow-500 border-yellow-500/20";default:return"bg-muted text-muted-foreground"}},x=d=>({discover:"Post Discovery",reply:"Posted Reply",like:"Liked Post",like_and_reply:"Liked & Replied",approve:"Approved Post",reject:"Rejected Post"})[d]||d;return r?e.jsx(U,{className:"border-border/50 bg-card/30 backdrop-blur-sm shadow-lg",children:e.jsxs(ye,{className:"p-8 text-center",children:[e.jsxs("div",{className:"relative w-12 h-12 mx-auto mb-4",children:[e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary/20"}),e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary border-t-transparent animate-spin"})]}),e.jsx("p",{className:"text-muted-foreground",children:"Loading automation logs..."})]})}):e.jsxs(U,{className:"border-border/50 bg-card/30 backdrop-blur-sm shadow-lg",children:[e.jsxs(Be,{children:[e.jsxs($e,{className:"flex items-center gap-2 font-display",children:[e.jsx(Nt,{className:"h-5 w-5"}),"Automation Logs"]}),e.jsx(os,{children:"Track all automation activities and their status"})]}),e.jsx(ye,{children:t.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No automation logs yet. Start discovering posts to see activity here."}):e.jsx(jt,{className:"h-[400px] pr-4",children:e.jsx("div",{className:"space-y-3",children:t.map(d=>{const u=d.details,m=(u==null?void 0:u.post_url)||(u==null?void 0:u.url);return e.jsxs("div",{className:"p-4 rounded-lg border border-border/50 bg-background/50 hover:bg-background/80 transition-colors",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[l(d.status),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("p",{className:"font-medium text-sm",children:x(d.action_type)}),e.jsx(W,{variant:"outline",className:"text-xs",children:d.platform.toUpperCase()}),e.jsx(W,{className:`text-xs ${c(d.status)}`,children:d.status}),m&&e.jsxs(h,{variant:"ghost",size:"sm",className:"h-5 px-1.5 text-xs gap-1",onClick:()=>window.open(m,"_blank"),children:[e.jsx(Ys,{className:"h-3 w-3"}),"View"]})]}),u&&e.jsx("p",{className:"text-xs text-muted-foreground",children:d.action_type==="discover"&&u.postsDiscovered?`Discovered ${u.postsDiscovered} posts`:d.action_type==="reply"&&u.replyLength?`Reply length: ${u.replyLength} characters`:d.action_type==="like_and_reply"?"â Liked ⢠Replied":d.action_type==="like"?"â¤ï¸ Liked":null}),d.error_message&&e.jsxs("p",{className:"text-xs text-red-500",children:["Error: ",d.error_message]})]})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:ha(new Date(d.created_at),{addSuffix:!0})})]}),m&&(d.action_type==="reply"||d.action_type==="like"||d.action_type==="like_and_reply")&&e.jsx("div",{className:"mt-3 pl-7",children:e.jsx(wd,{userId:s,platform:d.platform,postUrl:m,hasAuthor:!0,hasSnippet:!0,variant:"inline"})})]},d.id)})})})})]})},Yp=({userId:s})=>{const[t,a]=i.useState(!0),[r,o]=i.useState("instant"),[n,l]=i.useState("default"),[c,x]=i.useState({gmail:!1,outlook:!1}),[d,u]=i.useState(!0),[m,p]=i.useState(!1);i.useEffect(()=>{g(),v()},[s]);const g=async()=>{try{const[j,y]=await Promise.all([w.from("email_preferences").select("*").eq("user_id",s).maybeSingle(),w.from("profiles").select("email_provider").eq("id",s).maybeSingle()]);j.data&&(a(j.data.comment_notifications_enabled??!0),o(j.data.notification_frequency||"instant")),y.data&&y.data.email_provider&&l(y.data.email_provider)}catch{}finally{u(!1)}},v=()=>{const j=y=>{var N;((N=y.data)==null?void 0:N.type)==="DESHILLER_MAILBOX_STATUS"&&x({gmail:!!y.data.gmail,outlook:!!y.data.outlook})};window.addEventListener("message",j),window.postMessage({type:"DESHILLER_CHECK_MAILBOX_STATUS"},"*"),setTimeout(()=>window.removeEventListener("message",j),4e3)},b=j=>{const y=j==="gmail"?"https://mail.google.com/mail/u/0/#inbox":"https://outlook.live.com/mail/0/inbox";window.open(y,"_blank"),k.info(`Sign in to ${j==="gmail"?"Gmail":"Outlook"}, then click "Verify" here.`)},z=async()=>{p(!0);try{const[j,y]=await Promise.all([w.from("email_preferences").update({comment_notifications_enabled:t,notification_frequency:r,updated_at:new Date().toISOString()}).eq("user_id",s),w.from("profiles").update({email_provider:n}).eq("id",s)]);if(j.error||y.error)throw j.error||y.error;k.success("Email settings saved",{description:"Your preferences have been updated"})}catch{k.error("Failed to save settings")}finally{p(!1)}};if(d)return e.jsx(U,{className:"bg-card/50 backdrop-blur-sm border-border/50",children:e.jsx(ye,{className:"p-8 flex items-center justify-center",children:e.jsx("div",{className:"w-8 h-8 rounded-full border-4 border-primary/20 border-t-primary animate-spin"})})});const C=[{value:"default",label:"Default sender",desc:"Quick start. Sent from a shared deSHILLER address.",icon:ex},{value:"custom_domain",label:"Custom domain",desc:"Configure DNS so emails come from your own domain.",icon:bt,badge:"Branded"},{value:"extension_gmail",label:"Connect Gmail (via extension)",desc:"Sends from your real Gmail. No DNS, best deliverability.",icon:pa,badge:"Recommended",connected:c.gmail},{value:"extension_outlook",label:"Connect Outlook (via extension)",desc:"Sends from your real Outlook. No DNS, best deliverability.",icon:pa,connected:c.outlook}];return e.jsxs("div",{className:"space-y-4",children:[e.jsxs(U,{className:"bg-card/50 backdrop-blur-sm border-border/50",children:[e.jsx(Be,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(Fs,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx($e,{children:"Outreach Sender"}),e.jsx(os,{children:"Choose where cold emails and follow-ups are sent from. Your work email gets the best replies."})]})]})}),e.jsxs(ye,{className:"space-y-3",children:[C.map(j=>{const y=j.value.startsWith("extension_"),N=n===j.value,f=y&&!j.connected;return e.jsx("button",{type:"button",onClick:()=>
28l(j.value),className:`w-full text-left p-4 rounded-lg border transition-all ${N?"border-primary/50 bg-primary/5 ring-1 ring-primary/20":"border-border/50 bg-background/50 hover:border-border"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center shrink-0 ${N?"bg-primary/15":"bg-muted/40"}`,children:e.jsx(j.icon,{className:`h-4 w-4 ${N?"text-primary":"text-muted-foreground"}`})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("p",{className:"font-medium text-sm",children:j.label}),j.badge&&e.jsx(W,{variant:"outline",className:"text-[10px] h-4 border-accent/30 text-accent",children:j.badge}),y&&(j.connected?e.jsxs(W,{variant:"outline",className:"text-[10px] h-4 border-accent/30 text-accent gap-0.5",children:[e.jsx(Ve,{className:"h-2.5 w-2.5"})," Signed in"]}):e.jsx(W,{variant:"outline",className:"text-[10px] h-4 border-border/40 text-muted-foreground",children:"Not signed in"}))]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:j.desc}),N&&f&&e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[e.jsxs(h,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:R=>{R.stopPropagation(),b(j.value==="extension_gmail"?"gmail":"outlook")},children:[e.jsx(Ys,{className:"h-3 w-3"})," Sign in"]}),e.jsx(h,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:R=>{R.stopPropagation(),v()},children:"Verify"})]})]})]})},j.value)}),n.startsWith("extension_")&&e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-amber-500/5 border border-amber-500/20 text-xs",children:[e.jsx(Ss,{className:"h-3.5 w-3.5 text-amber-500 mt-0.5 shrink-0"}),e.jsx("p",{className:"text-muted-foreground",children:"Requires the deSHILLER browser extension. Emails are queued and sent the next time you have your mailbox open in this browser."})]})]})]}),e.jsxs(U,{className:"bg-card/50 backdrop-blur-sm border-border/50",children:[e.jsxs(Be,{children:[e.jsx($e,{className:"text-base",children:"Email Notifications"}),e.jsx(os,{children:"How often we email you about your activity."})]}),e.jsxs(ye,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-background/50 border border-border/50",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ce,{htmlFor:"email-enabled",className:"text-base font-medium",children:"Email Notifications"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Receive emails about replies and discoveries"})]}),e.jsx(Js,{id:"email-enabled",checked:t,onCheckedChange:a})]}),t&&e.jsxs("div",{className:"space-y-3 p-4 rounded-lg bg-background/50 border border-border/50",children:[e.jsx(Ce,{htmlFor:"frequency",className:"text-base font-medium",children:"Frequency"}),e.jsxs(Gs,{value:r,onValueChange:o,children:[e.jsx(qs,{id:"frequency",children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"instant",children:"Instant"}),e.jsx(Te,{value:"daily",children:"Daily Digest"}),e.jsx(Te,{value:"weekly",children:"Weekly Summary"})]})]})]}),e.jsx(h,{onClick:z,disabled:m,className:"w-full bg-gradient-to-r from-primary to-accent hover:shadow-glow",children:m?"Saving...":"Save Preferences"})]})]})]})},Kp=({userId:s})=>{const[t,a]=i.useState(!0),[r,o]=i.useState(!1),[n,l]=i.useState({dashboard_layout:"default",theme_mode:"system",primary_color:"violet",font_size:"medium",compact_mode:!1,show_welcome_message:!0}),[c,x]=i.useState({comment_notifications_enabled:!0,notification_frequency:"instant"});i.useEffect(()=>{d()},[s]);const d=async()=>{try{const{data:m,error:p}=await w.from("user_preferences").select("*").eq("user_id",s).maybeSingle();if(p)throw p;m&&l({dashboard_layout:m.dashboard_layout,theme_mode:m.theme_mode,primary_color:m.primary_color,font_size:m.font_size,compact_mode:m.compact_mode,show_welcome_message:m.show_welcome_message});const{data:g,error:v}=await w.from("email_preferences").select("*").eq("user_id",s).maybeSingle();if(v)throw v;g&&x({comment_notifications_enabled:g.comment_notifications_enabled??!0,notification_frequency:g.notification_frequency??"instant"})}catch{k.error("Failed to load preferences")}finally{a(!1)}},u=async()=>{o(!0);try{const{error:m}=await w.from("user_preferences").upsert({user_id:s,...n});if(m)throw m;const{error:p}=await w.from("email_preferences").upsert({user_id:s,...c});if(p)throw p;k.success("Preferences saved")}catch{k.error("Failed to save preferences")}finally{o(!1)}};return t?e.jsx("div",{className:"flex items-center justify-center p-12",children:e.jsx(Pe,{className:"h-8 w-8 animate-spin text-primary"})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-display font-semibold",children:"User Preferences"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Customize your dashboard, notifications, and theme"})]}),e.jsxs(Ct,{defaultValue:"layout",className:"space-y-6",children:[e.jsxs(wt,{className:"grid w-full grid-cols-3",children:[e.jsxs(cs,{value:"layout",className:"gap-2",children:[e.jsx(cn,{className:"h-4 w-4"}),"Dashboard"]}),e.jsxs(cs,{value:"notifications",className:"gap-2",children:[e.jsx($a,{className:"h-4 w-4"}),"Notifications"]}),e.jsxs(cs,{value:"theme",className:"gap-2",children:[e.jsx(In,{className:"h-4 w-4"}),"Theme"]})]}),e.jsx(us,{value:"layout",className:"space-y-4",children:e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Dashboard Layout"}),e.jsx(os,{children:"Customize how your dashboard appears"})]}),e.jsx(ye,{className:"space-y-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ce,{htmlFor:"layout-style",children:"Layout Style"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose your preferred dashboard layout"})]}),e.jsxs(Gs,{value:n.dashboard_layout,onValueChange:m=>l({...n,dashboard_layout:m}),children:[e.jsx(qs,{className:"w-[180px]",children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"default",children:"Default"}),e.jsx(Te,{value:"compact",children:"Compact"}),e.jsx(Te,{value:"spacious",children:"Spacious"})]})]})]}),e.jsx(da,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ce,{htmlFor:"compact-mode",children:"Compact Mode"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Reduce spacing and padding throughout the interface"})]}),e.jsx(Js,{id:"compact-mode",checked:n.compact_mode,onCheckedChange:m=>l({...n,compact_mode:m})})]}),e.jsx(da,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ce,{htmlFor:"welcome-message",children:"Show Welcome Message"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Display a welcome message on your dashboard"})]}),e.jsx(Js,{id:"welcome-message",checked:n.show_welcome_message,onCheckedChange:m=>l({...n,show_welcome_message:m})})]})]})})]})}),e.jsx(us,{value:"notifications",className:"space-y-4",children:e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Notification Settings"}),e.jsx(os,{children:"Control how and when you receive notifications"})]}),e.jsx(ye,{className:"space-y-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ce,{htmlFor:"email-notifications",children:"Email Notifications"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Receive email updates about new comments and replies"})]}),e.jsx(Js,{id:"email-notifications",checked:c.comment_notifications_enabled,onCheckedChange:m=>x({...c,comment_notifications_enabled:m})})]}),e.jsx(da,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ce,{htmlFor:"notification-frequency",children:"Notification Frequency"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"How often should we send you notifications"})]}),e.jsxs(Gs,{value:c.notification_frequency,onValueChange:m=>x({...c,notification_frequency:m}),children:[e.jsx(qs,{className:"w-[180px]",children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"instant",children:"Instant"}),e.jsx(Te,{value:"daily",children:"Daily Digest"}),e.jsx(Te,{value:"weekly",children:"Weekly Summary"}),e.jsx(Te,{value:"never",children:"Never"})]})]})]})]})})]})}),e.jsx(us,{value:"theme",className:"space-y-4",children:e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Theme Settings"}),e.jsx(os,{children:"Customize the look and feel of your interface"})]}),e.jsx(ye,{className:"space-y-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ce,{htmlFor:"theme-mode",children:"Theme Mode"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose between light, dark, or system theme"})]}),e.jsxs(Gs,{value:n.theme_mode,onValueChange:m=>l({...n,theme_mode:m}),children:[e.jsx(qs,{className:"w-[180px]",children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"light",children:"Light"}),e.jsx(Te,{value:"dark",children:"Dark"}),e.jsx(Te,{value:"system",children:"System"})]})]})]}),e.jsx(da,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ce,{htmlFor:"primary-color",children:"Primary Color"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose your preferred accent color"})]}),e.jsxs(Gs,{value:n.primary_color,onValueChange:m=>l({...n,primary_color:m}),children:[e.jsx(qs,{className:"w-[180px]",children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"violet",children:"Violet"}),e.jsx(Te,{value:"blue",children:"Blue"}),e.jsx(Te,{value:"green",children:"Green"}),e.jsx(Te,{value:"orange",children:"Orange"}),e.jsx(Te,{value:"red",children:"Red"})]})]})]}),e.jsx(da,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ce,{htmlFor:"font-size",children:"Font Size"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Adjust the text size across the interface"})]}),e.jsxs(Gs,{value:n.font_size,onValueChange:m=>l({...n,font_size:m}),children:[e.jsx(qs,{className:"w-[180px]",children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"small",children:"Small"}),e.jsx(Te,{value:"medium",children:"Medium"}),e.jsx(Te,{value:"large",children:"Large"})]})]})]})]})})]})})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(h,{onClick:u,disabled:r,size:"lg",children:r?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Preferences"})})]})},Xp=({userId:s})=>{const[t,a]=i.useState({discovery_notifications:!0,approval_notifications:!0,error_notifications:!0,in_app_notifications:!0}),[r,o]=i.useState(!0),[n,l]=i.useState(!1);i.useEffect(()=>{c()},[s]);const c=async()=>{try{o(!0);const{data:u,error:m}=await w.from("notification_preferences").select("*").eq("user_id",s).single();if(m)if(m.code==="PGRST116")await x();else throw m;else u&&a({discovery_notifications:u.discovery_notifications,approval_notifications:u.approval_notifications,error_notifications:u.error_notifications,in_app_notifications:u.in_app_notifications})}catch{k.error("Failed to load notification preferences")}finally{o(!1)}},x=async()=>{try{const{error:u}=await w.from("notification_preferences").insert({user_id:s,discovery_notifications:!0,approval_notifications:!0,error_notifications:!0,in_app_notifications:!0});if(u)throw u}catch{}},d=async(u,m)=>{try{l(!0),a(g=>({...g,[u]:m}));const{error:p}=await w.from("notification_preferences").update({[u]:m}).eq("user_id",s);if(p)throw p;k.success("Notification preferences updated")}catch{k.error("Failed to update preferences"),c()}finally{l(!1)}};return r?e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Notification Preferences"}),e.jsx(os,{children:"Choose which events trigger notifications"})]}),e.jsx(ye,{children:e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Pe,{className:"h-8 w-8 animate-spin text-muted-foreground"})})})]}):e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsxs($e,{className:"flex items-center gap-2",children:[e.jsx($a,{className:"h-5 w-5"}),"Notification Preferences"]}),e.jsx(os,{children:"Customize which types of events trigger notifications"})]}),e.jsxs(ye,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 bg-muted/50 rounded-lg",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ce,{htmlFor:"in_app_notifications",className:"text-base font-medium",children:"In-App Notifications"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable all in-app notifications"})]}),e.jsx(Js,{id:"in_app_notifications",checked:t.in_app_notifications,onCheckedChange:u=>d("in_app_notifications",u),disabled:n})]}),e.jsx(da,{}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Notification Types"}),e.jsxs("div",{className:`flex items-center justify-between p-4 rounded-lg border border-border/50 transition-opacity ${t.in_app_notifications?""
28:"opacity-50"}`,children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 rounded-full bg-blue-500/10 text-blue-600",children:e.jsx(gs,{className:"h-4 w-4"})}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ce,{htmlFor:"discovery_notifications",className:"text-sm font-medium cursor-pointer",children:"New Post Discoveries"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Get notified when relevant posts are discovered on social platforms"})]})]}),e.jsx(Js,{id:"discovery_notifications",checked:t.discovery_notifications,onCheckedChange:u=>d("discovery_notifications",u),disabled:!t.in_app_notifications||n})]}),e.jsxs("div",{className:`flex items-center justify-between p-4 rounded-lg border border-border/50 transition-opacity ${t.in_app_notifications?"":"opacity-50"}`,children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 rounded-full bg-green-500/10 text-green-600",children:e.jsx(ys,{className:"h-4 w-4"})}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ce,{htmlFor:"approval_notifications",className:"text-sm font-medium cursor-pointer",children:"Reply Approvals"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Get notified when your replies are successfully posted"})]})]}),e.jsx(Js,{id:"approval_notifications",checked:t.approval_notifications,onCheckedChange:u=>d("approval_notifications",u),disabled:!t.in_app_notifications||n})]}),e.jsxs("div",{className:`flex items-center justify-between p-4 rounded-lg border border-border/50 transition-opacity ${t.in_app_notifications?"":"opacity-50"}`,children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 rounded-full bg-red-500/10 text-red-600",children:e.jsx(Ss,{className:"h-4 w-4"})}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ce,{htmlFor:"error_notifications",className:"text-sm font-medium cursor-pointer",children:"Errors & Issues"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Get notified when automation actions fail or encounter errors"})]})]}),e.jsx(Js,{id:"error_notifications",checked:t.error_notifications,onCheckedChange:u=>d("error_notifications",u),disabled:!t.in_app_notifications||n})]})]}),e.jsx(da,{}),e.jsx("div",{className:"text-xs text-muted-foreground",children:e.jsx("p",{children:"ð¡ Tip: You can clear individual notifications by clicking the X button, or mark all as read from the notifications menu."})})]})]})},Rd=({userId:s,onComplete:t,isSettings:a=!1})=>{const[r,o]=i.useState(""),[n,l]=i.useState(""),[c,x]=i.useState(""),[d,u]=i.useState(!1),[m,p]=i.useState(!1),[g,v]=i.useState(""),[b,z]=i.useState(!0);i.useEffect(()=>{C()},[s]);const C=async()=>{try{const{data:N}=await w.from("user_preferences").select("tone_description").eq("user_id",s).maybeSingle();N!=null&&N.tone_description&&(v(N.tone_description),x(N.tone_description))}catch{}finally{z(!1)}},j=async()=>{if(!r.trim()||!n.trim()){k.error("Please provide both example comments");return}if(r.trim().length<20||n.trim().length<20){k.error("Examples should be at least 20 characters each");return}u(!0),x("");try{const{data:N,error:f}=await w.functions.invoke("analyze-tone",{body:{examples:[r.trim(),n.trim()]}});if(f)throw f;if(N.toneDescription)x(N.toneDescription),k.success("Tone analyzed successfully");else throw new Error("No tone description returned")}catch{k.error("Failed to analyze tone. Please try again.")}finally{u(!1)}},y=async()=>{if(!c){k.error("Please analyze your examples first");return}p(!0);try{const{error:N}=await w.from("user_preferences").upsert({user_id:s,tone_of_voice:"custom",tone_description:c},{onConflict:"user_id"});if(N)throw N;a||await w.from("onboarding_progress").update({tone_selected:!0,updated_at:new Date().toISOString()}).eq("user_id",s),v(c),k.success("Tone saved"),t==null||t()}catch{k.error("Failed to save tone preference")}finally{p(!1)}};return b?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Pe,{className:"h-6 w-6 animate-spin text-primary"})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ka,{className:"h-5 w-5 text-primary"}),e.jsx("h3",{className:"text-lg font-semibold",children:"Set Your Tone of Voice"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Write 2 example comments you've made before (or would make). We'll analyze your writing style and match it for all AI-generated replies."})]}),g&&!c&&e.jsxs(Xt,{className:"bg-green-500/10 border-green-500/30",children:[e.jsx(bs,{className:"h-4 w-4 text-green-500"}),e.jsxs(Qt,{className:"text-sm",children:[e.jsx("strong",{children:"Current tone:"})," ",g]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(U,{children:e.jsxs(ye,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{variant:"outline",children:"Example 1"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"A comment you've written or would write"})]}),e.jsx(Vs,{placeholder:"e.g., Hey! Just saw your post about productivity tools - we built something similar at [Product]. Happy to chat if you want to compare notes. No pitch, just genuinely curious about your experience!",value:r,onChange:N=>o(N.target.value),className:"min-h-[100px]"}),e.jsxs("p",{className:"text-xs text-muted-foreground text-right",children:[r.length," characters"]})]})}),e.jsx(U,{children:e.jsxs(ye,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{variant:"outline",children:"Example 2"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Another comment in your natural style"})]}),e.jsx(Vs,{placeholder:"e.g., This is such a common pain point. We've been dealing with the same thing - ended up building [solution]. Would love to hear what approach you ended up taking.",value:n,onChange:N=>l(N.target.value),className:"min-h-[100px]"}),e.jsxs("p",{className:"text-xs text-muted-foreground text-right",children:[n.length," characters"]})]})})]}),e.jsx(h,{onClick:j,disabled:d||!r.trim()||!n.trim(),className:"w-full gap-2",variant:"outline",children:d?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"h-4 w-4 animate-spin"}),"Analyzing your tone..."]}):e.jsxs(e.Fragment,{children:[e.jsx(es,{className:"h-4 w-4"}),"Analyze My Tone"]})}),c&&e.jsx(U,{className:"border-primary/30 bg-primary/5",children:e.jsxs(ye,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ms,{className:"h-5 w-5 text-primary"}),e.jsx("h4",{className:"font-semibold",children:"Your Tone Profile"}),e.jsxs(W,{variant:"default",className:"gap-1",children:[e.jsx(bs,{className:"h-3 w-3"})," Analyzed"]})]}),e.jsx("p",{className:"text-sm bg-background p-3 rounded-lg border border-border/50",children:c}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"All AI-generated comments will match this tone."})]})}),e.jsxs(Xt,{className:"bg-muted/50",children:[e.jsx(zc,{className:"h-4 w-4"}),e.jsx(Qt,{className:"text-sm",children:"Your tone will be applied to all AI-generated replies across Twitter, LinkedIn, Reddit, and Facebook."})]}),e.jsx("div",{className:"flex justify-end gap-3",children:e.jsx(h,{onClick:y,disabled:!c||m,className:"gap-2",children:m?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"h-4 w-4 animate-spin"}),"Saving..."]}):a?"Save Tone":"Continue"})})]})},Qp=({userId:s,platform:t})=>{const[a,r]=i.useState(!1),[o,n]=i.useState(!1),[l,c]=i.useState(!1),[x,d]=i.useState(3),[u,m]=i.useState("contextual"),[p,g]=i.useState(""),[v,b]=i.useState([]),[z,C]=i.useState(""),[j,y]=i.useState("professional"),[N,f]=i.useState(!1),[R,M]=i.useState(!0),[q,_]=i.useState(!1);i.useEffect(()=>{A()},[s,t]);const A=async()=>{try{const{data:I,error:$}=await w.from("user_preferences").select("auto_like_enabled, reply_strategy, dm_template, auto_post_enabled, auto_post_limit, tone_of_voice").eq("user_id",s).maybeSingle();if($)throw $;if(I){r(I.auto_like_enabled||!1),c(I.auto_post_enabled||!1),d(I.auto_post_limit||3);const be=I.reply_strategy==="dm_invitation"?"dm_invitation":"contextual";m(be),g(I.dm_template||""),y(I.tone_of_voice||"professional")}if(t){const{data:be,error:Y}=await w.from("platform_preferences").select("exclude_posts_with_links, competitors").eq("user_id",s).eq("platform",t).maybeSingle();if(Y&&Y.code!=="PGRST116")throw Y;be&&(n(be.exclude_posts_with_links||!1),b(be.competitors||[]))}}catch{k.error("Failed to load engagement settings")}finally{M(!1)}},B=async()=>{_(!0);try{const{error:I}=await w.from("user_preferences").update({auto_like_enabled:a,auto_post_enabled:l,auto_post_limit:x,reply_strategy:u,dm_template:p}).eq("user_id",s);if(I)throw I;if(t){const{error:$}=await w.from("platform_preferences").upsert({user_id:s,platform:t,exclude_posts_with_links:o,competitors:v,enabled:!0},{onConflict:"user_id,platform"});if($)throw $}k.success("Engagement settings saved successfully")}catch{k.error("Failed to save engagement settings")}finally{_(!1)}};if(R)return e.jsx(U,{className:"p-6",children:e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-1/3"}),e.jsx("div",{className:"h-20 bg-muted rounded"})]})});const P={professional:"Professional",friendly:"Friendly & Casual",witty:"Witty & Engaging",empathetic:"Empathetic & Supportive",direct:"Direct & Concise"};return e.jsxs("div",{className:"space-y-6",children:[e.jsx(U,{className:"p-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-1",children:"Tone of Voice"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"All AI-generated replies will use this tone for consistent brand voice"})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-card/50",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[e.jsx(es,{className:"h-5 w-5 text-primary mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(Ce,{className:"text-base font-medium",children:"Current Tone"}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Your replies will sound ",e.jsx("span",{className:"font-medium text-foreground",children:P[j]||"Professional"})]})]})]}),e.jsxs(gt,{open:N,onOpenChange:f,children:[e.jsx(Cr,{asChild:!0,children:e.jsxs(h,{variant:"outline",className:"gap-2",children:[e.jsx(or,{className:"h-4 w-4"}),"Change Tone"]})}),e.jsxs(dt,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(mt,{children:[e.jsx(xt,{children:"Change Your Tone of Voice"}),e.jsx(Mt,{children:"Select a new tone for all AI-generated replies"})]}),e.jsx(Rd,{userId:s,isSettings:!0,onComplete:()=>{f(!1),A(),k.success("Tone updated successfully")}})]})]})]})]})}),e.jsx(U,{className:"p-6",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-1",children:"Engagement Behavior"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure how your automation interacts with posts"})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-card/50",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[e.jsx(Pa,{className:"h-5 w-5 text-primary mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(Ce,{htmlFor:"auto-like",className:"text-base font-medium cursor-pointer",children:"Automatically like posts before replying"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Builds rapport and increases visibility. Shows genuine engagement with the community."})]})]}),e.jsx(Js,{id:"auto-like",checked:a,onCheckedChange:r})]}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-card/50",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[e.jsx(Tt,{className:"h-5 w-5 text-primary mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(Ce,{htmlFor:"exclude-links",className:"text-base font-medium cursor-pointer",children:"Filter out posts containing links"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Reduces spam by excluding posts with URLs. Focuses on genuine conversations and questions."})]})]}),e.jsx(Js,{id:"exclude-links",checked:o,onCheckedChange:n})]}),e.jsxs("div",{className:"p-4 border rounded-lg bg-card/50 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ks,{className:"h-5 w-5 text-primary mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(Ce,{className:"text-base font-medium",children:"Track Competitor Mentions"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Get alerts when competitors are mentioned in discovered posts"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Je,{placeholder:"Add competitor name...",value:z,onChange:I=>C(I.target.value),onKeyDown:I=>{I.key==="Enter"&&z.trim()&&(I.preventDefault(),v.includes(z.trim())||(b([...v,z.trim()]),C("")))},className:"flex-1"}),e.jsx(h,{type:"button",variant:"secondary",onClick:()=>{z.trim()&&!v.includes(z.trim())&&(b([...v,z.trim()]),C(""))},disabled:!z.trim(),children:"Add"})]}),v.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:v.map((I,$)=>e.jsxs(W,{variant:"secondary",className:"pl-3 pr-1 py-1 flex items-center gap-1",children:[I,e.jsx("button",{onClick:()=>b(v.filter((be,Y)=>Y!==$)),className:"ml-1 hover:bg-destructive/20 rounded-full p-0.5 transition-colors",children:e.jsx(zs,{className:"h-3 w-3"})})]},$))})]})]}),e.jsxs("div",{className:"space-y-3 p-4 border-2 border-primary/20 rounded-lg bg-primary/5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ws,{className:"h-5 w-5 text-primary mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(Ce,{htmlFor:"auto-post",className:"text-base font-medium cursor-pointer",children:"Enable automatic posting"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Automatically post approved replies to platforms (requires manual approval first)"})]}),e.jsx(Js,{id:"auto-post",checked:l,onCheckedChange:c})]}),l&&e.jsxs("div",{className:"ml-8 space-y-2 pt-2",children:[e.jsx(Ce,{htmlFor:"post-limit",className:"text-sm font-medium",children:"Daily posting limit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Je,{id:"post-limit",type:"number",min:1,max:10,value:x,onChange:I=>d(Math.max(1,Math.min(10,parseInt(I.target.value)||3))),className:"w-20 bg-background/50"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"posts per day"})]}),e.jsxs("div",{className:"flex items-start gap-2 p-3 bg-amber-500/10 border border-amber-500/20 rounded text-sm",children:[e.jsx(qt,{className:"h-4 w-4 text-amber-500 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-amber-700 dark:text-amber-400",children:"Recommended: 1-3 posts/day to avoid spam detection. Higher limits may trigger platform restrictions."})]})]})]})]})}),e.jsx(U,{className:"p-6",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-1",children:"Reply Strategy"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose how your AI responds to posts and comments"})]}),e.jsx(Gr,{value:u,onValueChange:I=>m(I),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3 p-4 border rounded-lg cursor-pointer hover:bg-accent/50 transition-colors",children:[e.jsx(ba,{value:"contextual",id:"c
28ontextual",className:"mt-1"}),e.jsxs("label",{htmlFor:"contextual",className:"flex-1 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(ga,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"font-medium",children:"Contextual Reply with Screenshot"}),e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-2 py-0.5 rounded",children:"Default"})]}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-6",children:[e.jsx("li",{children:"⢠Provide full context and solution publicly"}),e.jsx("li",{children:"⢠Include product screenshots or demo links"}),e.jsx("li",{children:"⢠Best for: Brand awareness, thought leadership"})]}),e.jsxs("div",{className:"mt-3 p-3 bg-muted/50 rounded text-sm text-muted-foreground",children:[e.jsx("strong",{children:"Example:"}),` "Great question! [Context] Here's how we solve this: [screenshot/link]"`]})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-4 border rounded-lg cursor-pointer hover:bg-accent/50 transition-colors",children:[e.jsx(ba,{value:"dm_invitation",id:"dm_invitation",className:"mt-1"}),e.jsxs("label",{htmlFor:"dm_invitation",className:"flex-1 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(ms,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"font-medium",children:"DM Invitation Strategy"})]}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-6",children:[e.jsx("li",{children:"⢠Brief public reply + invitation to continue in DMs"}),e.jsx("li",{children:"⢠Automatically send follow-up DM with details"}),e.jsx("li",{children:"⢠Best for: Lead generation, personalized conversations"})]}),e.jsxs("div",{className:"mt-3 p-3 bg-muted/50 rounded text-sm text-muted-foreground",children:[e.jsx("strong",{children:"Example:"}),` "I'd love to share how we handle this! DMing you with details ð©"`]})]})]})]})}),u==="dm_invitation"&&e.jsxs("div",{className:"space-y-3 p-4 border-l-2 border-primary bg-accent/20 rounded-r-lg",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(At,{className:"h-4 w-4 text-primary"}),e.jsx(Ce,{htmlFor:"dm-template",className:"font-medium",children:"Custom DM Template"})]}),e.jsx(Vs,{id:"dm-template",value:p,onChange:I=>g(I.target.value),placeholder:"Enter your DM template...",className:"min-h-[120px] font-mono text-sm"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use ",e.jsx("code",{className:"bg-muted px-1 py-0.5 rounded",children:"[topic]"})," and"," ",e.jsx("code",{className:"bg-muted px-1 py-0.5 rounded",children:"[details]"})," as placeholders"]})]})]})}),e.jsx("div",{className:"flex justify-end",children:e.jsx(h,{onClick:B,disabled:q,size:"lg",children:q?"Saving...":"Save Engagement Settings"})})]})},zt=i.forwardRef(({className:s,value:t,...a},r)=>e.jsx(Ec,{ref:r,className:Z("relative h-4 w-full overflow-hidden rounded-full bg-secondary",s),...a,children:e.jsx(sx,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));zt.displayName=Ec.displayName;const Jp=({userId:s})=>{const[t,a]=i.useState(!0),[r,o]=i.useState(!1),[n,l]=i.useState({subscribed:!1,subscriptionEnd:null,dailyLimit:50,usedToday:0});i.useEffect(()=>{c()},[s]);const c=async()=>{try{const{data:{session:u}}=await w.auth.getSession();if(!u)return;const{data:m,error:p}=await w.functions.invoke("check-automation-subscription",{headers:{Authorization:`Bearer ${u.access_token}`}});if(p)throw p;m&&l({subscribed:m.subscribed,subscriptionEnd:m.subscriptionEnd,dailyLimit:m.dailyLimit||50,usedToday:m.usedToday||0})}catch{}finally{a(!1)}},x=async()=>{o(!0);try{const{data:{session:u}}=await w.auth.getSession();if(!u){k.error("Please log in to subscribe");return}const{data:m,error:p}=await w.functions.invoke("create-automation-checkout",{headers:{Authorization:`Bearer ${u.access_token}`}});if(p)throw p;m!=null&&m.url&&window.open(m.url,"_blank")}catch{k.error("Failed to start checkout")}finally{o(!1)}},d=n.usedToday/n.dailyLimit*100;return t?e.jsx(U,{className:"border-border/50",children:e.jsx(ye,{className:"p-8 text-center",children:e.jsx(Pe,{className:"h-8 w-8 animate-spin mx-auto text-muted-foreground"})})}):e.jsxs(U,{className:"border-border/50 bg-gradient-to-br from-card to-card/80",children:[e.jsx(Be,{children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:e.jsx(ws,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsxs($e,{className:"flex items-center gap-2",children:["Auto-Engage",n.subscribed?e.jsxs(W,{className:"bg-green-500/20 text-green-600 border-green-500/30",children:[e.jsx(Ve,{className:"h-3 w-3 mr-1"}),"Active"]}):e.jsx(W,{variant:"secondary",children:"$37/mo"})]}),e.jsx(os,{children:"Automatically comment on approved posts"})]})]})})}),e.jsx(ye,{className:"space-y-6",children:n.subscribed?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Daily Usage"}),e.jsxs("span",{className:"font-medium",children:[n.usedToday," / ",n.dailyLimit," engagements"]})]}),e.jsx(zt,{value:d,className:"h-2"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Resets daily at midnight UTC"})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[e.jsx(Cs,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium",children:"Runs every 15 minutes"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Engages with approved posts automatically"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[e.jsx(Tt,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium",children:"Rate limited to 50/day"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Keeps your accounts safe from spam detection"})]})]})]}),n.subscriptionEnd&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Renews on ",new Date(n.subscriptionEnd).toLocaleDateString()]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Let AI handle your social engagement while you focus on what matters. Auto-Engage posts comments on your behalf using your approved posts queue."}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[e.jsx(ws,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"text-sm",children:"Up to 50 automated engagements per day"})]}),e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[e.jsx(Cs,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"text-sm",children:"Runs automatically every 15 minutes"})]}),e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[e.jsx(Tt,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"text-sm",children:"Safe rate limiting to protect your accounts"})]})]})]}),e.jsx(h,{onClick:x,disabled:r,className:"w-full bg-gradient-to-r from-primary to-accent hover:opacity-90",children:r?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"h-4 w-4 mr-2 animate-spin"}),"Opening checkout..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ys,{className:"h-4 w-4 mr-2"}),"Subscribe for $37/month"]})})]})})]})},Zp=({userId:s})=>e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(qr,{className:"h-6 w-6"}),e.jsx("h2",{className:"text-2xl font-display font-bold",children:"Settings & Logs"})]}),e.jsxs(Ct,{defaultValue:"preferences",className:"w-full",children:[e.jsx("div",{className:"overflow-x-auto -mx-2 px-2 pb-2",children:e.jsxs(wt,{className:"inline-flex w-auto min-w-full md:grid md:w-full md:grid-cols-6 gap-1",children:[e.jsxs(cs,{value:"preferences",className:"gap-2 whitespace-nowrap flex-shrink-0",children:[e.jsx(tx,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Preferences"})]}),e.jsxs(cs,{value:"engagement",className:"gap-2 whitespace-nowrap flex-shrink-0",children:[e.jsx(ws,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Engagement"})]}),e.jsxs(cs,{value:"notifications",className:"gap-2 whitespace-nowrap flex-shrink-0",children:[e.jsx($a,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Notifications"})]}),e.jsxs(cs,{value:"email",className:"gap-2 whitespace-nowrap flex-shrink-0",children:[e.jsx(Fs,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Email"})]}),e.jsxs(cs,{value:"extension",className:"gap-2 whitespace-nowrap flex-shrink-0",children:[e.jsx(Ra,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Extension"})]}),e.jsxs(cs,{value:"logs",className:"gap-2 whitespace-nowrap flex-shrink-0",children:[e.jsx(Nt,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Logs"})]})]})}),e.jsx(us,{value:"preferences",className:"mt-6",children:e.jsx(Kp,{userId:s})}),e.jsxs(us,{value:"engagement",className:"mt-6 space-y-6",children:[e.jsx(Jp,{userId:s}),e.jsx(Qp,{userId:s})]}),e.jsx(us,{value:"notifications",className:"mt-6",children:e.jsx(Xp,{userId:s})}),e.jsx(us,{value:"email",className:"mt-6",children:e.jsx(Yp,{userId:s})}),e.jsx(us,{value:"extension",className:"mt-6",children:e.jsx(Pn,{showCompleteButton:!1})}),e.jsx(us,{value:"logs",className:"mt-6",children:e.jsx(Vp,{userId:s})})]})]}),To=()=>{const t=Date.now()+3e3,a={startVelocity:30,spread:360,ticks:60,zIndex:9999},r=(l,c)=>Math.random()*(c-l)+l,o=["#3B82F6","#8B5CF6","#EC4899","#F59E0B"],n=setInterval(()=>{const l=t-Date.now();if(l<=0)return clearInterval(n);const c=50*(l/3e3);Gn({...a,particleCount:c,origin:{x:r(.1,.3),y:Math.random()-.2},colors:o}),Gn({...a,particleCount:c,origin:{x:r(.7,.9),y:Math.random()-.2},colors:o})},250);Gn({particleCount:100,spread:70,origin:{y:.6},colors:o,zIndex:9999})},eg=({step:s,isActive:t,isComplete:a,onClick:r})=>e.jsxs(la,{children:[e.jsx(ca,{asChild:!0,children:e.jsxs("div",{className:`flex flex-col items-center gap-2 p-4 rounded-lg transition-all cursor-pointer relative ${t?"bg-primary/10 border-2 border-primary":a?"bg-accent/10 border-2 border-accent":"bg-card border-2 border-border/50"}`,onClick:r,children:[e.jsx(zc,{className:"h-4 w-4 text-muted-foreground absolute top-2 right-2"}),a?e.jsx(Ve,{className:"h-6 w-6 text-accent"}):e.jsx(Tn,{className:"h-6 w-6 text-muted-foreground"}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"font-semibold text-sm",children:s.title}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s.description})]})]})}),e.jsx(sa,{side:"bottom",className:"max-w-xs",children:e.jsx("p",{className:"text-sm",children:s.tooltip})})]}),sg=[{number:1,title:"About Your Business",description:"What do you do?",key:"product_profile_completed",tooltip:"Share a bit about what you offer. This helps us find the right conversations for you."},{number:2,title:"Add Some Images",description:"Show off your work",key:"media_uploaded",tooltip:"Upload screenshots or images of your product. These
28can be shared in your replies to make them more compelling."},{number:3,title:"Install Extension",description:"Secure browser integration",key:"credentials_added",tooltip:"Install our browser extension to safely discover and engage with posts - no passwords shared, no risk of bans."},{number:4,title:"Your Voice",description:"Choose your tone",key:"tone_selected",tooltip:"Select how you want to sound in your replies. We'll analyze your product and show you sample responses."},{number:5,title:"Your First Reply",description:"Try it out!",key:"first_discovery_completed",tooltip:"Find a conversation and post your first reply. You've got this!"}],Ya=({user:s})=>{const t=ns(),[a,r]=i.useState(null);i.useEffect(()=>{s&&o()},[s]);const o=async()=>{if(s)try{const{data:x,error:d}=await w.from("profiles").select("full_name").eq("id",s.id).single();if(d)throw d;r(x)}catch{}},n=async()=>{await w.auth.signOut(),k.success("Signed out successfully"),t("/auth")},l=()=>{var d;return((a==null?void 0:a.full_name)||((d=s==null?void 0:s.user_metadata)==null?void 0:d.full_name)||(s==null?void 0:s.email)||"").split(" ").map(u=>u[0]).join("").toUpperCase().slice(0,2)},c=()=>{var x;return(a==null?void 0:a.full_name)||((x=s==null?void 0:s.user_metadata)==null?void 0:x.full_name)||(s==null?void 0:s.email)||"User"};return e.jsx("header",{className:"border-b border-border/40 bg-card/60 backdrop-blur-xl sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsxs("button",{onClick:()=>t(s?"/dashboard":"/"),className:"flex items-center gap-2.5 hover:opacity-80 transition-opacity",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-primary/80 font-medium hidden sm:inline",children:"Marketing OS"}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-muted-foreground/40 hidden sm:inline-block"}),e.jsx("span",{className:"font-display text-lg font-semibold tracking-tight text-foreground",children:"deSHILLER"})]}),e.jsx("div",{className:"flex items-center gap-6",children:s?e.jsxs(e.Fragment,{children:[e.jsxs("nav",{className:"hidden md:flex items-center gap-5 text-sm",children:[e.jsx("button",{onClick:()=>t("/dashboard"),className:"text-muted-foreground hover:text-foreground transition-colors relative after:content-[''] after:absolute after:w-full after:scale-x-0 after:h-0.5 after:bottom-0 after:left-0 after:bg-primary after:origin-bottom-right after:transition-transform after:duration-300 hover:after:scale-x-100 hover:after:origin-bottom-left",children:"Dashboard"}),e.jsx("button",{onClick:()=>t("/api-docs"),className:"text-muted-foreground hover:text-foreground transition-colors relative after:content-[''] after:absolute after:w-full after:scale-x-0 after:h-0.5 after:bottom-0 after:left-0 after:bg-primary after:origin-bottom-right after:transition-transform after:duration-300 hover:after:scale-x-100 hover:after:origin-bottom-left",children:"API & Agents"}),e.jsxs("button",{onClick:()=>t("/creative-studio"),className:"text-muted-foreground hover:text-foreground transition-colors relative flex items-center gap-1.5 after:content-[''] after:absolute after:w-full after:scale-x-0 after:h-0.5 after:bottom-0 after:left-0 after:bg-primary after:origin-bottom-right after:transition-transform after:duration-300 hover:after:scale-x-100 hover:after:origin-bottom-left",children:["Creative Studio",e.jsx("span",{className:"text-[10px] uppercase tracking-wider px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium",children:"Soon"})]})]}),e.jsxs(Ui,{children:[e.jsx(Wi,{asChild:!0,children:e.jsxs(h,{variant:"ghost",className:"gap-2 h-auto py-2",children:[e.jsx(Ur,{className:"h-8 w-8",children:e.jsx(Wr,{className:"bg-primary/10 text-primary text-xs",children:l()})}),e.jsx("span",{className:"text-sm font-medium hidden md:inline",children:c()}),e.jsx(nt,{className:"h-4 w-4 text-muted-foreground"})]})}),e.jsxs(Rn,{align:"end",className:"w-56 bg-card border-border/50 z-50",children:[e.jsx(id,{className:"font-normal",children:e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:c()}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.email})]})}),e.jsx(Br,{className:"bg-border/50"}),e.jsxs(Zt,{onClick:()=>
28t("/dashboard"),className:"cursor-pointer",children:[e.jsx(Ei,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Dashboard"})]}),e.jsxs(Zt,{onClick:()=>{t("/dashboard"),setTimeout(()=>{const x=document.querySelector('[data-value="settings"]');x==null||x.click()},100)},className:"cursor-pointer",children:[e.jsx(qr,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Settings"})]}),e.jsx(Br,{className:"bg-border/50"}),e.jsxs(Zt,{onClick:n,className:"cursor-pointer text-destructive",children:[e.jsx(Rc,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Sign out"})]})]})]})]}):e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(h,{variant:"ghost",onClick:()=>t("/auth"),className:"text-sm",children:"Sign in"}),e.jsx(h,{onClick:()=>t("/auth"),className:"text-sm bg-primary text-primary-foreground hover:bg-primary/90",children:"Start free trial"})]})})]})})})},tg=({userId:s,onComplete:t})=>{const[a,r]=i.useState(1),[o,n]=i.useState({product_profile_completed:!1,media_uploaded:!1,credentials_added:!1,tone_selected:!1,first_discovery_completed:!1}),[l,c]=i.useState(!0),[x,d]=i.useState(null),u=sg;i.useEffect(()=>{p(),m()},[s]);const m=async()=>{const{data:{user:y}}=await w.auth.getUser();d(y)},p=async()=>{try{let{data:y,error:N}=await w.from("onboarding_progress").select("*").eq("user_id",s).maybeSingle();if(N)throw N;if(!y){const{data:f,error:R}=await w.from("onboarding_progress").insert([{user_id:s}]).select().single();if(R)throw R;y=f}if(y){const f={product_profile_completed:y.product_profile_completed||!1,media_uploaded:y.media_uploaded||!1,credentials_added:y.credentials_added||!1,tone_selected:y.tone_selected||!1,first_discovery_completed:y.first_discovery_completed||!1};n(f);const R=u.findIndex(M=>!f[M.key]);r(R!==-1?R+1:5)}}catch{k.error("Failed to load onboarding progress")}finally{c(!1)}},g=async(y,N)=>{try{const{error:f}=await w.from("onboarding_progress").update({[y]:N,updated_at:new Date().toISOString()}).eq("user_id",s);if(f)throw f;const R={...o,[y]:N};n(R),Object.values(R).every(Boolean)&&(await w.from("onboarding_progress").update({completed_at:new Date().toISOString()}).eq("user_id",s),To(),k.success("Onboarding complete",{description:"Your account is configured and ready"}),setTimeout(()=>t(),2e3))}catch{k.error("Failed to update progress")}},v=()=>o[u[a-1].key],b=()=>{if(!v()){k.error("Please complete this step before continuing");return}a<u.length&&r(a+1)},z=()=>{a>1&&r(a-1)},C=()=>Object.values(o).filter(Boolean).length/u.length*100;if(l)return e.jsxs(e.Fragment,{children:[e.jsx(Ya,{user:x}),e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsxs("div",{className:"text-center space-y-4",children:[e.jsxs("div",{className:"relative w-16 h-16 mx-auto",children:[e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary/20"}),e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary border-t-transparent animate-spin"})]}),e.jsx("p",{className:"text-muted-foreground",children:"Loading onboarding..."})]})}),e.jsx(_s,{})]});const j=Object.values(o).every(Boolean);return e.jsxs(e.Fragment,{children:[e.jsx(Ya,{user:x}),e.jsx("div",{className:"min-h-screen bg-background py-12 px-6",children:e.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[e.jsxs("div",{className:"text-center space-y-4 animate-fade-up",children:[e.jsxs("h1",{className:"text-4xl font-display font-bold",children:["Welcome to ",e.jsx("span",{className:"text-primary",children:"DESHILLER"})]}),e.jsx("p",{className:"text-xl text-muted-foreground",children:"Let's set up your account in just a few minutes"}),e.jsx("p",{className:"text-sm text-muted-foreground/70",children:"Don't worry - you can always change these settings later"}),e.jsxs("a",{href:"https://wa.me/34711079539",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-[#25D366]/10 text-[#25D366] hover:bg-[#25D366]/20 transition-colors text-sm font-medium",children:[e.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.
28198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"})}),"Need help? Chat with us on WhatsApp"]})]}),e.jsxs("div",{className:"space-y-2 animate-fade-in",children:[e.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground mb-2",children:[e.jsxs("span",{children:["Step ",a," of ",u.length]}),e.jsxs("span",{children:[Math.round(C()),"% Complete"]})]}),e.jsx(zt,{value:C(),className:"h-3"}),e.jsxs("div",{className:"flex items-center justify-center gap-2 text-xs text-muted-foreground pt-2",children:[e.jsx(Ve,{className:"h-3.5 w-3.5 text-green-600"}),e.jsx("span",{children:"All progress is automatically saved"})]})]}),e.jsx(Ka,{children:e.jsx("div",{className:"grid grid-cols-5 gap-3",children:u.map(y=>e.jsx(eg,{step:y,isActive:a===y.number,isComplete:o[y.key],onClick:()=>r(y.number)},y.number))})}),e.jsxs(U,{className:"bg-card/50 backdrop-blur-sm border-border/50 animate-fade-in",children:[e.jsxs(Be,{children:[e.jsx($e,{className:"text-2xl",children:u[a-1].title}),e.jsx(os,{className:"text-base",children:u[a-1].description})]}),e.jsxs(ye,{className:"space-y-6",children:[a===1&&e.jsx(zd,{userId:s,onComplete:()=>{g("product_profile_completed",!0),b()}}),a===2&&e.jsx(Ed,{userId:s,onComplete:()=>{g("media_uploaded",!0),b()}}),a===3&&e.jsx(Pn,{onComplete:()=>{g("credentials_added",!0),b()},showCompleteButton:!0}),a===4&&e.jsx(Rd,{userId:s,onComplete:()=>{g("tone_selected",!0),b()}}),a===5&&e.jsx(Ld,{userId:s,onFirstComment:()=>{g("first_discovery_completed",!0)}}),e.jsxs("div",{className:"flex justify-between pt-6 border-t border-border/50",children:[e.jsxs(h,{variant:"outline",onClick:z,disabled:a===1,className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back"]}),a<u.length?e.jsxs(h,{onClick:b,disabled:!v(),className:"gap-2 bg-gradient-to-r from-primary to-accent hover:shadow-glow",children:[v()?"Next Step":"Complete This Step First",e.jsx(Ns,{className:"h-4 w-4"})]}):e.jsxs(h,{onClick:()=>{j&&(To(),t())},disabled:!j,className:"gap-2 bg-gradient-to-r from-primary to-accent hover:shadow-glow animate-pulse",children:[e.jsx(bi,{className:"h-4 w-4"}),j?"Complete Setup":"Complete All Steps First"]})]})]})]})]})}),e.jsx(_s,{})]})};function Ba({content:s,side:t="top",className:a=""}){return e.jsxs(la,{delayDuration:200,children:[e.jsx(ca,{asChild:!0,children:e.jsx("button",{type:"button",className:`inline-flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors ${a}`,"aria-label":"Help",children:e.jsx(Va,{className:"h-3.5 w-3.5"})})}),e.jsx(sa,{side:t,className:"max-w-[280px] text-xs leading-relaxed bg-popover border-border",children:e.jsx("p",{children:s})})]})}const ag=({userId:s})=>{const[t,a]=i.useState(null),[r,o]=i.useState(""),[n,l]=i.useState(!1),[c,x]=i.useState("trial"),[d,u]=i.useState(3),m=ns();i.useEffect(()=>{p()},[s]),i.useEffect(()=>{if(!t)return;const b=setInterval(()=>{const z=new Date().getTime(),j=new Date(t).getTime()-z;if(j<0){l(!0),o("Trial Expired"),clearInterval(b);return}const y=Math.floor(j/(1e3*60*60)),N=Math.floor(j%(1e3*60*60)/(1e3*60)),f=Math.floor(j%(1e3*60)/1e3);o(`${y}h ${N}m ${f}s`)},1e3);return()=>clearInterval(b)},[t]),i.useEffect(()=>{if(n&&c==="trial"){const b=setInterval(()=>{u(z=>z<=1?(clearInterval(b),m("/payment"),0):z-1)},1e3);return()=>clearInterval(b)}},[n,c,m]);const p=async()=>{try{const{data:b,error:z}=await w.from("profiles").select("trial_ends_at, subscription_status").eq("id",s).single();if(z)return;if(b&&(a(b.trial_ends_at),x(b.subscription_status||"trial"),b.trial_ends_at)){const C=new Date().getTime(),j=new Date(b.trial_ends_at).getTime();l(C>j&&b.subscription_status==="trial")}}catch{}},g=async()=>{try{const{data:b}=await w.from("profiles").select("trial_ends_at").eq("id",s).single();if(b!=null&&b.trial_ends_at)return;const{error:z}=await w.rpc("start_trial_if_needed",{p_user_id:s});if(z)return;p()}catch{}};if(i.useEffect(()=>{g()},[s]),c==="active")return null;const v=()=>{m("/payment")};return n?e.jsxs("div",{className:"bg-destructive/5 border border-destructive/20 rounded-lg p-2 sm:p-4 flex items-center gap-2 sm:gap-3 min-w-0 flex-1",children:[e.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-full bg-destructive/10 flex items-center justify-center shrink-0",children:e.jsx(Ss,{className:"h-4 w-4 sm:h-5 sm:w-5 text-destructive"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-medium text-xs sm:text-sm truncate",children:"Expired"}),e.jsxs("div",{className:"text-[10px] sm:text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(Pe,{className:"h-3 w-3 animate-spin shrink-0"}),e.jsxs("span",{className:"truncate",children:["Redirecting ",d,"s"]})]})]}),e.jsxs(h,{onClick:v,size:"sm",className:"bg-primary text-primary-foreground hover:bg-primary/90 shrink-0 h-8 px-2 sm:px-3 text-xs sm:text-sm",children:[e.jsx(Sa,{className:"h-3 w-3 sm:h-4 sm:w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Upgrade"})]})]}):e.jsxs("div",{className:"bg-primary/5 border border-primary/20 rounded-lg p-2 sm:p-4 flex items-center gap-2 sm:gap-3 min-w-0 flex-1",children:[e.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-full bg-primary/10 flex items-center justify-center shrink-0",children:e.jsx(Cs,{className:"h-4 w-4 sm:h-5 sm:w-5 text-primary"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"font-medium text-xs sm:text-sm truncate flex items-center gap-1",children:["Trial",e.jsx(Ba,{content:"Your free trial gives you full access to all features including discovery, engagement, and analytics. Upgrade anytime to continue after the trial ends."})]}),e.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground truncate",children:r})]}),e.jsxs(h,{variant:"outline",size:"sm",onClick:v,className:"border-border/50 shrink-0 h-8 px-2 sm:px-3 text-xs sm:text-sm",children:[e.jsx(Sa,{className:"h-3 w-3 sm:h-4 sm:w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Upgrade"})]})]})},rg=({isExpired:s})=>{const[t,a]=i.useState(5),r=ns();return i.useEffect(()=>{if(!s)return;const o=setInterval(()=>{a(n=>n<=1?(clearInterval(o),r("/payment"),0):n-1)},1e3);return()=>clearInterval(o)},[s,r]),s?e.jsx("div",{className:"fixed inset-0 z-50 bg-background/95 backdrop-blur-sm flex items-center justify-center",children:e.jsxs("div",{className:"max-w-md w-full mx-4 text-center space-y-6",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-destructive/10 flex items-center justify-center mx-auto",children:e.jsx(Ss,{className:"h-8 w-8 text-destructive"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-2xl font-semibold",children:"Trial Expired"}),e.jsx("p",{className:"text-muted-foreground",children:"Your 24-hour free trial has ended. Upgrade to a paid plan to continue using all features."})]}),e.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Pe,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{children:["Redirecting to payment in ",t,"s..."]})]}),e.jsxs(h,{onClick:()=>r("/payment"),size:"lg",className:"w-full",children:[e.jsx(Sa,{className:"h-4 w-4 mr-2"}),"Upgrade Now"]})]})}):null},Pd=({userId:s})=>{const[t,a]=i.useState(!0),[r,o]=i.useState("7d"),[n,l]=i.useState({current:{totalDiscovered:0,totalRepliesGenerated:0,totalRepliesPosted:0,engagementRate:0,timeSavedMinutes:0},previous:{totalDiscovered:0,totalRepliesGenerated:0,totalRepliesPosted:0,engagementRate:0,timeSavedMinutes:0},changes:{discovered:0,replied:0,suggestions:0,engagement:0,timeSaved:0}}),[c,x]=i.useState([]),[d,u]=i.useState([]),[m,p]=i.useState();i.useEffect(()=>{z()},[s,r]);const g=f=>{switch(f){case"7d":return 7;case"30d":return 30;case"90d":return 90}},v=(f,R)=>{const M=new Date;M.setDate(M.getDate()-f);const q=new Date(M);return q.setDate(q.getDate()-R),{start:q.toISOString(),end:M.toISOString()}},b=(f,R)=>R===0?f>0?100:0:(f-R)/R*100,z=async()=>{a(!0);try{const f=g(r),R=v(0,f),M=v(f,f),[q,_]=await Promise.all([w.from("discovered_posts").select("id, platform, status, generated_reply, created_at, updated_at").eq("user_id",s).gte("created_at",M.start).order("created_at",{ascending:!1}).limit(1e3),w.from("automation_logs").select("id, action_type, platform, status, created_at").eq("user_id",s).order("created_at",{ascending:!1}).limit(200)]),A=q.data||[],B=_.data||[],P=A.filter(me=>me.created_at>=R.start),I=A.filter(me=>me.created_at>=M.start&&me.created_at<R.start),$=P.length,be=P.filter(me=>me.generated_reply).length,Y=P.filter(me=>
28["commented","posted","approved"].includes(me.status)).length,O=$>0?Y/$*100:0,he=Y*8,re=I.length,oe=I.filter(me=>me.generated_reply).length,T=I.filter(me=>["commented","posted","approved"].includes(me.status)).length,ce=re>0?T/re*100:0,le=T*8;l({current:{totalDiscovered:$,totalRepliesGenerated:be,totalRepliesPosted:Y,engagementRate:O,timeSavedMinutes:he},previous:{totalDiscovered:re,totalRepliesGenerated:oe,totalRepliesPosted:T,engagementRate:ce,timeSavedMinutes:le},changes:{discovered:b($,re),replied:b(Y,T),suggestions:b(be,oe),engagement:b(O,ce),timeSaved:b(he,le)}});const L=["x","linkedin","reddit","facebook","quora","youtube"].map(me=>({platform:me,discovered:P.filter(Ie=>Ie.platform===me).length,replied:P.filter(Ie=>Ie.platform===me&&["commented","posted","approved"].includes(Ie.status)).length,prevDiscovered:I.filter(Ie=>Ie.platform===me).length,prevReplied:I.filter(Ie=>Ie.platform===me&&["commented","posted","approved"].includes(Ie.status)).length}));x(L);const K=r==="7d"?7:r==="30d"?30:12,ue=r==="90d",Ne=[];for(let me=K-1;me>=0;me--){let Ie,Q,ne;if(ue)Q=new Date,Q.setDate(Q.getDate()-me*7),Ie=new Date(Q),Ie.setDate(Ie.getDate()-7),ne=`W${K-me}`;else{const E=new Date;E.setDate(E.getDate()-me),Ie=new Date(E),Ie.setHours(0,0,0,0),Q=new Date(E),Q.setHours(23,59,59,999),ne=E.toLocaleDateString("en-US",{month:"short",day:"numeric"})}const ke=P.filter(E=>{const xe=new Date(E.created_at);return xe>=Ie&&xe<=Q}).length,ee=P.filter(E=>{const xe=new Date(E.updated_at);return["commented","posted","approved"].includes(E.status)&&xe>=Ie&&xe<=Q}).length;Ne.push({date:ne,discovered:ke,replied:ee})}u(Ne);const fe=B.slice(0,10).map(me=>({id:me.id,action:me.action_type,platform:me.platform,status:me.status,created_at:me.created_at}));p(fe)}catch{}finally{a(!1)}},C={x:"hsl(38, 92%, 50%)",linkedin:"hsl(159, 30%, 50%)",reddit:"hsl(217, 19%, 40%)",facebook:"hsl(221, 44%, 41%)",quora:"hsl(0, 65%, 48%)",youtube:"hsl(0, 100%, 50%)"};if(t)return e.jsxs("div",{className:"space-y-6",children:[e.jsx(Ip,{}),e.jsx(Ap,{})]});const j=f=>{if(f<60)return`${f} min`;const R=Math.floor(f/60),M=f%60;return M===0?`${R}h`:`${R}h ${M}m`},y=({value:f,suffix:R=""})=>{if(Math.abs(f)<.1)return e.jsxs("span",{className:"flex items-center text-muted-foreground text-[10px] sm:text-xs",children:[e.jsx(Dc,{className:"h-3 w-3 mr-0.5"}),"No change"]});const M=f>0;return e.jsxs("span",{className:`flex items-center text-[10px] sm:text-xs ${M?"text-green-500":"text-red-500"}`,children:[M?e.jsx(xn,{className:"h-3 w-3"}):e.jsx(ax,{className:"h-3 w-3"}),Math.abs(f).toFixed(1),R]})},N=r==="7d"?"vs prev 7 days":r==="30d"?"vs prev 30 days":"vs prev 90 days";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Analytics"}),e.jsxs(Gs,{value:r,onValueChange:f=>o(f),children:[e.jsx(qs,{className:"w-[140px]",children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"7d",children:"Last 7 days"}),e.jsx(Te,{value:"30d",children:"Last 30 days"}),e.jsx(Te,{value:"90d",children:"Last 90 days"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3 sm:gap-4",children:[e.jsxs(U,{className:"border-border/50",children:[e.jsxs(Be,{className:"flex flex-row items-center justify-between pb-2 space-y-0",children:[e.jsxs($e,{className:"text-xs sm:text-sm font-medium text-muted-foreground truncate pr-2 flex items-center gap-1",children:["Time Saved",e.jsx(Ba,{content:"Estimated time saved by using DESHILLER instead of manually finding and responding to posts. Based on ~8 minutes per engagement."})]}),e.jsx(Cs,{className:"h-4 w-4 text-primary shrink-0"})]}),e.jsxs(ye,{className:"pt-0",children:[e.jsx("div",{className:"text-xl sm:text-2xl lg:text-3xl font-semibold text-primary truncate",children:j(n.current.timeSavedMinutes)}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(y,{value:n.changes.timeSaved,suffix:"%"}),e.jsx("span",{className:"text-[10px] text-muted-foreground hidden sm:inline",children:N})]})]})]}),e.jsxs(U,{className:"border-border/50",children:[e.jsxs(Be,{className:"flex flex-row items-center justify-between pb-2 space-y-0",children:[e.jsxs($e,{className:"text-xs sm:text-sm font-medium text-muted-foreground truncate pr-2 flex items-center gap-1",children:["Discovered",e.jsx(Ba,{content:"Total posts found across all platforms that match your product profile and keywords."})]}),e.jsx(ks,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),e.jsxs(ye,{className:"pt-0",children:[e.jsx("div",{className:"text-xl sm:text-2xl lg:text-3xl font-semibold",children:n.current.totalDiscovered}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(y,{value:n.changes.discovered,suffix:"%"}),e.jsx("span",{className:"text-[10px] text-muted-foreground hidden sm:inline",children:N})]})]})]}),e.jsxs(U,{className:"border-border/50",children:[e.jsxs(Be,{className:"flex flex-row items-center justify-between pb-2 space-y-0",children:[e.jsxs($e,{className:"text-xs sm:text-sm font-medium text-muted-foreground truncate pr-2 flex items-center gap-1",children:["Suggestions",e.
28jsx(Ba,{content:"AI-generated reply suggestions created for discovered posts to help you engage quickly."})]}),e.jsx(ms,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),e.jsxs(ye,{className:"pt-0",children:[e.jsx("div",{className:"text-xl sm:text-2xl lg:text-3xl font-semibold",children:n.current.totalRepliesGenerated}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(y,{value:n.changes.suggestions,suffix:"%"}),e.jsx("span",{className:"text-[10px] text-muted-foreground hidden sm:inline",children:N})]})]})]}),e.jsxs(U,{className:"border-border/50",children:[e.jsxs(Be,{className:"flex flex-row items-center justify-between pb-2 space-y-0",children:[e.jsxs($e,{className:"text-xs sm:text-sm font-medium text-muted-foreground truncate pr-2 flex items-center gap-1",children:["Posted",e.jsx(Ba,{content:"Comments and replies you've successfully posted to social media through DESHILLER."})]}),e.jsx(Ve,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),e.jsxs(ye,{className:"pt-0",children:[e.jsx("div",{className:"text-xl sm:text-2xl lg:text-3xl font-semibold",children:n.current.totalRepliesPosted}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(y,{value:n.changes.replied,suffix:"%"}),e.jsx("span",{className:"text-[10px] text-muted-foreground hidden sm:inline",children:N})]})]})]}),e.jsxs(U,{className:"border-border/50 col-span-2 sm:col-span-1",children:[e.jsxs(Be,{className:"flex flex-row items-center justify-between pb-2 space-y-0",children:[e.jsxs($e,{className:"text-xs sm:text-sm font-medium text-muted-foreground truncate pr-2 flex items-center gap-1",children:["Engagement",e.jsx(Ba,{content:"Percentage of discovered posts you engaged with. Higher rates mean you're actively participating in relevant conversations."})]}),e.jsx(gs,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),e.jsxs(ye,{className:"pt-0",children:[e.jsxs("div",{className:"text-xl sm:text-2xl lg:text-3xl font-semibold",children:[n.current.engagementRate.toFixed(1),"%"]}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(y,{value:n.changes.engagement,suffix:"%"}),e.jsx("span",{className:"text-[10px] text-muted-foreground hidden sm:inline",children:N})]})]})]})]}),e.jsxs(Ct,{defaultValue:"trends",className:"w-full",children:[e.jsxs(wt,{className:"w-full grid grid-cols-3 border border-border/50",children:[e.jsx(cs,{value:"trends",className:"text-xs sm:text-sm",children:"Trends"}),e.jsx(cs,{value:"platforms",className:"text-xs sm:text-sm",children:"Platforms"}),e.jsx(cs,{value:"activity",className:"text-xs sm:text-sm",children:"Activity"})]}),e.jsxs(us,{value:"trends",className:"space-y-4 sm:space-y-6 mt-4 sm:mt-6",children:[e.jsxs(U,{className:"border-border/50",children:[e.jsxs(Be,{className:"pb-2 sm:pb-4",children:[e.jsx($e,{className:"text-sm sm:text-base",children:"Discovery & Engagement"}),e.jsx(os,{className:"text-xs sm:text-sm",children:"Last 7 days"})]}),e.jsx(ye,{className:"pl-0 pr-2 sm:px-6",children:e.jsx(ea,{width:"100%",height:200,className:"sm:!h-[300px]",children:e.jsxs(Pc,{data:d,margin:{left:-20,right:5},children:[e.jsx(ar,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",opacity:.3}),e.jsx(rr,{dataKey:"date",stroke:"hsl(var(--muted-foreground))",fontSize:10,tickMargin:8}),e.jsx(nr,{stroke:"hsl(var(--muted-foreground))",fontSize:10,width:30}),e.jsx(ma,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",fontSize:"12px"}}),e.jsx(sr,{wrapperStyle:{fontSize:"10px"}}),e.jsx(zr,{type:"monotone",dataKey:"discovered",stroke:"hsl(var(--primary))",strokeWidth:2,name:"Discovered",dot:!1}),e.jsx(zr,{type:"monotone",dataKey:"replied",stroke:"hsl(var(--accent))",strokeWidth:2,name:"Replied",dot:!1})]})})})]}),e.jsxs(U,{className:"bg-card/50 backdrop-blur-sm border-border/50",children:[e.jsxs(Be,{className:"pb-2 sm:pb-4",children:[e.jsxs($e,{className:"flex items-center gap-2 text-sm sm:text-base",children:[e.jsx(Nt,{className:"h-4 w-4 sm:h-5 sm:w-5 text-accent"}),"Daily Volume"]}),e.jsx(os,{className:"text-xs sm:text-sm",children:"Posts discovered and replies sent"})]}),e.jsx(ye,{className:"pl-0 pr-2 sm:px-6",children:e.jsx(ea,{width:"100%",height:200,className:"sm:!h-[300px]",children:e.jsxs(Ri,{data:d,margin:{left:-20,right:5},children:[e.jsx(ar,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),e.jsx(rr,{dataKey:"date",stroke:"hsl(var(--muted-foreground))",fontSize:10}),e.jsx(nr,{stroke:"hsl(var(--muted-foreground))",fontSize:10,width:30}),e.jsx(ma,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",fontSize:"12px"}}),e.jsx(sr,{wrapperStyle:{fontSize:"10px"}}),e.jsx(Nr,{dataKey:"discovered",fill:"hsl(var(--primary))",name:"Discovered"}),e.jsx(Nr,{dataKey:"replied",fill:"hsl(var(--accent))",name:"Replied"})]})})})]})]}
28),e.jsx(us,{value:"platforms",className:"space-y-4 sm:space-y-6 mt-4 sm:mt-6",children:e.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[e.jsxs(U,{className:"bg-card/50 backdrop-blur-sm border-border/50",children:[e.jsxs(Be,{className:"pb-2 sm:pb-4",children:[e.jsx($e,{className:"text-sm sm:text-base",children:"Platform Distribution"}),e.jsx(os,{className:"text-xs sm:text-sm",children:"Posts discovered by platform"})]}),e.jsx(ye,{children:e.jsx(ea,{width:"100%",height:220,className:"sm:!h-[300px]",children:e.jsxs(dn,{children:[e.jsx(mn,{data:c,dataKey:"discovered",nameKey:"platform",cx:"50%",cy:"50%",outerRadius:70,label:!1,children:c.map((f,R)=>e.jsx(Er,{fill:C[f.platform]},`cell-${R}`))}),e.jsx(ma,{formatter:(f,R)=>[f,R==="x"?"X (Twitter)":R]}),e.jsx(sr,{wrapperStyle:{fontSize:"11px"},formatter:f=>f==="x"?"X":f})]})})})]}),e.jsxs(U,{className:"bg-card/50 backdrop-blur-sm border-border/50",children:[e.jsxs(Be,{className:"pb-2 sm:pb-4",children:[e.jsx($e,{className:"text-sm sm:text-base",children:"Platform Performance"}),e.jsx(os,{className:"text-xs sm:text-sm",children:"Breakdown by platform"})]}),e.jsx(ye,{className:"space-y-3 sm:space-y-4",children:c.map((f,R)=>{const M=f.platform==="x"?rt:f.platform==="linkedin"?Zs:Mc;return e.jsxs("div",{className:"p-3 sm:p-4 rounded-lg bg-background/50 border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 mb-2 sm:mb-3",children:[e.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:e.jsx(M,{className:"h-4 w-4 sm:h-5 sm:w-5",style:{color:C[f.platform]}})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-semibold capitalize text-sm sm:text-base truncate",children:f.platform==="x"?"X (Twitter)":f.platform}),e.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground",children:[f.discovered," found ⢠",f.replied," replied"]})]})]}),e.jsxs("div",{className:"space-y-1.5 sm:space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-xs sm:text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Engagement"}),e.jsxs("span",{className:"font-medium",children:[f.discovered>0?(f.replied/f.discovered*100).toFixed(1):0,"%"]})]}),e.jsx("div",{className:"h-1.5 sm:h-2 bg-secondary rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full transition-all duration-500",style:{width:`${f.discovered>0?f.replied/f.discovered*100:0}%`,backgroundColor:C[f.platform]}})})]})]},R)})})]})]})}),e.jsx(us,{value:"activity",className:"mt-4 sm:mt-6",children:e.jsxs(U,{className:"bg-card/50 backdrop-blur-sm border-border/50",children:[e.jsxs(Be,{className:"pb-2 sm:pb-4",children:[e.jsxs($e,{className:"flex items-center gap-2 text-sm sm:text-base",children:[e.jsx(Nt,{className:"h-4 w-4 sm:h-5 sm:w-5 text-primary"}),"Recent Activity"]}),e.jsx(os,{className:"text-xs sm:text-sm",children:"Your latest actions"})]}),e.jsx(ye,{className:"px-3 sm:px-6",children:m.length===0?e.jsx("div",{className:"text-center py-8 sm:py-12 text-muted-foreground text-xs sm:text-sm",children:"No activity yet. Start discovering posts to see your activity here."}):e.jsx("div",{className:"space-y-2 sm:space-y-3",children:m.map(f=>e.jsxs("div",{className:"flex items-center justify-between gap-2 p-2.5 sm:p-3 rounded-lg bg-background/50 border border-border/50 hover:border-primary/50 transition-all",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0 flex-1",children:[e.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${f.status==="success"?"bg-accent":"bg-destructive"}`}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-medium capitalize text-xs sm:text-sm truncate",children:f.action.replace("_"," ")}),e.jsx("div",{className:"text-[10px] sm:text-sm text-muted-foreground capitalize",children:f.platform==="x"?"X":f.platform})]})]}),e.jsx("div",{className:"text-[10px] sm:text-sm text-muted-foreground shrink-0",children:new Date(f.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},f.id))})})]})})]})]})},Vr=({items:s})=>e.jsx("nav",{className:"flex items-center gap-1.5 sm:gap-2 text-xs sm:text-sm text-muted-foreground mb-4 sm:mb-6 overflow-x-auto",children:s.map((t,a)=>e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 shrink-0",children:[a>0&&e.jsx($t,{className:"h-3 w-3 sm:h-4 sm:w-4"}),t.href?e.jsx(Ls,{to:t.href,className:"hover:text-foreground transition-colors truncate max-w-[100px] sm:max-w-none",children:t.label}):e.jsx("span",{className:"text-foreground font-medium truncate max-w-[120px] sm:max-w-none",children:t.label})]},a))}),ng=({run:s,onComplete:t,onNavigate:a})=>{const[r,o]=i.useState(0),[n,l]=i.useState(!1),c={0:"dashboard",1:"dashboard",2:"conversations",3:"engage",4:"auto-engage",5:"analytics",6:"product",7:"media",8:"settings"},x=[{target:"body",content:"Welcome to DESHILLER! Let me show you around your new engagement workspace. This quick tour will help you get the most out of the platform.",disableBeacon:!0,placement:"center",title:"Welcome to DESHILLER ð"},{target:'[data-tour="dashboard-tab"]',content:"This is your Dashboard - your command center. Here you'll see an overview of your engagement activity, discovery credits, and recent actions all in one place.",disableBeacon:!0,placement:"right",title:"Dashboard Overview ð"},{target:'[data-tour="conversations-tab"]',content:"The Conversations tab tracks mentions and discussions about your product across social media. Monitor what people are saying about you and your competitors in real-time.",disableBeacon:!0,placement:"right",title:"Track Conversations ð"},{target:'[data-tour="engage-tab"]',content:"This is where the magic happens! Discover relevant posts on Twitter, LinkedIn, and Reddit. Find conversations where your product could help, then write and post replies directly from here.",disableBeacon:!0,placement:"right",title:"Engage with Your Audience ð¬"},{target:'[data-tour="auto-engage-tab"]',content:"Auto-Engage lets AI handle engagement for you automatically. Set your preferences, daily limits, and let the system find and respond to relevant conversations while you focus on your business.",disableBeacon:!0,placement:"right",title:"Automate Your Engagement â¡"},{target:'[data-tour="analytics-tab"]',content:"Track your performance over time. See how many posts you've discovered, replies you've sent, and measure your engagement growth across all platforms.",disableBeacon:!0,placement:"right",title:"Analytics & Insights ð"},{target:'[data-tour="product-tab"]',content:"Tell us about your product here. The better we understand your business, value proposition, and ideal customers, the more relevant conversations we can find for you.",disableBeacon:!0,placement:"right",title:"Your Product Profile ð¢"},{target:'[data-tour="media-tab"]',content:"Upload screenshots, images, and other media files here. These
28can be attached to your replies to make them more engaging and persuasive.",disableBeacon:!0,placement:"right",title:"Media Library ð¼ï¸"},{target:'[data-tour="settings-tab"]',content:"Connect your social media accounts and customize your engagement preferences. You'll need to add your API credentials here to start posting replies.",disableBeacon:!0,placement:"right",title:"Settings & Connections âï¸"}];i.useEffect(()=>{if(s&&a&&c[r]){const u=c[r];a(u),l(!1);const m=setTimeout(()=>{l(!0)},300);return()=>clearTimeout(m)}},[r,s,a]),i.useEffect(()=>{if(s){const u=setTimeout(()=>{l(!0)},500);return()=>clearTimeout(u)}},[s]);const d=i.useCallback(u=>{const{status:m,action:p,type:g,index:v}=u;if([ao.FINISHED,ao.SKIPPED].includes(m)){o(0),t();return}g===rx.STEP_AFTER&&(p===Un.NEXT?o(v+1):p===Un.PREV&&o(Math.max(0,v-1))),p===Un.CLOSE&&(o(0),t())},[t]);return!s||!n?null:e.jsx(nx,{steps:x,run:s&&n,continuous:!0,showProgress:!0,showSkipButton:!0,stepIndex:r,callback:d,disableScrolling:!0,spotlightPadding:8,floaterProps:{disableAnimation:!1},styles:{options:{primaryColor:"hsl(var(--primary))",textColor:"hsl(var(--foreground))",backgroundColor:"hsl(var(--card))",overlayColor:"rgba(0, 0, 0, 0.6)",arrowColor:"hsl(var(--card))",zIndex:1e4},tooltip:{borderRadius:"12px",padding:"20px",maxWidth:"400px"},tooltipContainer:{textAlign:"left"},tooltipTitle:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"},tooltipContent:{fontSize:"14px",lineHeight:"1.6"},buttonNext:{backgroundColor:"hsl(var(--primary))",borderRadius:"8px",padding:"10px 20px",fontSize:"14px",fontWeight:"500"},buttonBack:{color:"hsl(var(--muted-foreground))",marginRight:"8px"},buttonSkip:{color:"hsl(var(--muted-foreground))",fontSize:"13px"},spotlight:{borderRadius:"8px"}},locale:{back:"Back",close:"Close",last:"Get Started",next:"Next",skip:"Skip Tour"}})},ig=({userId:s,onComplete:t})=>{const[a,r]=i.useState("strategy"),[o,n]=i.useState("contextual"),[l,c]=i.useState(""),[x,d]=i.useState(!1),u=[{label:"Professional",example:"Clear, authoritative, business-focused"},{label:"Friendly",example:"Warm, approachable, conversational"},{label:"Casual",example:"Relaxed, informal, peer-to-peer"},{label:"Expert",example:"Technical, detailed, industry-specific"}],m=async()=>{d(!0);try{const{data:p}=await w.from("user_preferences").select("id").eq("user_id",s).maybeSingle();p?await w.from("user_preferences").update({reply_strategy:o,updated_at:new Date().toISOString()}).eq("user_id",s):await w.from("user_preferences").insert({user_id:s,reply_strategy:o});const{data:g}=await w.from("product_profiles").select("id").eq("user_id",s).maybeSingle();g&&l&&await w.from("product_profiles").update({tone_guidelines:l,updated_at:new Date().toISOString()}).eq("user_id",s),k.success("Settings saved"),t()}catch{k.error("Failed to save settings")}finally{d(!1)}};return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-6",children:e.jsxs("div",{className:"w-full max-w-2xl space-y-6",children:[e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("h1",{className:"text-3xl font-display font-bold text-foreground",children:"One more thing..."}),e.jsx("p",{className:"text-muted-foreground",children:"Let's customize how you engage with your audience"})]}),e.jsxs("div",{className:"flex justify-center gap-2",children:[e.jsx("div",{className:`w-3 h-3 rounded-full ${a==="strategy"?"bg-primary":"bg-primary/30"}`}),e.jsx("div",{className:`w-3 h-3 rounded-full ${a==="tone"?"bg-primary":"bg-primary/30"}`})]}),a==="strategy"&&e.jsxs(U,{className:"bg-card/50 backdrop-blur border-border",children:[e.jsxs(Be,{children:[e.jsxs($e,{className:"flex items-center gap-2",children:[e.jsx(ms,{className:"w-5 h-5 text-primary"}),"How do you want to engage?"]}),e.jsx(os,{children:"Choose your preferred reply style"})]}),e.jsxs(ye,{className:"space-y-4",children:[e.jsxs(Gr,{value:o,onValueChange:p=>n(p),children:[e.jsx("div",{className:`p-4 border rounded-lg cursor-pointer transition-all ${o==="contextual"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>n("contextual"),children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ba,{value:"contextual",id:"c
28ontextual",className:"mt-1"}),e.jsxs("label",{htmlFor:"contextual",className:"cursor-pointer flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(ga,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"font-semibold",children:"Public Reply with Context"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Share helpful insights publicly. Great for building your brand and reaching a wider audience."})]})]})}),e.jsx("div",{className:`p-4 border rounded-lg cursor-pointer transition-all ${o==="dm_invitation"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>n("dm_invitation"),children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ba,{value:"dm_invitation",id:"dm_invitation",className:"mt-1"}),e.jsxs("label",{htmlFor:"dm_invitation",className:"cursor-pointer flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(ms,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"font-semibold",children:"Invite to Direct Message"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Start a private conversation. Best for generating leads and personal connections."})]})]})})]}),e.jsxs(h,{onClick:()=>r("tone"),className:"w-full bg-primary hover:bg-primary/90",children:["Continue",e.jsx(Ns,{className:"w-4 h-4 ml-2"})]})]})]}),a==="tone"&&e.jsxs(U,{className:"bg-card/50 backdrop-blur border-border",children:[e.jsxs(Be,{children:[e.jsxs($e,{className:"flex items-center gap-2",children:[e.jsx(es,{className:"w-5 h-5 text-primary"}),"What's your tone of voice?"]}),e.jsx(os,{children:"This helps us match your brand personality"})]}),e.jsxs(ye,{className:"space-y-4",children:[e.jsx("div",{className:"grid grid-cols-2 gap-2",children:u.map(p=>e.jsxs("button",{onClick:()=>c(p.label+" - "+p.example),className:`p-3 text-left border rounded-lg transition-all ${l.includes(p.label)?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,children:[e.jsx("div",{className:"font-medium text-foreground",children:p.label}),e.jsx("div",{className:"text-xs text-muted-foreground",children:p.example})]},p.label))}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"custom-tone",className:"text-sm text-muted-foreground",children:"Or describe your own style:"}),e.jsx(Vs,{id:"custom-tone",value:l,onChange:p=>c(p.target.value),placeholder:"e.g., Helpful and knowledgeable, but never pushy. Use simple language without jargon.",className:"min-h-[100px]"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"outline",onClick:()=>r("strategy"),className:"flex-1",children:"Back"}),e.jsxs(h,{onClick:m,disabled:x,className:"flex-1 bg-primary hover:bg-primary/90",children:[x?"Saving...":"Finish Setup",e.jsx(bs,{className:"w-4 h-4 ml-2"})]})]})]})]}),e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"You can always change these settings later"})]})})},Xi=ox,Qi=lx,$n=i.forwardRef(({className:s,align:t="center",sideOffset:a=4,...r},o)=>e.jsx(ix,{children:e.jsx(Oc,{ref:o,align:t,sideOffset:a,className:Z("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...r})}));$n.displayName=Oc.displayName;const og=({userId:s})=>{const[t,a]=i.useState([]),[r,o]=i.useState(0),[n,l]=i.useState(!1),[c,x]=i.useState({discovery_notifications:!0,approval_notifications:!0,error_notifications:!0,in_app_notifications:!0});i.useEffect(()=>{d(),u();const N=w.channel("notification-updates").on("postgres_changes",{event:"INSERT",schema:"public",table:"discovered_posts",filter:`user_id=eq.${s}`},f=>{m(f.new)}).on("postgres_changes",{event:"UPDATE",schema:"public",table:"discovered_posts",filter:`user_id=eq.${s}`},f=>{p(f.new)}).on("postgres_changes",{event:"INSERT",schema:"public",table:"automation_logs",filter:`user_id=eq.${s}`},f=>{g(f.new)}).subscribe();return()=>{w.removeChannel(N)}},[s]);const d=async()=>{try{const{data:N}=await w.from("notification_preferences").select("*").eq("user_id",s).single();N&&x({discovery_notifications:N.discovery_notifications,approval_notifications:N.approval_notifications,error_notifications:N.error_notifications,in_app_notifications:N.in_app_notifications})}catch{}},u=async()=>{try{const N=localStorage.getItem(`notifications_${s}`);if(N){const R=JSON.parse(N);a(R),o(R.filter(M=>!M.read).length);return}const{data:f}=await w.from("discovered_posts").select("id, post_content, platform, created_at").eq("user_id",s).eq("status","pen
28ding").order("created_at",{ascending:!1}).limit(10);if(f&&f.length>0){const R=f.map(M=>({id:`discovery_${M.id}`,type:"discovery",title:"New Post Discovered",description:M.post_content.substring(0,60)+"...",platform:M.platform,timestamp:M.created_at,read:!1,postId:M.id}));a(R),o(R.length),b(R)}}catch{}},m=N=>{if(!c.in_app_notifications||!c.discovery_notifications)return;const f={id:`discovery_${N.id}`,type:"discovery",title:"New Post Discovered",description:N.post_content.substring(0,60)+"...",platform:N.platform,timestamp:N.created_at,read:!1,postId:N.id};a(R=>[f,...R.slice(0,49)]),o(R=>R+1),b([f,...t.slice(0,49)]),k.success("New post discovered",{description:`Found relevant post on ${N.platform}`})},p=N=>{if(!(!c.in_app_notifications||!c.approval_notifications)&&N.status==="approved"){const f={id:`approval_${N.id}_${Date.now()}`,type:"approval",title:"Reply Approved",description:`Your reply was posted to ${N.platform}`,platform:N.platform,timestamp:N.updated_at,read:!1,postId:N.id};a(R=>[f,...R.slice(0,49)]),o(R=>R+1),b([f,...t.slice(0,49)])}},g=N=>{if(!(N.status==="error"&&(!c.in_app_notifications||!c.error_notifications))&&(N.status==="success"||N.status==="error")){const f={id:`action_${N.id}`,type:"action",title:v(N.action_type),description:N.status==="error"?`Error: ${N.error_message||"Action failed"} on ${N.platform}`:`Action completed on ${N.platform}`,platform:N.platform,timestamp:N.created_at,read:!1};a(R=>[f,...R.slice(0,49)]),o(R=>R+1),b([f,...t.slice(0,49)])}},v=N=>N.split("_").map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join(" "),b=N=>{localStorage.setItem(`notifications_${s}`,JSON.stringify(N))},z=N=>{const f=t.map(R=>R.id===N?{...R,read:!0}:R);a(f),o(f.filter(R=>!R.read).length),b(f)},C=()=>{const N=t.map(f=>({...f,read:!0}));a(N),o(0),b(N),k.success("All notifications marked as read")},j=N=>{const f=t.filter(R=>R.id!==N);a(f),o(f.filter(R=>!R.read).length),b(f)},y=N=>{switch(N){case"discovery":return e.jsx(gs,{className:"h-4 w-4"});case"approval":return e.jsx(ys,{className:"h-4 w-4"});case"action":return e.jsx(ms,{className:"h-4 w-4"});default:return e.jsx($a,{className:"h-4 w-4"})}};return e.jsxs(Xi,{open:n,onOpenChange:l,children:[e.jsx(Qi,{asChild:!0,children:e.jsxs(h,{variant:"ghost",size:"icon",className:"relative","aria-label":"Notifications",children:[e.jsx($a,{className:"h-5 w-5"}),r>0&&e.jsx(W,{variant:"destructive",className:"absolute -top-1 -right-1 h-5 w-5 p-0 flex items-center justify-center text-xs",children:r>99?"99+":r})]})}),e.jsxs($n,{className:"w-[calc(100vw-2rem)] sm:w-[400px] max-w-[400px] p-0",align:"end",sideOffset:8,children:[e.jsxs("div",{className:"flex items-center justify-between p-3 sm:p-4 border-b border-border",children:[e.jsx("h3",{className:"font-semibold text-sm sm:text-base",children:"Notifications"}),r>0&&e.jsxs(h,{variant:"ghost",size:"sm",onClick:C,className:"text-xs h-8 px-2",children:[e.jsx(cx,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"Mark all read"})]})]}),e.jsx(jt,{className:"h-[60vh] sm:h-[500px]",children:t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center px-4",children:[e.jsx($a,{className:"h-12 w-12 text-muted-foreground mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No notifications yet"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"You'll be notified when new posts are discovered"})]}):e.jsx("div",{className:"divide-y divide-border",children:t.map(N=>e.jsxs("div",{className:`p-4 hover:bg-muted/50 transition-colors cursor-pointer ${N.read?"":"bg-primary/5"}`,onClick:()=>z(N.id),children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:`p-2 rounded-full h-fit ${N.type==="discovery"?"bg-blue-500/10 text-blue-600":N.type==="approval"?"bg-green-500/10 text-green-600":"bg-purple-500/10 text-purple-600"}`,children:y(N.type)}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium mb-1",children:N.title}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:N.description}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{variant:"secondary",className:"text-xs",children:N.platform}),e.jsx("span",{className:"text-xs text-muted-foreground",children:ha(new Date(N.timestamp),{addSuffix:!0})})]})]}),e.jsx(h,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:f=>{f.stopPropagation(),j(N.id)},children:e.jsx(zs,{className:"h-3 w-3"})})]})})]}),!N.read&&e.jsx("div",{className:"ml-auto mt-2",children:e.jsx("div",{className:"h-2 w-2 rounded-full bg-primary"})})]},N.id))})})]})]})},hr=[{id:"x",name:"X (Twitter)",icon:rt,color:"text-sky-500",maxLimit:50},{id:"linkedin",name:"LinkedIn",icon:Zs,color:"text-blue-600",maxLimit:25},{id:"reddit",name:"Reddit",icon:ms,color:"text-orange-500",maxLimit:25},{id:"facebook",name:"Facebook",icon:Wt,color:"text-blue-500",maxLimit:10},{id:"youtube",name:"YouTube",icon:Pi,color:"text-red-500",maxLimit:25}],lg=[{value:"6h",label:"6 hours"},{value:"12h",label:"12 hours"},{value:"1d",label:"1 day"},{value:"3d",label:"3 days"},{value:"7d",label:"1 week"},{value:"14d",label:"2 weeks"},{value:"30d",label:"1 month"}],Ao=[{value:"professional",label:"Professional",description:"Clear, business-appropriate"},{value:"friendly",label:"Friendly & Casual",description:"Warm, conversational"},{value:"witty",label:"Witty & Engaging",description:"Clever, playful"},{value:"empathetic",label:"Empathetic",description:"Understanding, supportive"},{value:"direct",label:"Direct & Concise",description:"To the point, no fluff"},{value:"custom",label:"Custom",description:"Your own description"}],cg=({userId:s,dailyLimit:t,usedToday:a,subscriptionEnd:r,onRefresh:o})=>{const n=ns(),[l,c]=i.useState("x"),[x,d]=i.useState("discover"),[u,m]=i.useState({x:!1,linkedin:!1,reddit:!1,facebook:!1,youtube:!1}),[p,g]=i.useState({x:10,linkedin:10,reddit:10,facebook:5,youtube:10}),[v,b]=i.useState([]),[z,C]=i.useState(null),[j,y]=i.useState(!1),[N,f]=i.useState(!1),[R,M]=i.useState(""),[q,_]=i.useState({}),[A,B]=i.useState(!0),[P,I]=i.useState("professional"),[$,be]=i.useState(""),[Y,O]=i.useState(!1),[he,re]=i.useState(!1),[oe,T]=i.useState("1d"),[ce,le]=i.useState(null),F=ce&&!Wn(ce),[L,K]=i.useState(null),ue=i.useCallback((S=1500)=>{const J=`${Date.now()}-${Math.random().toString(16).slice(2)}`;return new Promise(je=>{const se=We=>{const H=We.origin===window.location.origin||We.origin==="null",ae=We.source===window;!H&&!ae||!We.data||We.data.type!=="SOCIALPILOT_PONG"||We.data.nonce===J&&(window.removeEventListener("message",se),clearTimeout(Oe),je({installed:We.data.installed===!0,authenticated:We.data.authenticated===!0}))},Oe=window.setTimeout(()=>{window.removeEventListener("message",se),je(null)},S);window.addEventListener("message",se),window.postMessage({type:"SOCIALPILOT_PING",nonce:J},"*")})},[]),Ne=i.useCallback(async(S=3)=>{for(let J=0;J<S;J++){const je=await ue(1200);if(je!=null&&je.installed)return je;await new Promise(se=>setTimeout(se,800))}return null},[ue]);i.useEffect(()=>{let S=!1;try{document.documentElement.dataset.socialpilotBridge==="1"&&K(se=>se??{installed:!0,authenticated:!1})}catch{}const J=se=>{var H;const Oe=se.origin===window.location.origin||se.origin==="null",We=se.source===window;!Oe&&!We||((H=se.data)==null?void 0:H.type)==="SOCIALPILOT_BRIDGE_READY"&&K(ae=>ae??{installed:!0,authenticated:!1})},je=se=>{var H;const Oe=se.origin===window.location.origin||se.origin==="null",We=se.source===window;!Oe&&!We||((H=se.data)==null?void 0:H.type)==="SOCIALPILOT_EXTENSION_CONNECTED"&&K({installed:!0,authenticated:!0})};return window.addEventListener("message",J),window.addEventListener("message",je),(async()=>{const se=await Ne(3);if(!S)if(se)K(se);else{const Oe=(()=>{try{return document.documentElement.dataset.socialpilotBridge==="1"}catch{return!1}})();K(Oe?{installed:!0,authenticated:!1}:{installed:!1,authenticated:!1})}})(),()=>{S=!0,window.removeEventListener("message",J),window.removeEventListener("message",je)}},[Ne]),i.useEffect(()=>{(async()=>{B(!0);try{const{data:J}=await w.from("browser_profiles").select("platform, status").eq("user_id",s),je={};
28(J||[]).forEach(se=>{const Oe=se.platform==="twitter"?"x":se.platform;je[Oe]=se.status==="connected"}),_(je)}catch{}finally{B(!1)}})()},[s]);const fe=i.useCallback(async()=>{try{const{data:S}=await w.from("user_preferences").select("auto_post_enabled, auto_post_limit, tone_of_voice, tone_description").eq("user_id",s).maybeSingle();S!=null&&S.auto_post_enabled&&m({x:!0,linkedin:!0,reddit:!0,facebook:!0,youtube:!0}),S!=null&&S.tone_of_voice&&I(S.tone_of_voice),S!=null&&S.tone_description&&be(S.tone_description);const J=localStorage.getItem(`autoEngage_limits_${s}`);J&&g(JSON.parse(J));const je=localStorage.getItem(`autoEngage_paused_${s}`);if(je){const se=new Date(je);Wn(se)?localStorage.removeItem(`autoEngage_paused_${s}`):le(se)}}catch{}},[s]),me=i.useCallback(async()=>{try{const{data:S}=await w.from("automation_logs").select("*").eq("user_id",s).order("created_at",{ascending:!1}).limit(100);S&&b(S)}catch{}},[s]);i.useEffect(()=>{fe(),me()},[fe,me]),i.useEffect(()=>{if(!ce)return;const S=setInterval(()=>{Wn(ce)&&(le(null),localStorage.removeItem(`autoEngage_paused_${s}`),k.success("Auto-Engage has resumed"))},6e4);return()=>clearInterval(S)},[ce,s]);const Ie=()=>{let S;oe.endsWith("h")?S=mx(new Date,parseInt(oe)):S=ji(new Date,parseInt(oe)),le(S),localStorage.setItem(`autoEngage_paused_${s}`,S.toISOString()),re(!1),k.success(`Auto-Engage paused until ${at(S,"MMM d, h:mm a")}`)},Q=()=>{le(null),localStorage.removeItem(`autoEngage_paused_${s}`),k.success("Auto-Engage resumed")},ne=async S=>{const J=!u[S];m(se=>({...se,[S]:J}));const je=Object.entries({...u,[S]:J}).some(([se,Oe])=>Oe);await w.from("user_preferences").update({auto_post_enabled:je}).eq("user_id",s),k.success(J?`Auto-Engage enabled for ${S}`:`Auto-Engage paused for ${S}`)},ke=async(S,J)=>{const je={...p,[S]:J[0]};g(je),localStorage.setItem(`autoEngage_limits_${s}`,JSON.stringify(je));const se=Object.values(je).reduce((Oe,We)=>Oe+We,0);await w.from("automation_subscriptions").update({daily_limit:se}).eq("user_id",s)},ee=async()=>{var S;O(!0);try{const J=P==="custom"?$:((S=Ao.find(je=>je.value===P))==null?void 0:S.description)||"";await w.from("user_preferences").upsert({user_id:s,tone_of_voice:P,tone_description:J},{onConflict:"user_id"}),k.success("Tone saved")}catch{k.error("Failed to save tone")}finally{O(!1)}},E=async S=>{var J;C(S);try{const{data:{session:je}}=await w.auth.getSession();if(!je){k.error("Please log in");return}if(L&&!L.installed){k.error("Chrome extension required",{description:"Install the deSHILLER extension to engage on this platform.",duration:6e3});return}const se=((J=hr.find(ss=>ss.id===S))==null?void 0:J.name)||S,Oe=p[S]||10;k.info(`Running AI Lead Machine on ${se}...`,{duration:4e3});const{data:We,error:H}=await w.from("discovered_posts").select("id, post_url, post_content, author_name, author_username, platform").eq("user_id",s).eq("platform",S).in("status",["pending","approved"]).order("relevance_score",{ascending:!1}).limit(Math.min(Oe,10));if(H)throw H;let ae=We||[];if(!ae.length){k.info(`No fresh posts. Discovering on ${se}...`,{duration:4e3});const{data:ss}=await w.from("platform_preferences").select("keywords").eq("user_id",s).eq("platform",S==="x"?"twitter":S).maybeSingle(),$s=(ss==null?void 0:ss.keywords)||[],Xs=S==="reddit"&&R.trim()?R.split(",").map(te=>te.trim().replace(/^r\//,"")).filter(Boolean):void 0,{data:xs,error:de}=await w.functions.invoke("discover-posts",{body:{platform:S,keywords:$s,subreddits:Xs},headers:{Authorization:`Bearer ${je.access_token}`}});if(de)throw de;if(xs!=null&&xs.error)throw new Error(xs.error);const{data:D}=await w.from("discovered_posts").select("id, post_url, post_content, author_name, author_username, platform").eq("user_id",s).eq("platform",S).in("status",["pending","approved"]).order("relevance_score",{ascending:!1}).limit(Math.min(Oe,10));ae=D||[]}if(!ae.length){k.info(`No engageable posts on ${se}. Try adding more keywords or check back later.`);return}const ze=ae.map(ss=>ss.id),{data:pe}=await w.from("engagement_queue").select("discovered_post_id").eq("user_id",s).in("discovered_post_id",ze),Ae=new Set((pe||[]).map(ss=>ss.discovered_post_id));if(ae=ae.filter(ss=>!Ae.has(ss.id)),!ae.length){k.info(`All fresh posts on ${se} are already queued. Open the platform to let the extension post them.`);return}let Ee=0,ls=0;for(const ss of ae)try{const{data:$s,error:Xs}=await w.functions.invoke("generate-reply",{body:{platform:S,postContent:ss.post_content||"",authorName:ss.author_name||ss.author_username||""},headers:{Authorization:`Bearer ${je.access_token}`}});if(Xs)throw Xs;
28const xs=(($s==null?void 0:$s.reply)||($s==null?void 0:$s.comment)||"").trim();if(!xs){ls++;continue}const{error:de}=await w.from("engagement_queue").insert({user_id:s,discovered_post_id:ss.id,platform:ss.platform,post_url:ss.post_url,reply_text:xs,status:"pending",priority:0});if(de)throw de;await w.from("discovered_posts").update({status:"queued",updated_at:new Date().toISOString()}).eq("id",ss.id),Ee++}catch{ls++}Ee>0?k.success(`ð Queued ${Ee} ${se} ${Ee===1?"reply":"replies"} for the extension`,{description:"Open the platform tab â the extension will post automatically.",duration:6e3}):ls>0?k.error(`Could not queue replies on ${se}. Try again in a moment.`):k.info(`No engageable posts on ${se}.`),me(),o()}catch{k.error("Failed to run AI Lead Machine")}finally{C(null)}},xe=async()=>{var S;f(!0);try{const{data:{session:J},error:je}=await w.auth.getSession();if(je||!J){k.error("Please log in to use discovery");return}const{data:se}=await w.from("platform_preferences").select("keywords").eq("user_id",s).eq("platform",l).maybeSingle(),Oe=(se==null?void 0:se.keywords)||[],We=l==="reddit"&&R.trim()?R.split(",").map(pe=>pe.trim().replace(/^r\//,"")).filter(Boolean):void 0,H=((S=hr.find(pe=>pe.id===l))==null?void 0:S.name)||l;k.info(`Discovering posts on ${H}...`,{duration:3e3});const{data:ae,error:ze}=await w.functions.invoke("discover-posts",{body:{platform:l,keywords:Oe,subreddits:We},headers:{Authorization:`Bearer ${J.access_token}`}});if(ze)throw ze;if(ae!=null&&ae.error)throw new Error(ae.error);ae.postsDiscovered===0?k.info(`No posts found on ${H}. Try adding more keywords.`):k.success(`Discovered ${ae.postsDiscovered} relevant posts from ${H}!`)}catch(J){const je=(J==null?void 0:J.message)||"Failed to discover posts";je.includes("Discovery limit")||je.includes("used all")?k.error("Discovery Limit Reached",{description:"Purchase a Discovery Pack to continue.",duration:1e4,action:{label:"Get More",onClick:()=>window.location.href="/payment?pack=discovery"}}):kt(J,"Post discovery")}finally{f(!1)}};hr.find(S=>S.id===l);const ve=v.filter(S=>{const J=new Date().toISOString().split("T")[0];return S.platform===l&&S.created_at.startsWith(J)&&(S.action_type==="auto_comment"||S.action_type==="reply")});return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl sm:text-3xl font-display font-semibold flex items-center gap-3",children:[e.jsx(ws,{className:"h-7 w-7 text-primary"}),"AI Lead Machine"]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Automated discovery & engagement â same posts, fully hands-free"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[F?e.jsxs(W,{variant:"outline",className:"bg-amber-500/10 text-amber-600 border-amber-500/20",children:[e.jsx(Za,{className:"h-3 w-3 mr-1"}),"Paused until ",at(ce,"MMM d, h:mm a")]}):e.jsxs(W,{variant:"outline",className:"bg-green-500/10 text-green-600 border-green-500/20",children:[e.jsx(bs,{className:"h-3 w-3 mr-1"}),"Active"]}),F?e.jsxs(h,{variant:"outline",size:"sm",onClick:Q,children:[e.jsx(Ua,{className:"h-4 w-4 mr-1"})," Resume"]}):e.jsxs(gt,{open:he,onOpenChange:re,children:[e.jsx(Cr,{asChild:!0,children:e.jsxs(h,{variant:"outline",size:"sm",children:[e.jsx(Za,{className:"h-4 w-4 mr-1"})," Pause"]})}),e.jsxs(dt,{children:[e.jsxs(mt,{children:[e.jsxs(xt,{className:"flex items-center gap-2",children:[e.jsx(Ea,{className:"h-5 w-5"})," Pause Auto-Engage"]}),e.jsx(Mt,{children:"Take a break from automatic engagement."})]}),e.jsx("div",{className:"py-4 space-y-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Pause Duration"}),e.jsxs(Gs,{value:oe,onValueChange:T,children:[e.jsx(qs,{children:e.jsx(Us,{})}),e.jsx(Hs,{children:lg.map(S=>e.jsx(Te,{value:S.value,children:S.label},S.value))})]})]})}),e.jsxs(Ft,{children:[e.jsx(h,{variant:"outline",onClick:()=>re(!1),children:"Cancel"}),e.jsxs(h,{onClick:Ie,children:[e.jsx(Za,{className:"h-4 w-4 mr-1"})," Pause Now"]})]})]})]})]})]}),!F&&e.jsxs(Xt,{className:"bg-primary/5 border-primary/20",children:[e.jsx(ws,{className:"h-4 w-4 text-primary"}),e.jsx(_a,{className:"text-sm",children:"Fully automated â no approvals needed"}),e.jsx(Qt,{className:"text-xs text-muted-foreground",children:"The AI Lead Machine runs in the background every 30 minutes: discovers fresh posts, drafts comments in your tone, and posts them to X automatically. You don't need to approve anything â just keep platforms enabled below."})]}),F&&e.jsxs(Xt,{className:"bg-amber-500/10 border-amber-500/20",children:[e.jsx(Za,{className:"h-4 w-4 text-amber-500"}),e.jsxs(Qt,{className:"text-amber-700 dark:text-amber-400",children:["Auto-Engage is paused until ",at(ce,"MMMM d, yyyy at h:mm a"),". No automatic engagements will be posted."]})]}),e.jsx(na,{open:j,onOpenChange:y,children:e.jsxs(U,{className:"border-border/50 bg-card/50 backdrop-blur-xl",children:[e.jsx(ia,{asChild:!0,children:e.jsx(Be,{className:"cursor-pointer hover:bg-secondary/20 transition-colors rounded-t-lg",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(or,{className:"h-5 w-5 text-primary"}),e.jsxs("div",{children:[e.jsx($e,{className:"text-base",children:"Automation Settings"}),e.jsxs(os,{className:"text-xs",children:[Object.entries(u).filter(([S,J])=>J).length," platforms active ·"," ",P," tone · ",Object.values(p).reduce((S,J)=>S+J,0)," daily limit"]})]})]}),e.jsx(nt,{className:`h-5 w-5 text-muted-foreground transition-transform ${j?"rotate-180":""}`})]})})}),e.jsx(oa,{children:e.jsxs(ye,{className:"pt-0 space-y-6",children:[e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-4",children:hr.map(S=>{const J=S.icon;return e.jsxs("div",{className:"p-4 rounded-lg bg-secondary/30 border border-border/30 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:`h-4 w-4 ${S.c
28olor}`}),e.jsx("span",{className:"text-sm font-medium",children:S.name.split("/")[0]})]}),e.jsx(Js,{checked:u[S.id],onCheckedChange:()=>ne(S.id)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:"Daily limit"}),e.jsxs("span",{className:"font-medium",children:[p[S.id],"/day"]})]}),e.jsx(Kt,{value:[p[S.id]],onValueChange:je=>ke(S.id,je),max:S.maxLimit,min:1,step:1})]})]},S.id)})}),e.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1 min-w-[200px]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(dx,{className:"h-4 w-4"}),e.jsx("label",{className:"text-sm font-medium",children:"Comment Tone"})]}),e.jsxs(Gs,{value:P,onValueChange:I,children:[e.jsx(qs,{children:e.jsx(Us,{placeholder:"Select tone"})}),e.jsx(Hs,{children:Ao.map(S=>e.jsxs(Te,{value:S.value,children:[S.label," - ",S.description]},S.value))})]}),P==="custom"&&e.jsx(Vs,{placeholder:"Describe your preferred tone...",value:$,onChange:S=>
28be(S.target.value),className:"min-h-[60px]"})]}),e.jsx(h,{variant:"outline",size:"sm",onClick:ee,disabled:Y,children:Y?"Saving...":"Save Tone"})]}),e.jsxs("div",{className:"p-3 rounded-lg bg-green-500/10 border border-green-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2 text-green-700 dark:text-green-400",children:[e.jsx(Tt,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium text-sm",children:"Platform-Safe Mode"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"30 min cooldown between posts, natural timing, human-like patterns"})]})]})})]})}),e.jsx(U,{className:"border-border/50 bg-card/50 backdrop-blur-xl shadow-xl",children:e.jsx(ye,{className:"pt-6",children:e.jsxs(Ct,{value:l,onValueChange:S=>{c(S),d("discover")},children:[e.jsx("div",{className:"overflow-x-auto -mx-2 px-2 pb-2",children:e.jsx(wt,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 bg-secondary/50 p-1 gap-1",children:hr.map(S=>{const J=S.icon,je=q[S.id]===!0;return e.jsxs(cs,{value:S.id,className:"data-[state=active]:bg-gradient-to-r data-[state=active]:from-primary data-[state=active]:to-accent data-[state=active]:text-white data-[state=active]:shadow-lg rounded-lg transition-all relative whitespace-nowrap flex-shrink-0",children:[e.jsx(J,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:S.name}),!A&&e.jsx("span",{className:`ml-1.5 inline-flex items-center justify-center w-4 h-4 rounded-full ${je?"bg-green-500/20 text-green-500":"bg-muted/50 text-muted-foreground"}`,children:je?e.jsx(bs,{className:"h-3 w-3"}):e.jsx(bt,{className:"h-3 w-3"})})]},S.id)})})}),hr.map(S=>e.jsxs(us,{value:S.id,className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(U,{className:"bg-secondary/20",children:e.jsxs(ye,{className:"pt-4 pb-3 px-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1",children:[e.jsx(Et,{className:"h-3.5 w-3.5"})," Today's Usage"]}),e.jsxs("div",{className:"text-2xl font-bold",children:[ve.length,"/",p[S.id]]}),e.jsx(zt,{value:ve.length/p[S.id]*100,className:"mt-2 h-1.5"})]})}),e.jsx(U,{className:"bg-secondary/20",children:e.jsxs(ye,{className:"pt-4 pb-3 px-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1",children:[e.jsx(gs,{className:"h-3.5 w-3.5"})," Success Rate"]}),(()=>{const J=v.filter(se=>se.platform===S.id),je=J.length>0?Math.round(J.filter(se=>se.status==="success").length/J.length*100):0;return e.jsxs("div",{className:"text-2xl font-bold",children:[je,"%"]})})()]})}),e.jsx(U,{className:"bg-secondary/20",children:e.jsxs(ye,{className:"pt-4 pb-3 px-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1",children:[e.jsx(Cs,{className:"h-3.5 w-3.5"})," Total"]}),e.jsx("div",{className:"text-2xl font-bold",children:v.filter(J=>J.platform===S.id).length})]})})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(h,{onClick:()=>E(S.id),disabled:z===S.id||!u[S.id]||!!F,className:"bg-gradient-to-r from-primary to-accent hover:opacity-90",children:z===S.id?e.jsxs(e.Fragment,{children:[e.jsx(st,{className:"mr-2 h-4 w-4 animate-spin"})," Running..."]}):F?e.jsxs(e.Fragment,{children:[e.jsx(Za,{className:"mr-2 h-4 w-4"})," Paused"]}):e.jsxs(e.Fragment,{children:[e.jsx(ws,{className:"mr-2 h-4 w-4"})," Run Auto-Engage Now"]})}),!u[S.id]&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Enable ",S.name," in settings above to run"]})]}),S.id==="linkedin"?e.jsx(_d,{userId:s}):e.jsx(e.Fragment,{children:e.jsxs(Ct,{value:x,onValueChange:J=>d(J),className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(wt,{className:"bg-secondary/50 p-1",children:[e.jsxs(cs,{value:"discover",className:"data-[state=active]:bg-background data-[state=active]:shadow-sm gap-2",children:[e.jsx(Ks,{className:"h-4 w-4"})," Discover Posts"]}),e.jsxs(cs,{value:"engage",className:"data-[state=active]:bg-background data-[state=active]:shadow-sm gap-2",children:[e.jsx(St,{className:"h-4 w-4"})," Ready to Engage"]}),e.jsxs(cs,{value:"logs",className:"data-[state=active]:bg-background data-[state=active]:shadow-sm gap-2",children:[e.jsx(ms,{className:"h-4 w-4"}
28)," Activity Log"]})]}),x==="discover"&&e.jsx(h,{onClick:xe,disabled:N,className:"bg-gradient-to-r from-primary to-accent hover:opacity-90 disabled:opacity-50",children:N?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"mr-2 h-4 w-4 animate-spin"})," Discovering..."]}):e.jsxs(e.Fragment,{children:[e.jsx(es,{className:"mr-2 h-4 w-4"})," Start Discovery"]})})]}),e.jsxs(us,{value:"discover",className:"mt-4 space-y-4",children:[(S.id==="x"||S.id==="reddit"||S.id==="facebook"||S.id==="youtube")&&L!==null&&!(L!=null&&L.installed)&&e.jsxs(Xt,{className:"border-yellow-500/50 bg-yellow-500/10",children:[e.jsx(Ss,{className:"h-4 w-4"}),e.jsx(_a,{children:"Extension Required for Posting"}),e.jsxs(Qt,{className:"flex items-center gap-2",children:[e.jsxs("span",{children:["Install the browser extension to post comments on ",S.name,"."]}),e.jsx(h,{variant:"link",size:"sm",className:"h-auto p-0 text-primary underline",onClick:()=>n("/dashboard",{state:{activeView:"settings"}}),children:"Go to Settings â Extension"})]})]}),S.id==="reddit"&&e.jsx(Id,{userId:s,onSubredditsChange:J=>M(J.join(", "))}),(S.id==="x"||S.id==="facebook")&&e.jsx("div",{className:"p-4 bg-secondary/30 rounded-lg border border-border/50",children:e.jsx(Bn,{userId:s,platform:S.id})}),S.id==="facebook"&&e.jsx(Ad,{userId:s}),e.jsx(Dn,{userId:s,platform:S.id})]}),e.jsx(us,{value:"engage",className:"mt-4",children:e.jsx(Fn,{userId:s,platform:S.id})}),e.jsx(us,{value:"logs",className:"mt-4",children:e.jsxs(U,{children:[e.jsx(Be,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs($e,{className:"flex items-center gap-2 text-base",children:[e.jsx(ms,{className:"h-5 w-5"})," Recent Activity"]}),e.jsxs(h,{variant:"ghost",size:"sm",onClick:me,className:"h-8 px-2 gap-1",children:[e.jsx(st,{className:"h-4 w-4"})," Refresh"]})]})}),e.jsx(ye,{children:e.jsx(jt,{className:"h-[400px]",children:v.filter(J=>J.platform===S.id).length===0?e.jsx(Yi,{icon:Et,title:"No activity yet",description:"Enable auto-engage and run to start"}):e.jsx("div",{className:"space-y-2",children:v.filter(J=>J.platform===S.id).slice(0,50).map(J=>{var We,H,ae,ze,pe,Ae,Ee,ls;const je=((We=J.details)==null?void 0:We.postUrl)||((H=J.details)==null?void 0:H.post_url)||((ae=J.details)==null?void 0:ae.url),se=((ze=J.details)==null?void 0:ze.replyUrl)||((pe=J.details)==null?void 0:pe.reply_url),Oe=((Ae=J.details)==null?void 0:Ae.comment_preview)||((Ee=J.details)!=null&&Ee.replyLength?`Reply (${(ls=J.details)==null?void 0:ls.replyLength} chars)`:null);return e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-secondary/30",children:[e.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center ${J.status==="success"?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:J.status==="success"?e.jsx(bs,{className:"h-3 w-3"}):e.jsx(zs,{className:"h-3 w-3"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx(W,{variant:"outline",className:"text-xs",children:J.action_type.replace(/_/g," ")}),e.jsxs("div",{className:"flex gap-1",children:[se&&e.jsxs(h,{variant:"default",size:"sm",className:"h-6 px-2 text-xs gap-1",onClick:()=>window.open(se,"_blank"),children:["View Reply ",e.jsx(Ys,{className:"h-3 w-3"})]}),je&&e.jsxs(h,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs gap-1",onClick:()=>window.open(je,"_blank"),children:["Post ",e.jsx(Ys,{className:"h-3 w-3"})]})]})]}),Oe&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1.5 line-clamp-2",children:['"',Oe,'..."']}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:at(new Date(J.created_at),"MMM d, h:mm a")}),J.error_message&&e.jsx("p",{className:"text-xs text-red-500 mt-1 truncate",children:J.error_message})]})]},J.id)})})})})]})})]})})]},S.id))]})})})]})},Io=[{id:"x",name:"Twitter/X",icon:rt,color:"text-sky-500"},{id:"linkedin",name:"LinkedIn",icon:Zs,color:"text-blue-600"},{id:"reddit",name:"Reddit",icon:ms,color:"text-orange-500"},{id:"facebook",name:"Facebook",icon:Wt,color:"text-blue-500"}],Lo=4,dg=({userId:s,dailyLimit:t,onComplete:a})=>{const[r,o]=i.useState(1),[n,l]=i.useState([]),[c,x]=i.useState({x:10,linkedin:10,reddit:10,facebook:5}),[d,u]=i.useState(!0),[m,p]=i.useState(!0),[g,v]=i.useState(!1),[b,z]=i.useState([]),[C,j]=i.useState(""),[y,N]=i.useState(10),[f,R]=i.useState(!1),M=A=>{l(B=>B.includes(A)?B.filter(P=>P!==A):[...B,A])},q=A=>{z(B=>B.includes(A)?B.filter(P=>P!==A):[...B,A])},_=async()=>
28{if(n.length===0){k.error("Select at least one platform");return}R(!0);try{await w.from("user_preferences").upsert({user_id:s,auto_post_enabled:!0,auto_post_limit:Object.values(c).reduce((A,B)=>A+B,0)},{onConflict:"user_id"}),k.success("Lead Machine configured"),a()}catch{k.error("Failed to save settings")}finally{R(!1)}};return e.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[Array.from({length:Lo},(A,B)=>B+1).map(A=>e.jsx("div",{className:`h-2 w-12 rounded-full transition-colors ${A<=r?"bg-primary":"bg-muted"}`},A)),e.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:[r,"/",Lo]})]}),r===1&&e.jsxs(U,{className:"border-border/50",children:[e.jsxs(Be,{className:"text-center",children:[e.jsx($e,{className:"text-2xl font-display",children:"AI Lead Machine"}),e.jsx(os,{className:"text-base mt-2",children:"Automated commenting and cold outreach across social platforms, powered by AI and your browser extension."})]}),e.jsxs(ye,{className:"space-y-6",children:[e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-secondary/30",children:[e.jsx("div",{className:"h-5 w-5 rounded-full bg-primary/20 flex items-center justify-center mt-0.5 shrink-0",children:e.jsx("span",{className:"text-xs font-semibold text-primary",children:"1"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Auto-Commenting"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"AI generates contextual comments on discovered posts and posts them via your extension"})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-secondary/30",children:[e.jsx("div",{className:"h-5 w-5 rounded-full bg-primary/20 flex items-center justify-center mt-0.5 shrink-0",children:e.jsx("span",{className:"text-xs font-semibold text-primary",children:"2"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Cold Outreach"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Find prospects matching your ICP and send personalized DMs automatically"})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-secondary/30",children:[e.jsx("div",{className:"h-5 w-5 rounded-full bg-primary/20 flex items-center justify-center mt-0.5 shrink-0",children:e.jsx("span",{className:"text-xs font-semibold text-primary",children:"3"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Safe & Controlled"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Built-in rate limits, smart scheduling, and platform-safe cooldowns"})]})]})]}),e.jsxs(h,{onClick:()=>o(2),className:"w-full",size:"lg",children:["Get Started",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]})]})]}),r===2&&e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Select Platforms"}),e.jsx(os,{children:"Choose platforms for auto-commenting"})]}),e.jsxs(ye,{className:"space-y-6",children:[e.jsx("div",{className:"grid gap-3",children:Io.map(A=>{const B=A.icon,P=n.includes(A.id);return e.jsxs("div",{onClick:()=>M(A.id),className:`flex items-center gap-4 p-4 rounded-lg border-2 cursor-pointer transition-all ${P?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/30"}`,children:[e.jsx(Ot,{checked:P}),e.jsx(B,{className:`h-5 w-5 ${A.color}`}),e.jsx("span",{className:"font-medium flex-1",children:A.name})]},A.id)})}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(h,{variant:"outline",onClick:()=>o(1),children:"Back"}),e.jsxs(h,{onClick:()=>o(3),className:"flex-1",disabled:n.length===0,children:["Continue",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]})]})]})]}),r===3&&e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Configure Limits"}),e.jsxs(os,{children:["Daily engagement limits per platform (max ",t," total/day)"]})]}),e.jsxs(ye,{className:"space-y-6",children:[e.jsx("div",{className:"space-y-4",children:n.map(A=>{const B=Io.find(I=>I.id===A);if(!B)return null;const P=B.icon;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P,{className:`h-4 w-4 ${B.color}`}),e.jsx("span",{className:"font-medium text-sm",children:B.name})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[c[A],"/day"]})]}),e.jsx(Kt,{value:[c[A]],onValueChange:I=>x($=>({...$,[A]:I[0]})),max:A==="facebook"?10:20,min:1,step:1})]},A)})}),n.includes("facebook")&&e.jsx("div",{className:"p-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(qt,{className:"h-4 w-4 text-amber-500 mt-0.5"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Facebook has stricter limits â max 10/day recommended"})]})}),e.jsxs("div",{className:"space-y-3 pt-4 border-t",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Smart Scheduling"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Space out engagements naturally"})]}),e.jsx(Js,{checked:d,onCheckedChange:u})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"High-Relevance Only"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Only engage with 80%+ relevance posts"})]}),e.jsx(Js,{checked:m,onCheckedChange:p})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(h,{variant:"outline",onClick:()=>o(2),children:"Back"}),e.jsxs(h,{onClick:()=>o(4),className:"flex-1",children:["Continue",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]})]})]})]}),r===4&&e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Cold Outreach"}),e.jsx(os,{children:"Optionally enable automated prospecting and DMs"})]}),e.jsxs(ye,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Enable Cold Reach"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Find and message prospects automatically"})]}),e.jsx(Js,{checked:g,onCheckedChange:v})]}),g&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-sm font-medium",children:"Outreach Platforms"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{id:"linkedin",name:"LinkedIn",icon:Zs,color:"text-blue-600"},{id:"x",name:"Twitter/X",icon:rt,color:"text-sky-500"},{id:"facebook",name:"Facebook",icon:Wt,color:"text-blue-500"}].map(A=>{const B=A.icon,P=b.includes(A.id);return e.jsxs("div",{onClick:()=>q(A.id),className:`flex items-center gap-2 p-3 rounded-lg border cursor-pointer transition-all text-sm ${P?"border-primary bg-primary/5":"border-border hover:border-muted-foreground
28/30"}`,children:[e.jsx(Ot,{checked:P}),e.jsx(B,{className:`h-4 w-4 ${A.color}`}),e.jsx("span",{children:A.name})]},A.id)})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-sm font-medium",children:"Ideal Customer Profile"}),e.jsx(Vs,{placeholder:"e.g., SaaS founders, marketing managers at mid-size companies, ecommerce store owners...",value:C,onChange:A=>j(A.target.value),className:"min-h-[80px] text-sm"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Describe who you want to reach. The AI uses this to find relevant prospects."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Ce,{className:"text-sm font-medium",children:"Daily DM Limit"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[y,"/day"]})]}),e.jsx(Kt,{value:[y],onValueChange:A=>N(A[0]),max:25,min:1,step:1}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Lower limits are safer for new accounts"})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(h,{variant:"outline",onClick:()=>o(3),children:"Back"}),e.jsxs(h,{onClick:_,className:"flex-1",disabled:f,children:[f?"Saving...":"Complete Setup",e.jsx(bs,{className:"ml-2 h-4 w-4"})]})]})]})]})]})},Pr=({icon:s,eyebrow:t,eyebrowAccent:a,title:r,description:o,headerActions:n,subnav:l,children:c})=>e.jsxs("div",{className:"relative space-y-6",children:[e.jsx("div",{className:"absolute -top-12 left-1/4 w-96 h-96 rounded-full bg-primary/10 blur-3xl pointer-events-none -z-10"}),e.jsx("div",{className:"absolute top-32 right-0 w-72 h-72 rounded-full bg-accent/10 blur-3xl pointer-events-none -z-10"}),e.jsx("div",{className:"sticky top-16 z-30 -mx-1 px-1 pt-1 pb-1",children:e.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-border/50 bg-card/70 backdrop-blur-xl shadow-[0_8px_32px_-12px_hsl(var(--primary)/0.25)]",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/[0.06] via-transparent to-accent/[0.05] pointer-events-none"}),e.jsxs("div",{className:"relative flex flex-col md:flex-row md:items-end md:justify-between gap-5 p-5 md:p-6",children:[e.jsxs("div",{className:"flex items-start gap-4 min-w-0 flex-1",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-gradient-to-br from-primary/25 to-accent/20 flex items-center justify-center border border-primary/20 shadow-md shadow-primary/10 shrink-0",children:e.jsx(s,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5 flex-wrap",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/80 font-medium",children:t}),a&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"h-1 w-1 rounded-full bg-muted-foreground/40"}),e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-primary/80 font-medium",children:a})]})]}),e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold tracking-tight text-foreground",children:r}),o&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 max-w-2xl leading-relaxed",children:o})]})]}),n&&e.jsx("div",{className:"flex items-center gap-2 flex-wrap shrink-0",children:n})]}),l&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"relative h-px bg-gradient-to-r from-transparent via-border/60 to-transparent"}),e.jsx("div",{className:"relative px-3 md:px-4 py-3",children:l})]})]})}),c]}),mg=({userId:s})=>{const[t,a]=i.useState(!0),[r,o]=i.useState(!1),[n,l]=i.useState(null),c=i.useCallback(async()=>{try{const{data:{session:u}}=await w.auth.getSession();if(!u){l({subscribed:!0,dailyLimit:50,usedToday:0,subscriptionEnd:null}),a(!1);return}try{const{data:m,error:p}=await w.functions.invoke("check-automation-subscription",{headers:{Authorization:`Bearer ${u.access_token}`}});l(!p&&m?{subscribed:!0,dailyLimit:m.dailyLimit||50,usedToday:m.usedToday||0,subscriptionEnd:m.subscriptionEnd||null}:{subscribed:!0,dailyLimit:50,usedToday:0,subscriptionEnd:null})}catch{l({subscribed:!0,dailyLimit:50,usedToday:0,subscriptionEnd:null})}}catch{l({subscribed:!0,dailyLimit:50,usedToday:0,subscriptionEnd:null})}finally{a(!1)}},[]),x=i.useCallback(async()=>{try{const{data:u}=await w.from("user_preferences").select("auto_post_enabled").eq("user_id",s).maybeSingle(),m=localStorage.getItem(`autoEngage_setup_${s}`);o(!!(u!=null&&u.auto_post_enabled)||!!m)}catch{}},[s]);i.useEffect(()=>{c(),x();const u=setInterval(c,6e4);return()=>clearInterval(u)},[c,x]);const d=()=>{localStorage.setItem(`autoEngage_setup_${s}`,"true"),o(!0)};return t?e.jsx(Pr,{icon:Et,eyebrow:"Engage",eyebrowAccent:"AI Lead Machine",title:"AI Lead Machine",description:"Automated discovery and personalized engagement across your connected platforms.",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[e.jsx(Ws,{className:"h-32"}),e.jsx(Ws,{className:"h-32"}),e.jsx(Ws,{className:"h-32"})]}),e.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[e.jsx(Ws,{className:"h-64"}),e.jsx(Ws,{className:"h-64"})]})]})}):r?e.jsx(Pr,{icon:Et,eyebrow:"Engage",eyebrowAccent:"AI Lead Machine · Live",title:"AI Lead Machine",description:"Your automation is running. Track activity, tune limits and pause anytime.",children:e.jsx(cg,{userId:s,dailyLimit:(n==null?void 0:n.dailyLimit)||50,usedToday:(n==null?void 0:n.usedToday)||0,subscriptionEnd:(n==null?void 0:n.subscriptionEnd)||null,onRefresh:c})}):e.jsx(Pr,{icon:Et,eyebrow:"Engage",eyebrowAccent:"AI Lead Machine · Setup",title:"Set up your AI Lead Machine",description:"Pick keywords, platforms and tone â we'll handle discovery and replies.",children:e.jsx(dg,{userId:s,dailyLimit:(n==null?void 0:n.dailyLimit)||50,onComplete:d})})},ja=i.forwardRef(({className:s,...t},a)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:a,className:Z("w-full caption-bottom text-sm",s),...t})}));ja.displayName="Table";const ya=i.forwardRef(({className:s,...t},a)=>e.jsx("thead",{ref:a,className:Z("[&_tr]:border-b",s),...t}));ya.displayName="TableHeader";const va=i.forwardRef(({className:s,...t},a)=>e.jsx("tbody",{ref:a,className:Z("[&_tr:last-child]:border-0",s),...t}));va.displayName="TableBody";const xg=i.forwardRef(({className:s,...t},a)=>e.jsx("tfoot",{ref:a,className:Z("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...t}));xg.displayName="TableFooter";const tt=i.forwardRef(({className:s,...t},a)=>e.jsx("tr",{ref:a,className:Z("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...t}));tt.displayName="TableRow";const fs=i.forwardRef(({className:s,...t},a)=>e.jsx("th",{ref:a,className:Z("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...t}));fs.displayName="TableHead";const is=i.forwardRef(({className:s,...t},a)=>e.jsx("td",{ref:a,className:Z("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...t}));is.displayName="TableCell";const ug=i.forwardRef(({className:s,...t},a)=>e.jsx("caption",{ref:a,className:Z("mt-4 text-sm text-muted-foreground",s),...t}));ug.displayName="TableCaption";const hg=({isPaidUser:s})=>{const[t,a]=i.useState([]),[r,o]=i.useState([]),[n,l]=i.useState(0),[c,x]=i.useState(0),[d,u]=i.useState(!0),[m,p]=i.useState(""),[g,v]=i.useState(null),[b,z]=i.useState(!1),[C,j]=i.useState(!1),[y,N]=i.useState(!1);i.useEffect(()=>{R(),f()},[]);const f=async()=>{const I=new URLSearchParams(window.location.search);if(I.get("credits")==="success"){const $=I.get("quantity"),be=I.get("session_id");if(be){const{data:Y,error:O}=await w.functions.invoke("add-api-credits",{body:{action:"verify",session_id:be}});!O&&(Y!=null&&Y.success)&&k.success(`${Y.credits_added} API credits added to your account`)}else $&&k.success(`${$} API credits added to your account`);window.history.replaceState({},"","/dashboard?tab=api"),R()}},R=async()=>{u(!0);try{const{data:I}=await w.functions.invoke("manage-api-keys",{body:{action:"list"}});I!=null&&I.keys&&a(I.keys);const{data:{user:$}}=await w.auth.getUser();if($){const{data:be}=await w.from("api_subscriptions").select("credits_balance, total_credits_purchased").eq("user_id",$.id).single();be&&(l(be.credits_balance),x(be.total_credits_purchased));const{data:Y}=await w.from("api_usage").select("endpoint, platform, credits_used, created_at").eq("user_id",$.id).order("created_at",{ascending:!1}).limit(50);Y&&o(Y)}}catch{}finally{u(!1)}},M=async()=>{j(!0);try{const{data:I,error:$}=await w.functions.invoke("manage-api-keys",{body:{action:"create",name:m||"API Key"}});if($)throw $;I!=null&&I.api_key&&(v(I.api_key),z(!0),p(""),k.success("API key created. Save it now - it won't be shown again."),R())}catch(I){k.error(I.message||"Failed to create API key")}finally{j(!1)}},q=async I=>{try{const{error:$}=await w.functions.invoke("manage-api-keys",{body:{action:"revoke",keyId:I}});if($)throw $;k.success("API key revoked"),R()}catch($){k.error($.message||"Failed to revoke key")}},_=async I=>{try{const{error:$}=await w.functions.invoke("manage-api-keys",{body:{action:"delete",ke
28yId:I}});if($)throw $;k.success("API key deleted"),R()}catch($){k.error($.message||"Failed to delete key")}},A=async(I=1)=>{N(!0);try{const{data:$,error:be}=await w.functions.invoke("purchase-api-credits",{body:{quantity:I}});if(be)throw be;$!=null&&$.url&&window.open($.url,"_blank")}catch($){k.error($.message||"Failed to start checkout")}finally{N(!1)}},B=I=>{navigator.clipboard.writeText(I),k.success("Copied to clipboard")},P="https://iqikbtfdddpbyxpztpbh.supabase.co/functions/v1/enterprise-api";return s?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold",children:"Enterprise API"}),e.jsx("p",{className:"text-muted-foreground",children:"Programmatic access to discovery, AI comments, and posting"})]}),e.jsxs(h,{variant:"outline",size:"sm",onClick:R,disabled:d,children:[e.jsx(st,{className:`h-4 w-4 mr-2 ${d?"animate-spin":""}`}),"Refresh"]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsxs(U,{children:[e.jsx(Be,{className:"pb-2",children:e.jsx($e,{className:"text-sm font-medium text-muted-foreground",children:"Credits Balance"})}),e.jsx(ye,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ws,{className:"h-5 w-5 text-amber-500"}),e.jsx("span",{className:"text-3xl font-bold",children:n.toLocaleString()})]})})]}),e.jsxs(U,{children:[e.jsx(Be,{className:"pb-2",children:e.jsx($e,{className:"text-sm font-medium text-muted-foreground",children:"Total Purchased"})}),e.jsx(ye,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Sa,{className:"h-5 w-5 text-primary"}),e.jsx("span",{className:"text-3xl font-bold",children:c.toLocaleString()})]})})]}),e.jsxs(U,{children:[e.jsx(Be,{className:"pb-2",children:e.jsx($e,{className:"text-sm font-medium text-muted-foreground",children:"API Keys"})}),e.jsx(ye,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(yi,{className:"h-5 w-5 text-green-500"}),e.jsx("span",{className:"text-3xl font-bold",children:t.filter(I=>I.is_active).length}),e.jsx("span",{className:"text-muted-foreground text-sm",children:"active"})]})})]})]}),e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsxs($e,{className:"flex items-center gap-2",children:[e.jsx(Sa,{className:"h-5 w-5"}),"Purchase API Credits"]}),e.jsx(os,{children:"Usage-based pricing. Credits never expire."})]}),e.jsxs(ye,{children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[e.jsxs(h,{variant:"outline",className:"h-auto py-4 flex flex-col",onClick:()=>A(1),disabled:y,children:[e.jsx("span",{className:"text-lg font-semibold text-muted-foreground mb-1",children:"Starter"}),e.jsx("span",{className:"text-2xl font-bold",children:"500"}),e.jsx("span",{className:"text-muted-foreground",children:"credits"}),e.jsx("span",{className:"text-primary font-semibold mt-1",children:"$99"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"$0.198/credit"})]}),e.jsxs(h,{variant:"outline",className:"h-auto py-4 flex flex-col relative overflow-hidden border-primary",onClick:()=>A(2),disabled:y,children:[e.jsx(W,{className:"absolute top-1 right-1 text-xs",children:"Popular"}),e.jsx("span",{className:"text-lg font-semibold text-muted-foreground mb-1",children:"Growth"}),e.jsx("span",{className:"text-2xl font-bold",children:"1,500"}),e.jsx("span",{className:"text-muted-foreground",children:"credits"}),e.jsx("span",{className:"text-primary font-semibold mt-1",children:"$249"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"$0.166/credit"})]}),e.jsxs(h,{variant:"outline",className:"h-auto py-4 flex flex-col",onClick:()=>A(3),disabled:y,children:[e.jsx("span",{className:"text-lg font-semibold text-muted-foreground mb-1",children:"Enterprise"}),e.jsx("span",{className:"text-2xl font-bold",children:"5,000"}),e.jsx("span",{className:"text-muted-foreground",children:"credits"}),e.jsx("span",{className:"text-primary font-semibold mt-1",children:"$499"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"$0.10/credit"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-4",children:"Credit costs: Discovery = 5 credits, Generate Comment = 2 credits, Post Comment = 3 credits"})]})]}),e.jsxs(Ct,{defaultValue:"keys",className:"space-y-4",children:[e.jsxs(wt,{children:[e.jsxs(cs,{value:"keys",children:[e.jsx(yi,{className:"h-4 w-4 mr-2"}),"API Keys"]}),e.jsxs(cs,{value:"usage",children:[e.jsx(Nt,{className:"h-4 w-4 mr-2"}),"Usage"]}),e.jsxs(cs,{value:"docs",children:[e.jsx(Ii,{className:"h-4 w-4 mr-2"}),"Documentation"]})]}),e.jsxs(us,{value:"keys",className:"space-y-4",children:[e.jsx(gt,{open:b,onOpenChange:z,children:e.jsxs(dt,{children:[e.jsxs(mt,{children:[e.jsx(xt,{children:"API Key Created"}),e.jsx(Mt,{children:"Copy your API key now. It will not be shown again."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-lg font-mono text-sm break-all",children:g}),e.jsxs(h,{className:"w-full",onClick:()=>{B(g||""),z(!1),v(null)},children:[e.jsx(ta,{className:"h-4 w-4 mr-2"}),"Copy and Close"]})]})]})}),e.jsxs(U,{children:[e.jsx(Be,{children:e.jsx($e,{children:"Create API Key"})}),e.jsx(ye,{children:e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsx(Je,{placeholder:"Key name (e.g., Production, Testing)",value:m,onChange:I=>p(I.target.value)})}),e.jsxs(h,{onClick:M,disabled:C,children:[e.jsx(ft,{className:"h-4 w-4 mr-2"}),"Create Key"]})]})})]}),e.jsxs(U,{children:[e.jsx(Be,{children:e.jsx($e,{children:"Your API Keys"})}),e.jsx(ye,{children:t.length===0?e.jsx("p",{className:"text-muted-foreground text-center py-8",children:"No API keys yet. Create one to get started."}):e.jsxs(ja,{children:[e.jsx(ya,{children:e.jsxs(tt,{children:[e.jsx(fs,{children:"Name"}),e.jsx(fs,{children:"Key"}),e.jsx(fs,{children:"Status"}),e.jsx(fs,{children:"Last Used"}),e.jsx(fs,{children:"Created"}),e.jsx(fs,{})]})}),e.jsx(va,{children:t.map(I=>e.jsxs(tt,{children:[e.jsx(is,{className:"font-medium",children:I.name}),e.jsx(is,{className:"font-mono text-sm",children:I.key_prefix}),e.jsx(is,{children:I.is_active?e.jsxs(W,{variant:"outline",className:"bg-green-500/10 text-green-600",children:[e.jsx(Ve,{className:"h-3 w-3 mr-1"}),"Active"]}):e.jsxs(W,{variant:"outline",className:"bg-destructive/10 text-destructive",children:[e.jsx(Rt,{className:"h-3 w-3 mr-1"}),"Revoked"]})}),e.jsx(is,{className:"text-muted-foreground",children:I.last_used_at?at(new Date(I.last_used_at),"MMM d, HH:mm"):"Never"}),e.jsx(is,{className:"text-muted-foreground",children:at(new Date(I.created_at),"MMM d, yyyy")}),e.jsx(is,{children:e.jsxs("div",{className:"flex gap-2",children:[I.is_active&&e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>q(I.id),children:"Revoke"}),e.jsx(h,{variant:"ghost",size:"sm",className:"text-destructive",onClick:()=>_(I.id),children:e.jsx(ua,{className:"h-4 w-4"})})]})})]},I.id))})]})})]})]}),e.jsx(us,{value:"usage",className:"space-y-4",children:e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Recent API Usage"}),e.jsx(os,{children:"Last 50 API calls"})]}),e.jsx(ye,{children:r.length===0?e.jsx("p",{className:"text-muted-foreground text-center py-8",children:"No API usage yet."}):e.jsxs(ja,{children:[e.jsx(ya,{children:e.jsxs(tt,{children:[e.jsx(fs,{children:"Endpoint"}),e.jsx(fs,{children:"Platform"}),e.jsx(fs,{children:"Credits"}),e.jsx(fs,{children:"Time"})]})}),e.jsx(va,{children:r.map((I,$)=>e.jsxs(tt,{children:[e.jsx(is,{className:"font-mono text-sm",children:I.endpoint}),e.jsx(is,{children:e.jsx(W,{variant:"outline",children:I.platform})}),e.jsx(is,{children:I.credits_used>0?e.jsxs("span",{className:"text-destructive",children:["-",I.credits_used]}):e.jsxs("span",{className:"text-green-600",children:["+",Math.abs(I.credits_used)]})}),e.jsx(is,{className:"text-muted-foreground",children:at(new Date(I.created_at),"MMM d, HH:mm:ss")})]},$))})]})})]})}),e.jsx(us,{value:"docs",className:"space-y-4",children:e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"API Documentation"}),e.jsxs(os,{children:["Base URL: ",e.jsx("code",{className:"bg-muted px-2 py-1 rounded",children:P}),e.jsx(h,{variant:"ghost",size:"sm",className:"ml-2",onClick:()=>B(P),children:e.jsx(ta,{className:"h-3 w-3"})})]})]}),e.jsxs(ye,{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Authentication"}),e.jsxs("p",{className:"text-muted-foreground text-sm mb-2",children:["Include your API key in the ",e.jsx("code",{className:"bg-muted px-1 rounded",children:"x-api-key"})," header:"]}),e.jsx("pre",{className:"bg-muted p-4 rounded-lg text-sm overflow-x-auto",children:`curl -X POST ${P} \\ 29 -H "x-api-key: desh_your_api_key_here" \\ 30 -H "Content-Type: application/json" \\ 31 -d '{"platform": "x", "keywords": ["saas", "startup"]}'`})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Endpoints"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(W,{children:"POST"}),e.jsx("code",{className:"font-mono",children:"/discover"}),e.jsx(W,{variant:"outline",children:"5 credits"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Discover relevant posts on a platform based on keywords."}),e.jsx("pre",{className:"bg-muted p-3 rounded mt-2 text-xs",children:`{ 32 "platform": "x", // x, linkedin, reddit, facebook 33 "keywords": ["saas", "startup", "automation"] 34}`})]}),e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(W,{children:"POST"}),e.jsx("code",{className:"font-mono",children:"/generate-comment"}),e.jsx(W,{variant:"outline",children:"2 credits"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Generate AI comment suggestions for a post."}),e.jsx("pre",{className:"bg-muted p-3 rounded mt-2 text-xs",children:`{ 35 "post_url": "https://twitter.com/user/status/123..." 36}`})]}),e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(W,{children:"POST"}),e.jsx("code",{className:"font-mono",children:"/post-comment"}),e.jsx(W,{variant:"outline",children:"3 credits"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Post a comment to a social media post."}),e.jsx("pre",{className:"bg-muted p-3 rounded mt-2 text-xs",children:`{ 37 "platform": "x", 38 "post_url": "https://twitter.com/user/status/123...", 39 "comment_text": "Great insights! Have you tried..." 40}`})]}),e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(W,{variant:"secondary",children:"GET"}),e.jsx("code",{className:"font-mono",children:"/balance"}),e.jsx(W,{variant:"outline",children:"0 credits"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Check your current credit balance."})]}),e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(W,{variant:"secondary",children:"GET"}
40),e.jsx("code",{className:"font-mono",children:"/usage"}),e.jsx(W,{variant:"outline",children:"0 credits"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Get your recent API usage history."})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Response Format"}),e.jsx("pre",{className:"bg-muted p-4 rounded-lg text-sm overflow-x-auto",children:`{ 41 "success": true, 42 "credits_used": 5, 43 "credits_remaining": 995, 44 "data": { ... } 45}`})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Error Codes"}),e.jsxs(ja,{children:[e.jsx(ya,{children:e.jsxs(tt,{children:[e.jsx(fs,{children:"Code"}),e.jsx(fs,{children:"Description"})]})}),e.jsxs(va,{children:[e.jsxs(tt,{children:[e.jsx(is,{children:e.jsx("code",{children:"401"})}),e.jsx(is,{children:"Invalid or missing API key"})]}),e.jsxs(tt,{children:[e.jsx(is,{children:e.jsx("code",{children:"402"})}),e.jsx(is,{children:"Insufficient credits"})]}),e.jsxs(tt,{children:[e.jsx(is,{children:e.jsx("code",{children:"400"})}),e.jsx(is,{children:"Bad request (missing required fields)"})]}),e.jsxs(tt,{children:[e.jsx(is,{children:e.jsx("code",{children:"500"})}),e.jsx(is,{children:"Internal server error"})]})]})]})]})]})]})})]})]}):e.jsx("div",{className:"relative min-h-[400px]",children:e.jsx("div",{className:"absolute inset-0 bg-background/90 backdrop-blur-sm z-10 flex items-center justify-center rounded-lg",children:e.jsxs("div",{className:"text-center max-w-sm px-6",children:[e.jsx(_t,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Pro Feature"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Upgrade to a paid plan to access the Enterprise API for programmatic discovery and engagement"}),e.jsx(h,{onClick:()=>window.location.href="/payment",children:"Upgrade to Pro"})]})})})},pg=s=>{if(!s)return"";let t=s.replace(/<[^>]*>/g," ").replace(/ /gi," ").replace(/&/gi,"&").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/'/gi,"'").replace(/'/gi,"'").replace(/&#\d+;/g,"").replace(/&\w+;/g," ").replace(/\b(on\w+|data-\w+|class|id|style|src|href|alt|title)=["'][^"']*["']/gi,"").replace(/\b(onerror|onload|onclick)=\S+/gi,"").replace(/this\.__\w+=\w+/gi,"").replace(/"[^"]*">/g," ").replace(/<\/?\w+/g," ").replace(/https?:\/\/\S+/g,"").replace(/\.(jpg|jpeg|png|gif|webp|svg)\b/gi,"").replace(/\s+/g," ").trim();return t=t.replace(/^[\s\-âââ¢Â·.,;:'"@]+/,"").replace(/[\s\-âââ¢Â·.,;:'"]+$/,""),t},gg=(s,t=280)=>{if(!s)return"No preview available";let a=pg(s);if(/^(r\/|Tweet by|LinkedIn post|Quora|YouTube|Facebook|Discussion in|Post about)/.test(a))return a.length>t?a.substring(0,t)+"...":a;if(a.length<15||/^[@\w\-]+$/.test(a))return"View post for full content";if(a.length>t){const r=a.substring(0,t),o=r.lastIndexOf(". "),n=r.lastIndexOf("? "),l=r.lastIndexOf("! "),c=Math.max(o,n,l);return c>t*.6?r.substring(0,c+1):r+"..."}return a},fg=({userId:s,isTrialExpired:t,isPaidUser:a})=>{const[r,o]=i.useState([]),[n,l]=i.useState(null),[c,x]=i.useState(null),[d,u]=i.useState(!1),[m,p]=i.useState({}),[g,v]=i.useState("all"),[b,z]=i.useState("all"),[C,j]=i.useState("relevance"),[y,N]=i.useState(1),f=10,[R,M]=i.useState(new Set),[q,_]=i.useState(!1),[A,B]=i.useState([]),[P,I]=i.useState([]),[$,be]=i.useState(""),[Y,O]=i.useState(""),[he,re]=i.useState(!1);i.useEffect(()=>{le(),oe()},[s]);const oe=()=>{const ee=localStorage.getItem(`conversations_variations_${s}`),E=localStorage.getItem(`conversations_competitors_${s}`);ee&&B(JSON.parse(ee)),E&&I(JSON.parse(E))},T=(ee,E)=>{if(E.trim())if(ee==="variation"){const xe=[...A,E.trim()];B(xe),localStorage.setItem(`conversations_variations_${s}`,JSON.stringify(xe)),be("")}else{const xe=[...P,E.trim()];I(xe),localStorage.setItem(`conversations_competitors_${s}`,JSON.stringify(xe)),O("")}},ce=(ee,E)=>{if(ee==="variation"){const xe=A.filter((ve,S)=>S!==E);B(xe),localStorage.setItem(`conversations_variations_${s}`,JSON.stringify(xe))}else{const xe=P.filter((ve,S)=>S!==E);I(xe),localStorage.setItem(`conversations_competitors_${s}`,JSON.stringify(xe))}},le=async()=>{const{data:ee}=await w.from("user_credentials").select("platform").eq("user_id",s);if(ee){const E=ee.map(ve=>ve.platform),xe={};for(const ve of["twitter","linkedin","reddit","facebook","youtube","quora"])xe[ve]=E.includes(ve);p(xe)}},F=async()=>
45{if(t){k.error("Trial expired",{description:"Please upgrade to continue tracking conversations"});return}u(!0),o([]),l(null),x(null);try{const{data:{session:ee}}=await w.auth.getSession();if(!ee)throw new Error("Not authenticated");const E=await fetch("https://iqikbtfdddpbyxpztpbh.supabase.co/functions/v1/track-conversations",{method:"POST",headers:{Authorization:`Bearer ${ee.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({customKeywords:A,competitors:P,stream:!0})});if(!E.ok)throw new Error("Failed to fetch");const xe=E.headers.get("content-type")||"",ve=xe.includes("application/json"),S=xe.includes("text/event-stream");if(ve&&!S){const We=await E.json(),H=Array.isArray(We==null?void 0:We.conversations)?We.conversations:[],ae=[],ze=new Set;for(const pe of H)pe!=null&&pe.url&&(ze.has(pe.url)||(ze.add(pe.url),ae.push(pe)));o(ae),We!=null&&We.summary&&l(We.summary),We!=null&&We.aiSummary&&x(We.aiSummary),k.success(`Found ${ae.length} conversations`);return}if(!E.body)throw new Error("No response body");const J=E.body.getReader(),je=new TextDecoder;let se="";const Oe=new Set;for(;;){const{done:We,value:H}=await J.read();if(We)break;se+=je.decode(H,{stream:!0});const ae=se.split(` 46 47`);se=ae.pop()||"";for(const ze of ae){if(!ze.startsWith("data: "))continue;const pe=ze.slice(6).trim();if(pe)try{const Ae=JSON.parse(pe);if(Ae.type==="results"&&Ae.conversations){const Ee=Ae.conversations.filter(ls=>Oe.has(ls.url)?!1:(Oe.add(ls.url),!0));o(ls=>[...ls,...Ee])}else Ae.type==="done"&&Ae.summary?l(Ae.summary):Ae.type==="error"&&k.error(Ae.error||"Search failed")}catch{}}}if(se.startsWith("data: "))try{const We=JSON.parse(se.slice(6).trim());We.type==="done"&&We.summary&&l(We.summary)}catch{}k.success(`Found ${Oe.size} conversations`)}catch{k.error("Failed to track conversations")}finally{u(!1)}},L=(ee,E="h-4 w-4")=>{switch(ee){case"twitter":return e.jsx(rt,{className:E});case"linkedin":return e.jsx(Zs,{className:E});case"reddit":return e.jsx(St,{className:E});case"facebook":return e.jsx(Wt,{className:E});case"instagram":return e.jsx(Fc,{className:E});case"youtube":return e.jsx(Pi,{className:E});case"quora":return e.jsx(Va,{className:E});default:return e.jsx(ms,{className:E})}},K=ee=>{switch(ee){case"mention":return{label:"Mention",color:"bg-emerald-500/10 text-emerald-600 border-emerald-500/20",icon:"ð¯"};case"competitor":return{label:"Competitor",color:"bg-red-500/10 text-red-600 border-red-500/20",icon:"âï¸"};case"opportunity":return{label:"Opportunity",color:"bg-purple-500/10 text-purple-600 border-purple-500/20",icon:"ð°"};case"question":return{label:"Question",color:"bg-amber-500/10 text-amber-600 border-amber-500/20",icon:"â"};default:return{label:"Discussion",color:"bg-blue-500/10 text-blue-600 border-blue-500/20",icon:"ð¬"}}},ue=["twitter","linkedin","reddit","facebook","youtube","quora"],Ne=r.filter(ee=>!(g!=="all"&&ee.platform!==g||b!=="all"&&ee.type!==b)).sort((ee,E)=>{switch(C){case"relevance":return E.relevanceScore-ee.relevanceScore;case"platform":return ee.platform.localeCompare(E.platform);case"type":return ee.type.localeCompare(E.type);default:return 0}}),fe=Math.ceil(Ne.length/f),me=Ne.slice((y-1)*f,y*f),Ie=me.filter(ee=>ue.includes(ee.platform)),Q=ee=>{const E=new Set(R);E.has(ee)?E.delete(ee):E.add(ee),M(E)},ne=()=>{R.size===Ie.length&&Ie.length>0?M(new Set):M(new Set(Ie.map(ee=>ee.url)))},ke=async()=>{const E=me.filter(xe=>R.has(xe.url)).filter(xe=>ue.includes(xe.platform));if(E.length===0){k.error("No valid conversations selected");return}_(!0);try{const xe=E.map(S=>({user_id:s,platform:S.platform==="twitter"?"x":S.platform,post_url:S.url,post_content:S.content,author_name:S.author,author_username:S.author,relevance_score:S.relevanceScore,relevance_reason:`${S.type==="mention"?"Product mentioned":S.type==="question"?"Question about your niche":"Discussion"}
47 - from Conversations tracker`,status:"pending"})),{error:ve}=await w.from("discovered_posts").insert(xe);if(ve)throw ve;k.success(`Added ${E.length} to Engage queue`),M(new Set)}catch{k.error("Failed to add conversations")}finally{_(!1)}};return i.useEffect(()=>{N(1)},[g,b,C,r]),a?t?e.jsx("div",{className:"relative min-h-[400px]",children:e.jsx("div",{className:"absolute inset-0 bg-background/90 backdrop-blur-sm z-10 flex items-center justify-center rounded-lg",children:e.jsxs("div",{className:"text-center max-w-sm px-6",children:[e.jsx(_t,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Trial Expired"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Upgrade to continue tracking conversations about your product"}),e.jsx(h,{onClick:()=>window.location.href="/payment",children:"Upgrade Now"})]})})}):e.jsxs(Pr,{icon:ms,eyebrow:"Engage",eyebrowAccent:"Conversations",title:"Conversations",description:"Track mentions, questions, and discussions across platforms.",headerActions:e.jsxs(e.Fragment,{children:[e.jsxs(h,{variant:"outline",size:"sm",onClick:()=>re(!he),children:[e.jsx(Ks,{className:"h-4 w-4 mr-2"}),"Keywords",A.length+P.length>0&&e.jsx(W,{variant:"secondary",className:"ml-2 h-5 px-1.5",children:A.length+P.length})]}),e.jsx(h,{onClick:F,disabled:d,size:"sm",children:d?e.jsxs(e.Fragment,{children:[e.jsx(st,{className:"h-4 w-4 mr-2 animate-spin"}),"Scanning..."]}):e.jsxs(e.Fragment,{children:[e.jsx(es,{className:"h-4 w-4 mr-2"}),"Scan Now"]})})]}),children:[e.jsx("div",{className:"flex flex-col gap-4",children:he&&e.jsx(U,{className:"border-dashed",children:e.jsx(ye,{className:"pt-4 pb-4",children:e.jsxs("div",{className:"grid sm:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ce,{className:"text-sm font-medium",children:"Product Variations"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Je,{placeholder:"e.g. DESHILLER, Deshiller.io",value:$,onChange:ee=>be(ee.target.value),onKeyDown:ee=>ee.key==="Enter"&&T("variation",$),className:"h-9"}),e.jsx(h,{variant:"outline",size:"sm",onClick:()=>T("variation",$),disabled:!$.trim(),children:e.jsx(ft,{className:"h-4 w-4"})})]}),A.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:A.map((ee,E)=>e.jsxs(W,{variant:"secondary",className:"text-xs pr-1",children:[ee,e.jsx("button",{onClick:()=>ce("variation",E),className:"ml-1.5 hover:text-destructive",children:e.jsx(zs,{className:"h-3 w-3"})})]},E))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ce,{className:"text-sm font-medium",children:"Competitors"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Je,{placeholder:"e.g. Hootsuite, Buffer",value:Y,onChange:ee=>O(ee.target.value),onKeyDown:ee=>ee.key==="Enter"&&T("competitor",Y),className:"h-9"}),e.jsx(h,{variant:"outline",size:"sm",onClick:()=>T("competitor",Y),disabled:!Y.trim(),children:e.jsx(ft,{className:"h-4 w-4"})})]}),P.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:P.map((ee,E)=>e.jsxs(W,{variant:"outline",className:"text-xs pr-1 border-amber-500/30 text-amber-600",children:[ee,e.jsx("button",{onClick:()=>ce("competitor",E),className:"ml-1.5 hover:text-destructive",children:e.jsx(zs,{className:"h-3 w-3"})})]},E))})]})]})})})}),c&&e.jsx(U,{className:"border-primary/20 bg-primary/5",children:e.jsx(ye,{className:"pt-4 pb-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"h-8 w-8 rounded-full bg-primary/10 flex items-center justify-center shrink-0 mt-0.5",children:e.jsx(es,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:"AI Analysis"}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:c})]})]})})}),n&&e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[e.jsx("div",{className:"bg-card border rounded-lg p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(ms,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-semibold",children:n.total}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Total"})]})]})}),e.jsx("div",{className:"bg-card border rounded-lg p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-full bg-emerald-500/10 flex items-center justify-center",children:e.jsx(gs,{className:"h-5 w-5 text-emerald-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-semibold",children:n.mentions}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Mentions"})]})]})}),e.jsx("div",{className:"bg-card border rounded-lg p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-full bg-amber-500/10 flex items-center justify-center",children:e.jsx(Va,{className:"h-5 w-5 text-amber-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-semibold",children:n.questions}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Questions"})]})]})}),e.jsx("div",{className:"bg-card border rounded-lg p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-full bg-blue-500/10 flex items-center justify-center",children:e.jsx(Es,{className:"h-5 w-5 text-blue-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-semibold",children:n.discussions}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Discussions"})]})]})})]}),e.jsxs(U,{children:[e.jsx(Be,{className:"pb-3",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[e.jsxs($e,{className:"text-base font-medium flex items-center gap-2",children:[e.jsx(Ta,{className:"h-4 w-4"}),"Results",Ne.length>0&&e.jsx(W,{variant:"secondary",className:"font-normal",children:Ne.length})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Gs,{value:g,onValueChange:v,children:[e.jsx(qs,{className:"w-[130px] h-8 text-xs",children:e.jsx(Us,{placeholder:"Platform"})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"all",children:"All Platforms"}),e.jsx(Te,{value:"linkedin",children:"LinkedIn"}),e.jsx(Te,{value:"twitter",children:"Twitter"}),e.jsx(Te,{value:"reddit",children:"Reddit"}),e.jsx(Te,{value:"facebook",children:"Facebook"}),e.jsx(Te,{value:"youtube",children:"YouTube"}),e.jsx(Te,{value:"quora",children:"Quora"})]})]}),e.jsxs(Gs,{value:b,onValueChange:z,children:[e.jsx(qs,{className:"w-[120px] h-8 text-xs",children:e.jsx(Us,{placeholder:"Type"})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"all",children:"All Types"}),e.jsx(Te,{value:"mention",children:"ð¯ Mentions"}),e.jsx(Te,{value:"competitor",children:"âï¸ Competitor"}),e.jsx(Te,{value:"opportunity",children:"ð° Opportunity"}),e.jsx(Te,{value:"question",children:"â Questions"}),e.jsx(Te,{value:"discussion",children:"ð¬ Discussions"})]})]}),e.jsxs(Gs,{value:C,onValueChange:j,children:[e.jsx(qs,{className:"w-[120px] h-8 text-xs",children:e.jsx(Us,{placeholder:"Sort"})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"relevance",children:"Relevance"}),e.jsx(Te,{value:"platform",children:"Platform"}),e.jsx(Te,{value:"type",children:"Type"})]})]})]})]})}),e.jsx(ye,{className:"p-0",children:d?e.jsx("div",{className:"p-6 space-y-4",children:[1,2,3,4].map(ee=>e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx(Ws,{className:"h-8 w-8 rounded-full shrink-0"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(Ws,{className:"h-4 w-3/4"}),e.jsx(Ws,{className:"h-3 w-1/2"})]})]},ee))}):Ne.length===0?e.jsxs("div",{className:"text-center py-16 px-6",children:[e.jsx(ms,{className:"h-10 w-10 mx-auto text-muted-foreground mb-3"}),e.jsx("h3",{className:"font-medium mb-1",children:"No conversations foun
47d"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:'Add keywords and click "Scan Now" to find relevant conversations'}),e.jsxs(h,{onClick:F,disabled:d,size:"sm",children:[e.jsx(es,{className:"h-4 w-4 mr-2"}),"Start Scanning"]})]}):e.jsxs(e.Fragment,{children:[R.size>0&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-primary/5 border-b",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xx,{className:"h-4 w-4 text-primary"}),e.jsxs("span",{className:"text-sm font-medium",children:[R.size," selected"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>M(new Set),children:"Clear"}),e.jsx(h,{size:"sm",onClick:ke,disabled:q,children:q?e.jsxs(e.Fragment,{children:[e.jsx(st,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}),"Adding..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ft,{className:"h-3.5 w-3.5 mr-1.5"}),"Add to Queue"]})})]})]}),e.jsxs(ja,{children:[e.jsx(ya,{children:e.jsxs(tt,{className:"hover:bg-transparent",children:[e.jsx(fs,{className:"w-[40px]",children:Ie.length>0&&e.jsx(Ot,{checked:R.size===Ie.length&&Ie.length>0,onCheckedChange:ne,"aria-label":"Select all"})}),e.jsx(fs,{className:"w-[60px]",children:"Source"}),e.jsx(fs,{children:"Conversation"}),e.jsx(fs,{className:"w-[60px] text-right",children:"Action"})]})}),e.jsx(va,{children:me.map((ee,E)=>{const xe=K(ee.type),ve=ue.includes(ee.platform),S=R.has(ee.url),J=ee.relevanceScore>=70?"bg-emerald-500/10 text-emerald-600 border-emerald-500/30":ee.relevanceScore>=50?"bg-amber-500/10 text-amber-600 border-amber-500/30":"bg-muted text-muted-foreground border-border";return e.jsxs(tt,{className:S?"bg-primary/5":"",children:[e.jsx(is,{className:"align-top pt-4",children:ve?e.jsx(Ot,{checked:S,onCheckedChange:()=>Q(ee.url),"aria-label":`Select ${ee.author}`}):e.jsx("div",{className:"w-4"})}),e.jsx(is,{className:"align-top pt-4",children:e.jsx("div",{className:"h-8 w-8 rounded-full bg-muted flex items-center justify-center",title:ee.platform,children:L(ee.platform,"h-4 w-4")})}),e.jsxs(is,{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsxs(W,{variant:"outline",className:`text-[10px] px-1.5 py-0 h-5 ${xe.color}`,children:[e.jsx("span",{className:"mr-0.5",children:xe.icon}),xe.label]}),e.jsxs(W,{variant:"outline",className:`text-[10px] px-1.5 py-0 h-5 font-semibold ${J}`,children:[ee.relevanceScore,"% match"]})]}),e.jsx("p",{className:"text-sm leading-relaxed line-clamp-2 whitespace-pre-wrap",children:gg(ee.content,280)}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["by ",e.jsx("span",{className:"font-medium",children:ee.author})]})]}),e.jsx(is,{className:"align-top pt-4 text-right",children:e.jsx(h,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>window.open(ee.url,"_blank"),title:"View post",children:e.jsx(Ys,{className:"h-4 w-4"})})})]},E)})})]}),fe>1&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing ",(y-1)*f+1,"-",Math.min(y*f,Ne.length)," of ",Ne.length]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(h,{variant:"outline",size:"sm",className:"h-7 w-7 p-0",onClick:()=>N(ee=>Math.max(1,ee-1)),disabled:y===1,children:e.jsx(Mi,{className:"h-4 w-4"})}),e.jsx("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,fe)},(ee,E)=>{let xe;return fe<=5||y<=3?xe=E+1:y>=fe-2?xe=fe-4+E:xe=y-2+E,e.jsx(h,{variant:y===xe?"default":"outline",size:"sm",className:"h-7 w-7 p-0 text-xs",onClick:()=>N(xe),children:xe},xe)})}),e.jsx(h,{variant:"outline",size:"sm",className:"h-7 w-7 p-0",onClick:()=>N(ee=>Math.min(fe,ee+1)),disabled:y===fe,children:e.jsx($t,{className:"h-4 w-4"})})]})]})]})})]})]}):e.jsx("div",{className:"relative min-h-[400px]",children:e.jsx("div",{className:"absolute inset-0 bg-background/90 backdrop-blur-sm z-10 flex items-center justify-center rounded-lg",children:e.jsxs("div",{className:"text-center max-w-sm px-6",children:[e.jsx(_t,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Pro Feature"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Upgrade to a paid plan to track conversations about your product across social media"}),e.jsx(h,{onClick:()=>window.location.href="/payment",children:"Upgrade to Pro"})]})})})},bg=()=>{const s=a=>a>=60?"Excellent":a>=30?"Good":a>=0?"Neutral":a>=-30?"Concerning":"Critical";return{exportToPdf:async({pulseData:a,platformSentiment:r,productName:o})=>{const n=new ux,l=n.internal.pageSize.getWidth(),c=20;let x=20;const d=[30,41,59],u=[100,116,139],m=[34,197,94],p=[239,68,68],g=[234,179,8];n.setFillColor(30,41,59),n.rect(0,0,l,45,"F"),n.setTextColor(255,255,255),n.setFontSize(24),n.setFont("helvetica","bold"),n.text("Brand Image Report",c,25),n.setFontSize(11),n.setFont("helvetica","normal"),n.text(`${o||"Your Brand"} ⢠Generated ${at(new Date,"MMMM d, yyyy")}
47`,c,38),x=60,n.setFillColor(248,250,252),n.roundedRect(c,x,l-2*c,55,3,3,"F"),n.setTextColor(...d),n.setFontSize(14),n.setFont("helvetica","bold"),n.text("Executive Summary",c+10,x+15);const v=s(a.overallSentiment),b=a.overallSentiment>=30?m:a.overallSentiment>=0?g:p;n.setFontSize(36),n.setTextColor(...b),n.text(`${a.overallSentiment>0?"+":""}${a.overallSentiment}`,c+10,x+42),n.setFontSize(12),n.setTextColor(...u),n.text(`Brand Score: ${v}`,c+55,x+42),n.setFontSize(11),n.setTextColor(...d);const z=l/2+10;if(n.text(`Total Mentions: ${a.totalMentions}`,z,x+25),n.setTextColor(...m),n.text(`Positive: ${a.positive} (${Math.round(a.positive/a.totalMentions*100)}%)`,z,x+35),n.setTextColor(...g),n.text(`Neutral: ${a.neutral} (${Math.round(a.neutral/a.totalMentions*100)}%)`,z,x+45),n.setTextColor(...p),n.text(`Negative: ${a.negative} (${Math.round(a.negative/a.totalMentions*100)}%)`,z+80,x+45),x+=70,r.length>0&&(n.setTextColor(...d),n.setFontSize(14),n.setFont("helvetica","bold"),n.text("Platform Breakdown",c,x),x+=8,ro(n,{startY:x,head:[["Platform","Mentions","Score","Positive","Neutral","Negative"]],body:r.map(y=>[y.platform.charAt(0).toUpperCase()+y.platform.slice(1),y.mentions.toString(),`${y.sentiment>0?"+":""}${y.sentiment}`,`${y.positive} (${Math.round(y.positive/y.mentions*100)}%)`,`${y.neutral} (${Math.round(y.neutral/y.mentions*100)}%)`,`${y.negative} (${Math.round(y.negative/y.mentions*100)}%)`]),theme:"striped",headStyles:{fillColor:[30,41,59],textColor:[255,255,255],fontStyle:"bold"},alternateRowStyles:{fillColor:[248,250,252]},margin:{left:c,right:c},styles:{fontSize:10}}),x=n.lastAutoTable.finalY+15),a.conclusions&&a.conclusions.length>0&&(x>220&&(n.addPage(),x=20),n.setTextColor(...d),n.setFontSize(14),n.setFont("helvetica","bold"),n.text("AI Insights & Recommendations",c,x),x+=10,n.setFontSize(10),n.setFont("helvetica","normal"),n.setTextColor(...u),a.conclusions.forEach((y,N)=>{x>270&&(n.addPage(),x=20);const f=n.splitTextToSize(`${N+1}. ${y}`,l-2*c-10);n.text(f,c+5,x),x+=f.length*5+5}),x+=10),a.mentions.length>0){x>200&&(n.addPage(),x=20),n.setTextColor(...d),n.setFontSize(14),n.setFont("helvetica","bold"),n.text("Sample Mentions",c,x),x+=8;const y=a.mentions.slice(0,10);ro(n,{startY:x,head:[["Platform","Sentiment","Content"]],body:y.map(N=>[N.platform.charAt(0).toUpperCase()+N.platform.slice(1),N.sentiment.charAt(0).toUpperCase()+N.sentiment.slice(1),N.content.length>80?N.content.substring(0,80)+"...":N.content]),theme:"striped",headStyles:{fillColor:[30,41,59],textColor:[255,255,255],fontStyle:"bold"},alternateRowStyles:{fillColor:[248,250,252]},margin:{left:c,right:c},columnStyles:{0:{cellWidth:30},1:{cellWidth:25},2:{cellWidth:"auto"}},styles:{fontSize:9,cellPadding:3}})}const C=n.getNumberOfPages();for(let y=1;y<=C;y++)n.setPage(y),n.setFontSize(9),n.setTextColor(...u),n.text(`DESHILLER Brand Image Report ⢠Page ${y} of ${C}`,l/2,n.internal.pageSize.getHeight()-10,{align:"center"});const j=`brand-image-report-${at(new Date,"yyyy-MM-dd")}.pdf`;return n.save(j),j}}},jg=["all","twitter","linkedin","reddit","facebook","instagram","youtube","quora"],yg=[{value:"7",label:"Last 7 days"},{value:"30",label:"Last 30 days"},{value:"90",label:"Last 90 days"}],vg=({userId:s,isTrialExpired:t,isPaidUser:a})=>{const[r,o]=i.useState(!1),[n,l]=i.useState(!0),[c,x]=i.useState(null),[d,u]=i.useState([]),[m,p]=i.useState([]),[g,v]=i.useState(!0),[b,z]=i.useState([]),[C,j]=i.useState(""),[y,N]=i.useState(!1),[f,R]=i.useState(-30),[M,q]=i.useState(!1),[_,A]=i.useState("all"),[B,P]=i.useState("30"),[I,$]=i.useState(""),[be,Y]=i.useState(0),[O,he]=i.useState(0),[re,oe]=i.useState(null),[T,ce]=i.useState(!1),[le,F]=i.useState(!1),[L,K]=i.useState(!1),[ue,Ne]=i.useState(""),[fe,me]=i.useState(""),[Ie,Q]=i.useState(!1),[ne,ke]=i.useState(""),[ee,E]=i.useState(null),{exportToPdf:xe}=bg();i.useEffect(()=>{const G=async()=>{try{const{data:ts,error:As}=await w.from("social_pulse_scans").select("scan_data, updated_at").eq("user_id",s).single();if(ts&&!As){const Rs=ts.scan_data;x(Rs),oe(ts.updated_at)}}catch{}finally{l(!1)}},Fe=async()=>{try{const{data:ts}=await w.from("product_profiles").select("product_name").eq("user_id",s).single();ts!=null&&ts.product_name&&Ne(ts.product_name)}catch{}},He=async()=>{try{const{data:ts,error:As}=await w.from("pulse_scan_jobs").select("*").eq("user_id",s).eq("status","running").order("started_at",{ascending:!1}).limit(1).single();ts&&!As&&E(ts)}catch{}};G(),Fe(),He()},[s]),i.useEffect(()=>{if(!ee)return;const G=setInterval(async()=>{try{const{data:Fe,error:He}=await w.from("pulse_scan_jobs").select("*").eq("id",ee.id).single();if(Fe&&!He){const ts=Fe;if(ts.status==="completed"){E(null);const{data:As}=await w.from("social_pulse_scans").select("scan_data, updated_at").eq("user_id",s).single();As&&(x(As.scan_data),oe(As.updated_at)),k.success("24-hour scan completed! View your full results below.")}else E(ts)}}catch{}},3e4);return()=>clearInterval(G)},[ee,s]),i.useEffect(()=>{(async()=>{try{const{data:Fe,error:He}=await w.from("sentiment_history").select("*").eq("user_id",s).order("scan_date",{ascending:!0}).limit(30);if(He)throw He;const ts=(Fe||[]).map(As=>({date:at(new Date(As.scan_date),"MMM d"),sentiment:As.overall_sentiment,mentions:As.total_mentions,positive:As.positive_count,negative:As.negative_count,neutral:As.neutral_count}));p(ts)}catch{}finally{v(!1)}})()},[s]),i.useEffect(()=>{(async()=>{try{const{data:Fe,error:He}=await w.from("notification_preferences").select("sentiment_alerts_enabled, sentiment_alert_threshold, weekly_pulse_report_enabled").eq("user_id",s).single();Fe&&(N(Fe.sentiment_alerts_enabled||!1),R(Fe.sentiment_alert_threshold||-30),ce(Fe.weekly_pulse_report_enabled||!1))}catch{}})()},[s]);const ve=async(G,Fe)=>{q(!0);try{const{error:He}=await w.from("notification_preferences").upsert({user_id:s,sentiment_alerts_enabled:G,sentiment_alert_threshold:Fe},{onConflict:"user_id"});if(He)throw He;k.success(G?"Sentiment alerts enabled":"Sentiment alerts disabled")}catch{k.error("Failed to save alert settings")}finally{q(!1)}},S=G=>{N(G),ve(G,f)},J=G=>{const Fe=G[0];R(Fe)},je=()=>{y&&ve(y,f)},se=async G=>{ce(G),F(!0);try{const{error:Fe}=await w.from("notification_preferences").upsert({user_id:s,weekly_pulse_report_enabled:G},{onConflict:"user_id"});if(Fe)throw Fe;k.success(G?"Weekly pulse reports enabled":"Weekly pulse reports disabled")}catch{k.error("Failed to save setting"),ce(!G)}finally{F(!1)}},Oe=()=>{const G=C.trim();G&&!b.includes(G)&&b.length<3?(z([...b,G]),j("")):b.length>=3&&k.error("Maximum 3 competitors allowed")},We=G=>{z(b.filter(Fe=>Fe!==G))},H=async()=>
47{if(!c){k.error("No data to export. Please run a scan first.");return}K(!0);try{const G=await xe({pulseData:c,platformSentiment:D,productName:ue||"Your Brand"});k.success(`Report downloaded: ${G}`)}catch{k.error("Failed to generate PDF report")}finally{K(!1)}},ae=fe||ue,ze=()=>{ne.trim()&&(me(ne.trim()),Q(!1),k.success(`Brand name set to "${ne.trim()}"`))},pe=()=>{ke(fe||ue),Q(!0)},Ae=c!=null&&c.competitors&&c.competitors.length>0?(()=>{const G=c.totalMentions+c.competitors.reduce((He,ts)=>He+ts.totalMentions,0);return G===0?null:[{name:"Your Brand",mentions:c.totalMentions,share:Math.round(c.totalMentions/G*100)},...c.competitors.map(He=>({name:He.brand,mentions:He.totalMentions,share:Math.round(He.totalMentions/G*100)}))]})():null,Ee=async()=>{if(!ae){k.error("Please set a brand name to scan");return}if(ee){k.info("A 24-hour scan is already in progress. Please wait for it to complete.");return}o(!0),$("Starting 24-hour deep scan...");try{const{data:{session:G}}=await w.auth.getSession();if(!G){k.error("Please sign in to scan");return}const{data:Fe}=await w.from("platform_preferences").select("keywords").eq("user_id",s),He=(Fe==null?void 0:Fe.flatMap(Rs=>Rs.keywords||[]))||[],{data:ts,error:As}=await w.from("pulse_scan_jobs").insert({user_id:s,brand_name:ae,keywords:He,competitors:b,status:"running"}).select().single();if(As)throw As;E(ts),k.success(`24-hour scan started for "${ae}". Results will accumulate over the next 24 hours with hourly searches. Check back anytime to see progress!`)}catch{k.error("Failed to start scan")}finally{o(!1),$("")}},ls=G=>G>=75?{label:"Excellent",sublabel:"Strong positive perception",color:"text-green-500",bgColor:"bg-green-500"}:G>=60?{label:"Good",sublabel:"Generally positive perception",color:"text-emerald-500",bgColor:"bg-emerald-500"}:G>=45?{label:"Neutral",sublabel:"Mixed perception, room to improve",color:"text-yellow-500",bgColor:"bg-yellow-500"}:G>=30?{label:"Concerning",sublabel:"Negative signals worth addressing",color:"text-orange-500",bgColor:"bg-orange-500"}:{label:"Critical",sublabel:"Reputation risk: investigate and respond",color:"text-red-500",bgColor:"bg-red-500"},ss=G=>{switch(G.toLowerCase()){case"twitter":case"x":return e.jsx(rt,{className:"h-5 w-5"});case"linkedin":return e.jsx(Zs,{className:"h-5 w-5"});case"reddit":return e.jsx(St,{className:"h-5 w-5"});case"facebook":return e.jsx(Wt,{className:"h-5 w-5"});case"instagram":return e.jsx(Fc,{className:"h-5 w-5"});case"youtube":return e.jsx(Pi,{className:"h-5 w-5"});case"tiktok":return e.jsx(Nt,{className:"h-5 w-5"});default:return e.jsx(bt,{className:"h-5 w-5"})}},$s=G=>{switch(G){case"positive":return e.jsx(xa,{className:"h-4 w-4 text-green-500"});case"negative":return e.jsx(vr,{className:"h-4 w-4 text-red-500"});default:return e.jsx(Vn,{className:"h-4 w-4 text-yellow-500"})}},Xs=G=>{switch(G){case"positive":return"bg-green-500/10 text-green-600 border-green-500/20";case"negative":return"bg-red-500/10 text-red-600 border-red-500/20";default:return"bg-yellow-500/10 text-yellow-600 border-yellow-500/20"}},xs=(c==null?void 0:c.mentions)||d,de=_==="all"?xs:xs.filter(G=>G.platform.toLowerCase()===_),D=xs.length>0?["twitter","linkedin","reddit","facebook","instagram","youtube","tiktok"].map(Fe=>{const He=xs.filter(Ue=>Ue.platform.toLowerCase()===Fe);if(He.length===0)return null;const ts=He.filter(Ue=>Ue.sentiment==="positive").length,As=He.filter(Ue=>Ue.sentiment==="negative").length,Rs=He.filter(Ue=>Ue.sentiment==="neutral").length,ge=Math.round(He.reduce((Ue,vs)=>Ue+vs.score,0)/He.length);return{platform:Fe,mentions:He.length,positive:ts,negative:As,neutral:Rs,sentiment:ge}}).filter(Boolean):[],te=c?[{name:"Positive",value:c.positive,color:"#22c55e"},{name:"Neutral",value:c.neutral,color:"#eab308"},{name:"Negative",value:c.negative,color:"#ef4444"}]:[],X=c?c.brandImageScore??c.overallSentiment:0,ie=c?[{name:"Brand Image",value:Math.max(0,Math.min(100,X)),fill:X>=75?"#22c55e":X>=60?"#10b981":X>=45?"#eab308":X>=30?"#f97316":"#ef4444"}]:[],_e=["hsl(var(--primary))","#f97316","#8b5cf6","#06b6d4","#ec4899"],Me=c!=null&&c.competitors?[{name:"Your Brand",sentiment:c.overallSentiment,mentions:c.totalMentions,positive:c.positive,negative:c.negative,neutral:c.neutral}
47,...c.competitors.map(G=>({name:G.brand,sentiment:G.overallSentiment,mentions:G.totalMentions,positive:G.positive,negative:G.negative,neutral:G.neutral}))]:null;if(t&&!a)return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl sm:text-3xl font-display font-semibold",children:"Brand Image Monitor"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Understand how your brand is perceived online"})]})}),e.jsx(U,{className:"border-dashed",children:e.jsxs(ye,{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(Ss,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Upgrade to Access Brand Image Monitor"}),e.jsx("p",{className:"text-muted-foreground mb-4 max-w-md",children:"Track your brand's perception and reputation across all platforms with a paid subscription."}),e.jsx(h,{onClick:()=>window.location.href="/payment",children:"Upgrade Now"})]})})]});if(n)return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl sm:text-3xl font-display font-semibold",children:"Brand Image Monitor"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Loading saved data..."})]})}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[1,2,3,4].map(G=>e.jsx(Ws,{className:"h-48"},G))})]});const Ge=c?ls(X):null;return e.jsxs(Pr,{icon:Ga,eyebrow:"Engage",eyebrowAccent:"Brand monitor",title:"Brand Image Monitor",description:re?`Understand how your brand is perceived across the web · Last scan: ${at(new Date(re),"MMM d, h:mm a")}`:"Understand how your brand is perceived across the web",headerActions:e.jsxs(e.Fragment,{children:[c&&e.jsx(h,{onClick:H,disabled:L,variant:"outline",size:"sm",children:L?e.jsxs(e.Fragment,{children:[e.jsx(st,{className:"mr-2 h-4 w-4 animate-spin"}),"Exporting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ut,{className:"mr-2 h-4 w-4"}),"Export PDF"]})}),e.jsx(h,{onClick:Ee,disabled:r||!ae,size:"sm",children:r?e.jsxs(e.Fragment,{children:[e.jsx(st,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyzing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Bt,{className:"mr-2 h-4 w-4"}),c?"Rescan":"Analyze"]})})]}),children:[e.jsx(U,{className:"border-dashed",children:e.jsx(ye,{className:"py-4",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ks,{className:"h-5 w-5 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Scanning brand:"}),Ie?e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(Je,{value:ne,onChange:G=>ke(G.target.value),placeholder:"Enter brand name...",className:"w-48 h-8 text-sm",autoFocus:!0,onKeyDown:G=>G.key==="Enter"&&ze()}),e.jsx(h,{size:"sm",variant:"ghost",onClick:ze,disabled:!ne.trim(),children:e.jsx(bs,{className:"h-4 w-4"})}),e.jsx(h,{size:"sm",variant:"ghost",onClick:()=>Q(!1),children:e.jsx(zs,{className:"h-4 w-4"})})]}):e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("span",{className:"font-semibold text-lg",children:ae||"Not set"}),e.jsx(h,{size:"sm",variant:"ghost",onClick:pe,className:"h-7 px-2",children:e.jsx(Di,{className:"h-3.5 w-3.5"})})]})]})]}),!ae&&e.jsx(W,{variant:"destructive",children:"Set a brand name to scan"})]})})}),ee&&e.jsx(U,{className:"border-primary/30 bg-gradient-to-r from-primary/10 to-primary/5",children:e.jsxs(ye,{className:"py-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Cs,{className:"h-6 w-6 text-primary"}),e.jsxs("span",{className:"absolute -top-1 -right-1 flex h-3 w-3",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-primary"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold",children:"24-Hour Scan in Progress"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:['Scanning "',ee.brand_name,'" across all platforms']})]})]}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-2xl font-bold text-primary",children:[ee.hours_completed,"/24"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Hours Complete"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-2xl font-bold",children:ee.total_mentions_count}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Mentions Found"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(xa,{
47className:"h-3 w-3 text-green-500"}),ee.positive_count]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Vn,{className:"h-3 w-3 text-yellow-500"}),ee.neutral_count]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(vr,{className:"h-3 w-3 text-red-500"}),ee.negative_count]})]})]})]}),e.jsxs("div",{className:"mt-3",children:[e.jsx(zt,{value:ee.hours_completed/24*100,className:"h-2"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Started ",at(new Date(ee.started_at),"MMM d, h:mm a")," ·"," ","Estimated completion: ",at(new Date(new Date(ee.started_at).getTime()+24*60*60*1e3),"MMM d, h:mm a")]})]})]})}),r&&e.jsx(U,{className:"border-primary/30 bg-primary/5",children:e.jsx(ye,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(st,{className:"h-5 w-5 animate-spin text-primary"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium",children:I||"Analyzing brand perception..."}),e.jsx(zt,{value:be,className:"mt-2 h-2"}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center justify-between gap-2 mt-1",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Cs,{className:"h-3 w-3"}),"This can take a couple minutes for large scans"]}),e.jsx("span",{children:"Target: 500+"})]})]}),e.jsxs(W,{variant:"secondary",className:"text-xs",children:[O.toLocaleString()," mentions found"]})]})})}),e.jsxs(U,{className:"overflow-hidden",children:[e.jsx(Be,{className:"pb-2",children:e.jsxs($e,{className:"text-lg flex items-center gap-2",children:[e.jsx(Bc,{className:"h-5 w-5 text-primary"}),"Your Brand Image Score"]})}),e.jsx(ye,{children:c?e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center py-4",children:[e.jsxs("div",{className:"relative w-48 h-48",children:[e.jsx(ea,{width:"100%",height:"100%",children:e.jsx(hx,{cx:"50%",cy:"50%",innerRadius:"70%",outerRadius:"100%",barSize:15,data:ie,startAngle:180,endAngle:0,children:e.jsx(px,{background:{fill:"hsl(var(--muted))"},dataKey:"value",cornerRadius:10})})}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsx("span",{className:`text-4xl font-bold ${Ge==null?void 0:Ge.color}`,children:Math.round(X)}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"out of 100"})]})]}),e.jsxs("div",{className:"text-center mt-4",children:[e.jsx("p",{className:`text-2xl font-semibold ${Ge==null?void 0:Ge.color}`,children:Ge==null?void 0:Ge.label}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:Ge==null?void 0:Ge.sublabel})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 rounded-xl bg-muted/30 border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(ms,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Total Mentions"})]}),e.jsx("p",{className:"text-3xl font-bold",children:c.totalMentions.toLocaleString()}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"across all platforms"})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-green-500/10 border border-green-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(xa,{className:"h-4 w-4 text-green-500"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Positive"})]}),e.jsx("p",{className:"text-3xl font-bold text-green-500",children:c.positive.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c.totalMentions>0?Math.round(c.positive/c.totalMentions*100):0,"% of mentions"]})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-yellow-500/10 border border-yellow-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Vn,{className:"h-4 w-4 text-yellow-500"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Neutral"})]}),e.jsx("p",{className:"text-3xl font-bold text-yellow-500",children:c.neutral.toLocaleStr
47ing()}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c.totalMentions>0?Math.round(c.neutral/c.totalMentions*100):0,"% of mentions"]})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-red-500/10 border border-red-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(vr,{className:"h-4 w-4 text-red-500"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Negative"})]}),e.jsx("p",{className:"text-3xl font-bold text-red-500",children:c.negative.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c.totalMentions>0?Math.round(c.negative/c.totalMentions*100):0,"% of mentions"]})]})]}),e.jsx("div",{className:"mt-6 flex justify-center",children:e.jsxs(h,{onClick:Ee,disabled:r,variant:"outline",size:"lg",children:[e.jsx(st,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Run Again"]})})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(Bt,{className:"h-16 w-16 text-muted-foreground/30 mb-4"}),e.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"No brand image data yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'Click "Analyze Brand Image" to see how your brand is perceived'})]})})]}),c&&c.engagementTotal&&e.jsxs(U,{children:[e.jsx(Be,{className:"pb-2",children:e.jsxs($e,{className:"text-lg flex items-center gap-2",children:[e.jsx(ws,{className:"h-5 w-5 text-primary"}),"Total Engagement Reach"]})}),e.jsxs(ye,{children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-4 rounded-xl bg-pink-500/10 border border-pink-500/20 text-center",children:[e.jsx(Pa,{className:"h-6 w-6 text-pink-500 mx-auto mb-2"}),e.jsx("p",{className:"text-3xl font-bold text-pink-500",children:c.engagementTotal.likes.toLocaleString()}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Likes"})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-blue-500/10 border border-blue-500/20 text-center",children:[e.jsx(ms,{className:"h-6 w-6 text-blue-500 mx-auto mb-2"}),e.jsx("p",{className:"text-3xl font-bold text-blue-500",children:c.engagementTotal.comments.toLocaleString()}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Comments"})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-purple-500/10 border border-purple-500/20 text-center",children:[e.jsx(lr,{className:"h-6 w-6 text-purple-500 mx-auto mb-2"}),e.jsx("p",{className:"text-3xl font-bold text-purple-500",children:c.engagementTotal.shares.toLocaleString()}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Shares"})]})]}),e.jsx("div",{className:"mt-4 p-3 rounded-lg bg-muted/30 text-center",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Combined reach of ",e.jsx("span",{className:"font-bold text-foreground",children:(c.engagementTotal.likes+c.engagementTotal.comments+c.engagementTotal.shares).toLocaleString()})," engagements across all platforms"]})})]})]}),c&&c.totalMentions>0&&e.jsxs(U,{children:[e.jsx(Be,{children:e.jsxs($e,{className:"text-lg flex items-center gap-2",children:[e.jsx(gx,{className:"h-5 w-5 text-primary"}),"Sentiment Breakdown"]})}),e.jsx(ye,{children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsx("div",{className:"h-[280px] flex items-center justify-center",children:e.jsx(ea,{width:"100%",height:"100%",children:e.jsxs(dn,{children:[e.jsx(mn,{data:te,cx:"50%",cy:"50%",innerRadius:70,outerRadius:110,paddingAngle:4,dataKey:"value",label:({name:G,percent:Fe})=>`${G} ${(Fe*100).toFixed(0)}%`,labelLine:!1,children:te.map((G,Fe)=>e.jsx(Er,{fill:G.color},`cell-${Fe}`))}),e.jsx(ma,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}})]})})}),e.jsxs("div",{className:"flex flex-col justify-center space-y-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500"}),e.jsx("span",{className:"font-medium",children:"Positive Perception"})]}),e.jsxs("span",{className:"text-green-500 font-bold",children:[Math.round(c.positive/c.totalMentions*100),"%"]})]}),e.jsx(zt,{value:c.positive/c.totalMentions*100,className:"h-3 bg-muted [&>div]:bg-green-500"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c.positive.toLocaleStr
47ing()," mentions praise your brand, product, or service"]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),e.jsx("span",{className:"font-medium",children:"Neutral Perception"})]}),e.jsxs("span",{className:"text-yellow-500 font-bold",children:[Math.round(c.neutral/c.totalMentions*100),"%"]})]}),e.jsx(zt,{value:c.neutral/c.totalMentions*100,className:"h-3 bg-muted [&>div]:bg-yellow-500"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c.neutral.toLocaleString()," mentions are informational or without strong sentiment"]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),e.jsx("span",{className:"font-medium",children:"Negative Perception"})]}),e.jsxs("span",{className:"text-red-500 font-bold",children:[Math.round(c.negative/c.totalMentions*100),"%"]})]}),e.jsx(zt,{value:c.negative/c.totalMentions*100,className:"h-3 bg-muted [&>div]:bg-red-500"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c.negative.toLocaleString()," mentions express concerns, complaints, or criticism"]})]})]})]})})]}),D.length>0&&e.jsxs(U,{children:[e.jsx(Be,{children:e.jsxs($e,{className:"text-lg flex items-center gap-2",children:[e.jsx(bt,{className:"h-5 w-5 text-primary"}),"Platform Reputation"]})}),e.jsxs(ye,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"See where your brand image is strongest and where it needs attention"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:D.map(G=>{const Fe=G.sentiment>=30?"Strong":G.sentiment>=0?"Neutral":G.sentiment>=-30?"Weak":"Critical",He=G.sentiment>=30?"text-green-500":G.sentiment>=0?"text-yellow-500":G.sentiment>=-30?"text-orange-500":"text-red-500",ts=G.sentiment>=30?"bg-green-500/5 border-green-500/20":G.sentiment>=0?"bg-yellow-500/5 border-yellow-500/20":G.sentiment>=-30?"bg-orange-500/5 border-orange-500/20":"bg-red-500/5 border-red-500/20",As=G.sentiment>=30?"text-green-500":G.sentiment>=0?"text-yellow-500":G.sentiment>=-30?"text-orange-500":"text-red-500";return e.jsxs("div",{className:`p-5 rounded-xl border-2 ${ts} transition-all hover:scale-[1.02]`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("div",{className:`p-2 rounded-lg bg-background ${As}`,children:ss(G.platform)}),e.jsx(W,{variant:"outline",className:`${He} border-current`,children:Fe})]}),e.jsx("h4",{className:"font-semibold capitalize text-lg mb-1",children:G.platform}),e.jsxs("div",{className:"space-y-3 mt-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between text-sm mb-1",children:[e.jsx("span",{className:"text-muted-foreground",children:"Reputation Score"}),e.jsxs("span",{className:`font-bold ${He}`,children:[G.sentiment>0?"+":"",G.sentiment]})]}),e.jsx("div",{className:"h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full transition-all ${G.sentiment>=30?"bg-green-500":G.sentiment>=0?"bg-yellow-500":G.sentiment>=-30?"bg-orange-500":"bg-red-500"}`,style:{width:`${Math.max(5,(G.sentiment+100)/200*100)}%`}})})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm pt-2 border-t border-border/50",children:[e.jsxs("span",{className:"text-muted-foreground",children:[G.mentions.toLocaleString()," mentions"]}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsx("span",{className:"text-green-500 font-medium",children:G.positive.toLocaleString()}),e.jsx("span",{className:"text-muted-foreground",children:"/"}),e.jsx("span",{className:"text-yellow-500 font-medium",children:G.neutral.toLocaleString()}),e.jsx("span",{className:"text-muted-foreground",children:"/"}),e.jsx("span",{className:"text-red-500 font-medium",children:G.negative.toLocaleString()})]})]})]})]},G.platform)})})]})]}),c&&c.keywordSentiment&&c.keywordSentiment.length>0&&e.jsxs(U,{children:[e.jsx(Be,{children:e.jsxs($e,{className:"text-lg flex items-center gap-2",children:[e.jsx(ks,{className:"h-5 w-5 text-primary"}),"Topic Perception Map"]})}),e.jsxs(ye,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Discover which topics drive positive vs negative perception of your brand"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"p-4 rounded-xl bg-green-500/5 border border-green-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(Pa,{className:"h-5 w-5 text-green-500"}),e.jsx("h4",{className:"font-semibold text-green-600",children:"What People Love"})]}),e.jsxs("div",{className:"space-y-3",children:[c.keywordSentiment.filter(G=>G.sentiment>0).sort((G,Fe)=>Fe.sentiment-G.sentiment).slice(0,5).map(G=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-background/50 rounded-lg",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(W,{variant:"secondary",className:"font-mono text-sm bg-green-500/10 text-green-600 border-green-500/20",children:G.keyword})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[G.mentions," mentions"]}),e.jsxs("span",{className:"text-green-500 font-bold",children:["+",G.sentiment]})]})]},G.keyword)),c.keywordSentiment.filter(G=>G.sentiment>0).length===0&&e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No strongly positive topics detected"})]})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-red-500/5 border border-red-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(Ss,{className:"h-5 w-5 text-red-500"}),e.jsx("h4",{className:"font-semibold text-red-600",children:"Areas Needing Attention"})]}),e.jsxs("div",{className:"space-y-3",children:[c.keywordSentiment.filter(G=>G.sentiment<0).sort((G,Fe)=>G.sentiment-Fe.sentiment).slice(0,5).map(G=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-background/50 rounded-lg",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(W,{variant:"secondary",className:"font-mono text-sm bg-red-500/10 text-red-600 border-red-500/20",children:G.keyword})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[G.mentions," mentions"]}),e.jsx("span",{className:"text-red-500 font-bold",children:G.sentiment})]})]},G.keyword)),c.keywordSentiment.filter(G=>G.sentiment<0).length===0&&e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No concerning topics detected"})]})]})]})]})]}),(c==null?void 0:c.conclusions)&&c.conclusions.length>0&&e.jsxs(U,{className:"border-primary/20 bg-primary/5",children:[e.jsx(Be,{children:e.jsxs($e,{className:"text-lg flex items-center gap-2",children:[e.jsx(za,{className:"h-5 w-5 text-primary"}),"AI Brand Image Insights"]})}),e.jsx(ye,{children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:c.conclusions.map((G,Fe)=>e.jsxs("div",{className:"flex gap-3 p-4 rounded-xl bg-background/50 border border-border/50",children:[e.jsx("span",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary/20 text-primary text-sm font-bold flex items-center justify-center",children:Fe+1}
47),e.jsx("p",{className:"text-sm text-foreground/90 leading-relaxed",children:G})]},Fe))})})]}),Me&&Me.length>1&&e.jsxs(U,{children:[e.jsx(Be,{children:e.jsxs($e,{className:"text-lg flex items-center gap-2",children:[e.jsx(Es,{className:"h-5 w-5 text-primary"}),"Competitor Comparison"]})}),e.jsxs(ye,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"See how your brand stacks up against competitors across key metrics"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-medium mb-4 flex items-center gap-2",children:[e.jsx(ks,{className:"h-4 w-4 text-muted-foreground"}),"Brand Image Score"]}),e.jsx("div",{className:"h-[250px] w-full",children:e.jsx(ea,{width:"100%",height:"100%",children:e.jsxs(Ri,{data:Me,margin:{top:10,right:10,left:-20,bottom:5},children:[e.jsx(ar,{strokeDasharray:"3 3",className:"stroke-border/50"}),e.jsx(rr,{dataKey:"name",tick:{fontSize:11},className:"text-muted-foreground",angle:-15,textAnchor:"end",height:60}),e.jsx(nr,{domain:[-100,100],tick:{fontSize:12},className:"text-muted-foreground"}),e.jsx(ma,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"},labelStyle:{color:"hsl(var(--foreground))"},formatter:G=>[G>0?`+${G}`:G,"Score"]}),e.jsx(Nr,{dataKey:"sentiment",name:"Brand Image Score",radius:[4,4,0,0],children:Me.map((G,Fe)=>e.jsx(Er,{fill:_e[Fe]},`cell-${Fe}`))})]})})})]}),e.jsx("div",{className:"space-y-3",children:Me.map((G,Fe)=>{const He=Fe===0,ts=G.mentions>0?Math.round(G.positive/G.mentions*100):0,As=G.mentions>0?Math.round(G.negative/G.mentions*100):0;return e.jsxs("div",{className:`p-4 rounded-xl border-2 transition-all ${He?"bg-primary/5 border-primary/30":"bg-muted/20 border-border/50"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:_e[Fe]}}),e.jsx("span",{className:`font-semibold ${He?"text-primary":""}`,children:G.name}),He&&e.jsx(W,{variant:"default",className:"text-xs",children:"You"})]}),e.jsxs("span",{className:`text-xl font-bold ${G.sentiment>=30?"text-green-500":G.sentiment>=0?"text-yellow-500":"text-red-500"}`,children:[G.sentiment>0?"+":"",G.sentiment]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 text-center",children:[e.jsxs("div",{className:"p-2 rounded-lg bg-background/50",children:[e.jsx("p",{className:"text-lg font-semibold",children:G.mentions}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Mentions"})]}),e.jsxs("div",{className:"p-2 rounded-lg bg-green-500/10",children:[e.jsxs("p",{className:"text-lg font-semibold text-green-500",children:[ts,"%"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Positive"})]}),e.jsxs("div",{className:"p-2 rounded-lg bg-red-500/10",children:[e.jsxs("p",{className:"text-lg font-semibold text-red-500",children:[As,"%"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Negative"})]})]})]},G.name)})})]})]})]}),Ae&&Ae.length>1&&e.jsxs(U,{children:[e.jsx(Be,{children:e.jsxs($e,{className:"text-lg flex items-center gap-2",children:[e.jsx(Nt,{className:"h-5 w-5 text-primary"}),"Share of Voice"]})}),e.jsxs(ye,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Your brand's visibility compared to competitors based on mention volume"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsx("div",{className:"h-[280px] flex items-center justify-center",children:e.jsx(ea,{width:"100%",height:"100%",children:e.jsxs(dn,{children:[e.jsx(mn,{data:Ae,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:3,dataKey:"mentions",label:({payload:G})=>`${G.name}: ${G.share}%`,labelLine:!1,children:Ae.map((G,Fe)=>e.jsx(Er,{fill:_e[Fe]},`sov-cell-${Fe}`))}),e.jsx(ma,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"},formatter:(G,Fe,He)=>[`${G} mentions (${He.payload.share}%)`,He.payload.name]})]})})}),e.jsx("div",{className:"flex flex-col justify-center space-y-4",children:Ae.map((G,Fe)=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:_e[Fe]}}),e.jsx("span",{className:`font-medium ${Fe===0?"text-primary":""}`,children:G.name}),Fe===0&&e.jsx(W,{variant:"default",className:"text-xs ml-1",children:"You"})]}),e.jsxs("span",{className:"font-bold text-lg",children:[G.share,"%"]})]}),e.jsx("div",{className:"relative h-4 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${G.share}%`,backgroundColor:_e[Fe]}})}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[G.mentions," total mentions"]})]},G.name))})]})]})]}),e.jsxs(U,{children:[e.jsx(Be,{children:e.jsxs($e,{className:"text-lg flex items-center gap-2",children:[e.jsx(cr,{className:"h-5 w-5 text-primary"}),"Brand Image Over Time"]})}),e.jsx(ye,{children:g?e.jsx(Ws,{className:"h-[200px] w-full"}):m.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ea,{className:"h-12 w-12 mx-auto mb-3 opacity-50"}),e.jsx("p",{children:"No historical data yet"}),e.jsx("p",{className:"text-sm mt-1",children:"Scan your brand image to start tracking perception over time"})]}):e.jsx("div",{className:"h-[200px] w-full",children:e.jsx(ea,{width:"100%",height:"100%",children:e.jsxs($c,{data:m,margin:{top:10,right:10,left:-20,bottom:0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"sentimentGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",
47stopColor:"hsl(var(--primary))",stopOpacity:.3}),e.jsx("stop",{offset:"95%",stopColor:"hsl(var(--primary))",stopOpacity:0})]})}),e.jsx(ar,{strokeDasharray:"3 3",className:"stroke-border/50"}),e.jsx(rr,{dataKey:"date",tick:{fontSize:12},className:"text-muted-foreground",tickLine:!1}),e.jsx(nr,{domain:[-100,100],tick:{fontSize:12},className:"text-muted-foreground",tickLine:!1,axisLine:!1}),e.jsx(ma,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"},labelStyle:{color:"hsl(var(--foreground))"}}),e.jsx(vi,{type:"monotone",dataKey:"sentiment",stroke:"hsl(var(--primary))",fill:"url(#sentimentGradient)",strokeWidth:2,name:"Brand Image Score"})]})})})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs(U,{children:[e.jsx(Be,{className:"pb-3",children:e.jsxs($e,{className:"text-sm flex items-center gap-2",children:[e.jsx(Es,{className:"h-4 w-4"}),"Compare Competitors"]})}),e.jsxs(ye,{children:[e.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:b.map((G,Fe)=>e.jsxs(W,{variant:"secondary",className:"px-2 py-1 text-xs",style:{borderLeft:`3px solid ${_e[Fe+1]}`},children:[G,e.jsx("button",{onClick:()=>We(G),className:"ml-1.5 hover:text-destructive",children:e.jsx(zs,{className:"h-3 w-3"})})]},G))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Je,{placeholder:"Competitor name...",value:C,onChange:G=>j(G.target.value),onKeyDown:G=>G.key==="Enter"&&Oe(),className:"flex-1 text-sm",disabled:b.length>=3}),e.jsx(h,{onClick:Oe,disabled:b.length>=3||!C.trim(),size:"sm",children:e.jsx(ft,{className:"h-4 w-4"})})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[b.length,"/3 competitors added"]})]})]}),e.jsxs(U,{children:[e.jsx(Be,{className:"pb-3",children:e.jsxs($e,{className:"text-sm flex items-center gap-2",children:[y?e.jsx($a,{className:"h-4 w-4"}):e.jsx(fx,{className:"h-4 w-4 text-muted-foreground"}),"Reputation Alerts"]})}),e.jsxs(ye,{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx(Ce,{htmlFor:"alerts-toggle",className:"text-sm",children:"Email when score drops"}),e.jsx(Js,{id:"alerts-toggle",checked:y,onCheckedChange:S,disabled:M})]}),y&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:"Alert threshold"}),e.jsx("span",{className:"font-medium text-red-500",children:f})]}),e.jsx(Kt,{value:[f],onValueChange:J,onValueCommit:je,min:-80,max:0,step:5})]})]})]}),e.jsxs(U,{children:[e.jsx(Be,{className:"pb-3",children:e.jsxs($e,{className:"text-sm flex items-center gap-2",children:[e.jsx(Ea,{className:"h-4 w-4"}),"Weekly Report"]})}),e.jsxs(ye,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Ce,{htmlFor:"weekly-report-toggle",className:"text-sm",children:"Email weekly summary"}),e.jsx(Js,{id:"weekly-report-toggle",checked:T,onCheckedChange:se,disabled:le||!c})]}),!c&&e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Scan first to enable"})]})]})]}),e.jsxs(U,{children:[e.jsx(Be,{children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[e.jsxs($e,{className:"text-lg flex items-center gap-2",children:[e.jsx(Nt,{className:"h-5 w-5 text-primary"}),"Recent Mentions",r&&e.jsx(st,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),e.jsxs("div",{className:"flex items-center gap-2 mr-4",children:[e.jsx(Ea,{className:"h-4 w-4 text-muted-foreground"}),yg.map(G=>e.jsx(h,{variant:B===G.value?"default":"outline",size:"sm",onClick:()=>P(G.value),className:"h-7 text-xs",children:G.label},G.value))]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(Ta,{className:"h-4 w-4 text-muted-foreground"}),jg.map(G=>e.jsxs(h,{variant:_===G?"default":"outline",size:"sm",onClick:()=>A(G),className:"h-7 text-xs",children:[G==="all"&&e.jsx(bt,{className:"h-3 w-3 mr-1"}),G==="twitter"&&e.jsx(rt,{className:"h-3 w-3 mr-1"}),G==="linkedin"&&e.jsx(Zs,{className:"h-3 w-3 mr-1"}),G==="reddit"&&e.jsx(St,{className:"h-3 w-3 mr-1"}),G==="facebook"&&e.jsx(Wt,{className:"h-3 w-3 mr-1"}),G==="all"?"All":G.charAt(0).toUpperCase()+G.slice(1)]},G))]})]})}),e.jsx(ye,{children:de.length===0&&!r?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Nt,{className:"h-12 w-12 mx-auto mb-3 opacity-50"}
47),e.jsx("p",{children:_==="all"?"No mentions found yet":`No ${_} mentions found`}),e.jsx("p",{className:"text-sm mt-1",children:_==="all"?'Click "Analyze Brand Image" to search for mentions':'Try selecting "All" to see mentions from all platforms'})]}):e.jsxs("div",{className:"space-y-3",children:[de.slice(0,20).map((G,Fe)=>e.jsx("div",{className:"p-4 rounded-lg border border-border/50 hover:border-border transition-colors",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[ss(G.platform),e.jsx("span",{className:"text-sm font-medium",children:G.platform}),e.jsxs(W,{variant:"outline",className:`${Xs(G.sentiment)} text-xs`,children:[$s(G.sentiment),e.jsx("span",{className:"ml-1",children:G.sentiment})]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Score: ",G.score]})]}),e.jsx("p",{className:"text-sm text-foreground/90 line-clamp-2",children:(()=>{let He=G.content||"";return He=He.replace(/<[^>]*>?/g," "),He=He.replace(/https?:\/\/\S+/gi,""),He=He.replace(/data:[^\s]+/g,""),He=He.replace(/[a-zA-Z0-9+/]{30,}={0,2}/g,""),He=He.replace(/\b(?:svelte|favicon|css|img|src|href|class|style|uddg|onerror)\b[-\w]*/gi,""),He=He.replace(/%[0-9A-Fa-f]{2}/g,""),He=He.replace(/[=>"<(){}\[\]\\]{2,}/g," "),He=He.replace(/\s+/g," ").trim(),He||"Content not available"})()}),e.jsx("div",{className:"flex items-center gap-2 mt-2",children:e.jsxs("span",{className:"text-xs text-muted-foreground",children:["by ",G.author]})})]}),G.url&&e.jsx(h,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx("a",{href:G.url,target:"_blank",rel:"noopener noreferrer",children:"View"})})]})},G.id||Fe)),de.length>20&&e.jsxs("p",{className:"text-center text-sm text-muted-foreground py-2",children:["Showing 20 of ",de.length," mentions"]})]})})]})]})};function Ng(s){return s.split(" ").map(t=>t[0]).filter(Boolean).slice(0,2).join("").toUpperCase()}function wg(s){var l,c,x,d;const t=[],a=u=>{u&&u.startsWith("http")&&!t.includes(u)&&t.push(u)};a(s.profilePic),a(s.avatarUrl);const r=((c=(l=s.linkedinUrl)==null?void 0:l.match(/linkedin\.com\/(?:[a-z]{2}\/)?(?:in|pub)\/([^/?#]+)/i))==null?void 0:c[1])||((d=(x=s.profileUrl)==null?void 0:x.match(/linkedin\.com\/(?:[a-z]{2}\/)?(?:in|pub)\/([^/?#]+)/i))==null?void 0:d[1])||"";r&&a(`https://unavatar.io/linkedin/${encodeURIComponent(r)}`);const o=s.username||"";s.platform==="linkedin"&&o&&a(`https://unavatar.io/linkedin/${encodeURIComponent(o)}`),s.platform==="twitter"&&o&&a(`https://unavatar.io/twitter/${encodeURIComponent(o)}`),s.twitterHandle&&a(`https://unavatar.io/twitter/${encodeURIComponent(s.twitterHandle)}`),s.email&&a(`https://unavatar.io/${encodeURIComponent(s.email)}`),s.companyLogo&&a(s.companyLogo),s.companyDomain&&a(`https://logo.clearbit.com/${s.companyDomain}`);const n=encodeURIComponent(s.name||s.username||"prospect");return a(`https://api.dicebear.com/7.x/initials/svg?seed=${n}&backgroundType=gradientLinear`),t}function zo({prospect:s,selected:t,onSelect:a,compact:r}){const o=i.useMemo(()=>wg(s),[s]),[n,l]=i.useState(0),c=o[n],x=!!s.email,d=!!(s.profileUrl||s.linkedinUrl),u=!!s.phoneNumber,m=[x,d,u].filter(Boolean).length;return e.jsxs("div",{onClick:()=>a==null?void 0:a(s),className:Z("flex items-start gap-3 p-3 rounded-lg border transition-all cursor-pointer group","hover:border-primary/40 hover:bg-primary/5",t?"border-primary/60 bg-primary/10":"border-border/20 bg-card/30",r&&"p-2.5 gap-2.5"),children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsxs(Ur,{className:"h-10 w-10",children:[e.jsx(Vi,{src:c,alt:s.name,onError:()=>{l(p=>Math.min(p+1,o.length-1))}}),e.jsx(Wr,{className:"bg-muted text-muted-foreground text-xs font-medium",children:Ng(s.name)})]}),t&&e.jsx("div",{className:"absolute -top-1 -right-1 h-4 w-4 rounded-full bg-primary flex items-center justify-center",children:e.jsx(bs,{className:"h-2.5 w-2.5 text-primary-foreground"})})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-medium text-sm text-foreground truncate",children:s.name}),s.matchScore!==void 0&&s.matchScore>0&&e.jsxs("span",{className:Z("text-[10px] font-semibold shrink-0 px-1.5 py-0.5 rounded-full",s.matchScore>=80?"bg-green-500/15 text-green-500":s.matchScore>=50?"bg-yellow-500/15 text-yellow-500":"bg-orange-500/15 text-orange-500"),children:[s.matchScore,"%"]})]}),(s.title||s.company)&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:[s.title,s.title&&s.company?" · ":"",s.company]}),(s.outreachAngle||s.matchReason)&&e.jsx("p",{className:"text-[11px] text-primary/70 mt-1.5 leading-snug line-clamp-2",children:s.outreachAngle||s.matchReason}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[x&&e.jsxs("div",{className:Z("flex items-center gap-1 text-[10px]",s.verificationStatus==="valid"?"text-green-500":s.verificationStatus==="accept_all"?"text-yellow-500":"text-muted-foreground"),children:[e.jsx(Fs,{className:"h-3 w-3"}),e.jsx("span",{children:"Email"}),s.emailConfidence!==void 0&&s.emailConfidence>=80&&e.jsx(bs,{className:"h-2.5 w-2.5"})]}),d&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-blue-400",children:[e.jsx(Zs,{className:"h-3 w-3"}),e.jsx("span",{children:"LinkedIn"})]}),u&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[e.jsx(an,{className:"h-3 w-3"}),e.jsx("span",{children:"Phone"})]}),s.activityConfidence==="verified"&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-green-500",children:[e.jsx(Nt,{className:"h-3 w-3"}),e.jsx("span",{children:"Active"})]}),m>0&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-accent ml-auto",children:[e.jsx(ms,{className:"h-3 w-3"}),e.jsxs("span",{children:[m," channel",m>1?"s":""]})]})]})]})]})}const kg={linkedin:Zs,twitter:rt,facebook:Wt};function Eo({dm:s,onApprove:t,onEdit:a,approved:r}){const[o,n]=i.useState(!1),[l,c]=i.useState(s.message),x=kg[s.platform]||rt,d=()=>{a==null||a(s,l),n(!1)};return e.jsxs("div",{className:Z("rounded-lg border p-3 transition-all",r?"border-accent/40 bg-accent/5":"border-border/30 bg-card/50"),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(x,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:s.prospect_name}),s.company&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["at ",s.company]})]}),r&&e.jsxs(W,{variant:"outline",className:"text-accent border-accent/40 text-xs",children:[e.jsx(bs,{className:"h-3 w-3 mr-1"}),"Approved"]})]}),o?e.jsxs("div",{className:"space-y-2",children:[e.jsx(Vs,{value:l,onCh
47ange:u=>c(u.target.value),className:"min-h-[80px] text-sm bg-background/50",autoFocus:!0}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(h,{size:"sm",variant:"default",onClick:d,children:[e.jsx(bs,{className:"h-3 w-3 mr-1"})," Save"]}),e.jsxs(h,{size:"sm",variant:"ghost",onClick:()=>{n(!1),c(s.message)},children:[e.jsx(zs,{className:"h-3 w-3 mr-1"})," Cancel"]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-foreground/90 whitespace-pre-wrap leading-relaxed bg-muted/30 rounded-md p-2.5",children:s.message}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsxs(h,{size:"sm",variant:"ghost",onClick:()=>n(!0),className:"text-xs",children:[e.jsx(ka,{className:"h-3 w-3 mr-1"})," Edit"]}),!r&&e.jsxs(h,{size:"sm",variant:"default",onClick:()=>t==null?void 0:t(s),className:"text-xs",children:[e.jsx(bs,{className:"h-3 w-3 mr-1"})," Approve"]})]})]})]})}const Ro={verified:{label:"Verified email",tone:"bg-emerald-500/10 text-emerald-600 border-emerald-500/20",icon:Na,tip:"Email pattern confirmed from a public source."},pattern_high:{label:"Likely email",tone:"bg-blue-500/10 text-blue-600 border-blue-500/20",icon:Na,tip:"Pattern detected from another @company email."},pattern_low:{label:"Best-guess email",tone:"bg-amber-500/10 text-amber-600 border-amber-500/20",icon:Ic,tip:"Common pattern guess. Verify before sending in volume."},none:{label:"No email",tone:"bg-muted text-muted-foreground",icon:Li,tip:"No public email found. DM is the recommended channel."}};function Md({confidence:s,email:t,mxValid:a,className:r}){const o=Ro[s??"none"]??Ro.none,n=o.icon;return e.jsx(Ka,{delayDuration:200,children:e.jsxs(la,{children:[e.jsx(ca,{asChild:!0,children:e.jsxs(W,{variant:"outline",className:Z("gap-1.5 font-medium",o.tone,r),children:[e.jsx(n,{className:"h-3 w-3"}),e.jsx("span",{children:o.label}),a===!1&&e.jsx("span",{className:"text-[10px] opacity-70",children:"(no MX)"})]})}),e.jsxs(sa,{className:"max-w-xs",children:[e.jsx("p",{className:"text-xs",children:o.tip}),t&&e.jsxs("p",{className:"mt-1 text-xs font-mono opacity-70 flex items-center gap-1",children:[e.jsx(Fs,{className:"h-3 w-3"}),t]})]})]})})}function Sg({prospectKey:s,prospectName:t,initial:a,approved:r,onApproved:o,selectable:n,selected:l,onToggleSelected:c,rejected:x}){const[d,u]=i.useState(!1),[m,p]=i.useState(!1),[g,v]=i.useState(a.email_guess??""),[b,z]=i.useState(a.personalization_hook??""),[C,j]=i.useState(a.pain_signals??[]),[y,N]=i.useState(""),f=async A=>{p(!0);try{const{error:B}=await w.from("prospect_enrichment").update({email_guess:A.email_guess,personalization_hook:A.personalization_hook,pain_signals:A.pain_signals}).eq("prospect_key",s);if(B)throw B;o(A),pt({title:"Enrichment approved",description:`${t} is ready for outreach.`})}catch(B){pt({title:"Failed to save",description:(B==null?void 0:B.message)??"Try again.",variant:"destructive"})}finally{p(!1)}},R=()=>{const A={...a,email_guess:g.trim()||null,personalization_hook:b.trim()||null,pain_signals:C.filter(B=>B.trim().length>0)};u(!1),f(A)},M=()=>{f({...a,email_guess:g.trim()||null,personalization_hook:b.trim()||null,pain_signals:C})},q=()=>{const A=y.trim();A&&(j(B=>[...B,A]),N(""))},_=A=>j(B=>B.filter((P,I)=>I!==A));return e.jsxs("div",{className:Z("rounded-lg border p-3 space-y-2.5 transition-all",x?"border-destructive/30 bg-destructive/5 opacity-70":r?"border-accent/40 bg-accent/5":"border-primary/30 bg-primary/5"),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[n&&!r&&!x&&e.jsx(Ot,{checked:!!l,onCheckedChange:()=>c==null?void 0:c(s),"aria-label":`Select ${t} for bulk action`,className:"h-3.5 w-3.5 mr-0.5"}),e.jsx(es,{className:"h-3.5 w-3.5 text-primary shrink-0"}),e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-foreground truncate",children:"AI enrichment review"}),r&&e.jsxs(W,{variant:"outline",className:"text-[9px] border-accent/40 text-accent gap-1 py-0 px-1.5",children:[e.jsx(Na,{className:"h-2.5 w-2.5"})," Approved"]}),x&&e.jsxs(W,{variant:"outline",className:"text-[9px] border-destructive/40 text-destructive gap-1 py-0 px-1.5",children:[e.jsx(bx,{className:"h-2.5 w-2.5"})," Rejected"]})]}),!d&&!r&&!x&&e.jsxs(h,{size:"sm",variant:"ghost",className:"h-6 text-[10px] px-2",onClick:()=>u(!0),children:[e.jsx(ka,{className:"h-2.5 w-2.5 mr-1"})," Edit"]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("label",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Email guess"}),a.email_confidence&&a.email_confidence!=="none"&&e.jsx(Md,{confidence:a.email_confidence,email:null,mxValid:a.email_mx_valid})]}),d?e.jsx(Je,{value:g,onChange:A=>v(A.target.value),placeholder:"[email protected]",className:"h-7 text-xs bg-background/60"}
47):e.jsx("p",{className:"text-xs text-foreground/90 font-mono bg-muted/40 rounded px-2 py-1",children:g||e.jsx("span",{className:"text-muted-foreground italic font-sans",children:"No email guessed"})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Personalization hook"}),d?e.jsx(Vs,{value:b,onChange:A=>z(A.target.value),placeholder:"The one specific thing your message should referenceâ¦",className:"min-h-[50px] text-xs bg-background/60"}):e.jsx("p",{className:"text-[11px] italic text-foreground/80 border-l-2 border-accent/40 pl-2",children:b||e.jsx("span",{className:"text-muted-foreground not-italic",children:"No hook yet"})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Pain signals"}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[C.length===0&&!d&&e.jsx("span",{className:"text-[11px] text-muted-foreground italic",children:"No pains detected"}),C.map((A,B)=>e.jsxs(W,{variant:"outline",className:"text-[10px] bg-muted/40 gap-1 pr-1",children:[A,d&&e.jsx("button",{type:"button",onClick:()=>_(B),className:"hover:text-destructive transition-colors","aria-label":`Remove ${A}`,children:e.jsx(zs,{className:"h-2.5 w-2.5"})})]},B))]}),d&&e.jsxs("div",{className:"flex gap-1.5",children:[e.jsx(Je,{value:y,onChange:A=>N(A.target.value),onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),q())},placeholder:"Add a pain signalâ¦",className:"h-7 text-xs bg-background/60"}),e.jsx(h,{size:"sm",variant:"outline",className:"h-7 px-2",onClick:q,disabled:!y.trim(),children:e.jsx(ft,{className:"h-3 w-3"})})]})]}),!r&&!x&&e.jsx("div",{className:"flex gap-1.5 pt-1",children:d?e.jsxs(e.Fragment,{children:[e.jsxs(h,{size:"sm",variant:"default",className:"h-7 text-[10px] px-2",onClick:R,disabled:m,children:[e.jsx(bs,{className:"h-2.5 w-2.5 mr-1"})," Save & approve"]}),e.jsxs(h,{size:"sm",variant:"ghost",className:"h-7 text-[10px] px-2",onClick:()=>{u(!1),v(a.email_guess??""),z(a.personalization_hook??""),j(a.pain_signals??[])},disabled:m,children:[e.jsx(zs,{className:"h-2.5 w-2.5 mr-1"})," Cancel"]})]}):e.jsxs(h,{size:"sm",variant:"default",className:"h-7 text-[10px] px-2",onClick:M,disabled:m,children:[e.jsx(bs,{className:"h-2.5 w-2.5 mr-1"})," Approve enrichment"]})})]})}function Cg({open:s,onOpenChange:t,prospectName:a,prospectCompany:r,prospectHeadline:o,personalizationHook:n,warmContact:l}){const[c,x]=i.useState(l.name),[d,u]=i.useState(l.profile_url??""),[m,p]=i.useState(""),[g,v]=i.useState(!1),[b,z]=i.useState(""),[C,j]=i.useState(""),[y,N]=i.useState("linkedin"),[f,R]=i.useState(!1),[M,q]=i.useState(!1),[_,A]=i.useState(!1);i.useEffect(()=>{s&&(x(l.name),u(l.profile_url??""),p(""),A(!1),z(""),j(""),q(!1),N("linkedin"))},[s,l.name,l.profile_url]);const B=i.useMemo(()=>c.trim().split(" ")[0]||"there",[c]),P=async()=>{if(!c.trim()){k.error("Add the mutual contact's name first");return}v(!0);try{const{data:Y,error:O}=await w.functions.invoke("draft-warm-intro",{body:{prospect_name:a,prospect_company:r,prospect_headline:o,warm_contact_name:c.trim(),warm_contact_first_name:B,interaction_count:l.interaction_count??null,personalization_hook:n??null}});if(O)throw O;if(!(Y!=null&&Y.message))throw new Error("No draft returned");z(Y.message),j(Y.subject_line_for_email??`Quick intro ask re: ${a}`),A(!0)}catch(Y){k.error((Y==null?void 0:Y.message)??"Couldn't draft intro request")}finally{v(!1)}},I=async()=>{const Y=y==="email"&&m?`Subject: ${C} 48 49${b}`:b;await kd(Y)?(q(!0),k.success("Copied to clipboard"),setTimeout(()=>q(!1),1500)):k.error("Couldn't access clipboard")},$=()=>{if(y!=="linkedin"){k.info("LinkedIn DM send is supported via extension. For email, use Copy and paste into your client.");return}if(!d.trim()){k.error("LinkedIn profile URL is required to send via the extension");return}if(!b.trim()){k.error("Generate a draft first");return}R(!0);const Y=setTimeout(()=>{R(!1),window.removeEventListener("message",O),k.info("No response from extension. Make sure deSHILLER extension is installed and enabled.")},8e3),O=he=>{var re,oe,T,ce;((re=he.data)==null?void 0:re.type)==="DESHILLER_SEND_DM_RESPONSE"&&(clearTimeout(Y),window.removeEventListener("message",O),R(!1),(oe=he.data)!=null&&oe.success?(k.success(`Intro request sent to ${B}`),t(!1)):(T=he.data)!=null&&T.requiresPremium?k.error("LinkedIn DM requires a premium account. Try Copy instead."):k.error(((ce=he.data)==null?void 0:ce.error)||"Couldn't send via extension. Try Copy instead."))};window.addEventListener("message",O),window.postMessage({type:"DESHILLER_SEND_DM",platform:"linkedin",profileUrl:d.trim(),message:b,prospectId:`warm-intro-${Date.now()}`,_responseType:"DESHILLER_SEND_DM_RESPONSE"},"*")},be=y==="linkedin"?!!b&&!!d.trim():!1;return e.jsx(gt,{open:s,onOpenChange:t,children:e.jsxs(dt,{className:"max-w-lg",children:[e.jsxs(mt,{children:[e.jsxs(xt,{className:"flex items-center gap-2",children:[e.jsx(Es,{className:"h-4 w-4 text-violet-600"}),"Ask ",B," for an intro"]}),e.jsx(Mt,{children:"Confirm the mutual contact's details, then we'll draft a short, casual ask you can send or copy."})]}),e.jsxs("div",{className:"rounded-md border border-border/40 bg-muted/30 p-2.5 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(W,{variant:"outline",className:"text-[10px]",children:"Target"}),e.jsx("span",{className:"font-medium",children:a}),r&&e.jsxs("span",{className:"text-muted-foreground",children:["· ",r]})]}),(l.interaction_count??0)>0&&e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[B," has ",l.interaction_count," recent interactions with ",a.split(" ")[0]," â strong signal."]}
49),n&&e.jsxs("p",{className:"text-[11px] italic text-muted-foreground border-l-2 border-accent/30 pl-2 mt-1",children:['"',n,'"']})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Ce,{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"1 · Confirm mutual contact"}),_&&e.jsxs(W,{variant:"outline",className:"text-accent border-accent/40 text-[9px] gap-1",children:[e.jsx(bs,{className:"h-2.5 w-2.5"})," Confirmed"]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Ce,{htmlFor:"warm-name",className:"text-[11px]",children:"Name"}),e.jsx(Je,{id:"warm-name",value:c,onChange:Y=>{x(Y.target.value),A(!1)},className:"h-8 text-sm"})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(Ce,{htmlFor:"warm-url",className:"text-[11px] flex items-center gap-1",children:[e.jsx(Zs,{className:"h-3 w-3"})," LinkedIn profile URL"]}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsx(Je,{id:"warm-url",value:d,onChange:Y=>{u(Y.target.value),A(!1)},placeholder:"https://www.linkedin.com/in/...",className:"h-8 text-sm"}),d&&e.jsx(h,{asChild:!0,variant:"outline",size:"icon",className:"h-8 w-8 shrink-0",children:e.jsx("a",{href:d,target:"_blank",rel:"noreferrer",children:e.jsx(Ys,{className:"h-3.5 w-3.5"})})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(Ce,{htmlFor:"warm-email",className:"text-[11px] flex items-center gap-1",children:[e.jsx(Fs,{className:"h-3 w-3"})," Email ",e.jsx("span",{className:"text-muted-foreground",children:"(optional)"})]}),e.jsx(Je,{id:"warm-email",type:"email",value:m,onChange:Y=>p(Y.target.value),placeholder:"[email protected]",className:"h-8 text-sm"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"2 · Draft the ask"}),!b&&e.jsx(h,{onClick:P,disabled:g||!c.trim(),variant:"default",size:"sm",className:"w-full gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"h-3.5 w-3.5 animate-spin"})," Draftingâ¦"]}):e.jsxs(e.Fragment,{children:[e.jsx(es,{className:"h-3.5 w-3.5"})," Generate intro request"]})}),b&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{type:"button",onClick:()=>N("linkedin"),className:Z("h-7 px-2 rounded-md text-[11px] flex items-center gap-1 border transition-colors",y==="linkedin"?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:text-foreground"),children:[e.jsx(Zs,{className:"h-3 w-3"})," LinkedIn DM"]}),e.jsxs("button",{type:"button",onClick:()=>N("email"),disabled:!m,className:Z("h-7 px-2 rounded-md text-[11px] flex items-center gap-1 border transition-colors disabled:opacity-50 disabled:cursor-not-allowed",y==="email"?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:text-foreground"),title:m?"":"Add an email above to use this channel",children:[e.jsx(Fs,{className:"h-3 w-3"})," Email"]}),e.jsxs(h,{variant:"ghost",size:"sm",onClick:P,disabled:g,className:"h-7 px-2 text-[11px] ml-auto",children:[g?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):e.jsx(es,{className:"h-3 w-3"}),"Regenerate"]})]}),y==="email"&&e.jsxs("div",{className:"space-y-1",children:[e.jsx(Ce,{className:"text-[10px] text-muted-foreground",children:"Subject"}),e.jsx(Je,{value:C,onChange:Y=>j(Y.target.value),className:"h-8 text-sm"})]}),e.jsx(Vs,{value:b,onChange:Y=>z(Y.target.value),className:"min-h-[110px] text-sm leading-relaxed"}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Edit freely. Keep it short â warm intros work best when the ask is small."})]})]}),e.jsxs(Ft,{className:"flex-col sm:flex-row gap-2 sm:gap-1.5",children:[e.jsx(h,{variant:"ghost",onClick:()=>t(!1),className:"sm:mr-auto",children:"Cancel"}),e.jsxs(h,{variant:"outline",disabled:!b,onClick:I,className:"gap-1.5",children:[M?e.jsx(bs,{className:"h-3.5 w-3.5"}):e.jsx(ta,{className:"h-3.5 w-3.5"}),M?"Copied":"Copy"]}),e.jsxs(h,{variant:"default",disabled:!be||f,onClick:$,className:"gap-1.5",title:y==="email"?"Email sending uses Copy. Paste into your email client.":d?"Sends through the deSHILLER browser extension":"Add a LinkedIn profile URL to send",children:[f?e.jsx(Pe,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(At,{className:"h-3.5 w-3.5"}),f?"Sendingâ¦":"Send via extension"]})]})]})})}const _g=/([^.!?\n]*\b(?:noticed|saw that|saw you|loved your|loved the|came across|caught your|impressed by)\b[^.!?\n]*[.!?])/i,Tg=/\"[^\"\n]{6,140}\"/,Ag=/\b(scaling (?:challenges|pains|issues)|growth (?:challenges|issues|pains)|hiring (?:challenges|pain)|sales (?:bottlenecks|friction)|team scaling)\b/i;function ri(s){const t=s.trim();return t?/[.!?]$/.test(t)?t:`${t}.`:""}function Ig(s,t){const a=s.trim().replace(/^["']|["']$/g,""),r=a.toLowerCase();return/^(noticed|saw|loved|came across|caught|impressed)/i.test(a)?ri(a):/^(your|you|the|a |an )/i.test(a)?ri(`Noticed ${r}`):ri(`Noticed ${r}`)}function Lg(s){const t=(s.baseDraft||"").replace(/\r\n/g,`
50`),a=(s.personalizationHook||"").trim(),r=(s.painSignals||[]).map(c=>c.trim()).filter(Boolean),o=r[0]||"";let n=t;const l=[];if(a){const c=Ig(a,s.prospectFirstName);let x=!1;const d=n.match(Tg);if(d&&d.index!==void 0){const u=d.index,m=u+d[0].length;n=n.slice(0,u)+c+n.slice(m),l.push({start:u,end:u+c.length,kind:"hook"}),x=!0}if(!x){const u=n.match(_g);if(u&&u.index!==void 0){const m=u.index,p=m+u[0].length;n=n.slice(0,m)+c+n.slice(p),l.push({start:m,end:m+c.length,kind:"hook"}),x=!0}}if(!x){const u=n.search(/(,\s*\n|,\s+(?=[A-Z]))/);if(u>=0){const m=n.indexOf(",",u)+1,p=` ${c}`;n=n.slice(0,m)+p+n.slice(m),l.push({start:m,end:m+p.length,kind:"hook"}),x=!0}}if(!x){const u=`${c} `;n=u+n,l.push({start:0,end:u.length,kind:"hook"})}}if(o){let c=!1;const x=n.match(Ag);if(x&&x.index!==void 0){const d=x.index,u=d+x[0].length;n=n.slice(0,d)+o+n.slice(u),l.push({start:d,end:d+o.length,kind:"pain"}),c=!0}if(!c){const d=n.trimEnd(),u=r.slice(0,2).length>1?` 51 52Context: ${r.slice(0,2).join(" · ")}.`:` 53 54Context: ${o}.`,m=d.length;n=`${d}${u}`,l.push({start:m,end:m+u.length,kind:"pain"})}}return{merged:n,highlights:l,changed:n!==t}}function zg(s,t){if(t.length===0)return[{text:s,kind:null}];const a=[...t].sort((n,l)=>n.start-l.start),r=[];let o=0;for(const n of a)n.start<o||(n.start>o&&r.push({text:s.slice(o,n.start),kind:null}),r.push({text:s.slice(n.start,n.end),kind:n.kind}),o=n.end);return o<s.length&&r.push({text:s.slice(o),kind:null}),r}function Po({baseDraft:s,personalizationHook:t,painSignals:a,prospectFirstName:r,onMergedChange:o,compact:n,className:l}){const c=i.useMemo(()=>Lg({baseDraft:s,personalizationHook:t,painSignals:a,prospectFirstName:r}),[s,t,a,r]);o&&queueMicrotask(()=>o(c.merged));const x=i.useMemo(()=>zg(c.merged,c.highlights),[c.merged,c.highlights]),d=!!(t&&t.trim()),u=(a??[]).filter(Boolean);return!(d||u.length>0)||!c.changed?null:e.jsxs("div",{className:Z("rounded-md border border-accent/30 bg-accent/5 space-y-1.5",n?"p-2":"p-2.5",l),children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx(es,{className:"h-3 w-3 text-accent"}),e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-accent",children:"Live preview with your enrichment"}),e.jsx(jx,{className:"h-2.5 w-2.5 text-muted-foreground"}),e.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[d&&e.jsx(W,{variant:"outline",className:"text-[9px] py-0 px-1 bg-accent/10 text-accent border-accent/30",children:"hook"}),u.length>0&&e.jsxs(W,{variant:"outline",className:"text-[9px] py-0 px-1 gap-0.5 bg-orange-500/10 text-orange-600 border-orange-500/30",children:[e.jsx(Ca,{className:"h-2 w-2"})," pain"]})]})]}),e.jsx("p",{className:Z("whitespace-pre-wrap leading-relaxed text-foreground/90","text-xs"),children:x.map((p,g)=>e.jsx("span",{className:Z(p.kind==="hook"&&"bg-accent/20 text-accent-foreground rounded px-0.5 ring-1 ring-accent/30",p.kind==="pain"&&"bg-orange-500/15 text-orange-700 rounded px-0.5 ring-1 ring-orange-500/30"),children:p.text},g))}),e.jsx("p",{className:"text-[10px] text-muted-foreground/80",children:"Approving sends the previewed text. Edit hook or pain signals above to update instantly."})]})}function Eg({prospect_name:s,prospect_key:t,company:a,title:r,dm:o,email:n,enrichment:l,onApproveDM:c,onApproveEmail:x,onEditDM:d,onEditEmail:u,onRejectDM:m,onRejectEmail:p,dmApproved:g,emailApproved:v,requireEnrichmentReview:b,bulkSelectable:z,bulkSelected:C,onBulkToggle:j,forceEnrichmentApproved:y,enrichmentRejected:N,isPaidUser:f=!1}){const[R,M]=i.useState(!1),[q,_]=i.useState(!1),[A,B]=i.useState((o==null?void 0:o.message)||""),[P,I]=i.useState(n?`Subject: ${n.subject} 55 56${n.body}`:""),[$,be]=i.useState(!1),[Y,O]=i.useState(!1),[he,re]=i.useState(!1),[oe,T]=i.useState(l??null),[ce,le]=i.useState(!1),[F,L]=i.useState(!1),[K,ue]=i.useState(""),[Ne,fe]=i.useState(""),me=(b??!!l)&&!!l&&!!t,Ie=ce||!!y,Q=me&&!Ie||!!N,ne=s.split(" ")[0],ke=!!oe&&(Ie||!me)&&!N,ee=ke?(oe==null?void 0:oe.personalization_hook)??null:null,E=ke?(oe==null?void 0:oe.pain_signals)??[]:[],xe=se=>{T(Oe=>({...Oe??{},email_guess:se.email_guess,email_confidence:se.email_confidence,email_mx_valid:se.email_mx_valid,pain_signals:se.pain_signals,personalization_hook:se.personalization_hook})),le(!0)},ve=()=>{if(o!=null&&o.alt_message){const se=!$;be(se);const Oe=se?o.alt_message:o.message;B(Oe),d==null||d({prospect_profile_url:o.prospect_profile_url,prospect_name:s},Oe)}},S=()=>{d==null||d({prospect_profile_url:o==null?void 0:o.prospect_profile_url,prospect_name:s},A),M(!1)},J=()=>{const se=P.match(/^Subject:\s*(.+)/),Oe=se?se[1].trim():(n==null?void 0:n.subject)||"",We=P.replace(/^Subject:.*\n\n?/s,"").trim();u==null||u({prospect_email:n==null?void 0:n.prospect_email,prospect_name:s},`Subject: ${Oe} 57 58${We}`),_(!1)},je=(!o||g)&&(!n||v);return e.jsxs("div",{className:Z("rounded-lg border p-3 transition-all space-y-2",je?"border-accent/40 bg-accent/5":"border-border/30 bg-card/50"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:s}),a&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["at ",a]}
58),r&&e.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["· ",r]})]}),e.jsxs("div",{className:"flex gap-1",children:[o&&e.jsxs(W,{variant:"outline",className:Z("text-[10px]",g?"border-blue-400/40 text-blue-400":"border-border/40 text-muted-foreground"),children:[e.jsx(Zs,{className:"h-2.5 w-2.5 mr-0.5"})," DM"]}),n&&e.jsxs(W,{variant:"outline",className:Z("text-[10px]",v?"border-accent/40 text-accent":"border-border/40 text-muted-foreground"),children:[e.jsx(Fs,{className:"h-2.5 w-2.5 mr-0.5"})," Email"]})]})]}),me&&l&&t&&e.jsx(Sg,{prospectKey:t,prospectName:s,initial:{email_guess:l.email_guess??null,email_confidence:l.email_confidence??null,email_mx_valid:l.email_mx_valid??null,pain_signals:l.pain_signals??[],personalization_hook:l.personalization_hook??null},approved:Ie,onApproved:xe,selectable:z,selected:C,onToggleSelected:j,rejected:N}),oe&&e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[oe.email_confidence&&oe.email_confidence!=="none"&&e.jsx(Md,{confidence:oe.email_confidence,email:oe.email_guess,mxValid:oe.email_mx_valid}),typeof oe.buying_intent_score=="number"&&oe.buying_intent_score>=50&&e.jsxs(W,{variant:"outline",className:"gap-1 bg-orange-500/10 text-orange-600 border-orange-500/20 text-[10px]",children:[e.jsx(Ca,{className:"h-2.5 w-2.5"})," Intent ",oe.buying_intent_score]}),(oe.pain_signals??[]).slice(0,2).map((se,Oe)=>e.jsx(W,{variant:"outline",className:"text-[10px] bg-muted/40",children:se},Oe)),oe.warm_path_contact&&e.jsx("button",{type:"button",onClick:()=>L(!0),className:"inline-flex",title:"Draft an intro request to this mutual contact",children:e.jsxs(W,{variant:"outline",className:"bg-violet-500/10 text-violet-600 border-violet-500/20 text-[10px] cursor-pointer hover:bg-violet-500/20 transition-colors",children:["Warm path · ",oe.warm_path_contact.name.split(" ")[0]]})})]}),(oe==null?void 0:oe.warm_path_contact)&&e.jsx(Cg,{open:F,onOpenChange:L,prospectName:s,prospectCompany:a,prospectHeadline:r,personalizationHook:oe.personalization_hook,warmContact:oe.warm_path_contact}),(oe==null?void 0:oe.personalization_hook)&&!me&&e.jsxs("p",{className:"text-[11px] italic text-muted-foreground border-l-2 border-accent/40 pl-2",children:['"',oe.personalization_hook,'"']}),o&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[f?e.jsx(Zs,{className:"h-3 w-3 text-blue-400"}):e.jsx(wa,{className:"h-3 w-3 text-blue-400"}),e.jsx("span",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:f?"LinkedIn DM":"Connect with a message"}),f?e.jsxs(W,{variant:"outline",className:"text-[9px] py-0 px-1 border-accent/40 text-accent gap-0.5",children:[e.jsx(Wa,{className:"h-2.5 w-2.5"})," Premium"]}):e.jsxs(W,{variant:"outline",className:"text-[9px] py-0 px-1 border-amber-500/40 text-amber-500/90 gap-0.5",children:[e.jsx(Wa,{className:"h-2.5 w-2.5"})," Free tier"]}),g&&e.jsx(W,{variant:"outline",className:"text-accent border-accent/40 text-[9px] py-0 px-1",children:e.jsx(bs,{className:"h-2.5 w-2.5"})})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:f?"Your premium plan can DM strangers directly â we'll open the LinkedIn message composer with this draft.":"Free LinkedIn can't DM strangers. We'll open their profile and copy the note so you can send a connection request â usually higher reply rates anyway."}),R?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Vs,{value:A,onChange:se=>
58B(se.target.value),className:"min-h-[60px] text-xs bg-background/50",autoFocus:!0}),!f&&A.length>300&&e.jsxs("p",{className:"text-[10px] text-amber-500/90",children:["Connection notes are limited to 300 characters â current draft is ",A.length,". We'll truncate when copying."]}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs(h,{size:"sm",variant:"default",onClick:S,className:"h-6 text-[10px] px-2",children:[e.jsx(bs,{className:"h-2.5 w-2.5 mr-0.5"})," Save"]}),e.jsxs(h,{size:"sm",variant:"ghost",onClick:()=>{M(!1),B($?o.alt_message:o.message)},className:"h-6 text-[10px] px-2",children:[e.jsx(zs,{className:"h-2.5 w-2.5 mr-0.5"})," Cancel"]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-foreground/90 whitespace-pre-wrap leading-relaxed bg-muted/30 rounded-md p-2",children:A}),e.jsx(Po,{baseDraft:A,personalizationHook:ee,painSignals:E,prospectFirstName:ne,onMergedChange:ue,compact:!0}),e.jsxs("div",{className:"flex gap-1.5 items-center flex-wrap",children:[e.jsxs(h,{size:"sm",variant:"ghost",onClick:()=>M(!0),className:"h-6 text-[10px] px-2",children:[e.jsx(ka,{className:"h-2.5 w-2.5 mr-0.5"})," Edit"]}),o.alt_message&&e.jsxs(h,{size:"sm",variant:"ghost",onClick:ve,className:"h-6 text-[10px] px-2",children:[e.jsx(yx,{className:"h-2.5 w-2.5 mr-0.5"})," ",$?"Version 1":"Version 2"]}),!g&&!Y&&e.jsxs(h,{size:"sm",variant:"ghost",onClick:()=>{O(!0),m==null||m({prospect_profile_url:o.prospect_profile_url,prospect_name:s})},className:"h-6 text-[10px] px-2 text-muted-foreground hover:text-destructive",title:"Reject â future drafts will learn from this",children:[e.jsx(zs,{className:"h-2.5 w-2.5 mr-0.5"})," Reject"]}),Y&&e.jsx("span",{className:"text-[10px] text-muted-foreground italic",children:"Rejected â style will adapt"}),!g&&!Y&&(f?e.jsxs(h,{size:"sm",variant:"default",disabled:Q,onClick:()=>{const se=K||A;se!==A&&(d==null||d({prospect_profile_url:o.prospect_profile_url,prospect_name:s},se)),c==null||c({prospect_profile_url:o.prospect_profile_url,prospect_name:s,message:se})},className:"h-6 text-[10px] px-2",title:Q?"Approve enrichment first":"Approves the previewed text",children:[Q?e.jsx(_t,{className:"h-2.5 w-2.5 mr-0.5"}):e.jsx(Zs,{className:"h-2.5 w-2.5 mr-0.5"}),Q?"Locked":"Approve LinkedIn DM"]}):e.jsxs(h,{size:"sm",variant:"default",disabled:Q||!o.prospect_profile_url,onClick:async()=>{const se=(K||A).slice(0,300);se!==A&&(d==null||d({prospect_profile_url:o.prospect_profile_url,prospect_name:s},se));try{await navigator.clipboard.writeText(se),k.success("Note copied â paste into LinkedIn's 'Add a note' field",{description:`Opening ${s}'s profileâ¦`})}catch{k.info("Opening profile â copy the note manually")}o.prospect_profile_url&&window.open(o.prospect_profile_url,"_blank","noopener,noreferrer"),c==null||c({prospect_profile_url:o.prospect_profile_url,prospect_name:s,message:se})},className:"h-6 text-[10px] px-2 gap-1",title:Q?"Approve enrichment first":"Copies the note and opens LinkedIn so you can send a connection request",children:[Q?e.jsx(_t,{className:"h-2.5 w-2.5"}):e.jsx(wa,{className:"h-2.5 w-2.5"}),"Connect with a message",!Q&&e.jsx(Ys,{className:"h-2.5 w-2.5 opacity-70"})]}))]})]})]}),n&&e.jsxs("div",{className:"space-y-1.5 pt-1 border-t border-border/20",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Fs,{className:"h-3 w-3 text-accent"}),e.jsx("span",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Email"}),v&&e.jsx(W,{variant:"outline",className:"text-accent border-accent/40 text-[9px] py-0 px-1",children:e.jsx(bs,{className:"h-2.5 w-2.5"})})]}),q?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Vs,{value:P,onChange:se=>I(se.target.value),className:"min-h-[80px] text-xs bg-background/50",autoFocus:!0}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs(h,{size:"sm",variant:"default",onClick:J,className:"h-6 text-[10px] px-2",children:[e.jsx(bs,{className:"h-2.5 w-2.5 mr-0.5"})," Save"]}),e.jsxs(h,{size:"sm",variant:"ghost",onClick:()=>{_(!1),I(`Subject: ${n.subject} 59 60${n.body}`)},className:"h-6 text-[10px] px-2",children:[e.jsx(zs,{className:"h-2.5 w-2.5 mr-0.5"})," Cancel"]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-foreground
60/90 whitespace-pre-wrap leading-relaxed bg-muted/30 rounded-md p-2",children:P}),e.jsx(Po,{baseDraft:P,personalizationHook:ee,painSignals:E,prospectFirstName:ne,onMergedChange:fe}),e.jsxs("div",{className:"flex gap-1.5 items-center",children:[e.jsxs(h,{size:"sm",variant:"ghost",onClick:()=>_(!0),className:"h-6 text-[10px] px-2",children:[e.jsx(ka,{className:"h-2.5 w-2.5 mr-0.5"})," Edit"]}),!v&&!he&&e.jsxs(h,{size:"sm",variant:"ghost",onClick:()=>{re(!0),p==null||p({prospect_email:n.prospect_email,prospect_name:s})},className:"h-6 text-[10px] px-2 text-muted-foreground hover:text-destructive",title:"Reject â future drafts will learn from this",children:[e.jsx(zs,{className:"h-2.5 w-2.5 mr-0.5"})," Reject"]}),he&&e.jsx("span",{className:"text-[10px] text-muted-foreground italic",children:"Rejected â style will adapt"}),!v&&!he&&e.jsxs(h,{size:"sm",variant:"default",disabled:Q,onClick:()=>{const se=Ne||P;se!==P&&(u==null||u({prospect_email:n.prospect_email,prospect_name:s},se)),x==null||x({prospect_email:n.prospect_email,prospect_name:s,message:se})},className:"h-6 text-[10px] px-2",title:Q?"Approve enrichment first":"Approves the previewed text",children:[Q?e.jsx(_t,{className:"h-2.5 w-2.5 mr-0.5"}):e.jsx(bs,{className:"h-2.5 w-2.5 mr-0.5"}),Q?"Locked":"Approve"]})]})]})]})]})}const Rg={users:Es,building:fa,map:er,briefcase:Sr,trending:gs,globe:bt,tag:Mr,layers:qa};function Pg({questions:s,original_query:t,onSubmit:a,escalated:r}){var M,q,_,A,B,P;const[o,n]=i.useState({}),[l,c]=i.useState(0),[x,d]=i.useState(""),u=s[l];if(!u)return null;const m=Rg[u.icon||""]||ws,p=I=>{n($=>({...$,[u.id]:I})),l<s.length-1&&setTimeout(()=>c($=>$+1),150)},g=I=>{n($=>{const be=$[u.id]||[],Y=be.includes(I)?be.filter(O=>O!==I):[...be,I];return{...$,[u.id]:Y}})},v=I=>{n($=>({...$,[u.id]:I[0]}))},b=I=>{n($=>({...$,[u.id]:I}))},z=()=>{const I=x.trim();if(!I)return;const $=o[u.id]||[];$.includes(I)||n(be=>({...be,[u.id]:[...$,I]})),d("")},C=I=>{n($=>{const be=$[u.id]||[];return{...$,[u.id]:be.filter(Y=>Y!==I)}})},j=()=>{const I=o[u.id];return u.required?Array.isArray(I)?I.length>0:I!==void 0&&I!=="":!0},y=l>=s.length-1,N=()=>{y?f():c(I=>I+1)},f=()=>{var O,he,re;let I=t;const $=[],be=[];for(const oe of s){const T=o[oe.id];if(!(!T||Array.isArray(T)&&T.length===0)){if(oe.options&&Array.isArray(T))for(const ce of T){const le=oe.options.find(F=>F.value===ce);(O=le==null?void 0:le.keywords)!=null&&O.length&&be.push(...le.keywords)}else if(oe.options&&typeof T=="string"){const ce=oe.options.find(le=>le.value===T);(he=ce==null?void 0:ce.keywords)!=null&&he.length&&be.push(...ce.keywords)}switch(oe.id){case"industry":case"sub_vertical":Array.isArray(T)?$.push(`in ${T.join(" or ")} industry`):typeof T=="string"&&!T.toLowerCase().includes("any")&&$.push(`in ${T} industry`);break;case"geography":case"geo":typeof T=="string"&&!T.toLowerCase().includes("global")&&!T.toLowerCase().includes("any")&&$.push(`in ${T}`);break;case"headcount":case"company_size":typeof T=="string"&&!T.toLowerCase().includes("any")&&$.push(`at companies with ${T} employees`);break;case"company_stage":typeof T=="string"&&!T.toLowerCase().includes("any")&&$.push(`at ${T} stage`);break;case"seniority":typeof T=="string"&&$.push(`${T} level`);break;case"department":Array.isArray(T)?$.push(`in ${T.join(" or ")} departments`):typeof T=="string"&&$.push(`in ${T} department`);break;case"company_keywords":case"focus_area":break;case"result_count":typeof T=="number"&&(I=I.replace(/\b\d+\b/,String(T)));break;default:if(oe.type==="keyword_chips"){if(Array.isArray(T))for(const ce of T)(re=oe.options)!=null&&re.find(le=>le.value===ce)||be.push(ce)}else typeof T=="string"?$.push(T):Array.isArray(T)&&$.push(T.join(", "))}}}$.length>0&&(I=`${I} ${$.join(" ")}`.replace(/\s{2,}/g," ").trim());const Y=[...new Set(be)];Y.length>0&&(I=`${I} [keywords: ${Y.join(", ")}]`),a(I)},R=Object.keys(o).filter(I=>{const $=o[I];return $!==void 0&&$!==""&&(!Array.isArray($)||$.length>0)}).length;return e.jsxs("div",{className:"rounded-xl border border-primary/20 bg-gradient-to-br from-primary/5 via-background to-accent/5 overflow-hidden",children:[e.jsx("div",{className:"h-1 bg-muted/30",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-primary to-accent transition-all duration-300",style:{width:`${(l+1)/s.length*100}%`}})}),e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/15 flex items-center justify-center",children:e.jsx(m,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:u.question}),e.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["Step ",l+1," of ",s.length,(u.type==="multi_select"||u.type==="
60keyword_chips")&&" · Select multiple"]})]})]}),e.jsx("div",{className:"flex gap-1",children:s.map((I,$)=>e.jsx("button",{onClick:()=>$<=l&&c($),className:Z("w-2 h-2 rounded-full transition-all",$===l?"bg-primary w-4":$<l?"bg-primary/50 cursor-pointer":"bg-muted-foreground/20")},$))})]}),u.type==="buttons"&&e.jsx("div",{className:"grid grid-cols-2 gap-2",children:(M=u.options)==null?void 0:M.map(I=>{const $=o[u.id]===I.value;return e.jsxs("button",{onClick:()=>p(I.value),className:Z("text-left rounded-lg border p-3 transition-all text-sm",$?"border-primary bg-primary/10 ring-1 ring-primary/30":"border-border/30 bg-card/30 hover:bg-primary/5 hover:border-primary/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:Z("font-medium",$?"text-primary":"text-foreground"),children:I.label}),$&&e.jsx(bs,{className:"h-3.5 w-3.5 text-primary"})]}),I.description&&e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:I.description})]},I.value)})}),u.type==="multi_select"&&e.jsx("div",{className:"flex flex-wrap gap-2",children:(q=u.options)==null?void 0:q.map(I=>{const $=(o[u.id]||[]).includes(I.value);return e.jsxs("button",{onClick:()=>g(I.value),className:Z("inline-flex items-center gap-1.5 px-3 py-2 rounded-full border text-xs font-medium transition-all",$?"border-primary bg-primary/15 text-primary ring-1 ring-primary/20":"border-border/40 bg-card/30 text-foreground hover:bg-primary/5 hover:border-primary/30"),children:[$&&e.jsx(bs,{className:"h-3 w-3"}),I.label]},I.value)})}),u.type==="keyword_chips"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[(_=u.options)==null?void 0:_.map(I=>{const $=(o[u.id]||[]).includes(I.value);return e.jsxs("button",{onClick:()=>g(I.value),className:Z("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full border text-xs font-medium transition-all",$?"border-primary bg-primary/15 text-primary ring-1 ring-primary/20":"border-border/40 bg-card/30 text-foreground hover:bg-primary/5 hover:border-primary/30"),children:[$?e.jsx(bs,{className:"h-3 w-3"}):e.jsx(Mr,{className:"h-3 w-3 text-muted-foreground"}),I.label]},I.value)}),(o[u.id]||[]).filter(I=>{var $;return!(($=u.options)!=null&&$.find(be=>be.value===I))}).map(I=>e.jsxs("button",{onClick:()=>C(I),className:"inline-flex items-center gap-1 px-3 py-1.5 rounded-full border border-accent bg-accent/15 text-accent-foreground text-xs font-medium",children:[I,e.jsx(zs,{className:"h-3 w-3"})]},I))]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Je,{placeholder:"Add custom keyword...",value:x,onChange:I=>d(I.target.value),onKeyDown:I=>I.key==="Enter"&&z(),className:"h-8 text-xs"}),e.jsx(h,{variant:"outline",size:"sm",className:"h-8 px-2",onClick:z,disabled:!x.trim(),children:e.jsx(ft,{className:"h-3.5 w-3.5"})})]})]}),u.type==="scale"&&e.jsxs("div",{className:"space-y-3 px-1",children:[e.jsx(Kt,{min:u.min||1,max:u.max||10,step:u.step||1,value:[typeof o[u.id]=="number"?o[u.id]:u.min||5],onValueChange:v,className:"w-full"}),e.jsxs("div",{className:"flex justify-between text-[11px] text-muted-foreground",children:[e.jsx("span",{children:((A=u.scale_labels)==null?void 0:A.min)||u.min}),e.jsx("span",{className:"font-medium text-primary text-sm",children:typeof o[u.id]=="number"?o[u.id]:"â"}),e.jsx("span",{children:((B=u.scale_labels)==null?void 0:B.max)||u.max})]})]}),u.type==="radio"&&e.jsx("div",{className:"space-y-1.5",children:(P=u.options)==null?void 0:P.map(I=>{const $=o[u.id]===I.value;return e.jsxs("button",{onClick:()=>b(I.value),className:Z("w-full flex items-center gap-3 rounded-lg border p-3 text-left transition-all",$?"border-primary bg-primary/10 ring-1 ring-primary/30":"border-border/30 bg-card/30 hover:bg-primary/5 hover:border-primary/30"),children:[e.jsx("div",{className:Z("w-4 h-4 rounded-full border-2 flex items-center justify-center transition-all",$?"border-primary":"border-muted-foreground/40"),children:$&&e.jsx("div",{className:"w-2 h-2 rounded-full bg-primary"})}),e.jsxs("div",{children:[e.jsx("span",{className:Z("text-sm font-medium",$?"text-primary":"text-foreground"),children:I.label}),I.description&&e.jsx("p",{className:"text-[11px] text-muted-foreground",children:I.description})]})]},I.value)})}),e.jsxs("div",{className:"flex items-center justify-between pt-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[l>0&&e.jsx(h,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground h-8",onClick:()=>c(I=>I-1),children:"â Back"}),e.jsx(h,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground h-8",onClick:f,children:"Skip & search"}),r&&e.jsxs(h,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground h-8 gap-1",onClick:()=>a(""),children:[e.jsx(Dr,{className:"h-3 w-3"}),"Start fresh"]})]}
60),(u.type==="multi_select"||u.type==="keyword_chips"||u.type==="scale"||u.type==="radio"||u.type==="buttons"&&o[u.id])&&e.jsx(h,{size:"sm",className:"h-8 gap-1.5 text-xs",onClick:N,disabled:u.required&&!j(),children:y?e.jsxs(e.Fragment,{children:[e.jsx(ws,{className:"h-3 w-3"}),"Find prospects"]}):e.jsxs(e.Fragment,{children:["Next",e.jsx(Ns,{className:"h-3 w-3"})]})})]}),R>0&&e.jsx("div",{className:"flex flex-wrap gap-1 pt-1 border-t border-border/20",children:s.slice(0,l).map(I=>{const $=o[I.id];if(!$||Array.isArray($)&&$.length===0)return null;const be=Array.isArray($)?$.join(", "):String($);return e.jsx(W,{variant:"outline",className:"text-[10px] h-5 px-2 border-primary/20 bg-primary/5 text-primary cursor-pointer hover:bg-primary/10",onClick:()=>c(s.indexOf(I)),children:be},I.id)})})]})]})}const Mg=new Set(["none","low","guessed",null,""]);function Dg(s){var a,r;const t=(s.email_confidence??"").toLowerCase();return!!(Mg.has(t)||!((a=s.personalization_hook)!=null&&a.trim())||!((r=s.pain_signals)!=null&&r.length))}function Og({items:s,selected:t,rejected:a,approved:r,onSelectionChange:o,onApproved:n,onRejected:l,needsEditsFilter:c,onNeedsEditsFilterChange:x}){const[d,u]=i.useState(null),m=i.useMemo(()=>s.filter(y=>!r.has(y.prospect_key)&&!a.has(y.prospect_key)),[s,r,a]),p=i.useMemo(()=>{const y=c?m.filter(Dg):m;return new Set(y.map(N=>N.prospect_key))},[m,c]),g=p.size>0&&Array.from(p).every(y=>t.has(y)),v=()=>{if(g){const y=new Set(t);p.forEach(N=>y.delete(N)),o(y)}else{const y=new Set(t);p.forEach(N=>y.add(N)),o(y)}},b=i.useMemo(()=>Array.from(t).filter(y=>m.some(N=>N.prospect_key===y)),[t,m]),z=async()=>{if(b.length!==0){u("approve");try{const{error:y}=await w.from("prospect_enrichment").update({updated_at:new Date().toISOString()}).in("prospect_key",b);if(y)throw y;n(b),pt({title:`Approved ${b.length} enrichments`,description:"Outreach unlocked for the selected prospects."});const N=new Set(t);b.forEach(f=>N.delete(f)),o(N)}catch(y){pt({title:"Bulk approve failed",description:(y==null?void 0:y.message)??"Try again.",variant:"destructive"})}finally{u(null)}}},C=()=>{if(b.length!==0){u("reject");try{l(b),pt({title:`Rejected ${b.length} enrichments`,description:"These prospects will be skipped from outreach."});const y=new Set(t);b.forEach(N=>y.delete(N)),o(y)}finally{u(null)}}};if(s.length===0)return null;const j=c?m.length-p.size:0;return e.jsxs("div",{className:"rounded-lg border border-primary/30 bg-gradient-to-r from-primary/5 to-accent/5 p-2.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(es,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-foreground",children:"Bulk enrichment review"}),e.jsxs(W,{variant:"outline",className:"text-[10px] py-0 px-1.5",children:[b.length," / ",m.length," selected"]}),r.size>0&&e.jsxs(W,{variant:"outline",className:"text-[10px] py-0 px-1.5 border-accent/40 text-accent",children:[r.size," approved"]}),a.size>0&&e.jsxs(W,{variant:"outline",className:"text-[10px] py-0 px-1.5 border-destructive/40 text-destructive",children:[a.size," rejected"]})]}),e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-muted-foreground cursor-pointer select-none",children:[e.jsx(Ta,{className:"h-3 w-3"}),"Needs edits only",e.jsx(Js,{checked:c,onCheckedChange:x,className:"h-4 w-7 data-[state=checked]:bg-primary"})]})})]}),e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("button",{type:"button",onClick:v,className:"flex items-center gap-1.5 text-[11px] text-muted-foreground hover:text-foreground transition-colors",disabled:p.size===0,children:[e.jsx(Ot,{checked:g,className:"h-3.5 w-3.5 pointer-events-none"}),g?"Clear selection":`Select all visible (${p.size})`]}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs(h,{size:"sm",variant:"outline",className:"h-7 text-[10px] px-2 border-destructive/30 text-destructive hover:bg-destructive/10",onClick:C,disabled:b.length===0||d!==null,children:[d==="reject"?e.jsx(Pe,{className:"h-2.5 w-2.5 mr-1 animate-spin"}):e.jsx(Rt,{className:"h-2.5 w-2.5 mr-1"}),"Reject ",b.length>0&&`(${b.length})`]}),e.jsxs(h,{size:"sm",variant:"default",className:"h-7 text-[10px] px-2",onClick:z,disabled:b.length===0||d!==null,children:[d==="approve"?e.jsx(Pe,{className:"h-2.5 w-2.5 mr-1 animate-spin"}):e.jsx(ys,{className:"h-2.5 w-2.5 mr-1"}),"Approve ",b.length>0&&`(${b.length})`]})]})]}),j>0&&e.jsxs("p",{className:Z("text-[10px] text-muted-foreground italic"),children:[j," high-confidence prospect",j===1?"":"s"," hidden by filter."]})]})}const jr=s=>typeof s=="string"?s.trim().toLowerCase():"",Mo=s=>jr(s.companyDomain)||jr(s.company);function Fg(s){var t;return{email:jr(s.email),nameDomain:s.name&&Mo(s)?`${jr(s.name)}|${Mo(s)}`:"",linkedin:jr(s.linkedinHandle)||((t=jr(s.linkedinUrl).split("/in/").pop())==null?void 0:t.replace(/\/$/,""))||""}}function Do(s){const t=[],a=new Map,r=new Map,o=new Map;for(const n of s){const l=Fg(n);let c=-1,x=null;if(l.email&&a.has(l.email)?(c=a.get(l.email),x="email"):l.linkedin&&o.has(l.linkedin)?(c=o.get(l.linkedin),x="linkedin"):l.nameDomain&&r.has(l.nameDomain)&&(c=r.get(l.nameDomain),x="name_domain"),c>=0&&x)t[c].duplicates.push({prospect:n,reason:x});else{const d=t.length;t.push({prospect:n,duplicates:[]}),l.email&&a.set(l.email,d),l.linkedin&&o.set(l.linkedin,d),l.nameDomain&&r.set(l.nameDomain,d)}}return t}function Oo(s){switch(s){case"email":return"same email";case"linkedin":return"same LinkedIn";case"name_domain":return"same name + company"}}const Bg=s=>s==="email"?Fs:s==="linkedin"?Zs:Ei;function Fo({group:s}){const[t,a]=i.useState(!1);if(s.duplicates.length===0)return null;const r=s.duplicates.length,o=Array.from(new Set(s.duplicates.map(n=>n.reason)));return e.jsxs("div",{className:"mt-1.5",children:[e.jsxs("button",{type:"button",onClick:()=>a(n=>!n),className:Z("inline-flex items-center gap-1.5 rounded-md border border-amber-500/30 bg-amber-500/10","px-2 py-0.5 text-[11px] font-medium text-amber-200/90 hover:bg-amber-500/15 transition-colors"),title:"Duplicate prospects merged into this entry",children:[e.jsx(qa,{className:"h-3 w-3"}),e.jsxs("span",{children:[r," duplicate",r>1?"s":""," merged"]}),e.jsx("span",{className:"text-amber-200/60",children:"·"}),e.jsx("span",{className:"text-amber-200/70",children:o.map(Oo).join(", ")}),t?e.jsx(Gt,{className:"h-3 w-3"}):e.jsx(nt,{className:"h-3 w-3"})]}),t&&e.jsx("div",{className:"mt-1.5 rounded-md border border-border/40 bg-muted/30 p-2 space-y-1",children:s.duplicates.map((n,l)=>{const c=Bg(n.reason);return e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsx(c,{className:"h-3 w-3 shrink-0 text-amber-400/80"}
60),e.jsx("span",{className:"font-medium text-foreground/80 truncate",children:n.prospect.name||"Unnamed"}),n.prospect.company&&e.jsxs("span",{className:"text-muted-foreground/70 truncate",children:["· ",n.prospect.company]}),e.jsx("span",{className:"ml-auto shrink-0 text-amber-300/80",children:Oo(n.reason)})]},l)})})]})}function Dd({totalCount:s,visibleCount:t,toggles:a,activeFilters:r,onFilterToggle:o,sortByReachability:n,onSortToggle:l,className:c}){if(s===0)return null;const x=r.size>0;return e.jsxs("div",{className:Z("rounded-lg border border-border/50 bg-gradient-to-br from-primary/[0.04] to-transparent backdrop-blur-sm p-2.5 space-y-2",c),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[e.jsx(Ta,{className:"h-3 w-3"}),e.jsx("span",{className:"font-medium uppercase tracking-wider",children:"Prioritize reachable"}),e.jsxs("span",{className:"text-foreground/70",children:["· ",t,"/",s]})]}),e.jsxs(h,{size:"sm",variant:n?"default":"outline",onClick:()=>l(!n),className:"h-6 text-[10px] px-2 gap-1",title:"Sort highest-likelihood-of-reach first",children:[e.jsx(vx,{className:"h-2.5 w-2.5"}),n?"Sorted by reach":"Sort by reach"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[a.map(d=>{const u=r.has(d.key),m=d.matchCount===0;return e.jsxs("button",{type:"button",disabled:m&&!u,onClick:()=>o(d.key),title:d.hint,className:Z("inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] transition-all",u?"border-primary/50 bg-primary/15 text-primary":"border-border/40 bg-card/40 text-muted-foreground hover:border-primary/30 hover:text-foreground",m&&!u&&"opacity-40 cursor-not-allowed"),children:[d.label,e.jsx(W,{variant:"outline",className:Z("h-3.5 px-1 text-[9px] border-0",u?"bg-primary/20 text-primary":"bg-muted/60 text-muted-foreground"),children:d.matchCount})]},d.key)}),x&&e.jsxs("button",{type:"button",onClick:()=>Array.from(r).forEach(o),className:"inline-flex items-center gap-1 rounded-full border border-destructive/30 bg-destructive/5 px-2 py-0.5 text-[10px] text-destructive/80 hover:bg-destructive/10",children:[e.jsx(zs,{className:"h-2.5 w-2.5"})," Clear"]})]})]})}function $g(s){const t=new Map,a=new Map;for(const r of s.enrichments||[])r!=null&&r.prospect_key&&a.set(r.prospect_key,r);for(const r of s.messages||[]){if(!r.message)continue;const o=r.prospect_profile_url||r.prospect_name;t.has(o)||t.set(o,{prospect_name:r.prospect_name,prospect_key:r.prospect_key||r.prospect_profile_url||void 0,company:r.company,title:r.title,enrichment:r.enrichment??a.get(r.prospect_key||r.prospect_profile_url||"")}),t.get(o).dm={message:r.message,alt_message:r.alt_message,prospect_profile_url:r.prospect_profile_url}}for(const r of s.emails||[]){if(!r.body)continue;const o=r.prospect_profile_url||r.prospect_email||r.prospect_name;t.has(o)||t.set(o,{prospect_name:r.prospect_name,prospect_key:r.prospect_key||r.prospect_profile_url||r.prospect_email||void 0,company:r.prospect_company,title:void 0,enrichment:r.enrichment??a.get(r.prospect_key||r.prospect_profile_url||r.prospect_email||"")}),t.get(o).email={subject:r.subject,body:r.body,prospect_email:r.prospect_email}}return[...t.values()]}function qg({message:s,onSelectProspect:t,selectedProspects:a,onApproveDM:r,onEditDM:o,onApproveEmail:n,onEditEmail:l,onRejectDM:c,onRejectEmail:x,approvedDMs:d,approvedEmails:u,onSuggestionClick:m,onQueueAllApproved:p,isLastMessage:g,isPaidUser:v=!1}){var he,re,oe;const b=s.role==="user",z=((d==null?void 0:d.size)||0)+((u==null?void 0:u.size)||0),C=(he=s.tool_results)==null?void 0:he.some(T=>T.tool==="generate_outreach"||T.tool==="generate_dm"||T.tool==="generate_email"),[j,y]=i.useState(new Set),[N,f]=i.useState(new Set),[R,M]=i.useState(new Set),[q,_]=i.useState(!1),[A,B]=i.useState(new Set),[P,I]=i.useState(!1),$=T=>B(ce=>{const le=new Set(ce);return le.has(T)?le.delete(T):le.add(T),le}),be=T=>{y(ce=>{const le=new Set(ce);return le.has(T)?le.delete(T):le.add(T),le})},Y=T=>{f(ce=>{const le=new Set(ce);return T.forEach(F=>le.add(F)),le})},O=T=>{M(ce=>{const le=new Set(ce);return T.forEach(F=>le.add(F)),le})};return e.jsxs("div",{className:Z("flex gap-3",b?"flex-row-reverse":"flex-row"),children:[e.jsx("div",{className:Z("shrink-0 w-7 h-7 rounded-full flex items-center justify-center mt-1",b?"bg-primary/20":"bg-
60accent/20"),children:b?e.jsx(Ei,{className:"h-3.5 w-3.5 text-primary"}):e.jsx(Et,{className:"h-3.5 w-3.5 text-accent"})}),e.jsxs("div",{className:Z("flex-1 max-w-[85%] space-y-3",b&&"flex flex-col items-end"),children:[s.content&&e.jsx("div",{className:Z("rounded-xl px-4 py-2.5 text-sm leading-relaxed",b?"bg-primary/15 text-foreground rounded-tr-sm":"bg-muted/50 text-foreground rounded-tl-sm"),children:e.jsx("div",{className:"whitespace-pre-wrap",children:s.content})}),(re=s.tool_results)==null?void 0:re.map((T,ce)=>{var le,F,L,K,ue,Ne,fe,me,Ie,Q;return e.jsxs("div",{className:"w-full space-y-2",children:[(T.tool==="qualify_search"&&T.status==="qualify"||T.tool==="search_prospects"&&T.status==="qualify")&&((le=T.questions)==null?void 0:le.length)>0&&e.jsx(Pg,{questions:T.questions,original_query:T.original_query||"",onSubmit:ne=>m==null?void 0:m(ne),escalated:T.escalated===!0}),T.tool==="search_prospects"&&T.status==="follow_up"&&T.question&&e.jsx("div",{className:"space-y-2.5",children:e.jsxs("div",{className:"rounded-lg border border-primary/20 bg-primary/5 p-3 space-y-2.5",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:T.question}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:(F=T.options)==null?void 0:F.map((ne,ke)=>{const ee=T.original_query||"",E=T.answered_dimension||"";let xe=ee;if(ne.toLowerCase().includes("no preference")||ne.toLowerCase().includes("global"))xe=ee;else if(E==="industry")xe=`${ee} in ${ne} industry`;else if(E==="geography")xe=`${ee} in ${ne}`;else if(E==="headcount"){const ve=ne.match(/^[\d-]+/);xe=`${ee} at companies with ${ve?ve[0]:ne} employees`}else xe=`${ee}, ${ne}`;return e.jsx(h,{variant:"outline",size:"sm",className:"h-auto py-2 px-3.5 text-xs font-normal border-primary/30 bg-primary/5 hover:bg-primary/15 hover:border-primary/50 text-foreground transition-all",onClick:()=>m==null?void 0:m(xe),children:ne},ke)})})]})}),T.tool==="search_prospects"&&T.status==="rate_limited"&&e.jsxs("div",{className:"space-y-2 p-3 rounded-lg bg-destructive/10 border border-destructive/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(qt,{className:"h-4 w-4 text-destructive"}),e.jsx("p",{className:"text-sm font-medium text-destructive",children:"API Quota Exhausted"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:T.message})]}),T.tool==="search_prospects"&&T.status==="no_results"&&((L=T.refinement_options)==null?void 0:L.length)>0&&e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("p",{className:"text-sm text-foreground",children:T.message}),e.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:T.refinement_options.map((ne,ke)=>{const ee=typeof ne=="string"?ne:ne.label,E=typeof ne=="string"?T.original_query?`${T.original_query} ${ne}`:ne:ne.query;return e.jsxs(h,{variant:"outline",size:"sm",className:"h-auto py-2 px-3 text-xs font-normal border-primary/20 bg-primary/5 hover:bg-primary/10 hover:border-primary/40 text-foreground transition-all justify-start",onClick:()=>m==null?void 0:m(E),children:[e.jsx(ws,{className:"h-3 w-3 mr-1 shrink-0 text-primary"}),e.jsx("span",{className:"truncate",children:ee})]},ke)})}),T.fallback_line&&e.jsx("p",{className:"text-xs text-muted-foreground",children:T.fallback_line})]}),T.tool==="search_prospects"&&T.status==="thin_results"&&e.jsxs("div",{className:"space-y-2.5",children:[((K=T.prospects)==null?void 0:K.length)>0&&(()=>{const ne=Do(T.prospects),ke=T.prospects.length-ne.length;return e.jsxs("div",{className:"space-y-1.5",children:[ke>0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-amber-300/80 px-1",children:[e.jsx(qa,{className:"h-3 w-3"}),e.jsxs("span",{children:[ke," duplicate",ke>1?"s":""," merged across ",ne.length," unique prospects"]})]}),ne.map((ee,E)=>e.jsxs("div",{children:[e.jsx(zo,{prospect:ee.prospect,selected:a==null?void 0:a.has(ee.prospect.profileUrl),onSelect:t,compact:!0}),e.jsx(Fo,{group:ee})]},`${ee.prospect.profileUrl}-${E}`))]})})(),((ue=T.refinement_options)==null?void 0:ue.length)>0&&e.jsxs("div",{className:"rounded-lg border border-accent/20 bg-accent/5 p-3 space-y-2",children:[e.jsx("p",{className:"text-sm text-foreground",children:T.message}),e.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:T.refinement_options.map((ne,ke)=>{const ee=typeof ne=="string"?ne:ne.label,E=typeof ne=="string"?T.original_query?`${T.original_query} ${ne}`:ne:ne.query;return e.jsxs(h,{variant:"outline",size:"sm",className:"h-auto py-1.5 px-3 text-xs font-normal border-accent/20 bg-accent/5 hover:bg-accent/10 hover:border-accent/40 text-foreground transition-all justify-start",onClick:()=>m==null?void 0:m(E),children:[e.jsx(ws,{className:"h-3 w-3 mr-1 shrink-0 text-accent"}),e.jsx("span",{className:"truncate",children:ee})]},ke)})})]})]}),T.tool==="search_prospects"&&T.status!=="thin_results"&&((Ne=T.prospects)==null?void 0:Ne.length)>0&&(()=>{const ne=Do(T.prospects),ke=T.prospects.length-ne.length;return e.jsxs("div",{className:"space-y-1.5",children:[ke>0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-amber-300/80 px-1",children:[e.jsx(qa,{className:"h-3 w-3"}),e.jsxs("span",{children:[ke," duplicate",ke>1?"s":""," merged across ",ne.length," unique prospects"]})]}),ne.map((ee,E)=>e.jsxs("div",{children:[e.jsx(zo,{prospect:ee.prospect,selected:a==null?void 0:a.has(ee.prospect.profileUrl),onSelect:t,compact:!0}),e.jsx(Fo,{group:ee})]},`${ee.prospect.profileUrl}-${E}`))]})})(),T.tool==="generate_outreach"&&(((fe=T.messages)==null?void 0:fe.length)>0||((me=T.emails)==null?void 0:me.length)>0)&&(()=>{const ne=$g(T),ke=S=>{var se,Oe,We,H,ae,ze;let J=0;const je=String(((se=S.enrichment)==null?void 0:se.email_confidence)||"").toLowerCase();return(Oe=S.email)!=null&&Oe.prospect_email&&(J+=30),je==="high"||je==="verified"?J+=30:je==="medium"||je==="likely"?J+=15:je==="low"&&(J+=5),(We=S.dm)!=null&&We.prospect_profile_url&&(J+=20),(H=S.enrichment)!=null&&H.personalization_hook&&(J+=10),(((ze=(ae=S.enrichment)==null?void 0:ae.pain_signals)==null?void 0:ze.length)??0)>0&&(J+=5),J},ee=(S,J)=>{var se,Oe,We,H;const je=String(((se=S.enrichment)==null?void 0:se.email_confidence)||"").toLowerCase();switch(J){case"has_email":return!!((Oe=S.email)!=null&&Oe.prospect_email);case"high_conf":return je==="high"||je==="verified";case"has_dm":return!!((We=S.dm)!=null&&We.prospect_profile_url);case"personalized":return!!((H=S.enrichment)!=null&&H.personalization_hook);default:return!0}},E={has_email:ne.filter(S=>ee(S,"has_email")).length,high_conf:ne.filter(S=>ee(S,"high_conf")).length,has_dm:ne.filter(S=>ee(S,"has_dm")).length,personalized:ne.filter(S=>ee(S,"personalized")).length};let xe=ne.filter(S=>Array.from(A).every(J=>ee(S,J)));P&&(xe=[...xe].sort((S,J)=>ke(J)-ke(S)));const ve=xe.filter(S=>S.prospect_key&&S.enrichment).map(S=>{var J,je,se,Oe;return{prospect_key:S.prospect_key,prospect_name:S.prospect_name,email_guess:((J=S.enrichment)==null?void 0:J.email_guess)??null,email_confidence:((je=S.enrichment)==null?void 0:je.email_confidence)??null,pain_signals:((se=S.enrichment)==null?void 0:se.pain_signals)??[],personalization_hook:((Oe=S.enrichment)==null?void 0:Oe.personalization_hook)??null}});return e.jsxs("div",{className:"space-y-2",children:[ne.length>1&&e.jsx(Dd,{totalCount:ne.length,visibleCount:xe.length,activeFilters:A,onFilterToggle:$,sortByReachability:P,onSortToggle:I,toggles:[{key:"has_email",label:"Has email",matchCount:E.has_email,hint:"Prospect has a discovered email address"},{key:"high_conf",label:"High-confidence email",matchCount:E.high_conf,hint:"Email verified or high-confidence"},{key:"has_dm",label:"Has LinkedIn",matchCount:E.has_dm,hint:"Reachable via LinkedIn DM or connection request"},{key:"personalized",label:"Personalization hook",matchCount:E.personalized,hint:"AI found a specific opener for this prospect"}]}),ve.length>1&&e.jsx(Og,{items:ve,selected:j,rejected:R,approved:N,onSelectionChange:y,onApproved:Y,onRejected:O,needsEditsFilter:q,onNeedsEditsFilterChange:_}),xe.map((S,J)=>e.jsx(Eg,{prospect_name:S.prospect_name,prospect_key:S.prospect_key,company:S.company,title:S.title,dm:S.dm,email:S.email,enrichment:S.enrichment,onApproveDM:r,onApproveEmail:n,onEditDM:o,onEditEmail:l,onRejectDM:c,onRejectEmail:x,dmApproved:S.dm?d==null?void 0:d.has(S.dm.prospect_profile_url):!1,emailApproved:S.email?u==null?void 0:u.has(S.email.prospect_email):!1,bulkSelectable:ve.length>1&&!!S.prospect_key,bulkSelected:S.prospect_key?j.has(S.prospect_key):!1,onBulkToggle:be,forceEnrichmentApproved:S.prospect_key?N.has(S.prospect_key):!1,enrichmentRejected:S.prospect_key?R.has(S.prospect_key):!1,isPaidUser:v},`outreach-${S.prospect_name}-${J}`)),xe.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground italic px-2 py-3 text-center",children:"No prospects match the active reachability filters â try clearing one."})]})})(),T.tool==="generate_dm"&&((Ie=T.messages)==null?void 0:Ie.length)>0&&e.jsx("div",{className:"space-y-2",children:T.messages.filter(ne=>ne.message).map((ne,ke)=>e.jsx(Eo,{dm:ne,onApprove:r,onEdit:o,approved:d==null?void 0:d.has(ne.prospect_profile_url)},`dm-${ne.prospect_profile_url}-${ke}`))}),T.tool==="generate_email"&&((Q=T.emails)==null?void 0:Q.length)>0&&e.jsx("div",{className:"space-y-2",children:T.emails.filter(ne=>ne.body).map((ne,ke)=>e.jsx(Eo,{dm:{prospect_name:ne.prospect_name,prospect_profile_url:ne.prospect_profile_url||"",platform:"email",company:ne.prospect_company,message:`Subject: ${ne.subject} 61 62${ne.body}`},onApprove:n,onEdit:l,approved:u==null?void 0:u.has(ne.prospect_email||ne.prospect_profile_url)},`email-${ne.prospect_email}-${ke}`))}),T.tool==="queue_outreach"&&T.queued_count!==void 0&&e.jsxs("div",{className:"rounded-lg border border-accent/30 bg-accent/5 p-3 text-sm",children:[e.jsxs("p",{className:"text-accent font-medium",children:["â ",T.queued_count," outreach message",T.queued_count!==1?"s":""," queued"]}),e.jsxs("div",{className:"flex gap-2 mt-1.5",children:[(T.queued_dms??0)>0&&e.jsxs(W,{variant:"outline",className:"text-[10px] border-blue-400/30 text-blue-400",children:[e.jsx(Zs,{className:"h-2.5 w-2.5 mr-0.5"}),T.queued_dms," DM",T.queued_dms!==1?"s":""]}),(T.queued_emails??0)>0&&e.jsxs(W,{variant:"outline",className:"text-[10px] border-accent/30 text-accent",children:[e.jsx(Fs,{className:"h-2.5 w-2.5 mr-0.5"}),T.queued_emails," email",T.queued_emails!==1?"s":""]})]}),T.instruction&&e.jsx("p",{className:"text-muted-foreground text-xs mt-1.5",children:T.instruction})]}),T.tool==="queue_dm"&&T.queued_count!==void 0&&e.jsxs("div",{className:"rounded-lg border border-accent/30 bg-accent/5 p-3 text-sm",children:[e.jsxs("p",{className:"text-accent font-medium",children:["â ",T.queued_count," message",T.queued_count!==1?"s":""," queued for delivery"]}),T.instruction&&e.jsx("p",{className:"text-muted-foreground text-xs mt-1",children:T.instruction})]})]},ce)}),!b&&g&&C&&z>0&&p&&e.jsxs(h,{variant:"default",size:"sm",onClick:p,className:"text-xs gap-1.5 bg-accent hover:bg-accent/90",children:[e.jsx(At,{className:"h-3 w-3"}),"Queue ",z," approved message",z!==1?"s":""]}),!b&&g&&((oe=s.suggestions)==null?void 0:oe.length)>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:s.suggestions.map((T,ce)=>e.jsxs(h,{variant:"outline",size:"sm",className:"h-auto py-1.5 px-3 text-xs font-normal border-primary/20 bg-primary/5 hover:bg-primary/10 hover:border-primary/40 text-foreground transition-all",onClick:()=>m==null?void 0:m(T),children:[e.jsx(ws,{className:"h-3 w-3 mr-1 text-primary"}),T]},ce))})]})]})}const Hg={hiring:{label:"Actively hiring",Icon:Sr},funding:{label:"Recently funded",Icon:Ht},launch:{label:"Just launched",Icon:Lt},expansion:{label:"Scaling team",Icon:gs},complaint:{label:"Frustrated with competitor",Icon:wx},tech_change:{label:"Stack change",Icon:qc}};function Gg(s){if(!s)return null;const t=Date.now()-new Date(s).getTime(),a=Math.round(t/6e4);if(a<60)return`${Math.max(1,a)}m ago`;const r=Math.round(a/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function Ug(s){if(!s)return null;try{return new URL(s).hostname.replace(/^www\./,"")}catch{return null}}function Wg({prospectName:s,company:t,signalType:a,score:r,hookText:o,sourceUrl:n,sourceSnippet:l,detectedAt:c,manualStatus:x,onUseHook:d,onPromote:u,onPause:m,onDismiss:p,onClearOverride:g,busy:v,className:b}){const[z,C]=i.useState(!1),j=Hg[a]??{label:a,Icon:es},y=j.Icon,N=r>
62=70,f=x==="promoted"||N&&x!=="paused"&&x!=="dismissed",R=x==="paused",M=x==="dismissed",q=Ug(n);return e.jsxs(U,{className:Z("p-4 space-y-3 transition-all",M&&"opacity-50",R&&"border-muted-foreground/30 bg-muted/30",!R&&!M&&f&&"border-orange-500/40 bg-gradient-to-br from-orange-500/5 to-transparent",!R&&!M&&!f&&"border-border",b),children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1.5 min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(Ca,{className:Z("h-4 w-4 shrink-0",f&&!R&&!M?"text-orange-500":"text-muted-foreground")}),e.jsx("span",{className:"font-medium text-sm truncate",children:s}),t&&e.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",t]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsxs(W,{variant:f&&!R&&!M?"default":"outline",className:Z("gap-1",f&&!R&&!M&&"bg-orange-500 hover:bg-orange-500/90"),children:[e.jsx(y,{className:"h-3 w-3"}),j.label," · ",r,"/100"]}),x==="promoted"&&e.jsxs(W,{variant:"outline",className:"text-[10px] border-accent/40 text-accent gap-1",children:[e.jsx(Ua,{className:"h-2.5 w-2.5"})," Manually promoted"]}),R&&e.jsxs(W,{variant:"outline",className:"text-[10px] border-muted-foreground/30 text-muted-foreground gap-1",children:[e.jsx(Za,{className:"h-2.5 w-2.5"})," Paused"]}),M&&e.jsxs(W,{variant:"outline",className:"text-[10px] border-muted-foreground/30 text-muted-foreground gap-1",children:[e.jsx(zs,{className:"h-2.5 w-2.5"})," Dismissed"]})]})]}),e.jsx("div",{className:"text-[10px] text-muted-foreground shrink-0 text-right space-y-0.5",children:c&&e.jsx("div",{children:Gg(c)})})]}),o&&e.jsxs("p",{className:"text-sm text-foreground/80 leading-relaxed border-l-2 border-orange-500/40 pl-3 italic",children:['"',o,'"']}),(n||l)&&e.jsxs("div",{className:"rounded-md border border-border/40 bg-muted/30 p-2 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground min-w-0",children:[e.jsx(Nx,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate font-medium text-foreground/80",children:q??"Source"}),l&&e.jsx("button",{type:"button",onClick:()=>C(_=>!_),className:"text-[10px] text-muted-foreground hover:text-foreground underline-offset-2 hover:underline",children:z?"hide":"what triggered this?"})]}),n&&e.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",className:"text-[10px] text-muted-foreground hover:text-foreground inline-flex items-center gap-1 shrink-0",children:["Open ",e.jsx(Ys,{className:"h-3 w-3"})]})]}),z&&l&&e.jsxs("p",{className:"text-[11px] text-foreground/70 leading-relaxed border-l-2 border-border/60 pl-2",children:['"',l,'"']})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pt-1",children:[d&&o&&!M&&e.jsxs(h,{size:"sm",variant:f&&!R?"default":"outline",onClick:d,disabled:v,className:"gap-1.5 h-7 text-xs",children:[e.jsx(es,{className:"h-3 w-3"}),"Use in outreach"]}),x?e.jsx(h,{size:"sm",variant:"ghost",onClick:g,disabled:v,className:"h-7 text-[11px] px-2 text-muted-foreground hover:text-foreground",children:"Clear override"}):e.jsxs(e.Fragment,{children:[!f&&u&&e.jsxs(h,{size:"sm",variant:"outline",onClick:u,disabled:v,className:"h-7 text-[11px] px-2 gap-1",children:[e.jsx(Ua,{className:"h-3 w-3"})," Promote"]}),f&&m&&e.jsxs(h,{size:"sm",variant:"outline",onClick:m,disabled:v,className:"h-7 text-[11px] px-2 gap-1",children:[e.jsx(Za,{className:"h-3 w-3"})," Pause"]}),p&&e.jsxs(h,{size:"sm",variant:"ghost",onClick:p,disabled:v,className:"h-7 text-[11px] px-2 gap-1 text-muted-foreground hover:text-destructive",children:[e.jsx(zs,{className:"h-3 w-3"})," Dismiss"]})]})]})]})}function Vg({userId:s,onUseSignal:t}){const[a,r]=i.useState([]),[o,n]=i.useState(!0),[l,c]=i.useState(!1),[x,d]=i.useState(null),[u,m]=i.useState("active"),p=async()=>{n(!0);const{data:j,error:y}=await w.from("prospect_buying_signals").select("id, prospect_key, prospect_name, prospect_company, signal_type, score, hook_text, source_url, source_snippet, detected_at, manual_status").eq("user_id",s).order("score",{ascending:!1}).order("detected_at",{ascending:!1}).limit(100);y||r(j??[]),n(!1)};i.useEffect(()=>{p()},[s]);const g=async()=>{c(!0);try{const{data:j,error:y}=await w.functions.invoke("buying-signal-scanner",{body:{}});if(y)throw y;k.success(`Scanned ${(j==null?void 0:j.scanned)??0} prospects · ${(j==null?void 0:j.signals_found)??0} signals found`),await p()}catch(j){k.error((j==null?void 0:j.message)??"Scan failed")}finally{c(!1)}},v=async(j,y,N)=>{d(j);try{const{error:f}=await w.from("prospect_buying_signals").update({manual_status:y,manual_status_at:y?new Date().toISOString():null}).eq("id",j).eq("user_id",s);if(f)throw f;r(R=>R.map(M=>M.id===j?{...M,manual_status:y}:M)),k.success(N)}catch(f){k.error((f==null?void 0:f.message)??"Failed to update signal")}finally{d(null)}},b=i.useMemo(()=>{const j=a.filter(q=>
62q.manual_status!=="paused"&&q.manual_status!=="dismissed"),y=j.filter(q=>q.manual_status==="promoted"||q.score>=70),N=j.filter(q=>q.manual_status!=="promoted"&&q.score>=50&&q.score<70),f=j.filter(q=>q.manual_status!=="promoted"&&q.score<50),R=a.filter(q=>q.manual_status==="paused"),M=a.filter(q=>q.manual_status==="dismissed");return{active:j,promoted:y,warm:N,cold:f,paused:R,dismissed:M}},[a]),z=i.useMemo(()=>u==="paused"?b.paused:u==="dismissed"?b.dismissed:u==="all"?a:b.active,[u,b,a]),C=j=>e.jsx(Wg,{prospectName:j.prospect_name??"Unknown",company:j.prospect_company,signalType:j.signal_type,score:j.score,hookText:j.hook_text,sourceUrl:j.source_url,sourceSnippet:j.source_snippet,detectedAt:j.detected_at,manualStatus:j.manual_status??null,busy:x===j.id,onUseHook:t?()=>t(j):void 0,onPromote:()=>v(j.id,"promoted",`Promoted ${j.prospect_name??"prospect"} into Hot Now`),onPause:()=>v(j.id,"paused","Paused â won't auto-fire outreach"),onDismiss:()=>v(j.id,"dismissed","Dismissed signal"),onClearOverride:()=>v(j.id,null,"Override cleared â back to auto")},j.id);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(Ca,{className:"h-5 w-5 text-orange-500"}),"Hot Now"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Prospects in a buying window. Signals from the open web â promote, pause, or dismiss any pick."})]}),e.jsxs(h,{onClick:g,disabled:l,variant:"outline",size:"sm",className:"gap-2",children:[e.jsx(Ks,{className:"h-4 w-4"}),l?"Scanning...":"Scan now"]})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:[e.jsxs(U,{className:"p-3",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:"Promoted"}),e.jsx("div",{className:"text-lg font-semibold text-orange-500",children:b.promoted.length})]}),e.jsxs(U,{className:"p-3",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:"Warm"}),e.jsx("div",{className:"text-lg font-semibold",children:b.warm.length})]}),e.jsxs(U,{className:"p-3",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:"Paused"}),e.jsx("div",{className:"text-lg font-semibold text-muted-foreground",children:b.paused.length})]}),e.jsxs(U,{className:"p-3",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:"Dismissed"}),e.jsx("div",{className:"text-lg font-semibold text-muted-foreground",children:b.dismissed.length})]})]}),e.jsx(Ct,{value:u,onValueChange:j=>m(j),children:e.jsxs(wt,{className:"h-8",children:[e.jsxs(cs,{value:"active",className:"text-xs gap-1.5",children:[e.jsx(Ta,{className:"h-3 w-3"})," Active (",b.active.length,")"]}),e.jsxs(cs,{value:"paused",className:"text-xs",children:["Paused (",b.paused.length,")"]}),e.jsxs(cs,{value:"dismissed",className:"text-xs",children:["Dismissed (",b.dismissed.length,")"]}),e.jsxs(cs,{value:"all",className:"text-xs",children:["All (",a.length,")"]})]})}),e.jsx(jt,{className:"h-[600px]",children:e.jsx("div",{className:"space-y-4 pr-4",children:o?e.jsxs(e.Fragment,{children:[e.jsx(Ws,{className:"h-32 w-full"}),e.jsx(Ws,{className:"h-32 w-full"})]}):z.length===0?e.jsxs(U,{className:"p-8 text-center",children:[e.jsx(Ca,{className:"h-10 w-10 text-muted-foreground/50 mx-auto mb-3"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[u==="active"&&"No active buying signals yet. Run a scan or discover prospects first â signals appear within a few hours.",u==="paused"&&"Nothing paused. Pausing a signal stops auto-promotion without deleting it.",u==="dismissed"&&"Nothing dism
62issed. Dismissed signals stay hidden until you clear the override.",u==="all"&&"No buying signals tracked yet."]})]}):u==="active"?e.jsxs(e.Fragment,{children:[b.promoted.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h4",{className:"text-xs font-semibold uppercase tracking-wider text-orange-600",children:["ð¥ Hot (",b.promoted.length,")"]}),b.promoted.map(C)]}),b.warm.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:["Warm (",b.warm.length,")"]}),b.warm.map(C)]}),b.cold.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:["Low score (",b.cold.length,") · promote any to escalate"]}),b.cold.map(C)]})]}):e.jsx("div",{className:"space-y-2",children:z.map(C)})})})]})}const Yg={interested:"bg-emerald-500/10 text-emerald-600 border-emerald-500/20",objection:"bg-amber-500/10 text-amber-600 border-amber-500/20",not_interested:"bg-rose-500/10 text-rose-600 border-rose-500/20",out_of_office:"bg-blue-500/10 text-blue-600 border-blue-500/20",ask_info:"bg-violet-500/10 text-violet-600 border-violet-500/20"};function Kg({userId:s}){const[t,a]=i.useState([]),[r,o]=i.useState(!0);i.useEffect(()=>{(async()=>{const{data:l}=await w.from("cold_email_campaigns").select("*").eq("user_id",s).not("replied_at","is",null).order("replied_at",{ascending:!1}).limit(100);a(l??[]),o(!1)})()},[s]);const n=t.filter(l=>l.paused_reason==="interested").length;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(wr,{className:"h-5 w-5"}),"Inbox",n>0&&e.jsxs(W,{className:"bg-emerald-500 hover:bg-emerald-500/90",children:[n," interested"]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Replies from your cold outreach, auto-classified and sequence-paused."})]}),e.jsx(jt,{className:"h-[600px]",children:e.jsx("div",{className:"space-y-2 pr-4",children:r?e.jsxs(e.Fragment,{children:[e.jsx(Ws,{className:"h-20 w-full"}),e.jsx(Ws,{className:"h-20 w-full"})]}):t.length===0?e.jsxs(U,{className:"p-8 text-center",children:[e.jsx(ms,{className:"h-10 w-10 text-muted-foreground/50 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No replies yet. Once prospects respond to your DMs or emails, they'll appear here, classified by intent."})]}):t.map(l=>e.jsx(U,{className:"p-4 hover:bg-accent/30 transition-colors",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1 flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:l.prospect_name??"Unknown"}),l.prospect_company&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",l.prospect_company]}),l.paused_reason&&e.jsx(W,{variant:"outline",className:Z("text-xs",Yg[l.paused_reason]??""),children:l.paused_reason.replace(/_/g," ")})]}),l.prospect_email&&e.jsx("p",{className:"text-xs text-muted-foreground font-mono truncate",children:l.prospect_email}),l.replied_at&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Replied ",new Date(l.replied_at).toLocaleString()]})]}),e.jsx(h,{size:"sm",variant:"ghost",children:"View"})]})},l.id))})})]})}async function qn(s=3e3){if(typeof window>"u")return!1;const t=`cr-${Date.now()}-${Math.random().toString(36).slice(2)}`;return new Promise(a=>{const r=setTimeout(()=>{window.removeEventListener("message",o),a(!1)},s),o=n=>{const l=n==null?void 0:n.data;(l==null?void 0:l.type)==="SOCIALPILOT_PONG"&&(l==null?void 0:l.nonce)===t&&(clearTimeout(r),window.removeEventListener("message",o),a(!0))};window.addEventListener("message",o),window.postMessage({type:"SOCIALPILOT_PING",nonce:t},"*")})}async function Bo(s,t,a=6e4,r="public"){if(typeof window>"u")return{success:!1,error:"Not in browser",prospects:[]};const o=`lps_${Date.now()}_${Math.random().toString(36).slice(2)}`;return new Promise(n=>{const l=setTimeout(()=>{window.removeEventListener("message",c),n({success:!1,error:"Extension search timed out",prospects:[]})},a),c=x=>{const d=x==null?void 0:x.data;(d==null?void 0:d.type)==="DESHILLER_LINKEDIN_PROSPECT_SEARCH_RESPONSE"&&d.requestId===o&&(clearTimeout(l),window.removeEventListener("message",c),n({success:!!d.success,authWall:!!d.authWall,prospects:Array.isArray(d.prospects)?d.prospects:[],error:d.error,count:d.count}))};window.addEventListener("message",c),window.postMessage({type:"DESHILLER_LINKEDIN_PROSPECT_SEARCH",query:s,limit:t,mode:r,requestId:o},"*")})}const Xg={extension:{title:"Install the Cold Reach extension",description:"Five quick steps to get DMs and emails sending.",icon:Ut},premium:{title:"LinkedIn blocked your DM",description:"Free LinkedIn accounts can't open new conversations. Here's what to do.",icon:Wa},mx:{title:"Email domain doesn't accept mail",description:"The MX check failed. Let's reroute this prospect safely.",icon:Fs}};function Qg({open:s,onOpenChange:t,topic:a,prospectName:r,onSwitchToEmail:o,onSwitchToDM:n}){const[l,c]=i.useState(0),[x,d]=i.useState(new Set),[u,m]=i.useState(!1);i.useEffect(()=>{s&&(c(0),d(new Set))},[s,a]);const p=i.useMemo(()=>a==="extension"?[{title:"Download the extension",body:"We'll open the install page in a new tab â your dashboard stays right here.",action:{label:"Open install page",icon:Ys,onClick:()=>{window.open("/install-extension","_blank")}}},{title:"Unzip the file",body:"Find the downloaded file (usually in your Downloads folder) and double-click to unzip it. You should see a folder named chrome-extension."},{title:"Open chrome://extensions",body:"Paste chrome://extensions into a new Chrome tab, then turn on Developer mode in the top-right corner.",action:{label:"Copy chrome://extensions",onClick:async()=>{await navigator.clipboard.writeText("chrome://extensions"),k.success("Copied â paste into a
62new Chrome tab")}}},{title:"Load unpacked",body:"Click the Load unpacked button (top-left) and select the unzipped chrome-extension folder."},{title:"Verify it's connected",body:"Reload this page and we'll detect the extension automatically.",checkLabel:"Check connection",check:async()=>{const j=await qn(3e3);return j?k.success("Extension detected â"):k.error("Still not detected â make sure the folder is loaded and Chrome is up to date"),j}}]:a==="premium"?[{title:"Why this happened",body:r?`LinkedIn blocked the DM to ${r} because free accounts can't message people outside their network. This is a LinkedIn rule, not a bug.`:"LinkedIn blocked the DM because free accounts can't message people outside their network. This is a LinkedIn rule, not a bug."},{title:"Best option: switch to Email",body:"Your enrichment already has an email guess for this prospect. Email has no premium gate and usually gets a faster reply anyway.",action:o?{label:"Switch this prospect to Email",onClick:()=>{o(),t(!1)}}:void 0},{title:"Alternative: upgrade LinkedIn",body:"If you'd rather DM on LinkedIn, a Premium / Sales Navigator subscription unlocks InMail credits. Once active, retry the DM and the extension will go through.",action:{label:"Open LinkedIn Premium",icon:Ys,onClick:()=>{window.open("https://www.linkedin.com/premium/products/","_blank")}}},{title:"Heads up",body:"Even with Premium, LinkedIn limits ~100 InMails per month and discourages templated outreach. Mix DMs with email for the best response rates."}]:[{title:"What MX failure means",body:r?`${r}'s domain doesn't have working mail servers (MX records). Any email you send will bounce immediately and damage your sender reputation.`:"This domain doesn't have working mail servers (MX records). Any email sent will bounce immediately and damage your sender reputation."},{title:"Switch this prospect to LinkedIn DM",body:"LinkedIn doesn't depend on the corporate email infrastructure, so it's the safest fallback channel here.",action:n?{label:"Switch to LinkedIn DM",onClick:()=>{n(),t(!1)}}:void 0},{title:"Optional: double-check the domain",body:"If you suspect the MX check was wrong, look up the domain in a public MX checker. If it really has no mail servers, skip email for this prospect entirely.",action:{label:"Open MX Toolbox",icon:Ys,onClick:()=>{window.open("https://mxtoolbox.com/","_blank")}}}],[a,r,o,n,t]),g=Xg[a],v=g.icon,b=p[l],z=l===p.length-1,C=async()=>{if(b.check){m(!0);try{if(!await b.check()){m(!1);return}}finally{m(!1)}}d(j=>new Set(j).add(l)),z?t(!1):c(l+1)};return e.jsx(gt,{open:s,onOpenChange:t,children:e.jsxs(dt,{className:"max-w-lg",children:[e.jsx(mt,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/15 flex items-center justify-center",children:e.jsx(v,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{children:[e.jsx(xt,{className:"text-base",children:g.title}),e.jsx(Mt,{className:"text-xs",children:g.description})]})]})}),e.jsx("div",{className:"flex items-center gap-1.5 mt-2",children:p.map((j,y)=>e.jsx("div",{className:`h-1 flex-1 rounded-full transition-colors ${y<l||x.has(y)?"bg-primary":y===l?"bg-primary/60":"bg-muted"}`},y))}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Step ",l+1," of ",p.length]}),e.jsxs("div",{className:"rounded-lg border border-border bg-card/50 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-primary/15 text-primary text-xs font-semibold flex items-center justify-center shrink-0 mt-0.5",children:l+1}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx("h4",{className:"text-sm font-semibold text-foreground",children:b.title}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:b.body})]})]}),b.action&&e.jsxs(h,{size:"sm",variant:"outline",onClick:()=>b.action.onClick(),className:"w-full justify-start text-xs",children:[b.action.icon?e.jsx(b.action.icon,{className:"h-3.5 w-3.5"}):null,b.action.label]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-1",children:[e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>c(Math.max(0,l-1)),disabled:l===0,className:"text-xs",children:"Back"}),e.jsx(h,{size:"sm",onClick:C,disabled:u,className:"text-xs gap-1",children:u?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"h-3.5 w-3.5 animate-spin"}),"Checkingâ¦"]}):z?e.jsxs(e.Fragment,{children:[e.jsx(bs,{className:"h-3.5 w-3.5"}),"Done"]}):b.check?e.jsxs(e.Fragment,{children:[b.checkLabel??"Verify & continue",e.jsx($t,{className:"h-3.5 w-3.5"})]}):e.jsxs(e.Fragment,{children:["Next",e.jsx($t,{className:"h-3.5 w-3.5"})]})})]})]})})}const Jg={info:"border-primary/30 bg-primary/5",warn:"border-orange-500/40 bg-orange-500/5",success:"border-emerald-500/40 bg-emerald-500/5"},$o={info:"text-primary",warn:"text-orange-500",success:"text-emerald-500"},Ji="cold_reach_last_failure_v1";function qo(){if(typeof window>"u")return null;try{const s=localStorage.getItem(Ji);if(!s)return null;const t=JSON.parse(s);return Date.now()-(t.at??0)>24*3600*1e3?null:t}catch{return null}}function ni(s){if(!(typeof window>"u"||!s))try{localStorage.setItem(Ji,JSON.stringify({reason:s,at:Date.now()}))}catch{}}function Zg(){if(!(typeof window>"u"))try{localStorage.removeItem(Ji)}catch{}}function ef({userId:s,isEmptyState:t,signal:a,onClearSignal:r,onOpenHotNow:o}){const[n,l]=i.useState(null),[c,x]=i.useState(!1),[d,u]=i.useState(0),[m,p]=i.useState(!1),[g,v]=i.useState(!1),[b,z]=i.useState(new Set),[C,j]=i.useState(null),[y,N]=i.useState(()=>{var _;return((_=qo())==null?void 0:_.reason)??null});i.useEffect(()=>{let _=!0;return qn(3e3).then(A=>{_&&l(A)}),()=>{_=!1}},[]),i.useEffect(()=>{t&&u(_=>_+1)},[t]),i.useEffect(()=>{(a==null?void 0:a.kind)==="premium_blocked"?(N("premium"),ni("premium")):(a==null?void 0:a.kind)==="mx_invali
62d"&&(N("mx"),ni("mx"))},[a]),i.useEffect(()=>{(async()=>{const A=new Date(Date.now()-432e6).toISOString(),{data:B}=await w.from("cold_email_campaigns").select("id").eq("user_id",s).is("replied_at",null).lt("last_sent_at",A).limit(1),P=((B==null?void 0:B.length)??0)>0;x(P),P&&(N(I=>I??"no_replies"),qo()||ni("no_replies"))})()},[s]);const f=async()=>{p(!0);try{const{error:_}=await w.functions.invoke("buying-signal-scanner",{body:{}});if(_)throw _;k.success("Scan complete â check the Hot Now tab"),o==null||o()}catch(_){k.error((_==null?void 0:_.message)??"Scan failed")}finally{p(!1)}},R=async _=>{if(_){v(!0);try{await _(),k.success("Retrying with the same inputsâ¦")}catch(A){k.error((A==null?void 0:A.message)??"Retry failed")}finally{v(!1)}}},M=i.useMemo(()=>{if((a==null?void 0:a.kind)==="bulk_dm_progress")return{key:"bulk_dm",icon:Nt,tone:"info",title:`Sending DM ${a.current} of ${a.total}`,body:"Using a single shared tab to stay safe â no popup spam."};if((a==null?void 0:a.kind)==="tab_recreated")return{key:"tab_recreated",icon:qt,tone:"warn",title:"Browser tab was closed mid-batch",body:"We re-opened a fresh tab and resumed where you left off.",dismissible:!0};if((a==null?void 0:a.kind)==="premium_blocked"&&!b.has("premium"))return{key:"premium",icon:Wa,tone:"warn",title:"LinkedIn requires Premium for this DM",body:a.prospectName?`${a.prospectName} can't be reached via DM on a free LinkedIn account. Switch to Email â your enrichment already has an email guess.`:"Switch this prospect to Email â enrichment already has an email guess.",nbaAction:a.onSwitchToEmail?{label:"Switch to Email",icon:Fs,onClick:a.onSwitchToEmail}:void 0,retryAction:a.onRetry?{label:g?"Retryingâ¦":"Retry last step",icon:g?Pe:Dr,onClick:()=>R(a.onRetry)}:void 0,troubleshoot:"premium",dismissible:!0};if((a==null?void 0:a.kind)==="mx_invalid"&&!b.has("mx"))return{key:"mx",icon:Fs,tone:"warn",title:"Email domain doesn't accept mail",body:a.prospectName?`${a.prospectName}'s domain failed MX check. Try LinkedIn DM instead.`:"MX check failed â try LinkedIn DM for this prospect.",nbaAction:a.onSwitchToDM?{label:"Switch to DM",icon:At,onClick:a.onSwitchToDM}:void 0,retryAction:a.onRetry?{label:g?"Retryingâ¦":"Retry last step",icon:g?Pe:Dr,onClick:()=>R(a.onRetry)}:void 0,troubleshoot:"mx",dismissible:!0};if(n===!1&&!b.has("extension"))return{key:"extension",icon:Ut,tone:"warn",title:"Install the extension to send DMs and emails",body:"It's the engine behind every Cold Reach action â without it, you can search but can't send.",action:{label:"Install extension",onClick:()=>{window.location.href="/install-extension"}},troubleshoot:"extension"};if((a==null?void 0:a.kind)==="low_email_confidence"&&a.count>=3&&!b.has("low_email"))return{key:"low_email",icon:Ca,tone:"info",title:`${a.count} prospects have weak email guesses`,body:"Try Hot Now instead â those prospects have buying signals and a known channel.",action:a.onOpenHotNow?{label:"Open Hot Now",onClick:a.onOpenHotNow}:o?{label:"Open Hot Now",onClick:o}:void 0,dismissible:!0};if(c&&!b.has("stale"))return{key:"stale",icon:za,tone:"info",title:"Nothing back from your emails in 5+ days",body:"Run a Buying Signal Scan to find prospects who are actively in-market right now.",nbaAction:{label:m?"Scanningâ¦":"Run buying-signal scan",icon:m?Pe:ws,onClick:f},dismissible:!0};if(y&&!b.has(`nba_${y}`)){const A={premium:{title:"Last DM was blocked by LinkedIn Premium",body:"Switch your next outreach to Email â most enrichments include a verified guess.",nba:{label:"Open Inbox & switch to Email",icon:Fs,onClick:()=>o==null?void 0:o()}},mx:{title:"Last email failed an MX check",body:"Try LinkedIn DM for that prospect, or scan for fresh in-market leads.",nba:{label:m?"Scanningâ¦":"Find fresh prospects",icon:m?Pe:Ks,onClick:f}},no_replies:{title:"Your last batch went quiet",body:"The fastest recovery is a fresh batch with current buying signals.",nba:{label:m?"Scanningâ¦":"Run buying-signal scan",icon:m?Pe:ws,onClick:f}}}[y];return{key:`nba_${y}`,icon:za,tone:"info",title:A.title,body:A.body,nbaAction:A.nba,dismissible:!0}}return t&&d>=3&&!b.has("empty")?{key:"empty",icon:za,tone:"info",title:"Stuck on what to ask?",body:"Try one of the starter prompts below, or just paste a LinkedIn post URL of someone you'd like to reach.",dismissible:!0}:null},[a,n,c,t,d,m,g,b,o,y]);if(!M)return null;const q=M.icon;return e.jsxs(e.Fragment,{children:[e.jsx(U,{className:`p-3 border ${Jg[M.tone]}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5",children:M.key==="bulk_dm"?e.jsx(Pe,{className:`h-4 w-4 animate-spin ${$o[M.tone]}`}):e.jsx(q,{className:`h-4 w-4 ${$o[M.tone]}`})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:M.title}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:M.body})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[M.troubleshoot&&e.jsxs(h,{size:"sm",variant:"ghost",onClick:()=>j(M.troubleshoot),className:"h-7 text-xs gap-1 text-muted-foreground hover:text-foreground",title:"Step-by-step troubleshooting",children:[e.jsx(qc,{className:"h-3.5 w-3.5"}),"Troubleshoot"]}),M.retryAction&&(()=>{const _=M.retryAction.icon,A=_===Pe;return e.jsxs(h,{size:"sm",variant:"secondary",onClick:M.retryAction.onClick,disabled:A,className:"h-7 text-xs gap-1.5",title:"Retry the last step with the same inputs",children:[e.jsx(_,{className:`h-3.5 w-3.5 ${A?"animate-spin":""}`}),M.retryAction.label]})})(),M.nbaAction&&(()=>{const _=M.nbaAction.icon,A=_===Pe;return e.jsxs(h,{size:"sm",variant:"default",onClick:M.nbaAction.onClick,disabled:A,className:"h-7 text-xs gap-1.5",title:"Next best action",children:[e.jsx(_,{className:`h-3.5 w-3.5 ${A?"animate-spin":""}`}),M.nbaAction.label]})})(),M.action&&e.jsx(h,{size:"sm",variant:"outline",onClick:M.action.onClick,className:"h-7 text-xs",children:M.action.label}),M.dismissible!==!1&&e.jsx(h,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>{z(_=>new Set(_).add(M.key)),a&&(M.key==="premium"||M.key==="mx"||M.key==="low_email"||M.key==="tab_recreated")&&(r==null||r()),M.key.startsWith("nba_")&&(N(null),Zg())},"aria-label":"Dismiss",children:e.jsx(zs,{className:"h-3.5 w-3.5"})})]})]})}),e.jsx(Qg,{open:C!==null,onOpenChange:_=>{_||j(null)},topic:C??"extension",prospectName:(a==null?void 0:a.kind)==="premium_blocked"||(
62a==null?void 0:a.kind)==="mx_invalid"?a.prospectName:void 0,onSwitchToEmail:(a==null?void 0:a.kind)==="premium_blocked"?a.onSwitchToEmail:void 0,onSwitchToDM:(a==null?void 0:a.kind)==="mx_invalid"?a.onSwitchToDM:void 0})]})}const ii={fintech:"fintech","financial technology":"fintech","financial services":"fintech",banking:"fintech",neobank:"fintech",neobanking:"fintech",payments:"fintech",payment:"fintech",lending:"fintech",insurtech:"fintech",wealthtech:"fintech",ai:"ai","a.i.":"ai",ml:"ai","machine learning":"ai",llm:"ai",llms:"ai",genai:"ai","generative ai":"ai","ai infra":"ai","ai infrastructure":"ai",devtools:"devtools",devtool:"devtools","developer tools":"devtools",devops:"devtools",infra:"devtools",infrastructure:"devtools",platform:"devtools",observability:"devtools",cloud:"devtools",saas:"saas","b2b saas":"saas","b2b software":"saas",productivity:"saas",collaboration:"saas",ecommerce:"ecommerce","e-commerce":"ecommerce","e commerce":"ecommerce",retail:"ecommerce",dtc:"ecommerce","direct-to-consumer":"ecommerce",shopify:"ecommerce",healthtech:"healthtech","health tech":"healthtech",health:"healthtech",healthcare:"healthtech",medtech:"healthtech","medical tech":"healthtech",digitalhealth:"healthtech",cybersecurity:"cybersecurity","cyber security":"cybersecurity",security:"cybersecurity",infosec:"cybersecurity",appsec:"cybersecurity",crypto:"crypto",cryptocurrency:"crypto",blockchain:"crypto",web3:"crypto",defi:"crypto",edtech:"edtech","ed tech":"edtech",education:"edtech",elearning:"edtech","e-learning":"edtech",hrtech:"hrtech","hr tech":"hrtech",hr:"hrtech",recruiting:"hrtech","talent management":"hrtech",payroll:"hrtech",marketing:"marketing",martech:"marketing","marketing tech":"marketing",adtech:"marketing","ad tech":"marketing",advertising:"marketing",logistics:"logistics",shipping:"logistics",freight:"logistics","supply chain":"logistics",delivery:"logistics",proptech:"proptech","prop tech":"proptech",realestate:"proptech","real estate":"proptech",gaming:"gaming",game:"gaming",games:"gaming",esports:"gaming",media:"media",streaming:"media",entertainment:"media",publishing:"media"},sf=[{name:"Revolut",domain:"revolut.com"},{name:"Stripe",domain:"stripe.com"},{name:"N26",domain:"n26.com"},{name:"Wise",domain:"wise.com"},{name:"Adyen",domain:"adyen.com"},{name:"Klarna",domain:"klarna.com"},{name:"Plaid",domain:"plaid.com"},{name:"Brex",domain:"brex.com"},{name:"Mercury",domain:"mercury.com"},{name:"Ramp",domain:"ramp.com"},{name:"Chime",domain:"chime.com"},{name:"Payoneer",domain:"payoneer.com"},{name:"Monzo",domain:"monzo.com"},{name:"Robinhood",domain:"robinhood.com"},{name:"SoFi",domain:"sofi.com"},{name:"Affirm",domain:"affirm.com"},{name:"Block",domain:"block.xyz"},{name:"Square",domain:"squareup.com"},{name:"Checkout.com",domain:"checkout.com"},{name:"Marqeta",domain:"marqeta.com"},{name:"Nubank",domain:"nubank.com.br"},{name:"Coinbase",domain:"coinbase.com"},{name:"Mollie",domain:"mollie.com"},{name:"GoCardless",domain:"gocardless.com"},{name:"Tide",domain:"tide.co"},{name:"Starling Bank",domain:"starlingbank.com"},{name:"Wealthsimple",domain:"wealthsimple.com"},{name:"Pleo",domain:"pleo.io"},{name:"Spendesk",domain:"spendesk.com"},{name:"Qonto",domain:"qonto.com"},{name:"Bunq",domain:"bunq.com"},{name:"Trade Republic",domain:"traderepublic.com"},{name:"Scalable Capital",domain:"scalable.capital"},{name:"eToro",domain:"etoro.com"},{name:"Trading 212",domain:"trading212.com"},{name:"Curve",domain:"curve.com"},{name:"Zopa",domain:"zopa.com"},{name:"OakNorth",domain:"oaknorth.com"},{name:"Atom Bank",domain:"atombank.co.uk"},{name:"Lunar",domain:"lunar.app"},{name:"Rapyd",domain:"rapyd.net"},{name:"Dave",domain:"dave.com"},{name:"Circle",domain:"circle.com"},{name:"Bolt",domain:"bolt.com"},{name:"Toast",domain:"pos.toasttab.com"},{name:"Mambu",domain:"mambu.com"},{name:"Modulr",domain:"modulrfinance.com"},{name:"Currencycloud",domain:"currencycloud.com"},{name:"TrueLayer",domain:"truelayer.com"},{name:"Tink",domain:"tink.com"},{name:"Yapily",domain:"yapily.com"},{name:"Bitpanda",domain:"bitpanda.com"},{name:"Kraken",domain:"kraken.com"},{name:"Lemonade",domain:"lemonade.com"},{name:"Hippo",domain:"hippo.com"},{name:"Root Insurance",domain:"joinroot.com"},{name:"Carta",domain:"carta.com"},{name:"AngelList",domain:"angellist.com"},{name:"Pipe",domain:"pipe.com"},{name:"Capchase",domain:"capchase.com"},{name:"Mambu",domain:"mambu.com"},{name:"Klarna",domain:"klarna.com"},{name:"PayPal",domain:"paypal.com"},{name:"Wealthfront",domain:"wealthfront.com"},{name:"Betterment",domain:"betterment.com"},{name:"Acorns",domain:"acorns.com"},{name:"Cash App",domain:"cash.app"},{name:"Venmo",domain:"venmo.com"}
62,{name:"Remitly",domain:"remitly.com"},{name:"Western Union",domain:"westernunion.com"},{name:"Ripple",domain:"ripple.com"},{name:"Anchorage",domain:"anchorage.com"},{name:"Fireblocks",domain:"fireblocks.com"},{name:"Chainalysis",domain:"chainalysis.com"},{name:"Alloy",domain:"alloy.com"},{name:"Persona",domain:"withpersona.com"},{name:"Sumsub",domain:"sumsub.com"},{name:"Onfido",domain:"onfido.com"},{name:"ComplyAdvantage",domain:"complyadvantage.com"},{name:"Kanmon",domain:"kanmon.com",size:"xs"},{name:"Zeal",domain:"zeal.com",size:"xs"},{name:"Pave",domain:"ave.dev",size:"xs"},{name:"Pomelo",domain:"omelo.com",size:"xs"},{name:"Monite",domain:"monite.com",size:"xs"},{name:"Column",domain:"column.com",size:"xs"},{name:"Increase",domain:"increase.com",size:"xs"},{name:"Standard Code",domain:"andardco.de",size:"xs"},{name:"Mighty",domain:"mighty.com",size:"xs"},{name:"Bridge",domain:"bridge.xyz",size:"xs"},{name:"Pangea",domain:"angea.cloud",size:"xs"},{name:"Nanovest",domain:"nanovest.com",size:"xs"},{name:"Plume",domain:"luume.com",size:"xs"},{name:"Neocova",domain:"neocova.com",size:"xs"},{name:"Constrafor",domain:"constrafor.com",size:"xs"},{name:"Flexbase",domain:"flexbase.com",size:"xs"},{name:"LevelUp",domain:"levelup.com.br",size:"xs"},{name:"Ensign",domain:"ensign.io",size:"xs"},{name:"Layer1",domain:"layer.one",size:"xs"},{name:"Muni",domain:"getmuni.com",size:"xs"},{name:"Stark Bank",domain:"arkbank.com",size:"xs"},{name:"Eversend",domain:"eversend.co",size:"xs"},{name:"Cowrywise",domain:"cowrywise.com",size:"xs"},{name:"Akudo",domain:"akudo.in",size:"xs"},{name:"Vouch",domain:"vouch.us",size:"s"},{name:"Stitch",domain:"itch.money",size:"s"},{name:"Unit",domain:"unit.co",size:"s"},{name:"Swan",domain:"wan.io",size:"s"},{name:"Belvo",domain:"belvo.com",size:"s"},{name:"Jeitto",domain:"jeitto.com.br",size:"s"},{name:"Meritize",domain:"meritize.com",size:"s"},{name:"Parafin",domain:"ara.fintech.com",size:"s"},{name:"Jiko",domain:"jiko.io",size:"s"},{name:"Bond",domain:"bond.tech",size:"s"},{name:"Treasury Prime",domain:"reasuryprime.com",size:"s"},{name:"Synctera",domain:"ynctera.com",size:"s"},{name:"Lithic",domain:"lithic.com",size:"s"},{name:"X1",domain:"x1.co",size:"s"},{name:"Skyflow",domain:"kyflow.com",size:"s"},{name:"SentiLink",domain:"entilink.com",size:"s"},{name:"Sardine",domain:"ardine.ai",size:"s"},{name:"Unit21",domain:"unit21.ai",size:"s"},{name:"Hummingbird",domain:"ummingbird.co",size:"s"},{name:"Middesk",domain:"middesk.com",size:"s"},{name:"Silverflow",domain:"ilverflow.com",size:"s"},{name:"Nomba",domain:"nomba.com",size:"s"},{name:"Tonik Bank",domain:"onikbank.com",size:"s"},{name:"Mantl",domain:"mantl.com",size:"s"},{name:"Narmi",domain:"narmi.com",size:"s"},{name:"Vouch Insurance",domain:"vouch.io",size:"s"},{name:"Cowbell Cyber",domain:"cowbell.ai",size:"s"},{name:"Resilience",domain:"resilienceinsurance.com",size:"s"},{name:"Ozow",domain:"ozow.com",size:"s"},{name:"PiggyVest",domain:"iggyvest.com",size:"s"},{name:"Carbon",domain:"carbon.money",size:"s"},{name:"FamApp",domain:"famapp.in",size:"s"},{name:"Paxos",domain:"axostk.com",size:"m"},{name:"Kuda",domain:"kuda.com",size:"m"},{name:"Rain",domain:"rain.us",size:"m"},{name:"DailyPay",domain:"daily-pay.com",size:"m"},{name:"Wagestream",domain:"wagestream.com",size:"m"},{name:"Branch",domain:"branchapp.com",size:"m"},{name:"Tally",domain:"ally.com",size:"m"},{name:"Modern Treasury",domain:"moderntreasury.com",size:"m"},{name:"Deserve",domain:"deserve.com",size:"m"},{name:"Petal",domain:"etale.com",size:"m"},{name:"PPRO",domain:"ro.com",size:"m"},{name:"Thunes",domain:"unes.com",size:"m"},{name:"TerraPay",domain:"errapay.com",size:"m"},{name:"FairMoney",domain:"fairmoney.io",size:"m"},{name:"TymeBank",domain:"yme.com",size:"m"},{name:"MFS Africa",domain:"mfsafrica.com",size:"m"},{name:"Chipper Cash",domain:"chippercash.com",size:"m"},{name:"Wave Mobile Money",domain:"wave.com",size:"m"},{name:"Opn",domain:"opn.ooo",size:"m"},{name:"Fazz",domain:"xfers.com",size:"m"},{name:"Aspire",domain:"aspireapp.com",size:"m"},{name:"Altruist",domain:"altruist.com",size:"m"},{name:"Corvus Insurance",domain:"corvusinsurance.com",size:"m"},{name:"Coalition",domain:"coalitioninc.com",size:"m"},{name:"At-Bay",domain:"at-bay.com",size:"m"},{name:"Pismo",domain:"ismo.io",size:"m"},{name:"CloudWalk",domain:"cloudwalk.io",size:"m"},{name:"Dock",domain:"dock.tech",size:"m"},{name:"Paystack",domain:"aystack.com",size:"m"},{name:"Flutterwave",domain:"flutterwave.com",size:"m"},{name:"JUMO",domain:"jumo.world",size:"m"},{name:"Kredivo",domain:"kredivo.com",size:"m"},{name:"Jupiter Money",domain:"jupiter.money",size:"m"},{name:"Fi Money",domain:"fi.money",size:"m"},{name:"Slice",domain:"liceit.com",size:"l"},{name:"Razorpay",domain:"razorpay.com",size:"l"},{name:"Pine Labs",domain:"ineperks.in",size:"l"},{name:"Creditas",domain:"creditas.com.br",size:"l"},{name:"Neon",domain:"neon.com.br",size:"l"},{name:"Bill",domain:"bill.com",size:"xl"},{name:"Fiserv",domain:"fiserv.com",size:"xl"},{name:"Visa",domain:"visa.com",size:"xl"},{name:"Procore Pay",domain:"rocore.com",size:"xl"}],tf=[{name:"OpenAI",domain:"openai.com"},{name:"Anthropic",domain:"anthropic.com"},{name:"Mistral AI",domain:"mistral.ai"},{name:"Cohere",domain:"cohere.com"},{name:"Hugging Face",domain:"huggingface.co"},{name:"Pinecone",domain:"pinecone.io"},{name:"Weaviate",domain:"weaviate.io"},{name:"LangChain",domain:"langchain.com"},{name:"LlamaIndex",domain:"llamaindex.ai"},{name:"Replicate",domain:"replicate.com"},{name:"Modal",domain:"modal.com"},{name:"Together AI",domain:"together.ai"},{name:"Fireworks AI",domain:"fireworks.ai"},{name:"Groq",domain:"groq.com"},{name:"Perplexity",domain:"perplexity.ai"},{name:"Runway",domain:"runwayml.com"},{name:"ElevenLabs",domain:"elevenlabs.io"},{name:"Stability AI",domain:"stability.ai"},{name:"Scale AI",domain:"scale.com"},{name:"Adept",domain:"adept.ai"},{name:"Inflection AI",domain:"inflection.ai"},{name:"Character.AI",domain:"character.ai"},{name:"xAI",domain:"x.ai"},{name:"DeepMind",domain:"deepmind.com"}
62,{name:"Databricks",domain:"databricks.com"},{name:"Snowflake",domain:"snowflake.com"},{name:"Weights & Biases",domain:"wandb.ai"},{name:"Cresta",domain:"cresta.com"},{name:"Glean",domain:"glean.com"},{name:"Harvey",domain:"harvey.ai"},{name:"Jasper",domain:"jasper.ai"},{name:"Copy.ai",domain:"copy.ai"},{name:"Writer",domain:"writer.com"},{name:"Synthesia",domain:"synthesia.io"},{name:"HeyGen",domain:"heygen.com"},{name:"Tome",domain:"tome.app"},{name:"Gamma",domain:"gamma.app"},{name:"Cursor",domain:"cursor.com"},{name:"Codeium",domain:"codeium.com"},{name:"Tabnine",domain:"tabnine.com"},{name:"Replit",domain:"replit.com"},{name:"Vercel",domain:"vercel.com"},{name:"Lovable",domain:"lovable.dev"},{name:"Bolt.new",domain:"bolt.new"},{name:"v0",domain:"v0.dev"},{name:"Magic",domain:"magic.dev"},{name:"Poolside",domain:"poolside.ai"},{name:"Imbue",domain:"imbue.com"},{name:"Reka",domain:"reka.ai"},{name:"AI21 Labs",domain:"ai21.com"},{name:"Aleph Alpha",domain:"aleph-alpha.com"},{name:"Mosaic ML",domain:"mosaicml.com"},{name:"Anyscale",domain:"anyscale.com"},{name:"Lightning AI",domain:"lightning.ai"},{name:"Modal",domain:"modal.com"},{name:"Baseten",domain:"baseten.co"},{name:"Octo AI",domain:"octo.ai"},{name:"RunPod",domain:"runpod.io"},{name:"Lambda",domain:"lambdalabs.com"},{name:"CoreWeave",domain:"coreweave.com"},{name:"Crusoe",domain:"crusoe.ai"},{name:"Sambanova",domain:"sambanova.ai"},{name:"Cerebras",domain:"cerebras.net"},{name:"Tenstorrent",domain:"tenstorrent.com"},{name:"Suno",domain:"suno.com"},{name:"Udio",domain:"udio.com"},{name:"Pika",domain:"pika.art"},{name:"Luma AI",domain:"lumalabs.ai"},{name:"Midjourney",domain:"midjourney.com"},{name:"Leonardo AI",domain:"leonardo.ai"},{name:"Ideogram",domain:"ideogram.ai"},{name:"ReductoAI",domain:"reducto.ai",size:"xs"},{name:"Unstructured",domain:"unstructured.io",size:"s"},{name:"Mendable",domain:"mendable.ai",size:"xs"},{name:"Vapi",domain:"vapi.ai",size:"xs"},{name:"Cartesia",domain:"cartesia.ai",size:"xs"},{name:"Parea AI",domain:"parea.ai",size:"xs"},{name:"Langfuse",domain:"langfuse.com",size:"xs"},{name:"Metalero",domain:"metalero.ai",size:"xs"},{name:"Boundary ML",domain:"boundaryml.com",size:"xs"},{name:"Arthur AI",domain:"arthur.ai",size:"s"},{name:"Deepgram",domain:"deepgram.com",size:"m"},{name:"AssemblyAI",domain:"assemblyai.com",size:"m"},{name:"Sarvam AI",domain:"sarvam.ai",size:"xs"},{name:"Krutrim",domain:"krutrim.com",size:"m"},{name:"Sakana AI",domain:"sakana.ai",size:"xs"},{name:"Kyutai",domain:"kyutai.org",size:"xs"},{name:"Silicon Intelligence",domain:"silicon-intelligence.com",size:"xs"},{name:"Voyage AI",domain:"voyageai.com",size:"xs"},{name:"Context AI",domain:"context.ai",size:"xs"},{name:"BerriAI",domain:"berri.ai",size:"xs"},{name:"Fixie AI",domain:"fixie.ai",size:"xs"},{name:"HyperWrite AI",domain:"hyperwriteai.com",size:"s"},{name:"Supermaven",domain:"supermaven.com",size:"xs"},{name:"Augment AI",domain:"augmentapi.com",size:"xs"},{name:"Greptile",domain:"greptile.com",size:"xs"},{name:"Sweep AI",domain:"sweep.dev",size:"xs"},{name:"Duckie AI",domain:"duckie.ai",size:"xs"},{name:"Phind",domain:"phind.com",size:"xs"},{name:"Exa AI",domain:"exa.ai",size:"xs"},{name:"Trieve AI",domain:"trieve.ai",size:"xs"},{name:"Vectorize",domain:"vectorize.io",size:"xs"},{name:"Turbopuffer",domain:"turbopuffer.com",size:"xs"},{name:"Qdrant",domain:"qdrant.tech",size:"s"},{name:"Predibase",domain:"predibase.com",size:"s"},{name:"Gradient AI",domain:"gradient.ai",size:"s"},{name:"DeepInfra",domain:"deepinfra.com",size:"xs"},{name:"Fal AI",domain:"fal.ai",size:"xs"},{name:"Traceloop",domain:"traceloop.com",size:"xs"},{name:"HoneyHive AI",domain:"honeyhive.ai",size:"xs"},{name:"Confident AI",domain:"confident-ai.com",size:"xs"},{name:"vLLM Project Group",domain:"vllm.ai",size:"xs"},{name:"BentoML Space",domain:"bentoml.com",size:"s"},{name:"Seldon",domain:"seldon.io",size:"s"},{name:"Comet ML",domain:"comet.com",size:"s"},{name:"Neptune AI",domain:"neptune.ai",size:"s"},{name:"Labelbox Sense",domain:"labelbox.com",size:"m"},{name:"Snorkel AI",domain:"snorkel.ai",size:"m"},{name:"Encord AI",domain:"encord.com",size:"s"},{name:"V7 Labs",domain:"v7labs.com",size:"s"},{name:"Hebbia AI",domain:"hebbia.ai",size:"s"},{name:"Nuclia AI",domain:"nuclia.com",size:"xs"},{name:"Vectara AI",domain:"vectara.com",size:"s"},{name:"Dust AI",domain:"dust.tt",size:"xs"},{name:"Typify AI",domain:"typify.ai",size:"xs"},{name:"Relevance AI",domain:"relevanceai.com",size:"s"},{name:"Gumloop AI",domain:"gumloop.com",size:"xs"},{name:"Skyflow AI",domain:"skyflow.com",size:"s"},{name:"Aimpact AI",domain:"aimpact.com",size:"xs"},{name:"Robust Intelligence",domain:"robustintelligence.com",size:"s"},{name:"HiddenLayer AI",domain:"hiddenlayer.com",size:"s"},{name:"Protect AI",domain:"protectai.com",size:"s"},{name:"CalypsoAI",domain:"calypsoai.com",size:"s"},{name:"Lakera AI",domain:"lakera.ai",size:"xs"},{name:"Modzy AI",domain:"modzy.com",size:"s"},{name:"Wallaroo AI",domain:"wallaroo.ai",size:"s"},{name:"Tecton AI",domain:"tecton.ai",size:"m"},{name:"Hopsworks AI",domain:"hopsworks.ai",size:"s"},{name:"Rasa AI",domain:"rasa.com",size:"m"},{name:"Cognigy AI Engineering",domain:"cognigy.com",size:"m"},{name:"Yellow AI Platforms",domain:"yellow.ai",size:"l"},{name:"Uniphore AI Solutions",domain:"uniphore.com",size:"l"},{name:"Gupshup Conversational AI",domain:"gupshup.io",size:"l"},{name:"Haptik AI Builders",domain:"haptik.ai",size:"m"},{name:"Moveworks AI Enterprise",domain:"moveworks.com",size:"m"},{name:"Paradox AI Platform",domain:"paradox.ai",size:"m"},{name:"H2O.ai Cloud",domain:"h2o.ai",size:"m"},{name:"Dataiku AI Studio",domain:"dataiku.com",size:"l"},{name:"DataRobot AI Apps",domain:"datarobot.com",size:"l"},{name:"SparkCognition AI Systems",domain:"sparkcognition.com",size:"m"},{name:"Abacus AI Services",domain:"abacus.ai",size:"s"},{name:"Vast AI Compute",domain:"vast.ai",size:"xs"},{name:"FluidStack AI Ops",domain:"fluidstack.io",size:"xs"},{name:"BitMagic AI Worlds",domain:"bitmagic.space",size:"xs"},{name:"Inworld AI NPCs",domain:"inworld.ai",size:"s"},{name:"Obsidian AI Security",domain:"obsidian.security",size:"m"},{name:"Microsoft Azure AI",domain:"microsoft.com",size:"xl"},{name:"Google Cloud AI Vertex",domain:"google.com",size:"xl"},{name:"AWS Bedrock AI",domain:"aws.amazon.com",size:"xl"}],af=[{name:"Vercel",domain:"vercel.com"},{name:"Netlify",domain:"netlify.com"},{name:"Supabase",domain:"supabase.com"},{name:"Render",domain:"render.com"},{name:"Railway",domain:"railway.app"},{name:"Fly.io",domain:"fly.io"},{name:"GitHub",domain:"github.com"},{name:"GitLab",domain:"gitlab.com"},{name:"Bitbucket",domain:"bitbucket.org"},{name:"CircleCI",domain:"circleci.com"},{name:"Buildkite",domain:"buildkite.com"},{name:"Datadog",domain:"datadoghq.com"},{name:"Sentry",domain:"sentry.io"},{name:"LaunchDarkly",domain:"launchdarkly.com"},{name:"PostHog",domain:"posthog.com"},{name:"Linear",domain:"linear.app"},{name:"Retool",domain:"retool.com"},{name:"HashiCorp",domain:"hashicorp.com"},{name:"Cloudflare",domain:"cloudflare.com"},{name:"Fastly",domain:"fastly.com"},{name:"Akamai",domain:"akamai.com"},{name:"MongoDB",domain:"mongodb.com"},{name:"Redis",domain:"redis.com"},{name:"PlanetScale",domain:"planetscale.com"},{name:"Neon",domain:"neon.tech"},{name:"Turso",domain:"turso.tech"},{name:"Confluent",domain:"confluent.io"},{name:"Elastic",domain:"elastic.co"},{name:"Grafana Labs",domain:"grafana.com"},{name:"Honeycomb",domain:"honeycomb.io"},{name:"New Relic",domain:"newrelic.com"},{name:"Splunk",domain:"splunk.com"},{name:"PagerDuty",domain:"pagerduty.com"},{name:"Sumo Logic",domain:"sumologic.com"},{name:"Snyk",domain:"snyk.io"},{name:"Sourcegraph",domain:"sourcegraph.com"},{name:"JetBrains",domain:"jetbrains.com"},{name:"Postman",domain:"postman.com"},{name:"Insomnia",domain:"insomnia.rest"},{name:"Twilio",domain:"twilio.com"},{name:"SendGrid",domain:"sendgrid.com"},{name:"Resend",domain:"resend.com"},{name:"Mailgun",domain:"mailgun.com"},{name:"Algolia",domain:"algolia.com"},{name:"Auth0",domain:"auth0.com"},{name:"Okta",domain:"okta.com"},{name:"Clerk",domain:"clerk.com"},{name:"WorkOS",domain:"workos.com"},{name:"Stripe",domain:"stripe.com"},{name:"Docker",domain:"docker.com"},{name:"Kubernetes",domain:"kubernetes.io"},{name:"Terraform",domain:"terraform.io"},{name:"Pulumi",domain:"pulumi.com"},{name:"Spacelift",domain:"spacelift.io"},{name:"Codecov",domain:"codecov.io"},{name:"Sentry",domain:"sentry.io"},{name:"Bugsnag",domain:"bugsnag.com"},{name:"Rollbar",domain:"rollbar.com"},{name:"Vercel",domain:"vercel.com"},{name:"Heroku",domain:"heroku.com"},{name:"DigitalOcean",domain:"digitalocean.com"},{name:"Linode",domain:"linode.com"},{name:"Hetzner",domain:"hetzner.com"},{name:"Ngrok",domain:"ngrok.com"},{name:"Statsig",domain:"statsig.com"},{name:"Mixpanel",domain:"mixpanel.com"},{name:"Amplitude",domain:"amplitude.com"},{name:"Segment",domain:"segment.com"},{name:"Liquibase",domain:"liquibase.com"},{name:"Prisma",domain:"prisma.io"},{name:"Dagger",domain:"dagger.io",size:"xs"},{name:"Koyeb",domain:"koyeb.com",size:"xs"},{name:"Speakeasy",domain:"eakeasyapi.dev",size:"xs"},{name:"Inngest",domain:"inngest.com",size:"xs"},{name:"Encore",domain:"encore.dev",size:"xs"},{name:"Shuttle",domain:"uttle.rs",size:"xs"},{name:"Qovery",domain:"qovery.com",size:"xs"},{name:"Checkly",domain:"checklyhq.com",size:"xs"},{name:"Axiom",domain:"axiom.co",size:"xs"},{name:"Grafbase",domain:"grafbase.com",size:"xs"},{name:"ChiselStrike",domain:"chiselstrike.com",size:"xs"},{name:"FerretDB",domain:"ferret-db.com",size:"xs"},{name:"Mergent",domain:"mergent.co",size:"xs"},{name:"Trigger.dev",domain:"rigger.dev",size:"xs"},{name:"EdgeDB",domain:"edgedb.com",size:"xs"},{name:"Xata",domain:"xata.io",size:"xs"},{name:"SurrealDB",domain:"urrealdb.com",size:"xs"},{name:"Windmill",domain:"windmill.dev",size:"xs"},{name:"SuperTokens",domain:"upertokens.com",size:"xs"},{name:"ZITADEL",domain:"zitadel.com",size:"xs"}
62,{name:"Border0",domain:"border0.com",size:"xs"},{name:"Terrateam",domain:"errateam.io",size:"xs"},{name:"Loft Labs",domain:"loft.sh",size:"xs"},{name:"Garden",domain:"garden.io",size:"xs"},{name:"Brest",domain:"brest.dev",size:"xs"},{name:"LocalStack",domain:"localstack.cloud",size:"xs"},{name:"Outline",domain:"getoutline.com",size:"xs"},{name:"Chroma",domain:"chromadb.com",size:"xs"},{name:"LangChain",domain:"langchain.com",size:"xs"},{name:"Helicone",domain:"elicone.ai",size:"xs"},{name:"Braintrust",domain:"braintrustdata.com",size:"xs"},{name:"WhyLabs",domain:"whylabs.ai",size:"xs"},{name:"Evidently AI",domain:"evidentlyai.com",size:"xs"},{name:"Modal",domain:"modal.com",size:"xs"},{name:"Featureform",domain:"featureform.com",size:"xs"},{name:"Trino",domain:"rino.io",size:"xs"},{name:"RisingWave",domain:"risingwave.com",size:"xs"},{name:"Upstash",domain:"upstash.com",size:"xs"},{name:"Momento",domain:"momento.com",size:"xs"},{name:"Svix",domain:"vix.com",size:"xs"},{name:"Hookdeck",domain:"ookdeck.com",size:"xs"},{name:"Convoy",domain:"convoy.linux.dev",size:"xs"},{name:"Standard Webhooks",domain:"andardwebhooks.com",size:"xs"},{name:"Buoyant",domain:"buoyant.io",size:"xs"},{name:"incident.io",domain:"incident.io",size:"s"},{name:"Pangea",domain:"angea.cloud",size:"s"},{name:"Better Stack",domain:"betterstack.com",size:"s"},{name:"Upbound",domain:"upbound.io",size:"s"},{name:"TileDB",domain:"iledb.com",size:"s"},{name:"ScyllaDB",domain:"cylladb.com",size:"s"},{name:"FireHydrant",domain:"firehydrant.com",size:"s"},{name:"Blameless",domain:"blameless.com",size:"s"},{name:"n8n",domain:"n8n.io",size:"s"},{name:"Appsmith",domain:"appsmith.com",size:"s"},{name:"Stytch",domain:"ytch.com",size:"s"},{name:"Descope",domain:"descope.com",size:"s"},{name:"Twingate",domain:"wingate.com",size:"s"},{name:"Cloudsmith",domain:"cloudsmith.com",size:"s"},{name:"env0",domain:"env0.com",size:"s"},{name:"Okteto",domain:"okteto.com",size:"s"},{name:"Coder",domain:"coder.com",size:"s"},{name:"Gitpod",domain:"gitpod.io",size:"s"},{name:"Replicate",domain:"replicate.com",size:"s"},{name:"Pinecone",domain:"inecone.io",size:"s"},{name:"Weaviate",domain:"weaviate.io",size:"s"},{name:"Arize AI",domain:"arize.com",size:"s"},{name:"Fiddler AI",domain:"fiddler.ai",size:"s"},{name:"deepset",domain:"deepset.ai",size:"s"},{name:"Baseten",domain:"baseten.co",size:"s"},{name:"Tecton",domain:"ecton.ai",size:"s"},{name:"Hopsworks",domain:"opsworks.ai",size:"s"},{name:"Dagster Labs",domain:"dagster.io",size:"s"},{name:"Prefect",domain:"refect.io",size:"s"},{name:"Materialize",domain:"materialize.com",size:"s"},{name:"Conduktor",domain:"conduktor.io",size:"s"},{name:"Solo.io",domain:"olo.io",size:"s"},{name:"Tetrate",domain:"etrate.io",size:"s"},{name:"Isovalent",domain:"isovalent.com",size:"s"},{name:"StrongDM",domain:"rongdm.com",size:"s"},{name:"Temporal",domain:"emporal.io",size:"m"},{name:"Cockroach Labs",domain:"cockroachlabs.com",size:"m"},{name:"Tailscale",domain:"ailscale.com",size:"m"},{name:"Hugging Face",domain:"uggingface.co",size:"m"},{name:"Zilliz",domain:"milvus.io",size:"m"},{name:"Anyscale",domain:"anyscale.com",size:"m"},{name:"Astronomer",domain:"astronomer.io",size:"m"},{name:"Airbyte",domain:"airbyte.com",size:"m"},{name:"dbt Labs",domain:"dbtlabs.com",size:"m"},{name:"Starburst",domain:"arburst.io",size:"m"},{name:"ClickHouse",domain:"clickhouse.com",size:"m"},{name:"Tyk",domain:"yk.io",size:"m"},{name:"Sysdig",domain:"ysdig.com",size:"m"},{name:"Lacework",domain:"lacework.com",size:"m"},{name:"Teleport",domain:"eleport.com",size:"m"},{name:"JFrog",domain:"jfrog.com",size:"l"},{name:"Fivetran",domain:"fivetran.com",size:"l"},{name:"Kong",domain:"konghq.com",size:"l"},{name:"Wiz",domain:"wiz.io",size:"l"},{name:"Snowflake",domain:"nowflake.com",size:"xl"},{name:"Databricks",domain:"databricks.com",size:"xl"}],rf=[{name:"HubSpot",domain:"hubspot.com"},{name:"Salesforce",domain:"salesforce.com"},{name:"Notion",domain:"notion.so"},{name:"Airtable",domain:"airtable.com"},{name:"Figma",domain:"figma.com"},{name:"Asana",domain:"asana.com"},{name:"Monday.com",domain:"monday.com"},{name:"ClickUp",domain:"clickup.com"},{name:"Intercom",domain:"intercom.com"},{name:"Zendesk",domain:"zendesk.com"},{name:"Calendly",domain:"calendly.com"}
62,{name:"Loom",domain:"loom.com"},{name:"Slack",domain:"slack.com"},{name:"Atlassian",domain:"atlassian.com"},{name:"Trello",domain:"trello.com"},{name:"Miro",domain:"miro.com"},{name:"Mural",domain:"mural.co"},{name:"Canva",domain:"canva.com"},{name:"Dropbox",domain:"dropbox.com"},{name:"Box",domain:"box.com"},{name:"DocuSign",domain:"docusign.com"},{name:"PandaDoc",domain:"pandadoc.com"},{name:"Zoom",domain:"zoom.us"},{name:"Webex",domain:"webex.com"},{name:"Gong",domain:"gong.io"},{name:"Chorus",domain:"chorus.ai"},{name:"Outreach",domain:"outreach.io"},{name:"Salesloft",domain:"salesloft.com"},{name:"Apollo",domain:"apollo.io"},{name:"ZoomInfo",domain:"zoominfo.com"},{name:"Clearbit",domain:"clearbit.com"},{name:"Drift",domain:"drift.com"},{name:"Pipedrive",domain:"pipedrive.com"},{name:"Freshworks",domain:"freshworks.com"},{name:"Zoho",domain:"zoho.com"},{name:"ServiceNow",domain:"servicenow.com"},{name:"Workday",domain:"workday.com"},{name:"SAP",domain:"sap.com"},{name:"Oracle",domain:"oracle.com"},{name:"Smartsheet",domain:"smartsheet.com"},{name:"Coda",domain:"coda.io"},{name:"Mem",domain:"mem.ai"},{name:"Superhuman",domain:"superhuman.com"},{name:"Front",domain:"front.com"},{name:"Help Scout",domain:"helpscout.com"},{name:"Crisp",domain:"crisp.chat"},{name:"Tidio",domain:"tidio.com"},{name:"Plaid",domain:"plaid.com"},{name:"Webflow",domain:"webflow.com"},{name:"Bubble",domain:"bubble.io"},{name:"Typeform",domain:"typeform.com"},{name:"SurveyMonkey",domain:"surveymonkey.com"},{name:"Qualtrics",domain:"qualtrics.com"},{name:"Height",domain:"eight.app",size:"xs"},{name:"Attio",domain:"attio.com",size:"xs"},{name:"folk",domain:"folk.app",size:"xs"},{name:"Surfe",domain:"urfe.com",size:"xs"},{name:"Amie",domain:"amie.so",size:"xs"},{name:"Raycast",domain:"raycast.com",size:"xs"},{name:"Screener",domain:"creen.run",size:"xs"},{name:"Rows",domain:"rows.com",size:"xs"},{name:"Cron",domain:"cron.com",size:"xs"},{name:"June",domain:"june.so",size:"xs"},{name:"Tally",domain:"ally.so",size:"xs"},{name:"Reclaim.ai",domain:"reclaim.ai",size:"xs"},{name:"Magical",domain:"magical.com",size:"xs"},{name:"Vowel",domain:"vowel.com",size:"xs"},{name:"TLDV",domain:"lapi.io",size:"xs"},{name:"Missive",domain:"missiveapp.com",size:"xs"},{name:"Cycle",domain:"cycle.app",size:"xs"},{name:"Slite",domain:"lite.com",size:"xs"},{name:"Nuclino",domain:"nuclino.com",size:"xs"},{name:"Outline",domain:"getoutline.com",size:"xs"},{name:"Airplane",domain:"airplane.dev",size:"xs"},{name:"Internal",domain:"internal.io",size:"xs"},{name:"WorkOS",domain:"workos.com",size:"xs"},{name:"Read AI",domain:"read.ai",size:"xs"},{name:"Fathom",domain:"fathom.video",size:"xs"},{name:"PostHog",domain:"osthog.com",size:"xs"},{name:"Chameleon",domain:"chameleon.io",size:"xs"},{name:"Userflow",domain:"userflow.com",size:"xs"},{name:"Plain",domain:"lain.com",size:"xs"},{name:"Tavus",domain:"avus.ai",size:"xs"},{name:"Noty.ai",domain:"noty.ai",size:"xs"},{name:"Firelay",domain:"firelay.com",size:"xs"},{name:"Superlist",domain:"uperlist.com",size:"xs"},{name:"Any Distance",domain:"anydistance.active",size:"xs"},{name:"Tome",domain:"ome.app",size:"s"},{name:"Linear",domain:"linear.app",size:"s"},{name:"Clay",domain:"clay.com",size:"s"},{name:"Perplexity",domain:"erplexity.ai",size:"s"},{name:"Grain",domain:"grain.com",size:"s"},{name:"Copy.ai",domain:"copy.ai",size:"s"},{name:"HEY",domain:"ey.com",size:"s"},{name:"Trainual",domain:"rainual.com",size:"s"},{name:"incident.io",domain:"incident.io",size:"s"},{name:"Stytch",domain:"ytch.com",size:"s"},{name:"Fireflies.ai",domain:"fireflies.ai",size:"s"},{name:"Clockwise",domain:"getclockwise.com",size:"s"},{name:"Secureframe",domain:"ecureframe.com",size:"s"},{name:"Bitwarden",domain:"bitwarden.com",size:"s"},{name:"Airbyte",domain:"airbyte.com",size:"s"},{name:"Census",domain:"census.com",size:"s"},{name:"Hightouch",domain:"ightouch.com",size:"s"},{name:"LogRocket",domain:"logrocket.com",size:"s"},{name:"Appcues",domain:"appcues.com",size:"s"},{name:"Customer.io",domain:"customer.io",size:"s"},{name:"Postscript",domain:"ostscript.io",size:"s"},{name:"Ultimate.ai",domain:"ultimate.ai",size:"s"},{name:"Mavenoid",domain:"mavenoid.com",size:"s"},{name:"Vitally",domain:"vitally.io",size:"s"},{name:"Planhat",domain:"lanhat.com",size:"s"},{name:"ChurnZero",domain:"churnzero.net",size:"s"},{name:"Catalyst",domain:"catalyst.io",size:"s"},{name:"Synthesia",domain:"ynthesia.io",size:"s"},{name:"Runway",domain:"runwayml.com",size:"s"},{name:"Descript",domain:"descript.com",size:"s"},{name:"Riverside.fm",domain:"riverside.fm",size:"s"},{name:"Jasper",domain:"jasper.ai",size:"m"},{name:"Guru",domain:"getguru.com",size:"m"},{name:"Retool",domain:"retool.com",size:"m"},{name:"Otter.ai",domain:"otter.ai",size:"m"},{name:"Vanta",domain:"vanta.com",size:"m"},{name:"Drata",domain:"drata.com",size:"m"},{name:"Oyster",domain:"oysterhr.com",size:"m"},{name:"Papaya Global",domain:"apayaglobal.com",size:"m"},{name:"HiBob",domain:"ibob.com",size:"m"},{name:"Lattice",domain:"lattice.com",size:"m"},{name:"Dashlane",domain:"dashlane.com",size:"m"},{name:"dbt Labs",domain:"dbtlabs.com",size:"m"},{name:"Segment",domain:"egment.com",size:"m"},{name:"Amplitude",domain:"amplitude.com",size:"m"},{name:"Mixpanel",domain:"mixpanel.com",size:"m"},{name:"FullStory",domain:"fullstory.com",size:"m"},{name:"Iterable",domain:"iterable.com",size:"m"},{name:"Gorgias",domain:"gorgias.com",size:"m"},{name:"Gladly",domain:"gladly.com",size:"m"},{name:"Kustomer",domain:"kustomer.com",size:"m"},{name:"Ada",domain:"ada.support",size:"m"},{name:"Rippling",domain:"rippling.com",size:"l"},{name:"Deel",domain:"deel.com",size:"l"},{name:"Remote",domain:"remote.com",size:"l"},{name:"Personio",domain:"ersonio.com",size:"l"},{name:"Culture Amp",domain:"cultureamp.com",size:"l"},{name:"1Password",domain:"1password.com",size:"l"},{name:"Fivetran",domain:"fivetran.com",size:"l"},{name:"Pendo",domain:"endo.io",size:"l"},{name:"Braze",domain:"braze.com",size:"l"},{name:"Klaviyo",domain:"klaviyo.com",size:"l"},{name:"Attentive",domain:"attentive.com",size:"l"},{name:"Okta",domain:"okta.com",size:"xl"},{name:"Snowflake",domain:"nowflake.com",size:"xl"}
62,{name:"Databricks",domain:"databricks.com",size:"xl"}],nf=[{name:"Shopify",domain:"shopify.com"},{name:"BigCommerce",domain:"bigcommerce.com"},{name:"Squarespace",domain:"squarespace.com"},{name:"Wix",domain:"wix.com"},{name:"Webflow",domain:"webflow.com"},{name:"WooCommerce",domain:"woocommerce.com"},{name:"Recharge",domain:"rechargepayments.com"},{name:"Klaviyo",domain:"klaviyo.com"},{name:"Gorgias",domain:"gorgias.com"},{name:"Yotpo",domain:"yotpo.com"},{name:"Attentive",domain:"attentivemobile.com"},{name:"Postscript",domain:"postscript.io"},{name:"Bold Commerce",domain:"boldcommerce.com"},{name:"Rebuy",domain:"rebuyengine.com"},{name:"Shogun",domain:"getshogun.com"},{name:"Loop",domain:"loopreturns.com"},{name:"Returnly",domain:"returnly.com"},{name:"Stamped",domain:"stamped.io"},{name:"Judge.me",domain:"judge.me"},{name:"Okendo",domain:"okendo.io"},{name:"Zaius",domain:"zaius.com"},{name:"Bloomreach",domain:"bloomreach.com"},{name:"Algolia",domain:"algolia.com"},{name:"Nosto",domain:"nosto.com"},{name:"Searchspring",domain:"searchspring.com"},{name:"Triple Whale",domain:"triplewhale.com"},{name:"Northbeam",domain:"northbeam.io"},{name:"Polar Analytics",domain:"polaranalytics.com"},{name:"Glew",domain:"glew.io"},{name:"Segment",domain:"segment.com"},{name:"Etsy",domain:"etsy.com"},{name:"eBay",domain:"ebay.com"},{name:"Faire",domain:"faire.com"},{name:"Mirakl",domain:"mirakl.com"},{name:"Commercetools",domain:"commercetools.com"},{name:"Salesforce Commerce",domain:"salesforce.com"},{name:"Magento",domain:"magento.com"},{name:"Shopware",domain:"shopware.com"},{name:"Spryker",domain:"spryker.com"},{name:"Vinted",domain:"vinted.com"},{name:"Depop",domain:"depop.com"},{name:"ASOS",domain:"asos.com"},{name:"Zalando",domain:"zalando.com"},{name:"Allbirds",domain:"allbirds.com"},{name:"Warby Parker",domain:"warbyparker.com"},{name:"Glossier",domain:"glossier.com"},{name:"Casper",domain:"casper.com"},{name:"Away",domain:"awaytravel.com"},{name:"Harry's",domain:"harrys.com"},{name:"Dollar Shave Club",domain:"dollarshaveclub.com"},{name:"Replo",domain:"replo.app",size:"xs"},{name:"Tydo",domain:"ydo.com",size:"xs"},{name:"Fondue",domain:"fondue.com",size:"xs"},{name:"Feroot",domain:"feroot.com",size:"xs"},{name:"Penny",domain:"ennie.com",size:"xs"},{name:"Wonderment",domain:"wonderment.com",size:"xs"},{name:"Mantle",domain:"mantle.dev",size:"xs"},{name:"Viably",domain:"viably.com",size:"xs"},{name:"Milo",domain:"okmilo.com",size:"xs"},{name:"Carro",domain:"getcarro.com",size:"xs"},{name:"Arrive",domain:"arrive.io",size:"xs"},{name:"Intelligems",domain:"intelligems.io",size:"xs"},{name:"Comfy",domain:"comfy.org",size:"xs"},{name:"Dover",domain:"dover.com",size:"xs"},{name:"Mojo",domain:"getmojo.com",size:"xs"},{name:"JoinedUp",domain:"joinedup.com",size:"xs"},{name:"Kin AI",domain:"kin.ai",size:"xs"},{name:"Koala",domain:"koala.io",size:"xs"},{name:"Layers",domain:"layers.com",size:"xs"},{name:"Marra",domain:"marratech.com",size:"xs"},{name:"Menten AI",domain:"menten.ai",size:"xs"},{name:"Novos",domain:"novos.io",size:"xs"},{name:"Parcelment",domain:"arcelment.com",size:"xs"},{name:"Quidax",domain:"quidax.com",size:"xs"},{name:"Recap",domain:"recap.io",size:"xs"},{name:"SegmentStream",domain:"egmentstream.com",size:"xs"},{name:"Sitebase",domain:"esitebase.com",size:"xs"},{name:"Totem",domain:"otem.org",size:"xs"},{name:"Unbound",domain:"unbound.com",size:"xs"},{name:"Warp",domain:"warp.dev",size:"xs"},{name:"Archive",domain:"archive.ai",size:"xs"},{name:"Canal",domain:"canal.co",size:"xs"},{name:"Feria",domain:"feria.com",size:"xs"},{name:"Givewith",domain:"givewith.com",size:"xs"},{name:"Hype",domain:"ype.com",size:"xs"},{name:"Jump",domain:"jump.ro",size:"xs"},{name:"Kaching",domain:"kaching.com",size:"xs"},{name:"MarketCube",domain:"marketcube.io",size:"xs"},{name:"Narrative",domain:"narrative.io",size:"xs"},{name:"Octaves",domain:"octaves.io",size:"xs"},{name:"Pantastic",domain:"antastic.com",size:"xs"},{name:"QuickCEP",domain:"quickcep.com",size:"xs"},{name:"Rumby",domain:"rumby.com",size:"xs"},{name:"Upp",domain:"upp.ai",size:"xs"},{name:"Vow",domain:"vow.com",size:"xs"},{name:"XOTV",domain:"xotv.me",size:"xs"}
62,{name:"Finkargo",domain:"finkargo.com.co",size:"xs"},{name:"Razz",domain:"razz.io",size:"xs"},{name:"Scrooge",domain:"crooge.fi",size:"xs"},{name:"Tint",domain:"int.ai",size:"xs"},{name:"Unstack",domain:"unstack.com",size:"xs"},{name:"Voda",domain:"voda.ai",size:"xs"},{name:"Zippie",domain:"zippie.com",size:"xs"},{name:"Beacons",domain:"beacons.ai",size:"xs"},{name:"Drops",domain:"drops.io",size:"xs"},{name:"FormRunners",domain:"formrunners.com",size:"xs"},{name:"GetLatka",domain:"getlatka.com",size:"xs"},{name:"Hellotax",domain:"ellotax.com",size:"xs"},{name:"Infisign",domain:"infisign.com",size:"xs"},{name:"Juni",domain:"juni.co",size:"s"},{name:"Tapcart",domain:"apcart.com",size:"s"},{name:"Blackpoint Cyber",domain:"blackpoint.ca",size:"s"},{name:"Osano",domain:"osano.com",size:"s"},{name:"Verishop",domain:"verishop.com",size:"s"},{name:"Vitally",domain:"vitally.io",size:"s"},{name:"Yieldify",domain:"yieldify.com",size:"s"},{name:"Zenly",domain:"zenly.com",size:"s"},{name:"Influential",domain:"influential.co",size:"s"},{name:"Landbot",domain:"landbot.io",size:"s"},{name:"WearOS",domain:"wearos.com",size:"s"},{name:"Zeeto",domain:"zeeto.com",size:"s"},{name:"Fast",domain:"fast.co",size:"s"},{name:"Xapo",domain:"xapo.com",size:"s"},{name:"Alohas",domain:"alohas.io",size:"s"},{name:"Carbon6",domain:"carbon6.io",size:"s"},{name:"Ember",domain:"ember.com",size:"s"},{name:"Justuno",domain:"justuno.com",size:"s"},{name:"Shopmonkey",domain:"opmonkey.io",size:"m"},{name:"Sorare",domain:"orare.com",size:"m"},{name:"Vendr",domain:"vendr.com",size:"m"},{name:"Xoxoday",domain:"xoxoday.com",size:"m"},{name:"Zipline",domain:"zipline.com",size:"m"},{name:"Shippo",domain:"ippo.com",size:"m"},{name:"Yalla",domain:"yalla.com",size:"m"},{name:"Cart.com",domain:"cart.com",size:"m"},{name:"Bolt",domain:"bolt.com",size:"m"},{name:"Printify",domain:"rintify.com",size:"m"},{name:"Woot",domain:"woot.com",size:"m"},{name:"Yieldstreet",domain:"yieldstreet.com",size:"m"},{name:"Keeps",domain:"keeps.com",size:"m"},{name:"Checkout.com",domain:"checkout.com",size:"l"},{name:"Thrasio",domain:"rasio.com",size:"l"},{name:"Printful",domain:"rintful.com",size:"l"},{name:"Shipt",domain:"ipt.com",size:"l"},{name:"Gorillas",domain:"gorillas.io",size:"l"},{name:"Instacart",domain:"instacart.com",size:"xl"},{name:"DoorDash",domain:"doordash.com",size:"xl"},{name:"Getir",domain:"getir.com",size:"xl"},{name:"Mercado Libre",domain:"mercadolibre.com",size:"xl"}],of=[{name:"Oscar Health",domain:"hioscar.com"},{name:"Ro",domain:"ro.co"},{name:"Hims & Hers",domain:"forhims.com"},{name:"Cerebral",domain:"cerebral.com"},{name:"Headspace",domain:"headspace.com"},{name:"Calm",domain:"calm.com"},{name:"Tempus",domain:"tempus.com"},{name:"Flatiron Health",domain:"flatiron.com"},{name:"Komodo Health",domain:"komodohealth.com"},{name:"Veeva",domain:"veeva.com"},{name:"Doximity",domain:"doximity.com"},{name:"Teladoc",domain:"teladoc.com"},{name:"Amwell",domain:"amwell.com"},{name:"Doctolib",domain:"doctolib.com"},{name:"Babylon Health",domain:"babylonhealth.com"},{name:"Kry / Livi",domain:"kry.se"},{name:"PatientPop",domain:"patientpop.com"},{name:"Zocdoc",domain:"zocdoc.com"},{name:"Practo",domain:"practo.com"},{name:"23andMe",domain:"23andme.com"},{name:"Color",domain:"color.com"},{name:"Invitae",domain:"invitae.com"},{name:"Recursion",domain:"recursion.com"},{name:"Insilico Medicine",domain:"insilico.com"},{name:"Atomwise",domain:"atomwise.com"},{name:"Devoted Health",domain:"devoted.com"},{name:"Bright Health",domain:"brighthealthplan.com"},{name:"Clover Health",domain:"cloverhealth.com"},{name:"Maven Clinic",domain:"mavenclinic.com"},{name:"Carrot Fertility",domain:"get-carrot.com"},{name:"Kindbody",domain:"kindbody.com"},{name:"Tia",domain:"asktia.com"},{name:"Modern Health",domain:"modernhealth.com"},{name:"Lyra Health",domain:"lyrahealth.com"},{name:"Ginger",domain:"ginger.io"},{name:"Spring Health",domain:"springhealth.com"},{name:"K Health",domain:"khealth.com"},{name:"PillPack",domain:"pillpack.com"},{name:"Capsule",domain:"capsule.com"},{name:"Truepill",domain:"truepill.com"},{name:"Alto Pharmacy",domain:"alto.com"},{name:"Olive AI",domain:"oliveai.com"},{name:"Notable Health",domain:"notablehealth.com"},{name:"Abridge",domain:"abridge.com"},{name:"Suki",domain:"suki.ai"},{name:"Hinge Health",domain:"hingehealth.com"},{name:"Sword Health",domain:"swordhealth.com"},{name:"Omada Health",domain:"omadahealth.com"},{name:"Livongo",domain:"livongo.com"}],lf=[{name:"CrowdStrike",domain:"crowdstrike.com"},{name:"SentinelOne",domain:"sentinelone.com"},{name:"Snyk",domain:"snyk.io"},{name:"1Password",domain:"1password.com"},{name:"Cloudflare",domain:"cloudflare.com"},{name:"Okta",domain:"okta.com"},{name:"Auth0",domain:"auth0.com"},{name:"Palo Alto Networks",domain:"paloaltonetworks.com"},{name:"Zscaler",domain:"zscaler.com"},{name:"Cybereason",domain:"cybereason.com"},{name:"Tanium",domain:"tanium.com"},{name:"Rapid7",domain:"rapid7.com"},{name:"Tenable",domain:"tenable.com"},{name:"Qualys",domain:"qualys.com"},{name:"Wiz",domain:"wiz.io"},{name:"Orca Security",domain:"orca.security"},{name:"Lacework",domain:"lacework.com"},{name:"Aqua Security",domain:"aquasec.com"},{name:"Sysdig",domain:"sysdig.com"},{name:"JumpCloud",domain:"jumpcloud.com"},{name:"Duo Security",domain:"duo.com"},{name:"Yubico",domain:"yubico.com"},{name:"HashiCorp",domain:"hashicorp.com"},{name:"Bitwarden",domain:"bitwarden.com"},{name:"Dashlane",domain:"dashlane.com"},{name:"LastPass",domain:"lastpass.com"},{name:"Proofpoint",domain:"proofpoint.com"},{name:"Mimecast",domain:"mimecast.com"},{name:"Abnormal Security",domain:"abnormalsecurity.com"},{name:"KnowBe4",domain:"knowbe4.com"},{name:"Cybrary",domain:"cybrary.it"},{name:"HackerOne",domain:"hackerone.com"},{name:"Bugcrowd",domain:"bugcrowd.com"},{name:"Synack",domain:"synack.com"},{name:"Trail of Bits",domain:"trailofbits.com"},{name:"Veracode",domain:"veracode.com"},{name:"Checkmarx",domain:"checkmarx.com"},{name:"GitGuardian",domain:"gitguardian.com"},{name:"Vanta",domain:"vanta.com"},{name:"Drata",domain:"drata.com"},{name:"Secureframe",domain:"secureframe.com"},{name:"Tugboat Logic",domain:"tugboatlogic.com"},{name:"Material Security",domain:"material.security"},{name:"Material Security",domain:"material.security"},{name:"Netskope",domain:"netskope.com"}
62,{name:"Lookout",domain:"lookout.com"},{name:"ExtraHop",domain:"extrahop.com"},{name:"Darktrace",domain:"darktrace.com"},{name:"Vectra AI",domain:"vectra.ai"},{name:"Descope",domain:"descope.com",size:"xs"},{name:"Pangea",domain:"angea.cloud",size:"xs"},{name:"Kinde",domain:"kinde.com",size:"xs"},{name:"SlashID",domain:"lashid.com",size:"xs"},{name:"Passage",domain:"assage.id",size:"xs"},{name:"Olympic",domain:"olympic.io",size:"xs"},{name:"Resourcely",domain:"resourcely.io",size:"xs"},{name:"StackHawk",domain:"ackhawk.com",size:"xs"},{name:"Socket",domain:"ocket.dev",size:"xs"},{name:"Endor Labs",domain:"endorsed.com",size:"xs"},{name:"StepSecurity",domain:"epsecurity.io",size:"xs"},{name:"Sandworm",domain:"andworm.dev",size:"xs"},{name:"Kusari",domain:"kusari.dev",size:"xs"},{name:"Authzed",domain:"authzed.com",size:"xs"},{name:"Aserto",domain:"aserto.com",size:"xs"},{name:"Permit.io",domain:"ermit.io",size:"xs"},{name:"Cerbos",domain:"cerbos.dev",size:"xs"},{name:"IndyKite",domain:"indykite.com",size:"xs"},{name:"Idtop",domain:"idtop.com",size:"xs"},{name:"SphereID",domain:"ereid.xyz",size:"xs"},{name:"Hanko",domain:"anko.io",size:"xs"},{name:"Sentra",domain:"entra.io",size:"xs"},{name:"Flow Security",domain:"flowsecurity.com",size:"xs"},{name:"Eureka Security",domain:"eurekawisdom.ai",size:"xs"},{name:"Symmetry Systems",domain:"ymmetry-systems.com",size:"xs"},{name:"Polar Security",domain:"olar.security",size:"xs"},{name:"Dasera",domain:"dasera.com",size:"xs"},{name:"Metomic",domain:"metomic.io",size:"xs"},{name:"Strac",domain:"rac.io",size:"xs"},{name:"Aquia",domain:"aquia.io",size:"xs"},{name:"BastionZero",domain:"bastionzero.com",size:"xs"},{name:"Border0",domain:"border0.com",size:"xs"},{name:"Enclave",domain:"enclave.io",size:"xs"},{name:"ZeroTier",domain:"zerotier.com",size:"xs"},{name:"Pomerium",domain:"omerium.com",size:"xs"},{name:"LayerX Security",domain:"layerxsecurity.com",size:"xs"},{name:"Seraphic Security",domain:"eraphicsecurity.com",size:"xs"},{name:"Surf Security",domain:"urf.security",size:"xs"},{name:"Sublime Security",domain:"ublime.security",size:"xs"},{name:"Blumira",domain:"blumira.com",size:"xs"},{name:"Relyance AI",domain:"relyance.ai",size:"xs"},{name:"Clerk",domain:"clerk.com",size:"s"},{name:"Stytch",domain:"ytch.com",size:"s"},{name:"Frontegg",domain:"frontegg.com",size:"s"},{name:"Chainguard",domain:"chainguard.dev",size:"s"},{name:"Styra",domain:"yra.com",size:"s"},{name:"Strata Identity",domain:"rata.io",size:"s"},{name:"Cyberhaven",domain:"cyberhaven.com",size:"s"},{name:"Dig Security",domain:"dig.security",size:"s"},{name:"Cyera",domain:"cyera.io",size:"s"},{name:"Nightfall AI",domain:"nightfall.ai",size:"s"},{name:"Tailscale",domain:"ailscale.com",size:"s"},{name:"Twingate",domain:"wingate.com",size:"s"},{name:"StrongDM",domain:"rongdm.com",size:"s"},{name:"Island",domain:"island.io",size:"s"},{name:"Talon Cyber Security",domain:"alon-sec.com",size:"s"},{name:"Hysolate",domain:"ysolate.com",size:"s"},{name:"Votiro",domain:"votiro.com",size:"s"},{name:"Glasswall",domain:"glasswallsolutions.com",size:"s"},{name:"Perception Point",domain:"erception-point.io",size:"s"},{name:"Ironscales",domain:"ironscales.com",size:"s"},{name:"Inky",domain:"inky.com",size:"s"},{name:"Armorblox",domain:"armorblox.com",size:"s"},{name:"Panther Labs",domain:"anther.com",size:"s"},{name:"Stellar Cyber",domain:"ellarcyber.ai",size:"s"},{name:"Tines",domain:"ines.com",size:"s"},{name:"Torq",domain:"orq.io",size:"s"},{name:"Chaitin Technology",domain:"chaitin.cn",size:"m"},{name:"Beyond Identity",domain:"beyondidentity.com",size:"m"},{name:"Transmit Security",domain:"ransmitsecurity.com",size:"m"},{name:"Silverfort",domain:"ilverfort.com",size:"m"},{name:"Privacera",domain:"rivacera.com",size:"m"},{name:"Immuta",domain:"immuta.com",size:"m"},{name:"BigID",domain:"bigid.com",size:"m"},{name:"Securiti",domain:"ecuriti.ai",size:"m"},{name:"OneLogin",domain:"onelogin.com",size:"m"},{name:"Teleport",domain:"eleport.com",size:"m"},{name:"Menlo Security",domain:"menlosecurity.com",size:"m"},{name:"Coro",domain:"coro.net",size:"m"},{name:"ComplyAdvantage",domain:"complyadvantage.com",size:"m"},{name:"Fenergo",domain:"fenergo.com",size:"m"},{name:"ForgeRock",domain:"forgerock.com",size:"l"},{name:"Ping Identity",domain:"ingidentity.com",size:"l"},{name:"SailPoint",domain:"ailpoint.com",size:"l"},{name:"Sophos",domain:"ophos.com",size:"l"},{name:"Trellix",domain:"fireeye.com",size:"l"},{name:"Forcepoint",domain:"forcepoint.com",size:"l"},{name:"Barracuda Networks",domain:"barracuda.com",size:"l"},{name:"Imperva",domain:"imperva.com",size:"l"},{name:"CyberArk Technology",domain:"cyberark.com",size:"xl"}
62,{name:"Check Point Software",domain:"checkpoint.com",size:"xl"},{name:"Fortinet",domain:"fortinet.com",size:"xl"},{name:"Trend Micro",domain:"rendmicro.com",size:"xl"},{name:"F5 Networks",domain:"f5.com",size:"xl"},{name:"Cortex XDR",domain:"aloaltonetworks.com",size:"xl"}],cf=[{name:"Coinbase",domain:"coinbase.com",size:"xl"},{name:"Binance",domain:"binance.com",size:"xl"},{name:"Crypto.com",domain:"crypto.com",size:"xl"},{name:"Kraken",domain:"kraken.com",size:"l"},{name:"OKX",domain:"okx.com",size:"l"},{name:"Ripple",domain:"ripple.com",size:"l"},{name:"ConsenSys",domain:"consensys.io",size:"l"},{name:"Ledger",domain:"ledger.com",size:"l"},{name:"Bybit",domain:"bybit.com",size:"l"},{name:"Kucoin",domain:"kucoin.com",size:"l"},{name:"Circle",domain:"circle.com",size:"l"},{name:"Chainalysis",domain:"chainalysis.com",size:"l"},{name:"Fireblocks",domain:"fireblocks.com",size:"l"},{name:"Alchemy",domain:"alchemy.com",size:"m"},{name:"Anchorage Digital",domain:"anchorage.com",size:"m"},{name:"BitGo",domain:"bitgo.com",size:"m"},{name:"Gemini",domain:"gemini.com",size:"m"},{name:"Bitfinex",domain:"bitfinex.com",size:"m"},{name:"Bitstamp",domain:"bitstamp.net",size:"m"},{name:"Bitpanda",domain:"bitpanda.com",size:"m"},{name:"Paxos",domain:"paxos.com",size:"m"},{name:"MetaMask",domain:"metamask.io",size:"m"},{name:"OpenSea",domain:"opensea.io",size:"m"},{name:"Polygon",domain:"polygon.technology",size:"m"},{name:"Solana",domain:"solana.com",size:"m"},{name:"Animoca Brands",domain:"animocabrands.com",size:"m"},{name:"Dapper Labs",domain:"dapperlabs.com",size:"m"},{name:"TRM Labs",domain:"trmlabs.com",size:"m"},{name:"Trezor",domain:"trezor.io",size:"m"},{name:"Trust Wallet",domain:"trustwallet.com",size:"m"},{name:"Infura",domain:"infura.io",size:"s"},{name:"QuickNode",domain:"quicknode.com",size:"s"},{name:"Magic Eden",domain:"magiceden.io",size:"s"},{name:"Avalanche",domain:"avax.network",size:"s"},{name:"Chainlink",domain:"chain.link",size:"s"},{name:"The Graph",domain:"thegraph.com",size:"s"},{name:"Aave",domain:"aave.com",size:"s"},{name:"Uniswap",domain:"uniswap.org",size:"s"},{name:"Lido",domain:"lido.fi",size:"s"},{name:"Phantom",domain:"phantom.app",size:"s"},{name:"Yuga Labs",domain:"yuga.com",size:"s"},{name:"Elliptic",domain:"elliptic.co",size:"s"},{name:"Blur",domain:"blur.io",size:"xs"},{name:"MakerDAO",domain:"makerdao.com",size:"xs"},{name:"Compound",domain:"compound.finance",size:"xs"},{name:"dYdX",domain:"dydx.exchange",size:"xs"},{name:"Rainbow",domain:"rainbow.me",size:"xs"},{name:"EigenLayer",domain:"eigenlayer.xyz",size:"s"},{name:"Berachain",domain:"berachain.com",size:"s"},{name:"LayerZero Labs",domain:"layerzero.network",size:"m"},{name:"Offchain Labs",domain:"arbitrum.io",size:"m"},{name:"OP Labs",domain:"optimism.io",size:"m"},{name:"StarkWare",domain:"starkware.co",size:"m"},{name:"Matter Labs",domain:"zksync.io",size:"m"},{name:"Monad Labs",domain:"monad.xyz",size:"s"},{name:"Celestia Labs",domain:"celestia.org",size:"s"},{name:"Pyth Network",domain:"pyth.network",size:"s"},{name:"Worldcoin",domain:"worldcoin.org",size:"m"},{name:"Base",domain:"base.org",size:"m"},{name:"Safe",domain:"safe.global",size:"s"},{name:"EigenLabs",domain:"eigenlabs.org",size:"s"},{name:"Aptos Labs",domain:"aptoslabs.com",size:"m"},{name:"Mysten Labs",domain:"mystenlabs.com",size:"m"},{name:"Scroll",domain:"scroll.io",size:"s"},{name:"Taiko",domain:"taiko.xyz",size:"s"},{name:"Fuel Labs",domain:"fuel.network",size:"s"},{name:"Succinct Labs",domain:"succinct.xyz",size:"xs"},{name:"RISC Zero",domain:"risczero.com",size:"s"},{name:"Ava Labs",domain:"avalanche.org",size:"m"},{name:"Linea",domain:"linea.build",size:"m"},{name:"Puffer Finance",domain:"puffer.fi",size:"xs"},{name:"Ether.fi",domain:"ether.fi",size:"xs"},{name:"Renzo Protocol",domain:"renzo.io",size:"xs"},{name:"Babylon Chain",domain:"babylonchain.io",size:"xs"},{name:"Movement Labs",domain:"movementlabs.xyz",size:"xs"},{name:"BeraChain Labs",domain:"beras.io",size:"xs"},{name:"MegaETH",domain:"megaeth.com",size:"xs"},{name:"Paradigm Research",domain:"paradigm.xyz",size:"s"},{name:"Flashbots Research",domain:"flashbots.net",size:"s"},{name:"Jito Labs",domain:"jito.network",size:"xs"},{name:"Marginfi",domain:"marginfi.com",size:"xs"},{name:"Kamino Finance",domain:"kamino.finance",size:"xs"},{name:"Drift Protocol",domain:"drift.trade",size:"xs"},{name:"Hyperliquid",domain:"hyperliquid.xyz",size:"xs"},{name:"Eonxi",domain:"eonxi.com",size:"xs"},{name:"Zora",domain:"zora.co",size:"s"},{name:"Merkle Manufactory",domain:"farcaster.xyz",size:"s"},{name:"Lens Protocol",domain:"lens.xyz",size:"xs"},{name:"0x Labs",domain:"0x.org",size:"s"},{name:"Morpho Labs",domain:"morpho.org",size:"xs"},{name:"Ethena Labs",domain:"ethena.fi",size:"xs"},{name:"Frax Finance",domain:"frax.com",size:"xs"},{name:"Liquidium",domain:"liquidium.fi",size:"xs"},{name:"Mezo",domain:"mezo.org",size:"xs"},{name:"Botto",domain:"botto.com",size:"xs"},{name:"Sky Finance",domain:"sky.money",size:"s"},{name:"Immunefi",domain:"immunefi.com",size:"s"},{name:"Sherlock Security",domain:"sherlock.xyz",size:"xs"},{name:"Spearbit",domain:"spearbit.com",size:"xs"},{name:"Zellic Security",domain:"zellic.io",size:"xs"},{name:"Halborn Security",domain:"halborn.com",size:"s"},{name:"CertiK Security",domain:"certik.com",size:"m"},{name:"Quantstamp Security",domain:"quantstamp.com",size:"s"},{name:"Galaxy Digital",domain:"galaxy.com",size:"l"},{name:"FalconX",domain:"falconx.io",size:"m"},{name:"Matrixport",domain:"matrixport.com",size:"m"},{name:"Amber Group",domain:"ambergroup.io",size:"m"},{name:"Wintermute",domain:"wintermute.com",size:"m"},{name:"Jump Crypto",domain:"jumpcrypto.com",size:"m"},{name:"Flowdesk Market Making",domain:"flowdesk.co",size:"s"},{name:"Copper.co",domain:"copper.co",size:"m"},{name:"BitFuFu",domain:"bitfufu.com",size:"m"},{name:"Canaan Creative",domain:"canaan.io",size:"xl"},{name:"Bitmain Technology",domain:"bitmain.com",size:"xl"},{name:"MicroStrategy Bitcoin",domain:"microstrategy.com",size:"xl"},{name:"MoonPay Payments",domain:"moonpay.com",size:"m"},{name:"Banxa Payments",domain:"banxa.com",size:"s"},{name:"Mercuryo Payments",domain:"mercuryo.io",size:"s"},{name:"Ramp Network",domain:"ramp.network",size:"s"}
62,{name:"Transak Infrastructure",domain:"transak.com",size:"s"},{name:"Sardine Risk Management",domain:"sardine.ai",size:"s"},{name:"Dynamic Auth",domain:"dynamic.xyz",size:"xs"},{name:"Privy Auth Labs",domain:"privy.io",size:"xs"},{name:"Web3Auth Network",domain:"web3auth.io",size:"s"},{name:"Lit Protocol Labs",domain:"litprotocol.com",size:"xs"},{name:"Particle Network Infrastructure",domain:"particle.network",size:"xs"},{name:"Biconomy Gasless Labs",domain:"biconomy.io",size:"s"},{name:"Gelato Automation Network",domain:"gelato.network",size:"xs"},{name:"StakeWise Staking Labs",domain:"stakewise.io",size:"xs"},{name:"Kiln Staking Services",domain:"kiln.fi",size:"s"},{name:"Figment Infrastructure Services",domain:"figment.io",size:"m"},{name:"Blockdaemon Node Ops",domain:"blockdaemon.com",size:"m"},{name:"InfStones Node Services",domain:"infstones.com",size:"s"},{name:"Allnodes Managed Hosting",domain:"allnodes.com",size:"xs"},{name:"Blocknative Mempool Ops",domain:"blocknative.com",size:"xs"},{name:"Tenderly Dev Platform",domain:"tenderly.co",size:"s"},{name:"Dune Analytics Hub",domain:"dune.com",size:"s"},{name:"Nansen Data Intelligence",domain:"nansen.ai",size:"s"},{name:"Arkham Intelligence Data",domain:"arkhamintelligence.com",size:"xs"},{name:"Kaiko Market Data Analytics",domain:"kaiko.com",size:"s"},{name:"Messari Research Data",domain:"messari.io",size:"s"},{name:"Coinglass Derivatives Tools",domain:"coinglass.com",size:"xs"},{name:"DefiLlama Analytics Aggregator",domain:"defillama.com",size:"xs"}],df=[{name:"Coursera",domain:"coursera.org"},{name:"Udemy",domain:"udemy.com"},{name:"Udacity",domain:"udacity.com"},{name:"edX",domain:"edx.org"},{name:"Khan Academy",domain:"khanacademy.org"},{name:"Duolingo",domain:"duolingo.com"},{name:"Babbel",domain:"babbel.com"},{name:"Rosetta Stone",domain:"rosettastone.com"},{name:"Brilliant",domain:"brilliant.org"},{name:"Codecademy",domain:"codecademy.com"},{name:"Pluralsight",domain:"pluralsight.com"},{name:"DataCamp",domain:"datacamp.com"},{name:"Skillshare",domain:"skillshare.com"},{name:"MasterClass",domain:"masterclass.com"},{name:"Outschool",domain:"outschool.com"},{name:"Varsity Tutors",domain:"varsitytutors.com"},{name:"Chegg",domain:"chegg.com"},{name:"Quizlet",domain:"quizlet.com"},{name:"Anki",domain:"ankiweb.net"},{name:"Notion",domain:"notion.so"},{name:"Course Hero",domain:"coursehero.com"},{name:"Brainly",domain:"brainly.com"},{name:"Photomath",domain:"photomath.com"},{name:"Symbolab",domain:"symbolab.com"},{name:"Kahoot!",domain:"kahoot.com"},{name:"ClassDojo",domain:"classdojo.com"},{name:"Seesaw",domain:"seesaw.com"},{name:"Remind",domain:"remind.com"},{name:"Schoology",domain:"schoology.com"},{name:"Canvas (Instructure)",domain:"instructure.com"},{name:"Blackboard",domain:"blackboard.com"},{name:"Moodle",domain:"moodle.com"},{name:"PowerSchool",domain:"powerschool.com"},{name:"Newsela",domain:"newsela.com"},{name:"BYJU'S",domain:"byjus.com"},{name:"Vedantu",domain:"vedantu.com"},{name:"Unacademy",domain:"unacademy.com"},{name:"GoStudent",domain:"gostudent.org"},{name:"Lingoda",domain:"lingoda.com"},{name:"Preply",domain:"preply.com"},{name:"italki",domain:"italki.com"},{name:"Course.com",domain:"course.com"},{name:"Multiverse",domain:"multiverse.io"},{name:"Lambda School / Bloom Tech",domain:"bloomtech.com"},{name:"General Assembly",domain:"generalassemb.ly"},{name:"Springboard",domain:"springboard.com"},{name:"Thinkful",domain:"thinkful.com"},{name:"Codesmith",domain:"codesmith.io"},{name:"ageOfLearning (ABCmouse)",domain:"ageoflearning.com"},{name:"Virtually",domain:"virtually.co",size:"xs"},{name:"Engageli",domain:"engageli.com",size:"s"},{name:"Guide",domain:"joinguide.com",size:"xs"},{name:"Superpeer",domain:"superpeer.com",size:"xs"},{name:"Continu",domain:"continu.com",size:"s"},{name:"Section",domain:"sectionschool.com",size:"xs"},{name:"Knowable",domain:"knowable.fyi",size:"xs"},{name:"Nas Academy",domain:"nasacademy.com",size:"s"},{name:"Swing Education",domain:"swingeducation.com",size:"m"},{name:"Paper",domain:"paper.co",size:"m"},{name:"Mainstay",domain:"mainstay.com",size:"s"},{name:"Graduway",domain:"graduway.com",size:"m"},{name:"Guild Education",domain:"guildeducation.com",size:"l"},{name:"Emeritus",domain:"emeritus.org",size:"l"},{name:"upGrad",domain:"upgrad.com",size:"l"},{name:"Scaler Academy",domain:"scalerschoool.com",size:"m"},{name:"Cuemath",domain:"cuemath.com",size:"m"},{name:"Teachmint Education",domain:"teachmint.com",size:"m"},{name:"Leada",domain:"leada.io",size:"xs"},{name:"Practera",domain:"practera.com",size:"xs"},{name:"Aula",domain:"aula.education",size:"s"},{name:"Kinteract",domain:"kinteract.com",size:"xs"},{name:"Firefly Learning",domain:"fireflylearning.com",size:"s"},{name:"Century Tech",domain:"century.tech",size:"s"},{name:"CoachHub",domain:"coachhub.com",size:"m"},{name:"Labster",domain:"labster.com",size:"m"},{name:"Seneca Learning Services",domain:"senecalearning.com",size:"xs"},{name:"BibliU",domain:"biblio.it",size:"s"},{name:"Perlego",domain:"perlego.com",size:"s"},{name:"Busuu Online",domain:"busuu.com",size:"m"},{name:"Codewars",domain:"codewars.com",size:"xs"},{name:"SoloLearn",domain:"sololearn.com",size:"s"},{name:"Educative",domain:"educative.io",size:"s"},{name:"Scrimba",domain:"scrimba.com",size:"xs"},{name:"Exercism",domain:"exercism.org",size:"xs"},{name:"CodeDojo",domain:"codedojo.com",size:"xs"},{name:"WhiteHat Jr",domain:"whitehatjr.com",size:"l"},{name:"Eruditus Executive Education",domain:"eruditus.com",size:"l"},{name:"Pesto Tech",domain:"pesto.tech",size:"xs"},{name:"Microverse",domain:"microverse.org",size:"xs"},{name:"Holberton School",domain:"holbertonschool.com",size:"s"},{name:"Le Wagon International",domain:"le-wagon.com",size:"m"},{name:"Ironhack Bootcamp",domain:"ironhack.com",size:"s"}
62,{name:"App Academy",domain:"appacademy.io",size:"s"},{name:"The Odin Project",domain:"theodinproject.com",size:"xs"},{name:"FreeCodeCamp Foundation",domain:"freecodecamp.org",size:"xs"},{name:"Scalyr",domain:"scalyr.com",size:"xs"},{name:"Education Services Australia",domain:"educationservices.org",size:"xs"},{name:"eFront Learning",domain:"efrontlearning.com",size:"s"},{name:"InfoSec Institute Training",domain:"infosecinstitute.com",size:"m"},{name:"Triber Education",domain:"triber.com",size:"xs"},{name:"Unibuddy Platforms",domain:"unibuddy.com",size:"s"},{name:"Admitad Academy",domain:"admitad.com",size:"xl"},{name:"Skillsoft Corporation",domain:"skillsoft.com",size:"xl"},{name:"Absorb Software Inc",domain:"absorblms.com",size:"m"},{name:"Hive Learning Business",domain:"hivelearning.com",size:"s"},{name:"HowNow Platforms",domain:"hownow.io",size:"xs"},{name:"Filtered Technologies Ltd",domain:"filtered.com",size:"xs"},{name:"Fuse Universal Learning",domain:"fuseuniversal.com",size:"s"},{name:"Open Campus Global",domain:"opencampus.sh",size:"xs"},{name:"Odemy Turkey",domain:"odemy.com.tr",size:"xs"},{name:"Beijing Education Information",domain:"beicourse.com",size:"xs"},{name:"Platzi LATAM",domain:"platzi.com",size:"m"},{name:"Crehana Education",domain:"crehana.com",size:"s"},{name:"UOL EdTech Brazil",domain:"uol.com.br",size:"m"},{name:"Descomplica Digital",domain:"descomplica.com.br",size:"m"},{name:"Claro EdTech Online",domain:"comunidadesclaro.com",size:"xs"},{name:"Labi Education Colombia",domain:"labi.com.co",size:"xs"},{name:"Cracku Test Prep India",domain:"cracku.in",size:"xs"},{name:"Toppr Learning App India",domain:"toppr.com",size:"m"},{name:"Doubtnut App India",domain:"doubtnut.com",size:"s"},{name:"Testbook Exams India",domain:"testbook.com",size:"s"},{name:"Adda247 Education India",domain:"addatwentyfourseven.com",size:"m"},{name:"PhysicsWallah Alakh Pandey",domain:"physicswallah.live",size:"m"},{name:"PW Skills Coding India",domain:"pw.live",size:"s"},{name:"Coding Ninjas India Private",domain:"codingninjas.com",size:"s"},{name:"InterviewBit Prep India",domain:"interviewbit.com",size:"s"},{name:"AlgoCamp Global Tuition",domain:"algocamp.io",size:"xs"},{name:"Coding Invaders IT Courses India",domain:"codinginvaders.it",size:"xs"},{name:"Fullstack Academy USA",domain:"fullstackacademy.com",size:"s"},{name:"Hack Reactor Bootcamps USA",domain:"hackreactor.com",size:"s"},{name:"Flatiron School USA",domain:"theflatironschool.com",size:"m"},{name:"Sabio Coding School USA",domain:"sabio.la",size:"xs"},{name:"Turito Global Tutoring USA",domain:"turito.com",size:"xs"},{name:"Skolaro Management Systems India",domain:"skolaro.com",size:"xs"},{name:"LeSchool Education France",domain:"le-school.com",size:"xs"}],mf=[{name:"Workday",domain:"workday.com"},{name:"BambooHR",domain:"bamboohr.com"},{name:"Gusto",domain:"gusto.com"},{name:"Rippling",domain:"rippling.com"},{name:"Deel",domain:"deel.com"},{name:"Remote",domain:"remote.com"},{name:"Oyster",domain:"oysterhr.com"},{name:"Papaya Global",domain:"papayaglobal.com"},{name:"Velocity Global",domain:"velocityglobal.com"},{name:"Greenhouse",domain:"greenhouse.io"},{name:"Lever",domain:"lever.co"},{name:"Ashby",domain:"ashbyhq.com"},{name:"SmartRecruiters",domain:"smartrecruiters.com"},{name:"iCIMS",domain:"icims.com"},{name:"Workable",domain:"workable.com"},{name:"Personio",domain:"personio.com"},{name:"Hibob",domain:"hibob.com"},{name:"ChartHop",domain:"charthop.com"},{name:"Lattice",domain:"lattice.com"},{name:"15Five",domain:"15five.com"},{name:"Culture Amp",domain:"cultureamp.com"},{name:"Officevibe",domain:"officevibe.com"},{name:"Peakon",domain:"peakon.com"},{name:"Glint",domain:"glintinc.com"},{name:"Carta",domain:"carta.com"},{name:"Pave",domain:"pave.com"},{name:"Figures",domain:"figures.hr"},{name:"Ravio",domain:"ravio.com"},{name:"Compa",domain:"compa.as"},{name:"Lifelabs Learning",domain:"lifelabslearning.com"},{name:"Eightfold AI",domain:"eightfold.ai"},{name:"Gem",domain:"gem.com"},{name:"HireEZ",domain:"hireez.com"},{name:"Findem",domain:"findem.ai"},{name:"Codility",domain:"codility.com"},{name:"HackerRank",domain:"hackerrank.com"},{name:"Karat",domain:"karat.com"},{name:"Checkr",domain:"checkr.com"},{name:"iSolved",domain:"isolvedhcm.com"},{name:"Paychex",domain:"paychex.com"},{name:"Paylocity",domain:"paylocity.com"},{name:"ADP",domain:"adp.com"},{name:"Zenefits / TriNet",domain:"trinet.com"},{name:"Justworks",domain:"justworks.com"},{name:"Insperity",domain:"insperity.com"},{name:"Lessonly",domain:"lessonly.com"},{name:"Cornerstone OnDemand",domain:"cornerstoneondemand.com"},{name:"Docebo",domain:"docebo.com"},{name:"360Learning",domain:"360learning.com"},{name:"Hubble",domain:"ubble.net",size:"xs"},{name:"Boundless",domain:"boundlesshq.com",size:"xs"},{name:"Gather",domain:"gatherround.com",size:"xs"},{name:"Epoch",domain:"epochapp.com",size:"xs"},{name:"Candidate.fyi",domain:"candidate.fyi",size:"xs"},{name:"Pyn",domain:"yn.ad",size:"xs"},{name:"Searchlight",domain:"earchlight.ai",size:"xs"},{name:"Brightflow AI",domain:"brightflow.com",size:"xs"},{name:"Kula",domain:"kula.ai",size:"xs"},{name:"Metaview",domain:"metaview.ai",size:"xs"},{name:"Starry HR",domain:"arry.com",size:"xs"},{name:"Parade",domain:"arade.ai",size:"xs"},{name:"Eqt AI",domain:"eqt.io",size:"xs"},{name:"Relish",domain:"relishapp.com",size:"xs"},{name:"GoZen",domain:"go-zen.com",size:"xs"},{name:"Eqi HR",domain:"eqi.hr",size:"xs"},{name:"Candor",domain:"candor.co",size:"xs"},{name:"Compt",domain:"compt.io",size:"xs"},{name:"Bravely",domain:"bravely.io",size:"xs"},{name:"Landit",domain:"landit.com",size:"xs"},{name:"Strive Training",domain:"rive.co",size:"xs"},{name:"Abridge Labs HR",domain:"abridge.com",size:"xs"},{name:"Bridging Space",domain:"bridging.space",size:"xs"},{name:"Workpay Africa",domain:"workpay.co",size:"xs"},{name:"Pula People Ops",domain:"ula.io",size:"xs"},{name:"Benten AI",domain:"benten.ai",size:"xs"},{name:"Bento HR",domain:"bentocast.com",size:"xs"},{name:"Abridge Recruiting",domain:"getabridge.com",size:"xs"},{name:"Mira Jobs",domain:"mira.jobs",size:"xs"},{name:"Wellfound",domain:"wellfound.com",size:"s"},{name:"Commsor",domain:"commsor.com",size:"s"},{name:"Humaans",domain:"umaans.io",size:"s"},{name:"Plane",domain:"lane.com",size:"s"},{name:"WorkOS",domain:"workos.com",size:"s"},{name:"Merit",domain:"merit.com",size:"s"},{name:"Applaud",domain:"getapplaud.com",size:"s"},{name:"ClayHR",domain:"clayhr.com",size:"s"},{name:"Kenjo",domain:"kenjo.io",size:"s"},{name:"Heetch Ops",domain:"eetch.com",size:"s"},{name:"WorkMotionBase",domain:"workmotion.com",size:"s"},{name:"Lano",domain:"lano.io",size:"s"},{name:"Localyze",domain:"localyze.com",size:"s"},{name:"Cord",domain:"cord.co",size:"s"},{name:"Otta",domain:"otta.com",size:"s"},{name:"HackajobWork",domain:"ackajob.co",size:"s"},{name:"Honeypot",domain:"oneypot.io",size:"s"},{name:"Juro",domain:"juro.com",size:"s"},{name:"Contractbook",domain:"contractbook.com",size:"s"},{name:"Revelio Labs",domain:"revelio.ai",size:"s"},{name:"Humanly",domain:"umanly.io",size:"s"},{name:"Fetcher",domain:"fetcher.ai",size:"s"},{name:"Syndio",domain:"yndio.com",size:"s"},{name:"Forma AI",domain:"forma.ai",size:"s"},{name:"Spiff",domain:"iff.com",size:"s"},{name:"Torch",domain:"orch.io",size:"s"},{name:"Coaching.com",domain:"coaching.com",size:"s"},{name:"GrowthSpace",domain:"growthspace.com",size:"s"},{name:"Hone",domain:"onehq.com",size:"s"},{name:"Vincere",domain:"vincere.io",size:"s"},{name:"Ontop",domain:"ontop.ai",size:"s"},{name:"SeamlessHR",domain:"eamlesshr.com",size:"s"},{name:"SkyHive AI",domain:"kyhive.ai",size:"s"},{name:"Fuel50",domain:"fuel50.com",size:"s"},{name:"Strivr",domain:"rivr.com",size:"s"},{name:"Talespin",domain:"alespin.com",size:"s"},{name:"Mursion",domain:"mursion.com",size:"s"},{name:"Interplay Learning",domain:"interplaylearning.com",size:"s"},{name:"Vanta Lab",domain:"vanta.com",size:"m"},{name:"Mercury Payroll",domain:"mercury.com",size:"m"},{name:"Multiplier",domain:"multipler.com",size:"m"},{name:"Omnipresent",domain:"omnipresent.com",size:"m"},{name:"Factorial",domain:"factorialhr.com",size:"m"},{name:"PayFit",domain:"ayfit.com",size:"m"},{name:"Alan",domain:"alan.com",size:"m"},{name:"Leapsome",domain:"leapsome.com",size:"m"},{name:"Pleo",domain:"leo.io",size:"m"},{name:"Talentful",domain:"alentful.com",size:"m"},{name:"Ironclad",domain:"ironcladapp.com",size:"m"},{name:"Paradox",domain:"aradox.ai",size:"m"},{name:"Beamery",domain:"beamery.com",size:"m"},{name:"HiBob (UK)",domain:"ibob.com",size:"m"},{name:"CaptivateIQ",domain:"captivateiq.com",size:"m"},{name:"Avature",domain:"avature.net",size:"m"},{name:"Pagar.me People",domain:"agar.me",size:"m"},{name:"Gloat",domain:"gloat.com",size:"m"},{name:"Degreed",domain:"degreed.com",size:"m"},{name:"EdCast",domain:"edcast.com",size:"m"},{name:"Go1",domain:"go1.com",size:"m"},{name:"TravelPerk",domain:"ravelperk.com",size:"l"},{name:"Phenom People",domain:"enom.com",size:"l"},{name:"Paylocity Payroll",domain:"aylocity.com",size:"l"},{name:"Qualtrics EX",domain:"qualtrics.com",size:"l"},{name:"Medallia Employee Experience",domain:"medallia.com",size:"l"},{name:"Bullhorn",domain:"bullhorn.com",size:"l"},{name:"BetterUp",domain:"betterup.com",size:"l"},{name:"UiPath People Ops",domain:"uipath.com",size:"xl"},{name:"ServiceNow HRSD",domain:"ervicenow.com",size:"xl"},{name:"UKG",domain:"ukg.com",size:"xl"}],xf=[{name:"HubSpot",domain:"hubspot.com"},{name:"Mailchimp",domain:"mailchimp.com"},{name:"Klaviyo",domain:"klaviyo.com"},{name:"Marketo",domain:"marketo.com"},{name:"Pardot",domain:"pardot.com"},{name:"ActiveCampaign",domain:"activecampaign.com"},{name:"Drip",domain:"drip.com"},{name:"Customer.io",domain:"customer.io"},{name:"Iterable",domain:"iterable.com"},{name:"Braze",domain:"braze.com"},{name:"OneSignal",domain:"onesignal.com"},{name:"Segment",domain:"segment.com"},{name:"mParticle",domain:"mparticle.com"},{name:"Tealium",domain:"tealium.com"},{name:"Treasure Data",domain:"treasuredata.com"},{name:"Hightouch",domain:"hightouch.com"},{name:"Census",domain:"getcensus.com"},{name:"Mixpanel",domain:"mixpanel.com"},{name:"Amplitude",domain:"amplitude.com"},{name:"Heap",domain:"heap.io"},{name:"FullStory",domain:"fullstory.com"},{name:"Hotjar",domain:"hotjar.com"},{name:"Crazy Egg",domain:"crazyegg.com"},{name:"Optimizely",domain:"optimizely.com"},{name:"VWO",domain:"vwo.com"}
62,{name:"AB Tasty",domain:"abtasty.com"},{name:"Statsig",domain:"statsig.com"},{name:"LaunchDarkly",domain:"launchdarkly.com"},{name:"Buffer",domain:"buffer.com"},{name:"Hootsuite",domain:"hootsuite.com"},{name:"Sprout Social",domain:"sproutsocial.com"},{name:"Later",domain:"later.com"},{name:"SocialBee",domain:"socialbee.com"},{name:"Brandwatch",domain:"brandwatch.com"},{name:"Sprinklr",domain:"sprinklr.com"},{name:"Khoros",domain:"khoros.com"},{name:"Meltwater",domain:"meltwater.com"},{name:"Cision",domain:"cision.com"},{name:"Ahrefs",domain:"ahrefs.com"},{name:"Semrush",domain:"semrush.com"},{name:"Moz",domain:"moz.com"},{name:"Surfer SEO",domain:"surferseo.com"},{name:"Clearscope",domain:"clearscope.io"},{name:"MarketMuse",domain:"marketmuse.com"},{name:"Jasper",domain:"jasper.ai"},{name:"Copy.ai",domain:"copy.ai"},{name:"Writesonic",domain:"writesonic.com"},{name:"ContentSquare",domain:"contentsquare.com"},{name:"Bynder",domain:"bynder.com"},{name:"Brandfolder",domain:"brandfolder.com"},{name:"Canva",domain:"canva.com"},{name:"AdRoll",domain:"adroll.com"},{name:"Criteo",domain:"criteo.com"},{name:"Taboola",domain:"taboola.com"},{name:"Outbrain",domain:"outbrain.com"},{name:"The Trade Desk",domain:"thetradedesk.com"}],uf=[{name:"Flexport",domain:"flexport.com"},{name:"Convoy",domain:"convoy.com"},{name:"Uber Freight",domain:"uberfreight.com"},{name:"C.H. Robinson",domain:"chrobinson.com"},{name:"ShipBob",domain:"shipbob.com"},{name:"ShipMonk",domain:"shipmonk.com"},{name:"Shippo",domain:"goshippo.com"},{name:"EasyPost",domain:"easypost.com"},{name:"ShipStation",domain:"shipstation.com"},{name:"Sendcloud",domain:"sendcloud.com"},{name:"Stord",domain:"stord.com"},{name:"Ryder",domain:"ryder.com"},{name:"XPO Logistics",domain:"xpo.com"},{name:"DHL",domain:"dhl.com"},{name:"FedEx",domain:"fedex.com"},{name:"UPS",domain:"ups.com"},{name:"Maersk",domain:"maersk.com"},{name:"Project44",domain:"project44.com"},{name:"FourKites",domain:"fourkites.com"},{name:"Samsara",domain:"samsara.com"},{name:"KeepTruckin / Motive",domain:"gomotive.com"},{name:"Onfleet",domain:"onfleet.com"},{name:"Bringg",domain:"bringg.com"},{name:"Routific",domain:"routific.com"},{name:"Locus",domain:"locus.sh"},{name:"Shippeo",domain:"shippeo.com"},{name:"Sennder",domain:"sennder.com"},{name:"Forto",domain:"forto.com"},{name:"Zencargo",domain:"zencargo.com"},{name:"Beacon",domain:"beacon.com"},{name:"Loadsmart",domain:"loadsmart.com"},{name:"Freightos",domain:"freightos.com"},{name:"Shipwell",domain:"shipwell.com"},{name:"GoBolt",domain:"gobolt.com"},{name:"Cargomatic",domain:"cargomatic.com"},{name:"Transfix",domain:"transfix.io"},{name:"EasyTransfer",domain:"easytransfer.com"},{name:"Ryder",domain:"ryder.com"},{name:"Trimble Transportation",domain:"transportation.trimble.com"},{name:"Lineage Logistics",domain:"lineagelogistics.com"},{name:"Geek+ ",domain:"geekplus.com"},{name:"AutoStore",domain:"autostoresystem.com"},{name:"Locus Robotics",domain:"locusrobotics.com"},{name:"Symbotic",domain:"symbotic.com"},{name:"7bridges",domain:"7bridges.com",size:"xs"},{name:"Sourceful",domain:"ourceful.com",size:"xs"},{name:"Delivigo",domain:"delivigo.id",size:"xs"},{name:"ShippiGo",domain:"ippigo.com",size:"xs"},{name:"Warp",domain:"warp.com",size:"xs"},{name:"Vectorai",domain:"vector.ai",size:"xs"},{name:"Raaft",domain:"raaft.io",size:"xs"},{name:"Darkstore",domain:"darkstore.com",size:"xs"},{name:"Bond",domain:"bond.co",size:"xs"},{name:"Shippers",domain:"ippers.tech",size:"xs"},{name:"Pikko",domain:"ikkopulsa.id",size:"xs"},{name:"Rappi Cargo",domain:"rappihand.com",size:"xs"},{name:"Boxbot",domain:"boxbot.io",size:"xs"},{name:"Tuatara",domain:"uatara.tech",size:"xs"},{name:"Forager",domain:"forager.com",size:"xs"},{name:"SmartLog",domain:"martlog.pro",size:"xs"},{name:"WhyLabs",domain:"whylabs.ai",size:"xs"},{name:"Loco Supply",domain:"loco.supply",size:"xs"},{name:"Wingo Robotics",domain:"wingo.ai",size:"xs"},{name:"Drover AI",domain:"drover.ai",size:"xs"},{name:"Tiny Mile",domain:"iny-mile.com",size:"xs"},{name:"Tortoise Delivery",domain:"ortoise.to",size:"xs"},{name:"LastMile AI",domain:"lastmile.ai",size:"xs"},{name:"Dispatch It",domain:"dispatchit.com",size:"xs"},{name:"Altana",domain:"altana.ai",size:"s"},{name:"Vantiq",domain:"vantiq.com",size:"s"},{name:"Trella",domain:"rella.app",size:"s"},{name:"Kobo360",domain:"kobo360.com",size:"s"},{name:"Sendy",domain:"endyit.com",size:"s"},{name:"Pargo",domain:"argo.co.za",size:"s"},{name:"CloudTrucks",domain:"cloudtrucks.com",size:"s"},{name:"Leaf Logistics",domain:"leaflogistics.com",size:"s"},{name:"Logixboard",domain:"logixboard.com",size:"s"},{name:"Waabi",domain:"waabi.ai",size:"s"},{name:"Locomation",domain:"locomation.ai",size:"s"},{name:"OTORIO",domain:"otorios.com",size:"s"},{name:"Shipium",domain:"ipium.com",size:"s"},{name:"Kiwibot",domain:"kiwibot.com",size:"s"},{name:"Flytrex",domain:"flytrex.com",size:"s"},{name:"Manna Drone Delivery",domain:"mana.delivery",size:"s"},{name:"Quiqup",domain:"quiqup.com",size:"s"},{name:"Liftit",domain:"liftit.co",size:"s"},{name:"Moova",domain:"moova.io",size:"s"},{name:"ShipNow",domain:"ipnow.com.ar",size:"s"},{name:"SkydropX",domain:"kydropx.com",size:"s"},{name:"Logisly Indonesia",domain:"logisly.com",size:"s"},{name:"Nimble Robotics",domain:"nimble.ai",size:"s"},{name:"Covariant",domain:"covariant.ai",size:"s"},{name:"Dexterity AI",domain:"dexterity.ai",size:"s"},{name:"Ambi Robotics",domain:"ambiclub.com.br",size:"s"},{name:"RightHand Robotics",domain:"rightstack.com",size:"s"},{name:"Vicarious AI",domain:"vicarious.com",size:"s"},{name:"OSARO",domain:"osaro.com",size:"s"},{name:"Kindred AI",domain:"kindred.ai",size:"s"},{name:"Scallog Automation",domain:"callog.com",size:"s"},{name:"Magazino GmbH",domain:"magazino.eu",size:"s"},{name:"Shipup",domain:"ipup.co",size:"s"},{name:"Bigblue Logistics",domain:"bigblue.co",size:"s"},{name:"Coco Robotics",domain:"coco-delivery.com",size:"s"},{name:"Einride",domain:"einride.tech",size:"m"},{name:"Everstream Analytics",domain:"everstream.ai",size:"m"},{name:"Overhaul",domain:"overhaul.com",size:"m"},{name:"GoGlobal",domain:"goglobal.com",size:"m"},{name:"Shippit",domain:"ippit.com",size:"m"},{name:"Gatik",domain:"gatik.ai",size:"m"},{name:"Kodiak Robotics",domain:"kodiak.ai",size:"m"},{name:"Nuro",domain:"nuro.ai",size:"m"},{name:"Starship Technologies",domain:"arship.xyz",size:"m"},{name:"Wing",domain:"wing.com",size:"m"},{name:"Rivigo Business Consulting",domain:"rivigo.com",size:"m"},{name:"Lyve Global",domain:"lyveglobal.com",size:"m"},{name:"TruKKer",domain:"rukker.com",size:"m"},{name:"Nowports",domain:"nowports.com",size:"m"},{name:"99minutos",domain:"99minutos.com",size:"m"},{name:"Intelipost",domain:"intelipost.com.br",size:"m"},{name:"CargoX",domain:"cargo-x.net",size:"m"},{name:"Berkshire Grey",domain:"berkshiregrey.com",size:"m"},{name:"GreyOrange",domain:"greyorange.com",size:"m"},{name:"Exotec Solutions",domain:"exotec.com",size:"m"},{name:"6 River Systems",domain:"6river.com",size:"m"},{name:"Fetch Robotics Inc.",domain:"fetchrobotics.com",size:"m"},{name:"Cubyn Fulfillment",domain:"cubyn.com",size:"m"},{name:"Deliveree Logistics",domain:"deliveree.com",size:"m"},{name:"PickMe Delivery",domain:"ickme.lk",size:"m"}
62,{name:"Zipline",domain:"zipline.com",size:"l"},{name:"Delhivery",domain:"delhivery.com",size:"l"},{name:"ElasticRun",domain:"elasticrun.com",size:"l"},{name:"BlackBuck",domain:"blackbuck.com",size:"l"},{name:"Porter",domain:"orter.in",size:"l"},{name:"Loggi",domain:"loggi.com",size:"l"},{name:"Oshkosh Corporation",domain:"oshkoshcorp.com",size:"l"},{name:"Lalamove Global Group",domain:"lalamove.com",size:"l"},{name:"GOGOVan / GOGOX",domain:"gogox.com",size:"l"},{name:"Meituan",domain:"meituan.com",size:"xl"},{name:"SF Express",domain:"f-express.com",size:"xl"},{name:"JD Logistics",domain:"jd.com",size:"xl"},{name:"Cainiao Network International",domain:"cainiao.com",size:"xl"}],hf=[{name:"Compass",domain:"compass.com"},{name:"Redfin",domain:"redfin.com"},{name:"Zillow",domain:"zillow.com"},{name:"Opendoor",domain:"opendoor.com"},{name:"Offerpad",domain:"offerpad.com"},{name:"Rocket Mortgage",domain:"rocketmortgage.com"},{name:"Better.com",domain:"better.com"},{name:"Roofstock",domain:"roofstock.com"},{name:"Pacaso",domain:"pacaso.com"},{name:"Sonder",domain:"sonder.com"},{name:"Airbnb",domain:"airbnb.com"},{name:"VRBO",domain:"vrbo.com"},{name:"Vacasa",domain:"vacasa.com"},{name:"Casavo",domain:"casavo.com"},{name:"Habito",domain:"habito.com"},{name:"Lendi",domain:"lendi.com.au"},{name:"PropertyGuru",domain:"propertyguru.com.sg"},{name:"Rightmove",domain:"rightmove.co.uk"},{name:"Zoopla",domain:"zoopla.co.uk"},{name:"ImmoScout24",domain:"immobilienscout24.de"},{name:"Idealista",domain:"idealista.com"},{name:"AppFolio",domain:"appfolio.com"},{name:"Buildium",domain:"buildium.com"},{name:"Yardi",domain:"yardi.com"},{name:"MRI Software",domain:"mrisoftware.com"},{name:"RealPage",domain:"realpage.com"},{name:"Procore",domain:"procore.com"},{name:"PlanGrid",domain:"plangrid.com"},{name:"Buildertrend",domain:"buildertrend.com"},{name:"Doma",domain:"doma.com"},{name:"Snapdocs",domain:"snapdocs.com"},{name:"Notarize",domain:"notarize.com"},{name:"Knock",domain:"knock.co"},{name:"Hippo",domain:"hippo.com"},{name:"Kin Insurance",domain:"kin.com"},{name:"VTS",domain:"vts.com"},{name:"Common",domain:"common.com"},{name:"Bungalow",domain:"bungalow.com"},{name:"Hubble",domain:"hubblehq.com"},{name:"WeWork",domain:"wework.com"},{name:"Industrious",domain:"industriousoffice.com"},{name:"ActiveFence",domain:"activefence.com",size:"m"},{name:"Adappt",domain:"adappt.com",size:"s"},{name:"Alcove",domain:"alcove.com",size:"xs"},{name:"Alice",domain:"alice.co",size:"xs"},{name:"Allied IoT",domain:"allied-iot.com",size:"xs"},{name:"AmberStudent",domain:"amberstudent.com",size:"m"},{name:"Andavy Properties",domain:"andavy.com",size:"xs"},{name:"AnyRoad",domain:"anyroad.com",size:"s"},{name:"Archistar",domain:"archistar.ai",size:"s"},{name:"Arive",domain:"arive.de",size:"s"},{name:"Ark Real Estate",domain:"ark-re.com",size:"xs"},{name:"Atlis",domain:"atlis.com.mx",size:"xs"},{name:"Atmotube",domain:"atmotube.com",size:"xs"},{name:"Avid Build",domain:"avidbuild.com",size:"xs"},{name:"Avvir",domain:"avvir.io",size:"xs"},{name:"Axonon",domain:"axonon.com",size:"xs"},{name:"Backflip",domain:"backflip.com",size:"xs"},{name:"Basalt AI",domain:"basalt.ai",size:"xs"},{name:"Beamup",domain:"beamup.ai",size:"xs"},{name:"Beam Precast",domain:"beamprecast.com.au",size:"xs"},{name:"Belong Home",domain:"belonghome.com",size:"m"},{name:"Beson Home",domain:"beson.com",size:"xs"},{name:"Betterview",domain:"betterview.com",size:"s"},{name:"Bezel",domain:"bezel.com",size:"xs"},{name:"Bhoomi",domain:"bhoomi.co",size:"xs"},{name:"Billd",domain:"billd.com",size:"s"},{name:"Bluebeam",domain:"bluebeam.com",size:"l"},{name:"Blueprint Automation",domain:"blueprint-automation.com",size:"l"},{name:"Bob.io",domain:"bob.io",size:"xs"},{name:"Bouwbox",domain:"bouwbox.nl",size:"xs"},{name:"Brickwell",domain:"brickwell.in",size:"xs"},{name:"Briq",domain:"briq.com",size:"s"},{name:"Buildots",domain:"buildots.com",size:"s"},{name:"Canopy",domain:"canopy.rent",size:"s"},{name:"Casai",domain:"casai.com",size:"s"},{name:"Chiffer",domain:"chiffer.com",size:"xs"},{name:"ClimateView",domain:"climateview.global",size:"xs"},{name:"Clutter Brands",domain:"clutter.com",size:"m"},{name:"Concular",domain:"concular.com",size:"xs"},{name:"Constructn AI",domain:"constructn.ai",size:"xs"},{name:"Cozymeal",domain:"cozymeal.com",size:"s"},{name:"Daft",domain:"daft.ie",size:"m"},{name:"Deepki Gold",domain:"deepki.com",size:"m"},{name:"DeNovus",domain:"denovus.com",size:"xs"},{name:"Divvy Homes",domain:"divvyhomes.com",size:"m"},{name:"Dusty Robotics",domain:"dustyrobotics.com",size:"s"}
62,{name:"ecoworks GmbH",domain:"ecoworks.eco",size:"xs"},{name:"Ellure",domain:"ellure.ai",size:"xs"},{name:"EnEvac",domain:"enevac.com",size:"xs"},{name:"Envoy Global",domain:"envoy.com",size:"m"},{name:"Evolve Vacation Rental",domain:"evolve.com",size:"m"},{name:"FarmAI",domain:"farmai.in",size:"xs"},{name:"Findable",domain:"findable.no",size:"xs"},{name:"Finest AT",domain:"finest-at.com",size:"xs"},{name:"Flyhomes",domain:"flyhomes.com",size:"m"},{name:"Funda",domain:"funda.nl",size:"m"},{name:"GetAgent",domain:"getagent.co.uk",size:"s"},{name:"GetGround",domain:"getground.co.uk",size:"s"},{name:"Goodlord",domain:"goodlord.co",size:"m"},{name:"Guaranteed Rate",domain:"guaranteedrate.com",size:"xl"},{name:"Habitat",domain:"habitat.no",size:"xs"},{name:"HashMove",domain:"hashmove.com",size:"xs"},{name:"HiCounselor",domain:"hicounselor.com",size:"xs"},{name:"Holidu",domain:"holidu.com",size:"m"},{name:"HomeLight Gold",domain:"homelight.com",size:"m"},{name:"Homesnap Gold",domain:"homesnap.com",size:"m"},{name:"HonestDoor",domain:"honestdoor.com",size:"xs"},{name:"Housfy Gold",domain:"housfy.com",size:"s"},{name:"Housing.com",domain:"housing.com",size:"l"},{name:"Infogrid Gold",domain:"infogrid.io",size:"s"},{name:"Instant Offices Gold",domain:"instant-offices.com",size:"m"},{name:"Jones Lang LaSalle Gold",domain:"jll.com",size:"xl"},{name:"Juno Gold",domain:"juno.com.au",size:"xs"},{name:"Kapu Gold India",domain:"kapu.com",size:"xs"},{name:"Keyway Gold",domain:"keyway.com",size:"xs"},{name:"Khubani Gold Real Estate",domain:"khubani.com",size:"xs"},{name:"Keller Williams Gold",domain:"kw.com",size:"xl"},{name:"Landis Gold Financial",domain:"landis.com",size:"s"},{name:"LandTech Gold UK",domain:"landtech.so",size:"s"},{name:"Latch Gold Tech",domain:"latch.com",size:"m"},{name:"Level Gold Smart Home tech",domain:"levelhome.com",size:"s"},{name:"Loft Gold Brazil Tech",domain:"loft.com.br",size:"m"},{name:"Matterport Gold Tech",domain:"matterport.com",size:"l"},{name:"Mesh Gold Construction Tech India",domain:"meshl.io",size:"xs"},{name:"Modernbanc Gold Proptech UK",domain:"modernbanc.com",size:"xs"},{name:"Noah Gold Real Estate Tech US",domain:"noah.co",size:"xs"},{name:"Noopsly Gold Real Estate Tech India",domain:"noopsly.com",size:"xs"},{name:"Nuvolo Gold Proptech US",domain:"nuvolo.com",size:"m"},{name:"On-Site Gold Real Estate tech UK",domain:"on-site.com",size:"m"},{name:"Open Box Gold Proptech UK",domain:"openbox.com",size:"s"},{name:"Oru Gold Real Estate Tech Mexico",domain:"oru.co",size:"xs"},{name:"Oxara Gold Construction Tech Switzerland",domain:"oxara.ch",size:"xs"},{name:"Pathpoint Gold Proptech tech US India",domain:"pathpoint.com",size:"xs"},{name:"Properly Gold Real Estate Tech Canada tech US India UK Mexico India US tech US India tech US India tech US India tech US India tech US India tech US India tech US India tech US India tech US India tech US India tech US India tech US India tech US India tech US India tech US India tech US India tech US India tech US India tech US India Canada",domain:"properly.ca",size:"s"},{name:"PropertyMe Gold Australia Tech US India tech US India tech US India tech US India Japan India UK Canada India tech US India China Japan India UK Canada India tech US India China India tech US India Australia",domain:"propertyme.com.au",size:"s"},{name:"Qualific Gold Real Estate Tech Brazil Australia India UK Canada India tech US India China India tech US India Australia Brazil",domain:"qualific.com.br",size:"xs"},{name:"Qureos Gold Proptech UAE Australia India UK Canada India tech US India China India tech US India Australia Brazil UAE",domain:"qureos.com",size:"xs"},{name:"Reonomy Gold Real Estate Tech US Australia India UK Canada India tech US India China India tech US India Australia Brazil UAE US",domain:"reonomy.com",size:"s"},{name:"SquareFoot Gold Real Estate Tech US Australia India UK Canada India tech US India China India tech US India Australia Brazil UAE US US tech US India Australia Brazil UAE US US",domain:"squarefoot.com",size:"s"}],pf=[{name:"Roblox",domain:"roblox.com"},{name:"Unity",domain:"unity.com"},{name:"Epic Games",domain:"epicgames.com"},{name:"Riot Games",domain:"riotgames.com"},{name:"Activision Blizzard",domain:"activisionblizzard.com"},{name:"Electronic Arts",domain:"ea.com"},{name:"Take-Two Interactive",domain:"take2games.com"},{name:"Ubisoft",domain:"ubisoft.com"},{name:"Niantic",domain:"nianticlabs.com"},{name:"Supercell",domain:"supercell.com"},{name:"Rovio",domain:"rovio.com"},{name:"King",domain:"king.com"},{name:"Zynga",domain:"zynga.com"},{name:"Scopely",domain:"scopely.com"},{name:"Playtika",domain:"playtika.com"},{name:"Embracer Group",domain:"embracer.com"},{name:"miHoYo",domain:"mihoyo.com"},{name:"Tencent Games",domain:"tencentgames.com"},{name:"NetEase Games",domain:"neteasegames.com"},{name:"Krafton",domain:"krafton.com"},{name:"Discord",domain:"discord.com"},{name:"Twitch",domain:"twitch.tv"},{name:"Steam (Valve)",domain:"valvesoftware.com"},{name:"GOG",domain:"gog.com"},{name:"itch.io",domain:"itch.io"},{name:"Roblox",domain:"roblox.com"},{name:"Improbable",domain:"improbable.io"},{name:"Hadean",domain:"hadean.com"},{name:"Manticore Games",domain:"manticoregames.com"},{name:"Stadia",domain:"stadia.com"},{name:"GeForce Now (Nvidia)",domain:"nvidia.com"},{name:"Xbox Cloud (Microsoft)",domain:"xbox.com"},{name:"PlayStation (Sony)",domain:"playstation.com"},{name:"Roblox",domain:"roblox.com"},{name:"Voodoo",domain:"voodoo.io"},{name:"Lion Studios",domain:"lionstudios.cc"},{name:"Homa Games",domain:"homagames.com"},{name:"Jam City",domain:"jamcity.com"},{name:"Wildlife Studios",domain:"wildlifestudios.com"},{name:"Gameloft",domain:"gameloft.com"},{name:"Tatsumeeko",domain:"atsumeeko.com",size:"xs"},{name:"Metatheory",domain:"metatheory.gg",size:"xs"},{name:"Proof of Play",domain:"roofofplay.gg",size:"xs"},{name:"Horizon Blockchain Games",domain:"orizon.io",size:"xs"},{name:"Pocketpair",domain:"ocketpair.jp",size:"xs"},{name:"Monzo Games Japan",domain:"monzo.me",size:"xs"},{name:"Mighty Bear Games",domain:"mightybeargames.com",size:"xs"},{name:"Ventura Studio",domain:"layventura.com",size:"xs"},{name:"Aftershock",domain:"aftershock.game",size:"xs"},{name:"Gamestart",domain:"gamestart.com.au",size:"xs"},{name:"Superwell",domain:"uperwell.io",size:"xs"},{name:"Theorycraft Games",domain:"eorycraftgames.com",size:"xs"},{name:"That's No Moon Entertainment",domain:"atsno-moon.com",size:"xs"},{name:"Odyssey Interactive",domain:"odysseyinteractive.gg",size:"xs"}
62,{name:"BonusXP",domain:"bonusxp.com",size:"xs"},{name:"Beamable",domain:"beamable.com",size:"xs"},{name:"Stardust",domain:"ardust.co",size:"xs"},{name:"LootRush",domain:"lootrush.com",size:"xs"},{name:"Elixir Games",domain:"elixir.app",size:"xs"},{name:"Mugen AI",domain:"mugen.ai",size:"xs"},{name:"BITKRAFT Ventures Gaming",domain:"bitkraft.vc",size:"xs"},{name:"Nascent Gaming",domain:"nascent.xyz",size:"xs"},{name:"AR Games Studio",domain:"argames.io",size:"xs"},{name:"Fanatiz Esports",domain:"fanatiz.com",size:"xs"},{name:"Strafe",domain:"rafe.com",size:"xs"},{name:"Esports Tower",domain:"esportstower.com",size:"xs"},{name:"Gamestream",domain:"gamestream.com",size:"xs"},{name:"OneStopGames",domain:"onestopgames.com",size:"xs"},{name:"Playtose Entertainment",domain:"laytose.com",size:"xs"},{name:"Hyperlight Studios India",domain:"yperlight.id",size:"xs"},{name:"Nimbus Games",domain:"nimbusgames.com",size:"xs"},{name:"Blackstorm Labs",domain:"blackstormlabs.com",size:"xs"},{name:"GameTech International",domain:"gametech.com",size:"xs"},{name:"e-point Esports",domain:"e-point.com",size:"xs"},{name:"Pixel Ducks Studio",domain:"ixelducks.com",size:"xs"},{name:"Wildcard Pro",domain:"wildcard.pro",size:"xs"},{name:"Gamelevate",domain:"gamelevate.com",size:"xs"},{name:"Gamers Hub Middle East",domain:"gamershub.pro",size:"xs"},{name:"Z League",domain:"zleague.gg",size:"xs"},{name:"Community Gaming",domain:"communitygaming.io",size:"xs"},{name:"Repeat.gg",domain:"repeat.gg",size:"xs"},{name:"BattleFly Game Studio",domain:"battlefly.game",size:"xs"},{name:"Polkastarter Gaming",domain:"olkastarter.gg",size:"xs"},{name:"Rainmaker Games",domain:"rainmaker.gg",size:"xs"},{name:"Fractal",domain:"fractal.is",size:"xs"},{name:"Merit Circle",domain:"meritcircle.io",size:"xs"},{name:"GuildFi",domain:"guildfi.com",size:"xs"},{name:"Ember Lab",domain:"emberlab.com",size:"xs"},{name:"IRONMACE",domain:"ironmace.com",size:"xs"},{name:"Carry1st",domain:"carry1st.com",size:"s"},{name:"Playco",domain:"layco.com",size:"s"},{name:"Superplay",domain:"uperplay.co",size:"s"},{name:"Buff.game",domain:"buff.game",size:"s"},{name:"Overwolf",domain:"overwolf.com",size:"s"},{name:"Neon Machine",domain:"rapnel.com",size:"s"},{name:"Limit Break",domain:"limitbreak.com",size:"s"},{name:"Yuga Labs",domain:"yugalabs.io",size:"s"},{name:"SYBO Games",domain:"ybogames.com",size:"s"},{name:"Fingerprint",domain:"fingerprintplay.com",size:"s"},{name:"Nanobit",domain:"nanobit.com",size:"s"},{name:"Metacore Games",domain:"metacoregames.com",size:"s"},{name:"Mountaintop Studios",domain:"mountaintop.gg",size:"s"},{name:"Ready Player Me",domain:"readyplayer.me",size:"s"},{name:"mod.io",domain:"mod.io",size:"s"},{name:"CurseForge",domain:"curseforge.com",size:"s"},{name:"Talespin",domain:"alespin.com",size:"s"},{name:"Yield Guild Games (YGG)",domain:"yieldguild.io",size:"s"},{name:"Big Time Studios",domain:"bigtime.gg",size:"s"},{name:"Illuvium",domain:"illuvium.io",size:"s"},{name:"Star Atlas",domain:"aratlas.com",size:"s"},{name:"Find Satoshi Lab (STEPN)",domain:"epn.com",size:"s"},{name:"Gunzilla Games",domain:"offthegrid.game",size:"s"},{name:"Mythical Games",domain:"mythicalgames.com",size:"m"},{name:"Dapper Labs",domain:"dapperlabs.com",size:"m"},{name:"Animoca Brands",domain:"animocabrands.com",size:"m"},{name:"FACEIT",domain:"faceit.com",size:"m"},{name:"Remedy Entertainment",domain:"remedygames.com",size:"m"},{name:"Paradox Interactive",domain:"aradoxinteractive.com",size:"m"},{name:"Tripledot Studios",domain:"ripledotstudios.com",size:"m"},{name:"Dream Games",domain:"dreamgames.com",size:"m"},{name:"Belka Games",domain:"belkaguys.com",size:"m"},{name:"Sorare",domain:"orare.com",size:"m"},{name:"The Sandbox",domain:"esandbox.game",size:"m"},{name:"InnoGames",domain:"innogames.com",size:"m"},{name:"Wooga",domain:"wooga.com",size:"m"},{name:"Tactile Games",domain:"actilegames.com",size:"m"},{name:"Nordeus",domain:"nordeus.com",size:"m"},{name:"Huuuge Games",domain:"uuugegames.com",size:"m"},{name:"Vizor Games",domain:"vizor-games.com",size:"m"}
62,{name:"Dream11",domain:"dream11.com",size:"l"},{name:"Moonton Games",domain:"mobilelegends.com",size:"l"},{name:"Moon Active",domain:"moonactive.com",size:"l"},{name:"Square Enix",domain:"quare-enix.com",size:"l"},{name:"Capcom",domain:"capcom.com",size:"l"},{name:"Playrix Studios",domain:"layrix.com",size:"l"},{name:"Garena Engineering",domain:"garena.com",size:"xl"},{name:"NCSOFT",domain:"ncsoft.com",size:"xl"},{name:"Bandai Namco Entertainment",domain:"bandainamco.co.jp",size:"xl"},{name:"Nexon",domain:"nexon.com",size:"xl"}],gf=[{name:"Netflix",domain:"netflix.com"},{name:"Spotify",domain:"spotify.com"},{name:"Disney+",domain:"disneyplus.com"},{name:"Hulu",domain:"hulu.com"},{name:"HBO Max",domain:"max.com"},{name:"Paramount+",domain:"paramountplus.com"},{name:"Peacock",domain:"peacocktv.com"},{name:"Apple TV+",domain:"tv.apple.com"},{name:"Amazon Prime Video",domain:"primevideo.com"},{name:"YouTube",domain:"youtube.com"},{name:"TikTok",domain:"tiktok.com"},{name:"Snap",domain:"snap.com"},{name:"Pinterest",domain:"pinterest.com"},{name:"Reddit",domain:"reddit.com"},{name:"Twitch",domain:"twitch.tv"},{name:"Substack",domain:"substack.com"},{name:"Medium",domain:"medium.com"},{name:"Patreon",domain:"patreon.com"},{name:"OnlyFans",domain:"onlyfans.com"},{name:"Cameo",domain:"cameo.com"},{name:"Vimeo",domain:"vimeo.com"},{name:"Wistia",domain:"wistia.com"},{name:"Brightcove",domain:"brightcove.com"},{name:"Mux",domain:"mux.com"},{name:"Cloudflare Stream",domain:"cloudflare.com"},{name:"Bandcamp",domain:"bandcamp.com"},{name:"SoundCloud",domain:"soundcloud.com"},{name:"Tidal",domain:"tidal.com"},{name:"Audible",domain:"audible.com"},{name:"iHeartMedia",domain:"iheartmedia.com"},{name:"Spotify for Podcasters",domain:"anchor.fm"},{name:"Buzzsprout",domain:"buzzsprout.com"},{name:"The New York Times",domain:"nytimes.com"},{name:"The Washington Post",domain:"washingtonpost.com"},{name:"The Wall Street Journal",domain:"wsj.com"},{name:"Bloomberg",domain:"bloomberg.com"},{name:"BuzzFeed",domain:"buzzfeed.com"},{name:"Vox Media",domain:"voxmedia.com"},{name:"The Athletic",domain:"theathletic.com"},{name:"Axios",domain:"axios.com"},{name:"Insider",domain:"businessinsider.com"},{name:"Penguin Random House",domain:"penguinrandomhouse.com"},{name:"HarperCollins",domain:"harpercollins.com"},{name:"Hachette",domain:"hachettebookgroup.com"},{name:"Gumroad",domain:"gumroad.com",size:"xs"},{name:"Jetpack Creator",domain:"creators.jetpack.com",size:"xs"},{name:"RedCircle",domain:"redcircle.com",size:"xs"},{name:"Fontaine",domain:"fontaine.io",size:"xs"},{name:"Ghost",domain:"ghost.org",size:"xs"},{name:"Passionfroot",domain:"assionfroot.me",size:"xs"},{name:"Flagship",domain:"flagship.shop",size:"xs"},{name:"Repurpose.io",domain:"repurpose.io",size:"xs"},{name:"Zencastr",domain:"zencastr.com",size:"xs"},{name:"Captivate",domain:"captivate.fm",size:"xs"},{name:"Splash",domain:"lash.stream",size:"xs"},{name:"Overcast",domain:"overcast.fm",size:"xs"},{name:"Pocket Casts",domain:"ocketcasts.com",size:"xs"},{name:"RadioPublic",domain:"radiopublic.com",size:"xs"},{name:"Podchaser",domain:"odchaser.com",size:"xs"},{name:"Odysee",domain:"odysee.com",size:"xs"},{name:"Melon",domain:"melonapp.com",size:"xs"},{name:"evmux",domain:"evmux.com",size:"xs"},{name:"LiveReacting",domain:"livereacting.com",size:"xs"},{name:"Transistor",domain:"ransistor.fm",size:"xs"},{name:"Castos",domain:"castos.com",size:"xs"},{name:"Fireside.fm",domain:"fireside.fm",size:"xs"},{name:"Puck Medical",domain:"uck.news",size:"xs"},{name:"The Bulwark",domain:"ebulwark.com",size:"xs"},{name:"Defector Media",domain:"defector.com",size:"xs"},{name:"The Wire India",domain:"ewire.in",size:"xs"},{name:"Nebula",domain:"nebula.tv",size:"xs"},{name:"Critical Role",domain:"criticalrole.com",size:"xs"},{name:"Studio78",domain:"eveneight.studio",size:"xs"},{name:"Creative Juice",domain:"creativejuice.com",size:"xs"},{name:"Blubrry",domain:"blubrry.com",size:"xs"},{name:"Fm.fm",domain:"fm.fm",size:"xs"},{name:"Riverside.fm",domain:"riverside.fm",size:"s"},{name:"beehiiv",domain:"beehiiv.com",size:"s"},{name:"Ausha",domain:"ausha.co",size:"s"},{name:"Maven",domain:"maven.com",size:"s"},{name:"Karat Financial",domain:"karat.com",size:"s"},{name:"Beacons",domain:"beacons.ai",size:"s"},{name:"Theta Network",domain:"eta.tv",size:"s"},{name:"StreamYard",domain:"reamyard.com",size:"s"},{name:"Restream",domain:"restream.io",size:"s"},{name:"Maestro",domain:"maestro.io",size:"s"},{name:"Molotov TV",domain:"molotov.tv",size:"s"},{name:"Simplecast",domain:"implecast.com",size:"s"},{name:"The Information",domain:"einformation.com",size:"s"},{name:"Skift",domain:"kift.com",size:"s"},{name:"HelloGiggles",domain:"ellogiggles.com",size:"s"},{name:"theSkimm",domain:"eskimm.com",size:"s"},{name:"ALTBalaji",domain:"altbalaji.com",size:"s"},{name:"POPxo",domain:"opxo.com",size:"s"},{name:"The Quint",domain:"equint.com",size:"s"},{name:"Scroll.in",domain:"croll.in",size:"s"},{name:"Hayu",domain:"ayu.com",size:"s"},{name:"BritBox",domain:"britbox.com",size:"s"},{name:"CuriosityStream",domain:"curiositystream.com",size:"s"},{name:"Dropout",domain:"dropout.tv",size:"s"},{name:"Collab",domain:"collab.inc",size:"s"},{name:"Night Media",domain:"night.co",size:"s"}
62,{name:"Spotter",domain:"otter.la",size:"s"},{name:"Audioboom",domain:"audioboom.com",size:"s"},{name:"Spreaker",domain:"reaker.com",size:"s"},{name:"Podbean",domain:"odbean.com",size:"s"},{name:"Nextory",domain:"nextory.com",size:"s"},{name:"Descript",domain:"descript.com",size:"m"},{name:"Linktree",domain:"linktree.ee",size:"m"},{name:"Kajabi",domain:"kajabi.com",size:"m"},{name:"Podimo",domain:"odimo.com",size:"m"},{name:"Acast (Pippa)",domain:"ippa.io",size:"m"},{name:"Triller",domain:"riller.co",size:"m"},{name:"Rumble",domain:"rumble.com",size:"m"},{name:"OneFootball",domain:"onefootball.com",size:"m"},{name:"FuboTV",domain:"fubo.tv",size:"m"},{name:"Megaphone (Spotify)",domain:"megalist.media",size:"m"},{name:"Morning Brew",domain:"morningbrew.com",size:"m"},{name:"Industry Dive",domain:"industrydive.com",size:"m"},{name:"Bustle Digital Group",domain:"bustle.com",size:"m"},{name:"Voot",domain:"voot.com",size:"m"},{name:"Pocket FM",domain:"ocketfm.com",size:"m"},{name:"Pratilipi",domain:"ratilipi.com",size:"m"},{name:"Rakuten Viki",domain:"viki.com",size:"m"},{name:"WeTV",domain:"wetv.vip",size:"m"},{name:"MUBI Beauty",domain:"mubi.com",size:"m"},{name:"Rooster Teeth",domain:"roosterteeth.com",size:"m"},{name:"Jellysmack",domain:"jellysmack.com",size:"m"},{name:"Libsyn",domain:"libsyn.com",size:"m"},{name:"Storytel",domain:"orytel.com",size:"m"},{name:"DAZN Group",domain:"dazn.com",size:"l"},{name:"Viaplay Group",domain:"viaplaygroup.com",size:"l"},{name:"Future PLC",domain:"futureplc.com",size:"l"},{name:"JioCinema",domain:"jio.com",size:"l"},{name:"ZEE5",domain:"zee5.com",size:"l"},{name:"Viu",domain:"viu.com",size:"l"},{name:"Dotdash Meredith",domain:"dotdashmeredith.com",size:"xl"},{name:"Schibsted",domain:"chibsted.com",size:"xl"},{name:"Ringier",domain:"ringier.com",size:"xl"},{name:"Axel Springer",domain:"axelspringer.com",size:"xl"}],Hn={fintech:sf,ai:tf,devtools:af,saas:rf,ecommerce:nf,healthtech:of,cybersecurity:lf,crypto:cf,edtech:df,hrtech:mf,marketing:xf,logistics:uf,proptech:hf,gaming:pf,media:gf},Od=s=>{const t=new Set,a=[];for(const r of s){const o=r.domain.toLowerCase();t.has(o)||(t.add(o),a.push(r))}return a};function ff(s){if(!s)return null;const t=s.toLowerCase().trim();if(!t)return null;if(t in Hn)return t;if(t in ii)return ii[t];for(const[a,r]of Object.entries(ii)){if(a.length<3)continue;if(new RegExp(`\\b${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"i").test(t))return r}return null}function bf(s){for(const t of s){const a=ff(t);if(a)return a}return null}const jf={"stripe.com":"xl","klarna.com":"xl","adyen.com":"xl","wise.com":"xl","paypal.com":"xl","block.xyz":"xl","squareup.com":"xl","coinbase.com":"xl","binance.com":"xl","robinhood.com":"xl","sofi.com":"xl","westernunion.com":"xl","openai.com":"xl","databricks.com":"xl","snowflake.com":"xl","github.com":"xl","gitlab.com":"xl","atlassian.com":"xl","salesforce.com":"xl","hubspot.com":"xl","servicenow.com":"xl","workday.com":"xl","sap.com":"xl","oracle.com":"xl","zoom.us":"xl","slack.com":"xl","dropbox.com":"xl","box.com":"xl","docusign.com":"xl","shopify.com":"xl","bigcommerce.com":"xl","wix.com":"xl","squarespace.com":"xl","ebay.com":"xl","etsy.com":"xl","zalando.com":"xl","asos.com":"xl","cloudflare.com":"xl","akamai.com":"xl","fastly.com":"xl","mongodb.com":"xl","elastic.co":"xl","splunk.com":"xl","newrelic.com":"xl","datadoghq.com":"xl","twilio.com":"xl","sendgrid.com":"xl","okta.com":"xl","auth0.com":"xl","crowdstrike.com":"xl","paloaltonetworks.com":"xl","zscaler.com":"xl","rapid7.com":"xl","tenable.com":"xl","qualys.com":"xl","proofpoint.com":"xl","mimecast.com":"xl","duo.com":"xl","lastpass.com":"xl","kraken.com":"xl","ripple.com":"xl","consensys.io":"xl","metamask.io":"xl","coursera.org":"xl","udemy.com":"xl","duolingo.com":"xl","khanacademy.org":"xl","chegg.com":"xl","byjus.com":"xl","blackboard.com":"xl","instructure.com":"xl","powerschool.com":"xl","adp.com":"xl","paychex.com":"xl","rippling.com":"xl","deel.com":"xl","mailchimp.com":"xl","klaviyo.com":"xl","marketo.com":"xl","hootsuite.com":"xl","ahrefs.com":"xl","semrush.com":"xl","criteo.com":"xl","thetradedesk.com":"xl","fedex.com":"xl","ups.com":"xl","dhl.com":"xl","maersk.com":"xl","samsara.com":"xl","zillow.com":"xl","redfin.com":"xl","airbnb.com":"xl","wework.com":"xl","roblox.com":"xl","unity.com":"xl","epicgames.com":"xl","ea.com":"xl","ubisoft.com":"xl","tencentgames.com":"xl","netflix.com":"xl","spotify.com":"xl","disneyplus.com":"xl","youtube.com":"xl","tiktok.com":"xl","snap.com":"xl","pinterest.com":"xl","reddit.com":"xl","twitch.tv":"xl","nytimes.c
62om":"xl","wsj.com":"xl","bloomberg.com":"xl","veeva.com":"xl","teladoc.com":"xl","revolut.com":"l","n26.com":"l","monzo.com":"l","nubank.com.br":"l","chime.com":"l","affirm.com":"l","marqeta.com":"l","checkout.com":"l","plaid.com":"l","brex.com":"l","ramp.com":"l","starlingbank.com":"l","wealthsimple.com":"l","qonto.com":"l","etoro.com":"l","trading212.com":"l","chainalysis.com":"l","circle.com":"l","fireblocks.com":"l","carta.com":"l","anthropic.com":"l","huggingface.co":"l","scale.com":"l","perplexity.ai":"l","elevenlabs.io":"l","runwayml.com":"l","stability.ai":"l","character.ai":"l","cohere.com":"l","vercel.com":"l","netlify.com":"l","supabase.com":"l","render.com":"l","hashicorp.com":"l","sentry.io":"l","launchdarkly.com":"l","linear.app":"l","retool.com":"l","notion.so":"l","airtable.com":"l","figma.com":"l","asana.com":"l","monday.com":"l","intercom.com":"l","zendesk.com":"l","calendly.com":"l","loom.com":"l","miro.com":"l","canva.com":"l","gong.io":"l","outreach.io":"l","salesloft.com":"l","apollo.io":"l","zoominfo.com":"l","freshworks.com":"l","zoho.com":"l","pipedrive.com":"l","qualtrics.com":"l","wiz.io":"l","snyk.io":"l","1password.com":"l","sentinelone.com":"l","cybereason.com":"l","tanium.com":"l","darktrace.com":"l","abnormalsecurity.com":"l","vanta.com":"l","drata.com":"l","discord.com":"l","remote.com":"l","personio.com":"l","lattice.com":"l","greenhouse.io":"l","lever.co":"l","amplitude.com":"l","mixpanel.com":"l","segment.com":"l","braze.com":"l","iterable.com":"l","activecampaign.com":"l","buffer.com":"l","sproutsocial.com":"l","flexport.com":"l","shipbob.com":"l","shipstation.com":"l","project44.com":"l","fourkites.com":"l","compass.com":"l","opendoor.com":"l","procore.com":"l","mercury.com":"m","tide.co":"m","pleo.io":"m","spendesk.com":"m","bunq.com":"m","traderepublic.com":"m","scalable.capital":"m","wealthfront.com":"m","betterment.com":"m","acorns.com":"m","remitly.com":"m","gocardless.com":"m","mollie.com":"m","currencycloud.com":"m","truelayer.com":"m","tink.com":"m","rapyd.net":"m","dave.com":"m","lemonade.com":"m","alloy.com":"m","withpersona.com":"m","onfido.com":"m","complyadvantage.com":"m","sumsub.com":"m","mistral.ai":"m","pinecone.io":"m","weaviate.io":"m","langchain.com":"m","replicate.com":"m","together.ai":"m","groq.com":"m","ai21.com":"m","aleph-alpha.com":"m","anyscale.com":"m","lightning.ai":"m","cursor.com":"m","codeium.com":"m","replit.com":"m","lovable.dev":"m","posthog.com":"m","planetscale.com":"m","neon.tech":"m","honeycomb.io":"m","clerk.com":"m","workos.com":"m","resend.com":"m","algolia.com":"m","coda.io":"m","webflow.com":"m","typeform.com":"m","front.com":"m","helpscout.com":"m","orca.security":"m","lacework.com":"m","aquasec.com":"m","sysdig.com":"m","knowbe4.com":"m","hackerone.com":"m","bugcrowd.com":"m","secureframe.com":"m","alchemy.com":"m","infura.io":"m","quicknode.com":"m","anchorage.com":"m","bitgo.com":"m","ginger.io":"m","lyrahealth.com":"m","modernhealth.com":"m","springhealth.com":"m","hingehealth.com":"m","swordhealth.com":"m","kry.se":"m","doctolib.com":"m","ro.co":"m","forhims.com":"m","ashbyhq.com":"m","hibob.com":"m","charthop.com":"m","15five.com":"m","cultureamp.com":"m","gusto.com":"m","bamboohr.com":"m","oysterhr.com":"m","papayaglobal.com":"m","workable.com":"m","drip.com":"m","customer.io":"m","onesignal.com":"m","hightouch.com":"m","getcensus.com":"m","heap.io":"m","fullstory.com":"m","hotjar.com":"m","optimizely.com":"m","vwo.com":"m","later.com":"m","convoy.com":"m","uberfreight.com":"m","shipmonk.com":"m","stord.com":"m","sennder.com":"m","forto.com":"m","better.com":"m","sonder.com":"m","vacasa.com":"m","snapdocs.com":"m","appfolio.com":"m","buildium.com":"m","supercell.com":"m","scopely.com":"m","niantic.com":"m","voodoo.io":"m","homagames.com":"m","substack.com":"m","patreon.com":"m","vimeo.com":"m","mux.com":"m","wistia.com":"m","axios.com":"m","theathletic.com":"m","lunar.app":"s","modulrfinance.com":"s","yapily.com":"s","curve.com":"s","zopa.com":"s","oaknorth.com":"s","atombank.co.uk":"s","pipe.com":"s","capchase.com":"s","fireworks.ai":"s","baseten.co":"s","octo.ai":"s","runpod.io":"s","reka.ai":"s","imbue.com":"s","poolside.ai":"s","magic.dev":"s","v0.dev":"s","tabnine.com":"s","harvey.ai":"s","glean.com":"s","writer.com":"s","synthesia.io":"s","heygen.com":"s","tome.app":"s","gamma.app":"s","leonardo.ai":"s","ideogram.ai":"s","luma-ai.com":"s","pika.art":"s","railway.app":"s","fly.io":"s","turso.tech":"s","spacelift.io":"s","statsig.com":"s","mem.ai":"s","superhuman.
62com":"s","crisp.chat":"s","tidio.com":"s","material.security":"s","gitguardian.com":"s","trailofbits.com":"s","abridge.com":"s","suki.ai":"s","notablehealth.com":"s","oliveai.com":"s","tia.com":"s","asktia.com":"s","kindbody.com":"s","get-carrot.com":"s","ravio.com":"s","compa.as":"s","figures.hr":"s","pave.com":"s","findem.ai":"s","gem.com":"s","polaranalytics.com":"s","northbeam.io":"s","triplewhale.com":"s","rebuyengine.com":"s","loopreturns.com":"s","postscript.io":"s","routific.com":"s","onfleet.com":"s","shipwell.com":"s","loadsmart.com":"s","knock.co":"s","bungalow.com":"s","common.com":"s","hubblehq.com":"s","manticoregames.com":"s","lionstudios.cc":"s","modal.com":"xs","crusoe.ai":"xs"},yf={fintech:"m",ai:"s",devtools:"m",saas:"l",ecommerce:"m",healthtech:"m",cybersecurity:"m",crypto:"m",edtech:"m",hrtech:"m",marketing:"m",logistics:"m",proptech:"m",gaming:"m",media:"l"},vn=(s,t)=>s.size??jf[s.domain.toLowerCase()]??yf[t],vf={xs:"â¤50",s:"~150",m:"~500",l:"1k+",xl:"5k+"};function Nf(s,t){const a=Number(s||0)||0,r=Number(t||0)||1/0,o=[{tier:"xs",lo:1,hi:50},{tier:"s",lo:51,hi:200},{tier:"m",lo:201,hi:1e3},{tier:"l",lo:1001,hi:5e3},{tier:"xl",lo:5001,hi:1/0}],n=o.filter(l=>l.hi>=a&&l.lo<=r).map(l=>l.tier);return n.length?n:o.map(l=>l.tier)}const wf={xs:["s"],s:["xs","m"],m:["s","l"],l:["m","xl"],xl:["l"]},kf={xs:0,s:1,m:2,l:3,xl:4};function oi(s,t){return s.map((a,r)=>({c:a,i:r,rank:kf[vn(a,t)]})).sort((a,r)=>a.rank-r.rank||a.i-r.i).map(a=>a.c)}function Sf(s,t){var r;if(!s)return;const a=t.toLowerCase();return(r=Hn[s])==null?void 0:r.find(o=>o.name.toLowerCase()===a)}function Ho(s,t){if(!s)return;const a=Sf(s,t);if(a)return vf[vn(a,s)]}function Go(s,t=20,a){if(!s)return[];const r=Od(Hn[s]||[]),o=Math.max(0,t);if(!((a==null?void 0:a.sizeMin)&&String(a.sizeMin).trim()!==""||(a==null?void 0:a.sizeMax)&&String(a.sizeMax).trim()!==""))return oi(r,s).slice(0,o);const l=new Set(Nf(a==null?void 0:a.sizeMin,a==null?void 0:a.sizeMax)),c=oi(r.filter(u=>l.has(vn(u,s))),s);if(c.length>=o)return c.slice(0,o);const x=new Set;for(const u of l)for(const m of wf[u])x.add(m);for(const u of l)x.delete(u);const d=oi(r.filter(u=>x.has(vn(u,s))),s);return[...c,...d].slice(0,o)}function Cf(s){return s?Od(Hn[s]||[]).length:0}function _f(s){return{fintech:"Fintech",ai:"AI / ML",devtools:"DevTools / DevOps",saas:"B2B SaaS",ecommerce:"E-commerce",healthtech:"Healthtech",cybersecurity:"Cybersecurity",crypto:"Crypto / Web3",edtech:"Edtech",hrtech:"HR Tech",marketing:"Marketing / Adtech",logistics:"Logistics",proptech:"Proptech",gaming:"Gaming",media:"Media / Streaming"}[s]}const Uo=[{label:"Any",min:"",max:""},{label:"1-10",min:"1",max:"10"},{label:"11-50",min:"11",max:"50"},{label:"51-200",min:"51",max:"200"},{label:"201-500",min:"201",max:"500"},{label:"501-1000",min:"501",max:"1000"},{label:"1000+",min:"1001",max:""}],Tf=["Founder","Co-Founder","CTO","CEO","Head of AI","Head of ML","VP Engineering","Head of DevOps"],Af=["AI","ML","devtools","devops","infra","SaaS","fintech","cybersecurity"],If=["LLM","MLOps","Kubernetes","open-source","B2B"],li=s=>s.split(",").map(t=>t.trim()).filter(Boolean),Lf=new Set(["a","an","the","and","or","of","for","in","to","with"]),Fd=s=>{const t=s.toLowerCase().replace(/[^\p{L}\p{N}\s+#./-]/gu," ").split(/\s+/).map(a=>a.replace(/^[-./+#]+|[-./+#]+$/g,"")).filter(a=>a.length>1&&!Lf.has(a));return new Set(t)},Bd=(s,t)=>{if(s.size===0&&t.size===0)return 1;if(s.size===0||t.size===0)return 0;let a=0;for(const r of s)t.has(r)&&a++;return a/(s.size+t.size-a)},$d=.8,Wo=s=>{const t=s.map(r=>r.trim()).filter(Boolean),a=[];for(const r of t){const o=Fd(r);a.some(l=>Bd(l.tokens,o)>=$d)||a.push({raw:r,tokens:o})}return a.map(r=>r.raw)},Oa=4,qd=20;function Vo(s,t,a,r,o,n=[]){const l=[],c=new Set,x=n.length>0?qd:Oa,d=g=>{const v=g.map(C=>C.trim()).filter(Boolean);if(!v.length)return;const b=v.slice(0,4).join(" "),z=b.toLowerCase();c.has(z)||b.length>90||(c.add(z),l.push(b))};if(!t.length)return l;const u=t;if(n.length>0){if(s==="sales_nav")return u.slice(0,4).forEach(j=>d([j])),l.slice(0,Oa);const g=u[0],v=a[0],b=a[1],z=r[0],C=r[1];v&&d([g,v]),z&&d([g,z]),b?d([g,b]):C&&d([g,C]),u[1]?d([u[1],v||z||""]):v&&z&&d([g,v,z]),d(o?[g,"remote"]:[g,"startup"]);for(const j of n){const y=/\s/.test(j)?`"${j}"`:j;if(d([g,y]),l.length>=x)break}if(l.length<x)for(const j of u.slice(1,3)){for(const y of n.slice(0,3)){const N=/\s/.test(y)?`"${y}"`:y;if(d([j,N]),l.length>=x)break}if(l.length>=x)break}return l.slice(0,x)}if(s==="sales_nav")return u.slice(0,4).forEach(g=>d([g])),l.slice(0,Oa);const m=a.length?a:[""],p=r[0];for(const g of u){for(const v of m)if(d([g,v,o?"remote":""]),l.length>=Oa)break;if(l.length>=Oa)break}return p&&l.length<Oa&&d([u[0],p,o?"remote":""]),l.slice(0,Oa)}function zf({mode:s,initialVariants:t,initialFilters:a,onCancel:r,onConfirm:o}){var ze;const[n,l]=i.useState(li(a.role)),[c,x]=i.useState(li(a.industry)),[d,u]=i.useState(li(a.keywords||"")),m=a.sizeMin&&a.sizeMin.trim()!==""?a.sizeMin:"1",p=a.sizeMax&&a.sizeMax.trim()!==""||a.sizeMin&&a.sizeMin.trim()!==""?a.sizeMax:"200",[g,v]=i.useState(m),[b,z]=i.useState(p),[C,j]=i.useState(a.remote),[y,N]=i.useState(""),[f,R]=i.useState(""),[M,q]=i.useState(""),[_,A]=i.useState(""),B=i.useMemo(()=>bf(c),[c]),P=i.useMemo(()=>Go(B,20,{sizeMin:g,sizeMax:b}),[B,g,b]),I=i.useMemo(()=>Cf(B),[B]),[$,be]=i.useState(!0),[Y,O]=i.useState(()=>Math.min(20,Math.max(10,P.length||20))),[he,re]=i.useState(!1),[oe,T]=i.useState(()=>P.slice(0,20).map(pe=>pe.name)),[ce,le]=i.useState(!1);i.useEffect(()=>{ce||$&&T(P.slice(0,Y).map(pe=>pe.name))},[P,ce,$,Y]);const[F,L]=i.useState(t.length?t:Vo(s,n,c,d,C,oe)),[K,ue]=i.useState(!0),Ne=s==="public",fe=i.useMemo(()=>$&&B?oe.slice(0,Y):[],[$,B,oe,Y]),Ie=Ne&&fe.length>0?qd:Oa,Q=i.useMemo(()=>Vo(s,n,c,d,C,fe),[s,n,c,d,C,fe]);i.useEffect(()=>{K&&L(Q.length?Q:[""])},[K,Q]);const ne=pe=>{const Ae=pe.trim().replace(/^["']|["']$/g,"");if(Ae){if(oe.some(Ee=>Ee.toLowerCase()===Ae.toLowerCase())){A("");return}le(!0),T([...oe,Ae]),A("")}},ke=pe=>{le(!0),T(oe.filter((Ae,Ee)=>Ee!==pe))},ee=()=>{le(!1),T(P.map(pe=>pe.name))},E=(pe,Ae,Ee,ls)=>{const ss=Ee.trim();if(ss){if(pe.some($s=>$s.toLowerCase()===ss.toLowerCase())){ls("");return}Ae([...pe,ss]),ls("")}},xe=(pe,Ae,Ee)=>Ae(pe.filter((ls,ss)=>ss!==Ee)),ve=(pe,Ae)=>{v(pe),z(Ae)},S=(ze=Uo.find(pe=>pe.min===g&&pe.max===b))==null?void 0:ze.label,J=(pe,Ae)=>{ue(!1),L(Ee=>Ee.map((ls,ss)=>ss===pe?Ae:ls))},je=pe=>{ue(!1),L(Ae=>Ae.filter((Ee,ls)=>
62ls!==pe))},se=()=>{F.length>=Ie||(ue(!1),L(pe=>[...pe,""]))},Oe=i.useMemo(()=>{const pe=F.map(Ee=>Fd(Ee)),Ae=new Set;for(let Ee=0;Ee<F.length;Ee++)if(F[Ee].trim()){for(let ss=0;ss<Ee;ss++)if(!(!F[ss].trim()||Ae.has(ss))&&Bd(pe[Ee],pe[ss])>=$d){Ae.add(Ee);break}}return Ae},[F]),We=()=>{const pe=Wo(F);pe.length!==F.filter(Ae=>Ae.trim()).length&&(ue(!1),L(pe.length?pe:[""]))},H=()=>{const pe=Wo(F);pe.length!==0&&(pe.length!==F.filter(Ae=>Ae.trim()).length&&L(pe),o(pe,{role:n.join(", "),industry:c.join(", "),keywords:d.join(", "),sizeMin:g,sizeMax:b,remote:C}))},ae=(pe,Ae,Ee,ls,ss,$s,Xs)=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Ce,{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:pe}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 min-h-[34px] rounded-md border border-border/40 bg-card/40 px-2 py-1.5",children:[Ae.map((xs,de)=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-primary/15 border border-primary/30 px-2 py-0.5 text-xs text-foreground",children:[xs,e.jsx("button",{type:"button",onClick:()=>xe(Ae,Ee,de),className:"text-muted-foreground hover:text-destructive","aria-label":`Remove ${xs}`,children:e.jsx(zs,{className:"h-3 w-3"})})]},`${xs}-${de}`)),e.jsx("input",{value:ls,onChange:xs=>ss(xs.target.value),onKeyDown:xs=>{xs.key==="Enter"||xs.key===","?(xs.preventDefault(),E(Ae,Ee,ls,ss)):xs.key==="Backspace"&&!ls&&Ae.length&&Ee(Ae.slice(0,-1))},onBlur:()=>E(Ae,Ee,ls,ss),placeholder:Ae.length===0?$s:"",className:"flex-1 min-w-[100px] bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),Xs.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:Xs.filter(xs=>!Ae.some(de=>de.toLowerCase()===xs.toLowerCase())).slice(0,6).map(xs=>e.jsxs("button",{type:"button",onClick:()=>Ee([...Ae,xs]),className:"text-[10px] px-1.5 py-0.5 rounded bg-card/40 border border-border/40 text-muted-foreground hover:border-primary/40 hover:text-foreground transition-colors",children:["+ ",xs]},xs))})]});return e.jsxs("div",{className:"rounded-xl border border-primary/30 bg-primary/5 p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[e.jsx(ka,{className:"h-4 w-4 text-primary"}),"Build your LinkedIn search"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:Ne?"Public LinkedIn â each constraint becomes its own short query (role à industry). Multiple searches run in parallel and merge.":"Sales Navigator â role chips become individual title searches. Apply size & remote in Sales Nav's side filters after results load."})]}),e.jsx(h,{size:"sm",variant:"ghost",onClick:r,className:"h-7 px-2 text-xs",children:"Cancel"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[ae("Roles",n,l,y,N,"e.g. Founder, CTO, Head of AI",Tf),ae("Industry / focus",c,x,f,R,"e.g. AI, devtools, devops",Af)]}),Ne&&B&&e.jsxs("div",{className:"rounded-lg border border-primary/25 bg-card/40 p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs(Ce,{className:"text-[11px] uppercase tracking-wide text-muted-foreground flex items-center gap-1.5",children:[e.jsx(fa,{className:"h-3 w-3 text-primary"}),"Target companies in ",_f(B),$&&e.jsxs("span",{className:"text-foreground/70 normal-case font-normal",children:["· ",fe.length," seeded",S&&S!=="Any"&&e.jsxs("span",{className:"text-primary/80",children:[" · filtered to ",S," employees"]}),I>oe.length&&ce===!1&&!S&&e.jsxs("span",{className:"text-muted-foreground",children:[" · ",I," in catalog"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[$&&ce&&e.jsxs(h,{size:"sm",variant:"ghost",onClick:ee,className:"h-6 px-2 text-[10px] gap-1 text-muted-foreground hover:text-foreground",title:"Reset to the catalog default",children:[e.jsx(Dr,{className:"h-3 w-3"})," Reset"]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Seeding"}),e.jsx(Js,{checked:$,onCheckedChange:pe=>{be(pe),ue(!0)},"aria-label":"Toggle company seeding"})]})]})]}),$?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-[10px] text-muted-foreground -mt-1",children:['Each company below becomes its own LinkedIn search ("',n[0]||"Founder",'" + "',oe[0]||"Company",'"), so you find real people at recognizable employers instead of relying on a single industry token.']}),!ce&&e.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[e.jsx(Ce,{className:"text-[10px] uppercase tracking-wide text-muted-foreground shrink-0",children:"Seed count"}),e.jsx("input",{type:"range",min:10,max:Math.min(20,Math.max(10,I)),step:1,value:Y,onChange:pe=>O(Number(pe.target.value)),className:"flex-1 accent-primary","aria-label":"Number of companies to seed"}),e.jsx("span",{className:"text-xs font-mono text-foreground w-8 text-right",children:Y})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 min-h-[34px] rounded-md border border-border/40 bg-card/40 px-2 py-1.5",children:[oe.map((pe,Ae)=>{const Ee=Ho(B,pe);return e.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-primary/15 border border-primary/30 px-2 py-0.5 text-xs text-foreground",children:[pe,Ee&&e.jsxs("span",{className:"text-[9px] font-mono text-muted-foreground",children:["· ",Ee]}),e.jsx("button",{type:"button",onClick:()=>ke(Ae),className:"text-muted-foreground hover:text-destructive","aria-label":`Remove ${pe}`,children:e.jsx(zs,{className:"h-3 w-3"})})]},`${pe}-${Ae}`)}
62),e.jsx("input",{value:_,onChange:pe=>A(pe.target.value),onKeyDown:pe=>{pe.key==="Enter"||pe.key===","?(pe.preventDefault(),ne(_)):pe.key==="Backspace"&&!_&&oe.length&&(le(!0),T(oe.slice(0,-1)))},onBlur:()=>ne(_),placeholder:oe.length===0?"Add a company nameâ¦":"",className:"flex-1 min-w-[120px] bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),!ce&&I>oe.length&&e.jsx("div",{className:"flex flex-wrap gap-1",children:Go(B,I,{sizeMin:g,sizeMax:b}).filter(pe=>!oe.some(Ae=>Ae.toLowerCase()===pe.name.toLowerCase())).slice(0,8).map(pe=>{const Ae=Ho(B,pe.name);return e.jsxs("button",{type:"button",onClick:()=>ne(pe.name),className:"text-[10px] px-1.5 py-0.5 rounded bg-card/40 border border-border/40 text-muted-foreground hover:border-primary/40 hover:text-foreground transition-colors",children:["+ ",pe.name,Ae&&e.jsxs("span",{className:"ml-1 opacity-70",children:["· ",Ae]})]},pe.domain)})}),e.jsxs("div",{className:"pt-1",children:[e.jsxs("button",{type:"button",onClick:()=>re(pe=>!pe),className:"inline-flex items-center gap-1.5 text-[10px] uppercase tracking-wide text-muted-foreground hover:text-foreground transition-colors","aria-expanded":he,children:[e.jsx(Bt,{className:"h-3 w-3"}),"Preview ",Q.length," generated quer",Q.length===1?"y":"ies",he?e.jsx(Gt,{className:"h-3 w-3"}):e.jsx(nt,{className:"h-3 w-3"})]}),he&&e.jsx("div",{className:"mt-1.5 rounded-md border border-border/40 bg-background/40 p-2 max-h-48 overflow-auto space-y-1",children:Q.length===0?e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"No variants will be generated â add a role chip to seed the search."}):Q.map((pe,Ae)=>e.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px]",children:[e.jsxs("span",{className:"text-muted-foreground w-5 shrink-0",children:["#",Ae+1]}),e.jsx(Ks,{className:"h-3 w-3 text-muted-foreground shrink-0"}),e.jsx("span",{className:"text-foreground truncate",children:pe})]},Ae))})]})]}):e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Seeding is off â searches fall back to plain role à industry queries."})]}),ae("Tech / keywords (optional)",d,u,M,q,"e.g. LLM, Kubernetes, MLOps",If),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(Ce,{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:["Company size ",S&&e.jsxs("span",{className:"text-foreground/70 normal-case",children:["· ",S]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Uo.map(pe=>e.jsx("button",{type:"button",onClick:()=>ve(pe.min,pe.max),className:Z("px-2.5 py-1 rounded-md text-xs border transition-colors",pe.label===S?"bg-primary/20 border-primary/50 text-foreground":"bg-card/50 border-border/40 text-muted-foreground hover:border-primary/30"),children:pe.label},pe.label))}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(Je,{type:"number",min:0,value:g,onChange:pe=>v(pe.target.value),placeholder:"Min",className:"h-7 text-xs w-20"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"to"}),e.jsx(Je,{type:"number",min:0,value:b,onChange:pe=>z(pe.target.value),placeholder:"Max",className:"h-7 text-xs w-20"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"employees (post-filter)"})]}),e.jsxs("p",{className:"text-[10px] text-muted-foreground/80 italic pt-0.5",children:["Defaults to startups (1â200) â small teams reply faster. Click ",e.jsx("span",{className:"font-medium not-italic",children:"Any"})," to include large public companies."]})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg bg-card/40 border border-border/30 px-3 py-2",children:[e.jsxs("div",{children:[e.jsx(Ce,{className:"text-sm font-medium",children:"Remote-friendly only"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:Ne?"Adds 'remote' as a token in each query and post-filters results.":"Post-filters Sales Nav results to those mentioning remote."})]}),e.jsx(Js,{checked:C,onCheckedChange:j})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(Ce,{className:"text-[11px] uppercase tracking-wide text-muted-foreground flex items-center gap-1.5",children:["Generated queries (",F.filter(pe=>pe.trim()).length,"/",Ie,")",K&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-normal text-primary/80 normal-case",children:[e.jsx(es,{className:"h-2.5 w-2.5"})," auto-synced"]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[Oe.size>0&&e.jsxs(h,{size:"sm",variant:"ghost",onClick:We,className:"h-6 px-2 text-[10px] gap-1 text-amber-600 dar
62k:text-amber-400 hover:text-amber-700",title:`${Oe.size} near-duplicate quer${Oe.size===1?"y":"ies"} detected`,children:[e.jsx(es,{className:"h-3 w-3"})," Dedupe (",Oe.size,")"]}),!K&&e.jsxs(h,{size:"sm",variant:"ghost",onClick:()=>ue(!0),className:"h-6 px-2 text-[10px] gap-1",children:[e.jsx(es,{className:"h-3 w-3"})," Resync"]}),F.length<Ie&&e.jsxs(h,{size:"sm",variant:"ghost",onClick:se,className:"h-6 px-2 text-xs gap-1",children:[e.jsx(ft,{className:"h-3 w-3"})," Add query"]})]})]}),e.jsx("div",{className:"space-y-1.5",children:F.map((pe,Ae)=>{const Ee=Oe.has(Ae);return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground w-6 shrink-0",children:["#",Ae+1]}),e.jsx(Ks,{className:Z("h-3.5 w-3.5 shrink-0",Ee?"text-amber-500":"text-muted-foreground")}),e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Je,{value:pe,onChange:ls=>J(Ae,ls.target.value),placeholder:Ne?"Founder AI remote":"Founder",className:Z("h-8 text-sm font-mono",Ee&&"border-amber-500/50 bg-amber-500/5 focus-visible:ring-amber-500/30 pr-20")}),Ee&&e.jsx("span",{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[9px] font-medium uppercase tracking-wide text-amber-600 dark:text-amber-400",children:"near-dup"})]}),F.length>1&&e.jsx("button",{type:"button",onClick:()=>je(Ae),className:"text-muted-foreground hover:text-destructive p-1","aria-label":"Remove query",children:e.jsx(zs,{className:"h-3.5 w-3.5"})})]},Ae)})}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:Ne?"Each query runs as its own LinkedIn search. Results are merged and de-duplicated.":"Each query opens a Sales Nav search targeting the Title filter."})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[e.jsx(h,{size:"sm",variant:"ghost",onClick:r,children:"Cancel"}),e.jsxs(h,{size:"sm",onClick:H,disabled:F.filter(pe=>pe.trim()).length===0,className:"gap-1.5",children:[e.jsx(Ua,{className:"h-3.5 w-3.5"}),"Run ",F.filter(pe=>pe.trim()).length," search",F.filter(pe=>pe.trim()).length===1?"":"es"]})]})]})}async function pr(s){try{if(s.action==="edited"&&(!s.originalDraft||!s.editedDraft)||s.action==="edited"&&s.originalDraft===s.editedDraft)return;await w.functions.invoke("record-outreach-feedback",{body:{channel:s.channel,action:s.action,original_draft:s.originalDraft??null,edited_draft:s.editedDraft??null,prospect_context:s.prospectContext??null}})}catch{}}const Zi=new Set(["the","and","for","with","that","this","from","your","you","our","are","but","not","have","has","had","will","can","into","over","under","about","their","they","them","who","what","when","where","why","how","all","any","some","one","two","more","most","such","only","own","same","than","too","very","just","also","like","help","helps","make","makes","made","get","gets","getting","use","uses","using","used","build","building","built","need","needs","want","wants","find","finds","new","best","good","great","top","high","low","fast","easy","simple","powerful","modern","amazing","platform","tool","tools","solution","solutions","product","products","service","services","customer","customers","user","users","people","team","teams","business","businesses","company","companies","work","works","working","based","across","while","within","without","ideal","profile","value","proposition","benefits","name","including","include","includes","across","every","each","other","through","because","being","been","should","would","could","without","instead","really","actually"]),Hd=new Set(["http","https","www","com","html","link","links","bio","here","there","check","learn","read","watch","follow","share","comment","like","post","posts","posted","today","tomorrow","yesterday","week","weeks","month","months","year","years","monday","tuesday","wednesday","thursday","friday","saturday","sunday","january","february","march","april","june","july","august","september","october","november","december","thread","tweet","retweet","linkedin","twitter","facebook","instagram","going","gonna","wanna","really","just","know","think","thought","said","things","thing","stuff","lots","huge","tiny","small","big"]),eo=/[a-zA-Z][a-zA-Z0-9-]{3,}/g,Gd=/\bhttps?:\/\/\S+/gi;function Ef(s){if(!s)return[];
62const t=[s.product_name,s.value_proposition,s.benefits,s.ideal_customer_profile].filter(Boolean).join(" ").toLowerCase();if(!t.trim())return[];const a=new Map,r=t.match(eo)||[];for(const o of r){const n=o.toLowerCase();Zi.has(n)||a.set(n,(a.get(n)||0)+1)}return[...a.entries()].sort((o,n)=>n[1]-o[1]).slice(0,25).map(([o])=>o)}function Rf(s){if(!s||!s.length)return[];const t=s.map(o=>((o==null?void 0:o.content)||"").trim()).filter(Boolean).join(" ").replace(Gd," ").replace(/[@#]/g," ").toLowerCase();if(!t.trim())return[];const a=new Map,r=t.match(eo)||[];for(const o of r){const n=o.toLowerCase();Zi.has(n)||Hd.has(n)||a.set(n,(a.get(n)||0)+1)}return[...a.entries()].sort((o,n)=>n[1]-o[1]).slice(0,25).map(([o])=>o)}function Yo(s,t=25){if(!s||!s.length)return[];const a=s.map(n=>(n||"").trim()).filter(Boolean).join(" ").replace(Gd," ").replace(/[@#]/g," ").toLowerCase();if(!a.trim())return[];const r=new Map,o=a.match(eo)||[];for(const n of o){const l=n.toLowerCase();Zi.has(l)||Hd.has(l)||r.set(l,(r.get(l)||0)+1)}return[...r.entries()].sort((n,l)=>l[1]-n[1]).slice(0,t).map(([n])=>n)}function Ko(...s){const t=new Map;for(const a of s)if(a)for(let r=0;r<a.length;r++){const o=a[r];if(!o)continue;const n=t.get(o);(n===void 0||r<n)&&t.set(o,r)}return[...t.entries()].sort((a,r)=>a[1]-r[1]).slice(0,40).map(([a])=>a)}function Pf(s){if(!s)return"";const t=[];for(const r of["title","company","headline","about","bio","summary","description","snippet"]){const o=s[r];typeof o=="string"&&o.trim()&&t.push(o)}const a=s.web_snippets;if(Array.isArray(a))for(const r of a)r&&typeof r.snippet=="string"&&t.push(r.snippet);for(const r of["recent_posts","posts"]){const o=s[r];if(Array.isArray(o))for(const n of o)typeof n=="string"?t.push(n):n&&typeof n=="object"&&(typeof n.text=="string"&&t.push(n.text),typeof n.content=="string"&&t.push(n.content),typeof n.body=="string"&&t.push(n.body))}return t.join(" ").toLowerCase()}function Ud(s,t=[]){if(!s)return!1;const r=s.trim().match(/"([^"]+)"/g)||[],o=new Set(t.map(n=>n.toLowerCase().trim()));for(const n of r){const l=n.slice(1,-1).toLowerCase().trim();if(o.has(l))return!1}return!0}function Mf(s,t){const{domainKeywords:a,wildcardVariants:r,targetCompanies:o=[]}=t;if(!s.length||!a.length)return s;const n=[],l=[];for(const c of s){const x=(c.sourceVariant||"").trim(),d=typeof c.isWildcardSource=="boolean"?c.isWildcardSource:r?r.has(x):Ud(x,o),u=Pf(c),m=a.some(p=>u.includes(p));c.isWildcardSource=d,c.domainMatch=m,d&&!m?l.push(c):n.push(c)}return[...n,...l]}const Xo=["first_name","last_name","full_name","company","role","industry","city"],Df=kx({channel:Sx(["auto","email","dm"]),tones:no(Lr()).max(4),subject:Lr().trim().max(140,"Keep subject under 140 chars"),body:Lr().trim().min(20,"Body must be at least 20 characters").max(2e3,"Body must stay under 2000 chars"),variables:no(Lr()).max(8)}),Of=[{value:"friendly",label:"Friendly",hint:"Casual and warm"},{value:"formal",label:"Formal",hint:"Professional, buttoned-up"},{value:"direct",label:"Direct",hint:"No fluff, get to the point"},{value:"warm",label:"Warm",hint:"Empathetic, human"},{value:"short",label:"Short",hint:"Aim for 2â3 sentences"},{value:"longer",label:"Longer",hint:"Allow 4â6 sentences"}];function Ff({open:s,onOpenChange:t,intent:a,initial:r,onApprove:o}){const[n,l]=i.useState((r==null?void 0:r.channel)??"auto"),[c,x]=i.useState((r==null?void 0:r.tones)??["friendly","short"]),[d,u]=i.useState((r==null?void 0:r.subject)??""),[m,p]=i.useState((r==null?void 0:r.body)??""),[g,v]=i.useState((r==null?void 0:r.variables)??["first_name","company"]),[b,z]=i.useState(!1),[C,j]=i.useState(!!r),[y,N]=i.useState({});i.useEffect(()=>{s&&!r?(j(!1),u(""),p(""),N({}),f()):s&&r&&(l(r.channel),x(r.tones),u(r.subject),p(r.body),v(r.variables),j(!0))},[s]);const f=async()=>{z(!0),N({});try{const{data:P,error:I}=await w.functions.invoke("draft-outreach-template",{body:{intent:a,channel:n,tones:c,variables:g}});if(I)throw I;if(P!=null&&P.error)throw new Error(P.error);u((P==null?void 0:P.subject)??""),p((P==null?void 0:P.body)??""),j(!0)}catch(P){k.error((P==null?void 0:P.message)||"Couldn't generate draft")}finally{z(!1)}},R=P=>{x(I=>I.includes(P)?I.filter($=>$!==P):[...I,P])},M=P=>{Xo.includes(P)&&(g.includes(P)||v([...g,P]))},q=P=>v(g.filter(I=>I!==P)),_=P=>{const I=`{{${P}}}`;p($=>$.endsWith(" ")||$.length===0?`${$}${I}`:`${$} ${I}`)},A=()=>{var I;const P=Df.safeParse({channel:n,tones:c,subject:d,body:m,variables:g});if(!P.success){const $={};for(const be of P.error.issues){const Y=((I=be.path[0])==null?void 0:I.toString())||"form";$[Y]=be.message}N($),k.error("Fix the highlighted fields before continuing");return}N({}),o(P.data),t(!1)},B=i.useMemo(()=>{const P={first_name:"Alex",last_name:"Chen",full_name:"Alex Chen",company:"Acme",role:"Head of Marketing",industry:"fintech",city:"Berlin"};return m.replace(/\{\{(\w+)\}\}/g,(I,$)=>P[$]??`{{${$}}
62}`)},[m]);return e.jsx(gt,{open:s,onOpenChange:t,children:e.jsxs(dt,{className:"max-w-3xl max-h-[90vh] flex flex-col",children:[e.jsxs(mt,{children:[e.jsxs(xt,{className:"flex items-center gap-2",children:[e.jsx(Oi,{className:"h-4 w-4 text-primary"}),"Review your outreach template"]}),e.jsxs(Mt,{children:["Edit how this message reads ",e.jsx("span",{className:"font-medium text-foreground",children:"before"})," Cold Reach starts looking up emails or DMs. Personalization tokens get filled in per prospect."]})]}),e.jsx(jt,{className:"flex-1 -mx-6 px-6",children:e.jsxs("div",{className:"space-y-5 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Channel preference"}),e.jsx(Ct,{value:n,onValueChange:P=>l(P),children:e.jsxs(wt,{className:"grid w-full grid-cols-3",children:[e.jsxs(cs,{value:"auto",className:"gap-1.5",children:[e.jsx(es,{className:"h-3.5 w-3.5"})," Auto"]}),e.jsxs(cs,{value:"email",className:"gap-1.5",children:[e.jsx(Fs,{className:"h-3.5 w-3.5"})," Email only"]}),e.jsxs(cs,{value:"dm",className:"gap-1.5",children:[e.jsx(ms,{className:"h-3.5 w-3.5"})," DM only"]})]})}),e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[n==="auto"&&"Cold Reach picks email or LinkedIn DM per prospect based on what's available.",n==="email"&&"Only contact prospects we can reach by email. Skip everyone else.",n==="dm"&&"Only contact prospects via LinkedIn DM. Subject line will be hidden."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Tone & style"}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[Of.map(P=>{const I=c.includes(P.value);return e.jsx("button",{type:"button",onClick:()=>R(P.value),title:P.hint,className:Z("text-xs px-2.5 py-1 rounded-full border transition-colors",I?"bg-primary/10 border-primary/40 text-primary":"bg-muted/40 border-border/40 text-muted-foreground hover:bg-muted/60"),children:P.label},P.value)}),e.jsxs(h,{type:"button",size:"sm",variant:"ghost",className:"h-7 gap-1.5 text-xs ml-1",onClick:f,disabled:b,children:[b?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):e.jsx(st,{className:"h-3 w-3"}),"Re-draft with these"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Personalization tokens"}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[g.map(P=>e.jsxs(W,{variant:"secondary",className:"gap-1 pr-1 cursor-pointer",onClick:()=>_(P),title:"Click to insert into body",children:[`{{${P}}}`,e.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),q(P)},className:"ml-0.5 rounded hover:bg-destructive/20 p-0.5","aria-label":`Remove ${P}`,children:e.jsx(zs,{className:"h-2.5 w-2.5"})})]},P)),Xo.filter(P=>!g.includes(P)).map(P=>e.jsxs(W,{variant:"outline",className:"gap-1 cursor-pointer hover:bg-muted/40",onClick:()=>M(P),children:[e.jsx(ft,{className:"h-2.5 w-2.5"})," ",P]},P))]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Click an active token to insert it into the body. Each prospect's real values replace it at send time."})]}),n!=="dm"&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Ce,{htmlFor:"cr-subject",className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Subject"}),e.jsx(Je,{id:"cr-subject",value:d,onChange:P=>u(P.target.value),placeholder:"Quick question about {{company}}",maxLength:140,disabled:b}),y.subject&&e.jsx("p",{className:"text-[11px] text-destructive",children:y.subject}),e.jsxs("p",{className:"text-[10px] text-muted-foreground text-right",children:[d.length,"/140"]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Ce,{htmlFor:"cr-body",className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Message body"}),e.jsx(Vs,{id:"cr-body",value:m,onChange:P=>p(P.target.value),placeholder:b?"Draftingâ¦":"Hi {{first_name}}, â¦",className:"min-h-[160px] resize-y font-sans text-sm",maxLength:2e3,disabled:b}),y.body&&e.jsx("p",{className:"text-[11px] text-destructive",children:y.body}),e.jsxs("p",{className:"text-[10px] text-muted-foreground text-right",children:[m.length,"/2000"]})]}),m.trim().length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(Ce,{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide flex items-center gap-1.5",children:[e.jsx(Bt,{className:"h-3 w-3"})," Live preview (sample values)"]}),e.jsxs("div",{className:"rounded-md border border-border/40 bg-muted/30 p-3 text-sm whitespace-pre-wrap leading-relaxed",children:[n!=="dm"&&d&&e.jsx("p",{className:"font-medium mb-2 text-foreground",children:d.replace(/\{\{(\w+)\}\}/g,(P,I)=>({first_name:"Alex",last_name:"Chen",full_name:"Alex Chen",company:"Acme",role:"Head of Marketing",industry:"fintech",city:"Berlin"})[I]??`{{${I}}}`)}
62),e.jsx("p",{className:"text-foreground/90",children:B})]})]})]})}),e.jsxs(Ft,{className:"gap-2 sm:gap-2",children:[e.jsx(h,{variant:"outline",onClick:()=>t(!1),disabled:b,children:"Cancel"}),e.jsxs(h,{variant:"ghost",onClick:f,disabled:b,className:"gap-1.5",children:[b?e.jsx(Pe,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(st,{className:"h-3.5 w-3.5"}),"Regenerate"]}),e.jsxs(h,{onClick:A,disabled:b||!C||m.trim().length<20,className:"gap-1.5",children:[e.jsx(es,{className:"h-3.5 w-3.5"}),"Approve & start outreach"]})]})]})})}const Wd=["Find marketing leads at Stripe, Figma, and Notion","Search for CTOs at Series A fintech startups","Find sales leaders at companies like HubSpot and Salesforce","Get me founders at AI startups who recently posted on LinkedIn"];function Bf(s){if(!(s!=null&&s.product_name)||!(s!=null&&s.ideal_customer_profile))return Wd;const t=s.ideal_customer_profile,a=s.product_name,r=/\b(CTO|CEO|CMO|COO|CFO|VP|director|head|manager|founder|leader|engineer|developer|marketer|sales|growth|product|operations|HR|recruiter)\b/gi,o=[...new Set((t.match(r)||[]).map(v=>v.charAt(0).toUpperCase()+v.slice(1).toLowerCase()))],n=o[0]||"decision makers",l=o[1]||"founders",c=/\b(SaaS|fintech|healthtech|edtech|e-commerce|ecommerce|AI|machine learning|blockchain|crypto|cybersecurity|martech|adtech|proptech|insurtech|biotech|medtech|cleantech|agritech|legaltech|regtech|govtech|logistics|retail|B2B|B2C|enterprise|startup|SMB|agency|consulting)\b/gi,x=[...new Set((t.match(c)||[]).map(v=>v))],d=x[0]||"tech",u=x[1]||"startups",m=/\b(seed|series [A-D]|early[- ]stage|growth[- ]stage|enterprise|Fortune 500|mid[- ]market|SMB|small business)\b/gi,g=(t.match(m)||[])[0]||"Series A";return[`Find ${n}s at ${g} ${d} companies`,`Search for ${l} at ${u} who recently posted on LinkedIn`,`Get me ${n}s at companies that could use ${a}`,`Find ${l}s in ${d} ${u} with 10-200 employees`]}const ci=[{icon:Ks,text:"Discovering matching companies...",delay:0},{icon:fa,text:"Searching for contacts...",delay:3e3},{icon:Cx,text:"Enriching top prospects...",delay:8e3},{icon:ws,text:"Scoring and ranking matches...",delay:13e3},{icon:Fs,text:"Preparing outreach channels...",delay:18e3},{icon:ws,text:"Almost there â finalizing best matches...",delay:23e3}];function $f({userId:s,isPaidUser:t=!1}){const[a,r]=i.useState([]),[o,n]=i.useState(""),[l,c]=i.useState(!1),[x,d]=i.useState(null),[u,m]=i.useState([]),[p,g]=i.useState(!1),[v,b]=i.useState(new Set),[z,C]=i.useState(new Set),[j,y]=i.useState(new Set),[N,f]=i.useState(0),[R,M]=i.useState(Wd),[q,_]=i.useState("discover"),[A,B]=i.useState(null),[P,I]=i.useState(25),[$,be]=i.useState(()=>typeof window>"u"?"public":localStorage.getItem("coldReach.searchMode")||"public"),[Y,O]=i.useState(null),[he,re]=i.useState(null),[oe,T]=i.useState(null),[ce,le]=i.useState(!1),[F,L]=i.useState(null),K=i.useRef(null),ue=i.useRef(null),Ne=i.useRef([]),fe=i.useRef(null),me=i.useRef([]);i.useEffect(()=>{(async()=>{const[{data:te},{data:X},{data:ie}]=await Promise.all([w.from("product_profiles").select("product_name, ideal_customer_profile, value_proposition, benefits, common_objections, tone_guidelines").eq("user_id",s).maybeSingle(),w.from("scheduled_posts").select("content").eq("user_id",s).in("status",["posted","scheduled"]).order("updated_at",{ascending:!1}).limit(50),w.from("media_library").select("description, file_name").eq("user_id",s).order("created_at",{ascending:!1}).limit(50)]);te&&M(Bf(te));const _e=te?Ef(te):[],Me=Rf(X||[]);let Ge=[];if(Me.length===0){const Fe=(ie||[]).flatMap(As=>[As==null?void 0:As.description,As==null?void 0:As.file_name]),He=Yo(Fe),ts=te?Yo([te.ideal_customer_profile,te.value_proposition,te.benefits,te.common_objections,te.tone_guidelines]):[];Ge=Ko(He,ts),`${He.length}${ts.length}`}const G=Ko(_e,Me,Ge);me.current=G})()},[s]),i.useEffect(()=>{Ie()},[]),i.useEffect(()=>{K.current&&(K.current.scrollTop=K.current.scrollHeight)},[a,l,N]),i.useEffect(()=>(l?(f(0),Ne.current.forEach(D=>clearTimeout(D)),Ne.current=[],ci.forEach((D,te)=>{if(te>0){const X=setTimeout(()=>f(te),D.delay);Ne.current.push(X)}})):(Ne.current.forEach(D=>clearTimeout(D)),Ne.current=[]),()=>{Ne.current.forEach(D=>clearTimeout(D))}),[l]);const Ie=async()=>{const{data:D}=await w.from("cold_reach_conversations").select("id, title, created_at, messages").eq("user_id",s).order("updated_at",{ascending:!1}).limit(20);D&&m(D.map(te=>({...te,messages:te.messages||[]})))},Q=async()=>{const{data:D}=await w.from("cold_reach_conversations").insert({user_id:s,title:"New Search",messages:[]}).select("id").single();D&&(d(D.id),r([]),b(new Set),C(new Set),y(new Set),g(!1))},ne=D=>{d(D.id),r(D.messages),b(new Set),C(new Set),y(new Set),g(!1)},ke=async(D,te)=>{te.stopPropagation(),await w.from("cold_reach_conversations").delete().eq("id",D),m(X=>X.filter(ie=>ie.id!==D)),x===D&&(d(null),r([]))},ee=i.useCallback(async D=>{var Ue,vs,Qs;if(!D.trim()||l)return;const te={role:"user",content:D.trim()},X=[...a,te];r(X),n(""),c(!0),O({phase:"Starting searchâ¦",percent:5,source:null,companies:[],prospects:[]});let ie=x;if(ie)await w.from("cold_reach_conversations").update({messages:X}).eq("id",ie);else{const V=D.trim().substring(0,60),{data:we}=await w.from("cold_reach_conversations").insert({user_id:s,title:V,messages:[te]}).select("id").single();we&&(ie=we.id,d(we.id))}let _e,Me,Ge=!1;const G=/\b(find|search|get|show|look(?:ing)? for|who('?s| is)|prospects?|leads?|contacts?|people|founders?|ceos?|ctos?|cmos?|vps?|directors?|managers?|engineers?|marketers?|sales|companies)\b/i.test(D),Fe=V=>{const we=V.toLowerCase(),De=[[/\b(co[-\s]?founder)s?\b/g,'"Co-Founder"'],[/\b(vp|vice president) of (\w+)/g,'"VP $2"'],[/\bhead of (\w+)/g,'"Head of $1"'],[/\bchief (\w+) officer\b/g,'"Chief $1 Officer"'],[/\bdirector of (\w+)/g,'"Director of $1"']],Re="(manager|managers|lead|leads|specialist|specialists|strategist|strategists|marketer|marketers|director|directors|coordinator|coordinators|executive|executives|representative|representatives|rep|reps|engineer|engineers|designer|designers|analyst|analysts)",Le=new RegExp(`\\b(social media|community|content|growth|product|brand|marketing|sales|partnerships|partnership|operations|o
62ps|people|talent|engineering|customer success|customer support|business development|biz dev|account|paid|seo|email|influencer|creator|developer|developer relations|devrel|public relations|pr|demand generation|demand gen|revenue|finance|data|design|ux|ui)\\s+${Re}\\b`,"gi"),Ke=Ms=>Ms.toLowerCase().replace(/\b[a-z]/g,as=>as.toUpperCase()),qe=Ms=>Ms.replace(/s$/i,""),ds=new Set;De.forEach(([Ms,as])=>{let Os;const vt=new RegExp(Ms.source,Ms.flags);for(;Os=vt.exec(we);){const Jt=as.replace(/\$(\d)/g,(dr,Yr)=>Os[Number(Yr)]||"").replace(/[a-z]+/g,dr=>dr[0].toUpperCase()+dr.slice(1));ds.add(Jt)}});let hs;for(;hs=Le.exec(we);){const Ms=hs[1].trim(),as=qe(hs[2].trim()),Os=`${Ke(Ms)} ${Ke(as)}`;ds.add(`"${Os}"`)}const js=new RegExp(`\\b([a-z]{3,})\\s+${Re}\\b`,"gi");let Bs;for(;Bs=js.exec(we);){const Ms=Bs[1].trim(),as=qe(Bs[2].trim()),vt=`"${`${Ke(Ms)} ${Ke(as)}`}"`;["the","any","all","best","top","good","some","their","our","your","his","her"].includes(Ms)||[...ds].some(aa=>aa.toLowerCase()===vt.toLowerCase())||ds.add(vt)}const et=/\b(founders?|ceos?|ctos?|cmos?|cfos?|coos?|cpos?|cros?|vps?|owners?|recruiters?|marketers?)\b/g;let Se;for(;Se=et.exec(we);){const Ms=Se[1].replace(/s$/,"");ds.add(Ms.length<=4?Ms.toUpperCase():Ms[0].toUpperCase()+Ms.slice(1))}const Is={saas:"SaaS",fintech:"fintech",devtools:"devtools",martech:"martech",adtech:"adtech",proptech:"proptech",insurtech:"insurtech",healthtech:"healthtech",edtech:"edtech",biotech:"biotech",cybersecurity:"cybersecurity",crypto:"crypto",blockchain:"blockchain",gaming:"gaming",logistics:"logistics",ecommerce:"ecommerce",ai:"AI",ml:"ML"},Xe=new Set;for(const[Ms,as]of Object.entries(Is))new RegExp(`\\b${Ms}\\b`,"i").test(we)&&Xe.add(as);/\be-?commerce\b/i.test(we)&&Xe.add("ecommerce");const Pt=[[/\bunited states\b/i,'"United States"'],[/\bsan francisco\b/i,'"San Francisco"'],[/\bnew york\b/i,'"New York"'],[/\blos angeles\b/i,'"Los Angeles"'],[/\bbay area\b/i,'"Bay Area"'],[/\bunited kingdom\b/i,'"United Kingdom"']],It=/\b(usa|uk|europe|asia|canada|australia|germany|france|india|israel|london|berlin|paris|toronto|remote)\b/i,ut=new Set;Pt.forEach(([Ms,as])=>{Ms.test(we)&&ut.add(as)});const Ds=we.match(It);Ds&&ut.add(Ds[1][0].toUpperCase()+Ds[1].slice(1));const Ye=new Set,Qe=we.match(/\bseries\s+([a-e])\b/i);Qe&&Ye.add(`"Series ${Qe[1].toUpperCase()}"`),/\bpre[-\s]?seed\b/i.test(we)?Ye.add('"pre-seed"'):/\bseed\b/i.test(we)&&Ye.add("seed"),/\bbootstrapped\b/i.test(we)&&Ye.add("bootstrapped");const ps=new Set(["find","search","get","show","me","please","can","you","could","would","for","at","in","on","of","the","a","an","and","or","to","with","that","who","is","are","be","i","want","need","like","some","any","all","my","our","their","decision","makers","maker","people","contacts","prospects","leads","list","give","good","best","looking","help","companies","company","startup","startups","employees","keywords","artificial","intelligence","machine","learning","deep","neural","networks","developer","tools","infrastructure","devops","enterprise","software","business","solution","b2b","b2c","tech","technology","firms","using","manager","managers","lead","leads","specialist","specialists","strategist","strategists","marketer","marketers","director","directors","coordinator","coordinators","executive","executives","representative","representatives","rep","reps","social","media"]),Ps=(we.match(/\b[a-z]{3,}\b/g)||[]).filter(Ms=>!ps.has(Ms)&&!ds.has(Ms)&&!Xe.has(Ms.toLowerCase())).slice(0,2);return{roles:[...ds],industries:[...Xe],geos:[...ut],stages:[...Ye],freeform:Ps}},He=(V,we)=>{const De=js=>(js||"").replace(/^"|"$/g,""),Re=V.roles.length?V.roles:[],Le=V.industries.length?V.industries:[],Ke=De(V.stages[0]),qe=[],ds=new Set,hs=js=>{const Bs=js.filter(Boolean).map(Is=>Is.trim()).filter(Boolean);if(!Bs.length)return;const et=Bs.slice(0,3).join(" "),Se=et.toLowerCase();ds.has(Se)||et.length>60||(ds.add(Se),qe.push(et))};if(Re.length&&Le.length){e:for(const js of Re)for(const Bs of Le)if(hs([js,Bs]),qe.length>=4)break e}else Re.length?Re.slice(0,4).forEach(js=>hs([js,V.freeform[0]])):Le.length&&Le.slice(0,4).forEach(js=>hs([js,V.freeform[0]]));if(Ke&&Re[0]&&qe.length<4&&hs([Re[0],Ke]),qe.length===0){const js=[Re[0],Le[0],Ke,V.freeform[0]].filter(
62Boolean);js.length>=1?qe.push(js.slice(0,3).join(" ")):qe.push(we.split(/\s+/).slice(0,3).join(" "))}return qe.slice(0,4)},ts=(V,we)=>{const De=[],Re=new Set,Le=Ke=>{if(!Ke)return;const qe=Ke.trim();!qe||Re.has(qe.toLowerCase())||qe.length>60||(Re.add(qe.toLowerCase()),De.push(qe))};return V.roles.slice(0,4).forEach(Le),De.length===0&&(Le(V.industries[0]),Le(V.freeform[0])),De.length===0&&Le(we.split(/\s+/).slice(0,4).join(" ")),De.slice(0,4)},As=(V,we)=>{const De=Fe(V);return we==="sales_nav"?ts(De,V):He(De,V)},ge=(V=>{const we=V.toLowerCase().replace(/_/g," "),De=/\b(founder|co-?founder|ceo|cto|cmo|cfo|coo|cpo|cro|vp|svp|evp|director|head of|chief|c-?level|c-?suite|executive|exec|owner|principal|partner|manager|lead|engineer|designer|sales|marketing|product|growth|recruiter|technical lead|decision maker)\b/i.test(we),Re=/\b(saas|fintech|ai|ai tech|deep tech|web ?3|healthtech|edtech|e-?commerce|consumer|b2b|b2c|crypto|blockchain|defi|nft|dao|cybersecurity|devtools|martech|adtech|proptech|insurtech|biotech|medtech|cleantech|legaltech|hrtech|logistics|gaming|media|tokenomics|smart contracts?|ethereum)\b/i.test(we),Le=/\b(united states|us|usa|uk|europe|eu|apac|asia|india|germany|france|canada|australia|new york|san francisco|london|berlin|remote|global|north america|south america|latam|emea)\b/i.test(we),Ke=/\b(seed|series [a-z]|pre-?seed|bootstrapped|funded|growth stage|early stage|early|growth|scaleup|enterprise|startup|smb|1-?10|11-?50|51-?200|1-?50)\b/i.test(we),qe=/\[keywords:\s*[^\]]+\]/i.test(we);return[De,Re,Le,Ke,qe].filter(Boolean).length<2})(D);if(G&&!ge){const V=Fe(D),we=As(D,$),De={role:V.roles.map(Le=>Le.replace(/"/g,"")).join(", "),industry:V.industries.join(", "),keywords:V.freeform.join(", "),sizeMin:"",sizeMax:"",remote:/\bremote\b/i.test(D)};if(await qn(1500)){const{variants:Le,filters:Ke}=await new Promise((as,Os)=>{fe.current=async(vt,aa)=>{as({variants:vt,filters:aa})},re({text:D,variants:we,filters:De}),fe.cancel=()=>Os(new Error("USER_CANCELLED"))}).catch(as=>{if((as==null?void 0:as.message)==="USER_CANCELLED")return null;throw as});if(!Le){c(!1),O(null),r(a);return}const qe=Le.map(as=>as.trim()).filter(Boolean).map(as=>{const Os=as.toLowerCase();return Ke.remote&&$==="public"&&!/\bremote\b/.test(Os)&&(as=`${as} remote`.slice(0,70)),as.split(/\s+/).filter(Boolean).slice(0,6).join(" ").slice(0,70)}).filter(Boolean),ds=qe.length?qe:we,hs=new Map,js=as=>(as.profile_url||`${as.name}|${as.company}`).split("?")[0].toLowerCase();let Bs=!1,et,Se=0;const Is=Math.min(50,Math.ceil(P/ds.length)+5);k.info(`Scanning LinkedIn ${$==="sales_nav"?"Sales Navigator":"Public"} â ${ds.length} search${ds.length===1?"":"es"}â¦`);let Xe=0;const Pt=6;for(let as=0;as<ds.length;as++){const Os=ds[as];O(aa=>({...aa??{companies:[],prospects:[]},phase:`LinkedIn (${as+1}/${ds.length}): ${Os} â ${hs.size} so far`,percent:15+Math.floor(as/ds.length*25),source:"extension",companies:(aa==null?void 0:aa.companies)??[],prospects:[...hs.values()].slice(0,12).map(Jt=>({name:Jt.name,title:Jt.title,company:Jt.company,photoUrl:Jt.photo_url,profileUrl:Jt.profile_url||Jt.profileUrl||Jt.linkedin_url||Jt.linkedinUrl}))}));let vt=await Bo(Os,Is,6e4,$);if(!vt.success&&!vt.authWall&&((Ue=vt.error)!=null&&Ue.toLowerCase().includes("timed out")||!((vs=vt.prospects)!=null&&vs.length)&&vt.error)&&(vt=await Bo(Os,Is,6e4,$)),vt.authWall){Bs=!0;break}if(vt.success){Se++;const aa=Ud(Os),Jt=((Qs=vt.prospects)==null?void 0:Qs.length)||0;for(const dr of vt.prospects||[]){const Yr=js(dr);hs.has(Yr)||hs.set(Yr,{...dr,sourceVariant:Os,isWildcardSource:aa})}Jt===0?Xe++:Xe=0}else et=vt.error,Xe++;if(hs.size>=P||hs.size===0&&Xe>=Pt)break}const It=parseInt(Ke.sizeMin||"0",10)||0,ut=parseInt(Ke.sizeMax||"0",10)||0,Ds=It>0||ut>0,Ye=[...hs.values()].filter(as=>{if(Ke.remote){const Os=`${as.title||""} ${as.company||""}`.toLowerCase();if(!/remote/.test(Os))return!1}if(Ds&&as.companySize){const Os=parseInt(String(as.companySize).replace(/\D/g,""),10);if(Number.isFinite(Os)&&(It>0&&Os<It||ut>0&&Os>ut))return!1}return!0}),Qe=Mf(Ye,{domainKeywords:me.current});
62Qe.filter(as=>as.isWildcardSource&&as.domainMatch===!1).length>0&&me.current.length>0;const Ps=Qe.slice(0,P),Ms=(as,Os=[])=>{r(vt=>[...vt,{role:"assistant",content:as,tool_results:[],suggestions:Os}])};if(Bs&&Ps.length===0){const as="LinkedIn is asking me to sign in. Open linkedin.com in another tab, log in, then retry your search.";k.warning(as,{action:{label:"Retry extension",onClick:()=>ee(D)},duration:8e3}),Ms(as,["Retry search","Use different keywords"]),c(!1),O(null);return}else if(Ps.length>0)_e=Ps,Me=D.trim(),O(as=>({...as??{companies:[],prospects:[]},phase:`Pulled ${Ps.length} prospects from ${Se} LinkedIn search${Se===1?"":"es"}`,percent:45,source:"extension",companies:(as==null?void 0:as.companies)??[],prospects:Ps.slice(0,12).map(Os=>({name:Os.name,title:Os.title,company:Os.company,photoUrl:Os.photo_url,profileUrl:Os.profile_url||Os.profileUrl||Os.linkedin_url||Os.linkedinUrl}))})),k.success(`Pulled ${Ps.length} prospects from LinkedIn (${Se} search${Se===1?"":"es"})`);else if(Se>0){const as=`I searched LinkedIn across ${Se} variant${Se===1?"":"s"} but found 0 matching prospects. Try narrowing the role (e.g. "Head of Growth" instead of "marketer"), pinning a specific industry, or adding a geography.`;k.info("No LinkedIn matches â refine the role, industry, or geography."),Ms(as,["Try a more specific role","Add a target industry","Add a city or country"]),c(!1),O(null);return}else if(et){const as=`Extension error: ${et}. Make sure the deSHILLER extension is installed and you're logged into LinkedIn, then retry.`;k.error(as,{action:{label:"Retry extension",onClick:()=>ee(D)},duration:8e3}),Ms(as,["Retry search"]),c(!1),O(null);return}else{const as="I couldn't reach LinkedIn through the extension. Install/enable the deSHILLER extension, sign in to LinkedIn, then try again.";k.error(as),Ms(as,["Retry search","Install extension"]),c(!1),O(null);return}}else{k.error("Install the deSHILLER extension and log into LinkedIn to search prospects.",{action:{label:"Install extension",onClick:()=>window.open("/install-extension","_blank")},duration:1e4}),c(!1),O(null),r(a);return}}try{const V="https://iqikbtfdddpbyxpztpbh.supabase.co",we="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImlxaWtidGZkZGRwYnl4cHp0cGJoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ0MDY4OTUsImV4cCI6MjA3OTk4Mjg5NX0.Ousbd6qOJMMRzWXeihaGZ0Lm_itZUKN3n2GKVujYEiQ",{data:{session:De}}=await w.auth.getSession(),Re=De==null?void 0:De.access_token,Le=await fetch(`${V}/functions/v1/cold-reach-agent`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${Re||we}`,apikey:we},body:JSON.stringify({messages:X.map(qe=>({role:qe.role,content:qe.content})),conversation_id:ie,stream:!0,extension_prospects:_e,extension_prospect_query:Me,prospect_limit:P,force_firecrawl:Ge})});if(!Le.ok){const qe=await Le.json().catch(()=>({error:"Request failed"}));k.error(qe.error||"Failed to get response"),c(!1);return}if((Le.headers.get("Content-Type")||"").includes("text/event-stream")&&Le.body){const qe=Le.body.getReader(),ds=new TextDecoder;let hs="";const js=[];let Bs=!1;const et={role:"assistant",content:"",tool_results:[],suggestions:[]};r(Se=>[...Se,et]);try{for(;!Bs;){let Se;
62try{Se=await qe.read()}catch{r(ut=>{const Ds=[...ut],Ye=Ds.length-1;if(Ye>=0&&Ds[Ye].role==="assistant"){const Qe=js.length>0;Ds[Ye]={...Ds[Ye],content:Qe?`Found ${js.length} prospects (connection interrupted â showing partial results)`:"Connection was interrupted. Please try again.",tool_results:Qe?[{tool:"search_prospects",status:"success",count:js.length,prospects:[...js]}]:Ds[Ye].tool_results,suggestions:["Try again","Simplify query"]}}return Ds});break}const{done:Is,value:Xe}=Se;if(Is)break;hs+=ds.decode(Xe,{stream:!0});let Pt;for(;(Pt=hs.indexOf(` 63`))!==-1;){const It=hs.slice(0,Pt).trim();if(hs=hs.slice(Pt+1),!It.startsWith("data: "))continue;const ut=It.slice(6).trim();if(!(!ut||ut==="[DONE]"))try{const Ds=JSON.parse(ut);if(Ds.type==="companies_generated"){const Ye=Ds.companies||[];O(Qe=>({phase:`Identified ${Ds.count} target companies`,percent:30,source:(Qe==null?void 0:Qe.source)??"agent",companies:Ye.slice(0,20),prospects:(Qe==null?void 0:Qe.prospects)??[]})),r(Qe=>{const ps=[...Qe],Ps=ps.length-1;return Ps>=0&&ps[Ps].role==="assistant"&&(ps[Ps]={...ps[Ps],content:`Found ${Ds.count} target companies: ${Ye.slice(0,5).join(", ")}...`}),ps})}else if(Ds.type==="domains_resolved")O(Ye=>({...Ye??{companies:[],prospects:[]},phase:`Resolved ${Ds.count} company domains`,percent:45,source:(Ye==null?void 0:Ye.source)??"agent",companies:(Ye==null?void 0:Ye.companies)??[],prospects:(Ye==null?void 0:Ye.prospects)??[]})),r(Ye=>{const Qe=[...Ye],ps=Qe.length-1;return ps>=0&&Qe[ps].role==="assistant"&&(Qe[ps]={...Qe[ps],content:`Resolved ${Ds.count} company domains. Finding employees...`}),Qe});else if(Ds.type==="prospect"){js.push(Ds.prospect);const Ye=Math.max(P,10),Qe=Math.min(90,50+Math.round(js.length/Ye*40));O(ps=>({...ps??{companies:[],prospects:[]},phase:`Found ${js.length} prospect${js.length!==1?"s":""}â¦`,percent:Qe,source:(ps==null?void 0:ps.source)??"agent",companies:(ps==null?void 0:ps.companies)??[],prospects:js.slice(-12).map(Ps=>({name:Ps.name||Ps.full_name||"Unknown",title:Ps.title||Ps.position,company:Ps.company||Ps.organization}))}
63)),r(ps=>{const Ps=[...ps],Ms=Ps.length-1;return Ms>=0&&Ps[Ms].role==="assistant"&&(Ps[Ms]={...Ps[Ms],content:`Found ${js.length} prospect${js.length!==1?"s":""} so far...`,tool_results:[{tool:"search_prospects",status:"success",count:js.length,prospects:[...js]}]}),Ps})}else if(Ds.type==="prospect_skipped")r(Ye=>{const Qe=[...Ye],ps=Qe.length-1;return ps>=0&&Qe[ps].role==="assistant"&&(Qe[ps]={...Qe[ps],content:`Found ${js.length} prospects (filtered out ${Ds.name})`}),Qe});else if(Ds.type==="search_started")O(Ye=>({...Ye??{companies:[],prospects:[]},phase:`Searching ${Ds.count} companies for contactsâ¦`,percent:50,source:(Ye==null?void 0:Ye.source)??"agent",companies:(Ye==null?void 0:Ye.companies)??[],prospects:(Ye==null?void 0:Ye.prospects)??[]})),r(Ye=>{const Qe=[...Ye],ps=Qe.length-1;return ps>=0&&Qe[ps].role==="assistant"&&(Qe[ps]={...Qe[ps],content:`Searching ${Ds.count} companies...`}),Qe});else if(Ds.type==="status")O(Ye=>({...Ye??{companies:[],prospects:[]},phase:Ds.text||"Workingâ¦",percent:Math.max((Ye==null?void 0:Ye.percent)??0,Math.min(95,((Ye==null?void 0:Ye.percent)??20)+3)),source:(Ye==null?void 0:Ye.source)??null,companies:(Ye==null?void 0:Ye.companies)??[],prospects:(Ye==null?void 0:Ye.prospects)??[]})),r(Ye=>{const Qe=[...Ye],ps=Qe.length-1;return ps>=0&&Qe[ps].role==="assistant"&&(Qe[ps]={...Qe[ps],content:Ds.text||"Working..."}),Qe});else if(Ds.type==="done")Bs=!0,O(Ye=>({...Ye??{companies:[],prospects:[]},phase:`Done â ${js.length} prospect${js.length!==1?"s":""} found`,percent:100,source:(Ye==null?void 0:Ye.source)??null,companies:(Ye==null?void 0:Ye.companies)??[],prospects:(Ye==null?void 0:Ye.prospects)??[]})),r(Ye=>{const Qe=[...Ye],ps=Qe.length-1;if(ps>=0&&Qe[ps].role==="assistant"){const Ps=Ds.content||"",Ms=Ds.tool_results||Qe[ps].tool_results,as=Ds.suggestions||[],Os=Ps||Ms&&Ms.length>0||as.length>0;Qe[ps]={role:"assistant",content:Os?Ps:"Something went wrong. Please try again or simplify your query.",tool_results:Ms,suggestions:Os?as:["Try again","Simplify query"]}}return Qe});else if(Ds.type==="error"){const Ye=Ds.error||"Something went wrong";k.error(Ye,{duration:6e3}),r(Qe=>{const ps=[...Qe],Ps=ps.length-1;return Ps>=0&&ps[Ps].role==="assistant"&&(ps[Ps]={...ps[Ps],content:Ye,suggestions:["Try again","Simplify query"]}),ps}),Bs=!0}}catch{}}}}finally{try{qe.releaseLock()}catch{}}}else{const qe=await Le.json();if(qe!=null&&qe.error){k.error(qe.error),c(!1);return}const ds={role:"assistant",content:qe.content||"",tool_results:qe.tool_results,suggestions:qe.suggestions};r(hs=>[...hs,ds])}r(qe=>(ie&&w.from("cold_reach_conversations").update({messages:qe}).eq("id",ie).then(()=>{}),qe)),Ie()}catch(V){k.error(V.message||"Failed to get response")}finally{c(!1),setTimeout(()=>O(null),4e3)}},[a,l,x,s,P]),E=D=>!D||a.length>0?!1:/\b(find|search|get|show|look(?:ing)? for|prospects?|leads?|contacts?|people|founders?|ceos?|ctos?|cmos?|vps?|directors?|managers?|engineers?|marketers?|sales|companies)\b/i.test(D),xe=(D,te)=>{const X=te.channel==="email"?"Email only â skip prospects without a usable email.":te.channel==="dm"?"LinkedIn DM only â skip prospects we can't DM.":"Use email or LinkedIn DM, whichever is available per prospect.",ie=te.tones.length>0?te.tones.join(", "):"natural, professional",_e=te.channel!=="dm"&&te.subject?`Subject template: ${te.subject}`:"";return`${D} 64 65[OUTREACH TEMPLATE â user-approved, do not deviate from style] 66Channel: ${X} 67Tone: ${ie} 68${_e} 69Body template (personalize {{tokens}} per prospect, keep voice & length): 70""" 71${te.body} 72"""`},ve=i.useCallback(D=>{if(!D.trim()||l)return;if(!oe&&E(D)){L(D),le(!0);return}const te=oe?xe(D,oe):D;ee(te)},[l,oe,ee,a.length]),S=D=>{if(T(D),k.success("Template approved â starting outreach"),F){const te=F;L(null),setTimeout(()=>ee(xe(te,D)),50)}},J=D=>{b(te=>{const X=new Set(te);return X.has(D.profileUrl)?X.delete(D.profileUrl):X.add(D.profileUrl),X})},je=D=>{for(const te of a)if(te.tool_results){for(const X of te.tool_results)if((X.tool==="generate_dm"||X.tool==="generate_outreach")&&X.messages){const ie=X.messages.find(_e=>_e.prospect_profile_url===D);if(ie!=null&&ie.message)return ie.message}}return null},se=D=>{for(const te of a)if(te.tool_results){for(const X of te.tool_results)if((X.tool==="generate_email"||X.tool==="generate_outreach")&&X.emails){const ie=X.emails.find(_e=>(_e.prospect_email||_e.prospect_profile_url)===D);if(ie)return`Subject: ${ie.subject||""} 73 74${ie.body||""}`.trim()}}return null},Oe=D=>{C(te=>new Set([...te,D.prospect_profile_url])),pr({channel:"dm",action:"approved",originalDraft:je(D.prospect_profile_url),editedDraft:D.message??null})},We=D=>{y(te=>new Set([...te,D.prospect_email])),pr({channel:"email",action:"approved",originalDraft:se(D.prospect_email),editedDraft:D.message??null})},H=(D,te)=>{const X=je(D.prospect_profile_url);r(ie=>ie.map(_e=>_e.tool_results?{..._e,tool_results:_e.tool_results.map(Me=>(Me.tool==="generate_dm"||Me.tool==="generate_outreach")&&Me.messages?{...Me,messages:Me.messages.map(Ge=>Ge.prospect_profile_url===D.prospect_profile_url?{...Ge,message:te}:Ge)}:Me)}:_e)),pr({channel:"dm",action:"edited",originalDraft:X,editedDraft:te})},ae=(D,te)=>{const X=se(D.prospect_email);r(ie=>ie.map(_e=>_e.tool_results?{..._e,tool_results:_e.tool_results.map(Me=>(Me.tool==="generate_email"||Me.tool==="generate_outreach")&&Me.emails?{...Me,emails:Me.emails.map(Ge=>{const G=Ge.prospect_email||Ge.prospect_profile_url,Fe=D.prospect_email;if(G===Fe){const He=te.match(/^Subject:\s*(.+)/),ts=He?He[1].trim():Ge.subject,As=te.replace(/^Subject:.*\n\n?/s,"").trim();return{...Ge,subject:ts,body:As}}return Ge})}:Me)}:_e)),pr({channel:"email",action:"edited",originalDraft:X,editedDraft:te})},ze=D=>{pr({channel:"dm",action:"rejected",originalDraft:je(D.prospect_profile_url),editedDraft:null}
74),k.success("Got it â future drafts will adjust to your style.")},pe=D=>{pr({channel:"email",action:"rejected",originalDraft:se(D.prospect_email),editedDraft:null}),k.success("Got it â future drafts will adjust to your style.")},Ae=()=>{const D=[];for(const te of a)if(te.tool_results)for(const X of te.tool_results){if((X.tool==="generate_dm"||X.tool==="generate_outreach")&&X.messages)for(const ie of X.messages)ie.message&&z.has(ie.prospect_profile_url)&&D.push({prospect_name:ie.prospect_name,prospect_username:ie.prospect_username,prospect_profile_url:ie.prospect_profile_url,prospect_email:ie.prospect_email,prospect_company:ie.company,platform:"linkedin",dm_text:ie.message});if((X.tool==="generate_email"||X.tool==="generate_outreach")&&X.emails){for(const ie of X.emails)if(ie.body&&j.has(ie.prospect_email)){const _e=D.find(Me=>Me.prospect_email===ie.prospect_email);_e?(_e.email_subject=ie.subject,_e.email_body=ie.body):D.push({prospect_name:ie.prospect_name,prospect_profile_url:ie.prospect_profile_url||"",prospect_email:ie.prospect_email,prospect_company:ie.prospect_company,email_subject:ie.subject,email_body:ie.body})}}}D.length>0&&ee(`Queue ${D.length} approved outreach messages`)},Ee=D=>{if(D.toLowerCase().includes("select all")&&D.toLowerCase().includes("outreach")){const te=[];for(const X of a)if(X.tool_results){for(const ie of X.tool_results)if(ie.tool==="search_prospects"&&ie.prospects)for(const _e of ie.prospects)_e.profileUrl&&te.push(_e.profileUrl)}te.length>0&&b(new Set(te))}ve(D)},ls=D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),ve(o))},ss=()=>{const D=ci[N]||ci[0],te=D.icon;return e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"w-7 h-7 rounded-full bg-accent/20 flex items-center justify-center",children:e.jsx(Et,{className:"h-3.5 w-3.5 text-accent"})}),e.jsx("div",{className:"bg-muted/50 rounded-xl rounded-tl-sm px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(te,{className:"h-3.5 w-3.5 animate-pulse text-primary"}),e.jsx("span",{className:"animate-pulse",children:D.text})]})})]})},$s=()=>{if(!Y)return null;const D=Y.source==="extension"?"LinkedIn extension":Y.source==="firecrawl"?"Web scrape":Y.source==="agent"?"AI agent":"Searching",te=Y.percent>=100;return e.jsxs("div",{className:"rounded-xl border border-border/40 bg-card/60 backdrop-blur px-4 py-3 mb-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[te?e.jsx(ys,{className:"h-4 w-4 text-primary"}):e.jsx(Pe,{className:"h-4 w-4 animate-spin text-primary"}),e.jsx("span",{children:Y.phase})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted/60",children:D}),e.jsxs("span",{children:[Y.percent,"%"]})]})]}),e.jsx(zt,{value:Y.percent,className:"h-1.5"}),Y.companies.length>0&&e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground mb-1",children:"Target companies"}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[Y.companies.slice(0,12).map((X,ie)=>e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-md bg-muted/50 text-foreground/80 border border-border/30",children:X},ie)),Y.companies.length>12&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",Y.companies.length-12," more"]})]})]}),Y.prospects.length>0&&e.jsxs("div",{className:"mt-3",children:[e.jsxs("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground mb-1",children:["Found so far (",Y.prospects.length,")"]}),e.jsx("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:Y.prospects.map((X,ie)=>{const _e=(()=>{const Fe=(X.profileUrl||"").match(/linkedin\.com\/(?:[a-z]{2}\/)?(?:in|pub)\/([^/?#]+)/i);return Fe&&Fe[1]?decodeURIComponent(Fe[1]).replace(/\/+$/,""):""})(),Me=`https://ui-avatars.com/api/?name=${encodeURIComponent(X.name||"?")}&background=random&size=64&bold=true`,Ge=[X.photoUrl,_e?`https://unavatar.io/linkedin/${encodeURIComponent(_e)}
74`:"",Me].filter(Boolean);return e.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground/85",children:[e.jsx("img",{src:Ge[0],alt:"","data-step":"0",className:"h-5 w-5 rounded-full object-cover shrink-0 border border-border/40 bg-muted",onError:G=>{const Fe=G.currentTarget,He=parseInt(Fe.dataset.step||"0",10)+1;He<Ge.length?(Fe.dataset.step=String(He),Fe.src=Ge[He]):Fe.style.display="none"},referrerPolicy:"no-referrer"}),e.jsx("span",{className:"font-medium truncate",children:X.name}),(X.title||X.company)&&e.jsxs("span",{className:"text-muted-foreground truncate",children:["â ",[X.title,X.company].filter(Boolean).join(" · ")]})]},ie)})})]})]})},Xs=D=>{const te=(D==null?void 0:D.prospect_name)??"this prospect",X=D!=null&&D.prospect_company?` at ${D.prospect_company}`:"",ie=D!=null&&D.hook_text?` Hook: ${D.hook_text}`:"";n(`Draft outreach for ${te}${X}.${ie}`),_("discover"),setTimeout(()=>{var _e;return(_e=ue.current)==null?void 0:_e.focus()},50)},xs=D=>e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"rounded-2xl border border-border/50 bg-card/80 backdrop-blur-md shadow-[0_4px_24px_-8px_hsl(var(--primary)/0.15)] focus-within:border-primary/40 focus-within:shadow-[0_4px_24px_-4px_hsl(var(--primary)/0.25)] transition-all",children:e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-2",children:[e.jsx(Ka,{delayDuration:200,children:e.jsxs(Xi,{children:[e.jsxs(la,{children:[e.jsx(ca,{asChild:!0,children:e.jsx(Qi,{asChild:!0,children:e.jsx(h,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0 rounded-xl text-muted-foreground hover:text-foreground hover:bg-muted/60",disabled:l,children:e.jsx(or,{className:"h-4 w-4"})})})}),e.jsx(sa,{side:"top",children:"Search settings"})]}),e.jsxs($n,{align:"start",className:"w-72 p-4 space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-foreground",children:"Max prospects per search"}),e.jsxs("select",{value:P,onChange:te=>I(Number(te.target.value)),disabled:l,className:"w-full h-9 rounded-lg border border-border/40 bg-background px-2.5 text-sm text-foreground",children:[e.jsx("option",{value:10,children:"10 prospects"}),e.jsx("option",{value:25,children:"25 prospects"}),e.jsx("option",{value:50,children:"50 prospects"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-foreground",children:"LinkedIn source"}),e.jsxs("select",{value:$,onChange:te=>{const X=te.target.value;be(X);try{localStorage.setItem("coldReach.searchMode",X)}catch{}},disabled:l,className:"w-full h-9 rounded-lg border border-border/40 bg-background px-2.5 text-sm text-foreground",children:[e.jsx("option",{value:"public",children:"Public Search"}),e.jsx("option",{value:"sales_nav",children:"Sales Navigator"})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground leading-snug pt-1",children:"Sales Navigator returns higher-fidelity results when you have a paid LinkedIn seat."})]})]})]})}),e.jsx(Je,{ref:ue,value:o,onChange:te=>n(te.target.value),onKeyDown:ls,placeholder:D,className:"flex-1 border-0 bg-transparent shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 px-1 text-sm placeholder:text-muted-foreground/70",disabled:l}),e.jsx(h,{onClick:()=>ve(o),disabled:!o.trim()||l,size:"icon",className:"h-9 w-9 shrink-0 rounded-xl shadow-sm",children:l?e.jsx(Pe,{className:"h-4 w-4 animate-spin"}):e.jsx(At,{className:"h-4 w-4"})})]})}),e.jsxs("div",{className:"flex items-center gap-2 mt-2 px-1",children:[e.jsxs("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/70 font-medium",children:[P," prospects"]}),e.jsx("span",{className:"text-[10px] text-muted-foreground/40",children:"·"}),e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/70 font-medium",children:$==="sales_nav"?"Sales Navigator":"Public Search"}),oe&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[10px] text-muted-foreground/40",children:"·"}),e.jsxs("button",{type:"button",onClick:()=>le(!0),className:"text-[10px] uppercase tracking-wider font-medium text-primary/80 hover:text-primary inline-flex items-center gap-1",title:"Review or edit the outreach template before the next send",children:[e.jsx(Oi,{className:"h-3 w-3"})," Template ready · edit"]})]}
74),e.jsxs("span",{className:"text-[10px] text-muted-foreground/40 ml-auto",children:["Press ",e.jsx("kbd",{className:"px-1 py-0.5 rounded bg-muted/60 border border-border/40 text-[9px] font-mono",children:"âµ"})," to send"]})]})]}),de=()=>a.length===0&&!p?e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsx("div",{className:"flex items-center justify-end mb-3",children:e.jsxs(h,{variant:"ghost",size:"sm",onClick:()=>g(!0),className:"text-muted-foreground gap-1.5",children:[e.jsx(yr,{className:"h-4 w-4"})," History"]})}),e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-4 relative",children:[e.jsx("div",{className:"absolute top-1/3 left-1/2 -translate-x-1/2 -translate-y-1/2 w-72 h-72 rounded-full bg-primary/10 blur-3xl pointer-events-none"}),e.jsx("div",{className:"relative",children:e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-primary/20 to-accent/20 flex items-center justify-center mb-6 shadow-lg shadow-primary/10 border border-primary/20",children:e.jsx(es,{className:"h-7 w-7 text-primary"})})}),e.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-2 text-center tracking-tight",children:"Who do you want to reach?"}),e.jsx("p",{className:"text-sm text-muted-foreground text-center max-w-md mb-8 leading-relaxed",children:"Name target companies or describe your ideal prospect. I'll find employees with their emails and LinkedIn profiles, then draft personalized DMs and emails."}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2.5 w-full max-w-2xl",children:R.map((D,te)=>e.jsxs("button",{onClick:()=>ve(D),className:"group text-left text-sm px-4 py-3.5 rounded-xl border border-border/40 bg-card/60 hover:bg-card hover:border-primary/40 hover:shadow-md hover:shadow-primary/5 hover:-translate-y-0.5 transition-all text-foreground/80 hover:text-foreground flex items-center gap-3",children:[e.jsx("span",{className:"w-7 h-7 rounded-lg bg-muted/60 group-hover:bg-primary/10 flex items-center justify-center shrink-0 transition-colors",children:e.jsx(es,{className:"h-3.5 w-3.5 text-muted-foreground group-hover:text-primary transition-colors"})}),e.jsx("span",{className:"flex-1 leading-snug",children:D}),e.jsx($t,{className:"h-3.5 w-3.5 text-muted-foreground/40 group-hover:text-primary group-hover:translate-x-0.5 transition-all"})]},te))})]}),e.jsx("div",{className:"mt-4",children:xs("Name companies or describe ideal prospectsâ¦")})]}):p?e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground tracking-tight",children:"Search History"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Pick up where you left off"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(h,{variant:"default",size:"sm",onClick:()=>{g(!1),Q()},className:"gap-1.5",children:[e.jsx(fi,{className:"h-4 w-4"})," New search"]}),e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>g(!1),children:"Back"})]})]}),e.jsx(jt,{className:"flex-1",children:e.jsx("div",{className:"space-y-2",children:u.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-muted/50 flex items-center justify-center mb-3",children:e.jsx(yr,{className:"h-5 w-5 text-muted-foreground"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No search history yet"}),e.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"Your past searches will appear here"})]}):u.map(D=>e.jsxs("div",{onClick:()=>ne(D),className:"group flex items-center justify-between p-3.5 rounded-xl border border-border/40 bg-card/60 hover:bg-card hover:border-primary/30 hover:shadow-sm cursor-pointer transition-all",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:e.jsx(Ks,{className:"h-3.5 w-3.5 text-primary"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:D.title}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[new Date(D.created_at).toLocaleDateString()," · ",D.messages.length," messages"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(h,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:te=>ke(D.id,te),children:e.jsx(ua,{className:"h-3.5 w-3.5"})}
74),e.jsx($t,{className:"h-4 w-4 text-muted-foreground/40 group-hover:text-primary group-hover:translate-x-0.5 transition-all"})]})]},D.id))})})]}):e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsx("div",{className:"flex items-center justify-end mb-3",children:e.jsxs("div",{className:"flex items-center gap-1 rounded-lg border border-border/40 bg-card/40 p-0.5",children:[e.jsxs(h,{variant:"ghost",size:"sm",onClick:()=>g(!0),className:"h-7 px-2.5 text-xs text-muted-foreground hover:text-foreground gap-1.5",children:[e.jsx(yr,{className:"h-3.5 w-3.5"})," History"]}),e.jsx("div",{className:"w-px h-4 bg-border/40"}),e.jsxs(h,{variant:"ghost",size:"sm",onClick:Q,className:"h-7 px-2.5 text-xs text-muted-foreground hover:text-foreground gap-1.5",children:[e.jsx(ft,{className:"h-3.5 w-3.5"})," New"]})]})}),$s(),he&&e.jsx(zf,{mode:$,initialVariants:he.variants,initialFilters:he.filters,onCancel:()=>{const D=fe.cancel;re(null),fe.current=null,D==null||D()},onConfirm:(D,te)=>{const X=fe.current;re(null),fe.current=null,X==null||X(D,te)}}),e.jsx(jt,{className:"flex-1 pr-2 -mr-2",children:e.jsxs("div",{ref:K,className:"space-y-4 pb-4",children:[a.map((D,te)=>e.jsx(qg,{message:D,onSelectProspect:J,selectedProspects:v,onApproveDM:Oe,onEditDM:H,onApproveEmail:We,onEditEmail:ae,onRejectDM:ze,onRejectEmail:pe,approvedDMs:z,approvedEmails:j,onSuggestionClick:Ee,onQueueAllApproved:Ae,isLastMessage:te===a.length-1,isPaidUser:t},te)),l&&ss()]})}),e.jsx("div",{className:"mt-3",children:xs("Name companies, describe prospects, or paste a LinkedIn post URLâ¦")})]});return e.jsxs("div",{className:"space-y-6 relative",children:[e.jsx("div",{className:"absolute -top-12 left-1/4 w-96 h-96 rounded-full bg-primary/10 blur-3xl pointer-events-none -z-10"}),e.jsx("div",{className:"absolute top-32 right-0 w-72 h-72 rounded-full bg-accent/10 blur-3xl pointer-events-none -z-10"}),e.jsx("div",{className:"sticky top-16 z-30 -mx-1 px-1 pt-1 pb-1",children:e.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-border/50 bg-card/70 backdrop-blur-xl shadow-[0_8px_32px_-12px_hsl(var(--primary)/0.25)]",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/[0.06] via-transparent to-accent/[0.05] pointer-events-none"}),e.jsxs("div",{className:"relative flex items-start gap-4 p-5 md:p-6",children:[e.jsxs("div",{className:"w-12 h-12 rounded-2xl bg-gradient-to-br from-primary/25 to-accent/20 flex items-center justify-center border border-primary/20 shadow-md shadow-primary/10 shrink-0 relative",children:[e.jsx(Et,{className:"h-6 w-6 text-primary"}),e.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 rounded-full bg-emerald-500 border-2 border-background"})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/80 font-medium",children:"Cold Reach"}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-muted-foreground/40"}),e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-primary/80 font-medium",children:"Agent · Online"})]}),e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold tracking-tight text-foreground",children:"Find and message ideal prospects"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 max-w-2xl leading-relaxed",children:"Describe your ideal customer in plain English. The agent finds matching people, drafts personalized outreach, and queues it through your extension."})]})]})]})}),e.jsxs("div",{className:"flex flex-col h-[calc(100vh-22rem)] max-h-[760px]",children:[e.jsx("div",{className:"mb-3",children:e.jsx(ef,{userId:s,isEmptyState:a.length===0&&!p,signal:A,onClearSignal:()=>B(null),onOpenHotNow:()=>_("hot")})}),e.jsxs(Ct,{value:q,onValueChange:D=>_(D),className:"flex flex-col flex-1 min-h-0",children:[e.jsxs(wt,{className:"self-start mb-3 h-9 p-1 rounded-xl bg-muted/50 border border-border/30",children:[e.jsxs(cs,{value:"discover",className:"text-xs gap-1.5 rounded-lg px-3 data-[state=active]:shadow-sm",children:[e.jsx(es,{className:"h-3.5 w-3.5"})," Discover"]}),e.jsxs(cs,{value:"hot",className:"text-xs gap-1.5 rounded-lg px-3 data-[state=active]:shadow-sm",children:[e.jsx(Ca,{className:"h-3.5 w-3.5"})," Hot Now"]}),e.jsxs(cs,{value:"inbox",className:"text-xs gap-1.5 rounded-lg px-3 data-[state=active]:shadow-sm",children:[e.jsx(wr,{className:"h-3.5 w-3.5"})," Inbox"]})]}),e.jsx(us,{value:"discover",className:"flex-1 min-h-0 mt-0 flex flex-col",children:de()}),e.jsx(us,{value:"hot",className:"flex-1 min-h-0 mt-0 overflow-auto",children:e.jsx(Vg,{userId:s,onUseSignal:Xs})}),e.jsx(us,{value:"inbox",className:"flex-1 min-h-0 mt-0 overflow-auto",children:e.jsx(Kg,{userId:s})})]})]}),e.jsx(Ff,{open:ce,onOpenChange:D=>{le(D),D||L(null)},intent:F||o||"",initial:oe,onApprove:S})]})}const qf=({width:s,height:t,templateData:a,onCanvasReady:r})=>{const o=i.useRef(null),n=i.useRef(null),[l,c]=i.useState(null),[x,d]=i.useState(""),[u,m]=i.useState(!1),p=i.useRef(null),g=i.useCallback(()=>{const B=680/s,P=500/t;return Math.min(B,P,1)},[s,t]);i.useEffect(()=>{if(!o.current)return;
74const _=g(),A=new _x(o.current,{width:s*_,height:t*_,backgroundColor:"#1a1f2e",selection:!0});return A.setZoom(_),A.on("selection:created",B=>{var P;return c(((P=B.selected)==null?void 0:P[0])||null)}),A.on("selection:updated",B=>{var P;return c(((P=B.selected)==null?void 0:P[0])||null)}),A.on("selection:cleared",()=>c(null)),n.current=A,r==null||r(A),a&&v(A,a),()=>{A.dispose(),n.current=null}},[s,t,a]);const v=async(_,A)=>{_.clear(),_.backgroundColor=A.background||"#1a1f2e";for(const B of A.objects||[])if(B.type==="rect"){const P=new io({left:B.left,top:B.top,width:B.width,height:B.height,fill:B.fill||"transparent",stroke:B.stroke,strokeWidth:B.strokeWidth,rx:B.rx||0,ry:B.ry||0});_.add(P)}else if(B.type==="text"){const P=new mr(B.text||"Edit me",{left:B.left,top:B.top,fontSize:B.fontSize||24,fill:B.fill||"#ffffff",fontWeight:B.fontWeight||"normal",fontStyle:B.fontStyle||"normal",textAlign:B.textAlign||"left",fontFamily:B.fontFamily||"Inter"});_.add(P)}else if(B.type==="circle"){const P=new oo({left:B.left,top:B.top,radius:B.radius||30,fill:B.fill||"transparent",stroke:B.stroke,strokeWidth:B.strokeWidth});_.add(P)}_.renderAll()},b=()=>{const _=n.current;if(!_)return;const A=new mr("Edit this text",{left:s*.1,top:t*.4,fontSize:32,fill:"#ffffff",fontFamily:"Inter"});_.add(A),_.setActiveObject(A),_.renderAll()},z=()=>{const _=n.current;if(!_)return;const A=new io({left:s*.2,top:t*.2,width:200,height:120,fill:"hsl(38, 92%, 50%)",rx:8,ry:8});_.add(A),_.setActiveObject(A),_.renderAll()},C=()=>{const _=n.current;if(!_)return;const A=new oo({left:s*.3,top:t*.3,radius:60,fill:"hsl(159, 30%, 50%)"});_.add(A),_.setActiveObject(A),_.renderAll()},j=_=>{var P;const A=(P=_.target.files)==null?void 0:P[0];if(!A)return;const B=new FileReader;B.onload=async I=>{var O;const $=n.current;if(!$||!((O=I.target)!=null&&O.result))return;const be=await lo.fromURL(I.target.result),Y=Math.min(s*.5/(be.width||1),t*.5/(be.height||1));be.scale(Y),be.set({left:s*.1,top:t*.1}),$.add(be),$.setActiveObject(be),$.renderAll()},B.readAsDataURL(A)},y=()=>{const _=n.current;if(!_)return;const A=_.getActiveObject();A&&(_.remove(A),_.renderAll(),c(null))},N=async()=>{if(x.trim()){m(!0);try{const{data:_,error:A}=await w.functions.invoke("creative-generate",{body:{prompt:x,width:Math.min(s,1024),height:Math.min(t,1024)}});if(A)throw A;if(_!=null&&_.imageUrl){const B=n.current;if(!B)return;const P=await lo.fromURL(_.imageUrl),I=Math.min(s*.8/(P.width||1),t*.8/(P.height||1));P.scale(I),P.set({left:s*.1,top:t*.1}),B.add(P),B.sendObjectToBack(P),B.renderAll(),pt({title:"AI image added to canvas"})}}catch(_){pt({title:"Generation failed",description:_.message,variant:"destructive"})}finally{m(!1),d("")}}},f=()=>{const _=n.current;if(!_)return;const B=1/g(),P=_.toDataURL({format:"png",multiplier:B,quality:1}),I=document.createElement("a");I.download=`creative-${s}x${t}.png`,I.href=P,I.click(),pt({title:"Image exported!"})},R=()=>{var _;l&&l instanceof mr&&(l.set("fontWeight",l.fontWeight==="bold"?"normal":"bold"),(_=n.current)==null||_.renderAll())},M=()=>{var _;l&&l instanceof mr&&(l.set("fontStyle",l.fontStyle==="italic"?"normal":"italic"),(_=n.current)==null||_.renderAll())},q=_=>{var A;l&&l instanceof mr&&(l.set("textAlign",_),(A=n.current)==null||A.renderAll())};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 p-3 rounded-xl border border-border/40 bg-card/60",children:[e.jsxs(h,{variant:"outline",size:"sm",onClick:b,className:"gap-1.5",children:[e.jsx(Or,{className:"h-3.5 w-3.5"})," Text"]}),e.jsxs(h,{variant:"outline",size:"sm",onClick:z,className:"gap-1.5",children:[e.jsx(Tx,{className:"h-3.5 w-3.5"})," Rectangle"]}),e.jsxs(h,{variant:"outline",size:"sm",onClick:C,className:"gap-1.5",children:[e.jsx(Tn,{className:"h-3.5 w-3.5"})," Circle"]}),e.jsxs("label",{children:[e.jsx(h,{variant:"outline",size:"sm",className:"gap-1.5 cursor-pointer",asChild:!0,children:e.jsxs("span",{children:[e.jsx(ga,{className:"h-3.5 w-3.5"})," Image"]})}),e.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:j})]}),e.jsx("div",{className:"w-px h-6 bg-border/40 mx-1"}),l&&l instanceof mr&&e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",size:"sm",onClick:R,children:e.jsx(Ax,{className:"h-3.5 w-3.5"})}),e.jsx(h,{variant:"ghost",size:"sm",onClick:M,children:e.jsx(Ix,{className:"h-3.5 w-3.5"})}),e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>q("left"),children:e.jsx(Lx,{className:"h-3.5 w-3.5"})}),e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>q("center"),children:e.jsx(zx,{className:"h-3.5 w-3.5"})}),e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>q("right"),children:e.jsx(Ex,{className:"h-3.5 w-3.5"})}),e.jsx("div",{className:"w-px h-6 bg-border/40 mx-1"})]}),l&&e.jsx(h,{variant:"ghost",size:"sm",onClick:y,className:"text-destructive hover:text-destructive",children:e.jsx(ua,{className:"h-3.5 w-3.5"})}),e.jsx("div",{className:"ml-auto",children:e.jsxs(h,{size:"sm",onClick:f,className:"gap-1.5",children:[e.jsx(Ut,{className:"h-3.5 w-3.5"})," Export PNG"]})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(es,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-primary"}),e.jsx(Je,{value:x,onChange:_=>d(_.target.value),placeholder:"Describe an image to generate with AI...",className:"pl-9",onKeyDown:_=>_.key==="Enter"&&N()})]}),e.jsxs(h,{onClick:N,disabled:u||!x.trim(),className:"gap-1.5",children:[u?e.jsx(Pe,{className:"h-4 w-4 animate-spin"}):e.jsx(es,{className:"h-4 w-4"}),"Generate"]})]}),e.jsx("div",{ref:p,className:"rounded-xl border border-border/40 bg-muted/20 p-4 flex items-center justify-center overflow-auto",children:e.jsx("canvas",{ref:o})}),e.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:["Canvas: ",s," Ã ",t,"px â Click objects to select, drag to move, handles to resize"]})]})},Qo=[{id:"linkedin-post",name:"LinkedIn Post",platform:"LinkedIn",width:1200,height:628,icon:cn,category:"Post",purpose:"Brand awareness & thought leadership",data:{background:"#1a1f2e",objects:[{type:"rect",left:0,top:0,width:1200,height:628,fill:"#0f172a"},{type:"rect",left:40,top:40,width:120,height:120,fill:"hsl(38, 92%, 50%)",rx:16,ry:16},{type:"text",text:"Your Headline Here",left:40,top:200,fontSize:48,fill:"#ffffff",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:"Add your subtitle or description text here.",left:40,top:270,fontSize:22,fill:"#94a3b8",fontFamily:"Inter"},{type:"rect",left:40,top:520,width:220,height:48,fill:"hsl(38, 92%, 50%)",rx:24,ry:24},{type:"text",text:"Learn more â",left:65,top:530,fontSize:18,fill:"#0f172a",fontWeight:"bold",fontFamily:"Inter"}]}},{id:"twitter-quote",name:"Quote Card",platform:"X / Twitter",width:1600,height:900,icon:Or,category:"Quote",purpose:"Engagement & shareability",data:{background:"#0f172a",objects:[{type:"rect",left:0,top:0,width:1600,height:900,fill:"#0f172a"},{type:"text",text:'"',left:100,top:180,fontSize:200,fill:"hsl(38, 92%, 50%)",fontWeight:"bold",fontFamily:"Georgia"},{type:"text",text:`The best marketing doesn't 75feel like marketing.`,left:120,top:320,fontSize:52,fill:"#ffffff",fontWeight:"bold",fontFamily:"Inter",textAlign:"left"},{type:"rect",left:120,top:560,width:80,height:4,fill:"hsl(38, 92%, 50%)"},{type:"text",text:"@yourhandle",left:120,top:590,fontSize:24,fill:"#94a3b8",fontFamily:"Inter"}]}},{id:"instagram-square",name:"Instagram Post",platform:"Instagram",width:1080,height:1080,icon:ga,category:"Post",purpose:"Product showcase & visual branding",data:{background:"#1e293b",objects:[{type:"rect",left:0,top:0,width:1080,height:1080,fill:"#1e293b"},{type:"circle",left:440,top:200,radius:100,fill:"hsl(38, 92%, 50%)"},{type:"text",text:"BIG IDEA",left:200,top:460,fontSize:72,fill:"#ffffff",fontWeight:"bold",fontFamily:"Inter",textAlign:"center"}
75,{type:"text",text:`Supporting text goes here. 76Keep it short and punchy.`,left:200,top:570,fontSize:28,fill:"#94a3b8",fontFamily:"Inter",textAlign:"center"},{type:"rect",left:340,top:900,width:400,height:56,fill:"hsl(159, 30%, 50%)",rx:28,ry:28},{type:"text",text:"Follow for more",left:390,top:914,fontSize:22,fill:"#0f172a",fontWeight:"bold",fontFamily:"Inter"}]}},{id:"story-vertical",name:"Story / Reel",platform:"Instagram / TikTok",width:1080,height:1920,icon:Hc,category:"Story",purpose:"Short-form engagement & reach",data:{background:"#0f172a",objects:[{type:"rect",left:0,top:0,width:1080,height:1920,fill:"#0f172a"},{type:"circle",left:440,top:400,radius:100,fill:"hsl(38, 92%, 50%)"},{type:"text",text:`DID YOU 77KNOW?`,left:200,top:700,fontSize:72,fill:"#ffffff",fontWeight:"bold",fontFamily:"Inter",textAlign:"center"},{type:"text",text:`73% of B2B buyers check 78social media before 79making a purchase.`,left:150,top:920,fontSize:36,fill:"#cbd5e1",fontFamily:"Inter",textAlign:"center"},{type:"rect",left:290,top:1500,width:500,height:64,fill:"hsl(38, 92%, 50%)",rx:32,ry:32},{type:"text",text:"Swipe up â",left:410,top:1516,fontSize:26,fill:"#0f172a",fontWeight:"bold",fontFamily:"Inter"}]}},{id:"carousel-slide",name:"Carousel Slide",platform:"LinkedIn / Instagram",width:1080,height:1080,icon:qa,category:"Carousel",purpose:"Educational content & lead magnet",data:{background:"#1a1f2e",objects:[{type:"rect",left:0,top:0,width:1080,height:1080,fill:"#1a1f2e"},{type:"text",text:"Slide 1 of 5",left:60,top:60,fontSize:18,fill:"#64748b",fontFamily:"Inter"},{type:"text",text:`Why Users 80Churn`,left:60,top:350,fontSize:72,fill:"#ffffff",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:`84% of churn happens in the 81first 7 days. Here's what 82founders get wrong.`,left:60,top:560,fontSize:28,fill:"#94a3b8",fontFamily:"Inter"},{type:"rect",left:60,top:780,width:960,height:4,fill:"hsl(38, 92%, 50%)"},{type:"text",text:"@yourhandle",left:60,top:950,fontSize:22,fill:"#64748b",fontFamily:"Inter"}]}},{id:"facebook-cover",name:"Facebook Cover",platform:"Facebook",width:1640,height:624,icon:cn,category:"Cover",purpose:"Brand identity & first impressions",data:{background:"#0f172a",objects:[{type:"rect",left:0,top:0,width:1640,height:624,fill:"#0f172a"},{type:"text",text:"YOUR BRAND",left:80,top:200,fontSize:64,fill:"#ffffff",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:"Tagline or mission statement goes here",left:80,top:290,fontSize:28,fill:"#94a3b8",fontFamily:"Inter"},{type:"rect",left:1300,top:180,width:260,height:260,fill:"hsl(38, 92%, 50%)",rx:20,ry:20}]}},{id:"testimonial-card",name:"Testimonial Card",platform:"Any Platform",width:1080,height:1080,icon:ms,category:"Social Proof",purpose:"Trust building & conversion",data:{background:"#0f172a",objects:[{type:"rect",left:0,top:0,width:1080,height:1080,fill:"#0f172a"},{type:"rect",left:60,top:60,width:960,height:960,fill:"#1e293b",rx:24,ry:24},{type:"text",text:"â â â â â ",left:120,top:140,fontSize:32,fill:"hsl(38, 92%, 50%)",fontFamily:"Inter"},{type:"text",text:`"This tool completely changed 83how we approach social 84media marketing."`,left:120,top:260,fontSize:36,fill:"#ffffff",fontWeight:"bold",fontFamily:"Inter"},{type:"rect",left:120,top:560,width:60,height:4,fill:"hsl(38, 92%, 50%)"},{type:"text",text:"Jane Smith",left:120,top:600,fontSize:24,fill:"#ffffff",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:"VP Marketing, Acme Corp",left:120,top:640,fontSize:20,fill:"#94a3b8",fontFamily:"Inter"},{type:"rect",left:120,top:820,width:840,height:1,fill:"#334155"},{type:"text",text:"YOUR BRAND",left:120,top:860,fontSize:22,fill:"#64748b",fontFamily:"Inter"}]}},{id:"stat-highlight",name:"Stats Highlight",platform:"LinkedIn / Twitter",width:1200,height:675,icon:cr,category:"Data",purpose:"Authority positioning & engagement",data:{background:"#0f172a",objects:[{type:"rect",left:0,top:0,width:1200,height:675,fill:"#0f172a"},{type:"text",text:"73%",left:80,top:120,fontSize:160,fill:"hsl(38, 92%, 50%)",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:`of prospects say they 85discovered a new product 86through social media.`,left:80,top:310,fontSize:32,fill:"#ffffff",fontFamily:"Inter"},{type:"rect",left:80,top:520,width:200,height:4,fill:"#334155"},{type:"text",text:"Source: Industry Report 2024",left:80,top:550,fontSize:16,fill:"#64748b",fontFamily:"Inter"},{type:"text",text:"@yourhandle",left:980,top:620,fontSize:18,fill:"#64748b",fontFamily:"Inter"}]}},{id:"before-after",name:"Before / After",platform:"Any Platform",width:1080,height:1080,icon:Es,category:"Case Study",purpose:"Problem-solution storytelling",data:{background:"#0f172a",objects:[{type:"rect",left:0,top:0,width:1080,height:1080,fill:"#0f172a"},{type:"rect",left:0,top:0,width:540,height:1080,fill:"#1e293b"},{type:"text",text:"BEFORE",left:60,top:80,fontSize:20,fill:"#ef4444",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:`Manual 87outreach. 884 hours 89per day.`,left:60,top:300,fontSize:40,fill:"#94a3b8",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:"AFTER",left:600,top:80,fontSize:20,fill:"#22c55e",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:`Automated 90engagement. 9115 minutes 92per day.`,left:600,top:300,fontSize:40,fill:"#ffffff",fontWeight:"bold",fontFamily:"Inter"},{type:"rect",left:535,top:0,width:10,height:1080,fill:"hsl(38, 92%, 50%)"},{type:"text",text:"YOUR BRAND",left:400,top:980,fontSize:22,fill:"#64748b",fontFamily:"Inter",textAlign:"center"}]}},{id:"product-launch",name:"Product Launch",platform:"Any Platform",width:1200,height:628,icon:Fi,category:"Announcement",purpose:"Product launches & feature releases",data:{background:"#0f172a",objects:[{type:"rect",left:0,top:0,width:1200,height:628,fill:"#0f172a"},{type:"rect",left:40,top:40,width:160,height:36,fill:"hsl(38, 92%, 50%)",rx:18,ry:18},{type:"text",text:"ð NEW",left:62,top:46,fontSize:18,fill:"#0f172a",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:`Introducing 93Your Feature`,left:40,top:120,fontSize:56,fill:"#ffffff",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:`A short description of what this feature does 94and why your audience should care.`,left:40,top:280,fontSize:22,fill:"#94a3b8",fontFamily:"Inter"},{type:"rect",left:40,top:400,width:200,height:48,fill:"hsl(38, 92%, 50%)",rx:24,ry:24},{type:"text",text:"Try it now â",left:65,top:410,fontSize:18,fill:"#0f172a",fontWeight:"bold",fontFamily:"Inter"},{type:"rect",left:800,top:100,width:340,height:420,fill:"#1e293b",rx:16,ry:16},{type:"text",text:"[ Screenshot ]",left:890,top:290,fontSize:20,fill:"#64748b",fontFamily:"Inter"}]}},{id:"tips-listicle",name:"Tips / Listicle",platform:"LinkedIn / Instagram",width:1080,height:1080,icon:za,category:"Educational",purpose:"Thought leadership & saves",data:{background:"#0f172a",objects:[{type:"rect",left:0,top:0,width:1080,height:1080,fill:"#0f172a"},{type:"text",text:"5 TIPS",left:60,top:60,fontSize:20,fill:"hsl(38, 92%, 50%)",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:`to grow your 95LinkedIn audience`,left:60,top:100,fontSize:48,fill:"#ffffff",fontWeight:"bold",fontFamily:"Inter"},{type:"rect",left:60,top:300,width:960,height:1,fill:"#334155"},{type:"text",text:"01",left:60,top:340,fontSize:36,fill:"hsl(38, 92%, 50%)",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:"Comment on posts in your niche daily",left:140,top:348,fontSize:22,fill:"#e2e8f0",fontFamily:"Inter"},{type:"text",text:"02",left:60,top:420,fontSize:36,fill:"hsl(38, 92%, 50%)",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:"Share original insights, not just reposts",left:140,top:428,fontSize:22,fill:"#e2e8f0",fontFamily:"Inter"},{type:"text",text:"03",left:60,top:500,fontSize:36,fill:"hsl(38, 92%, 50%)",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:"Use a consistent posting schedule",left:140,top:508,fontSize:22,fill:"#e2e8f0",fontFamily:"Inter"},{type:"text",text:"04",left:60,top:580,fontSize:36,fill:"hsl(38, 92%, 50%)",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:"Engage before and after you post",left:140,top:588,fontSize:22,fill:"#e2e8f0",fontFamily:"Inter"},{type:"text",text:"05",left:60,top:660,fontSize:36,fill:"hsl(38, 92%, 50%)",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:"Optimize your profile for conversions",left:140,top:668,fontSize:22,fill:"#e2e8f0",fontFamily:"Inter"},{type:"rect",left:60,top:800,width:960,height:1,fill:"#334155"},{type:"text",text:"Save this for later ð",left:60,top:840,fontSize:22,fill:"#94a3b8",fontFamily:"Inter"},{type:"text",text:"@yourhandle",left:60,top:960,fontSize:20,fill:"#64748b",fontFamily:"Inter"}]}},{id:"poll-engagement",name:"Poll / Question",platform:"X / Twitter / LinkedIn",width:1200,height:675,icon:ms,category:"Engagement",purpose:"Audience interaction & algorithm boost",data:{background:"#0f172a",objects:[{type:"rect",left:0,top:0,width:1200,height:675,fill:"#0f172a"},{type:"text",text:`WHICH ONE 96ARE YOU?`,left:80,top:80,fontSize:64,fill:"#ffffff",fontWeight:"bold",fontFamily:"Inter"},{type:"rect",left:80,top:300,width:500,height:70,fill:"#1e293b",rx:12,ry:12},{type:"text",text:"A) Plan everything ð",left:120,top:318,fontSize:24,fill:"#e2e8f0",fontFamily:"Inter"},{type:"rect",left:80,top:390,width:500,height:70,fill:"#1e293b",rx:12,ry:12},{type:"text",text:"B) Wing it every time ð",left:120,top:408,fontSize:24,fill:"#e2e8f0",fontFamily:"Inter"},{type:"rect",left:80,top:480,width:500,height:70,fill:"#1e293b",rx:12,ry:12},{type:"text",text:"C) Depends on the day â",left:120,top:498,fontSize:24,fill:"#e2e8f0",fontFamily:"Inter"},{type:"text",text:"Comment below ð",left:80,top:600,fontSize:22,fill:"hsl(38, 92%, 50%)",fontWeight:"bold",fontFamily:"Inter"},{type:"rect",left:800,top:200,width:320,height:320,fill:"hsl(38, 92%, 50%)",rx:160,ry:160},{type:"text",text:"?",left:920,top:280,fontSize:160,fill:"#0f172a",fontWeight:"bold",fontFamily:"Inter"}]}},{id:"case-study-result",name:"Case Study Result",platform:"LinkedIn",width:1200,height:628,icon:Bi,category:"Social Proof",purpose:"Credibility & lead generation",data:{background:"#0f172a",objects:[{type:"rect",left:0,top:0,width:1200,height:628,fill:"#0f172a"},{type:"text",text:"CASE STUDY",left:60,top:50,fontSize:16,fill:"hsl(38, 92%, 50%)",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:`How [Client] grew 97engagement by 340%`,left:60,top:90,fontSize:44,fill:"#ffffff",fontWeight:"bold",fontFamily:"Inter"},{type:"rect",left:60,top:280,width:320,height:120,fill:"#1e293b",rx:12,ry:12},{type:"text",text:"340%",left:100,top:295,fontSize:42,fill:"hsl(38, 92%, 50%)",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:"Engagement â",left:100,top:350,fontSize:16,fill:"#94a3b8",fontFamily:"Inter"},{type:"rect",left:420,top:280,width:320,height:120,fill:"#1e293b",rx:12,ry:12},{type:"text",text:"2.5x",left:460,top:295,fontSize:42,fill:"#22c55e",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:"Lead Volume â",left:460,top:350,fontSize:16,fill:"#94a3b8",fontFamily:"Inter"},{type:"rect",left:780,top:280,width:320,height:120,fill:"#1e293b",rx:12,ry:12},{type:"text",text:"62%",left:820,top:295,fontSize:42,fill:"#3b82f6",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:"Time Saved",left:820,top:350,fontSize:16,fill:"#94a3b8",fontFamily:"Inter"},{type:"rect",left:60,top:470,width:260,height:48,fill:"hsl(38, 92%, 50%)",rx:24,ry:24},{type:"text",text:"Read full story â",left:90,top:480,fontSize:18,fill:"#0f172a",fontWeight:"bold",fontFamily:"Inter"}]}},{id:"thread-hook",name:"Thread Hook",platform:"X / Twitter",width:1200,height:675,icon:Or,category:"Thread",purpose:"Viral potential & deep engagement",data:{background:"#0f172a",objects:[{type:"rect",left:0,top:0,width:1200,height:675,fill:"#0f172a"},{type:"text",text:"ð§µ",left:80,top:60,fontSize:64,fontFamily:"Inter"},{type:"text",text:`I spent 6 months 98testing every social 99media strategy.`,left:80,top:150,fontSize:48,fill:"#ffffff",fontWeight:"bold",fontFamily:"Inter"},{type:"text",text:`Here are the 7 things 100that actually work:`,left:80,top:400,fontSize:36,fill:"#94a3b8",fontFamily:"Inter"},{type:"rect",left:80,top:580,width:180,height:40,fill:"hsl(38, 92%, 50%)",rx:20,ry:20},{type:"text",text:"Thread â",left:120,top:588,fontSize:18,fill:"#0f172a",fontWeight:"bold",fontFamily:"Inter"}]}}],Hf=["All","Post","Quote","Story","Carousel","Cover","Social Proof","Data","Case Study","Engagement","Educational","Announcement","Thread"],Gf=({onSelect:s,selectedId:t})=>{const[a,r]=i.useState(""),[o,n]=i.useState("All"),l=Qo.filter(x=>{const d=!a||x.name.toLowerCase().includes(a.toLowerCase())||x.platform.toLowerCase().includes(a.toLowerCase())||x.purpose.toLowerCase().includes(a.toLowerCase()),u=o==="All"||x.category===o;return d&&u}),c=Hf.filter(x=>x==="All"||Qo.some(d=>d.category===x));return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold mb-1",children:"Choose a Template"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Pick a format, then customize in the editor"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ks,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(Je,{value:a,onChange:x=>r(x.target.value),placeholder:"Search templates...",className:"h-8 pl-8 text-xs"})]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:c.map(x=>e.jsx("button",{onClick:()=>n(x),className:`text-[10px] px-2 py-0.5 rounded-full transition-colors ${o===x?"bg-primary text-primary-foreground":"bg-muted/40 text-muted-foreground hover:bg-muted"}`,children:x},x))}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:l.map(x=>{const d=x.icon,u=t===x.id,m=x.width/x.height;return e.jsxs(U,{onClick:()=>s(x),className:`p-2.5 cursor-pointer transition-all hover:border-primary/40 ${u?"border-primary bg-primary/5 ring-1 ring-primary/30":"border-border/30 bg-card/40"}`,children:[e.jsx("div",{className:"rounded-md bg-muted/30 mb-1.5 flex items-center justify-center overflow-hidden",style:{aspectRatio:Math.max(m,.6).toString(),maxHeight:"72px"},children:e.jsx(d,{className:`h-5 w-5 ${u?"text-primary":"text-muted-foreground"}`})}),e.jsx("p",{className:"text-[11px] font-medium truncate",children:x.name}),e.jsx("div",{className:"flex items-center gap-1 mt-0.5",children:e.jsx(W,{variant:"secondary",className:"text-[9px] px-1 py-0 h-4",children:x.platform})}),e.jsx("p",{className:"text-[9px] text-muted-foreground mt-0.5 truncate",children:x.purpose})]},x.id)})}),l.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No templates match your search"})]})},Uf=["hsl(38, 92%, 50%)","hsl(159, 30%, 50%)","hsl(222, 47%, 11%)","#ffffff","#94a3b8","#0f172a"],Wf=({onColorSelect:s})=>{const[t,a]=i.useState(Uf),[r,o]=i.useState("#e2a438"),[n,l]=i.useState([]),c=()=>{t.includes(r)||a([...t,r])},x=u=>{a(t.filter((m,p)=>p!==u))},d=u=>{var g;const m=(g=u.target.files)==null?void 0:g[0];if(!m)return;const p=new FileReader;p.onload=v=>{var b;(b=v.target)!=null&&b.result&&l([...n,v.target.result])},p.readAsDataURL(m)};return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-semibold mb-1 flex items-center gap-2",children:[e.jsx(In,{className:"h-4 w-4 text-primary"})," Brand Kit"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your brand colors & logos for c
100onsistent creatives"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs",children:"Brand Colors"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.map((u,m)=>e.jsxs("div",{className:"relative group",children:[e.jsx("button",{onClick:()=>s==null?void 0:s(u),className:"w-8 h-8 rounded-lg border border-border/40 transition-transform hover:scale-110",style:{backgroundColor:u},title:u}),e.jsx("button",{onClick:()=>x(m),className:"absolute -top-1 -right-1 w-3.5 h-3.5 rounded-full bg-destructive text-destructive-foreground flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(zs,{className:"h-2 w-2"})})]},m)),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("input",{type:"color",value:r,onChange:u=>o(u.target.value),className:"w-8 h-8 rounded-lg border border-border/40 cursor-pointer"}),e.jsx(h,{variant:"ghost",size:"sm",onClick:c,className:"h-8 w-8 p-0",children:e.jsx(ft,{className:"h-3.5 w-3.5"})})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs",children:"Logos"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.map((u,m)=>e.jsx("div",{className:"w-16 h-16 rounded-lg border border-border/40 bg-muted/20 p-1 overflow-hidden",children:e.jsx("img",{src:u,alt:`Logo ${m+1}`,className:"w-full h-full object-contain"})},m)),e.jsxs("label",{className:"w-16 h-16 rounded-lg border border-dashed border-border/40 bg-muted/10 flex items-center justify-center cursor-pointer hover:border-primary/40 transition-colors",children:[e.jsx(An,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:d})]})]})]})]})},Vf=[{id:"all",label:"All",color:""},{id:"linkedin",label:"LinkedIn",icon:"in",color:"bg-blue-600"},{id:"twitter",label:"X",icon:"ð",color:"bg-foreground"},{id:"facebook",label:"Facebook",icon:"f",color:"bg-blue-500"},{id:"instagram",label:"Instagram",icon:"ð·",color:"bg-pink-500"},{id:"reddit",label:"Reddit",icon:"r",color:"bg-orange-500"}
100],Yf={twitter:"bg-foreground/10 text-foreground border-foreground/20",linkedin:"bg-blue-500/15 text-blue-400 border-blue-500/25",reddit:"bg-orange-500/15 text-orange-400 border-orange-500/25",facebook:"bg-blue-600/15 text-blue-300 border-blue-500/25",instagram:"bg-pink-500/15 text-pink-400 border-pink-500/25"},Kf={twitter:"bg-foreground",linkedin:"bg-blue-500",reddit:"bg-orange-500",facebook:"bg-blue-500",instagram:"bg-pink-500"},Xf={scheduled:"bg-primary/15 text-primary border-primary/25",posted:"bg-accent/15 text-accent border-accent/25",failed:"bg-destructive/15 text-destructive border-destructive/25",cancelled:"bg-muted text-muted-foreground border-border"},Qf=({userId:s})=>{const[t,a]=i.useState(new Date),[r,o]=i.useState("month"),[n,l]=i.useState([]),[c,x]=i.useState(!0),[d,u]=i.useState("all"),[m,p]=i.useState(null),[g,v]=i.useState(null),[b,z]=i.useState(null),C=i.useCallback(async()=>{x(!0);const{data:O,error:he}=await w.from("scheduled_posts").select("*").eq("user_id",s).order("scheduled_at",{ascending:!0});!he&&O&&l(O),x(!1)},[s]);i.useEffect(()=>{C()},[C]);const j=d==="all"?n:n.filter(O=>O.platform===d),y=(O,he)=>{he.status==="scheduled"&&(v(he),O.dataTransfer.effectAllowed="move",O.dataTransfer.setData("text/plain",he.id))},N=(O,he)=>{O.preventDefault(),O.dataTransfer.dropEffect="move",z(he)},f=()=>{z(null)},R=async(O,he)=>{if(O.preventDefault(),z(null),!g||g.status!=="scheduled")return;const re=new Date(g.scheduled_at),oe=new Date(he);if(oe.setHours(re.getHours(),re.getMinutes(),0,0),oe<=new Date){pt({title:"Cannot reschedule to the past",variant:"destructive"}),v(null);return}const{error:T}=await w.from("scheduled_posts").update({scheduled_at:oe.toISOString()}).eq("id",g.id);T?pt({title:"Failed to reschedule",variant:"destructive"}):(pt({title:"Post rescheduled",description:at(oe,"MMM d 'at' h:mm a")}),C()),v(null)},M=async O=>{const{error:he}=await w.from("scheduled_posts").update({status:"cancelled"}).eq("id",O);he||(pt({title:"Post cancelled"}),C(),p(null))},q=async O=>{const{error:he}=await w.from("scheduled_posts").delete().eq("id",O);he||(pt({title:"Post deleted"}),C(),p(null))},B=r==="month"?(()=>{const O=Xr(Ox(t),{weekStartsOn:0}),he=Fx(Bx(t),{weekStartsOn:0});return mo({start:O,end:he})})():(()=>{const O=Xr(t,{weekStartsOn:0});return mo({start:O,end:ji(O,6)})})(),P=O=>j.filter(he=>co(new Date(he.scheduled_at),O)),I=O=>{a(he=>r==="month"?O>0?$x(he,1):qx(he,1):O>0?Hx(he,1):Gx(he,1))},$=n.filter(O=>O.status==="scheduled").length,be=n.filter(O=>O.status==="posted").length,Y=n.filter(O=>O.status==="failed").length;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(Ea,{className:"h-5 w-5 text-primary"})," Content Calendar"]}),e.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[e.jsx("span",{className:"text-primary font-medium",children:$})," scheduled"]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[e.jsx("span",{className:"text-accent font-medium",children:be})," posted"]}),Y>0&&e.jsxs("span",{className:"text-xs text-destructive",children:[Y," failed"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{variant:"ghost",size:"sm",onClick:C,className:"gap-1.5 h-8",children:e.jsx(st,{className:Z("h-3.5 w-3.5",c&&"animate-spin")})}),e.jsxs("div",{className:"flex rounded-lg border border-border bg-card p-0.5 gap-0.5",children:[e.jsx("button",{onClick:()=>o("month"),className:Z("px-2.5 py-1 rounded-md text-xs font-medium transition-colors",r==="month"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:e.jsx(Rx,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:()=>o("week"),className:Z("px-2.5 py-1 rounded-md text-xs font-medium transition-colors",r==="week"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:e.jsx(Px,{className:"h-3.5 w-3.5"})})]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-1",children:[e.jsx(Ta,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),Vf.map(O=>e.jsxs("button",{onClick:()=>u(O.id),className:Z("px-3 py-1.5 rounded-full text-xs font-medium transition-all whitespace-nowrap border",d===O.i
100d?"bg-primary/15 text-primary border-primary/30":"text-muted-foreground border-border/50 hover:border-border hover:text-foreground"),children:[O.id!=="all"&&e.jsx("span",{className:"mr-1",children:O.icon}),O.label,O.id!=="all"&&e.jsxs("span",{className:"ml-1 opacity-60",children:["(",n.filter(he=>he.platform===O.id).length,")"]})]},O.id))]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>I(-1),className:"h-8 w-8 p-0",children:e.jsx(Mi,{className:"h-4 w-4"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h4",{className:"text-sm font-semibold",children:r==="month"?at(t,"MMMM yyyy"):`${at(Xr(t,{weekStartsOn:0}),"MMM d")} â ${at(ji(Xr(t,{weekStartsOn:0}),6),"MMM d, yyyy")}`}),e.jsx("button",{onClick:()=>a(new Date),className:"text-[10px] text-primary hover:underline",children:"Today"})]}),e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>I(1),className:"h-8 w-8 p-0",children:e.jsx($t,{className:"h-4 w-4"})})]}),e.jsxs(U,{className:"border-border/30 overflow-hidden",children:[e.jsx("div",{className:"grid grid-cols-7 border-b border-border/30",children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(O=>e.jsx("div",{className:"px-2 py-2 text-center text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:O},O))}),e.jsx("div",{className:Z("grid grid-cols-7",r==="week"?"grid-rows-1":""),children:B.map(O=>{const he=P(O),re=Mx(O,t),oe=b&&co(O,b);return e.jsxs("div",{onDragOver:T=>N(T,O),onDragLeave:f,onDrop:T=>R(T,O),className:Z("border-b border-r border-border/20 transition-colors",r==="week"?"min-h-[280px]":"min-h-[110px]",!re&&r==="month"&&"opacity-40",oe&&"bg-primary/10 ring-1 ring-inset ring-primary/30","relative group"),children:[e.jsxs("div",{className:"flex items-center justify-between px-2 py-1",children:[e.jsx("span",{className:Z("text-xs font-medium w-6 h-6 flex items-center justify-center rounded-full",Dx(O)?"bg-primary text-primary-foreground":"text-muted-foreground"),children:at(O,"d")}),he.length>0&&e.jsx("span",{className:"text-[9px] text-muted-foreground",children:he.length})]}),e.jsxs("div",{className:"px-1 pb-1 space-y-0.5",children:[he.slice(0,r==="week"?10:3).map(T=>e.jsx(Jf,{post:T,compact:r==="month",onDragStart:ce=>y(ce,T),onClick:()=>p(T)},T.id)),r==="month"&&he.length>3&&e.jsxs("button",{onClick:()=>{o("week"),a(O)},className:"text-[9px] text-primary hover:underline px-1",children:["+",he.length-3," more"]})]})]},O.toISOString())})})]}),e.jsx(gt,{open:!!m,onOpenChange:O=>!O&&p(null),children:e.jsx(dt,{className:"sm:max-w-lg",children:m&&e.jsxs(e.Fragment,{children:[e.jsx(mt,{children:e.jsxs(xt,{className:"flex items-center gap-2 text-base",children:[e.jsx(Bt,{className:"h-4 w-4 text-primary"})," Post Preview"]})}),e.jsxs("div",{className:"space-y-4 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(W,{className:Z("border text-xs",Yf[m.platform]||""),children:m.platform}),e.jsx(W,{className:Z("border text-xs",Xf[m.status]||""),children:m.status}),e.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(Cs,{className:"h-3 w-3"}),at(new Date(m.scheduled_at),"MMM d, yyyy 'at' h:mm a")]})]}),m.media_urls&&m.media_urls.length>0&&e.jsx("div",{className:"rounded-lg border border-border/30 overflow-hidden bg-muted/10",children:e.jsx("img",{src:m.media_urls[0],alt:"Post media",className:"w-full max-h-64 object-contain"})}),m.content?e.jsx(U,{className:"p-4 border-border/30 bg-muted/5",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:m.content})}):e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No caption"}),m.error_message&&e.jsx(U,{className:"p-3 border-destructive/30 bg-destructive/5",children:e.jsx("p",{className:"text-xs text-destructive",children:m.error_message})}),e.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[m.status==="scheduled"&&e.jsxs(h,{variant:"outline",size:"sm",onClick:()=>M(m.id),className:"gap-1.5 text-muted-foreground hover:text-destructive",children:[e.jsx(zs,{className:"h-3.5 w-3.5"})," Cancel"]}),(m.status==="cancelled"||m.status==="failed")&&e.jsxs(h,{variant:"outline",size:"sm",onClick:()=>q(m.id),className:"gap-1.5 text-destructive hover:text-destructive",children:[e.jsx(ua,{className:"h-3.5 w-3.5"})," Delete"]})]})]})]})})})]})};function Jf({post:s,compact:t,onDragStart:a,onClick:r}){var n;const o=s.status==="scheduled";return e.jsxs("button",{draggable:o,onDragStart:a,onClick:r,className:Z("w-full text-left rounded-md px-1.5 py-1 transition-all group/chip","hover:ring-1 hover:ring-primary/30 hover:shadow-sm",o&&"cursor-grab active:cursor-grabbing",!o&&"cursor-pointer opacity-70",t?"flex items-center gap-1":"space-y-1"),style:{touchAction:"none"},children:[e.jsx("div",{className:Z("w-2 h-2 rounded-full shrink-0",Kf[s.platform]||"bg-muted-foreground")}),t?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[10px] font-medium truncate flex-1",children:((n=s.content)==null?void 0:n.substring(0,25))||s.platform}),e.jsx("span",{className:"text-[9px] text-muted-foreground shrink-0",children:at(new Date(s.scheduled_at),"h:mma")})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-[10px] font-medium capitalize",children:s.platform}),e.jsx("span",{className:"text-[9px] text-muted-foreground ml-auto",children:at(new Date(s.scheduled_at),"h:mm a")})]}),s.content&&e.jsx("p",{className:"text-[10px] text-muted-foreground truncate leading-tight",children:s.content.substring(0,60)}),s.media_urls&&s.media_urls.length>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ga,{className:"h-2.5 w-2.5 text-muted-foreground"}),e.jsxs("span",{className:"text-[9px] text-muted-foreground",children:[s.media_urls.length," media"]})]})]})]})}function Vd({className:s,classNames:t,showOutsideDays:a=!0,...r}){return e.jsx(Ux,{showOutsideDays:a,className:Z("p-3",s),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:sp
100ace-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Z(Fr({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:Z(Fr({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...o})=>e.jsx(Mi,{className:"h-4 w-4"}),IconRight:({...o})=>e.jsx($t,{className:"h-4 w-4"})},...r})}Vd.displayName="Calendar";const Zf=({userId:s,imageDataUrl:t,caption:a,children:r,onScheduled:o})=>{const[n,l]=i.useState(!1),[c,x]=i.useState("linkedin"),[d,u]=i.useState(a||""),[m,p]=i.useState(new Date),[g,v]=i.useState("09:00"),[b,z]=i.useState(!1),C=async()=>{if(!m){pt({title:"Please select a date",variant:"destructive"});return}z(!0);try{const[j,y]=g.split(":").map(Number),N=new Date(m);if(N.setHours(j,y,0,0),N<=new Date){pt({title:"Scheduled time must be in the future",variant:"destructive"}),z(!1);return}let f=[];if(t){const M=await(await fetch(t)).blob(),q=`creative-${Date.now()}.png`,{data:_,error:A}=await w.storage.from("product-media").upload(`${s}/${q}`,M,{contentType:"image/png"});if(A)throw A;const{data:B}=w.storage.from("product-media").getPublicUrl(_.path);f=[B.publicUrl]}const{error:R}=await w.from("scheduled_posts").insert({user_id:s,platform:c,content:d||null,media_urls:f.length>0?f:null,scheduled_at:N.toISOString(),status:"scheduled"});if(R)throw R;pt({title:"Post scheduled!",description:`${c} · ${at(N,"MMM d 'at' h:mm a")}`}),l(!1),u(""),o==null||o()}catch(j){pt({title:"Failed to schedule",description:j.message,variant:"destructive"})}finally{z(!1)}};return e.jsxs(gt,{open:n,onOpenChange:l,children:[e.jsx(Cr,{asChild:!0,children:r}),e.jsxs(dt,{className:"sm:max-w-md",children:[e.jsx(mt,{children:e.jsxs(xt,{className:"flex items-center gap-2",children:[e.jsx(At,{className:"h-4 w-4 text-primary"})," Schedule Post"]})}),e.jsxs("div",{className:"space-y-4 pt-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs",children:"Platform"}),e.jsxs(Gs,{value:c,onValueChange:x,children:[e.jsx(qs,{children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"linkedin",children:"LinkedIn"}),e.jsx(Te,{value:"twitter",children:"X / Twitter"}),e.jsx(Te,{value:"facebook",children:"Facebook"}),e.jsx(Te,{value:"reddit",children:"Reddit"}),e.jsx(Te,{value:"instagram",children:"Instagram"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs",children:"Caption / Text (optional)"}),e.jsx(Vs,{value:d,onChange:j=>u(j.target.value),placeholder:"Write your post caption...",rows:3})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs",children:"Date"}),e.jsxs(Xi,{children:[e.jsx(Qi,{asChild:!0,children:e.jsxs(h,{variant:"outline",className:Z("w-full justify-start text-left font-normal",!m&&"text-muted-foreground"),children:[e.jsx(Ea,{className:"mr-2 h-4 w-4"}),m?at(m,"MMM d, yyyy"):"Pick date"]})}),e.jsx($n,{className:"w-auto p-0",align:"start",children:e.jsx(Vd,{mode:"single",selected:m,onSelect:p,disabled:j=>j<new Date(new Date().setHours(0,0,0,0)),className:Z("p-3 pointer-events-auto")})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{className:"text-xs",children:"Time"}),e.jsxs("div",{className:"relative",children:[e.jsx(Cs,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(Je,{type:"time",value:g,onChange:j=>v(j.target.value),className:"pl-9"})]})]})]}),t&&e.jsx("div",{className:"rounded-lg border border-border/30 overflow-hidden",children:e.jsx("img",{src:t,alt:"Creative preview",className:"w-full max-h-32 object-contain bg-muted/20"})}),e.jsxs(h,{onClick:C,disabled:b,className:"w-full gap-2",children:[b?e.jsx(Pe,{className:"h-4 w-4 animate-spin"}):e.jsx(At,{className:"h-4 w-4"}),"Schedule for ",m?at(m,"MMM d"):"..."," at ",g]})]})]})]})},eb={LinkedIn:3e3,"X / Twitter":280,Instagram:2200,"Instagram / TikTok":2200,Facebook:63206,"LinkedIn / Instagram":2200,"X / Twitter / LinkedIn":280,"Any Platform":2200},sb=({platform:s="Any Platform",templatePurpose:t,onCaptionChange:a})=>{const[r,o]=i.useState(""),[n,l]=i.useState(!1),[c,x]=i.useState(null),[d,u]=i.useState(!0),m=eb[s]||2200,p=r.length,g=p>m;i.useEffect(()=>
100{v()},[]),i.useEffect(()=>{a==null||a(r)},[r,a]);const v=async()=>{try{const{data:{user:C}}=await w.auth.getUser();if(!C)return;const{data:j}=await w.from("product_profiles").select("product_name, value_proposition, benefits, ideal_customer_profile, tone_guidelines").eq("user_id",C.id).maybeSingle();j&&x(j)}catch{}finally{u(!1)}},b=async C=>{if(!c){pt({title:"Set up your product profile first",description:"Go to Settings â Product Profile to configure your brand strategy.",variant:"destructive"});return}l(!0);try{const j={engage:`Write a conversational, engagement-focused ${s} caption. Ask a question or invite interaction. Goal: ${t||"engagement"}.`,promote:`Write a compelling promotional ${s} caption. Highlight benefits and include a CTA. Goal: ${t||"conversion"}.`,educate:`Write an educational ${s} caption that provides value. Share a tip or insight. Goal: ${t||"thought leadership"}.`},{data:y,error:N}=await w.functions.invoke("generate-comment",{body:{postContent:`Brand: ${c.product_name}. Value prop: ${c.value_proposition}. Benefits: ${c.benefits}. ICP: ${c.ideal_customer_profile}. ${c.tone_guidelines?`Tone: ${c.tone_guidelines}.`:""}`,productContext:j[C],platform:s.split(" / ")[0].toLowerCase()}});if(N)throw N;if(y!=null&&y.comment){const f=y.comment.length>m?y.comment.slice(0,m):y.comment;o(f),pt({title:"Caption generated from your strategy"})}}catch(j){pt({title:"Failed to generate",description:j.message,variant:"destructive"})}finally{l(!1)}},z=()=>{r&&(navigator.clipboard.writeText(r),pt({title:"Copied to clipboard"}))};return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"Caption & Copy"}),c&&e.jsxs(W,{variant:"outline",className:"text-[10px] gap-1",children:[e.jsx(ks,{className:"h-3 w-3"}),c.product_name]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsxs(h,{variant:"outline",size:"sm",onClick:()=>b("engage"),disabled:n||!c,className:"gap-1.5 text-xs h-7",children:[n?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):e.jsx(Es,{className:"h-3 w-3"}),"Engage"]}),e.jsxs(h,{variant:"outline",size:"sm",onClick:()=>b("promote"),disabled:n||!c,className:"gap-1.5 text-xs h-7",children:[n?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):e.jsx(Fi,{className:"h-3 w-3"}),"Promote"]}),e.jsxs(h,{variant:"outline",size:"sm",onClick:()=>b("educate"),disabled:n||!c,className:"gap-1.5 text-xs h-7",children:[n?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):e.jsx(es,{className:"h-3 w-3"}),"Educate"]}),r&&e.jsxs(h,{variant:"ghost",size:"sm",onClick:z,className:"gap-1.5 text-xs h-7 ml-auto",children:[e.jsx(ta,{className:"h-3 w-3"})," Copy"]})]}),!c&&!d&&e.jsx(U,{className:"p-3 border-dashed border-primary/30 bg-primary/5",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsx(es,{className:"h-3.5 w-3.5 inline mr-1 text-primary"}),"Set up your ",e.jsx("strong",{children:"Product Profile"})," in Settings to generate strategy-aligned captions automatically."]})}),e.jsxs("div",{className:"relative",children:[e.jsx(Vs,{value:r,onChange:C=>o(C.target.value),placeholder:`Write your ${s} caption here...`,className:"min-h-[120px] text-sm resize-none",maxLength:m+100}),e.jsxs("div",{className:`absolute bottom-2 right-3 text-[10px] ${g?"text-destructive font-semibold":"text-muted-foreground"}`,children:[p,"/",m]})]}),t&&e.jsxs("p",{className:"text-[10px] text-muted-foreground flex items-center gap-1",children:[e.jsx(Mc,{className:"h-3 w-3"})," Template goal: ",t]})]})},tb=({userId:s})=>{const[t,a]=i.useState(null),[r,o]=i.useState(null),[n,l]=i.useState(""),c=d=>{a(d),l("")},x=()=>{if(r)try{return r.toDataURL({format:"png",quality:1})}catch{return}};return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-display font-semibold",children:"Creative Studio"}),e.jsx("p",{className:"text-muted-foreground",children:"Design, generate, and schedule social media creatives."})]})}),e.jsxs(Ct,{defaultValue:"create",className:"space-y-4",children:[e.jsxs(wt,{className:"grid w-full max-w-md grid-cols-3",children:[e.jsxs(cs,{value:"create",className:"gap-1.5",children:[e.jsx(xo,{className:"h-3.5 w-3.5"})," Create"]}),e.jsxs(cs,{value:"brand",className:"gap-1.5",children:[e.jsx(In,{className:"h-3.5 w-3.5"})," Brand Kit"]}),e.jsxs(cs,{value:"calendar",className:"gap-1.5",children:[e.jsx(Ea,{className:"h-3.5 w-3.5"})," Calendar"]})]}),e.jsx(us,{value:"create",className:"space-y-4",children:e.jsxs("div",{className:"grid lg:grid-cols-[260px_1fr] gap-4",children:[e.jsx("div",{className:"space-y-4 lg:max-h-[calc(100vh-240p
100x)] lg:overflow-y-auto pr-1",children:e.jsx(Gf,{onSelect:c,selectedId:t==null?void 0:t.id})}),e.jsx("div",{className:"space-y-4",children:t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold",children:t.name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.platform," · ",t.width,"Ã",t.height]})]}),e.jsx(Zf,{userId:s,imageDataUrl:x(),caption:n,onScheduled:()=>{},children:e.jsxs(h,{variant:"outline",size:"sm",className:"gap-1.5",children:[e.jsx(At,{className:"h-3.5 w-3.5"})," Schedule Post"]})})]}),e.jsx(qf,{width:t.width,height:t.height,templateData:t.data,onCanvasReady:d=>o(d)}),e.jsx(sb,{platform:t.platform,templatePurpose:t.purpose,onCaptionChange:l})]}):e.jsx("div",{className:"flex items-center justify-center h-96 rounded-xl border border-dashed border-border/40 bg-card/20",children:e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx(xo,{className:"h-10 w-10 text-muted-foreground/30 mx-auto"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a template to start designing"})]})})})]})}),e.jsx(us,{value:"brand",children:e.jsx("div",{className:"max-w-lg",children:e.jsx(Wf,{})})}),e.jsx(us,{value:"calendar",children:e.jsx(Qf,{userId:s})})]})]})},ab=(s=!1)=>$i.divIcon({className:"",iconSize:[28,36],iconAnchor:[14,34],popupAnchor:[0,-30],html:` 101 <div style="position:relative;width:28px;height:36px;filter:drop-shadow(0 2px 4px hsl(0 0% 0% / 0.35));"> 102 <svg viewBox="0 0 28 36" width="28" height="36" xmlns="http://www.w3.org/2000/svg"> 103 <path d="M14 0C6.268 0 0 6.268 0 14c0 8.5 14 22 14 22s14-13.5 14-22C28 6.268 21.732 0 14 0z" 104 fill="hsl(var(--primary))" 105 stroke="${s?"hsl(var(--accent))":"hsl(var(--background))"}" 106 stroke-width="${s?2.5:2}" /> 107 <circle cx="14" cy="14" r="5" fill="hsl(var(--primary-foreground))" /> 108 </svg> 109 </div> 110 `}),rb=$i.divIcon({className:"",iconSize:[36,36],iconAnchor:[18,18],html:` 111 <div style="position:relative;width:36px;height:36px;"> 112 <div style="position:absolute;inset:0;border-radius:50%;background:hsl(var(--accent) / 0.25);animation:deshillerPulse 2s ease-out infinite;"></div> 113 <div style="position:absolute;inset:9px;border-radius:50%;background:hsl(var(--accent));border:2.5px solid hsl(var(--background));box-shadow:0 2px 8px hsl(0 0% 0% / 0.35);"></div> 114 </div> 115 <style> 116 @keyframes deshillerPulse { 117 0% { transform: scale(0.6); opacity: 0.9; } 118 100% { transform: scale(1.8); opacity: 0; } 119 } 120 </style> 121 `});function nb({center:s,radiusKm:t,businesses:a}){const r=Gc();return i.useEffect(()=>{if(!a.length){r.setView(s,13);return}const o=$i.latLngBounds(a.map(n=>[n.lat,n.lon]));o.extend(s),r.fitBounds(o.pad(.15),{animate:!0,duration:.6})},[a,s,t,r]),null}function ib({businesses:s,selectedId:t}){const a=Gc();return i.useEffect(()=>{if(!t)return;const r=s.find(o=>o.id===t);r&&a.flyTo([r.lat,r.lon],Math.max(a.getZoom(),15),{duration:.5})},[t,s,a]),null}function ob({center:s,radiusKm:t,businesses:a,selectedId:r,onSelect:o,onCenterChange:n,height:l=420}){const c=i.useRef(null),x=i.useMemo(()=>[s.lat,s.lon],[s.lat,s.lon]);return e.jsxs("div",{ref:c,className:"relative rounded-xl overflow-hidden border border-border/60 shadow-lg",style:{height:l},children:[e.jsxs(Wx,{center:x,zoom:13,scrollWheelZoom:!0,className:"h-full w-full [&_.leaflet-container]:bg-muted",style:{background:"hsl(var(--muted))"},children:[e.jsx(Vx,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),e.jsx(Yx,{center:x,radius:t*1e3,pathOptions:{color:"hsl(var(--primary))",weight:1.5,opacity:.6,fillColor:"hsl(var(--primary))",fillOpacity:.06}}),e.jsx(uo,{position:x,icon:rb,draggable:!!n,eventHandlers:n?{dragend:d=>{const{lat:u,lng:m}=d.target.getLatLng();n(u,m)}}:void 0,children:e.jsxs(ho,{children:[e.jsx("div",{className:"text-xs font-medium",children:"Search center"}),n&&e.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Drag to re-center"})]})}),a.map(d=>e.jsx(uo,{position:[d.lat,d.lon],icon:ab(r===d.id),eventHandlers:{click:()=>o(d.id)},children:e.jsx(ho,{children:e.jsxs("div",{className:"space-y-1 min-w-[180px]",children:[e.jsx("div",{className:"font-semibold text-sm",children:d.name}),e.jsx("div",{className:"text-xs capitalize opacity-70",children:String(d.type).replace(/_/g," ")}),d.address&&e.jsx("div",{className:"text-[11px] opacity-70",children:d.address}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-1",children:[d.stars!=null&&e.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary",children:["â ",d.stars.toFixed(1),d.reviews!=null?` (${d.reviews})`:""]}),d.open_now===!0&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-accent/10 text-accent",children:"Open now"}),d.has_website&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-muted",children:"Website"})]})]})})},d.id)),e.jsx(nb,{center:x,radiusKm:t,businesses:a}),e.jsx(ib,{businesses:a,selectedId:r})]}),e.jsxs("div",{className:"pointer-events-none absolute bottom-3 left-3 bg-card/95 backdrop-blur-sm border border-border/60 rounded-lg px-3 py-2 text-[11px] shadow-md",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-full bg-accent ring-2 ring-background"}),e.jsx("span",{className:"text-muted-foreground",children:"Search center (drag to move)"})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("span",{className:"inline-block w-2.5 h-3 bg-primary",style:{clipPath:"pol
121ygon(50% 100%, 0 40%, 50% 0, 100% 40%)"}}),e.jsxs("span",{className:"text-muted-foreground",children:[a.length," businesses"]})]})]})]})}const lb=[{v:"restaurant",l:"Restaurants & Food"},{v:"cafe",l:"Cafés & Coffee Shops"},{v:"bar",l:"Bars & Pubs"},{v:"hotel",l:"Hotels & Lodging"},{v:"gym",l:"Gyms & Fitness"},{v:"salon",l:"Salons & Beauty"},{v:"dentist",l:"Dentists"},{v:"doctor",l:"Doctors & Clinics"},{v:"lawyer",l:"Lawyers"},{v:"accountant",l:"Accountants"},{v:"real_estate",l:"Real Estate"},{v:"retail",l:"Retail Shops"},{v:"car_dealer",l:"Auto Dealers & Repair"},{v:"bakery",l:"Bakeries"},{v:"pharmacy",l:"Pharmacies"},{v:"veterinary",l:"Veterinary"},{v:"florist",l:"Florists"},{v:"plumber",l:"Plumbers"},{v:"electrician",l:"Electricians"},{v:"contractor",l:"Contractors"}];function cb({userId:s}){var Rs,ge,Ue,vs,Qs;const[t,a]=i.useState(""),[r,o]=i.useState("restaurant"),[n,l]=i.useState(5),[c,x]=i.useState(!0),[d,u]=i.useState(!1),[m,p]=i.useState(!1),[g,v]=i.useState(!0),[b,z]=i.useState(!1),[C,j]=i.useState(0),[y,N]=i.useState(0),[f,R]=i.useState([]),[M,q]=i.useState(""),[_,A]=i.useState("any"),[B,P]=i.useState(30),[I,$]=i.useState(!1),[be,Y]=i.useState([]),[O,he]=i.useState(null),[re,oe]=i.useState(null),[T,ce]=i.useState(null),[le,F]=i.useState({}),[L,K]=i.useState(null),[ue,Ne]=i.useState(!1),[fe,me]=i.useState(null),[Ie,Q]=i.useState(""),[ne,ke]=i.useState(""),[ee,E]=i.useState(""),[xe,ve]=i.useState(!1),[S,J]=i.useState(null),je=i.useRef({}),[se,Oe]=i.useState(new Set),[We,H]=i.useState(!1),ae=V=>Oe(we=>{const De=new Set(we);return De.has(V)?De.delete(V):De.add(V),De}),[ze,pe]=i.useState([]),[Ae,Ee]=i.useState(!1),[ls,ss]=i.useState(!1),[$s,Xs]=i.useState(!1),xs=i.useRef(null),de=i.useRef(null);i.useEffect(()=>{const V=t.trim();if(V.length<3){pe([]),ss(!1);return}const we=setTimeout(async()=>{var De;try{(De=xs.current)==null||De.abort();const Re=new AbortController;xs.current=Re,ss(!0);const Le=`https://nominatim.openstreetmap.org/search?format=json&limit=5&addressdetails=0&q=${encodeURIComponent(V)}`,Ke=await fetch(Le,{signal:Re.signal,headers:{"Accept-Language":"en"}});if(!Ke.ok)throw new Error("geocode failed");const qe=await Ke.json(),ds=(Array.isArray(qe)?qe:[]).map(hs=>({display:hs.display_name,lat:parseFloat(hs.lat),lon:parseFloat(hs.lon)})).filter(hs=>Number.isFinite(hs.lat)&&Number.isFinite(hs.lon));pe(ds)}catch{}finally{ss(!1)}},350);return()=>clearTimeout(we)},[t]),i.useEffect(()=>{const V=we=>{de.current&&!de.current.contains(we.target)&&Ee(!1)};return document.addEventListener("mousedown",V),()=>document.removeEventListener("mousedown",V)},[]);const D=i.useCallback(()=>{if(!("geolocation"in navigator)){k.error("Geolocation isn't available in this browser");return}Xs(!0),navigator.geolocation.getCurrentPosition(V=>{const{latitude:we,longitude:De}=V.coords;Xs(!1);const Re=`${we.toFixed(4)}, ${De.toFixed(4)}`;a(Re),Ee(!1),oe({lat:we,lon:De}),X({lat:we,lon:De,label:Re})},V=>{Xs(!1),k.error(V.code===V.PERMISSION_DENIED?"Location permission denied â type a city instead":"Couldn't read your location â type a city instead")},{enableHighAccuracy:!1,timeout:8e3,maximumAge:6e4})},[]),te=i.useCallback(V=>{a(V.display),Ee(!1),pe([]),oe({lat:V.lat,lon:V.lon}),X({lat:V.lat,lon:V.lon,label:V.display})},[]),X=i.useCallback(async V=>{var we,De,Re;if(!V&&!t.trim())return k.error("Enter a location to search");$(!0),Y([]),ce(null),F({});try{const{data:Le,error:Ke}=await w.functions.invoke("local-business-search",{body:{location:(V==null?void 0:V.label)??t,lat:V==null?void 0:V.lat,lon:V==null?void 0:V.lon,businessType:r,radiusKm:n,requireWebsite:c,requirePhone:d,requireAddress:m,excludeChains:g,openNow:b,minStars:C,minReviews:y,keywords:f,keywordMode:_,limit:B}});if(Ke)throw Ke;if(Le!=null&&Le.error)throw Le.usage&&J(Le.usage),new Error(Le.reason||Le.error);const qe=Le.businesses||[];Y(qe),he(((we=Le.location)==null?void 0:we.display)??null),((De=Le==null?void 0:Le.location)==null?void 0:De.lat)!=null&&((Re=Le==null?void 0:Le.location)==null?void 0:Re.lon)!=null&&oe({lat:Le.location.lat,lon:Le.location.lon}),Le.usage&&J(Le.usage);const ds=qe.filter(hs=>hs.website).length;if(k.success(`Found ${qe.length} businesses · ${Le.discoveries_used} discoveries used`),ds>0){k.info(`Auto-extracting emails for ${ds} websitesâ¦`,{duration:2500});const hs=qe.filter(Se=>Se.website).slice(0,25),js=3;let Bs=0;const et=Array.from({length:Math.min(js,hs.length)},async()=>{for(;Bs<hs.length;){const Se=Bs++;try{await Ge(hs[Se])}catch{}}});Promise.all(et).catch(()=>{})}}catch(Le){k.error((Le==null?void 0:Le.message)||"Search failed")}finally{$(!1)}},[t,r,n,c,d,m,g,b,C,y,f,_,B]),ie=i.useCallback((V,we)=>{oe({lat:V,lon:we}),X({lat:V,lon:we,label:`${V.toFixed(4)}, ${we.toFixed(4)}`})},[X]),_e=i.useCallback(V=>{ce(V);const we=je.current[V];we&&we.scrollIntoView({behavior:"smooth",block:"center"})},[]),Me=V=>{var De;return(V.emails||[]).some(Re=>Re.sameDomain||Re.confidence&&Re.confidence!=="low")||!!V.contact_url||(((De=V.phones)==null?void 0:De.length)??0)>0},Ge=async(V,we)=>{if(!V.website)return;F(Le=>({...Le,[V.id]:{...Le[V.id]||{},loading:!0,error:void 0}}));const De=await qn(2e3);let Re=null;if(De&&!(we!=null&&we.deep)){const Le=`em_${V.id}_${Date.now()}`;if(Re=await new Promise(Ke=>{const qe=setTimeout(()=>{window.removeEventListener("message",ds),Ke({success:!1,error:"Extension timeout"})},35e3),ds=hs=>{var js;((js=hs==null?void 0:hs.data)==null?void 0:js.type)==="DESHILLER_EXTRACT_BUSINESS_EMAILS_RESPONSE"&&hs.data.requestId===Le&&(clearTimeout(qe),window.removeEventListener("message",ds),Ke(hs.data))};window.addEventListener("message",ds),window.postMessage({type:"DESHILLER_EXTRACT_BUSINESS_EMAILS",website:V.website,businessId:V.id,requestId:Le},"*")}),Re!=null&&Re.success&&Me(Re)){F(Ke=>({...Ke,[V.id]:{emails:Re.emails||[],phones:Re.phones||[],contact_url:Re.contact_url??null,reliable:!0,source:"extension"}}));return}}try{const{data:Le,error:Ke}=await w.functions.invoke("extract-business-email",{body:{website:V.website,deep:!!(we!=null&&we.deep)}});if(Ke)throw Ke;if(Le!=null&&Le.error)throw new Error(Le.error);let qe={emails:Le.emails||[],phones:Le.phones||[],contact_url:Le.contact_url??null,reliable:!!Le.reliable,reasons:Le.reasons||[],deepTried:!!(we!=null&&we.deep),source:we!=null&&we.deep?"server-deep":"server"};if(Re!=null&&Re.success){const ds=Re.emails||[],hs=new Set(qe.emails.map(Bs=>Bs.email.toLowerCase()));for(const Bs of ds)hs.has(Bs.email.toLowerCase())||qe.emails.push(Bs);const js=new Set(qe.phones);for(const Bs of Re.phones||[])js.has(Bs)||qe.phones.push(Bs);!qe.contact_url&&Re.contact_url&&(qe.contact_url=Re.contact_url),qe.reliable=qe.reliable||Me(qe)}if(!qe.reliable&&!(we!=null&&we.deep)){F(ds=>({...ds,[V.id]:{...qe,loading:!0}}));try{const{data:ds,error:hs}=await w.functions.invoke("extract-business-email",{body:{website:V.website,deep:!0}});if(!hs&&!(ds!=null&&ds.error)&&ds){const js=new Set(qe.emails.map(et=>et.email.toLowerCase()));for(const et of ds.emails||[])js.has(et.email.toLowerCase())||qe.emails.push(et);const Bs=new Set(qe.phones);for(const et of ds.phones||[])Bs.has(et)||qe.phones.push(et);!qe.contact_url&&ds.contact_url&&(qe.contact_url=ds.contact_url),qe.reasons=ds.reasons||qe.reasons,qe.deepTried=!0,qe.source="server-deep",qe.reliable=!!ds.reliable||Me(qe)}}catch{}}F(ds=>({...ds,[V.id]:qe}))}catch(Le){F(Ke=>({...Ke,[V.id]:{error:(Le==null?void 0:Le.message)||"Extraction failed",emails:[],phones:[],reliable:!1}}))}},G=async()=>{const V=be.filter(we=>{var De;return we.website&&!((De=le[we.id])!=null&&De.emails)});if(V.length===0)return k.info("No new websites to extract");ve(!0),k.info(`Extracting from ${V.length} sites â using a single tab to stay safe.`);try{for(const we of V)await Ge(we);window.postMessage({type:"DESHILLER_RELEASE_LOCAL_MARKETING_TAB"},"*"),k.success("Bulk extraction complete")}finally{ve(!1)}},Fe=V=>
121{navigator.clipboard.writeText(V).then(()=>k.success("Email copied"))},He=async V=>{var Re,Le;const we=le[V.id],De=((Re=((we==null?void 0:we.emails)||[]).find(Ke=>Ke.confidence==="high"))==null?void 0:Re.email)||((Le=((we==null?void 0:we.emails)||[])[0])==null?void 0:Le.email)||V.email||"";K(V),E(De),Q(""),ke(""),me(null),Ne(!0);try{const{data:Ke,error:qe}=await w.functions.invoke("draft-business-outreach",{body:{business:{name:V.name,type:V.type,address:V.address,website:V.website,has_website:!!V.website,stars:V.stars,reviews:V.reviews}}});if(qe)throw qe;if(Ke!=null&&Ke.error)throw new Error(Ke.error);Q(Ke.subject||`Quick note for ${V.name}`),ke(Ke.body||"")}catch(Ke){me((Ke==null?void 0:Ke.message)||"Could not draft message"),Q(`Quick note for ${V.name}`),ke("")}finally{Ne(!1)}},ts=()=>{if(!L)return;const V=ee.trim();if(!V)return k.error("No email address â use 'Open contact form' instead.");const we=`mailto:${encodeURIComponent(V)}?subject=${encodeURIComponent(Ie)}&body=${encodeURIComponent(ne)}`;window.location.href=we,k.success("Opening your mail clientâ¦"),K(null)},As=async()=>{if(!L)return;const V=le[L.id],we=(V==null?void 0:V.contact_url)||(L.website?`${L.website.replace(/\/$/,"")}/contact`:null);if(!we)return k.error("No contact page detected for this business.");try{await navigator.clipboard.writeText(`Subject: ${Ie} 122 123${ne}`),k.success("Message copied â paste it into the contact form.")}catch{k.info("Opening contact form (clipboard blocked â copy manually).")}window.open(we,"_blank","noopener,noreferrer"),K(null)};return e.jsxs("div",{className:"animate-fade-in space-y-6 relative",children:[e.jsx("div",{className:"absolute -top-12 left-1/4 w-96 h-96 rounded-full bg-primary/10 blur-3xl pointer-events-none -z-10"}),e.jsx("div",{className:"absolute top-32 right-0 w-72 h-72 rounded-full bg-accent/10 blur-3xl pointer-events-none -z-10"}),e.jsx("div",{className:"sticky top-16 z-30 -mx-1 px-1 pt-1 pb-1",children:e.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-border/50 bg-card/70 backdrop-blur-xl shadow-[0_8px_32px_-12px_hsl(var(--primary)/0.25)]",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/[0.06] via-transparent to-accent/[0.05] pointer-events-none"}),e.jsxs("div",{className:"relative flex items-start gap-4 p-5 md:p-6",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-gradient-to-br from-primary/25 to-accent/20 flex items-center justify-center border border-primary/20 shadow-md shadow-primary/10 shrink-0",children:e.jsx(er,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/80 font-medium",children:"Local Businesses"}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-muted-foreground/40"}),e.jsx(W,{variant:"outline",className:"border-accent/40 text-accent text-[9px] py-0 px-1.5 h-4",children:"NEW"})]}),e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold tracking-tight text-foreground",children:"Find local businesses & their contacts"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 max-w-2xl leading-relaxed",children:"Search by city and category, then let the extension extract contact emails straight from each business website â automatically after every search."})]})]})]})}),e.jsxs(U,{className:"p-5 bg-gradient-to-br from-card to-card/50 border-border/60",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-4",children:[e.jsxs("div",{className:"md:col-span-5 space-y-1.5",children:[e.jsxs(Ce,{htmlFor:"loc",className:"text-xs font-medium flex items-center gap-1.5",children:[e.jsx(er,{className:"h-3.5 w-3.5 text-primary"})," Location"]}),e.jsxs("div",{ref:de,className:"relative",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Je,{id:"loc",placeholder:"Type a city, neighborhood, or zipâ¦",value:t,onChange:V=>{a(V.target.value),Ee(!0)},onFocus:()=>Ee(!0),onKeyDown:V=>{V.key==="Enter"?(V.preventDefault(),ze.length>0?te(ze[0]):X()):V.key==="Escape"&&Ee(!1)},className:"bg-background pr-9",autoComplete:"off"}),ls&&e.jsx(Pe,{className:"absolute right-2.5 top-1/2 -translate-y-1/2 h-4 w-4 animate-spin text-muted-foreground"})]}),e.jsx(h,{type:"button",variant:"outline",size:"icon",onClick:D,disabled:$s,title:"Use my current location",className:"shrink-0",children:$s?e.jsx(Pe,{className:"h-4 w-4 animate-spin"}):e.jsx(zi,{className:"h-4 w-4"})})]}),Ae&&ze.length>0&&e.jsx("div",{className:"absolute z-50 left-0 right-0 mt-1 bg-popover border border-border rounded-md shadow-lg overflow-hidden max-h-72 overflow-y-auto",children:ze.map((V,we)=>e.jsxs("button",{type:"button",onClick:()=>te(V),className:"w-full text-left px-3 py-2 text-sm hover:bg-accent/50 transition-colors flex items-start gap-2 border-b border-border/40 last:border-0",children:[e.jsx(er,{className:"h-3.5 w-3.5 text-primary mt-0.5 shrink-0"}),e.jsx("span",{className:"line-clamp-2 leading-snug",children:V.display})]},`${V.lat}-${V.lon}-${we}`))}),Ae&&!ls&&t.trim().length>=3&&ze.length===0&&e.jsx("div",{className:"absolute z-50 left-0 right-0 mt-1 bg-popover border border-border rounded-md shadow-lg px-3 py-2 text-xs text-muted-foreground",children:"No matching places â try a broader name (e.g. just the city)."})]})]}),e.jsxs("div",{className:"md:col-span-4 space-y-1.5",children:[e.jsxs(Ce,{className:"text-xs font-medium flex items-center gap-1.5",children:[e.jsx(fa,{className:"h-3.5 w-3.5 text-primary"})," Business type"]}),e.jsxs(Gs,{value:r,onValueChange:o,children:[e.jsx(qs,{className:"bg-background",children:e.jsx(Us,{})}),e.jsx(Hs,{className:"max-h-72",children:lb.map(V=>e.jsx(Te,{value:V.v,children:V.l},V.v))})]})]}),e.jsxs("div",{className:"md:col-span-3 space-y-1.5",children:[e.jsxs(Ce,{className:"text-xs font-medium",children:["Radius: ",e.jsxs("span",{className:"text-primary",children:[n," km"]})]}),e.jsx(Kt,{min:1,max:50,step:1,value:[n],onValueChange:V=>l(V[0]),className:"py-2"})]})]}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-border/40 flex flex-wrap items-center gap-x-6 gap-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(Ta,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground font-medium",children:"Filters:"})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[e.jsx(Js,{checked:c,onCheckedChange:x}),e.jsx("span",{children:"Has website"})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[e.jsx(Js,{checked:d,onCheckedChange:u}),e.jsx("span",{children:"Has phone"})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[e.jsx(Js,{checked:m,onCheckedChange:p}),e.jsx("span",{children:"Has address"})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[e.jsx(Js,{checked:g,onCheckedChange:v}),e.jsx("span",{children:"Exclude chains"})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",title:"Requires the business to publish opening hours in OpenStreetMap",children:[e.jsx(Js,{checked:b,onCheckedChange:z}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Cs,{className:"h-3.5 w-3.5"})," Open now"]})]})]}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-border/40 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[e.jsxs(Ce,{className:"text-xs font-medium flex items-center gap-1.5",children:[e.jsx(Mr,{className:"h-3.5 w-3.5 text-primary"})," Keywords",e.jsx("span",{className:"text-muted-foreground font-normal",children:"(matches name, type, cuisine, description, brand)"})]}),e.jsxs("div",{className:"inline-flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:"Match:"}),e.jsxs(Gs,{value:_,onValueChange:V=>A(V),children:[e.jsx(qs,{className:"h-7 w-24 bg-background text-xs",children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"any",children:"Any"}),e.jsx(Te,{value:"all",children:"All"})]})]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.map(V=>e.jsxs(W,{variant:"secondary",className:"gap-1.5 pr-1 py-1 bg-primary/10 text-primary border-primary/20 hover:bg-primary/15",children:[V,e.jsx("button",{type:"button",onClick:()=>R(we=>we.filter(De=>De!==V)),className:"rounded-full hover:bg-primary/20 p-0.5 transition-colors","aria-label":`Remove ${V}`,children:e.jsx(zs,{className:"h-3 w-3"})})]},V)),e.jsx(Je,{value:M,onChange:V=>{const we=V.target.value;if(we.includes(",")){const De=we.split(",").map(Re=>
123Re.trim()).filter(Boolean);De.length&&R(Re=>{const Le=[...Re];for(const Ke of De){const qe=Ke.toLowerCase();!Le.some(ds=>ds.toLowerCase()===qe)&&Le.length<10&&Le.push(Ke)}return Le}),q("")}else q(we)},onKeyDown:V=>{if(V.key==="Enter"){V.preventDefault();const we=M.trim();if(!we)return;R(De=>{const Re=we.toLowerCase();return De.some(Le=>Le.toLowerCase()===Re)||De.length>=10?De:[...De,we]}),q("")}else V.key==="Backspace"&&!M&&f.length>0&&R(we=>we.slice(0,-1))},placeholder:f.length===0?'e.g. "vegan, organic, gluten-free" â press Enter or comma':"Add anotherâ¦",className:"bg-background flex-1 min-w-[220px] h-8 text-sm","aria-label":"Add keyword"}),f.length>0&&e.jsx(h,{type:"button",variant:"ghost",size:"sm",onClick:()=>R([]),className:"h-8 text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-end gap-x-6 gap-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ce,{className:"text-xs font-medium inline-flex items-center gap-1.5",children:[e.jsx(tr,{className:"h-3.5 w-3.5 text-primary"}),"Min stars: ",e.jsx("span",{className:"text-primary",children:C>0?C.toFixed(1):"Any"})]}),e.jsx("div",{className:"w-44",children:e.jsx(Kt,{min:0,max:5,step:.5,value:[C],onValueChange:V=>j(V[0])})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ce,{className:"text-xs font-medium",children:["Min reviews: ",e.jsx("span",{className:"text-primary",children:y>0?y:"Any"})]}),e.jsx("div",{className:"w-44",children:e.jsx(Kt,{min:0,max:500,step:10,value:[y],onValueChange:V=>N(V[0])})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm ml-auto",children:[e.jsx("span",{className:"text-muted-foreground",children:"Limit:"}),e.jsxs(Gs,{value:String(B),onValueChange:V=>P(parseInt(V,10)),children:[e.jsx(qs,{className:"w-20 h-8 bg-background",children:e.jsx(Us,{})}),e.jsx(Hs,{children:[10,20,30,50,100].map(V=>e.jsx(Te,{value:String(V),children:V},V))})]}),e.jsxs(h,{onClick:()=>X(),disabled:I||!t.trim(),className:"gap-2",children:[I?e.jsx(Pe,{className:"h-4 w-4 animate-spin"}):e.jsx(Ks,{className:"h-4 w-4"}),"Search"]})]})]}),(C>0||y>0)&&e.jsxs("p",{className:"text-[11px] text-muted-foreground/80 mt-2 flex items-start gap-1.5",children:[e.jsx(Ss,{className:"h-3 w-3 text-primary mt-0.5 shrink-0"}),"Ratings & review counts come from OpenStreetMap tags and aren't universally populated â businesses without a rating are kept by default so you don't lose leads."]}),e.jsxs("p",{className:"text-[11px] text-muted-foreground/80 mt-3 flex items-start gap-1.5",children:[e.jsx(es,{className:"h-3 w-3 text-primary mt-0.5 shrink-0"}),"Each business returned consumes ",e.jsx("strong",{className:"text-foreground",children:"1 discovery"})," from your monthly quota."]})]}),S&&e.jsxs(U,{className:"p-4 bg-gradient-to-br from-primary/5 via-card to-card border-primary/20",children:[e.jsxs("div",{className:"flex items-start justify-between flex-wrap gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-primary/15 flex items-center justify-center shrink-0",children:e.jsx(un,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"Discovery usage"}),e.jsxs(W,{variant:"outline",className:"text-[10px] capitalize border-primary/30 text-primary",children:[S.tier," plan"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:S.charged>0?e.jsxs(e.Fragment,{children:["This search charged ",e.jsx("strong",{className:"text-foreground",children:S.charged})," ",S.charged===1?"discovery":"discoveries"," (1 per business returned)."," ",S.charged_to_free>0&&e.jsxs(e.Fragment,{children:[S.charged_to_free," from free quota"]}),S.charged_to_free>0&&S.charged_to_paid>0&&e.jsx(e.Fragment,{children:" · "}),S.charged_to_paid>0&&e.jsxs(e.Fragment,{children:[S.charged_to_paid," from purchased pack"]})]}):e.jsx(e.Fragment,{children:"No businesses were returned â nothing was charged."})})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 text-xs",children:[e.jsxs("div",{className:"px-3 py-2 rounded-lg bg-muted/40 border border-border/40 min-w-[84px]",children:[e.jsx("div",{className:"text-muted-foreground text-[10px] uppercase tracking-wide",children:"Free used"}),e.jsxs("div",{className:"font-semibold text-foreground",children:[S.free_used_after,e.jsxs("span",{className:"text-muted-foreground font-normal",children:[" / ",S.tier_limit]})]})]}),e.jsxs("div",{className:"px-3 py-2 rounded-lg bg-muted/40 border border-border/40 min-w-[84px]",children:[e.jsx("div",{className:"text-muted-foreground text-[10px] uppercase tracking-wide",children:"Pack left"}),e.jsx("div",{className:"font-semibold text-foreground",children:S.paid_after})]}),e.jsxs("div",{className:"px-3 py-2 rounded-lg bg-accent/10 border border-accent/30 min-w-[84px]",children:[e.jsx("div",{className:"text-accent/80 text-[10px] uppercase tracking-wide",children:"Total left"}),e.jsx("div",{className:"font-semibold text-accent",children:S.total_remaining})]})]})]}),e.jsx("div",{className:"mt-3",children:e.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-primary to-accent transition-all",style:{width:`${Math.min(100,Math.round(S.free_used_after/Math.max(1,S.tier_limit)*100))}%`}})})})]}),be.length>0&&re&&(()=>{const V=be.filter(Se=>Se.website),we=V.length,De=V.filter(Se=>{var Is;return le[Se.id]&&!((Is=le[Se.id])!=null&&Is.loading)}).length,Re=V.filter(Se=>{var Is;return(Is=le[Se.id])==null?void 0:Is.error}).length,Le=V.filter(Se=>{var Is,Xe;return(((Xe=(Is=le[Se.id])==null?void 0:Is.emails)==null?void 0:Xe.length)??0)>0}
123).length,Ke=V.filter(Se=>{var Is,Xe;return(((Xe=(Is=le[Se.id])==null?void 0:Is.phones)==null?void 0:Xe.length)??0)>0}).length,qe=we-De>0,ds=we===0?0:Math.round(De/we*100),hs=Se=>{var It;const Is=le[Se.id];let Xe=0;Se.has_website&&(Xe+=15),(Se.has_phone||(((It=Is==null?void 0:Is.phones)==null?void 0:It.length)??0)>0)&&(Xe+=25);const Pt=(Is==null?void 0:Is.emails)??[];return Pt.length>0&&(Xe+=25),Pt.some(ut=>ut.confidence==="high")?Xe+=25:Pt.some(ut=>ut.confidence==="medium")&&(Xe+=12),Se.address&&(Xe+=5),(Se.stars??0)>=4&&(Xe+=5),Xe},js=(Se,Is)=>{var Pt,It;const Xe=le[Se.id];switch(Is){case"has_website":return!!Se.website;case"has_phone":return!!Se.has_phone||(((Pt=Xe==null?void 0:Xe.phones)==null?void 0:Pt.length)??0)>0;case"has_email":return(((It=Xe==null?void 0:Xe.emails)==null?void 0:It.length)??0)>0;case"high_conf":return((Xe==null?void 0:Xe.emails)??[]).some(ut=>ut.confidence==="high");case"address":return!!Se.address;default:return!0}},Bs={has_website:be.filter(Se=>js(Se,"has_website")).length,has_phone:be.filter(Se=>js(Se,"has_phone")).length,has_email:be.filter(Se=>js(Se,"has_email")).length,high_conf:be.filter(Se=>js(Se,"high_conf")).length,address:be.filter(Se=>js(Se,"address")).length};let et=be.filter(Se=>Array.from(se).every(Is=>js(Se,Is)));return We&&(et=[...et].sort((Se,Is)=>hs(Is)-hs(Se))),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-base font-semibold",children:[be.length," businesses found"]}),O&&e.jsxs("p",{className:"text-xs text-muted-foreground truncate max-w-md",children:["Centered on ",O," · drag the pin on the map to re-search"]})]}),e.jsxs(h,{onClick:G,disabled:xe,variant:"outline",className:"gap-2",children:[xe?e.jsx(Pe,{className:"h-4 w-4 animate-spin"}):e.jsx(Fs,{className:"h-4 w-4"}),"Extract all emails (",be.filter(Se=>{var Is;return Se.website&&!((Is=le[Se.id])!=null&&Is.emails)}).length,")"]})]}),we>0&&e.jsxs(U,{className:"p-3 border-border/60 bg-gradient-to-br from-primary/5 to-transparent",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium",children:[qe?e.jsx(Pe,{className:"h-3.5 w-3.5 animate-spin text-primary"}):e.jsx(ys,{className:"h-3.5 w-3.5 text-accent"}),e.jsxs("span",{children:[qe?"Auto-enriching contacts":"Enrichment complete"," · ",De,"/",we]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px]",children:[e.jsxs(W,{variant:"outline",className:"gap-1 h-5",children:[e.jsx(Fs,{className:"h-2.5 w-2.5"}),Le," emails"]}),e.jsxs(W,{variant:"outline",className:"gap-1 h-5",children:[e.jsx(an,{className:"h-2.5 w-2.5"}),Ke," phones"]}),Re>0&&e.jsxs(W,{variant:"outline",className:"gap-1 h-5 text-destructive border-destructive/40",children:[e.jsx(Ss,{className:"h-2.5 w-2.5"}),Re," failed"]})]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-primary to-accent transition-all",style:{width:`${ds}%`}})})]}),e.jsx(Dd,{totalCount:be.length,visibleCount:et.length,activeFilters:se,onFilterToggle:ae,sortByReachability:We,onSortToggle:H,toggles:[{key:"has_website",label:"Has website",matchCount:Bs.has_website,hint:"Business has a public website (required for email extraction)"},{key:"has_phone",label:"Has phone",matchCount:Bs.has_phone,hint:"Direct phone number is available"},{key:"has_email",label:"Email found",matchCount:Bs.has_email,hint:"At least one email was extracted from the site"},{key:"high_conf",label:"High-confidence email",matchCount:Bs.high_conf,hint:"Email matches the business domain â most reliable"},{key:"address",label:"Address listed",matchCount:Bs.address,hint:"Has a verifiable street address"}]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-4",children:[e.jsx("div",{className:"lg:col-span-3 lg:sticky lg:top-4 lg:self-start",children:e.jsx(ob,{center:re,radiusKm:n,businesses:be.map(Se=>({id:Se.id,name:Se.name,type:Se.type,address:Se.address,lat:Se.lat,lon:Se.lon,has_website:Se.has_website,has_phone:Se.has_phone,stars:Se.stars,reviews:Se.reviews,open_now:Se.open_now})),selectedId:T,onSelect:_e,onCenterChange:ie,height:520})}),e.jsxs("div",{className:"lg:col-span-2 space-y-3 lg:max-h-[520px] lg:overflow-y-auto lg:pr-2",children:[et.length===0&&e.jsx(U,{className:"p-6 text-center border-dashed",children:e.jsx("p",{className:"text-xs text-muted-foreground",children:"No businesses match the active reachability filters â try clearing one."})}),et.map((Se,Is)=>{var It,ut,Ds,Ye;const Xe=le[Se.id],Pt=T===Se.id;return e.jsxs(U,{ref:Qe=>{je.current[Se.id]=Qe},onClick:()=>ce(Se.id),className:Z("p-4 cursor-pointer transition-all group relative overflow-hidden",Pt?"border-primary/70 shadow-lg shadow-primary/10 bg-gradient-to-br from-primary/5 to-transparent":"border-border/60 hover:border-primary/40 hover:shadow-md"),children:[e.jsxs("div",{className:"absolute top-3 right-3 flex items-center gap-1.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 h-6 px-2 rounded-full bg-primary/10 text-primary text-[10px] font-medium",title:"This business counted as 1 discovery against your quota",children:[e.jsx(un,{className:"h-3 w-3"}),Se.discovery_cost??1]}),e.jsx("div",{className:Z("h-6 w-6 rounded-full flex items-center justify-center text-[11px] font-semibold transition-colors",Pt?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground group-hover:bg-primary/10 group-hover:text-primary"),children:Is+1})]}),e.jsx("div",{className:"flex items-start gap-3 mb-2 pr-24",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"font-semibold text-foreground truncate leading-tight",children:Se.name}),e.jsx("p",{className:"text-xs text-muted-foreground capitalize mt-0.5",children:String(Se.type).replace(/_/g," ")})]})}),Se.address&&e.jsxs("p",{className:"text-xs text-muted-foreground mb-2 line-clamp-1 flex items-center gap-1",children:[e.jsx(er,{className:"h-3 w-3 shrink-0"}
123)," ",Se.address]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 text-xs mb-3",children:[Se.stars!=null&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-primary/10 text-primary font-medium",children:[e.jsx(tr,{className:"h-3 w-3 fill-current"})," ",Se.stars.toFixed(1),Se.reviews!=null&&e.jsxs("span",{className:"opacity-70",children:["· ",Se.reviews]})]}),Se.open_now===!0&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-accent/10 text-accent font-medium",children:[e.jsx(Cs,{className:"h-3 w-3"})," Open"]}),Se.open_now===!1&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-muted text-muted-foreground",children:[e.jsx(Cs,{className:"h-3 w-3"})," Closed"]}),Se.has_website&&e.jsxs("a",{href:Se.website,target:"_blank",rel:"noreferrer",onClick:Qe=>Qe.stopPropagation(),className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-primary/10 text-primary hover:bg-primary/20",children:[e.jsx(bt,{className:"h-3 w-3"})," Website ",e.jsx(Ys,{className:"h-2.5 w-2.5"})]}),Se.has_phone&&e.jsxs("a",{href:`tel:${Se.phone}`,onClick:Qe=>Qe.stopPropagation(),className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-accent/10 text-accent hover:bg-accent/20",children:[e.jsx(an,{className:"h-3 w-3"})," ",Se.phone]}),Se.email&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-accent/10 text-accent",children:[e.jsx(Fs,{className:"h-3 w-3"})," ",Se.email]})]}),(Xe==null?void 0:Xe.loading)&&e.jsxs("div",{className:"absolute top-3 left-3 inline-flex items-center gap-1.5 h-6 px-2 rounded-full bg-primary/10 text-primary text-[10px] font-medium border border-primary/20",children:[e.jsx(Pe,{className:"h-3 w-3 animate-spin"}),"Enrichingâ¦"]}),e.jsxs("div",{className:"pt-2 border-t border-border/40",children:[!Xe&&e.jsxs(h,{size:"sm",variant:"outline",className:"w-full h-8 text-xs gap-2",disabled:!Se.website,onClick:Qe=>{Qe.stopPropagation(),Ge(Se)},children:[e.jsx(Fs,{className:"h-3.5 w-3.5"}),Se.website?"Find email with extension":"No website to scan"]}),(Xe==null?void 0:Xe.loading)&&e.jsxs("div",{className:"flex items-center gap-2 text-xs py-1.5 px-2 rounded-md bg-primary/5 border border-primary/10",children:[e.jsx(Pe,{className:"h-3.5 w-3.5 animate-spin text-primary shrink-0"}),e.jsxs("div",{className:"flex flex-col min-w-0",children:[e.jsx("span",{className:"text-foreground font-medium leading-tight",children:"Auto-enriching contacts"}),e.jsxs("span",{className:"text-muted-foreground text-[10px] leading-tight truncate",children:["Scanning ",(()=>{try{return new URL(Se.website).hostname.replace(/^www\./,"")}catch{return"website"}})()," for emails & phonesâ¦"]})]})]}),(Xe==null?void 0:Xe.emails)&&Xe.emails.length>0&&e.jsx("div",{className:"space-y-1",children:Xe.emails.slice(0,3).map((Qe,ps)=>e.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs bg-muted/40 px-2 py-1 rounded",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(ys,{className:Z("h-3 w-3 shrink-0",Qe.confidence==="high"?"text-accent":Qe.confidence==="medium"?"text-primary":"text-muted-foreground")}),e.jsx("span",{className:"truncate font-mono",children:Qe.email})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx(W,{variant:"outline",className:"text-[9px] h-4 px-1",children:Qe.confidence}),e.jsx(h,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:Ps=>{Ps.stopPropagation(),Fe(Qe.email)},children:e.jsx(ta,{className:"h-3 w-3"})})]})]},ps))}),(Xe==null?void 0:Xe.phones)&&Xe.phones.length>0&&e.jsx("div",{className:"space-y-1 mt-1",children:Xe.phones.slice(0,2).map((Qe,ps)=>e.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs bg-accent/5 px-2 py-1 rounded",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(an,{className:"h-3 w-3 shrink-0 text-accent"}),e.jsx("a",{href:`tel:${Qe}`,onClick:Ps=>Ps.stopPropagation(),className:"truncate font-mono hover:underline",children:Qe})]}),e.jsx(h,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:Ps=>{Ps.stopPropagation(),navigator.clipboard.writeText(Qe).then(()=>k.success("Phone copied"))},children:e.jsx(ta,{className:"h-3 w-3"})})]},ps))}),Xe&&!Xe.loading&&(((It=Xe.emails)==null?void 0:It.length)??0)===0&&(((ut=Xe.phones)==null?void 0:ut.length)??0)===0&&!Xe.contact_url&&!Xe.error&&e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1.5 min-w-0",children:[e.jsx(Ss,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",children:Xe.deepTried?"No contact channel found, even after deep scan.":"No emails or phones found on the site."})]}),Se.website&&e.jsxs(h,{size:"sm",variant:"ghost",className:"h-7 text-[11px] gap-1.5 shrink-0",onClick:Qe=>{Qe.stopPropagation(),Ge(Se,{deep:!Xe.deepTried})},children:[e.jsx(st,{className:"h-3 w-3"})," ",Xe.deepTried?"Retry":"Deep re-scan"]})]}),Xe&&!Xe.loading&&!Xe.error&&Xe.reliable===!1&&((((Ds=Xe.emails)==null?void 0:Ds.length)??0)>
1230||(((Ye=Xe.phones)==null?void 0:Ye.length)??0)>0||!!Xe.contact_url)&&e.jsxs("div",{className:"flex items-center justify-between gap-2 mt-1 py-1 px-2 rounded-md bg-amber-500/5 border border-amber-500/20",children:[e.jsxs("p",{className:"text-[11px] text-amber-700 dark:text-amber-400 flex items-center gap-1.5 min-w-0",children:[e.jsx(Ss,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",title:(Xe.reasons||[]).join(", "),children:"Contact details look unreliable â only low-confidence matches."})]}),Se.website&&!Xe.deepTried&&e.jsxs(h,{size:"sm",variant:"ghost",className:"h-7 text-[11px] gap-1.5 shrink-0 text-amber-700 dark:text-amber-400 hover:bg-amber-500/10",onClick:Qe=>{Qe.stopPropagation(),Ge(Se,{deep:!0})},children:[e.jsx(st,{className:"h-3 w-3"})," Deep re-scan"]})]}),(Xe==null?void 0:Xe.error)&&e.jsxs("div",{className:"flex items-center justify-between gap-2 py-1.5 px-2 rounded-md bg-destructive/5 border border-destructive/20",children:[e.jsxs("p",{className:"text-xs text-destructive flex items-center gap-1.5 min-w-0",children:[e.jsx(Ss,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",title:Xe.error,children:Xe.error})]}),Se.website&&e.jsxs(h,{size:"sm",variant:"outline",className:"h-7 text-[11px] gap-1.5 shrink-0 border-destructive/30 text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:Qe=>{Qe.stopPropagation(),Ge(Se)},children:[e.jsx(st,{className:"h-3 w-3"})," Retry extraction"]})]}),(()=>{var as;const Qe=(((as=Xe==null?void 0:Xe.emails)==null?void 0:as.length)??0)>0||!!Se.email,ps=!!(Xe!=null&&Xe.contact_url);if(!(Qe||ps||!!Se.website))return null;const Ms=Qe?"Drafts an email tailored to this business â preview before sending":ps?"No email found, but a contact form was detected â drafts a message to paste into it":"No email or contact form yet â draft a message you can paste anywhere";return e.jsxs(h,{size:"sm",className:"w-full h-8 text-xs gap-2 mt-2 bg-primary/90 hover:bg-primary",onClick:Os=>{Os.stopPropagation(),He(Se)},title:Ms,children:[e.jsx(es,{className:"h-3.5 w-3.5"}),"Compose & preview message"]})})()]})]},Se.id)})]})]})]})})(),e.jsx(gt,{open:!!L,onOpenChange:V=>{V||K(null)},children:e.jsxs(dt,{className:"max-w-2xl",children:[e.jsxs(mt,{children:[e.jsxs(xt,{className:"flex items-center gap-2",children:[e.jsx(ms,{className:"h-5 w-5 text-primary"}),"Message to ",L==null?void 0:L.name]}),e.jsx(Mt,{children:"Preview & edit before sending. Nothing leaves your computer until you confirm."})]}),ue?e.jsxs("div",{className:"flex items-center gap-3 py-12 justify-center text-sm text-muted-foreground",children:[e.jsx(Pe,{className:"h-5 w-5 animate-spin text-primary"}),"Drafting a message tailored to ",L==null?void 0:L.name,"â¦"]}):e.jsxs("div",{className:"space-y-3",children:[fe&&e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-md bg-destructive/5 border border-destructive/20 text-xs text-destructive",children:[e.jsx(Ss,{className:"h-4 w-4 shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium",children:"Couldn't auto-draft."}),e.jsxs("p",{className:"opacity-80",children:[fe," â write your own below or retry."]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Ce,{className:"text-xs",children:"To (email)"}),e.jsx(Je,{value:ee,onChange:V=>E(V.target.value),placeholder:L&&((Rs=le[L.id])!=null&&Rs.contact_url)?"No email â use 'Open contact form' instead":"[email protected]",className:"h-9 text-sm font-mono"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Ce,{className:"text-xs",children:"Subject"}),e.jsx(Je,{value:Ie,onChange:V=>Q(V.target.value),className:"h-9 text-sm"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Ce,{className:"text-xs",children:"Message"}),e.jsx(Vs,{value:ne,onChange:V=>ke(V.target.value),rows:8,className:"text-sm leading-relaxed"})]}),L&&e.jsxs("div",{className:"flex flex-wrap gap-2 text-[11px] text-muted-foreground",children:[((ge=le[L.id])==null?void 0:ge.contact_url)&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-accent/10 text-accent",children:[e.jsx(bt,{className:"h-3 w-3"})," Contact form detected"]}),(((vs=(Ue=le[L.id])==null?void 0:Ue.emails)==null?void 0:vs.length)??0)>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-primary/10 text-primary",children:[e.jsx(Fs,{className:"h-3 w-3"})," ",le[L.id].emails.length," email(s) found"]}
123)]})]}),e.jsxs(Ft,{className:"gap-2 sm:gap-2",children:[e.jsx(h,{variant:"ghost",onClick:()=>K(null),children:"Cancel"}),L&&((Qs=le[L.id])==null?void 0:Qs.contact_url)&&e.jsxs(h,{variant:"outline",onClick:As,disabled:ue||!ne.trim(),className:"gap-2",children:[e.jsx(Ys,{className:"h-4 w-4"})," Open contact form"]}),e.jsxs(h,{onClick:ts,disabled:ue||!ne.trim()||!ee.trim(),className:"gap-2",children:[e.jsx(At,{className:"h-4 w-4"})," Send via mail client"]})]})]})}),!I&&be.length===0&&e.jsxs(U,{className:"p-12 text-center border-dashed",children:[e.jsx(er,{className:"h-10 w-10 mx-auto text-muted-foreground/40 mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter a location and pick a business type to start prospecting locally."})]})]})}const Qr=[{id:"youtube",label:"YouTube",actionLabel:"like"},{id:"reddit",label:"Reddit",actionLabel:"upvote"},{id:"linkedin",label:"LinkedIn",actionLabel:"like"},{id:"twitter",label:"X / Twitter",actionLabel:"like"},{id:"facebook",label:"Facebook",actionLabel:"like"},{id:"quora",label:"Quora",actionLabel:"upvote"}];function db(s){try{const t=new URL(s).hostname.toLowerCase();return/youtube\.com|youtu\.be/.test(t)?"youtube":/reddit\.com/.test(t)?"reddit":/linkedin\.com/.test(t)?"linkedin":/twitter\.com|x\.com/.test(t)?"twitter":/facebook\.com|fb\.com/.test(t)?"facebook":/quora\.com/.test(t)?"quora":null}catch{return null}}const di=["saas","web3","crypto","ai","marketing","fintech","ecommerce","devtools","design","sales","hr","health","education","gaming"],mb=[5,10,25,50];function xb({userId:s}){var ee;const[t,a]=i.useState(null),[r,o]=i.useState([]),[n,l]=i.useState(null),[c,x]=i.useState([]),[d,u]=i.useState(0),[m,p]=i.useState({earned:0,spent:0,reserved:0,attempted:0,failed:0,verifiedRate:0,topPlatforms:[],topVerticals:[]}),[g,v]=i.useState(!0),[b,z]=i.useState("boost"),[C,j]=i.useState({}),[y,N]=i.useState(new Set),[f,R]=i.useState(!1),[M,q]=i.useState(new Map),[_,A]=i.useState(""),[B,P]=i.useState(""),[I,$]=i.useState(10),[be,Y]=i.useState([]),[O,he]=i.useState(!1),[re,oe]=i.useState(!1),[T,ce]=i.useState(!1),le=()=>{if(!re||T)return;ce(!0);const E=xe=>{var ve;xe.source===window&&((ve=xe.data)==null?void 0:ve.type)==="DESHILLER_HYPE_STOP_ACK"&&(window.removeEventListener("message",E),k.info("Stopping after this action",{description:"The current like will finish and verify, then no new comments will be claimed."}))};window.addEventListener("message",E),window.postMessage({type:"DESHILLER_HYPE_STOP"},"*"),setTimeout(()=>window.removeEventListener("message",E),4e3)},F=i.useCallback(async()=>{var de;v(!0);const[E,xe,ve,S]=await Promise.all([w.from("hype_credits").select("*").eq("user_id",s).maybeSingle(),w.from("hype_requests").select("*").eq("user_id",s).order("created_at",{ascending:!1}).limit(50),w.from("hype_settings").select("*").eq("user_id",s).maybeSingle(),w.from("hype_actions").select("*").eq("actor_user_id",s).order("created_at",{ascending:!1}).limit(20)]);a(E.data);const J=xe.data||[];if(o(J),l(ve.data),x(S.data||[]),J.length>0){const D=J.map(Me=>Me.id),{data:te}=await w.from("hype_actions").select("*").in("request_id",D).order("created_at",{ascending:!0}),X={};for(const Me of te||[])(X[de=Me.request_id]||(X[de]=[])).push(Me);const{data:ie}=await w.from("discovered_posts").select("post_url, status, posted_at, platform").eq("user_id",s).in("status",["posted","commented"]).order("posted_at",{ascending:!1,nullsFirst:!1}).limit(100),_e=new Map;for(const Me of ie||[])Me!=null&&Me.post_url&&_e.set(Me.post_url,{status:Me.status,posted_at:Me.posted_at,platform:Me.platform});q(_e),j(X)}const je=new Date;je.setHours(0,0,0,0);const{count:se}=await w.from("hype_actions").select("id",{count:"exact",head:!0}).eq("actor_user_id",s).eq("status","verified").gte("performed_at",je.toISOString());u(se??0);const Oe=new Date(Date.now()-7*24*60*60*1e3).toISOString(),[We,H]=await Promise.all([w.from("hype_actions").select("status, platform, performed_at, created_at").eq("actor_user_id",s).gte("created_at",Oe),w.from("hype_requests").select("target_count, completed_count, verticals, platform, status, created_at").eq("user_id",s).gte("created_at",Oe)]),ae=We.data||[],ze=H.data||[],pe=ae.filter(D=>D.status==="verified").length,Ae=ae.filter(D=>D.status==="failed").length,Ee=ae.filter(D=>D.status==="verified"||D.status==="failed").length,ls=ze.filter(D=>
123D.status!=="cancelled").reduce((D,te)=>D+(te.completed_count||0),0),ss=ze.filter(D=>D.status==="active").reduce((D,te)=>D+Math.max(0,(te.target_count||0)-(te.completed_count||0)),0),$s={};for(const D of ae)D.status==="verified"&&($s[D.platform]=($s[D.platform]||0)+1);const Xs={};for(const D of ze)for(const te of D.verticals||[])Xs[te]=(Xs[te]||0)+(D.completed_count||0);const xs=D=>Object.entries(D).sort((te,X)=>X[1]-te[1]).slice(0,3).map(([te,X])=>({name:te,count:X}));p({earned:pe,spent:ls,reserved:ss,attempted:Ee,failed:Ae,verifiedRate:Ee?Math.round(pe/Ee*100):0,topPlatforms:xs($s),topVerticals:xs(Xs)}),v(!1)},[s]);i.useEffect(()=>{F()},[F]),i.useEffect(()=>{const E=new Set(r.map(ve=>ve.id)),xe=w.channel(`mutual-hype-${s}`).on("postgres_changes",{event:"*",schema:"public",table:"hype_actions"},ve=>{const S=ve.new||ve.old;if(!S)return;const J=E.has(S.request_id),je=S.actor_user_id===s;!J&&!je||(J&&(j(se=>{const Oe={...se},We=[...Oe[S.request_id]||[]],H=We.findIndex(ae=>ae.id===S.id);return ve.eventType==="DELETE"?H>=0&&We.splice(H,1):H>=0?We[H]=S:We.push(S),We.sort((ae,ze)=>new Date(ae.created_at).getTime()-new Date(ze.created_at).getTime()),Oe[S.request_id]=We,Oe}),N(se=>new Set(se).add(S.request_id))),je&&x(se=>{const Oe=se.findIndex(We=>We.id===S.id);if(Oe>=0){const We=[...se];return We[Oe]=S,We}return[S,...se].slice(0,20)}),R(!0),setTimeout(()=>R(!1),1500))}).on("postgres_changes",{event:"UPDATE",schema:"public",table:"hype_requests",filter:`user_id=eq.${s}`},ve=>{const S=ve.new;o(J=>J.map(je=>je.id===S.id?{...je,...S}:je))}).on("postgres_changes",{event:"INSERT",schema:"public",table:"hype_requests",filter:`user_id=eq.${s}`},ve=>{const S=ve.new;o(J=>[S,...J.filter(je=>je.id!==S.id)])}).on("postgres_changes",{event:"INSERT",schema:"public",table:"hype_skipped_events",filter:`user_id=eq.${s}`},ve=>{const S=ve.new,J=String((S==null?void 0:S.platform)||"this platform");k.warning(`Auto-boost skipped on ${J}`,{description:"We couldn't pinpoint your reply on the page, so we didn't risk hyping the wrong comment. Open the post manually, copy your comment's link, and paste it here to boost it.",duration:8e3})}).subscribe();return()=>{w.removeChannel(xe)}},[s,r.length]);const L=E=>{N(xe=>{const ve=new Set(xe);return ve.has(E)?ve.delete(E):ve.add(E),ve})};i.useEffect(()=>{if(!_)return;const E=db(_);E&&P(E)},[_]);const K=async()=>{if(!_||!B){k.error("Paste your comment URL");return}if(!t||t.balance<I){k.error(`Not enough credits. You have ${(t==null?void 0:t.balance)??0}, need ${I}.`);return}he(!0);try{const{data:E,error:xe}=await w.functions.invoke("hype-create-request",{body:{platform:B,comment_url:_,target_count:I,verticals:be}});if(xe)throw xe;if(E!=null&&E.error)throw new Error(E.error);k.success("Hype request submitted"),A(""),P(""),Y([]),$(10),await F()}catch(E){k.error(E.message||"Failed to submit")}finally{he(!1)}},ue=async E=>{const{data:xe,error:ve}=await w.functions.invoke("hype-cancel-request",{body:{request_id:E}});if(ve||xe!=null&&xe.error){k.error((xe==null?void 0:xe.error)||"Cancel failed");return}k.success(`Refunded ${xe.refunded} credits`),await F()},Ne=async E=>{if(!n)return;const xe={...n,...E};l(xe);const{error:ve}=await w.from("hype_settings").update(E).eq("user_id",s);ve&&(k.error("Could not save"),l(n))},fe=async()=>{if(re)return;oe(!0),ce(!1);try{const{data:{session:ve}}=await w.auth.getSession();ve!=null&&ve.user&&await new Promise(S=>{const J=je=>{var se;je.source===window&&((se=je.data)==null?void 0:se.type)==="SOCIALPILOT_FORCE_SESSION_SYNC_ACK"&&(window.removeEventListener("message",J),S())};window.addEventListener("message",J),window.postMessage({type:"SOCIALPILOT_FORCE_SESSION_SYNC",userId:ve.user.id,email:ve.user.email},"*"),setTimeout(()=>{window.removeEventListener("message",J),S()},1500)})}catch{}let E=!1;const xe=ve=>{if(ve.source!==window)return;const S=ve.data;if(!(!S||S.type!=="DESHILLER_HYPE_RUN_NOW_ACK")){if(E=!0,window.removeEventListener("message",xe),S.ok){const J=S.result||{},je=J.completed??0,se=J.stopped_reason||"";if(J.skipped)k.info("Already running",{description:"An earn cycle is already in progress. Hold tight."});else if(je>0){const Oe=(J.results||[]).filter(We=>We.success).length;k.success(`Earned ${Oe} credit${Oe===1?"":"s"}`,{description:`${je} action${je===1?"":"s"} attempted across the network.`})}else se==="auth_wall"?k.error("Sign in to a platform first",{description:"We tried to act but hit a login wall. Open the platform tab and sign in, then try again."}):se==="no_match"||se==="no_more"?k.info("No matching requests right now",{description:"Nobody has posted hype requests that fit your verticals/platforms. We'll keep checking automatically."}):se==="Daily cap reached"?k.info("Daily cap reached",{description:"You've hit today's earn limit. It resets at midnight."}):se==="Auto-hype disabled"?k.info("Earn cycle paused",{description:"Your extension is still using the old earn-cycle setting. Update or reload the extension, then run it again."}):se==="Unauthorized"||se==="not_authenticated"?k.error("Extension session expired",{description:"Reload this page so the extension can re-sync your login, then try Earn again."}):k.info("Nothing to claim right now",{description:se?`Reason: ${se}
123`:"No matching requests in the pool. We'll keep checking on the schedule."})}else{const J=String(S.error||"");/context invalidated|Extension context/i.test(J)?k.error("Extension was just updated",{description:"Reload this page so the extension can re-attach, then try Earn again."}):k.error("Run failed",{description:J||"Extension did not respond. Make sure it's installed and signed in."})}oe(!1),ce(!1)}};window.addEventListener("message",xe),window.postMessage({type:"DESHILLER_HYPE_RUN_NOW"},"*"),setTimeout(()=>{E||(window.removeEventListener("message",xe),oe(!1),ce(!1),k.error("Extension didn't respond",{description:"Install or update the deSHILLER browser extension, then try again."}))},18e4)},[me,Ie]=i.useState(!1),Q=async()=>{if(!(!s||me)){Ie(!0);try{const{error:E}=await w.from("hype_settings").update({auto_boost_enabled:!0}).eq("user_id",s);if(E)throw E;const{data:xe,error:ve}=await w.from("hype_settings").select("*").eq("user_id",s).maybeSingle();if(ve)throw ve;if(!(xe!=null&&xe.auto_boost_enabled))throw new Error("Setting did not persist");l(xe),k.success("Auto-Boost enabled",{description:`Every reply you post will be boosted to ${xe.auto_boost_target??5} upvotes.`})}catch(E){k.error("Could not enable Auto-Boost",{description:(E==null?void 0:E.message)??"Please try again"})}finally{Ie(!1)}}},ne=(E,xe,ve)=>{xe.includes(E)?ve(xe.filter(S=>S!==E)):ve([...xe,E])},ke=E=>{if(!n)return;const xe=n.allowed_platforms,ve=xe.includes(E)?xe.filter(S=>S!==E):[...xe,E];if(ve.length===0){k.error("Keep at least one platform enabled");return}Ne({allowed_platforms:ve})};return g?e.jsx("div",{className:"flex items-center justify-center py-24",children:e.jsx(Pe,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsxs("div",{className:"space-y-6 animate-fade-in relative",children:[e.jsx("div",{className:"absolute -top-10 left-1/3 w-96 h-96 rounded-full bg-primary/10 blur-3xl pointer-events-none -z-10"}),e.jsx("div",{className:"absolute top-40 right-0 w-72 h-72 rounded-full bg-accent/10 blur-3xl pointer-events-none -z-10"}),e.jsxs(Ct,{value:b,onValueChange:E=>z(E),className:"w-full space-y-6",children:[e.jsx("div",{className:"sticky top-16 z-30 -mx-1 px-1 pt-1 pb-1",children:e.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-border/50 bg-card/70 backdrop-blur-xl shadow-[0_8px_32px_-12px_hsl(var(--primary)/0.25)]",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/[0.06] via-transparent to-accent/[0.05] pointer-events-none"}),e.jsxs("div",{className:"relative flex flex-col md:flex-row md:items-end md:justify-between gap-5 p-5 md:p-6",children:[e.jsxs("div",{className:"flex items-start gap-4 min-w-0",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-gradient-to-br from-primary/25 to-accent/20 flex items-center justify-center border border-primary/20 shadow-md shadow-primary/10 shrink-0",children:e.jsx(xa,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-primary/80 font-medium",children:"Pro"}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-muted-foreground/40"}),e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/80 font-medium",children:"Mutual"})]}),e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold tracking-tight text-foreground",children:"Mutual Hype"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 max-w-2xl leading-relaxed",children:"Boost your comments with real upvotes from other deSHILLER members. Earn credits by upvoting theirs back. Likes and upvotes only â never comments."})]})]}),e.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-primary/20 bg-gradient-to-br from-primary/15 via-card/80 to-card/80 backdrop-blur px-5 py-3 shadow-md shadow-primary/5 shrink-0",children:[e.jsx("div",{className:"h-11 w-11 rounded-xl bg-primary/15 flex items-center justify-center border border-primary/20",children:e.jsx(un,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-display font-semibold leading-none text-foreground",children:(t==null?void 0:t.balance)??0}),e.jsx("div",{className:"text-[11px] uppercase tracking-wider text-muted-foreground mt-1.5",children:"Hype credits"})]})]})]}),e.jsx("div",{className:"relative h-px bg-gradient-to-r from-transparent via-border/60 to-transparent"}),e.jsx("div",{className:"relative px-3 md:px-4 py-3",children:e.jsx(wt,{className:"h-auto w-full bg-transparent p-0 gap-1.5 flex flex-col sm:flex-row",children:[{value:"boost",icon:es,label:"Boost a comment",desc:"Submit a link · spend credits",count:r.filter(E=>E.status==="active").length,countLabel:"active"},{value:"auto-boost",icon:Lt,label:"Auto-Boost replies",desc:"Auto-hype every reply you post",count:n!=null&&n.auto_boost_enabled?(n==null?void 0:n.auto_boost_target)??0:0,countLabel:n!=null&&n.auto_boost_enabled?"target":"off"},{value:"earn",icon:ws,label:"Earn credits",desc:"Upvote others · earn back",count:d,countLabel:"today"},{value:"history",icon:yr,label:"History",desc:"Timeline · verified actions",count:c.length,countLabel:"recent"}].map(E=>{const xe=E.icon,ve=b===E.value;return e.jsx(cs,{value:E.value,className:"group flex-1 h-auto justify-start text-left px-3.5 py-3 rounded-xl border border-transparent data-[state=active]:border-primary/25 data-[state=active]:bg-gradient-to-br data-[state=active]:from-primary/15 data-[state=active]:to-accent/10 data-[state=active]:shadow-sm hover:border-border/50 hover:bg-card/40 transition-all",children:e.jsxs("div",{className:"flex items-center gap-3 w-full min-w-0",children:[e.jsx("div",{className:`h-9 w-9 rounded-lg flex items-center justify-center border shrink-0 transition-colors ${ve?"bg-primary/15 border-primary/25 text-primary":"bg-muted/40 border-border/40 text-muted-foreground group-hover:text-foreground"}`,children:e.jsx(xe,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`text-sm font-medium truncate ${ve?"text-foreground":"text-foreground
123/80"}`,children:E.label}),E.count>0&&e.jsx("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded-full leading-none ${ve?"bg-primary/20 text-primary":"bg-muted/60 text-muted-foreground"}`,children:E.count})]}),e.jsx("div",{className:"text-[11px] text-muted-foreground/80 truncate mt-0.5",children:E.desc})]})]})},E.value)})})})]})}),e.jsxs(us,{value:"boost",className:"space-y-6 mt-6",children:[e.jsxs(U,{className:"rounded-2xl border-border/50 bg-card/60 backdrop-blur-xl shadow-[0_4px_24px_-8px_hsl(var(--primary)/0.12)]",children:[e.jsxs(Be,{children:[e.jsx($e,{className:"text-lg",children:"Submit a hype request"}),e.jsx(os,{children:"Paste the link to a comment you've already posted. Other members will upvote it. 1 credit per upvote."})]}),e.jsxs(ye,{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"url",children:"Comment URL"}),e.jsx(Je,{id:"url",placeholder:"https://www.youtube.com/watch?v=...&lc=...",value:_,onChange:E=>A(E.target.value)}),B&&e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(bs,{className:"h-3 w-3 text-primary"})," Detected: ",e.jsx("span",{className:"font-medium text-foreground",children:(ee=Qr.find(E=>E.id===B))==null?void 0:ee.label})]})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{children:"Platform"}),e.jsxs(Gs,{value:B,onValueChange:E=>P(E),children:[e.jsx(qs,{children:e.jsx(Us,{placeholder:"Select platform"})}),e.jsx(Hs,{children:Qr.map(E=>e.jsx(Te,{value:E.id,children:E.label},E.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Ce,{children:["Target upvotes: ",e.jsx("span",{className:"font-semibold text-foreground",children:I})]}),e.jsx("div",{className:"flex items-center gap-3",children:e.jsx(Kt,{value:[I],min:1,max:50,step:1,onValueChange:E=>$(E[0]),className:"flex-1"})}),e.jsx("div",{className:"flex gap-1.5",children:mb.map(E=>e.jsx(h,{type:"button",variant:I===E?"default":"outline",size:"sm",onClick:()=>$(E),className:"h-7 px-2.5 text-xs",children:E},E))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{children:"Verticals (optional â only matched members will hype you)"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:di.map(E=>e.jsx(W,{variant:be.includes(E)?"default":"outline",className:"cursor-pointer capitalize",onClick:()=>ne(E,be,Y),children:E},E))})]}),e.jsxs("div",{className:"flex items-center justify-between border-t pt-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Cost: ",e.jsx("span",{className:"font-semibold text-foreground",children:I})," credits · Balance after: ",e.jsx("span",{className:"font-medium text-foreground",children:Math.max(0,((t==null?void 0:t.balance)??0)-I)})]}),e.jsxs(h,{onClick:K,disabled:O||!_||!B||((t==null?void 0:t.balance)??0)<I,children:[O?e.jsx(Pe,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(es,{className:"h-4 w-4 mr-2"}),"Launch hype"]})]})]})]}),e.jsxs(U,{className:"rounded-2xl border-border/50 bg-card/60 backdrop-blur-xl shadow-[0_4px_24px_-8px_hsl(var(--primary)/0.12)]",children:[e.jsxs(Be,{children:[e.jsx($e,{className:"text-lg",children:"Your active boosts"}),e.jsx(os,{children:"Live requests being upvoted by the network"})]}),e.jsx(ye,{children:r.filter(E=>E.status==="active").length===0?e.jsx("p",{className:"text-sm text-muted-foreground py-6 text-center",children:"No active boosts. Submit one above."}):e.jsx("div",{className:"space-y-3",children:r.filter(E=>E.status==="active").map(E=>{const xe=Math.round(E.completed_count/E.target_count*100);return e.jsxs("div",{className:"rounded-xl border border-border/50 bg-card/50 backdrop-blur p-4 hover:border-primary/30 hover:shadow-md hover:shadow-primary/5 transition-all",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(W,{variant:"outline",className:"capitalize text-[10px]",children:E.platform}),E.verticals.slice(0,3).map(ve=>e.jsx(W,{variant:"secondary",className:"text-[10px] capitalize",children:ve},ve))]}),e.jsx("a",{href:E.comment_url,target:"_blank",rel:"noreferrer noopener",className:"text-xs text-muted-foreground truncate block hover:text-foreground transition",children:E.comment_url})]}),e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>ue(E.id),className:"h-7 px-2 text-muted-foreground hover:text-destructive",children:e.jsx(zs,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("span",{className:"text-muted-foreground",children:[E.completed_count," / ",E.target_count," upvotes"]}),e.jsxs("span",{className:"font-medium",children:[xe,"%"]})]}),e.jsx(zt,{value:xe,className:"h-1.5"})]})]},E.id)})})})]})]}),e.jsxs(us,{value:"earn",className:"space-y-6 mt-6",children:[e.jsxs(U,{className:"rounded-2xl border-border/50 bg-card/60 backdrop-blur-xl shadow-[0_4px_24px_-8px_hsl(var(--primary)/0.12)] relative overflow-hidden",children:[e.jsx("div",{className:"absolute -top-16 right-1/4 w-72 h-72 rounded-full bg-primary/8 blur-3xl -z-10"}),e.jsx(Be,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx($e,{className:"text-lg",children:"This week"}),e.jsx(os,{children:"Last 7 days of Auto-Hype performance"})]}),e.jsxs(W,{variant:"outline",className:"text-[10px] gap-1",children:[e.jsx(es,{className:"h-3 w-3"})," 7d"]})]})}),e.jsxs(ye,{className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsxs("div",{className:"rounded-xl border border-border/50 bg-card/40 backdrop-blur p-3.5",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wide mb-1",children:"Earned"}),e.jsxs("p",{className:"text-2xl font-semibold text-emerald-400",children:["+",m.earned]}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"from upvoting others"})]}),e.jsxs("div",{className:"rounded-xl border border-border/50 bg-card/40 backdrop-blur p-3.5",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wide mb-1",children:"Spent"}),e.jsxs("p",{className:"text-2xl font-semibold text-destructive",children:["â",m.spent]}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"upvotes you received"})]}),e.jsxs("div",{className:"rounded-xl border border-border/50 bg-card/40 backdrop-blur p-3.5",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wide mb-1",children:"Reserved"}),e.jsx("p",{className:"text-2xl font-semibold text-amber-400",children:m.reserved}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"escrowed in active boosts"})]}),e.jsxs("div",{className:"rounded-xl border border-border/50 bg-card/40 backdrop-blur p-3.5",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wide mb-1",children:"Net"}),e.jsxs("p",{className:`text-2xl font-semibold ${m.earned-m.spent>=0?"text-emerald-400":"text-destructive"}`,children:[m.earned-m.spent>=0?"+":"",m.earned-m.spent]}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"balance change · 7d"})]})]}),e.jsxs("div",{className:"rounded-lg border border-border/40 bg-muted/20 px-3.5 py-2.5 text-[11px] text-muted-foreground leading-relaxed",children:[e.jsx("span",{className:"text-foreground font-medium",children:"How this adds up:"}),' Earned â Spent = Net change in your balance. Reserved credits are still locked in active boost requests â they leave your balance the moment you submit a boost, and only convert to "Spent" once another member verifies an upvote. Cancel a request to refund the unfulfilled portion.'," ",e.jsxs("span",{className:"text-muted-foreground
123/80",children:["Verified rate: ",e.jsxs("span",{className:"text-foreground",children:[m.verifiedRate,"%"]})," (",m.earned,"/",m.attempted," actions you performed)"]})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"rounded-xl border border-border/50 bg-card/40 backdrop-blur p-3.5",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wide mb-2",children:"Top platforms (verified)"}),m.topPlatforms.length===0?e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No verified actions yet"}):e.jsx("div",{className:"space-y-1.5",children:m.topPlatforms.map(E=>{const xe=m.earned?Math.round(E.count/m.earned*100):0;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{variant:"outline",className:"capitalize text-[10px] min-w-[68px] justify-center",children:E.name}),e.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted/40 overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-primary/70 to-primary rounded-full",style:{width:`${xe}%`}})}),e.jsx("span",{className:"text-xs text-muted-foreground tabular-nums w-10 text-right",children:E.count})]},E.name)})})]}),e.jsxs("div",{className:"rounded-xl border border-border/50 bg-card/40 backdrop-blur p-3.5",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wide mb-2",children:"Top verticals (your requests)"}),m.topVerticals.length===0?e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No vertical-tagged requests yet"}):e.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.topVerticals.map(E=>e.jsxs(W,{variant:"secondary",className:"capitalize text-[10px]",children:[E.name," ",e.jsxs("span",{className:"ml-1 text-muted-foreground",children:["· ",E.count]})]},E.name))})]})]}),m.failed>0&&e.jsxs("div",{className:"flex items-start gap-2 rounded-xl border border-amber-500/20 bg-amber-500/[0.04] backdrop-blur p-3 text-xs text-muted-foreground",children:[e.jsx(Ss,{className:"h-3.5 w-3.5 mt-0.5 shrink-0 text-amber-500"}),e.jsxs("p",{children:[e.jsx("span",{className:"text-foreground font-medium",children:m.failed})," action",m.failed===1?"":"s"," failed verification this week. Usually login walls or removed posts â Auto-Hype skips those automatically."]})]})]})]}),e.jsxs(U,{className:"rounded-2xl border-border/50 bg-card/60 backdrop-blur-xl shadow-[0_4px_24px_-8px_hsl(var(--primary)/0.12)]",children:[e.jsxs(Be,{children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx($e,{className:"text-lg",children:"Auto-Hype"}),e.jsx(os,{children:"The extension picks matching requests and upvotes them. Earn 1 credit per verified action."})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs(h,{size:"sm",variant:n!=null&&n.auto_hype_enabled?"default":"outline",onClick:fe,disabled:re||!(n!=null&&n.auto_hype_enabled),title:n!=null&&n.auto_hype_enabled?"Run one earn cycle right now":"Turn on Auto-Hype to allow this",children:[re?e.jsx(Pe,{className:"h-4 w-4 animate-spin"}):e.jsx(Kx,{className:"h-4 w-4"}),"Run now"]}),re&&e.jsxs(h,{size:"sm",variant:"destructive",onClick:le,disabled:T,title:"Finish the current like, then halt â no new comments will be claimed",children:[e.jsx(Xx,{className:"h-4 w-4"}),T?"Stoppingâ¦":"Stop after this"]}),e.jsx(Js,{checked:(n==null?void 0:n.auto_hype_enabled)??!1,onCheckedChange:E=>Ne({auto_hype_enabled:E})})]})]}),!(n!=null&&n.auto_hype_enabled)&&e.jsxs("p",{className:"mt-2 text-xs text-muted-foreground flex items-center gap-1.5",children:[e.jsx(Ss,{className:"h-3 w-3"}),"Run now is disabled until you enable Auto-Hype â we never act on your accounts without consent."]})]}),e.jsxs(ye,{className:"space-y-5",children:[e.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"rounded-xl border border-border/50 bg-card/40 backdrop-blur p-4",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Today"}),e.jsxs("p",{className:"text-2xl font-semibold",children:[d," ",e.jsxs("span",{className:"text-sm font-normal text-muted-foreground",children:["/ ",(n==null?void 0:n.daily_cap)??20]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"credits earned"})]}),e.jsxs("div",{className:"rounded-xl border border-border/50 bg-card/40 backdrop-blur p-4",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Lifetime earned"}),e.jsx("p",{className:"text-2xl font-semibold",children:(t==null?void 0:t.lifetime_earned)??0})]}),e.jsxs("div",{className:"rounded-xl border border-border/50 bg-card/40 backdrop-blur p-4",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Lifetime spent"}),e.jsx("p",{className:"text-2xl font-semibold",children:(t==null?void 0:t.lifetime_spent)??0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Ce,{children:["Daily cap: ",e.jsx("span",{className:"font-semibold text-foreground",children:(n==null?void 0:n.daily_cap)??20})," upvotes / day"]}),e.jsx(Kt,{value:[(n==null?void 0:n.daily_cap)??20],min:1,max:50,step:1,onValueChange:E=>Ne({daily_cap:E[0]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Ce,{children:"Per-platform pause"}),e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx("button",{type:"button",onClick:()=>Ne({allowed_platforms:Qr.map(E=>E.id)}),className:"text-muted-foreground hover:text-foreground transition",children:"Resume all"}),e.jsx("span",{className:"text-border",children:"·"}),e.jsx("button",{type:"button",onClick:()=>Ne({allowed_platforms:[]}),className:"text-muted-foreground hover:text-destructive transition",children:"Pause all"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Toggle individual platforms off without disabling Auto-Hype. Paused platforms won't be claimed for upvotes."}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-2 pt-1",children:Qr.map(E=>{const xe=(n==null?void 0:n.allowed_platforms.includes(E.id))??!1;return e.jsxs("div",{className:`flex items-center justify-between rounded-xl border backdrop-blur px-3.5 py-2.5 transition-all ${xe?"border-border/50 bg-card/50 hover:border-primary/30":"border-border/40 bg-muted/20 opacity-70"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:`h-2 w-2 rounded-full shrink-0 ${xe?"bg-primary shadow-[0_0_8px_hsl(var(--primary))]":"bg-muted-foreground
123/40"}`}),e.jsx("span",{className:"text-sm font-medium truncate",children:E.label}),!xe&&e.jsx(W,{variant:"outline",className:"text-[9px] py-0 px-1.5 h-4 ml-1",children:"Paused"})]}),e.jsx(Js,{checked:xe,onCheckedChange:()=>ke(E.id)})]},E.id)})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{children:"Verticals you'll engage with (empty = all)"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:di.map(E=>e.jsx(W,{variant:((n==null?void 0:n.allowed_verticals)??[]).includes(E)?"default":"outline",className:"cursor-pointer capitalize",onClick:()=>Ne({allowed_verticals:((n==null?void 0:n.allowed_verticals)??[]).includes(E)?n.allowed_verticals.filter(xe=>xe!==E):[...(n==null?void 0:n.allowed_verticals)??[],E]}),children:E},E))})]}),e.jsxs("div",{className:"flex items-start gap-2 rounded-xl border border-primary/20 bg-gradient-to-br from-primary/[0.05] to-accent/[0.04] backdrop-blur p-3.5 text-xs text-muted-foreground",children:[e.jsx(Ss,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),e.jsx("p",{children:"Auto-Hype only performs likes and upvotes. It never posts comments. Actions run with randomized delays to stay safe across platforms."})]})]})]}),e.jsxs(U,{className:"rounded-2xl border-border/50 bg-card/60 backdrop-blur-xl shadow-[0_4px_24px_-8px_hsl(var(--primary)/0.12)]",children:[e.jsx(Be,{children:e.jsx($e,{className:"text-lg",children:"Recent actions"})}),e.jsx(ye,{children:c.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No actions yet. Enable Auto-Hype to start earning."}):e.jsx("div",{className:"space-y-2",children:c.map(E=>e.jsxs("div",{className:"flex items-center justify-between text-sm border border-border/40 bg-card/40 backdrop-blur rounded-xl px-3.5 py-2.5 hover:border-primary/30 hover:bg-card/60 transition-all",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(W,{variant:"outline",className:"capitalize text-[10px]",children:E.platform}),e.jsx("span",{className:"capitalize text-muted-foreground",children:E.action_type})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(E.performed_at||E.created_at).toLocaleString()}),e.jsx(W,{variant:E.status==="verified"?"default":E.status==="failed"?"destructive":"secondary",className:"text-[10px] capitalize",children:E.status})]})]},E.id))})})]})]}),e.jsxs(us,{value:"auto-boost",className:"space-y-6 mt-6",children:[e.jsx(U,{className:`rounded-2xl border bg-card/60 backdrop-blur-xl shadow-[0_4px_24px_-8px_hsl(var(--primary)/0.18)] transition-colors ${n!=null&&n.auto_boost_enabled?"border-green-500/30":"border-primary/30"}`,children:e.jsx(ye,{className:"p-5 md:p-6",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[e.jsx("div",{className:`h-11 w-11 rounded-xl flex items-center justify-center border shrink-0 ${n!=null&&n.auto_boost_enabled?"bg-green-500/15 border-green-500/30 text-green-500":"bg-primary/15 border-primary/25 text-primary"}`,children:n!=null&&n.auto_boost_enabled?e.jsx(ys,{className:"h-5 w-5"}):e.jsx(Lt,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"flex items-center gap-2 mb-1",children:e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-primary/80 font-medium",children:n!=null&&n.auto_boost_enabled?"Active":"One-click setup"})}),e.jsx("div",{className:"text-base font-display font-semibold text-foreground",children:n!=null&&n.auto_boost_enabled?"Auto-Boost is on for your account":"Enable Auto-Boost for me"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-xl leading-relaxed",children:n!=null&&n.auto_boost_enabled?`Every reply you post will be boosted to ${(n==null?void 0:n.auto_boost_target)??5} upvotes using your current settings.`:`Turns Auto-Boost on and confirms the save. Each reply will be boosted to ${(n==null?void 0:n.auto_boost_target)??5} upvotes for ${(n==null?void 0:n.auto_boost_target)??5} credits.`})]})]}),e.jsx("div",{className:"shrink-0",children:n!=null&&n.auto_boost_enabled?e.jsxs(h,{variant:"outline",onClick:()=>Ne({auto_boost_enabled:!1}),children:[e.jsx(zs,{className:"h-4 w-4 mr-2"}),"Turn off"]}):e.jsx(h,{onClick:Q,disabled:me,className:"bg-gradient-to-r from-primary to-accent hover:opacity-90",children:me?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"h-4 w-4 mr-2 animate-spin"}),"Enablingâ¦"]}):e.jsxs(e.Fragment,{children:[e.jsx(Lt,{className:"h-4 w-4 mr-2"}),"Enable Auto-Boost for me"]})})})]})})}),e.jsxs(U,{className:"rounded-2xl border-border/50 bg-card/60 backdrop-blur-xl shadow-[0_4px_24px_-8px_hsl(var(--primary)/0.12)]",children:[e.jsx(Be,{children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs($e,{className:"text-lg flex items-center gap-2",children:[e.jsx(Lt,{className:"h-5 w-5 text-primary"}),"Auto-Boost replies",e.jsx(W,{variant:"secondary",className:"text-[10px]",children:"New"})]}),e.jsx(os,{children:"Whenever you post a reply via Discover & Reply, automatically create a Mutual Hype request to boost it."})]}),e.jsx(Js,{checked:(n==null?void 0:n.auto_boost_enabled)??!1,onCheckedChange:E=>Ne({auto_boost_enabled:E})})]})}),e.jsxs(ye,{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Ce,{children:["Boost target: ",e.jsx("span",{className:"font-semibold text-foreground",children:(n==null?void 0:n.auto_boost_target)??5})," upvotes per reply"]}),e.jsx(Kt,{value:[(n==null?void 0:n.auto_boost_target)??5],min:1,max:50,step:1,onValueChange:E=>Ne({auto_boost_target:E[0]}),disabled:!(n!=null&&n.auto_boost_enabled)}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Costs ",(n==null?void 0:n.auto_boost_target)??5," credits per posted reply. Skipped silently if your balance is too low."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{children:"Tag boosted requests with verticals (optional)"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:di.map(E=>{const xe=((n==null?void 0:n.auto_boost_verticals)??[]).includes(E);
123return e.jsx(W,{variant:xe?"default":"outline",className:`cursor-pointer capitalize ${n!=null&&n.auto_boost_enabled?"":"opacity-50 pointer-events-none"}`,onClick:()=>Ne({auto_boost_verticals:xe?((n==null?void 0:n.auto_boost_verticals)??[]).filter(ve=>ve!==E):[...(n==null?void 0:n.auto_boost_verticals)??[],E]}),children:E},E)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Helps other users in your verticals find and upvote your replies first."})]}),e.jsxs("div",{className:"flex items-start gap-2 rounded-xl border border-primary/20 bg-gradient-to-br from-primary/[0.05] to-accent/[0.04] backdrop-blur p-3.5 text-xs text-muted-foreground",children:[e.jsx(ws,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),e.jsx("p",{children:"Triggers the moment a discovered post is marked as posted/commented â works for both extension and server-side replies. Each comment URL is boosted at most once."})]})]})]}),(()=>{const E=(n==null?void 0:n.auto_boost_target)??5,xe=(n==null?void 0:n.auto_boost_verticals)??[],ve=(n==null?void 0:n.auto_boost_enabled)??!1,S=(t==null?void 0:t.balance)??0,J=E>0?Math.floor(S/E):0;return e.jsxs(U,{className:"rounded-2xl border-border/50 bg-card/60 backdrop-blur-xl shadow-[0_4px_24px_-8px_hsl(var(--primary)/0.12)]",children:[e.jsx(Be,{children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-primary/80 font-medium",children:"Preview"}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-muted-foreground/40"}),e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/80 font-medium",children:"Dry run"})]}),e.jsxs($e,{className:"text-lg flex items-center gap-2",children:[e.jsx(es,{className:"h-5 w-5 text-primary"}),"What Auto-Boost will do"]}),e.jsx(os,{className:"mt-1",children:"A live summary of how each reply you post will be boosted with your current settings."})]}),e.jsx(W,{variant:ve?"default":"outline",className:`text-[10px] shrink-0 ${ve?"":"text-muted-foreground"}`,children:ve?"Active":"Disabled"})]})}),e.jsxs(ye,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"rounded-xl border border-border/40 bg-card/50 backdrop-blur p-3.5",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/80 font-medium mb-1",children:"Target per reply"}),e.jsx("div",{className:"text-2xl font-display font-semibold text-foreground leading-none",children:E}),e.jsx("div",{className:"text-[11px] text-muted-foreground mt-1.5",children:"upvotes / likes"})]}),e.jsxs("div",{className:"rounded-xl border border-border/40 bg-card/50 backdrop-blur p-3.5",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/80 font-medium mb-1",children:"Cost per reply"}),e.jsx("div",{className:"text-2xl font-display font-semibold text-foreground leading-none",children:E}),e.jsx("div",{className:"text-[11px] text-muted-foreground mt-1.5",children:"credits each"})]}),e.jsxs("div",{className:"rounded-xl border border-border/40 bg-card/50 backdrop-blur p-3.5",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/80 font-medium mb-1",children:"Replies affordable now"}),e.jsx("div",{className:"text-2xl font-display font-semibold text-foreground leading-none",children:J}),e.jsxs("div",{className:"text-[11px] text-muted-foreground mt-1.5",children:["at ",S," credits"]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border/40 bg-card/50 backdrop-blur p-3.5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/80 font-medium",children:"Vertical tags"}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:xe.length===0?"none â boosted to general pool":`${xe.length} selected`})]}),xe.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Requests will be visible to anyone earning credits. Add tags to prioritize visibility within your niche."}):e.jsx("div",{className:"flex flex-wrap gap-1.5",children:xe.map(je=>e.jsx(W,{variant:"secondary",className:"capitalize text-[10px]",children:je},je))})]}),e.jsxs("div",{className:"rounded-xl border border-border/40 bg-card/50 backdrop-blur p-3.5",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground
123/80 font-medium mb-2.5",children:"Trigger conditions"}),e.jsxs("ul",{className:"space-y-2 text-xs text-muted-foreground",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(ys,{className:"h-3.5 w-3.5 mt-0.5 text-primary shrink-0"}),e.jsx("span",{children:"You post a reply via Discover & Reply (extension or server-side)."})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(ys,{className:"h-3.5 w-3.5 mt-0.5 text-primary shrink-0"}),e.jsxs("span",{children:["The discovered post status flips to ",e.jsx("span",{className:"text-foreground font-medium",children:"posted"})," or ",e.jsx("span",{className:"text-foreground font-medium",children:"commented"}),"."]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(ys,{className:"h-3.5 w-3.5 mt-0.5 text-primary shrink-0"}),e.jsx("span",{children:"The comment URL has not been boosted before (deduplicated per URL)."})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(ys,{className:"h-3.5 w-3.5 mt-0.5 text-primary shrink-0"}),e.jsxs("span",{children:["Your balance is at least ",e.jsx("span",{className:"text-foreground font-medium",children:E})," credits â otherwise the trigger is skipped silently."]})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-primary/20 bg-gradient-to-br from-primary/[0.06] to-accent/[0.04] backdrop-blur p-3.5",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-primary/80 font-medium mb-2",children:"Sample request that will be created"}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"h-9 w-9 rounded-lg bg-primary/15 border border-primary/25 flex items-center justify-center text-primary shrink-0",children:e.jsx(Lt,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1 text-xs text-muted-foreground space-y-1",children:[e.jsx("div",{className:"text-sm text-foreground font-medium truncate",children:"Boost my reply on reddit.com/r/â¦"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsxs(W,{variant:"outline",className:"text-[10px]",children:["Target: ",E]}),e.jsxs(W,{variant:"outline",className:"text-[10px]",children:["Cost: ",E," credits"]}),xe.slice(0,3).map(je=>e.jsx(W,{variant:"secondary",className:"capitalize text-[10px]",children:je},je)),xe.length>3&&e.jsxs(W,{variant:"secondary",className:"text-[10px]",children:["+",xe.length-3]})]})]})]})]}),!ve&&e.jsxs("div",{className:"flex items-start gap-2 rounded-xl border border-border/40 bg-muted/30 p-3 text-xs text-muted-foreground",children:[e.jsx(Ss,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),e.jsx("p",{children:"Auto-Boost is currently disabled. Toggle it on above to start applying these settings to new replies."})]})]})]})})(),(()=>{const E=ve=>{const S=new Date(ve),J=Date.now()-S.getTime(),je=Math.floor(J/6e4);if(je<1)return"just now";if(je<60)return`${je}m ago`;const se=Math.floor(je/60);if(se<24)return`${se}h ago`;const Oe=Math.floor(se/24);return Oe<7?`${Oe}d ago`:S.toLocaleDateString(void 0,{month:"short",day:"numeric"})},xe=r.map(ve=>({req:ve,dp:M.get(ve.comment_url)})).filter(ve=>!!ve.dp).slice(0,15);return e.jsxs(U,{className:"rounded-2xl border-border/50 bg-card/60 backdrop-blur-xl shadow-[0_4px_24px_-8px_hsl(var(--primary)/0.12)]",children:[e.jsx(Be,{children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-primary/80 font-medium",children:"Activity log"}),f&&e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-emerald-500",children:[e.jsx(Ga,{className:"h-3 w-3 animate-pulse"})," live"]})]}),e.jsxs($e,{className:"text-lg flex items-center gap-2",children:[e.jsx(yr,{className:"h-5 w-5 text-primary"}),"Recent Auto-Boost actions"]}),e.jsx(os,{className:"mt-1",children:"Boosts triggered automatically when your replies got posted or commented."})]}),e.jsxs(W,{variant:"outline",className:"text-[10px] shrink-0",children:[xe.length," ",xe.length===1?"entry":"entries"]})]})}),e.jsx(ye,{children:!(n!=null&&n.auto_boost_enabled)&&xe.length===0?e.jsxs("div",{className:"flex items-start gap-2 rounded-xl border border-border/40 bg-muted/30 p-3 text-xs text-muted-foreground",children:[e.jsx(Ss,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),e.jsx("p",{children:"Enable Auto-Boost above to start logging activity here."})]}):xe.length===0?e.jsxs("div",{className:"flex items-start gap-2 rounded-xl border border-border/40 bg-muted/30 p-3 text-xs text-muted-foreground",children:[e.jsx(Cs,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),e.jsx("p",{children:"No Auto-Boost actions yet. The next reply you post will appear here within seconds."})]}):e.jsx("ul",{className:"divide-y divide-border/40",children:xe.map(({req:ve,dp:S})=>{const J=(S==null?void 0:S.status)==="commented"?"commented":"posted",
123je=ve.status==="completed"?{icon:e.jsx(ys,{className:"h-3.5 w-3.5"}),color:"text-emerald-500",label:"completed"}:ve.status==="active"?{icon:e.jsx(Ga,{className:"h-3.5 w-3.5 animate-pulse"}),color:"text-primary",label:"boosting"}:ve.status==="cancelled"||ve.status==="expired"?{icon:e.jsx(Rt,{className:"h-3.5 w-3.5"}),color:"text-muted-foreground",label:ve.status}:{icon:e.jsx(Cs,{className:"h-3.5 w-3.5"}),color:"text-amber-500",label:"queued"};return e.jsxs("li",{className:"py-3 flex items-start gap-3",children:[e.jsx("div",{className:`h-8 w-8 rounded-lg bg-card/60 border border-border/40 flex items-center justify-center shrink-0 ${je.color}`,children:je.icon}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-xs font-medium text-foreground capitalize",children:je.label}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"·"}),e.jsx(W,{variant:"outline",className:"text-[10px] capitalize",children:ve.platform}),e.jsxs(W,{variant:"secondary",className:"text-[10px]",children:[ve.completed_count,"/",ve.target_count," boosts"]}),e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["Triggered by reply ",J]})]}),ve.comment_preview&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1",children:['"',ve.comment_preview,'"']}),e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[10px] text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Cs,{className:"h-3 w-3"}),"Queued ",E(ve.created_at)]}),(S==null?void 0:S.posted_at)&&e.jsxs("span",{children:["Reply ",J," ",E(S.posted_at)]}),e.jsx("a",{href:ve.comment_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline truncate max-w-[180px]",children:"open â"})]})]})]},ve.id)})})})]})})()]}),e.jsx(us,{value:"history",className:"mt-6",children:e.jsxs(U,{className:"rounded-2xl border-border/50 bg-card/60 backdrop-blur-xl shadow-[0_4px_24px_-8px_hsl(var(--primary)/0.12)]",children:[e.jsx(Be,{children:e.jsx("div",{className:"flex items-center justify-between gap-2",children:e.jsxs("div",{children:[e.jsxs($e,{className:"text-lg flex items-center gap-2",children:["All requests",e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[10px] uppercase tracking-widest text-muted-foreground font-medium",children:[e.jsx("span",{className:`relative inline-flex h-2 w-2 rounded-full ${f?"bg-emerald-500":"bg-emerald-500/60"}`,children:e.jsx("span",{className:`absolute inset-0 rounded-full bg-emerald-500 ${f?"animate-ping":""}`})}),"Live"]})]}),e.jsx(os,{children:"Real-time timeline of every hype action across your boosts"})]})})}),e.jsx(ye,{children:r.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No requests yet."}):e.jsx("div",{className:"space-y-3",children:r.map(E=>{const xe=C[E.id]||[],ve=y.has(E.id),S=Math.round(E.completed_count/E.target_count*100),J=xe.reduce((se,Oe)=>(se[Oe.status]=(se[Oe.status]||0)+1,se),{}),je=ve?nt:$t;return e.jsxs("div",{className:"rounded-xl border border-border/40 bg-card/40 backdrop-blur overflow-hidden hover:border-primary/30 transition-all",children:[e.jsxs("button",{onClick:()=>L(E.id),className:"w-full flex items-center gap-3 px-3.5 py-3 text-left hover:bg-card/60 transition-colors",children:[e.jsx(je,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5 flex-wrap",children:[e.jsx(W,{variant:"outline",className:"capitalize text-[10px]",children:E.platform}),e.jsx(W,{variant:E.status==="active"?"default":E.status==="completed"?"secondary":"outline",className:"text-[10px] capitalize",children:E.status}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[E.completed_count,"/",E.target_count]}),J.pending>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-amber-600 dark:text-amber-400",children:[e.jsx(Pe,{className:"h-2.5 w-2.5 animate-spin"}),J.pending," executing"]}),J.verified>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-emerald-600 dark:text-emerald-400",children:[e.jsx(ys,{className:"h-2.5 w-2.5"}),J.verified," verified"]}),J.failed>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-destructive",children:[e.jsx(Rt,{className:"h-2.5 w-2.5"}),J.failed," failed"]})]}),e.jsx("a",{href:E.comment_url,target:"_blank",rel:"noreferrer noopener",onClick:se=>se.stopPropagation(),className:"text-xs text-muted-foreground hover:text-foreground truncate block",children:E.comment_url}),e.jsx("div",{className:"mt-2",children:e.jsx(zt,{value:S,className:"h-1"})})]}),e.jsx("span",{className:"text-xs text-muted-foreground shrink-0 self-start",children:new Date(E.created_at).toLocaleDateString()})]}),ve&&e.jsx("div",{className:"border-t border-border/40 bg-background/30 px-4 py-4",children:xe.length===0?e.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"Waiting for the network to pick up this boostâ¦"}):e.jsxs("ol",{className:"relative space-y-3",children:[e.jsx("span",{className:"absolute left-[7px] top-2 bottom-2 w-px bg-border/60"}),xe.map(se=>{var ze,pe;const Oe=se.status,We=Oe==="verified"?ys:Oe==="failed"?Rt:Oe==="pending"?Pe:Cs,H=Oe==="verified"?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 border-emerald-500/40":Oe==="failed"?"bg-destructive/15 text-destructive border-destructive/40":"bg-
123amber-500/15 text-amber-600 dark:text-amber-400 border-amber-500/40",ae=se.verification_proof;return e.jsxs("li",{className:"relative pl-7",children:[e.jsx("span",{className:`absolute left-0 top-0.5 w-3.5 h-3.5 rounded-full border flex items-center justify-center ${H}`,children:e.jsx(We,{className:`h-2 w-2 ${Oe==="pending"?"animate-spin":""}`})}),e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-xs font-medium capitalize text-foreground",children:Oe==="pending"?"Claimed · executing":Oe==="verified"?`${se.action_type} verified`:`${se.action_type} failed`}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"by an anonymous member"})]}),Oe==="failed"&&se.error_message&&e.jsx("p",{className:"text-[11px] text-destructive/80 mt-0.5 truncate",children:se.error_message}),Oe==="verified"&&((ze=ae==null?void 0:ae.before)==null?void 0:ze.count)&&((pe=ae==null?void 0:ae.after)==null?void 0:pe.count)&&ae.before.count!==ae.after.count&&e.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:["Count: ",ae.before.count," â ",e.jsx("span",{className:"text-foreground font-medium",children:ae.after.count})]}),Oe==="verified"&&(ae==null?void 0:ae.already_pressed)&&e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"Already engaged before claim â no double-action"})]}),e.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:new Date(se.performed_at||se.created_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]})]},se.id)})]})})]},E.id)})})})]})})]})]})}const ub=[{icon:xa,title:"Real upvotes from real members",desc:"Boost any comment on YouTube, Reddit, X, LinkedIn, Quora or Facebook."},{icon:un,title:"Earn-as-you-go credits",desc:"Upvote others' comments to build a balance â no extra cost on top of Pro."},{icon:ws,title:"Auto-Boost on reply",desc:"Every reply you post via Discover & Reply is automatically queued for upvotes."},{icon:Na,title:"Verified delivery",desc:"Each upvote is independently verified before credits are settled."},{icon:Es,title:"Vertical targeting",desc:"Match your boost to members who actually engage in your niche."},{icon:es,title:"Weekly performance summary",desc:"Track credits earned/spent, verified rate and top platforms in one view."}];function hb({reason:s="free"}){const t=ns(),a=s==="expired"?"Your trial ended. Resume Mutual Hype with Pro.":"Mutual Hype is a Pro feature";return e.jsxs("div",{className:"space-y-6 animate-fade-in relative",children:[e.jsx("div",{className:"absolute -top-10 left-1/3 w-96 h-96 rounded-full bg-primary/10 blur-3xl pointer-events-none -z-10"}),e.jsx("div",{className:"absolute top-40 right-0 w-72 h-72 rounded-full bg-accent/10 blur-3xl pointer-events-none -z-10"}),e.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-primary/20 bg-card/60 backdrop-blur-xl shadow-[0_8px_32px_-12px_hsl(var(--primary)/0.25)]",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/[0.06] via-transparent to-accent/[0.06] pointer-events-none"}),e.jsxs("div",{className:"relative flex flex-col md:flex-row md:items-center md:justify-between gap-5 p-6 md:p-7",children:[e.jsxs("div",{className:"flex items-start gap-4 min-w-0",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-gradient-to-br from-primary/25 to-accent/20 flex items-center justify-center border border-primary/20 shadow-md shadow-primary/10 shrink-0",children:e.jsx(Wa,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-primary/80 font-medium",children:"Pro"}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-muted-foreground/40"}),e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/80 font-medium",children:"Mutual Hype"})]}),e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold tracking-tight text-foreground",children:a}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 max-w-2xl leading-relaxed",children:"Boost your comments with real upvotes from other deSHILLER members and earn credits by upvoting theirs back. Likes and upvotes only â never comments."})]})]}),e.jsxs(h,{size:"lg",onClick:()=>t("/payment"),className:"shrink-0 bg-gradient-to-r from-primary to-accent text-primary-foreground hover:opacity-90 shadow-md shadow-primary/20 group",children:["Upgrade to Pro",e.jsx(Ns,{className:"ml-2 h-4 w-4 group-hover:translate-x-0.5 transition-transform"})]})]})]}),e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-3",children:ub.map(({icon:r,title:o,desc:n})=>e.jsxs("div",{className:"rounded-2xl border border-border/50 bg-card/60 backdrop-blur-md p-5 hover:border-primary/30 hover:shadow-md hover:shadow-
123primary/5 transition-all",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-primary/15 to-accent/10 border border-primary/15 flex items-center justify-center mb-3",children:e.jsx(r,{className:"h-4 w-4 text-primary"})}),e.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:o}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:n})]},o))}),e.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-border/50 bg-card/60 backdrop-blur-xl p-6 md:p-7 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-accent/[0.05] via-transparent to-primary/[0.05] pointer-events-none"}),e.jsxs("div",{className:"relative",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/80 font-medium mb-1",children:"Included with Pro"}),e.jsx("p",{className:"text-base font-display font-semibold text-foreground",children:"Mutual Hype + Cold Reach + Creative Studio + API access"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Cancel anytime. Credits don't expire while your plan is active."})]}),e.jsxs(h,{onClick:()=>t("/payment"),className:"relative shrink-0 bg-gradient-to-r from-primary to-accent text-primary-foreground hover:opacity-90",children:["See Pro plans",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]})]})]})}const pb={twitter:rt,x:rt,linkedin:Zs,reddit:ms,facebook:Wt},gb={twitter:"bg-sky-500/20 text-sky-600 border-sky-500/30",x:"bg-sky-500/20 text-sky-600 border-sky-500/30",linkedin:"bg-blue-500/20 text-blue-600 border-blue-500/30",reddit:"bg-orange-500/20 text-orange-600 border-orange-500/30",facebook:"bg-indigo-500/20 text-indigo-600 border-indigo-500/30"},Jo={pending:{label:"Pending",color:"bg-yellow-500/20 text-yellow-600 border-yellow-500/30",icon:Cs},in_progress:{label:"Processing",color:"bg-blue-500/20 text-blue-600 border-blue-500/30",icon:Pe},completed:{label:"Posted",color:"bg-green-500/20 text-green-600 border-green-500/30",icon:ys},failed:{label:"Failed",color:"bg-red-500/20 text-red-600 border-red-500/30",icon:Rt},skipped:{label:"Skipped",color:"bg-muted text-muted-foreground border-border",icon:Ss}};function fb({userId:s}){const[t,a]=i.useState([]),[r,o]=i.useState(!0),[n,l]=i.useState(!1),[c,x]=i.useState("all"),[d,u]=i.useState("all"),[m,p]=i.useState(null),g=async()=>{try{let N=w.from("engagement_queue").select("*").eq("user_id",s).order("created_at",{ascending:!1}).limit(100);c!=="all"&&(N=N.eq("platform",c)),d!=="all"&&(N=N.eq("status",d));const{data:f,error:R}=await N;if(R)throw R;a(f||[])}catch{k.error("Failed to load queue")}finally{o(!1),l(!1)}};i.useEffect(()=>{g();const N=w.channel("unified-queue-changes").on("postgres_changes",{event:"*",schema:"public",table:"engagement_queue",filter:`user_id=eq.${s}`},()=>{g()}).subscribe();return()=>{w.removeChannel(N)}},[s,c,d]);const v=async()=>{l(!0),await g()},b=async N=>{p(N);try{const{error:f}=await w.from("engagement_queue").delete().eq("id",N);if(f)throw f;a(R=>R.filter(M=>M.id!==N)),k.success("Item removed from queue")}catch{k.error("Failed to remove item")}finally{p(null)}},z=async N=>{try{const{error:f}=await w.from("engagement_queue").update({status:"pending",attempts:0,error_message:null,updated_at:new Date().toISOString()}).eq("id",N.id);if(f)throw f;k.success("Item queued for retry")}catch{k.error("Failed to retry")}},C=async()=>{try{const{error:N}=await w.from("engagement_queue").delete().eq("user_id",s).eq("status","completed");if(N)throw N;a(f=>f.filter(R=>R.status!=="completed")),k.success("Cleared completed items")}catch{k.error("Failed to clear")}},j={pending:t.filter(N=>N.status==="pending").length,inProgress:t.filter(N=>N.status==="in_progress").length,completed:t.filter(N=>N.status==="completed").length,failed:t.filter(N=>N.status==="failed").length},y=N=>{const f=pb[N]||ms;return e.jsx(f,{className:"h-4 w-4"})};return r?e.jsx(U,{className:"border-border/50 bg-card/50 backdrop-blur-xl",children:e.jsxs(ye,{className:"p-8 text-center",children:[e.jsxs("div",{className:"relative w-12 h-12 mx-auto mb-4",children:[e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary/20"}),e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary border-t-transparent animate-spin"})]}),e.jsx("p",{className:"text-muted-foreground",children:"Loading queue..."})]})}):e.jsxs("div",{className:"space-y-6 relative",children:[e.jsx("div",{className:"absolute -top-12 left-1/4 w-96 h-96 rounded-full bg-primary/10 blur-3xl pointer-events-none -z-10"}),e.jsx("div",{className:"absolute top-32 right-0 w-72 h-72 rounded-full bg-accent/10 blur-3xl pointer-events-none -z-10"}),e.jsx("div",{className:"sticky top-16 z-30 -mx-1 px-1 pt-1 pb-1",children:e.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-border/50 bg-card/70 backdrop-blur-xl shadow-[0_8px_32px_-12px_hsl(var(--primary)/0.25)]",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/[0.06] via-trans
123parent to-accent/[0.05] pointer-events-none"}),e.jsxs("div",{className:"relative flex items-start gap-4 p-5 md:p-6",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-gradient-to-br from-primary/25 to-accent/20 flex items-center justify-center border border-primary/20 shadow-md shadow-primary/10 shrink-0",children:e.jsx(wr,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/80 font-medium",children:"Engagement Queue"}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-muted-foreground/40"}),e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-primary/80 font-medium",children:"All platforms"})]}),e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold tracking-tight text-foreground",children:"Your engagement queue"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 max-w-2xl leading-relaxed",children:"Every pending and completed comment across platforms â review, retry, or remove from one place."})]}),e.jsxs(h,{variant:"outline",size:"sm",onClick:v,disabled:n,className:"shrink-0",children:[e.jsx(st,{className:`h-4 w-4 mr-2 ${n?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[e.jsx(U,{className:"border-yellow-500/30 bg-yellow-500/5",children:e.jsxs(ye,{className:"p-4 flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-yellow-500/20",children:e.jsx(Cs,{className:"h-5 w-5 text-yellow-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:j.pending}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Pending"})]})]})}),e.jsx(U,{className:"border-blue-500/30 bg-blue-500/5",children:e.jsxs(ye,{className:"p-4 flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-blue-500/20",children:e.jsx(Pe,{className:"h-5 w-5 text-blue-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:j.inProgress}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Processing"})]})]})}),e.jsx(U,{className:"border-green-500/30 bg-green-500/5",children:e.jsxs(ye,{className:"p-4 flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-green-500/20",children:e.jsx(ys,{className:"h-5 w-5 text-green-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:j.completed}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Posted"})]})]})}),e.jsx(U,{className:"border-red-500/30 bg-red-500/5",children:e.jsxs(ye,{className:"p-4 flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-red-500/20",children:e.jsx(Rt,{className:"h-5 w-5 text-red-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:j.failed}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Failed"})]})]})})]}),e.jsx(U,{className:"border-border/50 bg-card/50 backdrop-blur-xl",children:e.jsx(ye,{className:"p-4",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ta,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Filters:"})]}),e.jsxs(Gs,{value:c,onValueChange:x,children:[e.jsx(qs,{className:"w-[140px] h-9",children:e.jsx(Us,{placeholder:"Platform"})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"all",children:"All Platforms"}),e.jsx(Te,{value:"linkedin",children:"LinkedIn"}),e.jsx(Te,{value:"twitter",children:"Twitter/X"}),e.jsx(Te,{value:"reddit",children:"Reddit"}),e.jsx(Te,{value:"facebook",children:"Facebook"})]})]}),e.jsxs(Gs,{value:d,onValueChange:u,children:[e.jsx(qs,{className:"w-[140px] h-9",children:e.jsx(Us,{placeholder:"Status"})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"all",children:"All Statuses"}),e.jsx(Te,{value:"pending",children:"Pending"}),e.jsx(Te,{value:"in_progress",children:"Processing"}),e.jsx(Te,{value:"completed",children:"Completed"}),e.jsx(Te,{value:"failed",children:"Failed"})]})]}),j.completed>0&&e.jsxs(wi,{children:[e.jsx(ki,{asChild:!0,children:e.jsxs(h,{variant:"outline",size:"sm",className:"ml-auto",children:[e.jsx(ua,{className:"h-4 w-4 mr-2"}),"Clear Completed"]})}),e.jsxs(hn,{children:[e.jsxs(pn,{children:[e.jsx(fn,{children:"Clear completed items?"}),e.jsxs(bn,{children:["This will remove all ",j.completed," completed items from your queue. This action cannot be undone."]})]}),e.jsxs(gn,{children:[e.jsx(yn,{children:"Cancel"}),e.jsx(jn,{onClick:C,children:"Clear All"})]})]})]})]})})}
123),t.length===0?e.jsx(Yi,{icon:wr,title:"Queue is empty",description:"No items in your engagement queue. Discover posts and add them to the queue to start auto-posting."}):e.jsx("div",{className:"space-y-3",children:t.map(N=>{const f=Jo[N.status]||Jo.pending,R=f.icon;return e.jsx(U,{className:"border-border/50 bg-card/50 backdrop-blur-sm hover:bg-card/70 transition-colors",children:e.jsx(ye,{className:"p-4",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:flex-col sm:items-start sm:gap-2 sm:w-24 shrink-0",children:[e.jsxs(W,{className:gb[N.platform]||"bg-muted",children:[y(N.platform),e.jsx("span",{className:"ml-1.5 capitalize",children:N.platform==="twitter"?"X":N.platform})]}),e.jsxs(W,{className:`${f.color} flex items-center gap-1`,children:[e.jsx(R,{className:`h-3 w-3 ${N.status==="in_progress"?"animate-spin":""}`}),f.label]})]}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[e.jsx("p",{className:"text-sm line-clamp-2",children:N.reply_text}),N.error_message&&e.jsx("p",{className:"text-xs text-red-500 bg-red-500/10 px-2 py-1 rounded",children:N.error_message}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsxs("span",{children:["Added ",ha(new Date(N.created_at),{addSuffix:!0})]}),N.attempts&&N.attempts>0&&e.jsxs("span",{children:["⢠",N.attempts," attempt",N.attempts!==1?"s":""]}),N.processed_at&&e.jsxs("span",{children:["⢠Processed ",ha(new Date(N.processed_at),{addSuffix:!0})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx(h,{variant:"ghost",size:"icon",onClick:()=>window.open(N.post_url,"_blank"),title:"View post",children:e.jsx(Ys,{className:"h-4 w-4"})}),N.status==="failed"&&e.jsxs(h,{variant:"outline",size:"sm",onClick:()=>z(N),children:[e.jsx(st,{className:"h-4 w-4 mr-1"}),"Retry"]}),e.jsxs(wi,{children:[e.jsx(ki,{asChild:!0,children:e.jsx(h,{variant:"ghost",size:"icon",disabled:m===N.id,className:"text-muted-foreground hover:text-destructive",children:m===N.id?e.jsx(Pe,{className:"h-4 w-4 animate-spin"}):e.jsx(ua,{className:"h-4 w-4"})})}),e.jsxs(hn,{children:[e.jsxs(pn,{children:[e.jsx(fn,{children:"Remove from queue?"}),e.jsx(bn,{children:"This will remove this item from your queue. This action cannot be undone."})]}),e.jsxs(gn,{children:[e.jsx(yn,{children:"Cancel"}),e.jsx(jn,{onClick:()=>b(N.id),children:"Remove"})]})]})]})]})]})})},N.id)})})]})}const Zo={check_reply:Ks,dm:ms,email:Fs,cross_platform_dm:At,final_nudge:At},Xa={check_reply:"Check for reply",dm:"Send DM",email:"Send email",cross_platform_dm:"Cross-platform DM",final_nudge:"Final nudge"},bb={email_queued:{text:"Email queued",tone:"success"},email_queued_via_mailbox:{text:"Sending from your mailbox",tone:"success"},dm_queued:{text:"DM queued",tone:"success"},dm_queued_for_extension:{text:"DM queued (sent via extension)",tone:"success"},final_email_sent:{text:"Final email sent",tone:"success"},replied:{text:"Prospect replied",tone:"success"},awaiting_extension_check:{text:"Waiting for reply check",tone:"info"},no_reply_detected:{text:"No reply detected â moving on",tone:"info"},email_lookup_pending:{text:"Looking up emailâ¦",tone:"info"},no_email_found:{text:"Email not found â DM track continues",tone:"info"},no_alternate_platform:{text:"No alternate profile found",tone:"warn"},no_alternate_platform_found:{text:"No alternate profile found",tone:"warn"},final_nudge_no_channel:{text:"Skipped â no email on file",tone:"warn"},dm_failed:{text:"Couldn't queue DM",tone:"error"},cross_dm_failed:{text:"Cross-platform DM failed",tone:"error"}};function el(s){return s?s.startsWith("cross_dm_queued_")?{text:`DM queued on ${s.replace("cross_dm_queued_","")}`,tone:"success"}:bb[s]||{text:s.replace(/_/g," "),tone:"info"}:null}function jb(s){return s||""}const yb={success:"border-accent/40 text-accent bg-accent/5",warn:"border-amber-500/40 text-amber-500 bg-amber-500/5",info:"border-primary/30 text-primary bg-primary/5",error:"border-destructive/40 text-destructive bg-destructive/5"},vb={dm:{label:"Send DM",message:"Hi {{first_name}}, following up on my last note."},email:{label:"Send email",subject:"Quick follow-up",message:`Hi {{first_name}}, 124 125Wanted to circle back on my last message. 126 127Best,`},cross_platform_dm:{label:"Cross-platform DM",message:"Hi {{first_name}}, tried reaching out elsewhere â open to a quick chat?"},final_nudge:{label:"Last note from me â should I close the loop or is now not the right moment?",message:"Last note from me â should I close the loop or is now not the right moment?"}},Nb=["Personalize the first 5 words â referencing the prospect's role or recent post lifts replies ~2Ã.","Wait 48â72h between touches; same-day follow-ups feel pushy.","A/B test subject lines first â they drive most of the open-rate variance.","End with a soft CTA like 'Worth 15 min?' rather than a hard demo ask."];function wb({followup:s,onUpdated:t}){var le;const[a,r]=i.useState(s.steps||[]),[o,n]=i.useState(null),[l,c]=i.useState(!1),[x,d]=i.useState(null),[u,m]=i.useState(null),[p,g]=i.useState(!1),[v,b]=i.useState(!1),[z,C]=i.useState(!1),[j,y]=i.useState({email:s.prospect_email||"",profilesText:s.prospect_profiles?Object.entries(s.prospect_profiles).map(([F,L])=>`${F}: ${L}`).join(` 128`):""}),[N,f]=i.useState(!1);i.useEffect(()=>{r(s.steps||[])},[s.id,s.steps]),i.useEffect(()=>{y({email:s.prospect_email||"",profilesText:s.prospect_profiles?Object.entries(s.prospect_profiles).map(([F,L])=>`${F}: ${L}`).join(` 129`):""})},[s.id,s.prospect_email,s.prospect_profiles]);const R=s.status!=="active"&&s.status!=="paused",M=(F,L)=>{r(K=>K.map((ue,Ne)=>Ne===F?{...ue,...L}:ue))},q=F=>{const L=vb[F]||{label:Xa[F]||F,message:""};r(K=>[...K,{step:K.length+1,channel:F,label:L.label,scheduled_at:null,executed_at:null,result:null,message:L.message,subject:L.subject,delay_hours:48}])},_=F=>{r(L=>L.filter((K,ue)=>ue!==F).map((K,ue)=>({...K,step:ue+1})))},A=async()=>{c(!0);const{error:F}=await w.from("lead_followups").update({steps:a,updated_at:new Date().toISOString()}).eq("id",s.id);if(c(!1),F){k.error("Couldn't save: "+F.message);return}k.success("Sequence updated"),n(null),t==null||t()},B=async F=>{d(F);try{const{data:L,error:K}=await w.functions.invoke("lead-followup-engine",{body:{action:"generate_step_content",followup_id:s.id,step_index:F,channel:a[F].channel}});if(K)throw K;L!=null&&L.message?(M(F,{message:L.message,...L.subject?{subject:L.subject}:{}}),k.success("Draft generated")):k.error("Couldn't generate â try again")}catch(L){k.error((L==null?void 0:L.message)||"Generation failed")}finally{d(null)}},P=F=>{var ue,Ne,fe;const L=a[F],K=!((ue=L.ab_test)!=null&&ue.enabled);M(F,{ab_test:{enabled:K,variant_a:L.message||"",variant_b:((Ne=L.ab_test)==null?void 0:Ne.variant_b)||"",subject_a:L.subject,subject_b:(fe=L.ab_test)==null?void 0:fe.subject_b}})},I=async F=>{m(F);try{const{data:L,error:K}=await w.functions.invoke("process-lead-followups",{body:{followup_id:s.id,force_step:F+1}});if(K)throw K;k.success((L==null?void 0:L.message)||"Step queued â refreshing"),t==null||t()}catch(L){k.error((L==null?void 0:L.message)||"Couldn't run this step")}finally{m(null)}},$=async()=>{var F,L;g(!0);try{z&&await be();const K=await w.functions.invoke("lead-followup-engine",{body:{action:"enrich",followup_id:s.id}});if(K.error)throw K.error;const ue=(F=K.data)==null?void 0:F.email,Ne=((L=K.data)==null?void 0:L.profiles)||{};if(!(!!ue||!!s.prospect_email||!!j.email.trim()||Object.keys(Ne).length>0||Object.keys(s.prospect_profiles||{}).length>0)){k.error("Still couldn't find a contact â add an email manually and retry."),t==null||t();return}s.status==="paused"&&await w.from("lead_followups").update({status:"active",updated_at:new Date().toISOString()}).eq("id",s.id);const me=a.findIndex(Q=>!Q.executed_at);if(me===-1){k.success(ue?`Found ${ue} â sequence already complete.`:"Lead refreshed."),t==null||t();return}const Ie=await w.functions.invoke("process-lead-followups",{body:{followup_id:s.id,force_step:me+1}});if(Ie.error)throw Ie.error;k.success(ue?`Found ${ue} â running step ${me+1} now.`:`Lead refreshed â running step ${me+1} now.`),t==null||t()}catch(K){k.error((K==null?void 0:K.message)||"Retry failed â try again in a moment.")}finally{g(!1)}},be=async()=>{f(!0);try{const F={};j.profilesText.split(/\n+/).map(K=>
129K.trim()).filter(Boolean).forEach(K=>{const ue=K.match(/^([^:\s]+)\s*:\s*(.+)$/);if(ue)F[ue[1].toLowerCase()]=ue[2].trim();else if(/^https?:\/\//i.test(K))try{const Ne=new URL(K).hostname.replace(/^www\./,"").split(".")[0];F[Ne]=K}catch{}});const{error:L}=await w.from("lead_followups").update({prospect_email:j.email.trim()||null,prospect_profiles:Object.keys(F).length?F:null,updated_at:new Date().toISOString()}).eq("id",s.id);if(L)throw L;k.success("Contact updated"),C(!1),t==null||t()}catch(F){k.error((F==null?void 0:F.message)||"Couldn't update contact")}finally{f(!1)}},Y=F=>{if(!F)return null;const L=new Date(F).getTime()-Date.now();if(L<=0)return"due now";const K=Math.round(L/6e4);if(K<60)return`in ${K}m`;const ue=Math.round(K/60);return ue<24?`in ${ue}h`:`in ${Math.round(ue/24)}d`},O=i.useMemo(()=>a.filter(F=>F.executed_at&&F.result!=="failed").length,[a]),he=a.length?Math.round(O/a.length*100):0,re={replied:{label:"Replied",tone:"border-accent/40 text-accent bg-accent/5",Icon:bi},active:{label:"Active",tone:"border-primary/40 text-primary bg-primary/5",Icon:Pe},completed:{label:"Completed",tone:"border-muted-foreground/30 text-muted-foreground bg-muted/10",Icon:Ve},paused:{label:"Paused",tone:"border-amber-500/40 text-amber-500 bg-amber-500/5",Icon:Cs},failed:{label:"Stopped",tone:"border-destructive/40 text-destructive bg-destructive/5",Icon:qt}},oe=re[s.status]||re.active,T=oe.Icon,ce=i.useMemo(()=>{for(let F=a.length-1;F>=0;F--){const L=el(a[F].result);if(L&&(L.tone==="warn"||L.tone==="error"))return{step:a[F],result:L}}return null},[a]);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(W,{variant:"outline",className:`gap-1.5 ${oe.tone}`,children:[e.jsx(T,{className:`h-3 w-3 ${s.status==="active"?"animate-spin":""}`}),oe.label]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[O," of ",a.length," steps"]})]}),s.next_action_at&&s.status==="active"&&e.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(Cs,{className:"h-3 w-3"}),"Next step ",Y(s.next_action_at)]})]}),e.jsx(zt,{value:he,className:"h-1.5"})]}),s.status==="replied"&&e.jsxs("div",{className:"rounded-md border border-accent/30 bg-accent/5 p-3 flex items-start gap-2",children:[e.jsx(bi,{className:"h-4 w-4 text-accent shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-xs",children:[e.jsx("p",{className:"font-medium text-accent",children:"The prospect replied â sequence stopped."}),e.jsx("p",{className:"text-muted-foreground mt-0.5",children:"Move them to the next pipeline stage when you're ready."})]})]}),s.status==="completed"&&e.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-muted/10 p-3 flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-muted-foreground shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-xs",children:[e.jsx("p",{className:"font-medium",children:"Sequence finished without a reply."}),e.jsx("p",{className:"text-muted-foreground mt-0.5",children:"Consider re-engaging in a few weeks with a new angle."})]})]}),(ce||s.status==="paused")&&s.status!=="replied"&&s.status!=="completed"&&e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/5 p-2.5 flex items-start gap-2",children:[e.jsx(qt,{className:"h-3.5 w-3.5 text-amber-500 shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5",children:[e.jsxs("p",{className:"text-[11px] text-foreground/80",children:[e.jsx("span",{className:"font-medium",children:s.status==="paused"?"Sequence paused.":"Heads up:"})," ",(ce==null?void 0:ce.result.text)||"Add or update contact info, then retry.",((le=ce==null?void 0:ce.result.text)==null?void 0:le.includes("Email not found"))&&" â add an email below, then retry."]}),e.jsxs(h,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1 border-amber-500/40 text-amber-700 dark:text-amber-400 hover:bg-amber-500/10",onClick:$,disabled:p||R,children:[p?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}
129):e.jsx(Qx,{className:"h-3 w-3"}),"Retry this lead"]})]})]}),e.jsxs("div",{className:"rounded-md border border-border/30 bg-muted/5 p-2.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide flex items-center gap-1.5",children:[e.jsx(Jx,{className:"h-3 w-3"}),"Contact"]}),!R&&!z&&e.jsx(h,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>C(!0),children:e.jsx(ka,{className:"h-3 w-3"})})]}),z?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx(Ce,{className:"text-[10px] text-muted-foreground",children:"Email"}),e.jsx(Je,{type:"email",value:j.email,onChange:F=>y({...j,email:F.target.value}),placeholder:"[email protected]",className:"h-8 text-xs"})]}),e.jsxs("div",{children:[e.jsx(Ce,{className:"text-[10px] text-muted-foreground",children:"Profiles (one per line, e.g. linkedin: https://â¦)"}),e.jsx(Vs,{value:j.profilesText,onChange:F=>y({...j,profilesText:F.target.value}),placeholder:`linkedin: https://linkedin.com/in/⦠130twitter: https://twitter.com/â¦`,className:"text-xs min-h-[60px]"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs(h,{size:"sm",className:"h-7 text-xs gap-1",onClick:be,disabled:N,children:[N?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):e.jsx(pi,{className:"h-3 w-3"}),"Save contact"]}),e.jsx(h,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>C(!1),children:"Cancel"})]})]}):s.prospect_email||s.prospect_profiles&&Object.keys(s.prospect_profiles).length>0?e.jsxs("div",{className:"space-y-1",children:[s.prospect_email&&e.jsx("p",{className:"text-xs break-all",children:s.prospect_email}),s.prospect_profiles&&Object.entries(s.prospect_profiles).map(([F,L])=>e.jsxs("p",{className:"text-xs",children:[e.jsxs("span",{className:"text-muted-foreground capitalize",children:[F,": "]}),e.jsx("a",{href:L,target:"_blank",rel:"noopener",className:"text-primary hover:underline break-all",children:L})]},F))]}):e.jsx("p",{className:"text-[11px] text-muted-foreground italic",children:"No contact info yet â add an email or profile to power email + DM steps."})]}),e.jsxs(na,{open:v,onOpenChange:b,children:[e.jsx(ia,{asChild:!0,children:e.jsxs(h,{variant:"ghost",size:"sm",className:"w-full justify-between h-7 px-2",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[e.jsx(za,{className:"h-3.5 w-3.5"}),"Tips for better reply rates"]}),e.jsx(nt,{className:`h-3.5 w-3.5 transition-transform ${v?"rotate-180":""}`})]})}),e.jsx(oa,{className:"mt-1.5",children:e.jsx("ul",{className:"text-[11px] text-muted-foreground space-y-1 pl-6 list-disc",children:Nb.map(F=>e.jsx("li",{children:F},F))})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Sequence"}),!R&&e.jsxs(h,{size:"sm",onClick:A,disabled:l,className:"h-7 text-xs gap-1",children:[l?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):e.jsx(pi,{className:"h-3 w-3"}),"Save changes"]})]}),a.map((F,L)=>{var Q,ne;const K=L+1===s.current_step&&s.status==="active",ue=F.executed_at&&F.result!=="failed",Ne=F.result==="failed",fe=Zo[F.channel]||At,me=o===L,Ie=!ue&&!Ne&&!R;return e.jsx(U,{className:ue?"bg-accent/5 border-accent/20":K?"bg-primary/5 border-primary/30":Ne?"bg-destructive/5 border-destructive/20":"bg-card border-border/40",children:e.jsxs(ye,{className:"p-2.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsx("div",{className:`h-6 w-6 rounded-full border flex items-center justify-center shrink-0 ${ue?"border-accent bg-accent/10":K?"border-primary bg-primary/10":Ne?"border-destructive bg-destructive/10":"border-border/40 bg-muted/30"}`,children:ue?e.jsx(Ve,{className:"h-3 w-3 text-accent"}):K?e.jsx(Pe,{className:"h-3 w-3 text-primary animate-spin"}):Ne?e.jsx(Rt,{className:"h-3 w-3 text-destructive"}):e.jsx(fe,{className:"h-3 w-3 text-muted-foreground"})}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsxs("p",{className:"text-xs font-medium truncate",children:[e.jsxs("span",{className:"text-muted-foreground",children:[F.step,"."]})," ",jb(F.label)]}),e.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[e.jsx(W,{variant:"outline",className:"h-4 text-[9px] px-1 font-normal",children:Xa[F.channel]||F.channel}),F.delay_hours?e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["+",F.delay_hours,"h"]}):null,(()=>{const ke=el(F.result);if(F.executed_at&&ke)return e.jsx(W,{variant:"outline",className:`h-4 text-[9px] px-1 font-normal ${yb[ke.tone]}`,children:ke.text});if(K){const ee=Y(s.next_action_at);return e.jsxs("span",{className:"text-[10px] text-primary flex items-center gap-1",children:[e.jsx(Pe,{className:"h-2.5 w-2.5 animate-spin"}),ee?`Running ${ee}`:"Runningâ¦"]})}return!F.executed_at&&L+1>s.current_step?e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Queued"}):null})(),F.executed_at&&e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["· ",new Date(F.executed_at).toLocaleDateString([],{month:"short",day:"numeric"})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[!R&&!ue&&s.status==="active"&&e.jsxs(h,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-[10px] gap-1 text-primary hover:text-primary",onClick:()=>
130I(L),disabled:u===L,title:"Run this step now",children:[u===L?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):e.jsx(Ua,{className:"h-3 w-3"}),"Run now"]}),Ie&&e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>n(me?null:L),children:me?e.jsx(zs,{className:"h-3 w-3"}):e.jsx(ka,{className:"h-3 w-3"})}),e.jsx(h,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>_(L),children:e.jsx(ua,{className:"h-3 w-3"})})]})]})]}),me&&e.jsxs("div",{className:"space-y-2 pt-2 border-t border-border/30",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(Ce,{className:"text-[10px] text-muted-foreground",children:"Channel"}),e.jsxs(Gs,{value:F.channel,onValueChange:ke=>M(L,{channel:ke,label:Xa[ke]||ke}),children:[e.jsx(qs,{className:"h-8 text-xs",children:e.jsx(Us,{})}),e.jsx(Hs,{children:Object.keys(Xa).map(ke=>e.jsx(Te,{value:ke,className:"text-xs",children:Xa[ke]},ke))})]})]}),e.jsxs("div",{children:[e.jsx(Ce,{className:"text-[10px] text-muted-foreground",children:"Delay (hours)"}),e.jsx(Je,{type:"number",min:0,value:F.delay_hours??48,onChange:ke=>M(L,{delay_hours:parseInt(ke.target.value)||0}),className:"h-8 text-xs"})]})]}),F.channel==="email"&&e.jsxs("div",{children:[e.jsx(Ce,{className:"text-[10px] text-muted-foreground",children:"Subject"}),e.jsx(Je,{value:F.subject||"",onChange:ke=>M(L,{subject:ke.target.value}),className:"h-8 text-xs",placeholder:"Subject line"})]}),F.channel!=="check_reply"&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx(Ce,{className:"text-[10px] text-muted-foreground",children:"Message"}),e.jsxs(h,{type:"button",variant:"ghost",size:"sm",className:"h-6 text-[10px] gap-1 px-2",onClick:()=>B(L),disabled:x===L,children:[x===L?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):e.jsx(es,{className:"h-3 w-3"}),"Generate with AI"]})]}),e.jsx(Vs,{value:F.message||"",onChange:ke=>M(L,{message:ke.target.value}),className:"text-xs min-h-[80px]",placeholder:"Use {{first_name}}, {{company}} for personalization"})]}),F.channel!=="check_reply"&&e.jsxs("div",{className:"rounded-md border border-border/30 bg-muted/10 p-2 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(Ce,{className:"text-[10px] flex items-center gap-1.5 text-muted-foreground",children:[e.jsx(Zx,{className:"h-3 w-3"}),"A/B test this step"]}),e.jsx(Js,{checked:!!((Q=F.ab_test)!=null&&Q.enabled),onCheckedChange:()=>P(L)})]}),((ne=F.ab_test)==null?void 0:ne.enabled)&&e.jsxs("div",{className:"space-y-2",children:[F.channel==="email"&&e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(Je,{placeholder:"Subject A",value:F.ab_test.subject_a||F.subject||"",onChange:ke=>M(L,{ab_test:{...F.ab_test,subject_a:ke.target.value}}),className:"h-7 text-xs"}),e.jsx(Je,{placeholder:"Subject B",value:F.ab_test.subject_b||"",onChange:ke=>M(L,{ab_test:{...F.ab_test,subject_b:ke.target.value}}),className:"h-7 text-xs"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[e.jsx(Vs,{placeholder:"Variant A",value:F.ab_test.variant_a,onChange:ke=>M(L,{ab_test:{...F.ab_test,variant_a:ke.target.value}}),className:"text-xs min-h-[60px]"}),e.jsx(Vs,{placeholder:"Variant B",value:F.ab_test.variant_b,onChange:ke=>M(L,{ab_test:{...F.ab_test,variant_b:ke.target.value}}),className:"text-xs min-h-[60px]"})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"50/50 split â winner is auto-detected by reply rate."})]})]})]})]})},L)}),!R&&e.jsxs("div",{className:"flex flex-wrap gap-1.5 pt-1",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground w-full uppercase tracking-wide font-semibold",children:"Add step"}),Object.keys(Xa).filter(F=>F!=="check_reply").map(F=>{const L=Zo[F]||At;return e.jsxs(h,{variant:"outline",size:"sm",onClick:()=>q(F),className:"h-7 text-xs gap-1",children:[e.jsx(ft,{className:"h-3 w-3"}),e.jsx(L,{className:"h-3 w-3"}),Xa[F]]},F)})]})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground border-t border-border/20 pt-2",children:"Sequence runs automatically every 10 min. DMs go via your extension; emails via Resend."})]})}function kb({userId:s}){const[t,a]=i.useState(null),[r,o]=i.useState([]),[n,l]=i.useState(!0);if(i.useEffect(()=>{(async()=>
130{l(!0);const{data:d}=await w.from("lead_followup_performance").select("*").eq("user_id",s).maybeSingle();a(d||{active_count:0,replied_count:0,completed_count:0,total_count:0,reply_rate_pct:0});const{data:u}=await w.from("lead_followups").select("steps, status").eq("user_id",s),m={dm:{channel:"DM",sent:0,replies:0},email:{channel:"Email",sent:0,replies:0},cross_platform_dm:{channel:"Cross-Platform DM",sent:0,replies:0},final_nudge:{channel:"Final Nudge",sent:0,replies:0}};for(const p of u||[]){const g=p.status==="replied";for(const v of p.steps||[])!v.executed_at||!m[v.channel]||(m[v.channel].sent++,g&&m[v.channel].replies++)}o(Object.values(m)),l(!1)})()},[s]),n)return e.jsx(U,{className:"border-border/30 bg-card/40 backdrop-blur-xl",children:e.jsx(ye,{className:"py-6 flex items-center justify-center",children:e.jsx(Pe,{className:"h-4 w-4 animate-spin text-muted-foreground"})})});if(!t||t.total_count===0)return null;const c=t.reply_rate_pct??0;return e.jsxs(U,{className:"border-border/30 bg-card/40 backdrop-blur-xl",children:[e.jsxs(Be,{className:"pb-3",children:[e.jsxs($e,{className:"text-base flex items-center gap-2",children:[e.jsx(gs,{className:"h-4 w-4 text-accent"}),"Follow-Up Performance"]}),e.jsx(os,{className:"text-xs",children:"Real-time conversion metrics from your automated sequences"})]}),e.jsxs(ye,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsx(Jr,{label:"Active",value:t.active_count,accent:"text-primary"}),e.jsx(Jr,{label:"Replied",value:t.replied_count,accent:"text-accent",icon:Ve}),e.jsx(Jr,{label:"Completed",value:t.completed_count,accent:"text-muted-foreground"}),e.jsx(Jr,{label:"Reply Rate",value:`${c}%`,accent:c>=15?"text-accent":"text-foreground"})]}),e.jsxs("div",{className:"border-t border-border/20 pt-3 space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Channel Effectiveness"}),r.filter(x=>x.sent>0).length===0?e.jsx("p",{className:"text-xs text-muted-foreground/60 italic",children:"No touchpoints sent yet"}):r.filter(x=>x.sent>0).map(x=>{const d=x.sent>0?Math.round(x.replies/x.sent*100):0;return e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[x.channel.includes("DM")?e.jsx(ms,{className:"h-3 w-3 text-muted-foreground"}):e.jsx(Fs,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{children:x.channel})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-muted-foreground",children:[x.sent," sent"]}),e.jsxs(W,{variant:"outline",className:d>=15?"border-accent/30 text-accent":"border-border/40 text-muted-foreground",children:[d,"% reply"]})]})]},x.channel)})]})]})]})}function Jr({label:s,value:t,accent:a,icon:r}){return e.jsxs("div",{className:"rounded-lg border border-border/20 bg-background/40 p-2.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[r&&e.jsx(r,{className:`h-3 w-3 ${a}`}),e.jsx("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:s})]}),e.jsx("p",{className:`text-lg font-display font-semibold ${a}`,children:t})]})}function Sb(s,t){if(typeof window>"u")return Promise.resolve({success:!1,email:null,emails:[],externalLinks:[],error:"Not in browser"});const a=`epe_${Date.now()}_${Math.random().toString(36).slice(2)}`;return new Promise(r=>{const o=setTimeout(()=>{window.removeEventListener("message",n),r({success:!1,email:null,emails:[],externalLinks:[],error:"Extension timed out"})},t),n=l=>{const c=l==null?void 0:l.data;(c==null?void 0:c.type)==="DESHILLER_EXTRACT_PROSPECT_EMAIL_RESPONSE"&&c.requestId===a&&(clearTimeout(o),window.removeEventListener("message",n),r({success:!!c.success,email:c.email??(Array.isArray(c.emails)?c.emails[0]??null:null),emails:Array.isArray(c.emails)?c.emails:[],externalLinks:Array.isArray(c.externalLinks)?c.externalLinks:[],url:c.url,sourceLabel:c.sourceLabel,attempts:Array.isArray(c.attempts)?c.attempts:void 0,error:c.error}))};window.addEventListener("message",n),window.postMessage({...s,type:"DESHILLER_EXTRACT_PROSPECT_EMAIL",requestId:a},"*")})}function Cb(s,t={}){const a=t.totalTimeoutMs??7e4;return Sb({attempts:s,totalTimeoutMs:a},a+5e3)}const _b=/(@gmail\.|@yahoo\.|@hotmail\.|@outlook\.|@aol\.|@icloud\.|@protonmail\.)/i,Tb=/^(info|contact|hello|hi|sales|office|admin|supp
130ort|team)/i,Ab=/^(noreply|no-reply|donotreply|notifications)/i,sl={lead:{delta:50,label:"On file (already known contact)"},extension_youtube_scrape:{delta:10,label:"Source: scraped from YouTube channel"},extension_linkedin_scrape:{delta:10,label:"Source: scraped from LinkedIn profile"},extension_chain:{delta:10,label:"Source: scraped from public profile"},website_scrape:{delta:10,label:"Source: company website"},searxng:{delta:0,label:"Source: public web search"},company_guess:{delta:-10,label:"Source: guessed from company name"}};function Qa(s,t,a){if(!a)return s;const r=a[t];return typeof r!="number"||!isFinite(r)?s:Math.round(s*r)}function Zr(s,t={}){const a=[],r=(s.split("@")[0]||"").toLowerCase(),o=(s.split("@")[1]||"").toLowerCase(),n=t.weights;a.push({delta:50,label:"Base score",code:"base"});const l=(t.businessDomain||"").toLowerCase().replace(/^www\./,"");l&&o.endsWith(l)&&a.push({delta:Qa(30,"domain_match",n),label:`Domain matches company (${l})`,code:"domain_match"}),t.contactName&&t.contactName.toLowerCase().split(/\s+/).filter(p=>p.length>1).some(p=>r.includes(p))&&a.push({delta:Qa(15,"name_match",n),label:"Name appears in local part",code:"name_match"}),Tb.test(r)&&a.push({delta:Qa(5,"role_address",n),label:"Role address (info/contact/sales)",code:"role_address"}),Ab.test(r)&&a.push({delta:Qa(-50,"noreply",n),label:"No-reply / notifications address",code:"noreply"}),_b.test(s)&&a.push({delta:Qa(-15,"freemail",n),label:`Free webmail domain (${o})`,code:"freemail"});const c=(t.source||"").toLowerCase(),x=Object.keys(sl).find(m=>c===m||c.startsWith(m));if(x){const m=sl[x],p=`source:${x}`;m.delta!==0&&a.push({delta:Qa(m.delta,p,n),label:m.label,code:p})}t.corroborated&&a.push({delta:Qa(5,"corroborated",n),label:"Corroborated by multiple sources",code:"corroborated"});const d=a.reduce((m,p)=>m+p.delta,0);return{score:Math.max(0,Math.min(100,d)),breakdown:a}}async function tl(s){try{await w.functions.invoke("record-email-finder-feedback",{body:{decision:s.decision,lead_id:s.leadId??null,email:s.decision==="edited"?s.originalEmail??s.email:s.email,edited_email:s.decision==="edited"?s.email:null,source:s.source??null,score:s.score??null,breakdown:s.breakdown??null,reason:s.reason??null}})}catch{}}async function Ib(s){try{const{data:t}=await w.from("email_factor_weights").select("factor_code, multiplier").eq("user_id",s),a={};for(const r of t||[])a[r.factor_code]=Number(r.multiplier);return a}catch{return{}}}function al(s){switch((s||"").toLowerCase()){case"lead":return"the lead record";case"website_scrape":return"their company website";case"company_guess":return"guessed company domain";case"searxng":return"public web search";case"github":return"their public GitHub profile";case"aggregator":return"their bio link page";case"external_link_scrape":return"their linked personal site";case"candidate_url_scrape":return"a site linked from their profile";case"extension_youtube_scrape":return"their YouTube channel";case"extension_linkedin_scrape":return"their LinkedIn profile";case"none":return"â";default:return s?s.replace(/_/g," "):"unknown"}}function Lb(s){if(!s)return null;switch(s){case"not_found":return"No verifiable email surfaced from public sources.";default:return s.replace(/_/g," ")}}function en(s){if(!s)return null;try{return new URL(/^https?:\/\//i.test(s)?s:`https://${s}`).hostname.replace(/^www\./i,"").toLowerCase()}catch{return null}}function zb({lead:s,open:t,onOpenChange:a,onConfirm:r,userId:o}){const[n,l]=i.useState({gmail:!1,outlook:!1}),[c,x]=i.useState(!0),[d,u]=i.useState(!1),[m,p]=i.useState(null),[g,v]=i.useState("personal"),[b,z]=i.useState(null),[C,j]=i.useState(null),[y,N]=i.useState(!1),[f,R]=i.useState({status:"idle",email:null,score:null,source:null,reason:null,externalLinks:[],steps:[],breakdown:[],missing:[]}),[M,q]=i.useState(!1),[_,A]=i.useState({}),[B,P]=i.useState(!1),[I,$]=i.useState(""),[be,Y]=i.useState(null),O=i.useCallback(()=>{x(!0);let fe=!1,me=null;(async()=>{var Q;try{const{data:ne}=await w.auth.getUserIdentities(),ke=((ne==null?void 0:ne.identities)||[]).find(ee=>ee.provider==="google");ke&&(fe=!0,me=((Q=ke.identity_data)==null?void 0:Q.email)??null,await w.from("profiles").update({gmail_connected_at:new Date().toISOString(),gmail_email:me}).eq("id",o))}catch{}})();const Ie=Q=>{var ne;((ne=Q.data)==null?void 0:ne.type)==="DESHILLER_MAILBOX_STATUS"&&(l({gmail:!!Q.data.gmail||fe,outlook:!!Q.data.outlook}),x(!1),window.removeEventListener("message",Ie))};window.addEventListener("message",Ie),window.postMessage({type:"DESHILLER_CHECK_MAILBOX_STATUS"},"*"),setTimeout(()=>{window.removeEventListener("message",Ie),l(Q=>({...Q,gmail:Q.gmail||fe})),x(!1)},1500)},[o]);i.useEffect(()=>{if(!t)return;O(),(async()=>{const{data:me}=await w.from("profiles").select("email_provider_default, email_provider_personal, email_provider_work").eq("id",o).maybeSingle(),Ie=(me==null?void 0:me.email_provider_default)||(me==null?void 0:me.email_provider_personal)||null;p(Ie),z((me==null?void 0:me.email_provider_personal)||null),j((me==null?void 0:me.email_provider_work)||null),A(await Ib(o))})();const fe=setInterval(O,3e3);return()=>clearInterval(fe)},[t,o,O]);const he=i.useCallback(async()=>
130{if(!s)return;if(P(!1),Y(null),s.contact_email){const S=s.metadata||{},J=S.website_url||S.linkedin_url||null,{score:je,breakdown:se}=Zr(s.contact_email,{businessDomain:J?en(J):null,contactName:s.contact_name,source:"lead",weights:_});Y(s.contact_email),R({status:"found",email:s.contact_email,score:je,source:"lead",reason:null,externalLinks:[],steps:[{label:"Already on record",ok:!0}],breakdown:se,missing:[]});return}R(S=>({...S,status:"searching",steps:[]}));const fe=(s.source_platform||"").toLowerCase(),me=s.metadata||{},Ie=(s.contact_name||me.handle||me.author||"").toString().replace(/^@/,"").trim(),Q=me.profile_url||me.author_url||me.channel_url||me.source_url||null,ne=[];let ke=[];const ee=S=>!!S&&S.length>=2&&S.length<=40&&/^[A-Za-z0-9._-]+$/.test(S),E=S=>{const J=[],je=Ie.replace(/^@/,"").trim(),se=Ie.replace(/^@/,"").replace(/^\/+|\/+$/g,"").trim(),Oe=me.linkedin_url||(S==null?void 0:S.linkedin)||null,We=(()=>{const Ee=(S==null?void 0:S.youtube)||Q;if(!Ee)return null;try{return new URL(Ee).hostname.endsWith("youtube.com")?Ee:null}catch{return null}})(),H=(()=>{const Ee=Oe||Q;if(!Ee)return null;try{return new URL(Ee).hostname.endsWith("linkedin.com")?Ee:null}catch{return null}})(),ae=We?We.replace(/\/about\/?$/i,"").replace(/\/+$/,""):ee(je)?`https://www.youtube.com/@${je}`:null,ze=H?H.replace(/\/+$/,""):ee(se)?`https://www.linkedin.com/in/${se}`:null,pe=()=>{ae&&(J.push({platform:"youtube",url:`${ae}/about`,label:"YouTube /about"}),J.push({platform:"youtube",url:ae,label:"YouTube channel home"}),J.push({platform:"youtube",url:`${ae}/about`,label:"YouTube /about retry",extraHydrateMs:2500}))},Ae=()=>{ze&&(J.push({platform:"linkedin",url:ze+"/",label:"LinkedIn profile"}),J.push({platform:"linkedin",url:ze+"/overlay/contact-info/",label:"LinkedIn contact card"}))};return fe==="youtube"?(pe(),Ae()):fe==="linkedin"?(Ae(),pe()):(pe(),Ae()),J},xe=async S=>{if(!S.length)return!1;try{const J=await Cb(S);ke=J.externalLinks||ke;const je=J.attempts||[];for(const se of je)ne.push({label:se.ok?`Found on ${se.label}`:`Scanned ${se.label}`,ok:!!se.ok});if(J.email){const se=J.sourceLabel||"extension scrape";
130await w.from("qualified_leads").update({contact_email:J.email,metadata:{...me,email_source:`extension_chain:${se}`,email_external_links:ke,email_attempts:je.map(ze=>({label:ze.label,ok:ze.ok,error:ze.error}))}}).eq("id",s.id),s.contact_email=J.email;const Oe=(J.sourceLabel||"").toLowerCase().includes("linkedin")?"extension_linkedin_scrape":"extension_youtube_scrape",We=me.website_url||me.linkedin_url||null,{score:H,breakdown:ae}=Zr(J.email,{businessDomain:en(We),contactName:s.contact_name,source:Oe,weights:_});return Y(J.email),R({status:"found",email:J.email,score:H,source:se,reason:null,externalLinks:ke,steps:ne,breakdown:ae,missing:[]}),!0}}catch{ne.push({label:"Extension scrape failed",ok:!1})}return!1},ve=E();if(ve.length){if(await xe(ve))return}else ne.push({label:"No verified profile URL â searching the web",ok:!0});try{const{data:S,error:J}=await w.functions.invoke("find-prospect-email",{body:{contact_email:s.contact_email,contact_name:s.contact_name,contact_company:s.contact_company,website_url:me.website_url||ke[0]||null,linkedin_url:me.linkedin_url||null,candidate_urls:ke}});if(J)throw J;const je=S==null?void 0:S.email,se=S==null?void 0:S.score,Oe=S==null?void 0:S.source,We=S==null?void 0:S.reason,H=(S==null?void 0:S.breakdown)||null,ae=(S==null?void 0:S.missing)||[];if(je){ne.push({label:`Found via ${al(Oe)}`,ok:!0}
130),await w.from("qualified_leads").update({contact_email:je,metadata:{...me,email_source:Oe,email_score:se,email_breakdown:H,email_external_links:ke}}).eq("id",s.id),s.contact_email=je;const pe=me.website_url||me.linkedin_url||null,Ae=H&&H.length?{score:se??0,breakdown:H}:Zr(je,{businessDomain:en(pe),contactName:s.contact_name,source:Oe,weights:_});Y(je),R({status:"found",email:je,score:Ae.score,source:al(Oe),reason:null,externalLinks:ke,steps:ne,breakdown:Ae.breakdown,missing:[]});return}const ze=(S==null?void 0:S.profile_urls)||{};if((ze.linkedin||ze.youtube)&&!ve.length){ne.push({label:"Resolved real profile URLs â rescanning",ok:!0});const pe=E(ze);if(pe.length&&await xe(pe)){await w.from("qualified_leads").update({metadata:{...me,linkedin_url:ze.linkedin||me.linkedin_url,youtube_url:ze.youtube||me.youtube_url,profile_url:me.profile_url||ze.linkedin||ze.youtube}}).eq("id",s.id);return}}ne.push({label:"Web search & domain guess",ok:!1}),R({status:"not_found",email:null,score:null,source:null,reason:Lb(We)||"No verifiable email surfaced from public sources",externalLinks:ke,steps:ne,breakdown:[],missing:ae}
130),ke.length&&await w.from("qualified_leads").update({metadata:{...me,email_external_links:ke,website_url:me.website_url||ke[0]}}).eq("id",s.id)}catch(S){ne.push({label:"Server lookup failed",ok:!1}),R({status:"not_found",email:null,score:null,source:null,reason:(S==null?void 0:S.message)||"Lookup failed",externalLinks:ke,steps:ne,breakdown:[],missing:[]})}},[s,_]);if(i.useEffect(()=>{!t||!s||he()},[t,s==null?void 0:s.id]),!s)return null;const re=(s.contact_name||"").split(" ")[0]||"there",oe=n.gmail||n.outlook,T=m&&(m==="extension_gmail"?n.gmail:n.outlook)?m:n.gmail?"extension_gmail":n.outlook?"extension_outlook":null,ce=async()=>{try{u(!0);const fe=await dd.auth.signInWithOAuth("google",{redirect_uri:window.location.href,extraParams:{prompt:"consent",access_type:"offline"}});if(fe!=null&&fe.error){k.error(`Couldn't connect Gmail: ${fe.error.message??"unknown error"}`);return}if(fe!=null&&fe.redirected)return;O(),k.success("Gmail connected.")}catch(fe){k.error(`Couldn't connect Gmail: ${fe instanceof Error?fe.message:String(fe)}`)}finally{u(!1)}},le=async(fe,me)=>{const Ie={email_provider_default:fe,email_provider:fe};me==="personal"&&(Ie.email_provider_personal=fe),me==="work"&&(Ie.email_provider_work=fe),await w.from("profiles").update(Ie).eq("id",o),p(fe),me==="personal"?z(fe):j(fe)},F=async()=>{if(T){u(!0);try{if(await le(T,g),f.status==="found"&&f.email){const fe=!!be&&be!==f.email;tl({decision:fe?"edited":"approved",leadId:s.id,email:f.email,originalEmail:be,source:f.source,score:f.score,breakdown:f.breakdown})}await r(s),a(!1)}finally{u(!1)}}},L=async()=>{if(!f.email)return;tl({decision:"rejected",leadId:s.id,email:f.email,source:f.source,score:f.score,breakdown:f.breakdown,reason:"user_rejected"});const fe=s.metadata||{};
130await w.from("qualified_leads").update({contact_email:null,metadata:{...fe,email_rejected:f.email,email_rejected_at:new Date().toISOString()}}).eq("id",s.id),s.contact_email=null,R(me=>({...me,status:"not_found",email:null,score:null,source:null,reason:"You rejected this email â won't be used."}))},K=async()=>{const fe=I.trim().toLowerCase();if(!fe||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(fe)){k.error("Please enter a valid email address");return}const me=s.metadata||{},Ie=me.website_url||me.linkedin_url||null,{score:Q,breakdown:ne}=Zr(fe,{businessDomain:Ie?en(Ie):null,contactName:s.contact_name,source:f.source||"manual",weights:_});await w.from("qualified_leads").update({contact_email:fe,metadata:{...me,email_source:"user_edit",email_score:Q,email_breakdown:ne}}).eq("id",s.id),s.contact_email=fe,R(ke=>({...ke,email:fe,score:Q,breakdown:ne})),P(!1)},ue=fe=>fe==="extension_gmail"?"Gmail":fe==="extension_outlook"?"Outlook":"â",Ne=f.status==="found"||f.status==="not_found";return e.jsx(gt,{open:t,onOpenChange:a,children:e.jsxs(dt,{className:"bg-card border-border/50 max-w-md",children:[e.jsxs(mt,{children:[e.jsxs(xt,{className:"flex items-center gap-2 text-lg",children:[e.jsx(Lt,{className:"h-4 w-4 text-primary"}),"Follow up with ",re]}),e.jsxs(Mt,{children:["We'll chase ",re," across DM, email, and another platform until they reply."]})]}),e.jsxs("div",{className:"space-y-4 pt-1",children:[e.jsxs("div",{className:"rounded-md border border-border/30 bg-muted/10 p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Contact"}),s.source_platform&&e.jsxs(W,{variant:"outline",className:"text-[10px] capitalize",children:["via ",s.source_platform]})]}),e.jsx("p",{className:"text-sm font-medium",children:s.contact_name})]}),e.jsxs("div",{className:`rounded-md border p-3 space-y-2 ${f.status==="found"?"border-accent/30 bg-accent/5":f.status==="not_found"?"border-amber-500/30 bg-amber-500/5":"border-border/30 bg-muted/10"}`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("span",{className:"text-xs text-muted-foreground uppercase tracking-wide flex items-center gap-1",children:[e.jsx(Ks,{className:"h-3 w-3"})," Email lookup"]}),f.status==="found"&&f.score!=null&&e.jsxs(W,{variant:"outline",className:"text-[10px]",children:["confidence ",Math.min(100,Math.max(0,f.score)),"%"]}),f.status==="searching"&&e.jsxs(W,{variant:"outline",className:"text-[10px] gap-1",children:[e.jsx(Pe,{className:"h-2.5 w-2.5 animate-spin"})," searching"]})]}),f.status==="searching"&&e.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-2",children:[e.jsx(es,{className:"h-3 w-3 text-primary"}),"Trying extension scrape, then web sourcesâ¦"]}),f.status==="found"&&f.email&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ys,{className:"h-4 w-4 text-accent mt-0.5 shrink-0"}),e.jsx("div",{className:"text-sm min-w-0 flex-1",children:B?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Je,{value:I,onChange:fe=>$(fe.target.value),placeholder:"[email protected]",className:"h-7 text-xs",autoFocus:!0}),e.jsx(h,{size:"sm",className:"h-7 text-xs",onClick:K,children:"Save"}),e.jsx(h,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>P(!1),children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-medium truncate",children:f.email}),e.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["from ",f.source||"unknown",be&&be!==f.email&&" · edited"]})]})}),!B&&e.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[e.jsx("button",{type:"button",title:"Edit email",onClick:()=>{$(f.email||""),P(!0)},className:"p-1 rounded hover:bg-muted/40 text-muted-foreground hover:text-foreground",children:e.jsx(ka,{className:"h-3 w-3"})}),e.jsx("button",{type:"button",title:"Reject this email â won't be used and similar sources will be down-weighted",onClick:L,className:"p-1 rounded hover:bg-amber-500/10 text-muted-foreground hover:text-amber-500",children:e.jsx(zs,{className:"h-3 w-3"})})]})]}),f.breakdown.length>0&&e.jsxs("div",{className:"pt-1 border-t border-border/30",children:[e.jsxs("button",{type:"button",onClick:()=>q(fe=>!fe),className:"text-[11px] text-primary hover:underline flex items-center gap-1",children:[M?e.jsx(Gt,{className:"h-3 w-3"}):e.jsx(nt,{className:"h-3 w-3"}),M?"Hide":"Why this score"]}),M&&e.jsx("ul",{className:"mt-1.5 space-y-0.5",children:f.breakdown.map((fe,me)=>{const Ie=fe.code&&_[fe.code]!=null&&_[fe.code]!==1;return e.jsxs("li",{className:"text-[11px] flex items-center gap-2 font-mono",children:[e.jsxs("span",{className:`inline-block w-9 text-right tabular-nums ${fe.delta>0?"text-emerald-500":fe.delta<0?"text-amber-500":"text-muted-foreground"}`,children:[fe.delta>0?"+":"",fe.delta]}),e.jsxs("span",{className:"text-muted-foreground font-sans",children:[fe.label,Ie&&e.jsx("span",{className:"ml-1 text-[10px] text-primary/80",title:`Adjusted from past decisions (Ã${_[fe.code].toFixed(2)})`,children:"· learned"})]})]},me)})})]})]}),f.status==="not_found"&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-amber-500 mt-0.5 shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium",children:"No email found"}),e.jsxs("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:[f.reason||"We couldn't surface a verifiable email."," The follow-up will still run on DM and the cross-platform nudge."]}),f.missing.length>0&&e.jsxs("div",{className:"text-[11px] text-muted-foreground mt-1",children:["What would help: ",f.missing.join(", "),"."]})]})]}),f.externalLinks.length>0&&e.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Found links worth checking:"," ",f.externalLinks.slice(0,2).map((fe,me,Ie)=>{let Q=fe;
130try{Q=new URL(fe.startsWith("http")?fe:`https://${fe}`).hostname}catch{}return e.jsxs("a",{href:fe,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline mr-2",children:[Q,me<Ie.length-1?",":""]},fe)})]})]}),Ne&&f.steps.length>0&&e.jsx("div",{className:"pt-1 border-t border-border/30 space-y-0.5",children:f.steps.map((fe,me)=>e.jsxs("div",{className:"text-[11px] text-muted-foreground flex items-center gap-1.5",children:[fe.ok?e.jsx(ys,{className:"h-2.5 w-2.5 text-accent"}):e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-muted-foreground/40"}),fe.label]},me))}),f.status==="not_found"&&e.jsx("button",{type:"button",onClick:he,className:"text-[11px] text-primary hover:underline",children:"Try again"})]}),c&&!oe?e.jsxs("div",{className:"rounded-md border border-border/30 bg-muted/10 p-4 text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx(Pe,{className:"h-4 w-4 animate-spin"})," Checking your mailboxâ¦"]}):T?e.jsxs("div",{className:"rounded-md border border-accent/30 bg-accent/5 p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ys,{className:"h-4 w-4 text-accent mt-0.5 shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"font-medium",children:["Sending email from your ",ue(T)]}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:["We'll find ",re,"'s email automatically and send from your inbox."]})]})]}),e.jsxs("button",{type:"button",onClick:()=>N(fe=>!fe),className:"text-[11px] text-primary hover:underline flex items-center gap-1",children:[y?e.jsx(Gt,{className:"h-3 w-3"}):e.jsx(nt,{className:"h-3 w-3"}),y?"Hide":"Switch personal / work"]}),y&&e.jsxs("div",{className:"pt-2 border-t border-border/30 space-y-2",children:[e.jsxs(Gr,{value:g,onValueChange:fe=>v(fe),className:"flex gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ba,{value:"personal",id:"k-personal"}),e.jsx(Ce,{htmlFor:"k-personal",className:"text-xs cursor-pointer",children:"Personal"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ba,{value:"work",id:"k-work"}),e.jsx(Ce,{htmlFor:"k-work",className:"text-xs cursor-pointer",children:"Work"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[n.gmail&&e.jsxs(h,{size:"sm",variant:T==="extension_gmail"?"default":"outline",className:"h-7 text-xs gap-1",onClick:()=>le("extension_gmail",g),children:[e.jsx(Fs,{className:"h-3 w-3"})," Use Gmail"]}),n.outlook&&e.jsxs(h,{size:"sm",variant:T==="extension_outlook"?"default":"outline",className:"h-7 text-xs gap-1",onClick:()=>le("extension_outlook",g),children:[e.jsx(Fs,{className:"h-3 w-3"})," Use Outlook"]})]}),e.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Personal: ",ue(b)," · Work: ",ue(C)]})]})]}):e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/5 p-3 space-y-3",children:[e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium",children:"Connect a mailbox first"}),e.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:"One click. We use your existing Google sign-in â no API keys, no setup. Replies land in your inbox."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(h,{size:"sm",className:"h-8 gap-1.5",onClick:ce,disabled:d,children:[d?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):e.jsx(Fs,{className:"h-3 w-3"}),"Connect Gmail"]}),e.jsxs(h,{size:"sm",variant:"outline",className:"h-8 gap-1.5 opacity-60 cursor-not-allowed",disabled:!0,title:"Outlook one-click connect coming soon",children:[e.jsx(Fs,{className:"h-3 w-3"})," Outlook",e.jsx("span",{className:"ml-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:"soon"})]})]}),e.jsx("button",{type:"button",onClick:O,className:"text-[11px] text-primary hover:underline",children:"Re-check connection"})]})]}),e.jsxs(Ft,{className:"gap-2 sm:gap-2",children:[e.jsx(h,{variant:"ghost",onClick:()=>a(!1),disabled:d,children:"Cancel"}),e.jsxs(h,{onClick:F,disabled:d||!T,className:"gap-1.5",children:[d?e.jsx(Pe,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Lt,{className:"h-3.5 w-3.5"}),"Start follow-up"]})]})]})})}function Eb({userId:s}){var p,g;const[t,a]=i.useState(null),[r,o]=i.useState([]),[n,l]=i.useState(!0);if(i.useEffect(()=>{(async()=>
130{l(!0);const[b,z]=await Promise.all([w.from("lead_pipeline_analytics").select("*").eq("user_id",s).maybeSingle(),w.from("lead_pipeline_daily").select("*").eq("user_id",s).order("day",{ascending:!0})]);a(b.data||null),o(z.data||[]),l(!1)})()},[s]),n)return e.jsx(U,{className:"border-border/30 bg-card/40 backdrop-blur-xl",children:e.jsx(ye,{className:"py-8 flex items-center justify-center",children:e.jsx(Pe,{className:"h-4 w-4 animate-spin text-muted-foreground"})})});if(!t||t.total_leads===0)return e.jsx(U,{className:"border-border/30 bg-card/40 backdrop-blur-xl",children:e.jsxs(ye,{className:"py-12 text-center",children:[e.jsx(cr,{className:"h-10 w-10 mx-auto text-muted-foreground/30 mb-3"}),e.jsx("p",{className:"text-muted-foreground font-medium",children:"No pipeline data yet"}),e.jsx("p",{className:"text-xs text-muted-foreground/60 mt-1",children:"Add leads to see funnel and channel performance."})]})});const c=[{name:"New",value:t.new_count,color:"bg-blue-500"},{name:"Qualified",value:t.qualified_count,color:"bg-primary"},{name:"Proposal",value:t.proposal_count,color:"bg-purple-500"},{name:"Won",value:t.won_count,color:"bg-accent"}],x=Math.max(...c.map(v=>v.value),1),d=[{name:"Engagement",value:t.source_engagement,icon:ms},{name:"Cold Reach",value:t.source_cold_reach,icon:wa},{name:"Conversation",value:t.source_conversation,icon:Ga}],u=d.reduce((v,b)=>v+b.value,0)||1,m=Math.max(...r.map(v=>v.leads_created),1);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsx(sn,{label:"Total Leads",value:t.total_leads,sub:`${t.leads_last_7d} this week`,icon:ks}),e.jsx(sn,{label:"Reply Rate",value:`${t.reply_rate_pct}%`,sub:`${t.replied_followups}/${t.total_followups||0} replied`,icon:ms,accent:t.reply_rate_pct>=15?"text-accent":void 0}),e.jsx(sn,{label:"Win Rate",value:`${t.win_rate_pct}%`,sub:`${t.won_count} won`,icon:gs,accent:t.win_rate_pct>=10?"text-accent":void 0}),e.jsx(sn,{label:"Pipeline Value",value:`$${Number(t.pipeline_value).toLocaleString()}`,sub:`$${Number(t.won_revenue).toLocaleString()} won`,icon:Ht})]}),e.jsxs(U,{className:"border-border/30 bg-card/40 backdrop-blur-xl",children:[e.jsxs(Be,{className:"pb-3",children:[e.jsx($e,{className:"text-base",children:"Conversion Funnel"}),e.jsx(os,{className:"text-xs",children:"From new lead to closed deal"})]}),e.jsx(ye,{className:"space-y-2",children:c.map((v,b)=>{const z=v.value/x*100,C=b>0&&c[b-1].value>0?Math.round(v.value/c[b-1].value*100):null;return e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-20 text-xs text-muted-foreground",children:v.name}),e.jsxs("div",{className:"flex-1 h-7 bg-background/40 rounded-md overflow-hidden relative",children:[e.jsx("div",{className:`h-full ${v.color} opacity-80 transition-all`,style:{width:`${Math.max(z,2)}%`}}),e.jsx("span",{className:"absolute inset-0 flex items-center px-2 text-xs font-medium",children:v.value})]}),e.jsx("div",{className:"w-12 text-right text-xs text-muted-foreground",children:C!==null?`${C}%`:"â"})]},v.name)})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs(U,{className:"border-border/30 bg-card/40 backdrop-blur-xl",children:[e.jsxs(Be,{className:"pb-3",children:[e.jsx($e,{className:"text-base",children:"Source Attribution"}),e.jsx(os,{className:"text-xs",children:"Where your leads come from"})]}),e.jsx(ye,{className:"space-y-3",children:d.map(v=>{const b=Math.round(v.value/u*100);return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(v.icon,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{children:v.name})]}),e.jsxs("span",{className:"text-muted-foreground",children:[v.value," (",b,"%)"]})]}),e.jsx("div",{className:"h-1.5 bg-background/40 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary/70",style:{width:`${b}%`}})})]},v.name)})})]}),e.jsxs(U,{className:"border-border/30 bg-card/40 backdrop-blur-xl",children:[e.jsxs(Be,{className:"pb-3",children:[e.jsx($e,{className:"text-base",children:"Last 30 Days"}),e.jsx(os,{className:"text-xs",children:"Daily new leads"})]}),e.jsxs(ye,{children:[r.length===0?e.jsx("p",{className:"text-xs text-muted-foreground
130/60 italic py-6 text-center",children:"No data in last 30 days"}):e.jsx("div",{className:"flex items-end gap-1 h-24",children:r.map(v=>e.jsx("div",{className:"flex-1 bg-primary/60 hover:bg-primary rounded-sm transition-colors min-h-[2px] relative group",style:{height:`${v.leads_created/m*100}%`},title:`${v.day}: ${v.leads_created} leads`},v.day))}),e.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground mt-2",children:[e.jsx("span",{children:((p=r[0])==null?void 0:p.day)||"â"}),e.jsx("span",{children:((g=r[r.length-1])==null?void 0:g.day)||"â"})]})]})]})]}),e.jsxs(U,{className:"border-border/30 bg-card/40 backdrop-blur-xl",children:[e.jsx(Be,{className:"pb-3",children:e.jsx($e,{className:"text-base",children:"Stage Distribution"})}),e.jsxs(ye,{className:"flex flex-wrap gap-2",children:[e.jsxs(W,{variant:"outline",className:"border-blue-500/30 text-blue-400",children:["New: ",t.new_count]}),e.jsxs(W,{variant:"outline",className:"border-primary/30 text-primary",children:["Qualified: ",t.qualified_count]}),e.jsxs(W,{variant:"outline",className:"border-purple-500/30 text-purple-400",children:["Proposal: ",t.proposal_count]}),e.jsxs(W,{variant:"outline",className:"border-accent/30 text-accent",children:["Won: ",t.won_count]}),e.jsxs(W,{variant:"outline",className:"border-destructive/30 text-destructive",children:["Lost: ",t.lost_count]})]})]})]})}function sn({label:s,value:t,sub:a,icon:r,accent:o}){return e.jsx(U,{className:"border-border/30 bg-card/40 backdrop-blur-xl",children:e.jsxs(ye,{className:"p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:s}),e.jsx(r,{className:`h-3.5 w-3.5 ${o||"text-muted-foreground"}`})]}),e.jsx("p",{className:`text-xl font-semibold ${o||""}`,children:t}),a&&e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:a})]})})}const Rb=({onChanged:s})=>{const[t,a]=i.useState(!1),[r,o]=i.useState(null),[n,l]=i.useState(""),[c,x]=i.useState(!1),[d,u]=i.useState(!1),m=async()=>{x(!0);const{data:b,error:z}=await w.functions.invoke("hubspot-connect",{body:{action:"status"}});!z&&b&&o(b),x(!1)};i.useEffect(()=>{m()},[]);const p=async()=>{if(!n.trim().startsWith("pat-")){k.error("Token must start with 'pat-'");return}u(!0);try{const{data:b,error:z}=await w.functions.invoke("hubspot-connect",{body:{action:"connect",token:n.trim()}});if(z||b!=null&&b.error){k.error("Connection failed",{description:(b==null?void 0:b.error)||(z==null?void 0:z.message)});return}k.success(`Connected to ${b.portal_name||"HubSpot"}`),l(""),await m(),s==null||s(),a(!1)}finally{u(!1)}},g=async()=>{u(!0);try{await w.functions.invoke("hubspot-connect",{body:{action:"disconnect"}}),k.success("HubSpot disconnected"),await m(),s==null||s()}finally{u(!1)}},v=r==null?void 0:r.connected;return e.jsx(U,{className:"border-border/10 bg-card/40 backdrop-blur-xl",children:e.jsxs(ye,{className:"p-4 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"h-10 w-10 rounded-lg bg-[#ff7a59]/10 flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-[#ff7a59] font-bold text-sm",children:"HS"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-medium text-sm truncate",children:"HubSpot"}),c?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Checkingâ¦"}):v?e.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["Connected to ",e.jsx("span",{className:"text-foreground",children:r==null?void 0:r.portal_name})," · Auto-syncs Qualified & Won"]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Not connected â paste a Private App token"})]})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:v?e.jsxs(e.Fragment,{children:[e.jsxs(W,{variant:"outline",className:"border-accent/40 text-accent text-xs gap-1",children:[e.jsx(ys,{className:"h-3 w-3"})," Active"]}),e.jsx(h,{size:"sm",variant:"ghost",onClick:g,disabled:d,className:"h-7 text-xs",children:d?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):"Disconnect"})]}):e.jsxs(gt,{open:t,onOpenChange:a,children:[e.jsx(Cr,{asChild:!0,children:e.jsx(h,{size:"sm",className:"h-7 text-xs",children:"Connect"})}),e.jsxs(dt,{children:[e.jsxs(mt,{children:[e.jsx(xt,{children:"Connect HubSpot"}),e.jsx(Mt,{children:"Paste a HubSpot Private App token. Takes ~1 minute."})]}),e.jsxs("ol",{className:"text-xs text-muted-foreground space-y-1.5 list-decimal pl-4",children:[e.jsxs("li",{children:["Open HubSpot â Settings â Integrations â ",e.jsx("strong",{children:"Private Apps"})]}),e.jsxs("li",{children:["Click ",e.jsx("strong",{children:"Create private app"}),', name it "deSHILLER"']}),e.jsxs("li",{children:["On the ",e.jsx("strong",{children:"Scopes"})," tab, enable ",e.jsx("code",{className:"text-[10px] bg-muted/40 px-1 rounded",children:"crm.objects.contacts.read"})," and ",e.jsx("code",{className:"text-[10px] bg-muted/40 px-1 rounded",children:"crm.objects.contacts.write"})]}),e.jsxs("li",{children:["Click ",e.jsx("strong",{children:"Create app"})," â copy the access token (starts with ",e.jsx("code",{className:"text-[10px] bg-muted/40 px-1 rounded",children:"pat-"}),")"]})]}),e.jsxs("a",{href:"https://app.hubspot.com/private-apps",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary inline-flex items-center gap-1 hover:underline",children:["Open HubSpot Private Apps ",e.jsx(Ys,{className:"h-3 w-3"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"hs-token",className:"text-xs",children:"Access token"}),e.jsx(Je,{id:"hs-token",placeholder:"pat-na1-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",value:n,onChange:b=>l(b.target.value),autoComplete:"off"})]}),e.jsxs(Ft,{children:[e.jsx(h,{variant:"ghost",onClick:()=>a(!1),children:"Cancel"}),e.jsxs(h,{onClick:p,disabled:d||!n,children:[d?e.jsx(Pe,{className:"h-4 w-4 animate-spin mr-1.5"}):null,"Connect"]})]})]})]})})]})})},Pb=({onChanged:s})=>{const[t,a]=i.useState(!1),[r,o]=i.useState(null),[n,l]=i.useState(""),[c,x]=i.useState(""),[d,u]=i.useState(!1),[m,p]=i.useState(!1),g=async()=>{u(!0);const{data:C,error:j}=await w.functions.invoke("ga-connect",{body:{action:"status"}});!j&&C&&o(C),u(!1)};i.useEffect(()=>{g()},[]);const v=async()=>
130{if(!/^G-[A-Z0-9]+$/i.test(n.trim())){k.error("Measurement ID must look like G-XXXXXXX");return}if(!c.trim()){k.error("API secret required");return}p(!0);try{const{data:C,error:j}=await w.functions.invoke("ga-connect",{body:{action:"connect",measurement_id:n.trim(),api_secret:c.trim()}});if(j||C!=null&&C.error){k.error("Connection failed",{description:(C==null?void 0:C.error)||(j==null?void 0:j.message)});return}k.success(`Tracking conversions to ${C.measurement_id}`),l(""),x(""),await g(),s==null||s(),a(!1)}finally{p(!1)}},b=async()=>{p(!0);try{await w.functions.invoke("ga-connect",{body:{action:"disconnect"}}),k.success("Google Analytics disconnected"),await g(),s==null||s()}finally{p(!1)}},z=r==null?void 0:r.connected;return e.jsx(U,{className:"border-border/10 bg-card/40 backdrop-blur-xl",children:e.jsxs(ye,{className:"p-4 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"h-10 w-10 rounded-lg bg-[#4285f4]/10 flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-[#4285f4] font-bold text-sm",children:"GA"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-medium text-sm truncate",children:"Google Analytics 4"}),d?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Checkingâ¦"}):z?e.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:[e.jsx("span",{className:"text-foreground",children:r==null?void 0:r.measurement_id})," · Sends lead_qualified, lead_won"]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Not connected â paste GA4 Measurement ID + API secret"})]})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:z?e.jsxs(e.Fragment,{children:[e.jsxs(W,{variant:"outline",className:"border-accent/40 text-accent text-xs gap-1",children:[e.jsx(ys,{className:"h-3 w-3"})," Active"]}),e.jsx(h,{size:"sm",variant:"ghost",onClick:b,disabled:m,className:"h-7 text-xs",children:m?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):"Disconnect"})]}):e.jsxs(gt,{open:t,onOpenChange:a,children:[e.jsx(Cr,{asChild:!0,children:e.jsx(h,{size:"sm",className:"h-7 text-xs",children:"Connect"})}),e.jsxs(dt,{children:[e.jsxs(mt,{children:[e.jsx(xt,{children:"Connect Google Analytics 4"}),e.jsx(Mt,{children:"Paste your GA4 Measurement ID and a Measurement Protocol API secret."})]}),e.jsxs("ol",{className:"text-xs text-muted-foreground space-y-1.5 list-decimal pl-4",children:[e.jsxs("li",{children:["Open GA4 â ",e.jsx("strong",{children:"Admin"})," â ",e.jsx("strong",{children:"Data Streams"})," â pick your web stream"]}),e.jsxs("li",{children:["Copy ",e.jsx("strong",{children:"Measurement ID"})," (looks like ",e.jsx("code",{className:"text-[10px] bg-muted/40 px-1 rounded",children:"G-XXXXXXX"}),")"]}),e.jsxs("li",{children:["Same screen â ",e.jsx("strong",{children:"Measurement Protocol API secrets"})," â ",e.jsx("strong",{children:"Create"})," â copy the secret value"]})]}),e.jsxs("a",{href:"https://analytics.google.com/analytics/web/",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary inline-flex items-center gap-1 hover:underline",children:["Open Google Analytics ",e.jsx(Ys,{className:"h-3 w-3"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"ga-mid",className:"text-xs",children:"Measurement ID"}),e.jsx(Je,{id:"ga-mid",placeholder:"G-XXXXXXX",value:n,onChange:C=>l(C.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"ga-secret",className:"text-xs",children:"API secret"}),e.jsx(Je,{id:"ga-secret",placeholder:"abcdef1234567890...",value:c,onChange:C=>x(C.target.value),autoComplete:"off"})]}),e.jsxs(Ft,{children:[e.jsx(h,{variant:"ghost",onClick:()=>a(!1),children:"Cancel"}),e.jsxs(h,{onClick:v,disabled:m||!n||!c,children:[m?e.jsx(Pe,{className:"h-4 w-4 animate-spin mr-1.5"}):null,"Connect & test"]})]})]})]})})]})})},Mb={new:"bg-blue-500/20 text-blue-400 border-blue-500/30",qualified:"bg-primary/20 text-primary border-primary/30",proposal:"bg-purple-500/20 text-purple-400 border-purple-500/30",won:"bg-accent/20 text-accent border-accent/30",lost:"bg-destructive/20 text-destructive border-destructive/30"},Db={engagement:ms,cold_reach:wa,conversation:Ga}
130,Ob=({userId:s})=>{const[t,a]=i.useState([]),[r,o]=i.useState({}),[n,l]=i.useState({}),[c,x]=i.useState([]),[d,u]=i.useState(!0),[m,p]=i.useState("all"),[g,v]=i.useState(""),[b,z]=i.useState(!1),[C,j]=i.useState(new Set),[y,N]=i.useState(null),[f,R]=i.useState(!1),[M,q]=i.useState(!1),[_,A]=i.useState(null),[B,P]=i.useState(null);i.useState(!1);const[I,$]=i.useState(null),[be,Y]=i.useState("leads"),[O,he]=i.useState({contact_name:"",contact_email:"",contact_company:"",source_type:"engagement",source_platform:"linkedin",deal_value:""});i.useEffect(()=>{(async()=>{const{data:H}=await w.from("profiles").select("webhook_secret").eq("id",s).maybeSingle();H&&H.webhook_secret&&$(H.webhook_secret)})()},[s]),i.useEffect(()=>{re()},[s]),i.useEffect(()=>{const H=async ae=>{var ss,$s,Xs;if(((ss=ae.data)==null?void 0:ss.type)!=="DESHILLER_CHECK_REPLY_RESPONSE")return;const{leadId:ze,followupId:pe,replied:Ae,replyText:Ee,error:ls}=ae.data;if(pe)if(Ae)k.success(`Prospect replied! "${(Ee||"").substring(0,80)}..."`),await oe(ze,pe,"post_reply",Ee),await w.from("lead_followups").update({status:"replied",steps:(Xs=($s=r[ze])==null?void 0:$s.steps)==null?void 0:Xs.map((xs,de)=>de===0?{...xs,executed_at:new Date().toISOString(),result:"replied"}:xs),updated_at:new Date().toISOString()}
130).eq("id",pe),await w.from("qualified_leads").update({stage:"qualified"}).eq("id",ze),re();else{k.info("No reply detected â advancing to next touchpoint");try{const{data:xs,error:de}=await w.functions.invoke("lead-followup-engine",{body:{action:"execute_step",followup_id:pe}});de||k.success(`Next step queued: ${(xs==null?void 0:xs.result)||"done"}`),re()}catch{}}};return window.addEventListener("message",H),()=>window.removeEventListener("message",H)},[r]);const re=async()=>{u(!0);const[H,ae,ze,pe]=await Promise.all([w.from("qualified_leads").select("*").order("created_at",{ascending:!1}),w.from("crm_connections").select("*"),w.from("lead_followups").select("*"),w.from("lead_engagement_signals").select("lead_id, kind, detected_at").order("detected_at",{ascending:!1})]);if(H.data&&a(H.data),ae.data&&x(ae.data),ze.data){const Ae={};for(const Ee of ze.data)Ae[Ee.lead_id]=Ee;o(Ae)}if(pe.data){const Ae={};for(const Ee of pe.data)Ae[Ee.lead_id]||(Ae[Ee.lead_id]=Ee);l(Ae)}u(!1)},oe=async(H,ae,ze,pe)=>{try{await w.from("lead_engagement_signals").insert({user_id:s,lead_id:H,followup_id:ae,kind:ze,payload:{reply_text:(pe==null?void 0:pe.slice(0,500))||null}})}catch{}},T=async()=>{if(!O.contact_name.trim()){k.error("Name is required");return}const{error:H}
130=await w.from("qualified_leads").insert({user_id:s,contact_name:O.contact_name,contact_email:O.contact_email||null,contact_company:O.contact_company||null,source_type:O.source_type,source_platform:O.source_platform,deal_value:O.deal_value?parseFloat(O.deal_value):null,stage:"new"});if(H){k.error("Failed to add lead");return}k.success("Lead added"),z(!1),he({contact_name:"",contact_email:"",contact_company:"",source_type:"engagement",source_platform:"linkedin",deal_value:""}),re()},ce=async(H,ae)=>{const{error:ze}=await w.from("qualified_leads").update({stage:ae}).eq("id",H);if(ze){k.error("Failed to update");return}a(pe=>pe.map(Ae=>Ae.id===H?{...Ae,stage:ae}:Ae)),k.success(`Stage updated to ${ae}`)},le=async H=>{var ae,ze,pe,Ae;N(H);try{const{data:Ee,error:ls}=await w.functions.invoke("lead-followup-engine",{body:{action:"initiate",lead_id:H}});if(ls)throw ls;if(Ee!=null&&Ee.error){k.error(Ee.error);return}k.success("Follow-up sequence created â review & customize"),(ae=Ee==null?void 0:Ee.followup)!=null&&ae.id&&(o(Xs=>({...Xs,[H]:Ee.followup})),A(H)),w.functions.invoke("lead-followup-engine",{body:{action:"enrich",followup_id:(ze=Ee.followup)==null?void 0:ze.id}});const ss=t.find(Xs=>Xs.id===H),$s=(pe=ss==null?void 0:ss.metadata)==null?void 0:pe.post_url;$s&&window.postMessage({type:"DESHILLER_CHECK_REPLY",postUrl:$s,leadId:H,followupId:(Ae=Ee.followup)==null?void 0:Ae.id,authorName:ss==null?void 0:ss.contact_name},"*"),re()}catch(Ee){k.error(Ee.message||"Failed to start follow-up")}finally{N(null)}},F=async()=>{const H=Array.from(C).filter(ae=>{const ze=t.find(pe=>pe.id===ae);return ze&&["engagement","cold_reach"].includes(ze.source_type)&&!r[ae]});if(!H.length){k.error("No eligible leads selected");return}R(!0);try{const{data:ae,error:ze}=await w.functions.invoke("lead-followup-engine",{body:{action:"initiate_bulk",lead_ids:H}});if(ze)throw ze;k.success(`Started ${(ae==null?void 0:ae.initiated)||0} follow-ups (${(ae==null?void 0:ae.skipped)||0} skipped)`),j(new Set),re()}catch(ae){k.error(ae.message||"Bulk follow-up failed")}finally{R(!1)}},L=H=>{j(ae=>{const ze=new Set(ae);return ze.has(H)?ze.delete(H):ze.add(H),ze})},K=()=>{if(!I)return;const H=`https://iqikbtfdddpbyxpztpbh.supabase.co/functions/v1/lead-outcome-webhook?secret=${I}`;navigator.clipboard.writeText(H),k.success("Webhook URL copied",{description:"Paste into Stripe, Calendly, Zapier, etc."})},ue=t.length,Ne=t.filter(H=>H.stage==="qualified"||H.stage==="proposal"||H.stage==="won").length,fe=t.filter(H=>H.stage==="won").length,me=t.filter(H=>H.stage==="won").reduce((H,ae)=>H+(ae.deal_value||0),0),Ie=t.filter(H=>{var ae;return!(m!=="all"&&H.stage!==m||g&&!H.contact_name.toLowerCase().includes(g.toLowerCase())&&!((ae=H.contact_company)!=null&&ae.toLowerCase().includes(g.toLowerCase())))}),Q=Object.values(r).filter(H=>H.status==="replied").length,ne=[{name:"Leads",value:ue,fill:"hsl(var(--muted-foreground))"},{name:"Engaged",value:Object.keys(n).length,fill:"hsl(var(--primary))"},{name:"Replied",value:Q,fill:"hsl(38, 92%, 60%)"},{name:"Qualified",value:Ne,fill:"hsl(var(--accent))"},{name:"Won",value:fe,fill:"hsl(159, 50%, 55%)"}].filter(H=>H.value>0),ke=[{label:"Total Leads",value:ue,icon:Es,color:"text-primary"},{label:"Qualified",value:Ne,icon:ks,color:"text-accent"},{label:"Won",value:fe,icon:Bi,color:"text-primary"},{label:"Revenue",value:`$${me.toLocaleString()}`,icon:Ht,color:"text-accent"}];c.find(H=>H.provider==="hubspot"),c.find(H=>H.provider==="google_analytics");const ee=t.filter(H=>{var ae;return(ae=H.metadata)==null?void 0:ae.auto_created}).length,E=Object.values(r).filter(H=>H.status==="active").length,xe=H=>["engagement","cold_reach"].includes(H.source_type)&&["new","qualified"].includes(H.stage)&&!r[H.id],ve=Array.from(C).filter(H=>{const ae=t.find(ze=>ze.id===H);return ae&&xe(ae)}),S=Date.now(),J=t.filter(H=>{const ae=r[H.id];if((ae==null?void 0:ae.status)==="replied")return!0;const ze=n[H.id];return!!(ze&&ze.kind==="email_open"&&S-new Date(ze.detected_at).getTime()<7*86400*1e3||(ae==null?void 0:ae.status)==="active"&&ae.next_action_at&&new Date(ae.next_action_at).getTime()<S-2*86400*1e3)}),je=t.filter(H=>H.stage==="new"&&!r[H.id]&&!n[H.id]&&S-new Date(H.updated_at).getTime()>14*86400*1e3),se=async()=>
130{if(je.length&&confirm(`Archive ${je.length} stale leads (no signal in 14+ days)? They'll move to "lost".`)){q(!0);try{const{error:H}=await w.from("qualified_leads").update({stage:"lost"}).in("id",je.map(ae=>ae.id));if(H)throw H;k.success(`Archived ${je.length} stale lead${je.length===1?"":"s"}`),re()}catch(H){k.error(H.message||"Archive failed")}finally{q(!1)}}},Oe=H=>{if(!H)return null;const ae=S-new Date(H.detected_at).getTime(),ze=ae<36e5?`${Math.max(1,Math.round(ae/6e4))}m ago`:ae<864e5?`${Math.round(ae/36e5)}h ago`:`${Math.round(ae/864e5)}d ago`;return`${{dm_reply:"Replied via DM",email_reply:"Replied via email",email_open:"Opened email",post_reply:"Replied on post",profile_visit:"Visited profile"}[H.kind]||H.kind.replace("_"," ")} · ${ze}`};i.useEffect(()=>{const H=ae=>{var ze;if(((ze=ae.data)==null?void 0:ze.type)==="DESHILLER_CHECK_REPLY_RESPONSE"){const{leadId:pe,followupId:Ae,replied:Ee,replyText:ls}=ae.data;Ee&&pe&&(oe(pe,Ae||null,"post_reply",ls),w.functions.invoke("lead-followup-engine",{body:{action:"mark_replied",lead_id:pe}}).then(()=>re()),k.success(`Prospect replied: "${(ls||"").substring(0,50)}..."`))}};return window.addEventListener("message",H),()=>window.removeEventListener("message",H)},[]),i.useEffect(()=>{let H=!1,ae={gmail:!1,outlook:!1};const ze=Ee=>{var ls;((ls=Ee.data)==null?void 0:ls.type)==="DESHILLER_MAILBOX_STATUS"&&(ae={gmail:!!Ee.data.gmail,outlook:!!Ee.data.outlook})};window.addEventListener("message",ze);const pe=async()=>{window.postMessage({type:"DESHILLER_CHECK_MAILBOX_STATUS"},"*"),await new Promise(xs=>setTimeout(xs,800));const{data:Ee}=await w.from("profiles").select("email_provider").eq("id",s).maybeSingle(),ls=Ee==null?void 0:Ee.email_provider;if(!ls||!ls.startsWith("extension_"))return;const ss=ls==="extension_outlook";if(!(ss?ae.outlook:ae.gmail))return;const{data:Xs}=await w.from("cold_reach_emails").select("id, prospect_email, subject, body").eq("user_id",s).eq("status","awaiting_extension").limit(3);if(!(H||!Xs||Xs.length===0))for(const xs of Xs){const de=`email_${xs.id}_${Date.now()}`,D=async te=>{var X,ie,_e,Me;((X=te.data)==null?void 0:X.type)!=="DESHILLER_SEND_EMAIL_VIA_EXTENSION_RESPONSE"||((ie=te.data)==null?void 0:ie.requestId)!==de||(window.removeEventListener("message",D),(_e=te.data)!=null&&_e.success?(await w.from("cold_reach_emails").update({status:"sent",sent_at:new Date().toISOString()}).eq("id",xs.id),k.success(`Email sent via your ${ss?"Outlook":"Gmail"} to ${xs.prospect_email}`)):await w.from("cold_reach_emails").update({status:"failed",error_message:((Me=te.data)==null?void 0:Me.error)||"Extension send failed"}).eq("id",xs.id))};window.addEventListener("message",D),window.postMessage({type:"DESHILLER_SEND_EMAIL_VIA_EXTENSION",payload:{to:xs.prospect_email,subject:xs.subject,body:xs.body,leadId:xs.id,provider:ss?"outlook":"gmail",requestId:de}},"*"),await new Promise(te=>setTimeout(te,4e3))}};pe();const Ae=setInterval(pe,6e4);return()=>{H=!0,clearInterval(Ae),window.removeEventListener("message",ze)}},[s]),i.useEffect(()=>{let H=!1;const ae=async()=>{const{data:pe}=await w.from("dm_messages").select("id, thread_id, content, dm_threads(platform, prospect_profile_url, prospect_name)").eq("user_id",s).eq("direction","outbound").eq("delivered",!1).like("automation_source","followup%").limit(5);if(!(H||!pe||pe.length===0))for(const Ae of pe){const Ee=Ae.dm_threads;if(!(Ee!=null&&Ee.prospect_profile_url))continue;await w.from("dm_messages").update({delivered:!0}).eq("id",Ae.id);const ls=Ee.platform==="x"?"twitter":Ee.platform;window.postMessage({type:"DESHILLER_SEND_DM",platform:ls,profileUrl:Ee.prospect_profile_url,message:Ae.content,prospectId:Ae.id},"*")}};ae();const ze=setInterval(ae,3e4);return()=>{H=!0,clearInterval(ze)}},[s]);const We=H=>{if(H.status==="replied")return{text:"Replied!",className:"text-accent"};if(H.status==="completed")return{text:"Completed",className:"text-muted-foreground"};if(H.status==="paused")return{text:"Paused",className:"text-muted-foreground"};const ae=(H.steps||[])[H.current_step-1],ze=(ae==null?void 0:ae.label)||"";return{text:`Step ${H.current_step}/5 â ${ze}`,className:"text-primary"}};return e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-display font-semibold",children:"Lead Pipeline"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Track every touchpoint from first engagement to closed deal"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[ve.length>0&&e.jsxs(h,{variant:"outline",size:"sm",onClick:F,disabled:f,className:"gap-1.5",children:[f?e.jsx(Pe,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Lt,{className:"h-3.5 w-3.5"}),"Follow Up (",ve.length,")"]}),e.jsxs(gt,{open:b,onOpenChange:z,children:[e.jsx(Cr,{asChild:!0,children:e.jsxs(h,{className:"gap-2",children:[e.jsx(ft,{className:"h-4 w-4"})," Add Lead"]})}),e.jsxs(dt,{className:"bg-card border-border/50",children:[e.jsx(mt,{children:e.jsx(xt,{children:"Add Qualified Lead"})}),e.jsxs("div",{className:"space-y-4 pt-2",children:[e.jsxs("div",{children:[e.jsx(Ce,{children:"Name *"}),e.jsx(Je,{value:O.contact_name,onChange:H=>he(ae=>({...ae,contact_name:H.target.value})),placeholder:"John Doe"})]}),e.jsxs("div",{children:[e.jsx(Ce,{children:"Email"}),e.jsx(Je,{value:O.contact_email,onChange:H=>he(ae=>({...ae,contact_email:H.target.value})),placeholder:"[email protected]"})]}),e.jsxs("div",{children:[e.jsx(Ce,{children:"Company"}),e.jsx(Je,{value:O.contact_company,onChange:H=>he(ae=>({...ae,contact_company:H.target.value})),placeholder:"Acme Inc"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(Ce,{children:"Source"}),e.jsxs(Gs,{value:O.source_type,onValueChange:H=>he(ae=>({...ae,source_type:H})),children:[e.jsx(qs,{children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"engagement",children:"Engagement"}),e.jsx(Te,{value:"cold_reach",children:"Cold Reach"}),e.jsx(Te,{value:"conversation",children:"Conversation"})]})]})]}),e.jsxs("div",{children:[e.jsx(Ce,{children:"Platform"}),e.jsxs(Gs,{value:O.source_platform,onValueChange:H=>he(ae=>({...ae,source_platform:H})),children:[e.jsx(qs,{children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"linkedin",children:"LinkedIn"}),e.jsx(Te,{value:"x",children:"X / Twitter"}),e.jsx(Te,{value:"reddit",children:"Reddit"}),e.jsx(Te,{value:"facebook",children:"Facebook"}),e.jsx(Te,{value:"quora",children:"Quora"})]})]})]})]}),e.jsxs("div",{children:[e.jsx(Ce,{children:"Deal Value ($)"}),e.jsx(Je,{type:"number",value:O.deal_value,onChange:H=>he(ae=>({...ae,deal_value:H.target.value})),placeholder:"5000"})]}),e.jsx(h,{onClick:T,className:"w-full",children:"Add Lead"})]})]})]})]})]}),e.jsx(U,{className:"border-accent/20 bg-accent/[0.03] backdrop-blur-xl",children:e.jsxs(ye,{className:"p-4 flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-9 w-9 rounded-lg bg-accent/10 flex items-center justify-center",children:e.jsx(Et,{className:"h-4.5 w-4.5 text-accent"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"font-medium text-sm flex items-center gap-2",children:["Automation Active",e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-accent opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-accent"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Leads auto-created from replies, cold reach & DMs. Follow-up engine runs multi-channel touchpoint sequences."})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[E>0&&e.jsxs(W,{variant:"outline",className:"border-primary/30 text-primary text-xs shrink-0",children:[e.jsx(Lt,{className:"h-3 w-3 mr-1"}),E," active follow-ups"]}),ee>0&&e.jsxs(W,{variant:"outline",className:"border-accent/30 text-accent text-xs shrink-0",children:[e.jsx(ws,{className:"h-3 w-3 mr-1"}),ee," auto-created"]})]})]})}),e.jsx(kb,{userId:s}),e.jsx(Ka,{children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(Rb,{onChanged:re}),e.jsx(Pb,{onChanged:re})]})}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(eu,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"shrink-0",children:"Webhook URL for Stripe, Calendly, Zapier:"}),e.jsxs(h,{size:"sm",variant:"ghost",onClick:K,disabled:!I,className:"h-7 gap-1.5 px-2 text-xs",children:[e.jsx(ta,{className:"h-3 w-3"})," Copy"]})]}),e.jsxs(Ct,{value:be,onValueChange:Y,className:"space-y-4",children:[e.jsxs(wt,{children:[e.jsxs(cs,{value:"leads",className:"gap-1.5",children:[e.jsx(Es,{className:"h-3.5 w-3.5"})," Pipeline"]}),e.jsxs(cs,{value:"analytics",className:"gap-1.5",children:[e.jsx(cr,{className:"h-3.5 w-3.5"})," Analytics"]})]}),e.jsx(us,{value:"analytics",className:"space-y-4",children:e.jsx(Eb,{userId:s})}),e.jsxs(us,{value:"leads",className:"space-y-4",children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:ke.map(H=>e.jsx(U,{className:"border-border/10 bg-card/40 backdrop-blur-xl",children:e.jsxs(ye,{className:"p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(H.icon,{className:`h-5 w-5 ${H.color}`}
130),e.jsx(gs,{className:"h-3.5 w-3.5 text-muted-foreground/40"})]}),e.jsx("p",{className:"text-2xl sm:text-3xl font-bold",children:H.value}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:H.label})]})},H.label))}),J.length>0&&e.jsxs(U,{className:"border-accent/30 bg-accent/[0.04] backdrop-blur-xl",children:[e.jsx(Be,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-accent"}),e.jsx($e,{className:"text-base",children:"Needs attention"}),e.jsx(W,{variant:"outline",className:"border-accent/30 text-accent text-[10px] h-5",children:J.length})]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Replied · warm · overdue"})]})}),e.jsx(ye,{className:"p-0",children:e.jsx("div",{className:"divide-y divide-border/10",children:J.slice(0,10).map(H=>{const ae=r[H.id],ze=n[H.id],pe=Oe(ze),Ae=(ae==null?void 0:ae.status)==="replied"?"Replied":pe||"Overdue follow-up";return e.jsxs("button",{onClick:()=>ae&&A(H.id),className:"w-full flex items-center justify-between px-4 py-2.5 hover:bg-accent/[0.04] text-left",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:H.contact_name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[H.contact_company||"â"," · ",Ae]})]}),e.jsx(Ns,{className:"h-3.5 w-3.5 text-muted-foreground/50"})]},H.id)})})})]}),je.length>5&&e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-border/30 bg-card/40 backdrop-blur px-4 py-3",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsxs("span",{className:"font-medium text-foreground",children:[je.length," leads"]}),' have been sitting in "New" with no signal for 14+ days.']}),e.jsxs(h,{size:"sm",variant:"outline",onClick:se,disabled:M,className:"gap-1.5 h-8 text-xs",children:[M?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):null,"Archive stale (",je.length,")"]})]}),ne.length>0&&e.jsxs(U,{className:"border-border/10 bg-card/40 backdrop-blur-xl",children:[e.jsxs(Be,{className:"pb-4",children:[e.jsx($e,{className:"text-lg",children:"Attribution Funnel"}),e.jsx(os,{children:"From discovery to deal closure"})]}),e.jsx(ye,{children:e.jsx("div",{className:"flex items-stretch gap-0 w-full",children:ne.map((H,ae)=>{var ss;const ze=((ss=ne[0])==null?void 0:ss.value)||1,pe=Math.max(20,H.value/ze*100),Ae=ae===ne.length-1,Ee=ae===0,ls=ae>0&&ne[ae-1].value>0?Math.round(H.value/ne[ae-1].value*100):null;return e.jsxs("div",{className:"flex-1 flex flex-col items-center group relative",children:[ls!==null&&e.jsx("div",{className:"absolute -left-3 top-1/2 -translate-y-1/2 z-10 hidden md:flex flex-col items-center",children:e.jsxs("span",{className:"text-[10px] font-medium text-muted-foreground bg-background/80 backdrop-blur-sm px-1 rounded",children:[ls,"%"]})}),e.jsx("div",{className:"w-full flex flex-col items-center justify-center transition-all duration-500 ease-out relative",style:{height:`${pe*1.6}px`,minHeight:"48px",maxHeight:"160px",background:H.fill,borderRadius:Ee?"8px 0 0 8px":Ae?"0 8px 8px 0":"0",opacity:.85+ae*.03},children:e.jsx("span",{className:"text-sm font-bold text-white drop-shadow-sm",children:H.value.toLocaleString()})}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-2 font-medium text-center leading-tight",children:H.name})]},H.name)})})})]}),e.jsxs(U,{className:"border-border/10 bg-card/40 backdrop-blur-xl",children:[e.jsx(Be,{className:"pb-3",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[e.jsx($e,{className:"text-lg",children:"All Leads"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Ks,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(Je,{value:g,onChange:H=>v(H.target.value),placeholder:"Search...",className:"pl-8 h-9 w-[180px] bg-background/50"})]}),e.jsxs(Gs,{value:m,onValueChange:p,children:[e.jsxs(qs,{className:"h-9 w-[130px] bg-background/50",children:[e.jsx(Ta,{className:"h-3.5 w-3.5 mr-1.5"}),e.jsx(Us,{})]}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"all",children:"All Stages"}),e.jsx(Te,{value:"new",children:"New"}
130),e.jsx(Te,{value:"qualified",children:"Qualified"}),e.jsx(Te,{value:"proposal",children:"Proposal"}),e.jsx(Te,{value:"won",children:"Won"}),e.jsx(Te,{value:"lost",children:"Lost"})]})]})]})]})}),e.jsx(ye,{className:"p-0",children:d?e.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading..."}):Ie.length===0?e.jsxs("div",{className:"p-12 text-center",children:[e.jsx(Es,{className:"h-10 w-10 mx-auto text-muted-foreground/30 mb-3"}),e.jsx("p",{className:"text-muted-foreground font-medium",children:"No leads yet"}),e.jsx("p",{className:"text-xs text-muted-foreground/60 mt-1",children:"Add leads manually or promote them from Engage, Cold Reach, or Conversations"})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(ja,{children:[e.jsx(ya,{children:e.jsxs(tt,{className:"border-border/10",children:[e.jsx(fs,{className:"w-10",children:e.jsx(Ot,{checked:C.size>0&&C.size===Ie.filter(H=>xe(H)).length,onCheckedChange:H=>{j(H?new Set(Ie.filter(ae=>xe(ae)).map(ae=>ae.id)):new Set)}})}),e.jsx(fs,{children:"Contact"}),e.jsx(fs,{children:"Source"}),e.jsx(fs,{children:"Stage"}),e.jsx(fs,{children:"Follow-Up"}),e.jsx(fs,{children:"Sync"}),e.jsx(fs,{className:"text-right",children:"Deal Value"})]})}),e.jsx(va,{children:Ie.map(H=>{var Ee;const ae=Db[H.source_type]||ms,ze=r[H.id],pe=ze?We(ze):null,Ae=xe(H);return e.jsxs(tt,{className:"border-border/10",children:[e.jsx(is,{children:xe(H)&&e.jsx(Ot,{checked:C.has(H.id),onCheckedChange:()=>L(H.id)})}),e.jsx(is,{children:e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:H.contact_name}),H.contact_company&&e.jsx("p",{className:"text-xs text-muted-foreground",children:H.contact_company}),H.contact_email&&e.jsx("p",{className:"text-xs text-muted-foreground/60",children:H.contact_email})]})}),e.jsx(is,{children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ae,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"text-xs capitalize",children:H.source_type.replace("_"," ")}),((Ee=H.metadata)==null?void 0:Ee.auto_created)&&e.jsx("span",{title:"Auto-created",children:e.jsx(ws,{className:"h-3 w-3 text-accent"})})]})}),e.jsx(is,{children:e.jsxs(Gs,{value:H.stage,onValueChange:ls=>ce(H.id,ls),children:[e.jsx(qs,{className:`h-7 w-[110px] text-xs border ${Mb[H.stage]||""}`,children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"new",children:"New"}),e.jsx(Te,{value:"qualified",children:"Qualified"}),e.jsx(Te,{value:"proposal",children:"Proposal"}),e.jsx(Te,{value:"won",children:"Won"}),e.jsx(Te,{value:"lost",children:"Lost"})]})]})}),e.jsx(is,{children:ze?e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("button",{onClick:()=>A(H.id),className:`text-xs font-medium flex items-center gap-1 hover:underline cursor-pointer ${pe==null?void 0:pe.className}`,children:[ze.status==="replied"?e.jsx(Ve,{className:"h-3 w-3"}):e.jsx(Lt,{className:"h-3 w-3"}),pe==null?void 0:pe.text]}),Oe(n[H.id])&&e.jsx("span",{className:"text-[10px] text-accent/80",children:Oe(n[H.id])})]}):Ae?e.jsxs(h,{variant:"ghost",size:"sm",onClick:()=>P(H),disabled:y===H.id,className:"h-7 text-xs gap-1 text-primary hover:text-primary",children:[y===H.id?e.jsx(Pe,{className:"h-3 w-3 animate-spin"}):e.jsx(Lt,{className:"h-3 w-3"}),"Follow Up"]}):e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-xs text-muted-foreground/40",children:"â"}),Oe(n[H.id])&&e.jsx("span",{className:"text-[10px] text-accent/80",children:Oe(n[H.id])})]})}),e.jsx(is,{children:H.crm_contact_id?e.jsxs(W,{variant:"outline",className:"border-accent/30 text-accent text-[10px] gap-1 h-5",children:[e.jsx(Ve,{className:"h-2.5 w-2.5"})," Synced"]}):["qualified","won"].includes(H.stage)?e.jsx(W,{variant:"outline",className:"border-border/40 text-muted-foreground text-[10px] h-5",children:"Auto-syncs"}):e.jsx("span",{className:"text-[10px] text-muted-foreground/40",children:"â"})}),e.jsx(is,{className:"text-right font-medium",children:H.deal_value?`$${H.deal_value.toLocaleString()}`:"â"})]},H.id)})})]})})})]})]})]}),e.jsx(gt,{open:!!_,onOpenChange:H=>!H&&A(null),children:e.jsxs(dt,{className:"bg-card border-border/50 max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsx(mt,{children:e.jsxs(xt,{className:"flex items-center gap-2",children:[e.jsx(Lt,{className:"h-4 w-4 text-primary"}),"Follow-Up Sequence"]})}),_&&r[_]&&e.jsx(wb,{followup:r[_],onUpdated:()=>re()})]})}),e.jsx(zb,{lead:B,userId:s,open:!!B,onOpenChange:H=>!H&&P(null),onConfirm:async H=>{a(ae=>ae.map(ze=>ze.id===H.id?{...ze,...H}:ze)),await le(H.id)}})]})},rl={starter:50,pro:500,trial:10,free:10};function Fb(){const s=ns(),[t,a]=i.useState(null),[r,o]=i.useState(null),[n,l]=i.useState(!0);i.useEffect(()=>{c()},[]);const c=async()=>{try{const{data:{user:N}}=await w.auth.getUser();if(!N)return;const[f,R]=await Promise.all([w.from("discovery_usage").select("free_discoveries_used, paid_discoveries_remaining, total_discoveries").eq("user_id",N.id).maybeSingle(),w.from("profiles").select("subscription_status, subscription_tier").eq("id",N.id).single()]);f.error&&f.error.code,R.error,a(f.data||{free_discoveries_used:0,paid_discoveries_remaining:0,total_discoveries:0}),o(R.data||{subscription_status:"trial",subscription_tier:null})}catch{}finally{l(!1)}},x=()=>{s("/payment")};if(n)return e.jsx(U,{children:e.jsx(ye,{className:"p-6 flex items-center justify-center",children:e.jsx(Pe,{className:"h-5 w-5 animate-spin text-muted-foreground"})})});const d=(r==null?void 0:r.subscription_status)||"trial",u=(r==null?void 0:r.subscription_tier)||null;let m=rl.trial,p="Trial";d==="active"&&u&&(m=rl[u]||50,p=u.charAt(0).toUpperCase()+u.slice(1));const g=(t==null?void 0:t.free_discoveries_used)||0,v=(t==null?void 0:t.paid_discoveries_remaining)||0,z=Math.max(0,m-g)+v,C=Math.min(g/m*100,100),j=g>=m*.8,y=g>=m;return e.jsxs(U,{children:[e.jsxs(Be,{className:"pb-2 sm:pb-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ks,{className:"h-4 w-4 sm:h-5 sm:w-5 text-primary"}),e.jsx($e,{className:"text-base sm:text-lg",children:"Discovery Usage"}),e.jsx(Ba,{content:`Your ${p} plan includes ${m} discoveries per month. Starter gets 50, Pro gets 500.`,side:"right"})]}),e.jsx(W,{variant:d==="active"?"default":"secondary",className:"text-xs",children:p})]}),e.jsxs(os,{className:"text-xs sm:text-sm",children:[u==="starter"&&"Exceed 50? Auto-upgrades to Pro.",u==="pro"&&"500 discoveries per month",d==="trial"&&"Subscribe for more discoveries"]})]}),e.jsxs(ye,{className:"space-y-3 sm:space-y-4",children:[e.jsxs("div",{className:"space-y-1.5 sm:space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-xs sm:text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Used this month"}),e.jsxs("span",{className:`font-medium ${y?"text-destructive":j?"text-yellow-500":""}`,children:[g," / ",m]})]}),e.jsx(zt,{value:C,className:`h-1.5 sm:h-2 ${y?"[&>div]:bg-destructive":j?"[&>div]:bg-yellow-500":""}`})]}),v>0&&e.jsxs("div",{className:"flex justify-between text-xs sm:text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Bonus credits"}),e.jsxs("span",{className:"font-medium text-primary",children:["+",v]})]}),e.jsxs("div",{className:"pt-2 border-t",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2 sm:mb-3",children:[e.jsx("span",{className:"text-xs sm:text-sm font-medium",children:"Remaining"}),e.jsx("span",{className:`text-base sm:text-lg font-bold ${z<=5?"text-destructive":"text-primary"}`,children:z})]}),(d==="trial"||u==="starter"&&j)&&e.jsxs(h,{onClick:x,className:"w-full h-9 sm:h-10 text-xs sm:text-sm gap-2",variant:y?"default":"outline",children:[e.jsx(su,{className:"h-3 w-3 sm:h-4 sm:w-4"}),d==="trial"?"Subscribe Now":"Upgrade to Pro (500/mo)"]})]})]})]})}const Bb=({userId:s,limit:t=20})=>{const[a,r]=i.useState([]),[o,n]=i.useState(!0);i.useEffect(()=>{l();const m=w.channel("activity-changes").on("postgres_changes",{event:"*",schema:"public",table:"automation_logs",filter:`user_id=eq.${s}`},()=>l()).on("postgres_changes",{event:"*",schema:"public",table:"discovered_posts",filter:`user_id=eq.${s}`},()=>l()).subscribe();return()=>{w.removeChannel(m)}},[s,t]);const l=async()=>{try{n(!0);const[m,p]=await Promise.all([w.from("automation_logs").select("id, action_type, platform, status, error_message, created_at, details").eq("user_id",s).order("created_at",{ascending:!1}).limit(t),w.from("discovered_posts").select("id, platform, status, post_content, post_url, created_at, updated_at").eq("user_id",s).in("status",["approved","pending"]).order("created_at",{ascending:!1}).limit(t)]),g=m.data,v=p.data,b=[];g==null||g.forEach(z=>{const C=z.details;b.push({id:z.id,type:"action",title:c(z.action_type),description:z.error_message||`${z.action_type} on ${z.platform}`,platform:z.platform,status:z.status,timestamp:z.created_at,icon:x(z.action_type),postUrl:(C==null?void 0:C.post_url)||(C==null?void 0:C.url)})}),v==null||v.forEach(z=>{z.status==="approved"?b.push({id:z.id,type:"engagement",title:"Reply Approved",description:`Engaged with post on ${z.platform}`,platform:z.platform,status:"approved",timestamp:z.updated_at,icon:ys,postUrl:z.post_url}
130):z.status==="pending"&&b.push({id:z.id,type:"discovery",title:"Post Discovered",description:z.post_content.substring(0,80)+"...",platform:z.platform,status:"pending",timestamp:z.created_at,icon:gs,postUrl:z.post_url})}),b.sort((z,C)=>new Date(C.timestamp).getTime()-new Date(z.timestamp).getTime()),r(b.slice(0,t))}catch{}finally{n(!1)}},c=m=>m.split("_").map(p=>p.charAt(0).toUpperCase()+p.slice(1)).join(" "),x=m=>m.includes("discover")?gs:m.includes("reply")?ms:Nt,d=m=>{switch(m){case"success":case"approved":return"bg-green-500/10 text-green-700 dark:text-green-400";case"error":case"rejected":return"bg-red-500/10 text-red-700 dark:text-red-400";case"pending":return"bg-amber-500/10 text-amber-700 dark:text-amber-400";default:return"bg-muted text-muted-foreground"}},u=m=>{switch(m){case"success":case"approved":return e.jsx(ys,{className:"h-4 w-4"});case"error":case"rejected":return e.jsx(Rt,{className:"h-4 w-4"});case"pending":return e.jsx(Cs,{className:"h-4 w-4"});default:return null}};return o?e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Recent Activity"}),e.jsx(os,{children:"Your latest actions and discoveries"})]}),e.jsx(ye,{children:e.jsx("div",{className:"space-y-4",children:[1,2,3,4,5].map(m=>e.jsxs("div",{className:"flex gap-4 items-start",children:[e.jsx(Ws,{className:"h-10 w-10 rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(Ws,{className:"h-4 w-3/4"}),e.jsx(Ws,{className:"h-3 w-1/2"})]})]},m))})})]}):e.jsxs(U,{children:[e.jsxs(Be,{className:"pb-3",children:[e.jsxs($e,{className:"text-base sm:text-lg flex items-center gap-2",children:["Recent Activity",e.jsx(Ba,{content:"Live feed of your discovery and engagement actions. Shows posts found, comments posted, and any errors in real-time."})]}),e.jsx(os,{className:"text-xs sm:text-sm",children:"Your latest actions and discoveries"})]}),e.jsx(ye,{className:"px-3 sm:px-6",children:e.jsx(jt,{className:"h-[400px] sm:h-[600px] pr-2 sm:pr-4",children:a.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 sm:py-12 text-center",children:[e.jsx(Nt,{className:"h-10 w-10 sm:h-12 sm:w-12 text-muted-foreground mb-3 sm:mb-4"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"No activity yet"}),e.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-1",children:"Start discovering posts to see your activity here"})]}):e.jsx("div",{className:"space-y-3 sm:space-y-4",children:a.map(m=>{const p=m.icon;return e.jsxs("div",{className:"flex gap-2 sm:gap-4 items-start p-2.5 sm:p-4 rounded-lg border border-border/50 hover:border-border transition-colors",children:[e.jsx("div",{className:"p-1.5 sm:p-2 rounded-full bg-primary/10 text-primary shrink-0",children:e.jsx(p,{className:"h-4 w-4 sm:h-5 sm:w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start gap-1.5 sm:gap-2 mb-1 flex-wrap",children:[e.jsx("p",{className:"font-medium text-xs sm:text-sm",children:m.title}),m.status&&e.jsx(W,{variant:"outline",className:`${d(m.status)} text-[10px] sm:text-xs px-1.5 py-0`,children:e.jsxs("span",{className:"flex items-center gap-0.5 sm:gap-1",children:[u(m.status),e.jsx("span",{className:"hidden xs:inline",children:m.status})]})})]}),e.jsx("p",{className:"text-[10px] sm:text-sm text-muted-foreground line-clamp-2",children:m.description}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 mt-1.5 sm:mt-2 flex-wrap",children:[e.jsx(W,{variant:"secondary",className:"text-[10px] sm:text-xs",children:m.platform}),e.jsx("span",{className:"text-[10px] sm:text-xs text-muted-foreground",children:ha(new Date(m.timestamp),{addSuffix:!0})}),m.postUrl&&e.jsxs(h,{variant:"ghost",size:"sm",className:"h-5 px-1.5 text-[10px] sm:text-xs gap-1",onClick:()=>window.open(m.postUrl,"_blank"),children:[e.jsx(Ys,{className:"h-3 w-3"}),"View"]})]})]})]},m.id)})})})})]})},$b=({userId:s,onNavigate:t,isPaidUser:a})=>{const[r,o]=i.useState({totalDiscovered:0,totalReplied:0,totalPosted:0,pendingQueue:0,platformsActive:0,rejectedCount:0,skippedCount:0,approvedCount:0,conversionRate:0}),[n,l]=i.useState({total:0,qualified:0,won:0,revenue:0}),[c,x]=i.useState(!0),[d,u]=i.useState(!1),[m,p]=i.useState(!1);i.useEffect(()=>{g()},[s]);const g=async()=>{var y,N;try{const[f,R,M,q,_]=await Promise.all([w.from("discovered_posts").select("id, platform, status",{count:"exact"}).eq("user_id",s),w.from("engagement_queue").select("id",{count:"exact"}
130).eq("user_id",s).eq("status","pending"),w.from("product_profiles").select("id").eq("user_id",s).limit(1),w.from("user_credentials").select("platform").eq("user_id",s),w.from("qualified_leads").select("id, stage, deal_value")]),A=f.data||[],B=new Set(A.map(re=>re.platform)),P=A.filter(re=>["posted","commented"].includes(re.status)).length,I=A.filter(re=>re.status==="approved").length,$=A.filter(re=>re.status==="rejected").length,be=A.filter(re=>re.status==="skipped").length,Y=P+I,O=A.length>0?Y/A.length*100:0;o({totalDiscovered:f.count||0,totalReplied:Y,totalPosted:P,pendingQueue:R.count||0,platformsActive:B.size,rejectedCount:$,skippedCount:be,approvedCount:I,conversionRate:O}),u((((y=M.data)==null?void 0:y.length)||0)>0),p((((N=q.data)==null?void 0:N.length)||0)>0);const he=_.data||[];l({total:he.length,qualified:he.filter(re=>["qualified","proposal","won"].includes(re.stage)).length,won:he.filter(re=>re.stage==="won").length,revenue:he.filter(re=>re.stage==="won").reduce((re,oe)=>re+(oe.deal_value||0),0)})}catch{}finally{x(!1)}},v=[{done:d,label:"Set up product profile",action:"product"},{done:m,label:"Connect a platform",action:"settings"},{done:r.totalDiscovered>0,label:"Run first discovery",action:"engage"},{done:r.totalReplied>0,label:"Post first reply",action:"engage"}],b=Math.round(v.filter(y=>y.done).length/v.length*100),z=[];if(d||z.push({icon:Li,severity:"critical",title:"AI replies lack context",description:"Without a product profile, AI generates generic replies. Set up your profile to 3Ã reply quality.",cta:"Fix now",action:"product"}),r.rejectedCount>5){const y=r.totalDiscovered>0?(r.rejectedCount/r.totalDiscovered*100).toFixed(0):"0";z.push({icon:Ln,severity:"warning",title:`${y}% of discovered posts rejected`,description:`${r.rejectedCount} posts didn't match your needs. Refine your keywords and discovery tags to find higher-quality leads.`,cta:"Tune discovery",action:"engage"})}r.pendingQueue>3&&z.push({icon:Ca,severity:"warning",title:`${r.pendingQueue} replies aging in queue`,description:"Stale replies lose relevance. Process your queue or enable Lead Machine to auto-post.",cta:"Process queue",action:"queue"}),r.approvedCount>0&&r.totalPosted===0&&z.push({icon:Bt,severity:"warning",title:`${r.approvedCount} approved but never posted`,description:"You approved replies but they haven't been posted. Connect the Chrome extension or enable auto-posting.",cta:"Set up posting",action:"settings"}),r.totalDiscovered>10&&r.conversionRate<20&&z.push({icon:ks,severity:"info",title:`Only ${r.conversionRate.toFixed(0)}% discovery-to-reply rate`,description:"Most discovered posts go unused. Try the Lead Machine to automatically engage with matching posts.",cta:"Try Lead Machine",action:"lead-machine"}),!a&&r.totalDiscovered>5&&z.push({icon:Lt,severity:"info",title:"Unlock Social Pulse & Conversations",description:"Monitor brand mentions in real-time and track conversations across platforms.",cta:"Upgrade",action:"settings"}),r.platformsActive>0&&r.platformsActive<3&&z.push({icon:Es,severity:"info",title:`Only ${r.platformsActive} platform(s) active`,description:"Expand to Reddit, LinkedIn, YouTube, and more to discover leads where your audience hangs out.",cta:"Add platforms",action:"settings"}),r.totalPosted>5&&z.push({icon:es,severity:"success",title:`${r.totalPosted} replies posted successfully`,description:"Great momentum! Enable Cold Reach to turn engaged prospects into DM conversations.",cta:"Try Cold Reach",action:"cold-reach"});const C={critical:"border-destructive/30 bg-destructive/5",warning:"border-amber-500/30 bg-amber-500/5",info:"border-primary/20 bg-primary/[0.03]",success:"border-emerald-500/30 bg-emerald-500/5"},j={critical:"text-destructive bg-destructive/10",warning:"text-amber-600 bg-amber-500/10",info:"text-primary bg-primary/10",success:"text-emerald-600 bg-emerald-500/10"};return e.jsxs("div",{className:"animate-fade-in space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-display font-semibold",children:"Dashboard"}),e.jsxs(W,{variant:"outline",className:"text-xs text-muted-foreground",children:[e.jsx(Cs,{className:"h-3 w-3 mr-1"})," Updated just now"]})]}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4",children:[{label:"Discovered",value:r.totalDiscovered,icon:ks,color:"text-primary",action:"engage"},{label:"Replied",value:r.totalReplied,icon:ms,color:"text-emerald-500",action:"engage",sub:r.totalPosted>0?`${r.totalPosted} posted`:void 0},{label:"In Queue",value:r.pendingQueue,icon:ws,color:"text-amber-500",action:"queue"},{label:"Platforms",value:r.platformsActive,icon:Nt,color:"text-violet-500",action:"settings"}].map(y=>e.jsx("button",{onClick:()=>t(y.action),className:"text-left",children:e.jsx(U,{className:"hover:border-primary/30 transition-colors cursor-pointer group h-full",children:e.jsxs(ye,{className:"p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(y.icon,{className:`h-4 w-4 ${y.color}`}),e.jsx(Ns,{className:"h-3 w-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]}),e.jsx("p",{className:"text-2xl sm:text-3xl font-semibold tracking-tight",children:y.value}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:y.label}),y.sub&&e.jsxs("p",{className:"text-[10px] text-emerald-500 mt-0.5 flex items-center gap-0.5",children:[e.jsx(xn,{className:"h-2.5 w-2.5"}),y.sub]})]})})},y.label))}),e.jsx("button",{onClick:()=>t("qualified-leads"),className:"w-full text-left group",children:e.jsx(U,{className:"border-border/10 bg-card/40 backdrop-blur-xl hover:border-primary/30 transition-colors cursor-pointer",children:e.jsxs(ye,{className:"p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ht,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"text-sm font-medium",children:"Qualified Leads"})]}),e.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:["View all ",e.jsx(Ns,{className:"h-3 w-3"})]})]}),e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xl sm:text-2xl font-bold",children:n.total}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Total"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xl sm:text-2xl font-bold",children:n.qualified}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Qualified"})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-xl sm:text-2xl font-bold flex items-center gap-1",children:[n.won," ",e.jsx(Bi,{className:"h-3.5 w-3.5 text-accent"})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Won"})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-xl sm:text-2xl font-bold text-accent",children:["$",n.revenue.toLocaleStr
130ing()]}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Revenue"})]})]})]})})}),b<100&&e.jsx(U,{className:"border-primary/20 bg-primary/[0.02]",children:e.jsxs(ye,{className:"p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(cr,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"text-sm font-medium",children:"Setup Progress"})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[b,"%"]})]}),e.jsx(zt,{value:b,className:"h-1.5 mb-4"}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-2",children:v.map((y,N)=>e.jsxs("button",{onClick:()=>!y.done&&t(y.action),className:`flex items-center gap-2 text-xs rounded-lg px-3 py-2 transition-colors text-left ${y.done?"text-muted-foreground line-through":"text-foreground hover:bg-accent/10 cursor-pointer"}`,children:[e.jsx(ys,{className:`h-3.5 w-3.5 shrink-0 ${y.done?"text-emerald-500":"text-muted-foreground/40"}`}),y.label]},N))})]})}),z.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(qt,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:"Insights & Actions"})]}),e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-3",children:z.slice(0,6).map((y,N)=>e.jsx(U,{className:`border ${C[y.severity]} transition-all hover:shadow-sm cursor-pointer group`,onClick:()=>t(y.action),children:e.jsx(ye,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`rounded-lg p-1.5 shrink-0 ${j[y.severity]}`,children:e.jsx(y.icon,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium leading-tight",children:y.title}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 leading-relaxed",children:y.description}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-primary mt-2 group-hover:underline",children:[y.cta," ",e.jsx(Ns,{className:"h-3 w-3"})]})]})]})})},N))})]}),e.jsxs("div",{className:"grid lg:grid-cols-3 gap-4 sm:gap-6",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsx(Pd,{userId:s})}),e.jsxs("div",{className:"lg:col-span-1 space-y-4 sm:space-y-5",children:[e.jsx(Fb,{}),e.jsx(Bb,{userId:s,limit:8})]})]})]})},mi=({title:s,description:t})=>e.jsx("div",{className:"animate-fade-in",children:e.jsxs("div",{className:"max-w-xl mx-auto mt-12 rounded-2xl border border-border/50 bg-card/40 backdrop-blur-sm p-8 text-center",children:[e.jsx("div",{className:"mx-auto h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center mb-4",children:e.jsx(_t,{className:"h-5 w-5 text-primary"})}),e.jsxs("h2",{className:"text-xl font-display font-semibold mb-2",children:[s," is in early access"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t??"This feature is currently limited to early-access accounts. Contact [email protected] if you'd like to request access."})]})}),Yd=["[email protected]","[email protected]"],Kd=["cold-reach","local-marketing","agent-builder","creative-studio"];function Xd(s){return s?Yd.includes(s.trim().toLowerCase()):!1}function Qd(s){return Kd.includes(s)}const qb=Object.freeze(Object.defineProperty({__proto__:null,EARLY_ACCESS_EMAILS:Yd,RESTRICTED_FEATURES:Kd,hasEarlyAccess:Xd,isRestrictedFeature:Qd},Symbol.toStringTag,{value:"Module"})),Hb=()=>{const s=ns();_i();const[t,a]=i.useState(null),[r,o]=i.useState(!0),[n,l]=i.useState(!1),[c,x]=i.useState(!0),[d,u]=i.useState(()=>{if(typeof window>"u")return"dashboard";const T=new Set(["dashboard","pulse","conversations","engage","queue","lead-machine","cold-reach","creative-studio","local-marketing","mutual-hype","qualified-leads","product","media","api","settings"]),le=new URLSearchParams(window.location.search).get("view");return le&&T.has(le)?le:"dashboard"}),[m,p]=i.useState(!1),[g,v]=i.useState(!1),[b,z]=i.useState(!1),[C,j]=i.useState(null),[y,N]=i.useState(!1),f=async()=>{await new Promise(T=>setTimeout(T,1e3)),window.location.reload()},{bind:R,style:M,isRefreshing:q}=sp({onRefresh:f,threshold:80}),_=async T=>{var ce,le;try{const[F,L,K,ue]=await Promise.all([w.from("profiles").select("trial_ends_at, subscription_status").eq("id",T).single(),w.from("onboarding_progress").select("completed_at").eq("user_id",T).single(),w.from("user_credentials").select("id").eq("user_id",T).limit(1),w.from("product_profiles").select("id").eq("user_id",T).limit(1)]);if(!L.error&&!((ce=L.data)!=null&&ce.completed_at)&&await w.from("onboarding_progress").upsert({user_id:T,completed_at:new Date().toISOString(),product_profile_completed:!1,media_uploaded:!1,credentials_added:!1,tone_selected:!1,first_discovery_completed:!1},{onConflict:"user_id"}),l(!1),!F.error&&F.data){const{trial_ends_at:Ne,subscription_status:fe}=F.data;if(j(fe),Ne&&fe==="trial"){const me=new Date().getTime(),Ie=new Date(Ne).getTime();z(me>Ie)}}K.error||N((((le=K.data)==null?void 0:le.length)||0)>0)}catch{}finally{x(!1)}};i.useEffect(()=>{const{data:{subscription:T}}=w.auth.onAuthStateChange((ce,le)=>{a((le==null?void 0:le.user)??null),le!=null&&le.user||s("/auth")});return w.auth.getSession().then(({data:{session:ce}})=>
130{a((ce==null?void 0:ce.user)??null),ce!=null&&ce.user?_(ce.user.id):s("/auth"),o(!1)}),()=>T.unsubscribe()},[s]);const A=()=>{l(!1),k.success("Setup complete",{description:"Your workspace is ready"})},B=async()=>{await w.auth.signOut(),k.success("Signed out successfully"),s("/auth")},P=C==="paid"||C==="active",I=Xd(t==null?void 0:t.email),$=T=>Qd(T)&&!I,be=[{label:"Overview",items:[{id:"dashboard",label:"Dashboard",icon:tu,tooltip:"Overview of your engagement activity",dataTour:"dashboard-tab"},{id:"qualified-leads",label:"Lead Pipeline",icon:Ht,tooltip:"Track leads from engagement to closed deals",dataTour:"qualified-leads-tab"},{id:"analytics",label:"Analytics",icon:gs,tooltip:"Track your performance and metrics",dataTour:"analytics-tab"}]},{label:"Engage",items:[{id:"pulse",label:"Social Pulse",icon:Ga,tooltip:"Real-time brand monitoring",dataTour:"pulse-tab"},{id:"conversations",label:"Conversations",icon:ms,tooltip:"Track ongoing conversations",dataTour:"conversations-tab"},{id:"engage",label:"Discover & Reply",icon:ws,tooltip:"Find and engage with relevant posts",dataTour:"engage-tab"},{id:"queue",label:"Queue",icon:wr,tooltip:"Manage your engagement queue",dataTour:"queue-tab"},{id:"lead-machine",label:"AI Lead Machine",icon:Et,tooltip:"Automated lead generation",dataTour:"lead-machine-tab"},{id:"cold-reach",label:"Cold Reach",icon:wa,tooltip:"AI-powered cold outreach",dataTour:"cold-reach-tab",locked:!I,badge:I?void 0:"EARLY"},{id:"local-marketing",label:"Local Businesses",icon:er,tooltip:"Find local businesses by location and extract their emails",dataTour:"local-marketing-tab",badge:I?"NEW":"EARLY",locked:!I},{id:"mutual-hype",label:"Mutual Hype",icon:xa,tooltip:"Boost your comments with upvotes from other deSHILLER members",dataTour:"mutual-hype-tab",badge:"PRO",locked:!P}]},{label:"Build",items:[{id:"agent-builder",label:"Agent Builder",icon:_n,tooltip:"Build custom AI agents",dataTour:"agent-builder-tab",badge:I?"PRO":"EARLY",locked:!I,isExternal:I},{id:"api",label:"API Access",icon:Ii,tooltip:"Enterprise API access",dataTour:"api-tab",badge:"API",locked:!P},{id:"creative-studio",label:"Creative Studio",icon:ga,tooltip:"AI-powered creative generation",dataTour:"creative-studio-tab",badge:I?"Soon":"EARLY",locked:!I}]},{label:"Setup",items:[{id:"product",label:"Product Profile",icon:Ai,tooltip:"Manage your product profiles",dataTour:"product-tab"},{id:"media",label:"Media Library",icon:ga,tooltip:"Upload and manage media assets",dataTour:"media-tab"},{id:"settings",label:"Settings",icon:qr,tooltip:"Configure your account",dataTour:"settings-tab"}]}];be.flatMap(T=>T.items),i.useEffect(()=>{if(!n&&!c&&t){const T=localStorage.getItem(`productTourCompleted_${t.id}`),ce=sessionStorage.getItem(`tourShownThisSession_${t.id}`);if(!T&&!ce){sessionStorage.setItem(`tourShownThisSession_${t.id}`,"true");const le=setTimeout(()=>{p(!0)},800);return()=>clearTimeout(le)}}},[n,c,t]);const Y=()=>{p(!1),t&&localStorage.setItem(`productTourCompleted_${t.id}`,"true"),localStorage.getItem("postWalkthroughSetupCompleted")?k.success("Tour completed"):v(!0)},O=T=>{u(T)},he=()=>{v(!1),localStorage.setItem("postWalkthroughSetupCompleted","true"),k.success("Setup complete! You're ready to start engaging.")},re=()=>t!=null&&t.email?t.email.split("@")[0].slice(0,2).toUpperCase():"U",oe={dashboard:"Dashboard",pulse:"Social Pulse",conversations:"Conversations",engage:"Engage",queue:"Queue","lead-machine":"AI Lead Machine","cold-reach":"Cold Reach","creative-studio":"Creative Studio","qualified-leads":"Lead Pipeline",api:"Enterprise API",analytics:"Analytics",product:"Product Profile",media:"Media Library","local-marketing":"Local Businesses","mutual-hype":"Mutual Hype",settings:"Settings"};return r||c?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsxs("div",{className:"text-center space-y-4",children:[e.jsxs("div",{className:"relative w-16 h-16 mx-auto",children:[e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary/20"}),e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary border-t-transparent animate-spin"})]}),e.jsx("p",{className:"text-muted-foreground",children:"Loading your workspace..."})]})}):t?n?e.jsx(tg,{userId:t.id,onComplete:A}):g?e.jsx(ig,{userId:t.id,onComplete:he}):e.jsx(Ka,{children:e.jsx(xd,{children:e.jsxs("div",{className:"min-h-screen flex w-full bg-background",children:[e.jsx(rg,{isExpired:b}),e.jsx(ng,{run:m,onComplete:Y,onNavigate:O}),e.jsxs(ud,{className:"border-r border-border/50",collapsible:"offcanvas",children:[e.jsx("div",{className:"p-4 sm:p-6 border-b border-border/50",children:e.jsx("h1",{className:"text-base sm:text-lg font-semibold tracking-tight",children:"DESHILLER"})}),e.jsx(pd,{className:"py-2",children:be.map((T,ce)=>e.jsxs(gd,{children:[e.jsx(fd,{className:"px-4 text-[10px] uppercase tracking-widest text-muted-foreground
130/60 font-medium mb-1",children:T.label}),e.jsx(bd,{children:e.jsx(jd,{children:T.items.filter(le=>le&&le.icon).map(le=>e.jsx(yd,{children:e.jsxs(la,{children:[e.jsx(ca,{asChild:!0,children:e.jsxs(vd,{"data-tour":le.dataTour,onClick:()=>{if($(le.id)){k.info("This feature is in early access",{description:"Contact [email protected] to request access."});return}le.isExternal?s("/agent-builder"):u(le.id)},isActive:d===le.id,className:"w-full justify-start h-9",children:[le.icon&&e.jsx(le.icon,{className:"h-4 w-4 mr-3 shrink-0"}),e.jsx("span",{className:"truncate text-sm",children:le.label}),le.locked&&e.jsx(_t,{className:"ml-auto h-3 w-3 text-muted-foreground/50 shrink-0"}),le.badge&&!le.locked&&e.jsx("span",{className:"ml-auto text-[9px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium shrink-0",children:le.badge})]})}),e.jsx(sa,{side:"right",className:"bg-card border-border/50 hidden md:block",children:e.jsx("p",{className:"text-sm",children:le.tooltip})})]})},le.id))})})]},T.label))}),e.jsxs("div",{className:"p-3 sm:p-4 border-t border-border/50 mt-auto space-y-2 sm:space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 px-1 sm:px-2",children:[e.jsx(Ur,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:e.jsx(Wr,{className:"bg-primary/10 text-primary text-[10px] sm:text-xs",children:re()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs sm:text-sm font-medium truncate",children:t.email}),e.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:P?"Pro Plan":"Free Trial"})]})]}),e.jsxs(h,{variant:"ghost",size:"sm",className:"w-full justify-start text-muted-foreground hover:text-foreground h-9",onClick:B,children:[e.jsx(Rc,{className:"h-4 w-4 mr-2 sm:mr-3"}),"Sign out"]})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsx("header",{className:"border-b border-border/50 bg-background/95 backdrop-blur-sm sticky top-0 z-40",children:e.jsxs("div",{className:"px-3 sm:px-4 md:px-8 py-3 sm:py-4 flex items-center gap-2 sm:gap-4",children:[e.jsxs(hd,{className:"md:hidden hover:bg-accent/5 shrink-0",children:[e.jsx(Ti,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Toggle sidebar"})]}),e.jsx(ag,{userId:t.id}),e.jsx(og,{userId:t.id})]})}),e.jsxs("main",{className:"flex-1 relative overflow-hidden",children:[e.jsx(tp,{y:M.y,rotate:M.rotate,isRefreshing:q}),e.jsx("div",{...R(),className:"h-full overflow-y-auto",style:{touchAction:"pan-y"},children:e.jsxs("div",{className:"p-4 sm:p-6 md:p-8",children:[e.jsx(Vr,{items:[{label:"Dashboard",href:"/dashboard"},{label:oe[d]}]}),d==="dashboard"&&e.jsx($b,{userId:t.id,onNavigate:u,isPaidUser:P}),d==="pulse"&&e.jsx("div",{className:"animate-fade-in",children:e.jsx(vg,{userId:t.id,isTrialExpired:b,isPaidUser:C==="paid"||C==="active"})}),d==="conversations"&&e.jsx("div",{className:"animate-fade-in",children:e.jsx(fg,{userId:t.id,isTrialExpired:b,isPaidUser:C==="paid"||C==="active"})}),d==="engage"&&e.jsx("div",{className:"animate-fade-in",children:e.jsx(Ld,{userId:t.id})}),d==="queue"&&e.jsx("div",{className:"animate-fade-in",children:e.jsx(fb,{userId:t.id})}),d==="lead-machine"&&e.jsx("div",{className:"animate-fade-in",children:e.jsx(mg,{userId:t.id})}),d==="cold-reach"&&e.jsx("div",{className:"animate-fade-in",children:I?e.jsx($f,{userId:t.id,isPaidUser:P}):e.jsx(mi,{title:"Cold Reach"})}),d==="creative-studio"&&e.jsx("div",{className:"animate-fade-in",children:I?e.jsx(tb,{userId:t.id}):e.jsx(mi,{title:"Creative Studio"})}),d==="local-marketing"&&e.jsx("div",{className:"animate-fade-in",children:I?e.jsx(cb,{userId:t.id}):e.jsx(mi,{title:"Local Businesses"})}),d==="mutual-hype"&&e.jsx("div",{className:"animate-fade-in",children:P?e.jsx(xb,{userId:t.id}):e.jsx(hb,{reason:b?"expired":"trial"})}),d==="qualified-leads"&&e.jsx("div",{className:"animate-fade-in",children:e.jsx(Ob,{userId:t.id})}),d==="product"&&e.jsx("div",{className:"animate-fade-in",children:e.jsx(zd,{userId:t.id})}),d==="media"&&e.jsx("div",{className:"animate-fade-in",children:e.jsx(Ed,{userId:t.id})}),d==="api"&&e.jsx("div",{className:"animate-fade-in",children:e.jsx(hg,{isPaidUser:P})}),d==="analytics"&&e.jsxs("div",{className:"animate-fade-in",children:[e.jsx("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-display font-semibold mb-4 sm:mb-6",children:"Analytics"}),e.jsx(Pd,{userId:t.id})]}),d==="settings"&&e.jsx("div",{className:"animate-fade-in",children:e.jsx(Zp,{userId:t.id})})]})})]})]})]})})}):null},Gb=async(s,t)=>{const{data:a}=await w.from("profiles").select("id, subscription_status, subscription_tier, created_at, trial_ends_at").gte("created_at",s.toISOString()).lte("created_at",t.toISOString()),r=(a==null?void 0:a.length)||0,o=(a==null?void 0:a.filter(m=>m.subscription_status==="trial").length)||0,n=(a==null?void 0:a.filter(m=>m.subscription_status==="active").length)||0,l=Math.ceil((t.getTime()-s.getTime())/(1e3*60*60*24)),c=new Date(s);c.setDate(c.getDate()-l);const{data:x}=await w.from("profiles").select("id").gte("created_at",c.toISOString()).lt("created_at",s.toISOString()),d=(x==null?void 0:x.length)||0,u=d>0?(r-d)/d*100:0;return{totalUsers:r,activeUsers:r,newSignups:r,trialUsers:o,paidUsers:n,growthRate:u,churnRate:0}},Ub=async()=>{const{data:s}=await w.from("payment_transactions").select("amount, plan_type, billing_period, status").eq("status","succeeded"),t=(s==null?void 0:s.reduce((d,u)=>d+Number(u.amount),0))||0,r=((s==null?void 0:s.filter(d=>d.billing_period==="monthly"||!d.billing_period))||[]).reduce((d,u)=>d+Number(u.amount),0),o=r*12,n=(s==null?void 0:s.reduce((d,u)=>{const m=u.plan_type||"unknown";return d[m]=(d[m]||0)+Number(u.amount),d},{}))||{},{count:l}=await w.from("profiles").select("id",{count:"exact",head:!0}),c=l?t/l:0,x=c*12;return{mrr:r,arr:o,totalRevenue:t,arpu:c,ltv:x,revenueByPlan:n}},Wb=async(s,t)=>{const{data:a}=await w.from("discovered_posts").select("platform, status, generated_reply").gte("created_at",s.toISOString()).lte("created_at",t.toISOString()),r={};return a==null||a.forEach(o=>{r[o.platform]||(r[o.platform]={discovered:0,generated:0,posted:0}),r[o.platform].discovered++,o.generated_reply&&r[o.platform].generated++,(o.status==="approved"||o.status==="posted")&&r[o.platform].posted++}),{postsDiscovered:(a==null?void 0:a.length)||0,repliesGenerated:(a==null?void 0:a.filter(o=>o.generated_reply).length)||0,repliesPosted:(a==null?void 0:a.filter(o=>o.status==="approved"||o.status==="posted").length)||0,byPlatform:r}},Vb=async()=>{const{count:s}=await w.from("profiles").select("id",{count:"exact",head:!0}),{count:t}=await w.from("profiles").select("id",{count:"exact",head:!0}).eq("subscription_status","trial"),{count:a}=await w.from("profiles").select("id",{count:"exact",head:!0}).eq("subscription_status","active"),r=t?a/t*100:0;return{visits:s||0,signups:s||0,trials:t||0,conversions:a||0,conversionRate:r}},Yb=async()=>{const{data:s}=await w.from("profiles").select("utm_source, utm_medium, utm_campaign, subscription_status"),t={};
130return s==null||s.forEach(a=>{const r=`${a.utm_source||"direct"}_${a.utm_medium||"none"}_${a.utm_campaign||"none"}`;t[r]||(t[r]={source:a.utm_source||"direct",medium:a.utm_medium||"none",campaign:a.utm_campaign||"none",signups:0,conversions:0}),t[r].signups++,a.subscription_status==="active"&&t[r].conversions++}),Object.values(t).map(a=>({...a,visits:a.signups,revenue:a.conversions*50,cpa:a.signups>0?100/a.signups:0,roas:a.conversions*50/100}))},Kb=(s,t)=>{if(t){if(t.includes("cpc")||t.includes("ppc")||t.includes("paid"))return"paid";if(t.includes("email"))return"email";if(t.includes("social"))return"social";if(t.includes("organic"))return"organic";if(t.includes("referral"))return"referral"}if(!s)return"direct";const a=s.toLowerCase();return a.includes("twitter.com")||a.includes("x.com")||a.includes("linkedin.com")||a.includes("facebook.com")||a.includes("instagram.com")||a.includes("reddit.com")||a.includes("tiktok.com")||a.includes("youtube.com")?"social":a.includes("google.")||a.includes("bing.com")||a.includes("yahoo.")||a.includes("duckduckgo.com")||a.includes("baidu.com")?"organic":a.includes("mail.")||a.includes("outlook.")||a.includes("gmail.")||a.includes("email")?"email":"referral"},Xb=(s,t)=>{if(t)return t;if(!s)return"Direct";try{const r=new URL(s).hostname.replace("www.","");return{"google.com":"Google","google.co.uk":"Google","bing.com":"Bing","yahoo.com":"Yahoo","duckduckgo.com":"DuckDuckGo","twitter.com":"Twitter/X","x.com":"Twitter/X","linkedin.com":"LinkedIn","facebook.com":"Facebook","instagram.com":"Instagram","reddit.com":"Reddit","youtube.com":"YouTube","tiktok.com":"TikTok","t.co":"Twitter/X","lnkd.in":"LinkedIn"}[r]||r}catch{return s.slice(0,30)}},Qb=async()=>{const{data:s}=await w.from("profiles").select("referrer_url, landing_page, utm_source, utm_medium, subscription_status"),t={};return s==null||s.forEach(a=>{const r=Xb(a.referrer_url,a.utm_source),o=Kb(a.referrer_url,a.utm_medium),n=`${r}_${o}`;t[n]||(t[n]={source:r,sourceType:o,signups:0,trials:0,conversions:0,landingPages:[]}),t[n].signups++,a.subscription_status==="trial"&&t[n].trials++,a.subscription_status==="active"&&t[n].conversions++,a.landing_page&&!t[n].landingPages.includes(a.landing_page)&&t[n].landingPages.push(a.landing_page)}),Object.values(t).map(a=>({source:a.source,sourceType:a.sourceType,signups:a.signups,trials:a.trials,conversions:a.conversions,conversionRate:a.signups>0?a.conversions/a.signups*100:0,topLandingPages:a.landingPages.slice(0,5)}))},Jb=(s,t,a)=>{const r=new Date;let o=new Date;switch(s){case"7d":o.setDate(r.getDate()-7);break;case"30d":o.setDate(r.getDate()-30);break;case"90d":o.setDate(r.getDate()-90);break;case"custom":return o=o,{start:o,end:r}}return{start:o,end:r}},$r=s=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(s),Zb=s=>`${s>=0?"+":""}${s.toFixed(1)}%`,ht=s=>new Intl.NumberFormat("en-US").format(s),ej=()=>{const[s,t]=i.useState({newSignups:0,postsDiscovered:0,repliesGenerated:0,repliesPosted:0,aiCalls:0,revenue:0,activeUsers:0,automationRuns:0}),[a,r]=i.useState(!0);i.useEffect(()=>{o()},[]);const o=async()=>{const l=new Date;l.setHours(0,0,0,0);const c=l.toISOString();try{const{count:x}=await w.from("profiles").select("id",{count:"exact",head:!0}).gte("created_at",c),{count:d}=await w.from("discovered_posts").select("id",{count:"exact",head:!0}).gte("created_at",c),{count:u}=await w.from("discovered_posts").select("id",{count:"exact",head:!0}).gte("created_at",c).not("generated_reply","is",null),{count:m}=await w.from("discovered_posts").select("id",{count:"exact",head:!0}).gte("created_at",c).in("status",["approved","posted"]),{count:p}=await w.from("automation_logs").select("id",{count:"exact",head:!0}).gte("created_at",c).in("action_type",["generate_reply","generate_comment","analyze"]),{data:g}=await w.from("payment_transactions").select("amount").gte("created_at",c).eq("status","succeeded"),v=(g==null?void 0:g.reduce((C,j)=>C+Number(j.amount),0))||0,{data:b}=await w.from("profiles").select("id").gte("last_active_at",c),{count:z}=await w.from("automation_logs").select("id",{count:"exact",head:!0}).gte("created_at",c);t({newSignups:x||0,postsDiscovered:d||0,repliesGenerated:u||0,repliesPosted:m||0,aiCalls:p||0,revenue:v,activeUsers:(b==null?void 0:b.length)||0,automationRuns:z||0})}catch{}finally{r(!1)}},n=[{label:"New Signups",value:ht(s.newSignups),icon:Es,color:"text-blue-500"},{label:"Active Users",value:ht(s.activeUsers),icon:Nt,color:"text-emerald-500"},{label:"Posts Discovered",value:ht(s.postsDiscovered),icon:Ks,color:"text-amber-500"},{label:"Replies Generated",value:ht(s.repliesGenerated),icon:ms,color:"text-violet-500"},{label:"Replies Posted",value:ht(s.repliesPosted),icon:gs,color:"text-pink-500"},{label:"AI Calls",value:ht(s.aiCalls),icon:Nt,color:"text-cyan-500"},{label:"Revenue",value:$r(s.revenue),icon:Ht,color:"text-emerald-500"},{label:"Automation Runs",value:ht(s.automationRuns),icon:Nt,color:"text-orange-500"}];return a?e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[...Array(8)].map((l,c)=>e.jsx(U,{className:"animate-pulse",children:e.jsxs(ye,{className:"p-6",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-1/2 mb-4"}),e.jsx("div",{className:"h-8 bg-muted rounded w-3/4"})]})},c))}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-xl font-semibold",children:"Today's Activity"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:new Date().toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric"})})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:n.map((l,c)=>{const x=l.icon;return e.jsx(U,{children:e.jsxs(ye,{className:"p-6",children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsx("div",{className:`p-2 rounded-lg bg-muted/50 ${l.color}`,children:e.jsx(x,{className:"h-4 w-4"})})}),e.jsx("p",{className:"text-2xl font-bold",children:l.value}),e.jsx("p",{className:"text-sm text-muted-foreground",children:l.label})]})},c)})}),e.jsx(sj,{})]})},sj=()=>{const[s,t]=i.useState([]);i.useEffect(()=>{a()},[]);const a=async()=>{const r=new Date;r.setHours(0,0,0,0);const{data:o}=await w.from("activity_feed").select("*").gte("created_at",r.toISOString()).order("created_at",{ascending:!1}).limit(20);t(o||[])};return e.jsxs(U,{children:[e.jsx(Be,{children:e.jsx($e,{className:"text-lg",children:"Recent Activity"})}),e.jsx(ye,{children:s.length===0?e.jsx("p",{className:"text-muted-foreground text-sm",children:"No activity today yet"}):e.jsx("div",{className:"space-y-3",children:s.map(r=>e.jsxs("div",{className:"flex items-start gap-3 text-sm",children:[e.jsx("div",{className:`w-2 h-2 rounded-full mt-2 ${r.severity==="error"?"bg-destructive":r.severity==="warning"?"bg-amber-500":"bg-emerald-500"}`}),e.jsxs("div",{children:[e.jsx("p",{children:r.description}),e.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(r.created_at).toLocaleTimeString()})]})]},r.id))})})]})},nl=({mrr:s,mrrChange:t,totalUsers:a,userChange:r,activeTrials:o,trialChange:n,conversionRate:l,conversionChange:c})=>{const x=[{label:"Monthly Recurring Revenue",value:$r(s),change:t,icon:Ht,color:"text-emerald-500"},{label:"Total Users",value:ht(a),change:r,icon:Es,color:"text-blue-500"},{label:"Active Trials",value:ht(o),change:n,icon:Nt,color:"text-amber-500"},{label:"Conversion Rate",value:`${l.toFixed(1)}%`,change:c,icon:ks,color:"text-violet-500"}];return e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:x.map((d,u)=>{const m=d.icon,p=d.change>=0,g=p?gs:Ln;return e.jsx(U,{className:"relative overflow-hidden",children:e.jsxs(ye,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("div",{className:`p-2 rounded-lg bg-muted/50 ${d.color}`,children:e.jsx(m,{className:"h-5 w-5"})}),e.jsxs("div",{className:`flex items-center gap-1 text-sm ${p?"text-emerald-500":"text-destructive"}`,children:[e.jsx(g,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:Zb(d.change)})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold mb-1",children:d.value}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d.label})]}),e.jsx("div",{className:`absolute bottom-0 left-0 right-0 h-1 ${d.color} opacity-50`})]})},u)})})},il=({data:s})=>e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Revenue Over Time"}),e.jsx(os,{children:"Monthly Recurring Revenue (MRR) and total revenue trends"})]}),e.jsx(ye,{children:e.jsx(ea,{width:"100%",height:350,children:e.jsxs($c,{data:s,children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"colorMrr",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",
130stopColor:"hsl(var(--primary))",stopOpacity:.3}),e.jsx("stop",{offset:"95%",stopColor:"hsl(var(--primary))",stopOpacity:0})]}),e.jsxs("linearGradient",{id:"colorRevenue",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"hsl(var(--accent))",stopOpacity:.3}),e.jsx("stop",{offset:"95%",stopColor:"hsl(var(--accent))",stopOpacity:0})]})]}),e.jsx(ar,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",opacity:.3}),e.jsx(rr,{dataKey:"date",stroke:"hsl(var(--muted-foreground))",fontSize:12}),e.jsx(nr,{stroke:"hsl(var(--muted-foreground))",fontSize:12,tickFormatter:t=>`$${(t/1e3).toFixed(0)}k`}),e.jsx(ma,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"},formatter:t=>$r(t)}),e.jsx(sr,{}),e.jsx(vi,{type:"monotone",dataKey:"mrr",stroke:"hsl(var(--primary))",fillOpacity:1,fill:"url(#colorMrr)",name:"MRR"}),e.jsx(vi,{type:"monotone",dataKey:"revenue",stroke:"hsl(var(--accent))",fillOpacity:1,fill:"url(#colorRevenue)",name:"Total Revenue"})]})})})]}),tj=({data:s})=>e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"User Growth"}),e.jsx(os,{children:"Daily signups and active users over time"})]}),e.jsx(ye,{children:e.jsx(ea,{width:"100%",height:350,children:e.jsxs(Pc,{data:s,children:[e.jsx(ar,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",opacity:.3}),e.jsx(rr,{dataKey:"date",stroke:"hsl(var(--muted-foreground))",fontSize:12}),e.jsx(nr,{stroke:"hsl(var(--muted-foreground))",fontSize:12}),e.jsx(ma,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"},formatter:t=>ht(t)}),e.jsx(sr,{}),e.jsx(zr,{type:"monotone",dataKey:"newSignups",stroke:"hsl(var(--primary))",strokeWidth:2,name:"New Signups",dot:{r:3}}),e.jsx(zr,{type:"monotone",dataKey:"totalUsers",stroke:"hsl(var(--accent))",strokeWidth:2,name:"Total Users",dot:{r:3}}),e.jsx(zr,{type:"monotone",dataKey:"activeUsers",stroke:"hsl(var(--muted-foreground))",strokeWidth:2,strokeDasharray:"5 5",name:"Active Users",dot:{r:3}})]})})})]}),aj={twitter:"hsl(29 90% 52%)",linkedin:"hsl(201 100% 35%)",reddit:"hsl(16 100% 50%)",facebook:"hsl(221 44% 41%)"},rj=({totalPosts:s,totalReplies:t,totalPosted:a,platformData:r})=>{const o=r.map(n=>({name:n.platform.charAt(0).toUpperCase()+n.platform.slice(1),value:n.discovered}));return e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Engagement Overview"}),e.jsx(os,{children:"Total engagement across all platforms"})]}),e.jsx(ye,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:e.jsx(gs,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Posts Discovered"}),e.jsx("p",{className:"text-2xl font-bold",children:ht(s)})]})]})}),e.jsx("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-accent/10",children:e.jsx(ms,{className:"h-5 w-5 text-accent"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Replies Generated"}),e.jsx("p",{className:"text-2xl font-bold",children:ht(t)})]})]})}),e.jsx("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-success/10",children:e.jsx(Es,{className:"h-5 w-5 text-success"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Replies Posted"}),e.jsx("p",{className:"text-2xl font-bold",children:ht(a)})]})]})})]})})]}),e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Posts by Platform"}),e.jsx(os,{children:"Distribution of discovered posts"})]}),e.jsx(ye,{children:e.jsx(ea,{width:"100%",height:250,children:e.jsxs(dn,{children:[e.jsx(mn,{data:o,cx:"50%",cy:"50%",labelLine:!1,label:({name:n,percent:l})=>`${n}: ${(l*100).toFixed(0)}%`,outerRadius:80,fill:"hsl(var(--primary))",dataKey:"value",children:o.map((n,l)=>e.jsx(Er,{fill:aj[n.name.toLowerCase()]||"hsl(var(--primary))"},`cell-${l}`))}),e.jsx(ma,{formatter:n=>ht(n)}),e.jsx(sr,{})]})})})]}),e.jsxs(U,{className:"lg:col-span-2",children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Platform Performance"}),e.jsx(os,{children:"Engagement metrics by platform"})]}),e.jsx(ye,{children:e.jsx(ea,{width:"100%",height:300,children:e.jsxs(Ri,{data:r,children:[e.jsx(ar,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",opacity:.3}),e.jsx(rr,{dataKey:"platform",stroke:"hsl(var(--muted-foreground))",fontSize:12,tickFormatter:n=>n.charAt(0).toUpperCase()+n.slice(1)}),e.jsx(nr,{stroke:"hsl(var(--muted-foreground))",fontSize:12}),e.jsx(ma,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"},formatter:n=>ht(n)}),e.jsx(sr,{}),e.jsx(Nr,{dataKey:"discovered",fill:"hsl(var(--primary))",name:"Discovered"}),e.jsx(Nr,{dataKey:"generated",fill:"hsl(var(--accent))",name:"Generated"}),e.jsx(Nr,{dataKey:"posted",fill:"hsl(var(--muted-foreground))",name:"Posted"})]})})})]})]})},nj=({data:s})=>{const t=r=>r.visits>0?(r.conversions/r.visits*100).toFixed(1):"0.0",a=()=>{const r=["Source","Medium","Campaign","Visits","Signups","Conversions","Revenue","CPA","ROAS"],o=s.map(d=>[d.source,d.medium,d.campaign,d.visits,d.signups,d.conversions,d.revenue,d.cpa,d.roas]),n=[r,...o].map(d=>d.join(",")).join(` 131`),l=new Blob([n],{type:"text/csv"}),c=window.URL.createObjectURL(l),x=document.createElement("a");x.href=c,x.download=`utm-performance-${new Date().toISOString().split("T")[0]}.csv`,x.click()};return e.jsxs(U,{children:[e.jsx(Be,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx($e,{children:"UTM Campaign Performance"}),e.jsx(os,{children:"Track marketing campaign effectiveness and ROI"})]}),e.jsxs(h,{variant:"outline",size:"sm",onClick:a,children:[e.jsx(Ut,{className:"h-4 w-4 mr-2"}),"Export CSV"]})]})}),e.jsx(ye,{children:e.jsx("div",{className:"rounded-md border",children:e.jsxs(ja,{children:[e.jsx(ya,{children:e.jsxs(tt,{children:[e.jsx(fs,{children:"Campaign"}),e.jsx(fs,{children:"Source"}),e.jsx(fs,{children:"Medium"}),e.jsx(fs,{className:"text-right",children:"Visits"}),e.jsx(fs,{className:"text-right",children:"Signups"}),e.jsx(fs,{className:"text-right",children:"Conversions"}),e.jsx(fs,{className:"text-right",children:"Conv. Rate"}),e.jsx(fs,{className:"text-right",children:"Revenue"}),e.jsx(fs,{className:"text-right",children:"CPA"}),e.jsx(fs,{className:"text-right",children:"ROAS"})]})}),e.jsx(va,{children:s.length===0?e.jsx(tt,{children:e.jsx(is,{colSpan:10,className:"text-center text-muted-foreground py-8",children:"No UTM data available yet"})}):s.map((r,o)=>{const n=parseFloat(t(r)),l=n>=2,c=r.roas>=2;return e.jsxs(tt,{children:[e.jsx(is,{className:"font-medium",children:r.campaign}),e.jsx(is,{children:e.jsx(W,{variant:"outline",children:r.source})}),e.jsx(is,{children:e.jsx(W,{variant:"secondary",children:r.medium})}),e.jsx(is,{className:"text-right",children:ht(r.visits)}),e.jsx(is,{className:"text-right",children:ht(r.signups)}),e.jsx(is,{className:"text-right font-medium",children:ht(r.conversions)}),e.jsx(is,{className:"text-right",children:e.jsxs("span",{className:l?"text-success":"text-muted-foreground",children:[n,"%"]})}),e.jsx(is,{className:"text-right font-medium",children:$r(r.revenue)}),e.jsx(is,{className:"text-right",children:$r(r.cpa)}),e.jsx(is,{className:"text-right",children:e.jsxs("div",{className:`flex items-center justify-end gap-1 ${c?"text-success":"text-muted-foreground"}`,children:[c?e.jsx(gs,{className:"h-3 w-3"}):e.jsx(Ln,{className:"h-3 w-3"}),e.jsxs("span",{children:[r.roas.toFixed(2),"x"]})]})})]},o)})})]})})})]})},ij=({users:s,onRefresh:t})=>{const[a,r]=i.useState(""),[o,n]=i.useState(null),[l,c]=i.useState(!1),[x,d]=i.useState(!1),[u,m]=i.useState(!1),[p,g]=i.useState(!1),[v,b]=i.useState(""),[z,C]=i.useState(""),[j,y]=i.useState("50"),[N,f]=i.useState("7"),[R,M]=i.useState(!1),[q,_]=i.useState("25"),[A,B]=i.useState(!1),P=s.filter(T=>{var ce;return T.email.toLowerCase().includes(a.toLowerCase())||((ce=T.full_name)==null?void 0:ce.toLowerCase().includes(a.toLowerCase()))}),I=T=>{switch(T){case"active":return"default";case"trial":return"secondary";case"canceled":return"destructive";default:return"outline"}},$=async()=>
131{if(o){B(!0);try{const{error:T}=await w.from("profiles").update({subscription_tier:v||null,subscription_status:z||"active",updated_at:new Date().toISOString()}).eq("id",o.id);if(T)throw T;k.success(`Plan updated for ${o.email}`),c(!1),t==null||t()}catch(T){k.error("Failed to update plan",{description:T.message})}finally{B(!1)}}},be=async()=>{if(o){B(!0);try{const{data:T}=await w.from("discovery_usage").select("id, paid_discoveries_remaining").eq("user_id",o.id).single(),ce=parseInt(j,10);if(T){const{error:le}=await w.from("discovery_usage").update({paid_discoveries_remaining:T.paid_discoveries_remaining+ce,updated_at:new Date().toISOString()}).eq("user_id",o.id);if(le)throw le}else{const{error:le}=await w.from("discovery_usage").insert({user_id:o.id,paid_discoveries_remaining:ce});if(le)throw le}await w.from("activity_feed").insert({user_id:o.id,activity_type:"admin_grant",description:`Admin granted ${ce} discoveries`,severity:"info",metadata:{amount:ce,granted_by:"admin"}}),k.success(`Granted ${ce} discoveries to ${o.email}`),d(!1),t==null||t()}catch(T){k.error("Failed to grant discoveries",{description:T.message})}finally{B(!1)}}},Y=async()=>{if(o){B(!0);try{const T=parseInt(N,10),ce=o.trial_ends_at?new Date(o.trial_ends_at):new Date,le=new Date(Math.max(ce.getTime(),Date.now()));le.setDate(le.getDate()+T);const{error:F}=await w.from("profiles").update({trial_ends_at:le.toISOString(),subscription_status:"trial",updated_at:new Date().toISOString()}).eq("id",o.id);if(F)throw F;await w.from("activity_feed").insert({user_id:o.id,activity_type:"admin_trial_extend",description:`Admin extended trial by ${T} days`,severity:"info",metadata:{days:T,new_end_date:le.toISOString()}}),k.success(`Extended trial by ${T} days for ${o.email}`),m(!1),t==null||t()}catch(T){k.error("Failed to extend trial",{description:T.message})}finally{B(!1)}}},O=async()=>{if(o){B(!0);try{if(R){const{data:T}=await w.from("automation_subscriptions").select("id").eq("user_id",o.id).maybeSingle(),ce=parseInt(q,10);if(T){const{error:le}=await w.from("automation_subscriptions").update({status:"active",daily_limit:ce,stripe_subscription_id:"admin_granted",updated_at:new Date().toISOString()}).eq("user_id",o.id);if(le)throw le}else{const{error:le}=await w.from("automation_subscriptions").insert({user_id:o.id,status:"active",daily_limit:ce,stripe_subscription_id:"admin_granted"});if(le)throw le}await w.from("activity_feed").insert({user_id:o.id,activity_type:"admin_auto_engage_grant",description:`Admin enabled Auto-Engage with ${ce}/day limit`,severity:"info",metadata:{daily_limit:ce,granted_by:"admin"}}),k.success(`Auto-Engage enabled for ${o.email}`)}else{const{error:T}=await w.from("automation_subscriptions").update({status:"canceled",updated_at:new Date().toISOString()}).eq("user_id",o.id);if(T)throw T;await w.from("activity_feed").insert({user_id:o.id,activity_type:"admin_auto_engage_revoke",description:"Admin disabled Auto-Engage",severity:"info"}),k.success(`Auto-Engage disabled for ${o.email}`)}g(!1),t==null||t()}catch(T){k.error("Failed to update Auto-Engage",{description:T.message})}finally{B(!1)}}},he=async T=>{var le;const{data:ce}=await w.from("automation_subscriptions").select("status, daily_limit").eq("user_id",T.id).maybeSingle();M((ce==null?void 0:ce.status)==="active"),_(((le=ce==null?void 0:ce.daily_limit)==null?void 0:le.toString())||"25")},re=async(T,ce)=>{try{const{error:le}=await w.functions.invoke("send-notification-email",{body:{type:ce,to:T.email,data:{userId:T.id,name:T.full_name||"there"}}});if(le)throw le;k.success(`Email sent to ${T.email}`)}catch(le){k.error("Failed to send email",{description:le.message})}},oe=()=>{const T=["Name","Email","Status","Plan","Signup Date","Trial Ends","UTM Source"],ce=P.map(ue=>[ue.full_name||"N/A",ue.email,ue.subscription_status||"N/A",ue.subscription_tier||"N/A",new Date(ue.created_at).toLocaleDateString(),ue.trial_ends_at?new Date(ue.trial_ends_at).toLocaleDateString():"N/A",ue.utm_source||"direct"]),le=[T,...ce].map(ue=>ue.join(",")).join(` 132`),F=new Blob([le],{type:"text/csv"}),L=window.URL.createObjectURL(F),K=document.createElement("a");K.href=L,K.download=`users-${new Date().toISOString().split("T")[0]}.csv`,K.click()};return e.jsxs(e.Fragment,{children:[e.jsxs(U,{children:[e.jsx(Be,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs($e,{className:"flex items-center gap-2",children:[e.jsx(au,{className:"h-5 w-5 text-accent"}),"User Management"]}),e.jsx(os,{children:"Manage user plans, trials, and discoveries"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Ks,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(Je,{placeholder:"Search users...",value:a,onChange:T=>r(T.target.value),className:"pl-9 w-[250px]"})]}),e.jsxs(h,{variant:"outline",size:"sm",onClick:oe,children:[e.jsx(Ut,{className:"h-4 w-4 mr-2"}),"Export"]})]})]})}),e.jsxs(ye,{children:[e.jsx("div",{className:"rounded-md border max-h-[500px] overflow-y-auto",children:e.jsxs(ja,{children:[e.jsx(ya,{className:"sticky top-0 bg-card z-10",children:e.jsxs(tt,{children:[e.jsx(fs,{children:"User"}),e.jsx(fs,{children:"Status"}),e.jsx(fs,{children:"Plan"}),e.jsx(fs,{children:"Signup"}),e.jsx(fs,{children:"Trial Ends"}),e.jsx(fs,{children:"Source"}),e.jsx(fs,{className:"text-right",children:"Actions"})]})}),e.jsx(va,{children:P.length===0?e.jsx(tt,{children:e.jsx(is,{colSpan:7,className:"text-center text-muted-foreground py-8",children:a?"No users found matching your search":"No users yet"})}):P.map(T=>e.jsxs(tt,{children:[e.jsx(is,{children:e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:T.full_name||"Unknown"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:T.email})]})}),e.jsx(is,{children:e.jsx(W,{variant:I(T.subscription_status),children:T.subscription_status||"none"})}),e.jsx(is,{children:e.jsx(W,{variant:"outline",children:T.subscription_tier||"free"})}),e.jsx(is,{className:"text-sm text-muted-foreground",children:ha(new Date(T.created_at),{addSuffix:!0})}),e.jsx(is,{className:"text-sm",children:T.trial_ends_at?e.jsx("span",{className:new Date(T.trial_ends_at)<new Date?"text-destructive":"text-muted-foreground",children:new Date(T.trial_ends_at)<new Date?"Expired":ha(new Date(T.trial_ends_at),{addSuffix:!0})}):e.jsx("span",{className:"text-muted-foreground",children:"N/A"})}),e.jsx(is,{children:e.jsx(W,{variant:"secondary",className:"text-xs",children:T.utm_source||"direct"})}),e.jsx(is,{className:"text-right",children:e.jsxs(Ui,{children:[e.jsx(Wi,{asChild:!0,children:e.jsx(h,{variant:"ghost",size:"sm",children:e.jsx(ru,{className:"h-4 w-4"})})}),e.jsxs(Rn,{align:"end",children:[e.jsxs(Zt,{onClick:()=>{n(T),b(T.subscription_tier||""),C(T.subscription_status||""),c(!0)},children:[e.jsx(Sa,{className:"h-4 w-4 mr-2"}),"Change Plan"]}),e.jsxs(Zt,{onClick:()=>{n(T),d(!0)},children:[e.jsx(gi,{className:"h-4 w-4 mr-2"}),"Grant Discoveries"]}),e.jsxs(Zt,{onClick:()=>{n(T),m(!0)},children:[e.jsx(Sa,{className:"h-4 w-4 mr-2"}),"Extend Trial"]}
132),e.jsxs(Zt,{onClick:async()=>{n(T),await he(T),g(!0)},children:[e.jsx(ws,{className:"h-4 w-4 mr-2"}),"Auto-Engage Settings"]}),e.jsx(Br,{}),e.jsxs(Zt,{onClick:()=>re(T,"trial_expiring"),children:[e.jsx(Fs,{className:"h-4 w-4 mr-2"}),"Send Trial Warning"]}),e.jsxs(Zt,{onClick:()=>re(T,"weekly_digest"),children:[e.jsx(Fs,{className:"h-4 w-4 mr-2"}),"Send Weekly Digest"]})]})]})})]},T.id))})]})}),e.jsx("div",{className:"flex items-center justify-between mt-4 text-sm text-muted-foreground",children:e.jsxs("p",{children:["Showing ",P.length," of ",s.length," users"]})})]})]}),e.jsx(gt,{open:l,onOpenChange:c,children:e.jsxs(dt,{children:[e.jsxs(mt,{children:[e.jsx(xt,{children:"Change User Plan"}),e.jsxs(Mt,{children:["Update subscription plan for ",o==null?void 0:o.email]})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{children:"Subscription Status"}),e.jsxs(Gs,{value:z,onValueChange:C,children:[e.jsx(qs,{children:e.jsx(Us,{placeholder:"Select status"})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"trial",children:"Trial"}),e.jsx(Te,{value:"active",children:"Active"}),e.jsx(Te,{value:"canceled",children:"Canceled"}),e.jsx(Te,{value:"expired",children:"Expired"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{children:"Subscription Tier"}),e.jsxs(Gs,{value:v,onValueChange:b,children:[e.jsx(qs,{children:e.jsx(Us,{placeholder:"Select plan"})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"free",children:"Free"}),e.jsx(Te,{value:"starter",children:"Starter ($49/mo)"}),e.jsx(Te,{value:"pro",children:"Pro ($149/mo)"}),e.jsx(Te,{value:"enterprise",children:"Enterprise"})]})]})]})]}),e.jsxs(Ft,{children:[e.jsx(h,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e.jsx(h,{onClick:$,disabled:A,children:A?"Updating...":"Update Plan"})]})]})}),e.jsx(gt,{open:x,onOpenChange:d,children:e.jsxs(dt,{children:[e.jsxs(mt,{children:[e.jsx(xt,{children:"Grant Discoveries"}),e.jsxs(Mt,{children:["Add free discoveries to ",o==null?void 0:o.email]})]}),e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{children:"Number of Discoveries"}),e.jsxs(Gs,{value:j,onValueChange:y,children:[e.jsx(qs,{children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"10",children:"10 discoveries"}),e.jsx(Te,{value:"25",children:"25 discoveries"}),e.jsx(Te,{value:"50",children:"50 discoveries"}),e.jsx(Te,{value:"100",children:"100 discoveries"}),e.jsx(Te,{value:"250",children:"250 discoveries"}),e.jsx(Te,{value:"500",children:"500 discoveries"})]})]})]})}),e.jsxs(Ft,{children:[e.jsx(h,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),e.jsx(h,{onClick:be,disabled:A,children:A?"Granting...":`Grant ${j} Discoveries`})]})]})}),e.jsx(gt,{open:u,onOpenChange:m,children:e.jsxs(dt,{children:[e.jsxs(mt,{children:[e.jsx(xt,{children:"Extend Trial"}),e.jsxs(Mt,{children:["Extend trial period for ",o==null?void 0:o.email]})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{children:"Additional Days"}),e.jsxs(Gs,{value:N,onValueChange:f,children:[e.jsx(qs,{children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"1",children:"1 day"}),e.jsx(Te,{value:"3",children:"3 days"}),e.jsx(Te,{value:"7",children:"7 days"}),e.jsx(Te,{value:"14",children:"14 days"}),e.jsx(Te,{value:"30",children:"30 days"})]})]})]}),(o==null?void 0:o.trial_ends_at)&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Current trial ends: ",new Date(o.trial_ends_at).toLocaleDateString()]})]}),e.jsxs(Ft,{children:[e.jsx(h,{variant:"outline",onClick:()=>m(!1),children:"Cancel"}),e.jsx(h,{onClick:Y,disabled:A,children:A?"Extending...":`Extend by ${N} Days`})]})]})}),e.jsx(gt,{open:p,onOpenChange:g,children:e.jsxs(dt,{children:[e.jsxs(mt,{children:[e.jsxs(xt,{className:"flex items-center gap-2",children:[e.jsx(ws,{className:"h-5 w-5 text-amber-500"}),"Auto-Engage Settings"]}),e.jsxs(Mt,{children:["Configure automatic engagement for ",o==null?void 0:o.email]})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ce,{children:"Enable Auto-Engage"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically post comments without user approval"})]}),e.jsx(Js,{checked:R,onCheckedChange:M})]}),R&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{children:"Daily Engagement Limit"}),e.jsxs(Gs,{value:q,onValueChange:_,children:[e.jsx(qs,{children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"10",children:"10 per day"}),e.jsx(Te,{value:"25",children:"25 per day"}),e.jsx(Te,{value:"50",children:"50 per day (max)"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Maximum 50/day to prevent platform account suspension"})]})]}),e.jsxs(Ft,{children:[e.jsx(h,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),e.jsx(h,{onClick:O,disabled:A,children:A?"Saving...":R?"Enable Auto-Engage":"Disable Auto-Engage"})]})]})})]})},oj=()=>{const[s,t]=i.useState([]);i.useEffect(()=>{a();const n=w.channel("activity-feed").on("postgres_changes",{event:"INSERT",schema:"public",table:"activity_feed"},l=>{t(c=>[l.new,...c].slice(0,50))}).subscribe();return()=>{w.removeChannel(n)}},[]);const a=async()=>{const{data:n,error:l}=await w.from("activity_feed").select("*").order("created_at",{ascending:!1}).limit(50);l||t(n||[])},r=n=>{switch(n){case"signup":return wa;case"payment":return Sa;case"engagement":return ms;case"error":return Ss;default:return Nt}},o=n=>{switch(n){case"success":return"default";case"info":return"secondary";case"warning":return"outline";case"error":return"destructive";default:return"secondary"}};return e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Real-Time Activity Feed"}),e.jsx(os,{children:"Live updates of user actions and system events"})]}),e.jsx(ye,{children:e.jsx(jt,{className:"h-[500px] pr-4",children:e.jsx("div",{className:"space-y-3",children:s.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Nt,{className:"h-12 w-12 mx-auto mb-3 opacity-50"}),e.jsx("p",{children:"No recent activity"})]}):s.map(n=>{const l=r(n.activity_type);return e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[e.jsx("div",{className:"p-2 rounded-lg bg-muted/50",children:e.jsx(l,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(W,{variant:o(n.severity),className:"text-xs",children:n.activity_type}),e.jsx("span",{className:"text-xs text-muted-foreground",children:ha(new Date(n.created_at),{addSuffix:!0})})]}),e.jsx("p",{className:"text-sm",children:n.description})]})]},n.id)})})})})]})},ol=({visits:s,signups:t,trials:a,conversions:r})=>{const o=[{label:"Visits",value:s,color:"bg-primary"}
132,{label:"Signups",value:t,color:"bg-accent"},{label:"Trials",value:a,color:"bg-secondary"},{label:"Paid",value:r,color:"bg-success"}],n=(l,c)=>c>0?(l/c*100).toFixed(1):"0.0";return e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{children:"Conversion Funnel"}),e.jsx(os,{children:"Track user journey from visit to conversion"})]}),e.jsx(ye,{children:e.jsxs("div",{className:"space-y-6",children:[o.map((l,c)=>{const x=c>0?o[c-1]:null,d=x?n(l.value,x.value):"100.0",u=s>0?l.value/s*100:0;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:l.label}),e.jsx(W,{variant:"secondary",className:"text-xs",children:ht(l.value)})]}),c>0&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Ns,{className:"h-4 w-4"}),e.jsxs("span",{children:[d,"% conversion"]})]})]}),e.jsx("div",{className:"relative h-10 bg-muted rounded-lg overflow-hidden",children:e.jsx("div",{className:`absolute top-0 left-0 h-full ${l.color} transition-all duration-500 flex items-center justify-center`,style:{width:`${Math.max(u,5)}%`},children:e.jsxs("span",{className:"text-sm font-medium text-white px-2",children:[u.toFixed(0),"%"]})})})]},l.label)}),e.jsx("div",{className:"pt-4 border-t",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground mb-1",children:"Overall Conversion"}),e.jsxs("p",{className:"text-2xl font-bold",children:[s>0?(r/s*100).toFixed(1):"0.0","%"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground mb-1",children:"Trial to Paid"}),e.jsxs("p",{className:"text-2xl font-bold",children:[a>0?(r/a*100).toFixed(1):"0.0","%"]})]})]})})]})})]})},ll=({users:s,totals:t})=>{const a=r=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2}).format(r);return e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsxs($e,{className:"flex items-center gap-2",children:[e.jsx(Ht,{className:"h-5 w-5 text-accent"}),"User Financial Metrics"]}),e.jsx(os,{children:"AI costs, revenue, and profit per user"})]})}),e.jsxs("div",{className:"grid grid-cols-4 gap-4 mt-4",children:[e.jsxs("div",{className:"bg-background/50 rounded-lg p-4 border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-sm mb-1",children:[e.jsx(nu,{className:"h-4 w-4"}),"Total AI Cost"]}),e.jsx("div",{className:"text-2xl font-bold text-destructive",children:a(t.totalAiCost)})]}),e.jsxs("div",{className:"bg-background/50 rounded-lg p-4 border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-sm mb-1",children:[e.jsx(Ht,{className:"h-4 w-4"}),"Total Revenue"]}),e.jsx("div",{className:"text-2xl font-bold text-accent",children:a(t.totalRevenue)})]}),e.jsxs("div",{className:"bg-background/50 rounded-lg p-4 border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-sm mb-1",children:[e.jsx(iu,{className:"h-4 w-4"}),"Total Profit"]}),e.jsx("div",{className:`text-2xl font-bold ${t.totalProfit>=0?"text-green-500":"text-destructive"}`,children:a(t.totalProfit)})]}),e.jsxs("div",{className:"bg-background/50 rounded-lg p-4 border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-sm mb-1",children:[t.avgProfitMargin>=0?e.jsx(gs,{className:"h-4 w-4"}):e.jsx(Ln,{className:"h-4 w-4"}),"Avg Profit Margin"]}),e.jsxs("div",{className:`text-2xl font-bold ${t.avgProfitMargin>=0?"text-green-500":"text-destructive"}`,children:[t.avgProfitMargin.toFixed(1),"%"]})]})]})]}),e.jsx(ye,{children:e.jsx("div",{className:"rounded-md border max-h-[400px] overflow-y-auto",children:e.jsxs(ja,{children:[e.jsx(ya,{className:"sticky top-0 bg-card",children:e.jsxs(tt,{children:[e.jsx(fs,{children:"User"}),e.jsx(fs,{children:"Plan"}),e.jsx(fs,{className:"text-right",children:"AI Calls"}),e.jsx(fs,{className:"text-right",children:"AI Cost"}),e.jsx(fs,{className:"text-right",children:"Revenue"}),e.jsx(fs,{className:"text-right",children:"Profit"}),e.jsx(fs,{className:"text-right",children:"Margin"})]})}),e.jsx(va,{children:s.length===0?e.jsx(tt,{children:e.jsx(is,{colSpan:7,className:"text-center text-muted-foreground py-8",children:"No financial data available"})}):s.map(r=>e.jsxs(tt,{children:[e.jsx(is,{children:e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:r.name||"Unknown"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:r.email})]})}),e.jsx(is,{children:e.jsx(W,{variant:r.tier==="pro"?"default":"secondary",children:r.tier||"free"})}),e.jsx(is,{className:"text-right font-mono",children:r.aiCalls.toLocaleStr
132ing()}),e.jsx(is,{className:"text-right font-mono text-destructive",children:a(r.aiCost)}),e.jsx(is,{className:"text-right font-mono text-accent",children:a(r.revenue)}),e.jsx(is,{className:`text-right font-mono ${r.profit>=0?"text-green-500":"text-destructive"}`,children:a(r.profit)}),e.jsx(is,{className:"text-right",children:e.jsxs(W,{variant:r.profitMargin>=50?"default":r.profitMargin>=0?"secondary":"destructive",className:r.profitMargin>=50?"bg-green-500/20 text-green-500 border-green-500/30":"",children:[r.profitMargin.toFixed(1),"%"]})})]},r.userId))})]})})})]})},lj=s=>{switch(s){case"direct":return e.jsx(bt,{className:"h-4 w-4"});case"organic":return e.jsx(Ks,{className:"h-4 w-4"});case"referral":return e.jsx(Ys,{className:"h-4 w-4"});case"social":return e.jsx(lr,{className:"h-4 w-4"});case"email":return e.jsx(Fs,{className:"h-4 w-4"});case"paid":return e.jsx(Es,{className:"h-4 w-4"});default:return e.jsx(bt,{className:"h-4 w-4"})}},cj=s=>{switch(s){case"organic":return"default";case"paid":return"destructive";case"social":return"secondary";default:return"outline"}},dj=({data:s})=>{const t=()=>{const r=["Source","Type","Signups","Trials","Conversions","Conv. Rate","Top Landing Pages"],o=s.map(d=>[d.source,d.sourceType,d.signups,d.trials,d.conversions,`${d.conversionRate.toFixed(1)}%`,d.topLandingPages.slice(0,3).join(" | ")]),n=[r,...o].map(d=>d.join(",")).join(` 133`),l=new Blob([n],{type:"text/csv"}),c=window.URL.createObjectURL(l),x=document.createElement("a");x.href=c,x.download=`traffic-sources-${new Date().toISOString().split("T")[0]}.csv`,x.click()},a=[...s].sort((r,o)=>o.signups-r.signups);return e.jsxs(U,{children:[e.jsx(Be,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx($e,{children:"Traffic Sources (All Channels)"}),e.jsx(os,{children:"User acquisition sources detected from referrers, landing pages, and UTM data"})]}),e.jsxs(h,{variant:"outline",size:"sm",onClick:t,children:[e.jsx(Ut,{className:"h-4 w-4 mr-2"}),"Export CSV"]})]})}),e.jsx(ye,{children:e.jsx("div",{className:"rounded-md border",children:e.jsxs(ja,{children:[e.jsx(ya,{children:e.jsxs(tt,{children:[e.jsx(fs,{children:"Source"}),e.jsx(fs,{children:"Type"}),e.jsx(fs,{className:"text-right",children:"Signups"}),e.jsx(fs,{className:"text-right",children:"Trials"}),e.jsx(fs,{className:"text-right",children:"Paid"}),e.jsx(fs,{className:"text-right",children:"Conv. Rate"}),e.jsx(fs,{children:"Top Landing Pages"})]})}),e.jsx(va,{children:a.length===0?e.jsx(tt,{children:e.jsx(is,{colSpan:7,className:"text-center text-muted-foreground py-8",children:"No traffic source data available yet"})}):a.map((r,o)=>{const n=r.conversionRate>=5;return e.jsxs(tt,{children:[e.jsx(is,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[lj(r.sourceType),e.jsx("span",{className:"font-medium",children:r.source})]})}),e.jsx(is,{children:e.jsx(W,{variant:cj(r.sourceType),children:r.sourceType})}),e.jsx(is,{className:"text-right",children:ht(r.signups)}),e.jsx(is,{className:"text-right",children:ht(r.trials)}),e.jsx(is,{className:"text-right font-medium",children:ht(r.conversions)}),e.jsx(is,{className:"text-right",children:e.jsxs("span",{className:n?"text-success":"text-muted-foreground",children:[r.conversionRate.toFixed(1),"%"]})}),e.jsx(is,{children:e.jsxs("div",{className:"flex flex-wrap gap-1 max-w-[200px]",children:[r.topLandingPages.slice(0,2).map((l,c)=>e.jsx(W,{variant:"outline",className:"text-xs truncate max-w-[90px]",children:l||"/"},c)),r.topLandingPages.length>2&&e.jsxs(W,{variant:"outline",className:"text-xs",children:["+",r.topLandingPages.length-2]})]})})]},o)})})]})})})]})},mj=()=>{const s=ns(),[t,a]=i.useState(!0),[r,o]=i.useState(!1),[n,l]=i.useState(null),[c,x]=i.useState("today"),[d,u]=i.useState(null),[m,p]=i.useState(null),[g,v]=i.useState(null),[b,z]=i.useState(null),[C,j]=i.useState([]),[y,N]=i.useState([]),[f,R]=i.useState([]),[M,q]=i.useState([]),[_,A]=i.useState([]),[B,P]=i.useState([]),[I,$]=i.useState([]),[be,Y]=i.useState({totalAiCost:0,totalRevenue:0,totalProfit:0,avgProfitMargin:0});i.useEffect(()=>{O()},[]),i.useEffect(()=>{r&&he()},[r]);const O=async()=>{try{const{data:{user:ce}}=await w.auth.getUser();if(!ce){s("/auth");return}l(ce);const{data:le,error:F}=await w.rpc("has_role",{_user_id:ce.id,_role:"admin"});if(F||!le){k.error("Access Denied",{description:"You don't have admin permissions"}),s("/dashboard");return}o(!0)}catch{s("/dashboard")}},he=async()=>{a(!0);try{const{start:ce,end:le}=Jb("30d"),[F,L,K,ue,Ne,fe,me]=await Promise.all([Gb(ce,le),Ub(),Wb(ce,le),Vb(),Yb(),Qb(),re()]);u(F),p(L),v(K),z(ue),j(Ne),$(fe),N(me),await oe(ce,le),await T(me)}
133catch{k.error("Failed to load analytics data")}finally{a(!1)}},re=async()=>{const{data:ce}=await w.from("profiles").select("*").order("created_at",{ascending:!1});return ce||[]},oe=async(ce,le)=>{const F=Math.ceil((le.getTime()-ce.getTime())/864e5),{data:L}=await w.from("profiles").select("id, created_at, subscription_status").order("created_at",{ascending:!0}),{data:K}=await w.from("payment_transactions").select("amount, created_at, status").eq("status","succeeded").order("created_at",{ascending:!0}),ue=[],Ne=[];for(let Ie=0;Ie<F;Ie++){const Q=new Date(ce);Q.setDate(Q.getDate()+Ie);const ne=new Date(Q);ne.setDate(ne.getDate()+1);const ke=Q.toISOString().split("T")[0],ee=(L==null?void 0:L.filter(J=>{const je=new Date(J.created_at);return je>=Q&&je<ne}).length)||0,E=(L==null?void 0:L.filter(J=>new Date(J.created_at)<=ne).length)||0,xe=(L==null?void 0:L.filter(J=>new Date(J.created_at)<=ne&&J.subscription_status==="active").length)||0;ue.push({date:ke,newSignups:ee,totalUsers:E,activeUsers:xe});const ve=(K==null?void 0:K.filter(J=>{const je=new Date(J.created_at);return je>=Q&&je<ne}).reduce((J,je)=>J+Number(je.amount),0))||0,S=(K==null?void 0:K.filter(J=>new Date(J.created_at)<=ne).reduce((J,je)=>J+Number(je.amount),0))||0;Ne.push({date:ke,mrr:S/Math.max(1,Ie+1),revenue:ve})}q(ue),R(Ne);const fe=["twitter","linkedin","reddit","facebook"],me=await Promise.all(fe.map(async Ie=>{const{count:Q}=await w.from("discovered_posts").select("id",{count:"exact",head:!0}).eq("platform",Ie),{count:ne}=await w.from("discovered_posts").select("id",{count:"exact",head:!0}).eq("platform",Ie).not("generated_reply","is",null),{count:ke}=await w.from("discovered_posts").select("id",{count:"exact",head:!0}).eq("platform",Ie).in("status",["approved","posted"]);return{platform:Ie,discovered:Q||0,generated:ne||0,posted:ke||0}}));A(me)},T=async ce=>{const F={starter:49,pro:149,enterprise:499,free:0,trial:0},L=await Promise.all(ce.map(async Ne=>{const{count:fe}=await w.from("automation_logs").select("id",{count:"exact",head:!0}).eq("user_id",Ne.id).in("action_type",["generate_reply","generate_comment","analyze"]),{count:me}=await w.from("discovered_posts").select("id",{count:"exact",head:!0}).eq("user_id",Ne.id),Ie=(fe||0)+(me||0),Q=Ie*.002,ne=Ne.subscription_status==="active",ke=Ne.subscription_tier||"free",ee=ne&&F[ke]||0,E=ee-Q,xe=ee>0?E/ee*100:Q>0?-100:0;return{userId:Ne.id,email:Ne.email,name:Ne.full_name,tier:Ne.subscription_tier,aiCalls:Ie,aiCost:Q,revenue:ee,profit:E,profitMargin:xe}}));L.sort((Ne,fe)=>Ne.profitMargin-fe.profitMargin);const K=L.reduce((Ne,fe)=>Ne+fe.aiCost,0),ue=L.reduce((Ne,fe)=>Ne+fe.revenue,0);P(L),Y({totalAiCost:K,totalRevenue:ue,totalProfit:ue-K,avgProfitMargin:ue>0?(ue-K)/ue*100:0})};return t&&!r?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsxs("div",{className:"text-center space-y-4",children:[e.jsxs("div",{className:"relative w-16 h-16 mx-auto",children:[e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary/20"}),e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary border-t-transparent animate-spin"})]}),e.jsx("p",{className:"text-muted-foreground",children:"Loading admin dashboard..."})]})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Ya,{user:n}),e.jsx("div",{className:"relative z-10",children:e.jsxs("main",{className:"container mx-auto px-4 py-8 max-w-7xl space-y-6",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(h,{onClick:()=>s("/dashboard"),variant:"outline",size:"sm",children:[e.jsx(Ts,{className:"h-4 w-4 mr-2"}),"Back"]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Tt,{className:"h-6 w-6 text-primary"}),e.jsx("h1",{className:"text-3xl font-display font-bold",children:"Admin Dashboard"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Business Intelligence & Analytics"})]})]})}),e.jsxs(Ct,{value:c,onValueChange:x,className:"space-y-6",children:[e.jsxs(wt,{className:"grid grid-cols-5 w-full max-w-2xl",children:[e.jsxs(cs,{value:"today",className:"flex items-center gap-2",children:[e.jsx(Ea,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Today"})]}),e.jsxs(cs,{value:"overview",className:"flex items-center gap-2",children:[e.jsx(cr,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Overview"})]}),e.jsxs(cs,{value:"users",className:"flex items-center gap-2",children:[e.jsx(Es,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Users"})]}),e.jsxs(cs,{value:"revenue",className:"flex items-center gap-2",children:[e.jsx(Ht,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Revenue"})]}),e.jsxs(cs,{value:"marketing",className:"flex items-center gap-2",children:[e.jsx(Fi,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Marketing"})]})]}),e.jsx(us,{value:"today",className:"space-y-6",children:e.jsx(ej,{})}),e.jsxs(us,{value:"overview",className:"space-y-6",children:[d&&m&&e.jsx(nl,{mrr:m.mrr,mrrChange:d.growthRate,totalUsers:d.totalUsers,userChange:d.growthRate,activeTrials:d.trialUsers,trialChange:0,conversionRate:(b==null?void 0:b.conversionRate)||0,conversionChange:0}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsx(il,{data:f}),e.jsx(tj,{data:M})]}),b&&e.jsx(ol,{visits:b.visits,signups:b.signups,trials:b.trials,conversions:b.conversions}),g&&e.jsx(rj,{totalPosts:g.postsDiscovered,totalReplies:g.repliesGenerated,totalPosted:g.repliesPosted,platformData:_})]}),e.jsxs(us,{value:"users",className:"space-y-6",children:[e.jsx(ll,{users:B,totals:be}),e.jsx(ij,{users:y,onRefresh:he})]}),e.jsxs(us,{value:"revenue",className:"space-y-6",children:[m&&e.jsx(nl,{mrr:m.mrr,mrrChange:(d==null?void 0:d.growthRate)||0,totalUsers:(d==null?void 0:d.paidUsers)||0,userChange:0,activeTrials:(d==null?void 0:d.trialUsers)||0,trialChange:0,conversionRate:(b==null?void 0:b.conversionRate)||0,conversionChange:0}),e.jsx(il,{data:f}),e.jsx(ll,{users:B,totals:be})]}),e.jsxs(us,{value:"marketing",className:"space-y-6",children:[b&&e.jsx(ol,{visits:b.visits,signups:b.signups,trials:b.trials,conversions:b.conversions}),e.jsx(dj,{data:I}),e.jsx(nj,{data:C}),e.jsx(oj,{})]})]})]})})]}):null},xj=()=>{const s=ns(),[t]=jc(),[a,r]=i.useState(null),[o,n]=i.useState(null),[l,c]=i.useState(!0),x=[{name:"Starter",price:"$8",tier:"starter",description:"For individual founders",features:["50 discoveries/month","All platforms (X, LinkedIn, Reddit)","AI reply generation","1 product profile","Email support"],popular:!1},{name:"Pro",price:"$49",tier:"pro",description:"For growing teams",features:["500 discoveries/month","All platforms (X, LinkedIn, Reddit)","AI reply generation","3 product profiles","Priority support","Analytics dashboard","Custom tone settings"],popular:!0},{name:"Enterprise",price:"Custom",tier:"enterprise",description:"For large organizations",features:["Unlimited discoveries","All platforms","Unlimited profiles","Dedicated support","Custom integrations","Team collaboration","White-label option"],popular:!1}];i.useEffect(()=>{d(),t.get("cancelled")==="true"&&k.info("Checkout cancelled")},[t]);const d=async()=>{const{data:{user:g}}=await w.auth.getUser();if(!g){s("/auth");return}try{const{data:v,error:b}=await w.functions.invoke("check-subscription");!b&&v&&n(v)}catch{}c(!1)},u=async g=>{if(g==="enterprise"){p();return}r(g);try{const{data:v,error:b}=await w.functions.invoke("create-subscription-checkout",{body:{tier:g}});if(b)throw b;v!=null&&v.url&&(window.location.href=v.url)}catch{k.error("Failed to start checkout. Please try again.")}finally{r(null)}},m=async()=>{r("manage");try{const{data:g,error:v}=await w.functions.invoke("customer-portal");if(v)throw v;g!=null&&g.url&&window.open(g.url,"_blank")}catch{k.error("Failed to open billing portal")}finally{r(null)}},p=()=>{k.info("Enterprise inquiries",{description:"Please email [email protected] for custom pricing."})};return l?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsx(Pe,{className:"h-8 w-8 animate-spin text-primary"})}):e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("div",{className:"fixed inset-0 bg-gradient-radial opacity-30"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("header",{className:"border-b border-border/50 bg-card/30 backdrop-blur-xl sticky top-0 z-50",children:e.jsx("div",{className:"container mx-auto px-4 py-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-primary to-accent flex items-center justify-center shadow-glow",children:e.jsx(Sa,{className:"h-5 w-5 text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-display font-semibold text-gradient",children:"Choose Your Plan"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Select a plan that fits your needs"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[(o==null?void 0:o.subscribed)&&e.jsxs(h,{onClick:m,variant:"outline",className:"gap-2",disabled:a==="manage",children:[a==="manage"?e.jsx(Pe,{className:"h-4 w-4 animate-spin"}):e.jsx(qr,{className:"h-4 w-4"}),"Manage Billing"]}),e.jsxs(h,{onClick:()=>s("/dashboard"),variant:"outline",className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back"]})]})]})})}),e.jsxs("main",{className:"container mx-auto px-4 py-12",children:[(o==null?void 0:o.subscribed)&&e.jsx("div",{className:"max-w-2xl mx-auto mb-8",children:e.jsx(U,{className:"border-primary/50 bg-primary/5",children:e.jsx(ye,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Current Plan"}),e.jsxs("p",{className:"text-2xl font-bold capitalize",children:[o.tier," Plan"]}),o.subscription_end&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Renews on ",new Date(o.subscription_end).toLocaleDateString()]})]}),e.jsx(W,{className:"bg-primary/20 text-primary border-0",children:"Active"})]})})})}),e.jsxs("div",{className:"text-center space-y-4 mb-12 animate-fade-up",children:[e.jsx("h2",{className:"text-4xl md:text-5xl font-display font-bold",children:o!=null&&o.subscribed?e.jsxs(e.Fragment,{children:["Upgrade Your ",e.jsx("span",{className:"text-gradient",children:"Plan"})]}):e.jsxs(e.Fragment,{children:["Upgrade to ",e.jsx("span",{className:"text-gradient",children:"Unlock Full Power"})]})}),e.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:o!=null&&o.subscribed?"Upgrade to get more features and higher limits.":"Your trial has ended. Choose a plan to continue automating your social engagement."}),e.jsxs("div",{className:"flex items-center justify-center gap-3 pt-2",children:[e.jsx(Tt,{className:"h-5 w-5 text-accent"}),e.jsx("span",{className:"text-muted-foreground",children:"Secure payment powered by Stripe"})]})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-8 max-w-6xl mx-auto",children:x.map((g,v)=>{const b=(o==null?void 0:o.tier)===g.tier;return e.jsxs(U,{className:`relative bg-card/50 backdrop-blur-sm border-border/50 hover:shadow-xl transition-all animate-fade-up ${g.popular?"border-primary shadow-glow scale-105":""} ${b?"ring-2 ring-accent":""}`,style:{animationDelay:`${v*.1}s`},children:[g.popular&&!b&&e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2",children:e.jsx(W,{className:"bg-gradient-to-r from-primary to-accent text-white border-0 px-4 py-1",children:"Most Popular"})}),b&&e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2",children:e.jsx(W,{className:"bg-accent text-accent-foreground border-0 px-4 py-1",children:"Your Plan"})}),e.jsxs(Be,{className:"text-center pb-8 pt-8",children:[e.jsx($e,{className:"text-2xl mb-2",children:g.name}),e.jsxs("div",{className:"mb-2",children:[e.jsx("span",{className:"text-5xl font-bold text-gradient",children:g.price}),g.price!=="Custom"&&e.jsx("span",{className:"text-muted-foreground",children:"/month"})]}),e.jsx(os,{className:"text-base",children:g.description})]}),e.jsxs(ye,{className:"space-y-6",children:[e.jsx("ul",{className:"space-y-3",children:g.features.map((z,C)=>e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-accent mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-foreground",children:z})]},C))}),e.jsx(h,{className:`w-full ${g.popular?"bg-gradient-to-r from-primary to-accent hover:shadow-glow":"border-border/50"}`,variant:g.popular?"default":"outline",size:"lg",disabled:a!==null||b,onClick:()=>
133u(g.tier),children:a===g.tier?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"mr-2 h-4 w-4 animate-spin"}),"Processing..."]}):b?"Current Plan":g.price==="Custom"?"Contact Sales":"Subscribe Now"})]})]},v)})}),e.jsxs("div",{className:"mt-12 text-center space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-center gap-6 text-sm text-muted-foreground flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-accent"}),"Cancel anytime"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Tt,{className:"h-4 w-4 text-accent"}),"Secure payment"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-accent"}),"Instant access"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"All prices in USD. Taxes may apply. By subscribing, you agree to our Terms of Service."})]})]})]})]})},uj=()=>(i.useEffect(()=>{document.title="Terms of Service | DESHILLER";const s=document.querySelector('meta[name="description"]');s&&s.setAttribute("content","Terms of Service for DESHILLER. Read our service terms, user responsibilities, payment terms, and legal agreements.")},[]),e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx(Ya,{}),e.jsx("main",{className:"flex-1",children:e.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-4xl",children:[e.jsx(Vr,{items:[{label:"Home",href:"/"},{label:"Terms of Service"}]}),e.jsxs("article",{className:"mt-8 space-y-8",children:[e.jsxs("header",{className:"space-y-4",children:[e.jsx("h1",{className:"text-4xl md:text-5xl font-display font-bold text-foreground",children:"Terms of Service"}),e.jsx("p",{className:"text-muted-foreground text-lg",children:"Last Updated: January 29, 2025"})]}),e.jsx(U,{className:"p-8 space-y-6 bg-card/50 backdrop-blur",children:e.jsxs("nav",{className:"space-y-2",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Table of Contents"}),e.jsxs("ul",{className:"space-y-2 text-muted-foreground",children:[e.jsx("li",{children:e.jsx("a",{href:"#acceptance",className:"hover:text-primary transition-colors",children:"1. Acceptance of Terms"})}),e.jsx("li",{children:e.jsx("a",{href:"#accounts",className:"hover:text-primary transition-colors",children:"2. User Accounts"})}),e.jsx("li",{children:e.jsx("a",{href:"#service",className:"hover:text-primary transition-colors",children:"3. Service Description"})}),e.jsx("li",{children:e.jsx("a",{href:"#payment",className:"hover:text-primary transition-colors",children:"4. Payment Terms"})}),e.jsx("li",{children:e.jsx("a",{href:"#responsibilities",className:"hover:text-primary transition-colors",children:"5. User Responsibilities"})}),e.jsx("li",{children:e.jsx("a",{href:"#intellectual",className:"hover:text-primary transition-colors",children:"6. Intellectual Property"})}),e.jsx("li",{children:e.jsx("a",{href:"#privacy",className:"hover:text-primary transition-colors",children:"7. Data Privacy"})}),e.jsx("li",{children:e.jsx("a",{href:"#trial",className:"hover:text-primary transition-colors",children:"8. Trial Period & Subscriptions"})}),e.jsx("li",{children:e.jsx("a",{href:"#cancellation",className:"hover:text-primary transition-colors",children:"9. Cancellation & Refunds"})}),e.jsx("li",{children:e.jsx("a",{href:"#liability",className:"hover:text-primary transition-colors",children:"10. Limitation of Liability"})}),e.jsx("li",{children:e.jsx("a",{href:"#disputes",className:"hover:text-primary transition-colors",children:"11. Dispute Resolution"})}),e.jsx("li",{children:e.jsx("a",{href:"#changes",className:"hover:text-primary transition-colors",children:"12. Changes to Terms"})})]})]})}),e.jsxs("section",{id:"acceptance",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"1. Acceptance of Terms"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:'By accessing or using SocialEngage AI ("Service"), you agree to be bound by these Terms of Service ("Terms"). If you disagree with any part of these terms, you may
133not access the Service.'}),e.jsx("p",{children:"These Terms apply to all visitors, users, and others who access or use the Service. By using the Service, you represent that you are at least 18 years old and have the legal capacity to enter into this agreement."})]})]}),e.jsxs("section",{id:"accounts",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"2. User Accounts"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"To use certain features of the Service, you must register for an account. You agree to:"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Provide accurate, current, and complete information during registration"}),e.jsx("li",{children:"Maintain and promptly update your account information"}),e.jsx("li",{children:"Maintain the security of your password and account"}),e.jsx("li",{children:"Accept all responsibility for activities that occur under your account"}),e.jsx("li",{children:"Notify us immediately of any unauthorized use of your account"})]}),e.jsx("p",{children:"We reserve the right to suspend or terminate accounts that violate these Terms or are inactive for extended periods."})]})]}),e.jsxs("section",{id:"service",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"3. Service Description"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"SocialEngage AI provides an automated social media engagement platform that:"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Discovers relevant conversations across X (Twitter), LinkedIn, Reddit, and Facebook"}),e.jsx("li",{children:"Generates AI-powered reply suggestions for user approval"}),e.jsx("li",{children:"Facilitates posting approved replies to connected social media accounts"}),e.jsx("li",{children:"Provides analytics and engagement tracking"})]}),e.jsx("p",{children:"We reserve the right to modify, suspend, or discontinue any part of the Service at any time with or without notice. We are not liable for any modification, suspension, or discontinuance of the Service."})]})]}),e.jsxs("section",{id:"payment",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"4. Payment Terms"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"Certain features of the Service require payment of fees. By using paid features, you agree to:"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Pay all fees associated with your selected subscription tier"}),e.jsx("li",{children:"Provide current, complete, and accurate billing information"}),e.jsx("li",{children:"Authorize automatic recurring charges for subscription renewals"}),e.jsx("li",{children:"Pay all applicable taxes"})]}),e.jsx("p",{children:"All fees are in USD and are non-refundable except as required by law or explicitly stated in these Terms. We reserve the right to change our pricing with 30 days' notice to existing subscribers."})]})]}),e.jsxs("section",{id:"responsibilities",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"5. User Responsibilities"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"You agree not to:"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Use the Service for any illegal or unauthorized purpose"}),e.jsx("li",{children:"Violate any laws in your jurisdiction"}),e.jsx("li",{children:"Post spam, harassment, or abusive content through the Service"}),e.jsx("li",{children:"Impersonate any person or entity"}),e.jsx("li",{children:"Interfere with or disrupt the Service or servers"}),e.jsx("li",{children:"Attempt to gain unauthorized access to any part of the Service"}),e.jsx("li",{children:"Use the Service to violate third-party social media platform terms"}),e.jsx("li",{children:"Share your account credentials with others"}),e.jsx("li",{children:"Use automated scripts or bots beyond the Service's intended functionality"})]}
133),e.jsx("p",{children:"You are solely responsible for all content posted through your account and compliance with third-party platform policies."})]})]}),e.jsxs("section",{id:"intellectual",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"6. Intellectual Property"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"The Service and its original content, features, and functionality are owned by SocialEngage AI and are protected by international copyright, trademark, patent, trade secret, and other intellectual property laws."}),e.jsx("p",{children:"You retain all rights to content you create using the Service. By using the Service, you grant us a limited, non-exclusive license to use, store, and process your content solely to provide the Service."}),e.jsx("p",{children:"AI-generated reply suggestions become your property once generated, but you acknowledge they are created using our proprietary AI technology and algorithms."})]})]}),e.jsxs("section",{id:"privacy",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"7. Data Privacy"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsxs("p",{children:["Your privacy is important to us. Our collection and use of personal information is described in our"," ",e.jsx(Ls,{to:"/privacy",className:"text-primary hover:underline",children:"Privacy Policy"}),", which is incorporated into these Terms by reference."]}),e.jsx("p",{children:"By using the Service, you consent to our collection, use, and sharing of your information as described in the Privacy Policy."})]})]}),e.jsxs("section",{id:"trial",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"8. Trial Period & Subscriptions"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"We offer a 24-hour free trial period for new users. During the trial:"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"You have full access to features available in your selected tier"}),e.jsx("li",{children:"No payment is required during the trial period"}),e.jsx("li",{children:"The trial begins immediately upon account creation"}),e.jsx("li",{children:"After 24 hours, access is restricted until payment is provided"})]}),e.jsx("p",{children:"Subscription billing begins after the trial period ends. You will be charged according to your selected plan (monthly or annually). Subscriptions automatically renew unless canceled before the renewal date."})]})]}),e.jsxs("section",{id:"cancellation",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"9. Cancellation & Refunds"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"You may cancel your subscription at any time from your account settings. Upon cancellation:"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"You retain access until the end of your current billing period"}),e.jsx("li",{children:"No refunds are provided for partial months or unused time"}),e.jsx("li",{children:"Your data is retained for 90 days after cancellation"}),e.jsx("li",{children:"You may reactivate your account during the 90-day retention period"})]}),e.jsx("p",{children:"Refunds may be provided at our sole discretion in cases of Service failure, billing errors, or as required by law. Refund requests must be submitted within 7 days of the charge."})]})]}),e.jsxs("section",{id:"liability",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"10. Limitation of Liability"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"TO THE MAXIMUM EXTENT PERMITTED BY LAW, SOCIALENGAGE AI SHALL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR ANY LOSS OF PROFITS OR REVENUES, WHETHER INCURRED DIRECTLY OR INDIRECTLY, OR ANY LOSS OF DATA, USE, GOODWILL, OR OTHER INTANGIBLE LOSSES."}),e.jsx("p",{children:'The Service is provided "as is" and "as available" without warranties of any kind, either express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, or non-infringement.'}),e.jsx("p",{children:"Our total liability to you for all claims arising from or related to the Service shall not exceed the amount you paid us in the 12 months preceding the claim."})]})]}),e.jsxs("section",{id:"disputes",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"11. Dispute Resolution"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"Any disputes arising from these Terms or the Service shall be resolved through binding arbitration in accordance with the rules of the American Arbitration Association."}),e.jsx("p",{children:"You agree to first contact us to attempt to resolve any disputes informally. If we cannot resolve the dispute within 30 days, either party may initiate arbitration."}),e.jsx("p",{children:"These Terms shall be governed by the laws of the State of Delaware, without regard to its conflict of law provisions."})]})]}),e.jsxs("section",{id:"changes",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"12. Changes to Terms"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"We reserve the right to modify these Terms at any time. We will notify users of material changes via email or through the Service at least 30 days before they take effect."}),e.jsx("p",{children:"Your continued use of the Service after changes take effect constitutes acceptance of the revised Terms. If you do not agree to the new terms, you must stop using the Service."})]})]}),e.jsx("section",{className:"mt-12 pt-8 border-t border-border",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-2xl font-display font-semibold text-foreground",children:"Contact Information"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["For questions about these Terms of Service, please contact our legal team at"," ",e.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"})]}),e.jsxs("div",{className:"flex gap-4 pt-4",children:[e.jsx(Ls,{to:"/",className:"text-primary hover:underline",children:"Back to Home"}),e.jsx("span",{className:"text-muted-foreground",children:"â¢"}),e.jsx(Ls,{to:"/privacy",className:"text-primary hover:underline",children:"Privacy Policy"})]})]})})]})]})}),e.jsx(_s,{})]})),hj=()=>(i.useEffect(()=>{document.title="Privacy Policy | DESHILLER";const s=document.querySelector('meta[name="description"]');s&&s.setAttribute("content","Privacy Policy for DESHILLER. Learn how we
133collect, use, and protect your data with GDPR compliance and industry-leading security.")},[]),e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx(Ya,{}),e.jsx("main",{className:"flex-1",children:e.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-4xl",children:[e.jsx(Vr,{items:[{label:"Home",href:"/"},{label:"Privacy Policy"}]}),e.jsxs("article",{className:"mt-8 space-y-8",children:[e.jsxs("header",{className:"space-y-4",children:[e.jsx("h1",{className:"text-4xl md:text-5xl font-display font-bold text-foreground",children:"Privacy Policy"}),e.jsx("p",{className:"text-muted-foreground text-lg",children:"Last Updated: January 29, 2025"})]}),e.jsxs(U,{className:"p-8 bg-primary/5 border-primary/20 space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"In plain language"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["deSHILLER runs social selling agents on your behalf, so we treat your data and your accounts with extra care. Our extension acts inside your own browser session â we never store, proxy or transmit your social platform passwords. Profile, ICP and engagement data live in our managed backend, encrypted at rest and in transit. You can request deletion at any time. The full legal text is below; for the architecture details, see our ",e.jsx(Ls,{to:"/security",className:"text-primary hover:underline",children:"Safety page"}),"."]})]}),e.jsx(U,{className:"p-8 space-y-6 bg-card/50 backdrop-blur",children:e.jsxs("nav",{className:"space-y-2",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Table of Contents"}),e.jsxs("ul",{className:"space-y-2 text-muted-foreground",children:[e.jsx("li",{children:e.jsx("a",{href:"#collection",className:"hover:text-primary transition-colors",children:"1. Information Collection"})}),e.jsx("li",{children:e.jsx("a",{href:"#usage",className:"hover:text-primary transition-colors",children:"2. How We Use Data"})}),e.jsx("li",{children:e.jsx("a",{href:"#storage",className:"hover:text-primary transition-colors",children:"3. Data Storage & Security"})}),e.jsx("li",{children:e.jsx("a",{href:"#third-party",className:"hover:text-primary transition-colors",children:"4. Third-Party Services"})}),e.jsx("li",{children:e.jsx("a",{href:"#cookies",className:"hover:text-primary transition-colors",children:"5. Cookies & Tracking"})}),e.jsx("li",{children:e.jsx("a",{href:"#rights",className:"hover:text-primary transition-colors",children:"6. Your Rights"})}),e.jsx("li",{children:e.jsx("a",{href:"#retention",className:"hover:text-primary transition-colors",children:"7. Data Retention"})}),e.jsx("li",{children:e.jsx("a",{href:"#california",className:"hover:text-primary transition-colors",children:"8. California Privacy Rights"})}),e.jsx("li",{children:e.jsx("a",{href:"#children",className:"hover:text-primary transition-colors",children:"9. Children's Privacy"})}),e.jsx("li",{children:e.jsx("a",{href:"#updates",className:"hover:text-primary transition-colors",children:"10. Policy Updates"})}),e.jsx("li",{children:e.jsx("a",{href:"#contact",className:"hover:text-primary transition-colors",children:"11. Contact Information"})})]})]})}),e.jsxs("section",{id:"collection",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"1. Information Collection"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"We collect information to provide and improve our services. The types of information we collect include:"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Information You Provide"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account Information:"})," Email address, name, company name, and password"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Profile Data:"})," Product profiles, value propositions, ideal customer descriptions"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Payment Information:"})," Processed securely through Stripe (we do not store credit card numbers)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Platform Credentials:"})," API keys and authentication tokens for connected social media accounts"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Content:"})," Media uploads, product descriptions, and content you create in the platform"]})]}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Automatically Collected Information"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Usage Data:"})," Pages viewed, features used, time spent, and interaction patterns"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Device Information:"})," Browser type, operating system, IP address, device identifiers"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Performance Data:"})," Error logs, crash reports, and diagnostic information"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Engagement Metrics:"})," Posts discovered, replies generated, engagement rates"]})]}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Information from Third Parties"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Social Media Data:"})," Public posts, user profiles, and engagement metrics from connected platforms"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Authentication Providers:"})," Profile information from Google OAuth"]})]})]})]}),e.jsxs("section",{id:"usage",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"2. How We Use Data"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"We use collected information for the following purposes:"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service Delivery:"})," Provide core features including post discovery, AI reply generation, and automated posting"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Personalization:"})," Customize content recommendations and AI-generated replies based on your product profile"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Analytics:"})," Generate engagement reports and provide insights into social media performance"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Communication:"})," Send service updates, security alerts, and subscription notifications"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Security:"})," Detect fraud, prevent abuse, and protect against security threats"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Improvement:"})," Analyze usage patterns to enhance features and develop new capabilities"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Compliance:"})," Meet legal obligations and enforce our Terms of Service"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Support:"})," Respond to inquiries and provide customer assistance"]})]})]})]}),e.jsxs("section",{id:"storage",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"3. Data Storage & Security"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"We implement industry-standard security measures to protect your data:"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Encryption:"})," All data is encrypted in transit using TLS 1.3 and at rest using AES-256"]}
133),e.jsxs("li",{children:[e.jsx("strong",{children:"Infrastructure:"})," Data is stored in secure, SOC 2 Type II certified data centers"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Access Controls:"})," Role-based access with multi-factor authentication for internal systems"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Monitoring:"})," 24/7 security monitoring and automated threat detection"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Backups:"})," Regular automated backups with point-in-time recovery capabilities"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Credential Protection:"})," Social media credentials are encrypted using Supabase Vault"]})]}),e.jsx("p",{children:"While we implement strong security measures, no method of transmission over the internet is 100% secure. We cannot guarantee absolute security but continuously work to protect your information."})]})]}),e.jsxs("section",{id:"third-party",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"4. Third-Party Services"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"We use trusted third-party services to operate our platform:"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Infrastructure Providers"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Supabase:"})," Database, authentication, and backend infrastructure"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Vercel:"})," Application hosting and content delivery"]})]}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Payment Processing"}),e.jsx("ul",{className:"list-disc pl-6 space-y-2",children:e.jsxs("li",{children:[e.jsx("strong",{children:"Stripe:"})," Payment processing and subscription management (PCI DSS compliant)"]})}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Authentication"}),e.jsx("ul",{className:"list-disc pl-6 space-y-2",children:e.jsxs("li",{children:[e.jsx("strong",{children:"Google OAuth:"})," Third-party authentication option"]})}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"AI Services"}),e.jsx("ul",{className:"list-disc pl-6 space-y-2",children:e.jsxs("li",{children:[e.jsx("strong",{children:"Groq (Llama AI):"})," AI-powered reply generation and content analysis using Llama models"]})}),e.jsx("p",{className:"mt-4",children:"These providers have their own privacy policies governing their use of your information. We recommend reviewing their policies to understand how they handle data."})]})]}),e.jsxs("section",{id:"cookies",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"5. Cookies & Tracking"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"We use cookies and similar technologies to improve your experience:"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Essential Cookies"}),e.jsx("p",{children:"Required for authentication, security, and core functionality. These cannot be disabled without affecting service operation."}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Functional Cookies"}),e.jsx("p",{children:"Store preferences like theme settings, dashboard layout, and notification preferences to enhance your experience."}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Analytics Cookies"}),e.jsx("p",{children:"Help us understand how users interact with the platform to improve features and performance. These are optional and can be disabled in your preferences."}),e.jsx("p",{className:"mt-4",children:"You can control cookie preferences through your browser settings. Disabling certain cookies may limit functionality of the Service."})]})]}),e.jsxs("section",{id:"rights",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"6. Your Rights"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"Under GDPR and other privacy regulations, you have the following rights:"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Access & Portability"}),e.jsx("p",{children:"Request a copy of all personal data we hold about you in a machine-readable format. Available through your account settings or by contacting us."}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Rectification"}),e.jsx("p",{children:"Correct inaccurate or incomplete personal data directly in your account settings or by contacting support."}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Deletion"}
133),e.jsx("p",{children:"Request deletion of your personal data. We will delete your data within 30 days, except where retention is required by law or for legitimate business purposes (e.g., financial records)."}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Restriction & Objection"}),e.jsx("p",{children:"Object to certain data processing activities or request restriction of processing under specific circumstances."}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Withdraw Consent"}),e.jsx("p",{children:"Withdraw consent for data processing at any time. This does not affect the lawfulness of processing before withdrawal."}),e.jsxs("p",{className:"mt-4",children:["To exercise these rights, contact our Data Protection Officer at"," ",e.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"})]})]})]}),e.jsxs("section",{id:"retention",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"7. Data Retention"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"We retain your data for as long as necessary to provide the Service and comply with legal obligations:"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Active Accounts:"})," Data retained while your account is active"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Canceled Accounts:"})," Data retained for 90 days after cancellation for potential reactivation"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Financial Records:"})," Payment and billing data retained for 7 years for tax and legal compliance"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Security Logs:"})," Retained for 1 year for security and fraud prevention"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Analytics Data:"})," Aggregated, anonymized usage data retained indefinitely for research"]})]}),e.jsx("p",{children:"After retention periods expire, data is securely deleted or anonymized beyond recognition."})]})]}),e.jsxs("section",{id:"california",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"8. California Privacy Rights (CCPA)"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"California residents have additional rights under the California Consumer Privacy Act (CCPA):"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Right to know what personal information is collected, used, shared, or sold"}),e.jsx("li",{children:"Right to delete personal information held by businesses"}),e.jsx("li",{children:"Right to opt-out of sale of personal information (we do not sell personal information)"}),e.jsx("li",{children:"Right to non-discrimination for exercising CCPA rights"})]}),e.jsxs("p",{children:["To exercise these rights, contact us at"," ",e.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"})," ",'with "CCPA Request" in the subject line.']})]})]}),e.jsxs("section",{id:"children",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"9. Children's Privacy"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"Our Service is not intended for individuals under 18 years of age. We do not knowingly collect personal information from children. If we become aware that we have collected data from a child without parental consent, we will take steps to delete that information promptly."}),e.jsxs("p",{children:["If you believe we have collected information from a child, please contact us immediately at"," ",e.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"})]})]})]}),e.jsxs("section",{id:"updates",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"10. Policy Updates"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"We may update this Privacy Policy periodically to reflect changes in our practices or legal requirements. We will notify you of material changes by:"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Sending an email to your registered email address"}),e.jsx("li",{children:"Displaying a prominent notice in the Service"}),e.jsx("li",{children:'Updating the "Last Updated" date at the top of this policy'})]}),e.jsx("p",{children:"Continued use of the Service after changes take effect constitutes acceptance of the updated policy."})]})]}),e.jsxs("section",{id:"contact",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"11. Contact Information"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"For questions, concerns, or requests regarding this Privacy Policy or our data practices, please contact:"}),e.jsxs("div",{className:"bg-muted/20 rounded-lg p-6 space-y-2 mt-4",children:[e.jsx("p",{children:e.jsx("strong",{children:"Data Protection Officer"})}),e.jsxs("p",{children:["Email: ",e.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"})]}),e.jsx("p",{children:'Subject Line: "Privacy Inquiry"'})]}),e.jsx("p",{className:"mt-6",children:"We will respond to all requests within 30 days as required by applicable privacy laws."})]})]}),e.jsx("section",{className:"mt-12 pt-8 border-t border-border",children:e.jsxs("div",{className:"flex gap-4",children:[e.jsx(Ls,{to:"/",className:"text-primary hover:underline",children:"Back to Home"}),e.jsx("span",{className:"text-muted-foreground",children:"â¢"}),e.jsx(Ls,{to:"/terms",className:"text-primary hover:underline",children:"Terms of Service"})]})})]})]})}),e.jsx(_s,{})]})),pj=()=>(i.useEffect(()=>{document.title="Anti-Spam Policy | DESHILLER";const s=document.querySelector('meta[name="description"]');s&&s.setAttribute("content","DESHILLER Anti-Spam Policy. Learn about platform-specific rules for X (Twitter), LinkedIn, Reddit, and Facebook engagement.")},[]),e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx(Ya,{}),e.jsx("main",{className:"flex-1",children:e.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-4xl",children:[e.jsx(Vr,{items:[{label:"Home",href:"/"},{label:"Anti-Spam Policy"}]}),e.jsxs("article",{className:"mt-8 space-y-8",children:[e.jsxs("header",{className:"space-y-4",children:[e.jsx("h1",{className:"text-4xl md:text-5xl font-display font-bold text-foreground",children:"Anti-Spam Policy"}),e.jsx("p",{className:"text-muted-foreground text-lg",children:"Last Updated: December 4, 2025"})]}),e.jsx(U,{className:"p-6 md:p-8 bg-destructive/10 border-destructive/30",children:e.jsxs("div",{className:"flex gap-4",children:[e.jsx(qt,{className:"h-6 w-6 text-destructive flex-shrink-0 mt-1"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Important Notice"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"By using DESHILLER, you agree to comply with the terms of service and anti-spam policies of each social media platform. Violation of these policies may result in your social media accounts being suspended or banned. DESHILLER is not responsible for any account restrictions resulting from policy violations."})]})]})}),e.jsx(U,{className:"p-6 md:p-8 space-y-6 bg-card/50 backdrop-blur",children:e.jsxs("nav",{className:"space-y-2",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Platform Policies"}),e.jsxs("ul",{className:"space-y-2 text-muted-foreground",children:[e.jsx("li",{children:e.jsxs("a",{href:"#twitter",className:"hover:text-primary transition-colors flex items-center gap-2",children:[e.jsx(rt,{className:"h-4 w-4"}
133)," X (Twitter) Policy"]})}),e.jsx("li",{children:e.jsxs("a",{href:"#linkedin",className:"hover:text-primary transition-colors flex items-center gap-2",children:[e.jsx(Zs,{className:"h-4 w-4"})," LinkedIn Policy"]})}),e.jsx("li",{children:e.jsxs("a",{href:"#reddit",className:"hover:text-primary transition-colors flex items-center gap-2",children:[e.jsx(ms,{className:"h-4 w-4"})," Reddit Policy"]})}),e.jsx("li",{children:e.jsxs("a",{href:"#facebook",className:"hover:text-primary transition-colors flex items-center gap-2",children:[e.jsx(Es,{className:"h-4 w-4"})," Facebook Policy"]})}),e.jsx("li",{children:e.jsx("a",{href:"#general",className:"hover:text-primary transition-colors",children:"General Guidelines"})}),e.jsx("li",{children:e.jsx("a",{href:"#enforcement",className:"hover:text-primary transition-colors",children:"Enforcement"})})]})]})}),e.jsxs("section",{id:"twitter",className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(rt,{className:"h-5 w-5 text-primary"})}),e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"X (Twitter) Policy"})]}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"X (Twitter) has strict policies against spam and platform manipulation. By using DESHILLER for X engagement, you agree to:"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Prohibited Activities"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Posting identical or substantially similar content repeatedly"}),e.jsx("li",{children:"Sending unsolicited bulk direct messages or replies"}),e.jsx("li",{children:"Aggressive following, unfollowing, or engagement patterns"}),e.jsx("li",{children:"Using automation to inflate metrics artificially"}),e.jsx("li",{children:"Coordinated inauthentic behavior with multiple accounts"}),e.jsx("li",{children:"Posting misleading or deceptive content"})]}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Best Practices"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Limit replies to 10-15 per hour maximum"}),e.jsx("li",{children:"Ensure each reply is unique and adds value to the conversation"}),e.jsx("li",{children:"Avoid aggressive promotional language"}),e.jsx("li",{children:"Include breaks between engagement sessions"}),e.jsx("li",{children:"Respond to genuine conversations only"})]}),e.jsx("p",{className:"mt-4",children:e.jsx("a",{href:"https://help.twitter.com/en/rules-and-policies/twitter-rules",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Read X's full Terms of Service â"})})]})]}),e.jsxs("section",{id:"linkedin",className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(Zs,{className:"h-5 w-5 text-primary"})}),e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"LinkedIn Policy"})]}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"LinkedIn is a professional network with strict policies to maintain trust and authenticity. By using DESHILLER for LinkedIn engagement, you agree to:"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Prohibited Activities"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Sending connection requests to people you don't know"}),e.jsx("li",{children:"Using third-party software to automate LinkedIn actions without authorization"}),e.jsx("li",{children:"Scraping or harvesting LinkedIn data"}),e.jsx("li",{children:"Creating fake profiles or impersonating others"}),e.jsx("li",{children:"Posting promotional content disguised as organic content"}),e.jsx("li",{children:"Mass messaging or spamming InMails"})]}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Best Practices"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Limit comments to 5-10 per day"}),e.jsx("li",{children:"Engage only with content relevant to your industry"}),e.jsx("li",{children:"Provide thoughtful, professional responses"}),e.jsx("li",{children:"Avoid direct promotional pitches in comments"}),e.jsx("li",{children:"Build genuine relationships over time"}),e.jsx("li",{children:"Wait for LinkedIn API approval (Share on LinkedIn product) before posting"})]}),e.jsx("p",{className:"mt-4",children:e.jsx("a",{href:"https://www.linkedin.com/legal/professional-community-policies",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Read LinkedIn's Professional Community Policies â"})})]})]}),e.jsxs("section",{id:"reddit",className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(ms,{className:"h-5 w-5 text-primary"})}),e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"Reddit Policy"})]}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:'Reddit has strong community guidelines and the famous "10% rule" for self-promotion. By using DESHILLER for Reddit engagement, you agree to:'}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Prohibited Activities"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Posting primarily self-promotional content (more than 10% of activity)"}),e.jsx("li",{children:"Vote manipulation or brigading"}),e.jsx("li",{children:"Creating multiple accounts to evade bans"}),e.jsx("li",{children:"Spam or repetitive posting across subreddits"}),e.jsx("li",{children:"Violating individual subreddit rules"}),e.jsx("li",{children:"Posting misleading links or content"})]}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Best Practices"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Follow the 10:1 rule (10 helpful comments for every promotional one)"}),e.jsx("li",{children:"Read and follow each subreddit's specific rules"}
133),e.jsx("li",{children:"Contribute genuinely to discussions before promoting"}),e.jsx("li",{children:"Build karma through helpful, non-promotional engagement"}),e.jsx("li",{children:"Disclose affiliations when relevant"}),e.jsx("li",{children:"Respect moderator decisions"})]}),e.jsx("p",{className:"mt-4",children:e.jsx("a",{href:"https://www.redditinc.com/policies/content-policy",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Read Reddit's Content Policy â"})})]})]}),e.jsxs("section",{id:"facebook",className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(Es,{className:"h-5 w-5 text-primary"})}),e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"Facebook Groups Policy"})]}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"Facebook Groups have strict moderation and anti-spam measures. By using DESHILLER for Facebook Group engagement, you agree to:"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Prohibited Activities"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Joining groups solely to promote products or services"}),e.jsx("li",{children:"Posting promotional content without adding value"}),e.jsx("li",{children:"Cross-posting identical content across multiple groups"}),e.jsx("li",{children:"Bypassing group approval processes"}),e.jsx("li",{children:"Creating fake accounts or impersonation"}),e.jsx("li",{children:"Harassing group members or administrators"})]}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"DESHILLER Safeguards"}),e.jsx("p",{children:"DESHILLER implements special protections for Facebook engagement:"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Mandatory warm-up period:"})," 3-5 days before engagement allowed"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Daily limits:"})," Maximum 5 comments/day, 1 post/day, 3 groups/day"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Cooldown timers:"})," 30 minutes between comments, 4 hours between posts"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Trust score system:"})," Gradually unlock capacity as you build reputation"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Spam risk indicators:"})," Real-time warnings when approaching limits"]})]}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mt-6",children:"Best Practices"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Complete the warm-up period before any promotional activity"}),e.jsx("li",{children:"Engage genuinely in discussions before promoting"}),e.jsx("li",{children:"Follow each group's specific posting rules"}),e.jsx("li",{children:"Build relationships with group members and admins"}),e.jsx("li",{children:"Use screenshots and media sparingly (1 in 5 comments)"})]}),e.jsx("p",{className:"mt-4",children:e.jsx("a",{href:"https://www.facebook.com/policies/pages_groups_events",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Read Facebook's Pages, Groups, and Events Policy â"})})]})]}),e.jsxs("section",{id:"general",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"General Guidelines"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"Across all platforms, DESHILLER users must:"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsx("li",{children:"Review and approve all AI-generated content before posting"}),e.jsx("li",{children:"Ensure all engagement is authentic and adds value"}),e.jsx("li",{children:"Respect platform rate limits and guidelines"}),e.jsx("li",{children:"Not use multiple accounts for coordinated activity"}),e.jsx("li",{children:"Immediately stop if receiving platform warnings"}),e.jsx("li",{children:"Report any DESHILLER bugs that could cause policy violations"}),e.jsx("li",{children:"Keep API credentials secure and not share access"})]})]})]}),e.jsxs("section",{id:"enforcement",className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold text-foreground",children:"Enforcement"}),e.jsxs("div",{className:"prose prose-invert max-w-none space-y-4 text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"DESHILLER takes anti-spam compliance seriously. Violations may result in:"}),e.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Warning:"})," First violation results in a warning email"]}
133),e.jsxs("li",{children:[e.jsx("strong",{children:"Temporary Suspension:"})," Repeated violations may result in temporary account suspension"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Permanent Ban:"})," Severe or repeated violations may result in permanent account termination"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"No Refunds:"})," Users banned for policy violations are not eligible for refunds"]})]}),e.jsx("p",{children:"We monitor for suspicious patterns and may proactively disable features to protect users from platform penalties."})]})]}),e.jsx("section",{className:"mt-12 pt-8 border-t border-border",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-2xl font-display font-semibold text-foreground",children:"Questions?"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["For questions about this Anti-Spam Policy, please contact us at"," ",e.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"})]}),e.jsxs("div",{className:"flex flex-wrap gap-4 pt-4",children:[e.jsx(Ls,{to:"/",className:"text-primary hover:underline",children:"Back to Home"}),e.jsx("span",{className:"text-muted-foreground",children:"â¢"}),e.jsx(Ls,{to:"/terms",className:"text-primary hover:underline",children:"Terms of Service"}),e.jsx("span",{className:"text-muted-foreground",children:"â¢"}),e.jsx(Ls,{to:"/privacy",className:"text-primary hover:underline",children:"Privacy Policy"})]})]})})]})]})}),e.jsx(_s,{})]})),gj=({steps:s})=>{var n;const[t,a]=i.useState(((n=s[0])==null?void 0:n.id)??"");i.useEffect(()=>{const l=new IntersectionObserver(c=>{const x=c.filter(d=>d.isIntersecting).sort((d,u)=>u.intersectionRatio-d.intersectionRatio);x[0]&&a(x[0].target.id)},{rootMargin:"-40% 0px -40% 0px",threshold:[0,.25,.5,1]});return s.forEach(c=>{const x=document.getElementById(c.id);x&&l.observe(x)}),()=>l.disconnect()},[s]);const r=Math.max(0,s.findIndex(l=>l.id===t)),o=(r+1)/s.length*100;return e.jsxs("nav",{"aria-label":"Steps progress",className:"hidden lg:flex sticky top-32 self-start flex-col gap-1 pr-8 border-r border-border/60",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground/70 font-mono mb-4 pl-1",children:"Steps"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-[7px] top-1 bottom-1 w-px bg-border","aria-hidden":!0}),e.jsx("div",{className:"absolute left-[7px] top-1 w-px bg-primary transition-all duration-500",style:{height:`calc(${o}% - 4px)`},"aria-hidden":!0}),e.jsx("ul",{className:"space-y-5",children:s.map((l,c)=>{const x=l.id===t,d=c<r;return e.jsx("li",{children:e.jsxs("a",{href:`#${l.id}`,className:"group flex items-center gap-3 text-sm",children:[e.jsx("span",{className:`relative z-10 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full border transition-all duration-300 ${x?"border-primary bg-primary scale-125 shadow-[0_0_0_4px_hsl(var(--primary)/0.15)]":d?"border-primary bg-primary/70":"border-border bg-background"}`}),e.jsxs("span",{className:`font-mono text-xs transition-colors ${x?"text-foreground":"text-muted-foreground group-hover:text-foreground"}`,children:[String(c+1).padStart(2,"0"),e.jsx("span",{className:"mx-1.5 opacity-40",children:"/"}),e.jsx("span",{className:"font-sans",children:l.label})]})]})},l.id)})})]})]})},fj=[{icon:Zs,color:"#0A66C2",author:"Maria Chen, VP Sales",text:"Anyone using something better than Outreach for sequence reporting?"},{icon:St,color:"#FF4500",author:"r/SaaS",text:"Looking for a Salesloft alternative that doesn't cost a kidney"},{icon:rt,color:"#1DA1F2",author:"@devon_pm",text:"Honestly the worst part of HubSpot is the workflow builder"},{icon:Zs,color:"#0A66C2",author:"Jordan Pak, Founder",text:"Hiring an SDR or buying tooling â what would you do at <10 ARR?"},{icon:Wt,color:"#1877F2",author:"B2B Founders Group",text:"What's everyone using for inbound lead routing these days?"},{icon:rt,color:"#1DA1F2",author:"@growth_kira",text:"Pipedrive vs Attio in 2026 â go"}],cl=({keyPrefix:s})=>e.jsx(e.Fragment,{children:fj.map((t,a)=>{const r=t.icon;return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 rounded-full border border-border/70 bg-card/40 backdrop-blur-sm shrink-0",children:[e.jsx(r,{className:"w-3.5 h-3.5 shrink-0",style:{color:t.color}}),e.jsx("span",{className:"text-xs font-medium text-foreground whitespace-nowrap",children:t.author}),e.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:['"',t.text,'"']}),e.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-primary/80 whitespace-nowrap",children:"buying signal"})]},`${s}-${a}
133`)})}),bj=()=>e.jsx("div",{className:"relative w-full overflow-hidden marquee-pause [mask-image:linear-gradient(to_right,transparent,black_8%,black_92%,transparent)]",children:e.jsxs("div",{className:"flex gap-3 marquee-track w-max",children:[e.jsx(cl,{keyPrefix:"a"}),e.jsx(cl,{keyPrefix:"b"})]})}),jj=[{icon:rt,color:"#1DA1F2",name:"X (Twitter)",handle:"@deshiller_io",status:"Connected",count:"2 accounts"},{icon:Zs,color:"#0A66C2",name:"LinkedIn",handle:"deSHILLER",status:"Connected",count:"1 account"},{icon:St,color:"#FF4500",name:"Reddit",handle:"u/deshiller",status:"Connected",count:"1 account"},{icon:Wt,color:"#1877F2",name:"Facebook",handle:"12 groups",status:"Connected",count:"12 groups"}],yj=()=>e.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden shadow-large",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border bg-card/60",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-destructive/70"}),e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-primary/70"}),e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-accent/70"})]}),e.jsx("span",{className:"text-[11px] font-mono text-muted-foreground",children:"settings / connections"}),e.jsx("span",{})]}),e.jsxs("ul",{className:"divide-y divide-border",children:[jj.map(s=>{const t=s.icon;return e.jsxs("li",{className:"flex items-center gap-3 px-4 py-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-md bg-background border border-border flex items-center justify-center shrink-0",children:e.jsx(t,{className:"w-4 h-4",style:{color:s.color}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:s.handle})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-accent opacity-60"}),e.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-accent"})]}),e.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wide text-accent",children:s.status})]})]},s.name)}),e.jsxs("li",{className:"flex items-center gap-3 px-4 py-3 text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors cursor-pointer",children:[e.jsx("div",{className:"w-9 h-9 rounded-md border border-dashed border-border flex items-center justify-center shrink-0",children:e.jsx(ft,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-sm",children:"Add another account"})]})]})]}),Jd=(s={})=>{const{threshold:t=.1,rootMargin:a="0px 0px -100px 0px",triggerOnce:r=!0}=s,o=i.useRef(null),[n,l]=i.useState(!1);return i.useEffect(()=>{const c=new IntersectionObserver(([x])=>{x.isIntersecting?(l(!0),r&&o.current&&c.unobserve(o.current)):r||l(!1)},{threshold:t,rootMargin:a});return o.current&&c.observe(o.current),()=>{o.current&&c.unobserve(o.current)}},[t,a,r]),{ref:o,isVisible:n}},vj=[{icon:Zs,color:"#0A66C2",author:"Maria Chen",role:"VP Sales · Series B SaaS",snippet:["Anyone using something better than ","Outreach"," for sequence reporting? The current dashboards are killing my team."],score:94,tag:"competitor mention"},{icon:St,color:"#FF4500",author:"r/SaaS",role:"thread · 38 comments",snippet:["Looking for a ","Salesloft alternative"," that doesn't cost a kidney. Need solid email + LinkedIn sequencing."],score:91,tag:"buying intent"},{icon:rt,color:"#1DA1F2",author:"@devon_pm",role:"PM at fintech · 4.1k followers",snippet:["Honestly the worst part of ","HubSpot"," is the workflow builder. Every other tool ate their lunch."],score:78,tag:"pain point"}],Nj=()=>{const{ref:s,isVisible:t}=Jd({threshold:.2});return e.jsxs("div",{ref:s,className:"rounded-xl border border-border bg-card overflow-hidden shadow-large",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-border bg-card/60",children:[e.jsx(Ks,{className:"w-3.5 h-3.5 text-muted-foreground"}),e.jsx("span",{className:"text-[11px] font-mono text-muted-foreground",children:"listening · 6 channels · live"}),e.jsxs("span",{className:"ml-auto inline-flex items-center gap-1.5 text-[11px] font-mono text-accent",children:[e.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-accent opacity-60"}),e.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-accent"})]}),"12 new"]})]}),e.jsx("ul",{className:"divide-y divide-border",children:vj.map((a,r)=>
133{const o=a.icon;return e.jsx("li",{className:`px-4 py-3.5 transition-all duration-500 ${t?"opacity-100 translate-y-0":"opacity-0 translate-y-3"}`,style:{transitionDelay:`${r*120}ms`},children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-background border border-border flex items-center justify-center shrink-0",children:e.jsx(o,{className:"w-3.5 h-3.5",style:{color:a.color}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[e.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.author}),e.jsx("span",{className:"text-[11px] text-muted-foreground truncate",children:a.role})]}),e.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:[a.snippet[0],e.jsx("mark",{className:"bg-primary/20 text-primary px-1 rounded-sm font-medium",children:a.snippet[1]}),a.snippet[2]]}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-primary/10 text-primary text-[10px] font-mono font-semibold",children:[a.score,"% match"]}),e.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-muted-foreground",children:a.tag})]})]})]})},r)})})]})},wj=({text:s,speed:t=18,startDelay:a=200,className:r=""})=>{const[o,n]=i.useState(""),[l,c]=i.useState(!1),x=i.useRef(null);i.useEffect(()=>{const u=x.current;if(!u)return;const m=new IntersectionObserver(p=>{var g;(g=p[0])!=null&&g.isIntersecting&&(c(!0),m.disconnect())},{threshold:.4});return m.observe(u),()=>m.disconnect()},[]),i.useEffect(()=>{if(!l)return;let u=0,m;const p=window.setTimeout(()=>{m=window.setInterval(()=>{u+=1,n(s.slice(0,u)),u>=s.length&&m!==void 0&&window.clearInterval(m)},t)},a);return()=>{window.clearTimeout(p),m!==void 0&&window.clearInterval(m)}},[l,s,t,a]);const d=o.length>=s.length;return e.jsxs("span",{ref:x,className:r,children:[o,!d&&e.jsx("span",{className:"caret-blink ml-0.5 inline-block w-[2px] h-[1em] align-[-0.15em] bg-primary"})]})},dl="Outreach's reporting felt like that for us too â we ended up routing buying signals from social into a lighter workflow tool. Happy to share the setup if useful.",kj=()=>e.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden shadow-large",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-border bg-card/60",children:[e.jsx(Zs,{className:"w-3.5 h-3.5",style:{color:"#0A66C2"}}),e.jsx("span",{className:"text-[11px] font-mono text-muted-foreground",children:"drafting reply · linkedin · maria chen"}),e.jsxs("span",{className:"ml-auto inline-flex items-center gap-1 text-[11px] font-mono text-primary",children:[e.jsx(es,{className:"w-3 h-3"})," ai draft"]})]}),e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted text-muted-foreground text-[10px] font-mono uppercase tracking-wider",children:"tone: helpful"}),e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted text-muted-foreground text-[10px] font-mono uppercase tracking-wider",children:"length: short"}),e.jsxs("span",{className:"ml-auto text-[10px] font-mono text-muted-foreground tabular-nums",children:[dl.length,"/600"]})]}),e.jsx("div",{className:"rounded-lg bg-background border border-border p-3.5 min-h-[120px]",children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:e.jsx(wj,{text:dl})})}),e.jsxs("div",{className:"flex gap-2 pt-1",children:[e.jsxs(h,{size:"sm",className:"flex-1",children:[e.jsx(At,{className:"w-3 h-3 mr-1.5"}),"Approve & post"]}),e.jsx(h,{size:"sm",variant:"outline",className:"flex-1",children:"Edit"}),e.jsx(h,{size:"sm",variant:"ghost",className:"text-muted-foreground",children:"Skip"})]})]})]}),ml=[{day:"Day 0",icon:At,label:"Initial reply",channel:"LinkedIn",state:"done"},{day:"Day 3",icon:St,label:"DM follow-up",channel:"Soft check-in",state:"done"},{day:"Day 7",icon:Fs,label:"Email touch",channel:"Queued · sending",state:"active"},{day:"Day 14",icon:Cs,label:"Final nudge",channel:"Auto-stop on reply",state:"future"}],Sj=()=>e.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden shadow-large",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-border bg-card/60",children:[e.jsx("span",{className:"text-[11px] font-mono text-muted-foreground",children:"sequence · maria chen · linkedin â email"}),e.jsx("span",{className:"ml-auto text-[11px] font-mono text-accent",children:"2/4 sent"})]}),e.jsx("div",{className:"hidden md:block p-6",children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-0 right-0 top-4 h-px bg-border","aria-hidden":!0}),e.jsx("div",{className:"absolute left-0 top-4 h-px bg-primary",style:{width:"62%"},"aria-hidden":!0}),e.jsx("ol",{className:"grid grid-cols-4 gap-2 relative",children:ml.map(s=>{const t=s.icon,a=s.state==="done",r=s.state==="active";return e.jsxs("li",{className:"flex flex-col items-center text-center",children:[e.jsx("div",{className:`relative z-10 w-8 h-8 rounded-full flex items-center justify-center border-2 transition-all ${a?"bg-primary border-primary text-primary-foreground":r?"bg-card border-primary text-primary shadow-[0_0_0_4px_hsl(var(--primary)/0.18)]":"bg-card border-border text-muted-foreground"} ${r?"animate-pulse":""}`,children:a?e.jsx(ys,{className:"w-4 h-4"}):e.jsx(t,{className:"w-3.5 h-3.5"})}),e.jsxs("div",{className:"mt-3 space-y-0.5",children:[e.jsx("div",{className:"text-[10px] font-mono uppercase tracking-wider text-muted-foreground",children:s.day}),e.jsx("div",{className:`text-xs font-medium ${r||a?"text-foreground":"text-muted-foreground"}`,children:s.label}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:s.channel})]})]},s.day)})})]})}),e.jsx("ul",{className:"md:hidden divide-y divide-border",children:ml.map(s=>{const t=s.icon,a=s.state==="done",r=s.state==="active";return e.jsxs("li",{className:"flex items-center gap-3 px-4 py-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center border-2 ${a?"bg-primary border-primary text-primary-foreground":r?"bg-card border-primary text-primary":"bg-card border-border text-muted-foreground"}`,children:a?e.jsx(ys,{className:"w-4 h-4"}):e.jsx(t,{className:"w-3.5 h-3.5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"text-xs font-medium text-foreground",children:[s.day," â ",s.label]}),e.jsx("div",{className:"text-[11px] text-muted-foreground",children:s.channel})]})]},s.day)})})]}),Cj=[0,1,2,1,0,0,3,2,1,1,0,2,1,0],_j=["S","M","T","W","T","F","S","S","M","T","W","T","F","S"],xl=s=>s===0?"bg-muted/30":s===1?"bg-primary/25":s===2?"bg-primary/55":"bg-primary",Tj=()=>e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden shadow-large",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border bg-card/60",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(or,{className:"w-3.5 h-3.5 text-primary"}),e.jsx("span",{className:"text-[11px] font-mono text-muted-foreground",children:"sequence settings · saas-vp-sales"})]}),e.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider px-2 py-0.5 rounded-full bg-accent/15 text-accent",children:"active"})]}),e.jsxs("div",{className:"p-4 space-y-3.5",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground font-mono uppercase tracking-wider text-[10px]",children:"cadence"}),e.jsx("span",{className:"text-foreground font-medium",children:"Day 0 · 3 · 7 · 14"})]}),e.jsx("div",{className:"h-1 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:"h-full w-[62%] bg-primary"})})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground font-mono uppercase tracking-wider text-[10px]",children:"channels"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("span",{className:"px-2 py-0.5 rounded bg-muted text-foreground text-[11px]",children:"Comment"}),e.jsx("span",{className:"px-2 py-0.5 rounded bg-muted text-foreground text-[11px]",children:"DM"}),e.jsx("span",{className:"px-2 py-0.5 rounded bg-muted text-foreground text-[11px]",children:"Email"})]})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground font-mono uppercase tracking-wider text-[10px]",children:"stop on"}),e.jsx("span",{className:"text-foreground font-medium",children:"Reply · Book · Opt-out"})]}),e.jsxs("div",{className:"flex gap-2 pt-1 border-t border-border",children:[e.jsxs(h,{size:"sm",variant:"outline",className:"flex-1",children:[e.jsx(Di,{className:"w-3 h-3 mr-1.5"})," Edit"]}),e.jsxs(h,{size:"sm",variant:"outline",className:"flex-1",children:[e.jsx(Uc,{className:"w-3 h-3 mr-1.5"})," Pause"]})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden shadow-medium",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border bg-card/60",children:[e.jsx("span",{className:"text-[11px] font-mono text-muted-foreground",children:"scheduled · next 14 days"}),e.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:"18 touches"})]}),e.jsxs("div",{className:"p-4",children:[e.jsx("div",{className:"grid grid-cols-7 gap-1.5",children:Cj.map((s,t)=>e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:`w-full aspect-square rounded-sm ${xl(s)} transition-colors`,title:`${s} touches`}),e.jsx("span",{className:"text-[9px] font-mono text-muted-foreground",children:_j[t]})]},t))}),e.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-3 text-[10px] font-mono text-muted-foreground",children:[e.jsx("span",{children:"less"}),[0,1,2,3].map(s=>e.jsx("span",{className:`w-2.5 h-2.5 rounded-sm ${xl(s)}`},s)),e.jsx("span",{children:"more"})]})]})]})]}
133),Tr=({id:s,index:t,total:a,eyebrow:r,title:o,description:n,bullets:l,mock:c,reverse:x})=>e.jsxs("section",{id:s,className:"scroll-mt-32 relative",children:[e.jsx("div",{className:"absolute inset-x-0 -top-px h-px bg-gradient-to-r from-transparent via-border to-transparent"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-10 lg:gap-16 items-center py-16 md:py-24",children:[e.jsxs("div",{className:`space-y-5 ${x?"md:order-2":""}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"font-mono text-xs text-primary tabular-nums",children:[String(t).padStart(2,"0"),e.jsx("span",{className:"mx-1.5 text-muted-foreground/50",children:"/"}),String(a).padStart(2,"0")]}),e.jsx("span",{className:"text-[10px] font-mono uppercase tracking-[0.18em] text-muted-foreground",children:r})]}),e.jsx("h2",{className:"font-display text-3xl md:text-4xl font-semibold text-foreground leading-tight tracking-tight text-balance",children:o}),e.jsx("p",{className:"text-base md:text-lg text-muted-foreground leading-relaxed max-w-prose",children:n}),e.jsx("ul",{className:"space-y-2.5 pt-2",children:l.map((d,u)=>{const m=d.icon;return e.jsxs("li",{className:"flex items-start gap-3 text-sm text-muted-foreground",children:[e.jsx(m,{className:"w-4 h-4 text-primary mt-0.5 shrink-0"}),e.jsx("span",{className:"leading-relaxed",children:d.text})]},u)})})]}),e.jsx("div",{className:x?"md:order-1":"",children:c})]})]}),Aj=[{id:"step1",label:"Connect"},{id:"step2",label:"Discover"},{id:"step3",label:"Reply"},{id:"step4",label:"Follow up"},{id:"step5",label:"Control"}],Ij=()=>(i.useEffect(()=>{document.title="How deSHILLER works | Listening agents, reply agents, workflows";const s=document.querySelector('meta[name="description"]');s&&s.setAttribute("content","How deSHILLER turns buying signals into pipeline: listening agents detect intent across 6 channels, reply agents respond on-brand through your own browser, workflows route everything into your CRM.");const t=document.createElement("script");return t.type="application/ld+json",t.text=JSON.stringify({"@context":"https://schema.org","@type":"HowTo",name:"How to Automate Social Media Engagement with SocialEngage AI",description:"A comprehensive guide to automating social media engagement across X, LinkedIn, Reddit, and Facebook",step:[{"@type":"HowToStep",position:1,name:"Connect Your Platforms",text:"Add your X (Twitter), LinkedIn, Reddit, and Facebook accounts with secure API credentials",url:"https://socialengage.ai/how-it-works#step1"},{"@type":"HowToStep",position:2,name:"AI Discovers Relevant Conversations",text:"Our AI algorithm discovers relevant posts based on your keywords, competitors, and ideal customer profile",url:"https://socialengage.ai/how-it-works#step2"},{"@type":"HowToStep",position:3,name:"Generate & Send Authentic Replies",text:"Review AI-generated replies and approve them before posting to maintain authenticity",url:"https://socialengage.ai/how-it-works#step3"},{"@type":"HowToStep",position:4,name:"Follow Up Automatically",text:"Multi-touch follow-up sequences re-engage prospects across channels until they reply, book, or opt out",url:"https://socialengage.ai/how-it-works#step4"},{"@type":"HowToStep",position:5,name:"Configure & Control Follow-Up Sequences",text:"Define cadence, channels, message tone, and stop conditions for every follow-up sequence â pause, edit, or override any touch before it sends",url:"https://socialengage.ai/how-it-works#step5"}]}),document.head.appendChild(t),()=>{document.head.removeChild(t)}},[]),e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx(Ya,{}),e.jsxs("main",{className:"flex-1",children:[e.jsxs("section",{className:"relative overflow-hidden border-b border-border",children:[e.jsx("div",{className:"absolute inset-0 bg-dot-grid opacity-40 [mask-image:radial-gradient(ellipse_at_center,black_30%,transparent_75%)]"}),e.jsxs("div",{className:"relative container mx-auto max-w-6xl px-4 pt-16 pb-12 md:pt-24 md:pb-16",children:[e.jsx(Vr,{items:[{label:"Home",href:"/"},{label:"How It Works"}]}),e.jsx("div",{className:"mt-6 flex items-center gap-2",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full border border-border bg-card/40 text-[10px] font-mono uppercase tracking-[0.16em] text-muted-foreground",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary"}),"Product · How it works"]})}),e.jsxs("h1",{className:"mt-5 font-display text-4xl md:text-5xl lg:text-6xl font-semibold leading-[1.05] tracking-tight text-foreground max-w-4xl text-balance",children:["Listening agents. Reply agents. ",e.jsx("span",{className:"text-primary",children:"Workflows."})]}),e.jsx("p",{className:"mt-5 text-base md:text-lg text-muted-foreground leading-relaxed max-w-2xl",children:"deSHILLER is structured as three layers: agents that listen for buying signals, agents that respond on-brand through your own browser session, and workflows that route everything into your pipeline."}),e.jsxs("div",{className:"mt-10 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 px-1",children:[e.jsx("span",{className:"text-[10px] font-mono uppercase tracking-[0.18em] text-muted-foreground",children:"Live signal feed"}),e.jsx("span",{className:"flex-1 h-px bg-border"}),e.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:"streaming"})]}),e.jsx(bj,{})]})]})]}),e.jsx("section",{className:"py-12 md:py-20",children:e.jsx("div",{className:"container mx-auto max-w-6xl px-4",children:e.jsxs("div",{className:"grid lg:grid-cols-[200px_1fr] gap-12",children:[e.jsx(gj,{steps:Aj}),e.jsxs("div",{children:[e.jsx(Tr,{id:"step1",index:1,total:5,eyebrow:"Connect",title:"Connect your platforms",description:"Securely connect your social accounts in a few clicks. We support every channel where your buyers actually hang out â and posting always runs through your own browser session.",bullets:[{icon:ys,text:"X, LinkedIn, Reddit, Facebook groups, YouTube and Quora"},{icon:ys,text:"No re-auth pop-ups: actions run inside your existing session via the extension"},{icon:ys,text:"Multi-account support â connect personal + brand profiles"}],mock:e.jsx(yj,{})}),e.jsx(Tr,{id:"step2",index:2,total:5,eyebrow:"Discover",title:"Find conversations worth joining",description:"Listening agents continuously scan posts, threads, and comments across six channels â surfacing only the ones where your product or expertise can add real value.",reverse:!0,bullets:[{icon:Ks,text:"Tracks competitors, alternatives, pain points and ICP keywords"},{icon:es,text:"Each match scored for relevance with a one-line explanation"},{icon:ys,text:"Dedupes against anything already in your engagement queue"}],mock:e.jsx(Nj,{})}
133),e.jsx(Tr,{id:"step3",index:3,total:5,eyebrow:"Reply",title:"Draft authentic replies, on your terms",description:"Reply agents draft a response that matches the platform, the thread, and your brand voice. You review, edit, and approve â every reply runs through your own browser, so it looks exactly like you posted it.",bullets:[{icon:es,text:"Tone adapted per platform â casual on X, professional on LinkedIn"},{icon:ys,text:"Natural product mentions only when they fit the conversation"},{icon:At,text:"Approve, edit, or skip in a single keystroke"}],mock:e.jsx(kj,{})}),e.jsx(Tr,{id:"step4",index:4,total:5,eyebrow:"Follow up",title:"Re-engage prospects automatically",description:"Most replies get lost in the noise. The follow-up engine sequences multi-touch outreach across comments, DMs and email until a prospect replies, books, or opts out. No spreadsheets, no manual chasing.",reverse:!0,bullets:[{icon:ou,text:"Cadence tuned per channel â comment, DM, then email"},{icon:Cs,text:"Smart timing windows that respect platform limits and timezones"},{icon:ys,text:"Auto-stops the moment a prospect replies, books, or opts out"}],mock:e.jsx(Sj,{})}),e.jsx(Tr,{id:"step5",index:5,total:5,eyebrow:"Control",title:"Stay in control of every sequence",description:"Follow-ups never run on autopilot without your rules. Define cadence, channels, tone, and stop conditions per sequence â then pause, edit, or skip any individual touch before it goes out.",bullets:[{icon:lu,text:"Cadence and delays per touch, from same-day to multi-week drips"},{icon:or,text:"Channel order â comment, DM, email â and which to skip per persona"},{icon:Di,text:"Edit any AI-drafted touch before it sends, or replace it entirely"},{icon:Uc,text:"Pause a single prospect, an entire sequence, or all outbound at once"}],mock:e.jsx(Tj,{})})]})]})})}),e.jsx("section",{className:"py-20 px-4 border-t border-border",children:e.jsxs("div",{className:"container mx-auto max-w-6xl",children:[e.jsxs("div",{className:"flex items-end justify-between flex-wrap gap-4 mb-10",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] font-mono uppercase tracking-[0.18em] text-muted-foreground",children:"Built for"}),e.jsx("h2",{className:"mt-2 font-display text-3xl md:text-4xl font-semibold text-foreground tracking-tight",children:"Teams that live in conversations"})]}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:"Three shapes of go-to-market motion, one underlying engine."})]}),e.jsx("div",{className:"grid md:grid-cols-3 divide-y md:divide-y-0 md:divide-x divide-border border-y border-border",children:[{icon:fa,tag:"B2B SaaS",title:"Capture buying intent",body:"Respond to users evaluating competitors or describing pain points your product solves. Build authority where the decision actually happens."},{icon:Es,tag:"Founders & creators",title:"Show up in the right threads",body:"Engage in relevant discussions with genuine expertise. Grow audience and pipeline at the same time without the daily grind."},{icon:Sr,tag:"Agencies",title:"Scale across clients",body:"Manage multiple client accounts from one dashboard. Scale social engagement without scaling headcount, and prove the ROI."}].map(s=>{const t=s.icon;return e.jsxs("div",{className:"p-6 md:p-8 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"text-[10px] font-mono uppercase tracking-[0.16em] text-muted-foreground",children:s.tag})]}),e.jsx("h3",{className:"font-display text-xl font-semibold text-foreground tracking-tight",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:s.body})]},s.tag)})})]})}),e.jsx("section",{className:"py-20 px-4 border-t border-border",children:e.jsxs("div",{className:"container mx-auto max-w-3xl",children:[e.jsxs("div",{className:"mb-10",children:[e.jsx("span",{className:"text-[10px] font-mono uppercase tracking-[0.18em] text-muted-foreground",children:"FAQ"}),e.jsx("h2",{className:"mt-2 font-display text-3xl md:text-4xl font-semibold text-foreground tracking-tight",children:"Questions, answered"})]}),e.jsx(ad,{type:"single",collapsible:!0,className:"border-t border-border",children:[{q:"How does the AI discover relevant posts?",a:"Listening agents use language models to read posts across six channels. They weigh your product profile, keywords, competitor mentions and ICP description to surface conversations where your input would actually be valuable. Each suggestion includes a relevance score and a one-line explanation."},{q:"Do replies sound like AI or human?",a:"Replies are written to sound like you â short, contextual, and on the right register for the platform (casual on X and Reddit, professional on LinkedIn). They focu
133s on adding value rather than pitching. You can edit any reply before it goes out."},{q:"Are my credentials secure?",a:"Posting runs through your own browser session via the extension, so we never need to store your platform passwords. Anything we do hold is encrypted with AES-256 in Supabase Vault, and all transit uses TLS 1.3."},{q:"Can I customize the AI's behavior?",a:"Yes. You build a product profile with value prop, ideal customer, tone guidelines and common objections. You also set discovery preferences â keywords, competitor names, hashtags, subreddits. The system gets sharper as it learns from what you approve."},{q:"What if I want to edit a reply before posting?",a:"Every reply requires explicit approval. You can edit the text, swap the tone, add or remove product mentions, or reject entirely. You stay fully in control of what gets posted from your accounts."},{q:"Does this work for Facebook groups?",a:"Yes, with extra safeguards. Facebook integration includes mandatory warm-up periods, trust-score based capacity unlocks, and strict daily limits. You build group-level trust gradually before increasing engagement frequency."}].map((s,t)=>e.jsxs(qi,{value:`item-${t}`,className:"border-b border-border px-0 py-1",children:[e.jsx(Hi,{className:"text-base font-medium text-foreground hover:text-primary text-left",children:s.q}),e.jsx(Gi,{className:"text-sm text-muted-foreground leading-relaxed",children:s.a})]},t))})]})}),e.jsx("section",{className:"py-20 px-4 border-t border-border",children:e.jsx("div",{className:"container mx-auto max-w-4xl",children:e.jsxs("div",{className:"rounded-2xl border border-border bg-card/40 p-8 md:p-12 relative overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-dot-grid opacity-30 [mask-image:radial-gradient(ellipse_at_top_right,black_20%,transparent_70%)]"}),e.jsxs("div",{className:"relative flex flex-col md:flex-row md:items-center md:justify-between gap-6",children:[e.jsxs("div",{className:"space-y-2 max-w-lg",children:[e.jsx("span",{className:"text-[10px] font-mono uppercase tracking-[0.18em] text-primary",children:"Ready when you are"}),e.jsx("h2",{className:"font-display text-2xl md:text-3xl font-semibold text-foreground tracking-tight",children:"Turn buying signals into pipeline."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"24-hour free trial. No credit card. Full feature access."})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 shrink-0",children:[e.jsx(h,{size:"lg",asChild:!0,children:e.jsxs(Ls,{to:"/auth",children:["Start free trial",e.jsx(Ns,{className:"ml-2 w-4 h-4"})]})}),e.jsx(h,{size:"lg",variant:"outline",asChild:!0,children:e.jsx(Ls,{to:"/",children:"View pricing"})})]})]})]})})})]}),e.jsx(_s,{})]})),gr={productName:"your business",summary:"We'll build a custom growth playbook based on your homepage.",personas:["Founders & operators","Marketing leads","Growth-focused teams"],recommended_platforms:["linkedin","x","reddit","facebook"],sample_reply:"Been there â we found that joining the conversation early (before pitching) made all the difference. Happy to share what worked."},Zd="deshiller_strategy_cache";function Lj(s){try{const t=sessionStorage.getItem(Zd);if(!t)return null;const a=JSON.parse(t);if((a==null?void 0:a.url)===s&&(a!=null&&a.data))return a.data}catch{}return null}function ul(s,t){try{sessionStorage.setItem(Zd,JSON.stringify({url:s,data:t,ts:Date.now()})),sessionStorage.setItem("deshiller_analyzed_url",s)}catch{}}function em(){const[s,t]=i.useState(!1),[a,r]=i.useState(null),[o,n]=i.useState(null),[l,c]=i.useState("");return{analyze:i.useCallback(async d=>{t(!0),r(null);const u=Lj(d);if(u)return n(u),t(!1),u;const m=["Reading your homepageâ¦","Identifying your audienceâ¦","Mapping high-intent conversationsâ¦","Drafting your strategyâ¦"];let p=0;c(m[0]);const g=setInterval(()=>{p=(p+1)%m.length,c(m[p])},1400);try{const{data:v,error:b}=await w.functions.invoke("analyze-website",{body:{url:d}});if(clearInterval(g),b||v&&v.error){const C=(b==null?void 0:b.message)||(v==null?void 0:v.error)||"Analysis failed";r(C);const j={...gr,productName:d.replace(/^https?:\/\//,"").split("/")[0]};return n(j),ul(d,j),t(!1),j}const z={...gr,...v,personas:Array.isArray(v.personas)&&v.personas.length?v.personas:gr.personas,recommended_platforms:Array.isArray(v.recommended_platforms)&&v.recommended_platforms.length?v.recommended_platforms:gr.recommended_platforms,sample_reply:v.sample_reply||gr.s
133ample_reply};return n(z),ul(d,z),t(!1),z}catch(v){clearInterval(g);const b=(v==null?void 0:v.message)||"Analysis failed";r(b);const z={...gr};return n(z),t(!1),z}},[]),loading:s,error:a,data:o,progressLabel:l}}const zj=[{Icon:ks,text:"Find your buyers",sub:"across LinkedIn, X, Reddit, FB"},{Icon:ms,text:"Reply in your voice",sub:"AI trained on your brand"},{Icon:gs,text:"Book real meetings",sub:"qualified conversations, on autopilot"}];function Ej({headline:s,subheadline:t,ctaLabel:a,loading:r,progressLabel:o,onSubmit:n,trustChips:l=["No credit card","60-second analysis","Cancel anytime"]}){const[c,x]=i.useState(""),[d,u]=i.useState(!1),m=/^([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}/.test(c.replace(/^https?:\/\//,"")),p=g=>{g.preventDefault(),u(!0),!(!m||r)&&n(c.trim())};return e.jsxs("section",{className:"relative overflow-hidden px-4 py-12 md:py-20",children:[e.jsxs("div",{className:"absolute inset-0 -z-10 overflow-hidden",children:[e.jsx("div",{className:"absolute top-[10%] left-[15%] w-[28rem] h-[28rem] bg-primary/15 rounded-full blur-3xl",style:{animation:"lp-float 14s ease-in-out infinite"}}),e.jsx("div",{className:"absolute bottom-[5%] right-[10%] w-[32rem] h-[32rem] bg-primary/10 rounded-full blur-3xl",style:{animation:"lp-float 18s ease-in-out infinite reverse",animationDelay:"2s"}}),e.jsx("div",{className:"absolute top-[40%] right-[25%] w-72 h-72 bg-primary/[0.08] rounded-full blur-3xl",style:{animation:"lp-float 22s ease-in-out infinite",animationDelay:"4s"}}),e.jsx("div",{className:"absolute inset-0 opacity-[0.04]",style:{backgroundImage:"linear-gradient(hsl(var(--foreground)) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--foreground)) 1px, transparent 1px)",backgroundSize:"48px 48px",maskImage:"radial-gradient(ellipse at center, black 40%, transparent 75%)",WebkitMaskImage:"radial-gradient(ellipse at center, black 40%, transparent 75%)"}}),[{top:"15%",left:"8%",delay:"0s",dur:"6s"},{top:"25%",right:"12%",delay:"1.2s",dur:"7s"},{top:"65%",left:"10%",delay:"0.6s",dur:"8s"},{top:"75%",right:"18%",delay:"2s",dur:"6.5s"},{top:"45%",left:"5%",delay:"1.8s",dur:"9s"},{top:"35%",right:"6%",delay:"0.3s",dur:"7.5s"}
133].map((g,v)=>e.jsx("div",{className:"absolute w-1.5 h-1.5 rounded-full bg-primary/40",style:{...g,animation:`lp-dot ${g.dur} ease-in-out infinite`,animationDelay:g.delay}},v)),e.jsx("div",{className:"absolute -inset-x-1/4 top-1/3 h-40 opacity-[0.06] rotate-[-8deg]",style:{background:"linear-gradient(90deg, transparent, hsl(var(--primary)) 50%, transparent)",animation:"lp-sweep 9s ease-in-out infinite"}}),e.jsxs("div",{className:"hidden lg:block pointer-events-none",children:[e.jsxs("div",{className:"absolute top-[8%] left-[2%] w-72 rounded-xl border border-border/60 bg-card/85 backdrop-blur-md shadow-2xl p-3",style:{animation:"lp-card-float 9s ease-in-out infinite",transform:"rotate(-4deg)"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-md bg-[#0A66C2] flex items-center justify-center",children:e.jsx(Zs,{className:"w-4 h-4 text-white"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold truncate",children:"Sarah K. · Founder"}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"2h · matched keyword"})]}),e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-primary/15 text-primary font-semibold",children:"94%"})]}),e.jsx("p",{className:"text-xs text-foreground/80 leading-snug line-clamp-2",children:'"Anyone know a tool that automates social engagement without sounding like a bot?"'}),e.jsxs("div",{className:"mt-2 flex items-center gap-2 text-[10px] text-muted-foreground",children:[e.jsx(xa,{className:"w-3 h-3"})," 24",e.jsx(St,{className:"w-3 h-3 ml-1"})," 8"]})]}),e.jsxs("div",{className:"absolute bottom-[10%] left-[4%] w-80 rounded-xl border border-primary/30 bg-card/90 backdrop-blur-md shadow-2xl p-3.5",style:{animation:"lp-card-float 11s ease-in-out infinite",animationDelay:"1.2s",transform:"rotate(3deg)"},children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2 text-[10px] font-semibold text-primary uppercase tracking-wide",children:[e.jsx(es,{className:"w-3 h-3"})," AI reply · in your voice"]}),e.jsx("p",{className:"text-xs text-foreground/85 leading-snug",children:`"Hey Sarah â we've been solving exactly this. Replies actually match your brand tone. Happy to share how it works."`}),e.jsxs("div",{className:"mt-2.5 flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Posted via DESHILLER"}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-primary font-semibold",children:[e.jsx(At,{className:"w-3 h-3"})," Sent"]})]})]}),e.jsxs("div",{className:"absolute top-[12%] right-[3%] w-72 rounded-xl border border-border/60 bg-card/85 backdrop-blur-md shadow-2xl p-3",style:{animation:"lp-card-float 10s ease-in-out infinite",animationDelay:"0.6s",transform:"rotate(5deg)"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-md bg-foreground flex items-center justify-center",children:e.jsx(rt,{className:"w-4 h-4 text-background"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold truncate",children:"@marcus_builds"}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"live · buyer intent"})]}),e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-primary/15 text-primary font-semibold",children:"88%"})]}),e.jsx("p",{className:"text-xs text-foreground/80 leading-snug line-clamp-2",children:`"Looking for recommendations â what are y'all using for outbound on
133LinkedIn?"`})]}),e.jsxs("div",{className:"absolute bottom-[14%] right-[4%] w-64 rounded-xl border border-primary/30 bg-gradient-to-br from-primary/10 to-card/85 backdrop-blur-md shadow-2xl p-3.5",style:{animation:"lp-card-float 12s ease-in-out infinite",animationDelay:"2s",transform:"rotate(-3deg)"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/20 text-primary flex items-center justify-center",children:e.jsx(ys,{className:"w-4 h-4"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold",children:"New lead captured"}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"From LinkedIn reply"})]})]}),e.jsx("div",{className:"text-[11px] text-foreground/75",children:"Sarah K. replied â booking link clicked"})]})]})]}),e.jsx("style",{children:` 134 @keyframes lp-float { 135 0%, 100% { transform: translate(0, 0) scale(1); } 136 33% { transform: translate(30px, -20px) scale(1.05); } 137 66% { transform: translate(-20px, 30px) scale(0.97); } 138 } 139 @keyframes lp-dot { 140 0%, 100% { transform: translateY(0) translateX(0); opacity: 0.35; } 141 50% { transform: translateY(-22px) translateX(8px); opacity: 0.85; } 142 } 143 @keyframes lp-sweep { 144 0% { transform: translateX(-30%) rotate(-8deg); } 145 100% { transform: translateX(30%) rotate(-8deg); } 146 } 147 @keyframes lp-card-float { 148 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 149 50% { transform: translateY(-14px) rotate(var(--r, 0deg)); } 150 } 151 `}),e.jsxs("div",{className:"container mx-auto max-w-5xl",children:[e.jsx("div",{className:"flex items-center justify-center gap-2 mb-8 animate-fade-in",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground px-3 py-1.5 rounded-full border border-border/60 bg-background/50 backdrop-blur",children:[e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),"Live AI analysis â built for founders & marketers"]})}),e.jsxs("div",{className:"text-center max-w-3xl mx-auto",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 mb-6 px-4 py-1.5 rounded-full border border-primary/30 bg-primary/5 animate-fade-in",children:[e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),e.jsx("span",{className:"text-xs font-semibold text-primary tracking-wide uppercase",children:"Free leads from social â live in 60s"})]}),e.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-display font-semibold leading-[1.05] tracking-tight mb-5 animate-fade-in",children:s}),e.jsx("p",{className:"text-lg md:text-xl text-muted-foreground mb-10 max-w-2xl mx-auto animate-fade-in",style:{animationDelay:"120ms"},children:t}),e.jsxs("form",{onSubmit:p,className:"max-w-xl mx-auto animate-fade-in",style:{animationDelay:"200ms"},children:[e.jsxs(U,{className:"p-2 flex items-center gap-2 shadow-2xl shadow-primary/10 border-2 border-border focus-within:border-primary focus-within:shadow-primary/20 transition-all",children:[e.jsx("div",{className:"pl-3 text-muted-foreground",children:e.jsx(bt,{className:"w-5 h-5"})}),e.jsx(Je,{type:"text",inputMode:"url",autoComplete:"url",placeholder:"yourcompany.com",value:c,onChange:g=>x(g.target.value),disabled:r,className:"border-0 focus-visible:ring-0 text-base h-12 bg-transparent"}),e.jsx(h,{type:"submit",size:"lg",disabled:r||!m&&d,className:"gap-2 h-12 px-6 font-semibold shadow-lg shadow-primary/20",children:r?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"w-4 h-4 animate-spin"})," Analyzing"]}):e.jsxs(e.Fragment,{children:[a," ",e.jsx(Ns,{className:"w-4 h-4"})]})})]}),d&&!m&&!r&&e.jsx("p",{className:"text-sm text-destructive mt-2 text-left ml-3",children:"Please enter a valid website (e.g. yourcompany.com)"}),r&&o&&e.jsxs("div",{className:"mt-5 flex items-center justify-center gap-2 text-sm text-muted-foreground animate-fade-in",children:[e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),o]})]}),e.jsx("div",{className:"mt-6 flex flex-wrap justify-center gap-x-5 gap-y-2 text-sm text-muted-foreground animate-fade-in",style:{animationDelay:"260ms"},children:l.map((g,v)=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[v===0?e.jsx(Tt,{className:"w-3.5 h-3.5"}):v===1?e.jsx(ws,{className:"w-3.5 h-3.5"}):e.jsx(_t,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:g})]},v))})]}),e.jsxs("div",{className:"mt-14 md:mt-20 animate-fade-in",style:{animationDelay:"340ms"},children:[e.jsx("p",{className:"text-center text-xs font-semibold uppercase tracking-widest text-muted-foreground mb-6",children:"What you'll see in 60 seconds"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 max-w-4xl mx-auto",children:zj.map(({Icon:g,text:v,sub:b},z)=>e.jsx(U,{className:"p-5 border-2 hover:border-primary/40 transition-all hover:-translate-y-1 hover:shadow-xl hover:shadow-
151primary/10 group",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 text-primary flex items-center justify-center shrink-0 group-hover:bg-primary group-hover:text-primary-foreground transition-colors",children:e.jsx(g,{className:"w-5 h-5"})}),e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"font-semibold text-base",children:v}),e.jsx("div",{className:"text-sm text-muted-foreground mt-0.5",children:b})]})]})},z))})]}),e.jsx("div",{className:"mt-12 max-w-2xl mx-auto animate-fade-in text-center",style:{animationDelay:"440ms"},children:e.jsxs("p",{className:"text-sm text-muted-foreground inline-flex items-center gap-1.5",children:[e.jsx(ys,{className:"w-4 h-4 text-primary"}),"Your strategy is generated live from your website â nothing pre-canned."]})})]})]})}const hl={linkedin:{label:"LinkedIn",Icon:Zs,color:"text-[#0a66c2]"},x:{label:"X (Twitter)",Icon:rt,color:"text-foreground"},twitter:{label:"X (Twitter)",Icon:rt,color:"text-foreground"},facebook:{label:"Facebook",Icon:Wt,color:"text-[#1877f2]"},reddit:{label:"Reddit",Icon:St,color:"text-[#ff4500]"},quora:{label:"Quora",Icon:Va,color:"text-[#b92b27]"}},Rj={trial:{conversations:320,replies:95,leads:14,label:"Realistic 30-day projection"},"case-study":{conversations:980,replies:240,leads:47,label:"Matched to TechFlow's playbook (300% lift)"},offer:{conversations:1450,replies:380,leads:72,label:"Premium-tier projection (capped during offer)"}};function xi({to:s,suffix:t=""}){const[a,r]=i.useState(0);return i.useEffect(()=>{let o;const n=performance.now(),l=1400,c=x=>{const d=Math.min(1,(x-n)/l),u=1-Math.pow(1-d,3);r(Math.round(s*u)),d<1&&(o=requestAnimationFrame(c))};return o=requestAnimationFrame(c),()=>cancelAnimationFrame(o)},[s]),e.jsxs(e.Fragment,{children:[a.toLocaleString(),t]})}function Pj({text:s,speed:t=18}){const[a,r]=i.useState("");return i.useEffect(()=>{r("");let o=0;const n=setInterval(()=>{o++,r(s.slice(0,o)),o>=s.length&&clearInterval(n)},t);return()=>clearInterval(n)},[s,t]),e.jsxs("span",{children:[a,e.jsx("span",{className:"inline-block w-1 h-4 bg-primary ml-0.5 animate-pulse"})]})}function Mj({loading:s,data:t,angle:a,ctaLabel:r,onContinue:o}){const n=Rj[a];return s||!t?e.jsx("section",{className:"min-h-screen px-4 py-16",children:e.jsxs("div",{className:"container mx-auto max-w-5xl space-y-6",children:[e.jsx(Ws,{className:"h-10 w-72"}),e.jsx(Ws,{className:"h-6 w-full max-w-2xl"}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-4 mt-8",children:[e.jsx(Ws,{className:"h-40"}),e.jsx(Ws,{className:"h-40"}),e.jsx(Ws,{className:"h-40"})]}),e.jsx(Ws,{className:"h-48 mt-6"})]})}):e.jsx("section",{className:"min-h-screen px-4 py-16 animate-fade-in",children:e.jsxs("div",{className:"container mx-auto max-w-5xl",children:[e.jsx("div",{className:"inline-flex items-center gap-2 mb-6 px-4 py-1.5 rounded-full border border-primary/30 bg-primary/5",children:e.jsx("span",{className:"text-xs font-semibold text-primary tracking-wide uppercase",children:"Step 2 of 3 â Your custom strategy"})}),e.jsxs("h2",{className:"text-3xl md:text-4xl font-display font-semibold leading-tight mb-3 animate-fade-in",children:["Here's the playbook for"," ",e.jsx("span",{className:"text-primary",children:t.productName||"your business"})]}),e.jsx("p",{className:"text-lg text-muted-foreground mb-10 max-w-3xl animate-fade-in",style:{animationDelay:"100ms"},children:t.summary||t.valueProposition}),e.jsxs("div",{className:"mb-10",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4 animate-fade-in",style:{animationDelay:"200ms"},children:[e.jsx(Es,{className:"w-5 h-5 text-primary"}),e.jsx("h3",{className:"text-xl font-display font-semibold",children:"Who we'll target"})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4",children:t.personas.slice(0,3).map((l,c)=>e.jsxs(U,{className:"p-5 border-2 hover:border-primary/40 transition-colors animate-fade-in",style:{animationDelay:`${300+c*100}ms`},children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center mb-3",children:e.jsx(ks,{className:"w-5 h-5 text-primary"})}),e.jsx("p",{className:"font-semibold text-foreground",children:l})]},c))})]}),e.jsxs("div",{className:"mb-10",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4 animate-fade-in",style:{animationDelay:"600ms"},children:[e.jsx(ms,{className:"w-5 h-5 text-primary"}),e.jsx("h3",{className:"text-xl font-display font-semibold",children:"Channels we'll work"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.recommended_platforms.map((l,c)=>{const x=hl[l.toLowerCase()]||hl.linkedin,d=x.Icon;return e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full border-2 border-border bg-card animate-fade-in hover:border-primary/40 transition-colors",style:{animationDelay:`${700+c*100}ms`},children:[e.jsx(d,{className:`w-4 h-4 ${x.color}`}),e.jsx("span",{className:"text-sm font-medium",children:x.label})]},l)})})]}),e.jsxs(U,{className:"p-6 mb-10 border-2 border-primary/20 bg-gradient-to-br from-primary/5 to-accent/5 animate-fade-in",style:{animationDelay:"1100ms"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(ms,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"text-xs font-semibold text-primary uppercase tracking-wide",children:"Sample reply our AI will write for you"})]}
151),e.jsxs("p",{className:"text-base md:text-lg text-foreground/90 leading-relaxed font-medium italic",children:['"',e.jsx(Pj,{text:t.sample_reply}),'"']})]}),e.jsxs(U,{className:"p-8 mb-10 border-2 border-border animate-fade-in",style:{animationDelay:"1300ms"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(gs,{className:"w-5 h-5 text-primary"}),e.jsx("h3",{className:"text-xl font-display font-semibold",children:"30-day projection"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:n.label}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-3xl md:text-4xl font-display font-bold text-primary",children:e.jsx(xi,{to:n.conversations})}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:"conversations found"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-3xl md:text-4xl font-display font-bold text-primary",children:e.jsx(xi,{to:n.replies})}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:"replies posted"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-3xl md:text-4xl font-display font-bold text-primary",children:e.jsx(xi,{to:n.leads})}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:"qualified leads"})]})]})]}),e.jsx("div",{className:"sticky bottom-4 z-10 animate-fade-in",style:{animationDelay:"1500ms"},children:e.jsxs(U,{className:"p-4 md:p-5 flex flex-col md:flex-row items-center justify-between gap-4 bg-gradient-to-r from-primary to-primary/80 border-0 shadow-2xl shadow-primary/30",children:[e.jsxs("div",{className:"text-primary-foreground text-center md:text-left",children:[e.jsx(W,{className:"bg-primary-foreground/20 text-primary-foreground hover:bg-primary-foreground/20 mb-1",children:"Step 3 of 3"}),e.jsx("p",{className:"font-semibold text-lg",children:"Activate this strategy in 60 seconds"})]}),e.jsxs(h,{size:"lg",variant:"secondary",onClick:o,className:"gap-2 font-semibold shadow-lg w-full md:w-auto",children:[r," ",e.jsx(Ns,{className:"w-4 h-4"})]})]})})]})})}function Dj({ctaLabel:s,analyzedUrl:t}){const a=ns(),[r,o]=i.useState(!1),[n,l]=i.useState(!1);i.useEffect(()=>{if(t)try{sessionStorage.setItem("deshiller_analyzed_url",t)}catch{}},[t]),i.useEffect(()=>{const x=u=>{const m=u.data;!m||typeof m!="object"||(m.type==="SOCIALPILOT_EXTENSION_READY"||m.type==="SOCIALPILOT_EXTENSION_DETECTED"||m.source==="socialpilot-extension")&&o(!0)};window.addEventListener("message",x);const d=setInterval(()=>{(document.documentElement.dataset.deshillerExtension==="true"||window.__SOCIALPILOT_EXTENSION__)&&o(!0)},1500);return()=>{window.removeEventListener("message",x),clearInterval(d)}},[]),i.useEffect(()=>{if(!r||n)return;l(!0);const x=setTimeout(async()=>{const{data:{session:d}}=await w.auth.getSession();a(d?"/dashboard":"/auth?next=/dashboard")},1600);return()=>clearTimeout(x)},[r,n,a]);const c=async()=>{const{data:{session:x}}=await w.auth.getSession();a(x?"/dashboard":"/auth?next=/dashboard")};return e.jsx("section",{className:"min-h-screen px-4 py-16 animate-fade-in",children:e.jsxs("div",{className:"container mx-auto max-w-4xl",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 mb-6 px-4 py-1.5 rounded-full border border-primary/30 bg-primary/5",children:[e.jsx(Ut,{className:"w-3.5 h-3.5 text-primary"}),e.jsx("span",{className:"text-xs font-semibold text-primary tracking-wide uppercase",children:"Step 3 of 3 â Install & activate"})]}),e.jsx("h2",{className:"text-3xl md:text-4xl font-display font-semibold leading-tight mb-3",children:"Install the extension to go live"}),e.jsx("p",{className:"text-lg text-muted-foreground mb-8 max-w-2xl",children:"The DESHILLER extension runs from your own browser â no passwords, no bots, no risk to your accounts."}),e.jsxs(U,{className:`p-5 mb-8 flex items-center gap-4 border-2 transition-all ${r?"border-primary/50 bg-primary/5":"border-primary/30 bg-primary/5"}`,children:[r?e.jsx(ys,{className:"w-8 h-8 text-primary flex-shrink-0"}):e.jsx(Pe,{className:"w-8 h-8 text-primary animate-spin flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-semibold text-foreground",children:r?"Extension detected â taking you to your dashboardâ¦":"Waiting for the extensionâ¦"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:r?"Nice. We'll prefill your strategy from the URL you analyzed.":"Follow the steps below. We'll auto-detect once it's installed."})]}),r&&e.jsx(es,{className:"w-5 h-5 text-primary animate-pulse"})]}),e.jsx(Pn,{showCompleteButton:!1}),e.jsxs("div",{className:"mt-8 flex flex-col sm:flex-row items-center justify-between gap-4 pt-6 border-t",children:[e.jsx("p",{className:"text-sm text-muted-foreground text-center sm:text-left",children:"Already installed it elsewhere? Skip ahead â your strategy is saved."}),e.jsxs(h,{onClick:c,size:"lg",className:"gap-2",children:[s," ",e.jsx(ys,{className:"w-4 h-4"})]})]})]})})}const pl=[{n:1,label:"Your site",Icon:bt},{n:2,label:"Your strategy",Icon:es},{n:3,label:"Activate",Icon:Lt}];function Oj({step:s}){return e.jsx("div",{className:"sticky top-[57px] z-30 backdrop-blur-md bg-background/90 border-b border-border/50",children:e.jsx("div",{className:"container mx-auto px-4 py-3",children:e.jsx("div",{className:"flex items-center justify-center gap-2 md:gap-4 max-w-2xl mx-auto",children:pl.map(({n:t,label:a,Icon:r},o)=>{const n=s===t,l=s>t;return e.jsxs("div",{className:"flex items-center gap-2 md:gap-4 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-2.5 min-w-0",children:[e.jsxs("div",{className:`relative w-8 h-8 md:w-9 md:h-9 rounded-full flex items-center justify-center text-xs font-bold transition-all duration-300 shrink-0 ${n?"bg-primary text-primary-foreground scale-110 shadow-lg shadow-primary/40 ring-4 ring-primary/15":l?"bg-primary/20 text-primary":"bg-muted text-muted-foreground"}`,children:[l?e.jsx(bs,{className:"w-4 h-4"}):e.jsx(r,{className:"w-4 h-4"}),n&&e.jsx("span",{className:"absolute inset-0 rounded-full animate-ping bg-primary/30"})]}),e.jsxs("div",{className:"hidden sm:flex flex-col leading-tight min-w-0",children:[e.jsxs("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground font-semibold",children:["Step ",t]}),e.jsx("span",{className:`text-xs md:text-sm font-semibold truncate transition-colors ${n?"text-foreground":l?"text-foreground
151/80":"text-muted-foreground"}`,children:a})]})]}),o<pl.length-1&&e.jsx("div",{className:"flex-1 h-0.5 rounded-full bg-border overflow-hidden min-w-[20px]",children:e.jsx("div",{className:`h-full bg-primary transition-all duration-500 ${s>t?"w-full":n?"w-1/2":"w-0"}`})})]},t)})})})})}function so({angle:s,copy:t}){const[a,r]=i.useState(1),[o,n]=i.useState(null),{analyze:l,loading:c,data:x,progressLabel:d}=em(),u=i.useRef(null),m=i.useRef(null),p=async v=>{n(v),r(2),setTimeout(()=>{var b;return(b=u.current)==null?void 0:b.scrollIntoView({behavior:"smooth"})},100),await l(v)},g=()=>{r(3),setTimeout(()=>{var v;return(v=m.current)==null?void 0:v.scrollIntoView({behavior:"smooth"})},100)};return i.useEffect(()=>{typeof window<"u"&&window.history.replaceState(null,"",`#step-${a}`)},[a]),e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-background via-background to-primary/5",children:[t.topBanner,e.jsx("nav",{className:"sticky top-0 z-40 backdrop-blur-md bg-background/80 border-b border-border/50",children:e.jsxs("div",{className:"container mx-auto px-4 py-3 flex items-center justify-between",children:[e.jsx(Ls,{to:"/",className:"text-xl font-display font-bold hover:text-primary transition-colors",children:"DESHILLER"}),e.jsx(Ls,{to:"/auth",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Sign in"})]})}),e.jsx(Oj,{step:a}),e.jsxs("main",{children:[a===1&&e.jsx(Ej,{headline:t.step1Headline,subheadline:t.step1Sub,ctaLabel:t.step1Cta,loading:c,progressLabel:d,onSubmit:p,trustChips:t.trustChips}),a>=2&&e.jsx("div",{ref:u,children:e.jsx(Mj,{loading:c,data:x,angle:s,ctaLabel:t.step2Cta,onContinue:g})}),a===3&&e.jsx("div",{ref:m,children:e.jsx(Dj,{ctaLabel:t.step3Cta,analyzedUrl:o})})]}),e.jsx("footer",{className:"border-t border-border/50 py-6 px-4 mt-16",children:e.jsxs("div",{className:"container mx-auto text-center text-sm text-muted-foreground",children:["© ",new Date().getFullYear()," DESHILLER · ",e.jsx(Ls,{to:"/privacy",className:"hover:text-foreground",children:"Privacy"})," · ",e.jsx(Ls,{to:"/terms",className:"hover:text-foreground",children:"Terms"})]})})]})}const Fj=()=>(i.useEffect(()=>{document.title="Get Free Leads From Social Media â Free Trial | DESHILLER";const s=document.querySelector('meta[name="description"]');s&&s.setAttribute("content","Paste your website. DESHILLER finds buyer conversations on LinkedIn, X, Reddit & Facebook and replies in your voice. Free 24-hour trial, no credit card.")},[]),e.jsx(so,{angle:"trial",copy:{step1Headline:e.jsxs(e.Fragment,{children:["Get free leads from ",e.jsx("span",{className:"text-primary",children:"social media"}),e.jsx("br",{}),e.jsx("span",{className:"text-muted-foreground text-3xl md:text-4xl lg:text-5xl",children:"â on autopilot, in your voice"})]}),step1Sub:"Drop your website. We'll find the buyer conversations on LinkedIn, X, Reddit & Facebook and reply for you â live preview in 60 seconds.",step1Cta:"Get my leads",step2Cta:"Activate this strategy",step3Cta:"Start my free trial",trustChips:["No credit card required","60-second analysis","Cancel anytime"]}})),Bj=()=>(i.useEffect(()=>{document.title="How TechFlow Got 47 Inbound Leads From Social â In Their Voice | DESHILLER";const s=document.querySelector('meta[name="description"]');s&&s.setAttribute("content","See the exact playbook TechFlow used to turn LinkedIn, X, Reddit and Facebook conversations into 47 inbound leads â projected onto your business in 60 seconds.")},[]),e.jsx(so,{angle:"case-study",copy:{step1Headline:e.jsxs(e.Fragment,{children:["How TechFlow turned social into",e.jsx("br",{}),e.jsx("span",{className:"text-primary",children:"47 inbound leads"})," â in their voice"]}),step1Sub:"Paste your site. We'll show you the exact same playbook running on your audience, your channels, your tone â live preview in 60 seconds.",step1Cta:"Show me the playbook",step2Cta:"Run this playbook on my site",step3Cta:"Run my playbook",trustChips:["Same engine TechFlow used","60-second preview","Free trial included"]}})),$j=()=>{const[s,t]=i.useState({hours:47,minutes:23,seconds:45}),[a,r]=i.useState(7);i.useEffect(()=>{document.title="50% Off â Get Free Leads From Social Media | DESHILLER";const n=document.querySelector('meta[name="description"]');n&&n.setAttribute("content","Limited offer: 50% off DESHILLER. Find buyer conversations on LinkedIn, X, Reddit & Facebook and reply in your voice â on auto
151pilot. Only a few spots left.");const l=setInterval(()=>{t(x=>{let{hours:d,minutes:u,seconds:m}=x;return m>0?m--:u>0?(u--,m=59):d>0&&(d--,u=59,m=59),{hours:d,minutes:u,seconds:m}})},1e3),c=setInterval(()=>{r(x=>Math.max(3,x-(Math.random()>.7?1:0)))},3e4);return()=>{clearInterval(l),clearInterval(c)}},[]);const o=e.jsx("div",{className:"bg-gradient-to-r from-primary to-primary/80 text-primary-foreground py-2 px-4 text-center font-semibold text-sm shadow-lg",children:e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx(Ca,{className:"w-4 h-4 animate-pulse"}),e.jsxs("span",{children:[a," spots left ⢠50% off ends in ",s.hours,"h ",String(s.minutes).padStart(2,"0"),"m ",String(s.seconds).padStart(2,"0"),"s"]}),e.jsx(Ca,{className:"w-4 h-4 animate-pulse"})]})});return e.jsx(so,{angle:"offer",copy:{topBanner:o,step1Headline:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-primary",children:"50% off"})," â get free leads",e.jsx("br",{}),"from social media on autopilot"]}),step1Sub:"Drop your URL. We'll find the buyer conversations on LinkedIn, X, Reddit & Facebook and reply in your voice. Lock in your 50% discount before spots run out.",step1Cta:"Claim 50% off",step2Cta:"Claim my spot",step3Cta:"Claim 50% off + install",trustChips:["50% off first month",`Only ${a} spots left`,"Cancel anytime"]}})},gl=[{id:"founder",label:"Founder",emoji:"ð",reply:"Been there. Built ours after burning $40k on tools that didn't talk to each other. Happy to share what worked."},{id:"expert",label:"Expert",emoji:"ð¯",reply:"Two patterns solve this: tighter ICP filters up front, and replying inside the original thread (not DMs)."},{id:"friendly",label:"Friendly",emoji:"ð",reply:"Oh same! We hit this last quarter â DM me, I'll send the playbook we wrote, no strings."},{id:"blunt",label:"Blunt",emoji:"â¡",reply:"Stop duct-taping. We fixed this in a week. Want a 90-sec loom?"}];function qj(){const[s,t]=i.useState(gl[0]);return e.jsxs("div",{className:"max-w-xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1.5 mb-3 flex-wrap",children:[e.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-muted-foreground mr-1",children:"pick a vibe â"}),gl.map(a=>e.jsxs("button",{type:"button",onClick:()=>t(a),className:`lpc-press inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full border text-xs font-medium transition-all ${s.id===a.id?"border-primary/60 bg-primary/10 text-foreground shadow-sm shadow-primary/10":"border-border bg-background/60 text-muted-foreground hover:text-foreground hover:border-border"}`,children:[e.jsx("span",{children:a.emoji}),a.label]},a.id))]}),e.jsxs("div",{className:"relative rounded-xl border border-border/70 bg-background/60 backdrop-blur p-3.5 text-left overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5 text-[10px] font-mono uppercase tracking-wider text-primary",children:[e.jsx(es,{className:"w-3 h-3"}),"live preview"]}),e.jsxs("p",{className:"text-sm text-foreground/90 leading-snug animate-fade-in",children:['"',s.reply,'"']},s.id)]})]})}const fl=[{label:"LinkedIn",color:"#0a66c2"},{label:"Reddit",color:"#ff4500"},{label:"X",color:"currentColor"},{label:"Quora",color:"#b92b27"},{label:"Facebook",color:"#1877f2"}];function Hj({onSubmit:s,loading:t,progressLabel:a}){const[r,o]=i.useState(""),[n,l]=i.useState(!1),[c,x]=i.useState(0),d=i.useRef(null),u=r.replace(/^https?:\/\//,"").split("/")[0],m=/^([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}/.test(u);i.useEffect(()=>{const g=setInterval(()=>x(v=>(v+1)%fl.length),1600);return()=>clearInterval(g)},[]),i.useEffect(()=>{const g=d.current;if(!g)return;const v=b=>{const z=g.getBoundingClientRect();g.style.setProperty("--mx",`${b.clientX-z.left}px`),g.style.setProperty("--my",`${b.clientY-z.top}px`)};return g.addEventListener("mousemove",v),()=>g.removeEventListener("mousemove",v)},[]);const p=i.useMemo(()=>{if(m)return e.jsxs(e.Fragment,{children:["Buyers for ",e.jsx("span",{className:"text-primary",children:u}),".",e.jsx("br",{}),e.jsx("span",{className:"text-muted-foreground",children:"In 45 seconds."})]});const g=fl[c];return e.jsxs(e.Fragment,{children:["Buyers talking on",e.jsx("br",{}),e.jsxs("span",{className:"relative inline-block text-left align-baseline",style:{minWidth:"9ch"},children:[e.jsx("span",{className:"inline-block animate-rotate-in font-bold",style:{color:g.color},children:g.label},c),e.jsx("span",{className:"text-foreground",children:"."})]})," ",e.jsx("span",{className:"text-muted-foreground",children:"Now."})]})},[m,u,c]);return e.jsxs("section",{ref:d,id:"step-0",className:"lpc-spotlight relative overflow-hidden px-4 pt-12 pb-14 md:pt-20 md:pb-20",children:[e.jsxs("div",{className:"absolute inset-0 -z-10 overflow-hidden",children:[e.jsx("div",{className:"lpc-mesh-a absolute -top-40 -left-20 w-[44rem] h-[44rem] rounded-full blur-3xl"}),e.jsx("div",{className:"lpc-mesh-b absolute -bottom-40 -right-20 w-[40rem] h-[40rem] rounded-full blur-3xl"}),e.jsx("div",{className:"absolute inset-0 opacity-[0.05]",style:{backgroundImage:"linear-gradient(hsl(var(--foreground)) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--foreground)) 1px, transparent 1px)",backgroundSize:"44px 44px",maskImage:"radial-gradient(ellipse at center, black 30%, transparent 75%)",WebkitMaskImage:"radial-gradient(ellipse at center, black 30%, transparent 75%)"}})]}),e.jsxs("div",{className:"container mx-auto max-w-4xl text-center",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 mb-6 px-3 py-1 rounded-full border border-border/70 bg-background/70 backdrop-blur animate-fade-in",children:[e.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-primary"})]}),e.jsx("span",{className:"text-[11px] font-medium tracking-wide tabular-nums",children:"1,247 buyer conversations surfaced today"})]}),e.jsx("h1",{className:"text-5xl md:text-7xl lg:text-8xl font-display font-semibold leading-[0.95] tracking-tight mb-6 animate-fade-in",children:p}),e.jsxs("p",{className:"text-base md:text-lg text-muted-foreground max-w-xl mx-auto mb-7 animate-fade-in",style:{animationDelay:"80ms"},children:["A vibe-marketing platform that drops you into your buyers' conversations."," ",e.jsx("span",{className:"text-foreground font-semibold",children:"73% reply rate."})]}),e.jsx("div",{className:"mb-6 animate-fade-in",style:{animationDelay:"140ms"},children:e.jsx(qj,{})}),e.jsxs("form",{onSubmit:g=>{g.preventDefault(),l(!0),!(!m||t)&&s(r.trim())},className:"max-w-xl mx-auto animate-fade-in",style:{animationDelay:"120ms"},children:[e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"absolute -inset-1 bg-gradient-to-r from-primary via-primary/50 to-primary rounded-2xl blur-md opacity-50 group-focus-within:opacity-80 transition-opacity"}),e.jsxs("div",{className:"relative flex items-center gap-1.5 p-1.5 rounded-2xl bg-background border border-border/80 focus-within:border-primary/60 transition-colors",children:[e.jsx("span",{className:"pl-3 text-sm font-mono text-muted-foreground hidden sm:inline",children:"https://"}),e.jsx(Je,{type:"text",inputMode:"url",autoComplete:"url",placeholder:"yourcompany.com",value:r,onChange:g=>o(g.target.value),disabled:t,className:"border-0 focus-visible:ring-0 text-base h-12 bg-transparent pl-2"}),e.jsx(h,{type:"submit",size:"lg",disabled:t||!m&&n,className:"lpc-press gap-2 h-12 px-5 font-semibold rounded-xl",children:t?e.jsx(Pe,{className:"w-4 h-4 animate-spin"}):e.jsxs(e.Fragment,{children:["Run ",e.jsx(Ns,{className:"w-4 h-4"})]})})]})]}),n&&!m&&!t&&e.jsx("p",{className:"text-xs text-destructive mt-2 text-left ml-3",children:"Try yourcompany.com"}),t&&a&&e.jsxs("div",{className:"mt-4 inline-flex items-center gap-2 text-xs text-muted-foreground animate-fade-in",children:[e.jsx(Pe,{className:"w-3 h-3 animate-spin text-primary"}),a]})]}
151),e.jsx("p",{className:"mt-4 text-xs text-muted-foreground/70 animate-fade-in font-mono uppercase tracking-wider",style:{animationDelay:"200ms"},children:"No signup · No card · 45s"})]}),e.jsx("div",{className:"mt-12 md:mt-16 -mx-4 overflow-hidden border-y border-border/50 bg-background/40 backdrop-blur-sm",children:e.jsx("div",{className:"lpc-marquee flex whitespace-nowrap py-3 text-[11px] font-mono uppercase tracking-wider text-muted-foreground",children:Array.from({length:2}).map((g,v)=>e.jsx("div",{className:"flex shrink-0 items-center",children:["buyer found · LinkedIn","reply drafted · Reddit","DM sent · X","thread joined · Quora","lead qualified · Facebook","buyer found · LinkedIn","reply drafted · X","comment posted · Reddit"].map((b,z)=>e.jsxs("span",{className:"inline-flex items-center gap-3 px-6",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-primary"}),b]},z))},v))})})]})}const bl={linkedin:{label:"LinkedIn",Icon:Zs,color:"#0a66c2"},x:{label:"X",Icon:rt,color:"currentColor"},twitter:{label:"X",Icon:rt,color:"currentColor"},facebook:{label:"Facebook",Icon:Wt,color:"#1877f2"},reddit:{label:"Reddit",Icon:St,color:"#ff4500"},quora:{label:"Quora",Icon:Va,color:"#b92b27"}};function Gj({loading:s,data:t,domain:a}){const[r,o]=i.useState([]);return i.useEffect(()=>{t!=null&&t.personas&&o(t.personas.slice(0,3))},[t]),e.jsx("section",{id:"step-1",className:"px-4 py-14 md:py-20",children:e.jsxs("div",{className:"container mx-auto max-w-3xl",children:[e.jsxs("div",{className:"flex items-baseline gap-3 mb-6",children:[e.jsx("span",{className:"text-[10px] font-mono text-primary tabular-nums",children:"01"}),e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold tracking-tight",children:"What we read"})]}),e.jsx(U,{className:"lpc-lift p-6 md:p-7 border border-border/80 bg-gradient-to-br from-background to-muted/20",children:s||!t?e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ws,{className:"h-4 w-32"}),e.jsx(Ws,{className:"h-7 w-2/3"}),e.jsx(Ws,{className:"h-4 w-full"}),e.jsx(Ws,{className:"h-4 w-5/6"}),e.jsxs("div",{className:"flex gap-2 pt-3",children:[e.jsx(Ws,{className:"h-7 w-24 rounded-full"}),e.jsx(Ws,{className:"h-7 w-28 rounded-full"}),e.jsx(Ws,{className:"h-7 w-20 rounded-full"})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 text-[10px] font-mono uppercase tracking-wider text-muted-foreground",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-primary animate-pulse"}),a]}),e.jsx("div",{className:"text-2xl md:text-3xl font-display font-semibold mb-2 tracking-tight",children:t.productName||"Your business"}),e.jsx("p",{className:"text-sm md:text-base text-muted-foreground leading-relaxed mb-5",children:t.summary||t.valueProposition}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:r.map((n,l)=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full border border-primary/30 bg-primary/5 text-xs font-medium animate-fade-in",style:{animationDelay:`${l*80}ms`},children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-primary"}),n]},l))}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.recommended_platforms.map((n,l)=>{const c=bl[n.toLowerCase()]||bl.linkedin,x=c.Icon;return e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full border border-border bg-background text-xs font-medium animate-fade-in",style:{animationDelay:`${240+l*80}ms`},children:[e.jsx(x,{className:"w-3 h-3",style:{color:c.color}}),c.label]},n+l)})})]})})]})})}function Uj({children:s,variant:t="rise",delay:a=0,className:r,as:o="div",style:n,threshold:l=.15,once:c=!0}){const x=i.useRef(null),[d,u]=i.useState(!1);return i.useEffect(()=>{const m=x.current;if(!m)return;if(typeof IntersectionObserver>"u"){u(!0);return}const p=new IntersectionObserver(g=>{g.forEach(v=>{v.isIntersecting?(u(!0),c&&p.unobserve(v.target)):c||u(!1)})},{threshold:l,rootMargin:"0px 0px -10% 0px"});return p.observe(m),()=>p.disconnect()},[l,c]),i.createElement(o,{ref:x,"data-reveal":d?"in":"out","data-reveal-variant":t==="rise"?void 0:t,className:r,style:{...n,transitionDelay:a?`${a}ms`:void 0}},s)}const jl={linkedin:{label:"LinkedIn",Icon:Zs,color:"#0a66c2"},x:{label:"X",Icon:rt,color:"currentColor"},twitter:{label:"X",Icon:rt,color:"currentColor"},reddit:{label:"Reddit",Icon:St,color:"#ff4500"},quora:{label:"Quora",Icon:Va,color:"#b92b27"},facebook:{label:"Facebook",Icon:Wt,color:"#1877f2"}},yl=[(s,t)=>`Anyone using something that actually solves ${t.toLowerCase()} for ${s.toLowerCase()}? Tired of the duct tape.`,s=>`${s} â what's your stack? Mine's a mess.`,(s,t)=>`Honest take: anything better than the obvious choice for ${t.toLowerCase()}? Asking for fellow ${s.toLowerCase()}.`,s=>`Built ours in-house. Costs more than it should. ${s}, what worked?`,(s,t)=>`Looking for ${t.toLowerCase()} recs. Open to anything not on the front page.`],vl=["sarahk_","marcus.builds","lena.ops","raj_growth","nora.fm"],Nl=["2m","11m","34m","1h","2h"];function Wj(s){var o,n;if(!s)return[];const t=(o=s.personas)!=null&&o.length?s.personas:["Founders","Marketers"],a=((n=s.recommended_platforms)!=null&&n.length?s.recommended_platforms:["linkedin","x","reddit","quora"]).map(l
151=>l.toLowerCase()),r=s.productName||"this";return Array.from({length:5}).map((l,c)=>{const x=t[c%t.length],d=a[c%a.length],u=yl[c%yl.length];return{id:c,platform:d,handle:vl[c%vl.length],persona:x,score:96-c*4,text:u(x,r),time:Nl[c%Nl.length]}})}function Vj({loading:s,data:t}){const a=i.useMemo(()=>Wj(t),[t]);return e.jsx("section",{id:"step-2",className:"px-4 py-14 md:py-20 bg-muted/20 border-y border-border/40",children:e.jsxs("div",{className:"container mx-auto max-w-3xl",children:[e.jsxs("div",{className:"flex items-baseline gap-3 mb-6",children:[e.jsx("span",{className:"text-[10px] font-mono text-primary tabular-nums",children:"02"}),e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold tracking-tight",children:"Conversations to jump into"}),e.jsxs("span",{className:"ml-auto inline-flex items-center gap-1.5 text-[10px] font-mono uppercase tracking-wider text-muted-foreground",children:[e.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-primary"})]}),"Live"]})]}),e.jsx("div",{className:"space-y-2",children:s?Array.from({length:4}).map((r,o)=>e.jsx(Ws,{className:"h-20 w-full"},o)):a.map((r,o)=>{const n=jl[r.platform]||jl.linkedin,l=n.Icon;return e.jsx(Uj,{variant:"rise-soft",delay:o*70,children:e.jsx(U,{className:"lpc-lift group p-3.5 md:p-4 border border-border/80 hover:border-primary/40 transition-colors",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(l,{className:"w-4 h-4 mt-0.5 shrink-0",style:{color:n.color}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 text-[11px] text-muted-foreground",children:[e.jsxs("span",{className:"font-semibold text-foreground",children:["@",r.handle]}),e.jsx("span",{children:"·"}),e.jsx("span",{children:r.persona}),e.jsx("span",{children:"·"}),e.jsx("span",{children:r.time}),e.jsxs("span",{className:"ml-auto inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-primary tabular-nums",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-primary"}),r.score]})]}),e.jsx("p",{className:"text-sm text-foreground/90 leading-snug",children:r.text})]})]})})},r.id)})})]})})}const Yj=["Friendly","Expert","Direct"];function Kj(s,t,a){const r=s.replace(/^["']|["']$/g,"").trim();switch(t){case"Friendly":return`Been there. We built ${a} for exactly this â happy to share what worked. No pitch.`;case"Expert":return r.length>30?r:`Two things solve this: tighter ICP filters up front, and replying inside the original thread, not in DMs. ${a} does both.`;case"Direct":return`Same problem. ${a} fixes it. Want a 90-sec loom?`}}function Xj({text:s}){const[t,a]=i.useState("");return i.useEffect(()=>{a("");let r=0;const o=setInterval(()=>{r++,a(s.slice(0,r)),r>=s.length&&clearInterval(o)},12);return()=>clearInterval(o)},[s]),e.jsxs("span",{children:[t,e.jsx("span",{className:"lpc-caret"})]})}function Qj({loading:s,data:t}){const[a,r]=i.useState("Friendly"),o=(t==null?void 0:t.productName)||"we",n=(t==null?void 0:t.sample_reply)||"",l=i.useMemo(()=>Kj(n,a,o),[n,a,o]);return e.jsx("section",{id:"step-3",className:"px-4 py-14 md:py-20",children:e.jsxs("div",{className:"container mx-auto max-w-3xl",children:[e.jsxs("div",{className:"flex items-baseline gap-3 mb-6",children:[e.jsx("span",{className:"text-[10px] font-mono text-primary tabular-nums",children:"03"}),e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold tracking-tight",children:"Replies in your voice"})]}),s||!t?e.jsx(Ws,{className:"h-56 w-full"}):e.jsxs(U,{className:"relative p-5 md:p-6 border border-primary/30 bg-gradient-to-br from-primary/5 to-background overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 right-0 w-40 h-40 bg-primary/10 rounded-full blur-3xl pointer-events-none"}),e.jsxs("div",{className:"relative flex items-center justify-between mb-4 gap-2 flex-wrap",children:[e.jsxs("div",{className:"inline-flex items-center gap-1.5 text-[10px] font-mono uppercase tracking-wider text-primary",children:[e.jsx(es,{className:"w-3 h-3"}),"Drafted"]}),e.jsx("div",{className:"flex gap-0.5 rounded-full bg-background/80 border border-border p-0.5",children:Yj.map(c=>e.jsx("button",{onClick:()=>r(c),className:`text-[11px] font-medium px-2.5 py-1 rounded-full transition-all ${a===c?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,children:c},c))})]}),e.jsx("p",{className:"relative text-base md:text-lg text-foreground leading-relaxed min-h-[5rem] font-display",children:e.jsx(Xj,{text:l})},a)]}),e.jsx("div",{className:"mt-3 px-5 py-3 rounded-lg border border-dashed border-border/70 bg-muted/30",children:e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(Et,{className:"w-3.5 h-3.5 mt-0.5 text-muted-foreground shrink-0"}),e.jsx("p",{className:"text-xs text-muted-foreground italic leading-relaxed",children:'Generic AI: "Great question! Have you considered automating your workflow?â¦"'})]})})]})})}function Jj({to:s,run:t}){const[a,r]=i.useState(0);return i.useEffect(()=>{if(!t)return;let o=0;const n=performance.now(),l=1400,c=x=>{const d=Math.min(1,(x-n)/l),u=1-Math.pow(1-d,3);r(Math.round(s*u)),d<1&&(o=requestAnimationFrame(c))};return o=requestAnimationFrame(c),()=>cancelAnimationFrame(o)}
151,[s,t]),e.jsx(e.Fragment,{children:a.toLocaleString()})}function Zj({data:s}){var x,d;const t=((x=s==null?void 0:s.recommended_platforms)==null?void 0:x.length)||3,a=((d=s==null?void 0:s.personas)==null?void 0:d.length)||3,r=180+t*65+a*30,o=Math.round(r*.32),n=Math.round(o*.16),{ref:l,isVisible:c}=Jd({threshold:.3});return e.jsx("section",{id:"step-4",className:"px-4 py-14 md:py-20 bg-muted/20 border-y border-border/40",children:e.jsxs("div",{ref:l,className:"container mx-auto max-w-3xl",children:[e.jsxs("div",{className:"flex items-baseline gap-3 mb-6",children:[e.jsx("span",{className:"text-[10px] font-mono text-primary tabular-nums",children:"04"}),e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold tracking-tight",children:"30 days, projected"})]}),e.jsxs(U,{className:"p-6 md:p-8 border border-border/80 bg-background",children:[e.jsx("div",{className:"grid grid-cols-3 divide-x divide-border/60",children:[{n:r,label:"conversations"},{n:o,label:"replies"},{n,label:"leads"}].map((u,m)=>e.jsxs("div",{className:"px-2 md:px-4 first:pl-0 last:pr-0",children:[e.jsx("div",{className:"text-3xl md:text-5xl font-display font-bold text-foreground tabular-nums leading-none",children:e.jsx(Jj,{to:u.n,run:c})}),e.jsx("div",{className:"text-[11px] uppercase tracking-wider text-muted-foreground mt-2 font-medium",children:u.label})]},m))}),e.jsx("p",{className:"mt-5 text-[11px] text-muted-foreground/70",children:"Based on median user activity. Not a guarantee."})]})]})})}const ey="https://chromewebstore.google.com/";function sy({domain:s}){const t=ns(),[a,r]=i.useState(!1),[o,n]=i.useState(""),[l,c]=i.useState(!1),[x,d]=i.useState(!1),[u,m]=i.useState(""),p=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o),g=()=>{r(!0),window.open(ey,"_blank","noopener,noreferrer")},v=async b=>{if(b.preventDefault(),!p||l)return;const z=o.trim().toLowerCase();c(!0);const{error:C}=await w.from("lp_email_captures").insert({email:z,domain:s,source:"lp_convert"});if(c(!1),C){k.error("Couldn't save your email",{description:C.message});return}d(!0),m(z),n(""),k.success("You're in.",{description:`We'll send your dashboard link to ${z}.`})};return e.jsxs("section",{id:"step-5",className:"relative px-4 py-20 md:py-24 overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 -z-10",children:e.jsx("div",{className:"lpc-mesh-a absolute -top-40 left-1/2 -translate-x-1/2 w-[50rem] h-[50rem] rounded-full blur-3xl op
151acity-60"})}),e.jsxs("div",{className:"container mx-auto max-w-xl",children:[e.jsxs("div",{className:"flex items-baseline justify-center gap-3 mb-5",children:[e.jsx("span",{className:"text-[10px] font-mono text-primary tabular-nums",children:"05"}),e.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-muted-foreground",children:"Activate"})]}),e.jsxs("h2",{className:"text-4xl md:text-5xl font-display font-semibold leading-[1.04] tracking-tight mb-3 text-center",children:["Start in ",e.jsx("span",{className:"text-primary",children:"2 minutes"}),"."]}),e.jsx("p",{className:"text-sm md:text-base text-muted-foreground mb-8 text-center",children:"Free 24h trial. No card. Posts under your own accounts."}),e.jsx("div",{className:"flex items-center justify-center gap-2 mb-6",children:[1,2,3].map(b=>{const z=b===1&&a||b===2&&x,C=b===1&&!a||b===2&&a&&!x||b===3&&a&&x;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`flex items-center justify-center w-6 h-6 rounded-full text-[11px] font-semibold tabular-nums transition-all ${z?"bg-primary text-primary-foreground":C?"bg-foreground text-background":"bg-muted text-muted-foreground"}`,children:z?e.jsx(bs,{className:"w-3.5 h-3.5"}):b}),b<3&&e.jsx("span",{className:`block w-8 h-px transition-colors ${z?"bg-primary":"bg-border"}`})]},b)})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:`rounded-2xl border p-5 transition-all ${a?"border-primary/30 bg-primary/5":"border-border bg-background shadow-sm"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-background border border-border/80 flex items-center justify-center shrink-0",children:e.jsx(pa,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Install the extension"}),a&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono uppercase tracking-wider text-primary",children:[e.jsx(bs,{className:"w-3 h-3"})," opened"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Posts under your own accounts. ~30 seconds."}),e.jsxs(h,{size:"sm",variant:a?"outline":"default",onClick:g,className:"lpc-press gap-2 h-9",children:[a?"Reopen Chrome Store":"Add to Chrome",e.jsx(Ns,{className:"w-3.5 h-3.5"})]})]})]})}),e.jsx("div",{className:`rounded-2xl border p-5 transition-all ${a?x?"border-primary/30 bg-primary/5":"border-primary/40 bg-background shadow-md":"border-border/60 bg-muted/20 opacity-60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-background border border-border/80 flex items-center justify-center shrink-0",children:e.jsx(Fs,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Where do we send your dashboard link?"}),x&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono uppercase tracking-wider text-primary",children:[e.jsx(bs,{className:"w-3 h-3"})," saved"]})]}),x?e.jsxs("p",{className:"text-xs text-muted-foreground",children:[u," â we'll keep it short, promise."]}):e.jsxs("form",{onSubmit:v,className:"flex gap-2",children:[e.jsx(Je,{type:"email",inputMode:"email",autoComplete:"email",placeholder:"[email protected]",value:o,onChange:b=>n(b.target.value),disabled:!a||l,className:"h-9 text-sm"}),e.jsx(h,{type:"submit",size:"sm",disabled:!a||!p||l,className:"lpc-press gap-1.5 h-9 shrink-0",children:l?e.jsx(Pe,{className:"w-3.5 h-3.5 animate-spin"}):e.jsxs(e.Fragment,{children:["Save ",e.jsx(Ns,{className:"w-3.5 h-3.5"})]})})]})]})]})}),e.jsx("div",{className:`rounded-2xl border p-5 transition-all ${x?"border-primary bg-gradient-to-br from-primary/10 to-background shadow-xl shadow-primary/15":"border-border/60 bg-muted/20 opacity-60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-background border border-border/80 flex items-center justify-center shrink-0 text-sm font-semibold tabular-nums",children:"â"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold mb-1",children:"Open your dashboard"}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"We'll set up your profile and start surfacing buyers."}),e.jsxs(h,{size:"sm",onClick:()=>
151t("/dashboard"),className:"lpc-press gap-2 h-9 font-semibold",children:[s?`Continue for ${s}`:"Continue to dashboard",e.jsx(Ns,{className:"w-3.5 h-3.5"})]})]})]})})]}),e.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-x-6 gap-y-2 text-[11px] text-muted-foreground/80 font-mono uppercase tracking-wider",children:[e.jsx("span",{children:"No card"}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-border"}),e.jsx("span",{children:"Cancel anytime"}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-border"}),e.jsx(Ls,{to:"/auth",className:"hover:text-foreground transition-colors",children:"already have an account?"})]})]})]})}function ty({steps:s}){const[t,a]=i.useState(0),r=i.useRef(null);return i.useEffect(()=>{const o=()=>{const l=window.scrollY+window.innerHeight*.4;let c=0;for(let x=0;x<s.length;x++){const d=document.getElementById(s[x].id);d&&d.offsetTop<=l&&(c=x)}a(x=>x===c?x:c)},n=()=>{r.current==null&&(r.current=requestAnimationFrame(()=>{r.current=null,o()}))};return o(),window.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n,{passive:!0}),()=>{window.removeEventListener("scroll",n),window.removeEventListener("resize",n),r.current!=null&&cancelAnimationFrame(r.current)}},[s]),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden lg:flex fixed left-6 top-1/2 -translate-y-1/2 z-30 flex-col gap-3",children:s.map((o,n)=>e.jsxs("a",{href:`#${o.id}`,className:"group flex items-center gap-3",children:[e.jsx("span",{className:`block h-1.5 rounded-full transition-[width,background-color,opacity] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] ${n===t?"w-10 bg-primary shadow-[0_0_12px_hsl(var(--primary)/0.55)]":n<t?"w-5 bg-primary/55":"w-3 bg-border"}`}),e.jsx("span",{className:`text-xs font-medium transition-opacity ${n===t?"opacity-100 text-foreground":"opacity-0 group-hover:opacity-70"}`,children:o.label})]},o.id))}),e.jsx("div",{className:"lg:hidden sticky top-[57px] z-30 backdrop-blur-md bg-background/85 border-b border-border/50",children:e.jsxs("div",{className:"container mx-auto px-4 py-2 flex items-center gap-1.5",children:[s.map((o,n)=>e.jsx("span",{className:`h-1 flex-1 rounded-full transition-all duration-500 ${n<=t?"bg-primary":"bg-border"}`},o.id)),e.jsxs("span",{className:"ml-2 text-[10px] font-semibold text-muted-foreground tabular-nums",children:[t+1,"/",s.length]})]})})]})}function ay({onDismiss:s}){const t=ns(),[a,r]=i.useState(!0);if(!a)return null;const o=()=>{r(!1),s==null||s()};return e.jsx("div",{className:"container mx-auto px-4 pt-4",children:e.jsxs("div",{role:"region","aria-label":"Welcome â finish setting up your product profile",className:"relative overflow-hidden rounded-2xl border border-primary/30 bg-gradient-to-br from-primary/10 via-background/40 to-amber-500/10 backdrop-blur-md p-5 sm:p-6 shadow-[0_8px_32px_-12px_hsl(var(--primary)/0.4)]",children:[e.jsx("div",{className:"pointer-events-none absolute -top-16 -right-16 h-48 w-48 rounded-full bg-primary/20 blur-3xl"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-20 -left-10 h-40 w-40 rounded-full bg-amber-500/10 blur-3xl"}),e.jsx("button",{type:"button",onClick:o,"aria-label":"Dismiss",className:"absolute right-3 top-3 rounded-md p-1.5 text-muted-foreground hover:text-foreground hover:bg-foreground
151/5 transition-colors",children:e.jsx(zs,{className:"h-4 w-4"})}),e.jsxs("div",{className:"relative flex flex-col sm:flex-row sm:items-center gap-4 sm:gap-6",children:[e.jsxs("div",{className:"flex items-start gap-3 sm:items-center flex-1 min-w-0",children:[e.jsx("div",{className:"shrink-0 inline-flex h-10 w-10 items-center justify-center rounded-xl bg-primary/15 text-primary ring-1 ring-primary/30",children:e.jsx(es,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-primary/90",children:"Welcome to deSHILLER"}),e.jsx("h2",{className:"mt-1 font-display text-lg sm:text-xl font-semibold leading-snug text-foreground",children:"Let's set up your product profile first"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground leading-relaxed",children:"We sent you here so you can drop your URL and we can read your site. That feeds your product profile â what we use to find buyers and draft replies in your voice. It takes about a minute."})]})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:flex-col sm:items-stretch sm:w-auto shrink-0",children:[e.jsxs(h,{size:"lg",onClick:()=>t("/dashboard?view=product"),className:"group whitespace-nowrap bg-primary text-primary-foreground hover:bg-primary/90 shadow-md",children:["Continue to product profile",e.jsx(Ns,{className:"ml-2 h-4 w-4 transition-transform group-hover:translate-x-0.5"})]}),e.jsx("button",{type:"button",onClick:o,className:"text-xs text-muted-foreground hover:text-foreground transition-colors text-center px-2 py-1",children:"Or try the URL flow below"})]})]})]})})}const ry=[{id:"step-0",label:"Start"},{id:"step-1",label:"Your site"},{id:"step-2",label:"Conversations"},{id:"step-3",label:"Reply"},{id:"step-4",label:"Projection"},{id:"step-5",label:"Activate"}];function ny(){const{analyze:s,loading:t,data:a,progressLabel:r}=em(),[o,n]=i.useState(null),l=i.useRef(null),[c,x]=i.useState(()=>{if(typeof sessionStorage>"u")return!1;try{for(let u=0;u<sessionStorage.length;u++){const m=sessionStorage.key(u);if(m&&m.startsWith("deshiller_lp_seen_")&&sessionStorage.getItem(m)==="1")return sessionStorage.setItem(m,"consumed"),!0}}catch{}return!1});i.useEffect(()=>{document.title="Show me buyers for my site â DESHILLER";const u=document.querySelector('meta[name="description"]');u&&u.setAttribute("content","Drop your website. We read it, surface live buyer conversations, and draft replies in your voice â all on this page, before you sign up.")},[]);const d=async u=>{const m=u.replace(/^https?:\/\//,"").split("/")[0];n(m),setTimeout(()=>{var p;(p=l.current)==null||p.scrollIntoView({behavior:"smooth",block:"start"})},250),await s(u)};return e.jsxs("div",{className:"min-h-screen bg-background lpc-page-enter",children:[e.jsx("nav",{className:"sticky top-0 z-40 backdrop-blur-md bg-background/80 border-b border-border/50",children:e.jsxs("div",{className:"container mx-auto px-4 py-3 flex items-center justify-between",children:[e.jsx(Ls,{to:"/",className:"text-xl font-display font-bold tracking-tight hover:text-primary transition-colors",children:"DESHILLER"}),e.jsx(Ls,{to:"/auth",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Sign in"})]})}),e.jsx(ty,{steps:ry}),e.jsxs("main",{children:[c&&e.jsx(ay,{onDismiss:()=>x(!1)}),e.jsx(Hj,{onSubmit:d,loading:t,progressLabel:r}),e.jsx("div",{ref:l,children:(t||a)&&e.jsxs(e.Fragment,{children:[e.jsx(Gj,{loading:t,data:a,domain:o}),e.jsx(Vj,{loading:t,data:a}),e.jsx(Qj,{loading:t,data:a}),e.jsx(Zj,{data:a}),e.jsx(sy,{domain:o})]})})]}),e.jsx("footer",{className:"border-t border-border/50 py-6 px-4",children:e.jsxs("div",{className:"container mx-auto text-center text-xs text-muted-foreground",children:["© ",new Date().getFullYear()," DESHILLER ·"," ",e.jsx(Ls,{to:"/privacy",className:"hover:text-foreground",children:"Privacy"})," ·"," ",e.jsx(Ls,{to:"/terms",className:"hover:text-foreground",children:"Terms"})]})})]})}const ui=[{slug:"generative-engine-optimization-guide",title:"Generative Engine Optimization (GEO): The 2026 Playbook",excerpt:"Search isn't ten blue links anymore. GEO is how brands rank inside ChatGPT, Perplexity, Claude and Google AI Overviews â the citation factors, content patterns and 30-day sprint that actually move the needle.",category:"AI Strategy",readTime:"15 min",icon:es},{slug:"reddit-seo-rank-on-google",title:"Reddit SEO: How Reddit Threads Rank #1 on Google",excerpt:"Since the 2024 RedditâGoogle data deal, Reddit owns the first page of nearly every commercial-intent SERP. Here's how to make sure the thread that ranks mentions you â without getting banned.",category:"SEO",readTime:"13 min",icon:Ks},{slug:"topical-authority-social-conversations",title:"Topical Authority Through Social Conversations: The Modern E-E-A-T Playbook",excerpt:"Authority used to be a property of a domain. Now it's a property of an entity, measured across the web. How to use LinkedIn, X and Reddit to send the E-E-A-T signals that lift every URL you own.",category:"SEO",readTime:"14 min",icon:gs},{slug:"aio-ranking-social-comments",title:"How to Rank in AI Search (AIO) Using Social Comments",excerpt:"AI search engines prioritize real conversations. Learn how to leverage social commenting to dominate AI-generated answers and get recommended by ChatGPT, Perplexity, and Google AI Overviews.",category:"AI Strategy",readTime:"14 min",icon:ln},{slug:"social-engagement-ai-agents",title:"Why Social Engagement Must Be Part of Your AI Agent Stack",excerpt:"AI agents can write code and analyze data, but without social engagement they miss the highest-ROI growth channel. Learn how to connect Claude, n8n, Replit, and more.",category:"AI Agents",readTime:"16 min",icon:Et},{slug:"social-media-automation-guide",title:"The Complete Guide to Social Media Automation in 2025",excerpt:"Learn how to automate your social media presence while maintaining authenticity and driving real engagement.",category:"Automation",readTime:"12 min",icon:ws},{slug:"ai-reply-generation-best-practices",title:"AI Reply Generation: Best Practices for Authentic Engagement",excerpt:"Master the art of using AI to generate replies that sound human and build genuine connections.",category:"AI Strategy",readTime:"10 min",icon:ks},{slug:"twitter-engagement-strategy",title:"How to Build a Twitter Engagement Strategy That Works",excerpt:"Proven tactics to increase your Twitter reach, engagement, and follower growth in 2025.",category:"Twitter",readTime:"15 min",icon:gs},{slug:"linkedin-lead-generation",title:"LinkedIn Lead Generation: The Ultimate Guide for B2B",excerpt:"Turn LinkedIn into your top lead generation channel with these proven strategies.",category:"LinkedIn",readTime:"18 min",icon:ks},{slug:"reddit-marketing-strategy",title:"Reddit Marketing Without Getting Banned: A Complete Guide",excerpt:"Navigate Reddit's strict community guidelines while effectively promoting your product.",category:"Reddit",readTime:"14 min",icon:xr}
151,{slug:"social-listening-tools",title:"Top 10 Social Listening Tools for Brand Monitoring",excerpt:"Compare the best social listening platforms to track mentions and find opportunities.",category:"Tools",readTime:"11 min",icon:ws},{slug:"engagement-rate-optimization",title:"How to Double Your Social Media Engagement Rate",excerpt:"Data-driven strategies to significantly improve your engagement metrics across all platforms.",category:"Strategy",readTime:"13 min",icon:gs},{slug:"b2b-social-selling",title:"B2B Social Selling: Convert Conversations Into Customers",excerpt:"Transform your social media presence into a reliable B2B sales channel.",category:"Sales",readTime:"16 min",icon:ks},{slug:"content-marketing-automation",title:"Content Marketing Automation: Save 10 Hours Per Week",excerpt:"Automate your content distribution without sacrificing quality or authenticity.",category:"Automation",readTime:"12 min",icon:ws},{slug:"competitor-monitoring-strategy",title:"Competitive Intelligence: Monitor Competitors on Social Media",excerpt:"Track competitor activity and identify gaps in their strategy you can exploit.",category:"Strategy",readTime:"14 min",icon:ks},{slug:"influencer-outreach-tactics",title:"Influencer Outreach That Actually Gets Responses",excerpt:"Proven templates and strategies for connecting with influencers in your niche.",category:"Outreach",readTime:"10 min",icon:xr},{slug:"social-media-roi-measurement",title:"How to Measure Social Media ROI (With Real Examples)",excerpt:"Stop guessing and start proving the value of your social media efforts.",category:"Analytics",readTime:"15 min",icon:gs},{slug:"personal-branding-executives",title:"Personal Branding for Executives: Build Authority Online",excerpt:"Establish yourself as a thought leader and attract opportunities through social media.",category:"Branding",readTime:"13 min",icon:ks},{slug:"crisis-management-social-media",title:"Social Media Crisis Management: A Step-by-Step Response Plan",excerpt:"Prepare for and respond to negative situations before they damage your brand.",category:"Management",readTime:"17 min",icon:ws},{slug:"employee-advocacy-programs",title:"Building Employee Advocacy Programs That Scale",excerpt:"Turn your team into brand ambassadors and amplify your social reach organically.",category:"Strategy",readTime:"12 min",icon:gs},{slug:"hashtag-strategy-guide",title:"Advanced Hashtag Strategy for Maximum Reach",excerpt:"Research, select, and use hashtags strategically to expand your audience.",category:"Growth",readTime:"11 min",icon:ks},{slug:"video-content-strategy",title:"Video Content Strategy for Social Media in 2025",excerpt:"Create scroll-stopping video content that drives engagement and conversions.",category:"Content",readTime:"14 min",icon:xr},{slug:"community-building-tactics",title:"Community Building: How to Create a Loyal Audience",excerpt:"Foster genuine relationships and build a community that advocates for your brand.",category:"Community",readTime:"16 min",icon:gs},{slug:"social-commerce-strategies",title:"Social Commerce: Sell Directly on Social Platforms",excerpt:"Leverage social shopping features to reduce friction and increase conversions.",category:"Commerce",readTime:"13 min",icon:ws},{slug:"algorithm-optimization",title:"Mastering Social Media Algorithms: Get More Visibility",excerpt:"Understand how algorithms work and optimize your content for maximum reach.",category:"Growth",readTime:"15 min",icon:ks},{slug:"customer-service-social-media",title:"Social Media Customer Service: Best Practices Guide",excerpt:"Turn customer inquiries into opportunities to showcase your brand values.",category:"Service",readTime:"12 min",icon:xr},{slug:"ugc-content-strategy",title:"User-Generated Content: How to Get Customers to Create for You",excerpt:"Encourage and leverage user-generated content to build trust and authenticity.",category:"Content",readTime:"11 min",icon:gs},{slug:"paid-social-advertising",title:"Paid Social Advertising: ROI-Focused Campaign Strategies",excerpt:"Create profitable paid social campaigns with proven targeting and creative tactics.",category:"Advertising",readTime:"18 min",icon:ws},{slug:"social-media-analytics",title:"Social Media Analytics: Metrics That Actually Matter",excerpt:"Focus on the KPIs that drive business results, not vanity metrics.",category:"Analytics",readTime:"14 min",icon:ks},{slug:"influencer-partnerships",title:"Influencer Partnership Guide: From Outreach to ROI",excerpt:"Build mutually beneficial influencer relationships that deliver measurable results.",category:"Partnerships",readTime:"16 min",icon:xr},{slug:"brand-voice-development",title:"Developing a Distinctive Brand Voice on Social Media",excerpt:"Create a consistent, recognizable voice that resonates with your target audience.",category:"Branding",readTime:"12 min",icon:gs},{slug:"social-media-audit",title:"Social Media Audit Checklist: Optimize Your Presence",excerpt:"Conduct a comprehensive audit to identify opportunities and fix weaknesses.",category:"Strategy",readTime:"15 min",icon:ks},{slug:"content-calendar-planning",title:"Content Calendar Planning: Stay Consistent Without Burnout",excerpt:"Create a sustainable content calendar that keeps you consistent and strategic.",category:"Planning",readTime:"11 min",icon:ws},{slug:"social-proof-strategies",title:"Social Proof Strategies to Build Trust and Credibility",excerpt:"Leverage testimonials, reviews, and social validation to increase conversions.",category:"Conversion",readTime:"13 min",icon:xr},{slug:"cross-platform-strategy",title:"Cross-Platform Social Media Strategy: Maximize Your Reach",excerpt:"Coordinate your efforts across platforms while respecting each platform's unique culture.",category:"Strategy",readTime:"17 min",icon:gs}],iy=()=>{const s=ns(),[t,a]=i.useState(""),[r,o]=i.useState(null),n=i.useMemo(()=>Array.from(new Set(ui.map(p=>p.category))),[]),l=ui.filter(p=>{const g=t.toLowerCase(),v=!g||p.title.toLowerCase().includes(g)||p.excerpt.toLowerCase().includes(g)||p.category.toLowerCase().includes(g),b=!r||p.category===r;return v&&b}),c=!!t||!!r,[x,...d]=l,u=d.slice(0,2),m=d.slice(2);return e.jsxs("div",{className:"min-h-screen bg-background text-foreground relative overflow-hidden",children:[e.jsx(Vt,{title:"Academy â social engagement & lead-gen guides | deSHILLER",description:"Long-form playbooks on social media automation, AI replies, B2B social selling, and turning conversations on X, LinkedIn, Reddit and Quora into qualified meetings.",path:"/academy"}
151),e.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 top-0 h-[720px] overflow-hidden",children:[e.jsx("div",{className:"absolute -top-40 left-1/2 -translate-x-1/2 w-[1200px] h-[1200px] rounded-full bg-primary/10 blur-[140px]"}),e.jsx("div",{className:"absolute top-32 -right-32 w-[500px] h-[500px] rounded-full bg-primary/5 blur-[100px]"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_1px_1px,hsl(var(--foreground)/0.04)_1px,transparent_0)] [background-size:32px_32px]"})]}),e.jsx(Ma,{}),e.jsx("section",{className:"relative max-w-7xl mx-auto px-6 lg:px-8 pt-32 lg:pt-40 pb-16",children:e.jsxs("div",{className:"max-w-4xl",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full border border-primary/20 bg-primary/5 backdrop-blur-sm mb-8",children:[e.jsx(es,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"text-xs font-medium tracking-wide uppercase text-primary",children:"The Academy"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",ui.length," playbooks"]})]}),e.jsxs("h1",{className:"font-display font-semibold tracking-tight text-5xl md:text-7xl lg:text-[5.5rem] leading-[0.95]",children:["Field notes on"," ",e.jsx("span",{className:"italic text-primary/90",children:"social pipeline"}),",",e.jsx("br",{className:"hidden md:block"}),"written by operators."]}),e.jsx("p",{className:"mt-8 text-lg md:text-xl text-muted-foreground max-w-2xl leading-relaxed",children:"Playbooks, agent architecture and B2B social selling tactics. Practical guides for teams running pipeline through social â without burning their accounts."}),e.jsx("div",{className:"mt-10 flex flex-col sm:flex-row gap-3 max-w-2xl",children:e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Ks,{className:"absolute left-4 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(Je,{type:"text",placeholder:"Search playbooks, tactics, platformsâ¦",value:t,onChange:p=>a(p.target.value),className:"pl-11 pr-10 h-12 bg-card/40 backdrop-blur-md border-border/40 text-base focus-visible:ring-primary/30"}),t&&e.jsx("button",{onClick:()=>a(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(Rt,{className:"h-4 w-4"})})]})})]})}),e.jsxs("section",{className:"relative max-w-7xl mx-auto px-6 lg:px-8 pb-12",children:[e.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto pb-2 -mx-1 px-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[e.jsx("button",{onClick:()=>o(null),className:`shrink-0 px-4 py-2 rounded-full text-sm font-medium transition-all border ${r===null?"bg-foreground text-background border-foreground":"bg-card/30 border-border/40 text-muted-foreground hover:text-foreground hover:border-border"}`,children:"All"}),n.map(p=>e.jsx("button",{onClick:()=>o(p),className:`shrink-0 px-4 py-2 rounded-full text-sm font-medium transition-all border ${r===p?"bg-foreground text-background border-foreground":"bg-card/30 border-border/40 text-muted-foreground hover:text-foreground hover:border-border"}`,children:p},p))]}),e.jsxs("div",{className:"mt-4 text-xs text-muted-foreground uppercase tracking-wider",children:[l.length," ",l.length===1?"article":"articles",r&&` · ${r}`,t&&` · "${t}"`]})]}),x&&!c&&e.jsx("section",{className:"relative max-w-7xl mx-auto px-6 lg:px-8 pb-20",children:e.jsxs("div",{className:"grid lg:grid-cols-3 gap-6 lg:gap-8",children:[e.jsxs("article",{onClick:()=>s(`/academy/${x.slug}`),className:"group lg:col-span-2 relative cursor-pointer overflow-hidden rounded-3xl border border-border/40 bg-gradient-to-br from-card/80 via-card/40 to-card/10 backdrop-blur-xl p-8 md:p-12 min-h-[460px] flex flex-col justify-between transition-all hover:border-primary/40",children:[e.jsx("div",{className:"absolute -top-32 -right-32 w-[400px] h-[400px] rounded-full bg-primary/10 blur-3xl group-hover:bg-primary/20 transition-all duration-700"}),e.jsxs("div",{className:"relative flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-[10px] font-bold tracking-[0.2em] uppercase text-primary",children:"Featured"}),e.jsx("span",{className:"w-8 h-px bg-primary/40"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:x.category})]}),e.jsx(xn,{className:"h-5 w-5 text-muted-foreground group-hover:text-primary group-hover:rotate-12 transition-all"})]}),e.jsxs("div",{className:"relative space-y-6 mt-8",children:[e.jsx("h2",{className:"font-display font-semibold text-3xl md:text-5xl leading-[1.05] tracking-tight group-hover:text-primary transition-colors",children:x.title}),e.jsx("p",{className:"text-base md:text-lg text-muted-foreground leading-relaxed max-w-2xl",children:x.excerpt}),e.jsxs("div",{className:"flex items-center gap-4 pt-2 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Cs,{className:"h-3.5 w-3.5"}),x.readTime," read"]}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-border"}),e.jsx("span",{className:"font-medium text-foreground",children:"Read the playbook"}),e.jsx(Ns,{className:"h-3.5 w-3.5 group-hover:translate-x-1 transition-transform"})]})]})]}),e.jsx("div",{className:"flex flex-col gap-6 lg:gap-8",children:u.map(p=>e.jsxs("article",{onClick:()=>s(`/academy/${p.slug}`),className:"group flex-1 relative cursor-pointer overflow-hidden rounded-3xl border border-border/40 bg-card/30 backdrop-blur-md p-6 md:p-7 flex flex-col justify-between min-h-[218px] transition-all hover:border-primary/40 hover:bg-card/50",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] font-bold tracking-[0.2em] uppercase text-muted-foreground",children:"Editor's pick"}),e.jsx(p.icon,{className:"h-4 w-4 text-primary/70"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"font-display font-semibold text-lg md:text-xl leading-snug group-hover:text-primary transition-colors",children:p.title}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsx("span",{children:p.category}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-border"}),e.jsx("span",{children:p.readTime})]})]})]},p.slug))})]})}),e.jsxs("section",{className:"relative max-w-7xl mx-auto px-6 lg:px-8 pb-24",children:[!c&&m.length>0&&e.jsx("div",{className:"flex items-end justify-between mb-10 pb-6 border-b border-border/40",children:e.jsxs("div",{children:[e.jsx("h2",{className:"font-display text-2xl md:text-3xl font-semibold",children:"The Archive"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Every playbook, sorted for builders."})]})}),l.length===0?e.jsxs("div",{className:"text-center py-24 border border-dashed border-border/40 rounded-3xl",children:[e.jsx("p",{className:"text-muted-foreground text-lg",children:"No articles found matching your criteria."}),e.jsx(h,{variant:"outline",className:"mt-4",onClick:()=>{a(""),o(null)},children:"Reset filters"})]}):e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-px bg-border/30 rounded-3xl overflow-hidden border border-border/40",children:(c?l:m).map(p=>e.jsxs("article",{onClick:()=>s(`/academy/${p.slug}`),className:"group relative cursor-pointer bg-background hover:bg-card/40 p-7 md:p-8 flex flex-col gap-5 transition-all min-h-[280px]",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] font-bold tracking-[0.18em] uppercase text-primary/80",children:p.category}),e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(Cs,{className:"h-3 w-3"}),p.readTime]})]}),e.jsx("h3",{className:"font-display font-semibold text-xl leading-snug tracking-tight group-hover:text-primary transition-colors line-clamp-3",children:p.title}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-3 flex-1",children:p.excerpt}),e.jsxs("div",{className:"flex items-center gap-1.5 text-sm font-medium text-foreground
151/80 group-hover:text-primary transition-colors",children:["Read",e.jsx(xn,{className:"h-3.5 w-3.5 group-hover:rotate-12 transition-transform"})]}),e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-px bg-gradient-to-r from-transparent via-primary/40 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"})]},p.slug))})]}),e.jsx(_s,{})]})},it=({title:s,description:t,category:a,readTime:r,publishDate:o,lastUpdated:n,featuredImage:l,author:c,stats:x})=>e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[e.jsx(W,{className:"bg-primary/10 text-primary hover:bg-primary/20",children:a}),x&&e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[x.views&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(gs,{className:"h-4 w-4"}),x.views," views"]}),x.shares&&e.jsxs("span",{children:[x.shares," shares"]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h1",{className:"text-4xl lg:text-5xl font-display font-bold leading-tight",children:s}),e.jsx("p",{className:"text-xl text-muted-foreground leading-relaxed",children:t})]}),e.jsxs("div",{className:"flex items-start gap-4 pb-6 border-b border-border/50",children:[e.jsxs(Ur,{className:"h-12 w-12",children:[e.jsx(Vi,{src:c.avatar,alt:c.name}),e.jsx(Wr,{children:c.name.split(" ").map(d=>d[0]).join("")})]}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold",children:c.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c.role})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground flex-wrap",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ea,{className:"h-4 w-4"}),o]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Cs,{className:"h-4 w-4"}),r]}),n&&e.jsxs("span",{className:"text-xs",children:["Updated: ",n]})]})]})]}),e.jsx("div",{className:"rounded-xl overflow-hidden border border-border/50",children:e.jsx("img",{src:l,alt:s,className:"w-full h-[400px] object-cover"})})]}),ot=({items:s})=>{const[t,a]=i.useState("");i.useEffect(()=>{const o=new IntersectionObserver(n=>{n.forEach(l=>{l.isIntersecting&&a(l.target.id)})},{rootMargin:"-20% 0% -35% 0%"});return s.forEach(({id:n})=>{const l=document.getElementById(n);l&&o.observe(l)}),()=>o.disconnect()},[s]);const r=o=>{const n=document.getElementById(o);if(n){const l=n.offsetTop-100;window.scrollTo({top:l,behavior:"smooth"})}};return e.jsxs("div",{className:"sticky top-24 space-y-3",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground mb-4",children:"On This Page"}),e.jsx("nav",{className:"space-y-1",children:s.map(o=>e.jsx("button",{onClick:()=>r(o.id),className:Z("block w-full text-left text-sm py-1 px-3 rounded transition-colors",o.level===3&&"pl-6",t===o.id?"text-primary bg-primary/10 font-medium":"text-muted-foreground hover:text-foreground hover:bg-accent"),children:o.text},o.id))})]})},lt=({articles:s})=>{const t=ns();return e.jsxs("div",{className:"space-y-6 mt-16 pt-12 border-t border-border/50",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold",children:"Read Next"}),e.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:s.map(a=>e.jsxs(U,{className:"cursor-pointer hover:border-primary/50 transition-all group",onClick:()=>t(a.path),children:[e.jsxs(Be,{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(W,{variant:"outline",className:"text-xs",children:a.category}),e.jsx("span",{className:"text-xs text-muted-foreground",children:a.readTime})]}),e.jsx($e,{className:"text-lg group-hover:text-primary transition-colors",children:a.title}),e.jsx(os,{className:"line-clamp-2",children:a.description})]}),e.jsx(ye,{children:e.jsxs("span",{className:"text-sm text-primary flex items-center gap-1 group-hover:gap-2 transition-all",children:["Read article ",e.jsx(Ns,{className:"h-4 w-4"})]})})]},a.path))})]})},Ze=({icon:s,stat:t,description:a,source:r})=>e.jsx("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 space-y-3",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 bg-primary/10 rounded-lg",children:e.jsx(s,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-2xl font-display font-bold text-foreground",children:t}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:a}
151),r&&e.jsxs("p",{className:"text-xs text-muted-foreground/60 mt-2 italic",children:["Source: ",r]})]})]})}),ct=({company:s,industry:t,challenge:a,solution:r,results:o,quote:n,author:l})=>e.jsxs("div",{className:"bg-primary/5 border border-primary/20 rounded-xl p-8 my-8 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-display font-bold text-foreground",children:s}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),e.jsx("div",{className:"px-4 py-2 bg-primary/10 rounded-full",children:e.jsx("span",{className:"text-sm font-semibold text-primary",children:"Case Study"})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold text-foreground mb-2",children:"Challenge"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold text-foreground mb-2",children:"Solution"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold text-foreground mb-2",children:"Results"}),e.jsx("ul",{className:"space-y-2",children:o.map((c,x)=>e.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsx("span",{children:c})]},x))})]})]}),n&&e.jsxs("div",{className:"pt-4 border-t border-primary/20",children:[e.jsx(cu,{className:"h-6 w-6 text-primary/40 mb-2"}),e.jsxs("p",{className:"text-sm italic text-muted-foreground",children:['"',n,'"']}),l&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["â ",l]})]})]}),oy=()=>{const s=ns(),t=[{id:"why-automation",text:"Why Social Media Automation Matters",level:2},{id:"three-pillars",text:"The 3 Pillars of Automation",level:2},{id:"scheduling",text:"Content Scheduling & Distribution",level:3},{id:"monitoring",text:"Social Listening & Monitoring",level:3},{id:"analytics",text:"Performance Analytics & Reporting",level:3},{id:"automation-stack",text:"The Automation Stack",level:2},{id:"common-mistakes",text:"Common Automation Mistakes",level:2},{id:"authenticity",text:"Maintaining Authenticity",level:2},{id:"measuring-success",text:"Measuring Success",level:2}],a=[{title:"AI Reply Generation Best Practices",description:"Learn how to create authentic AI-generated responses that drive real engagement",category:"AI & Automation",readTime:"8 min",path:"/academy/ai-reply-generation-best-practices"},{title:"Content Calendar Planning",description:"Build a sustainable content calendar that prevents burnout",category:"Planning",readTime:"7 min",path:"/academy/content-calendar-planning"},{title:"Social Media Analytics",description:"Master the metrics that matter for your social media strategy",category:"Analytics",readTime:"10 min",path:"/academy/social-media-analytics"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Complete Guide to Social Media Automation in 2025 | DESHILLER Academy"}),e.jsx("meta",{name:"description",content:"Master social media automation with proven strategies, real case studies, and data-driven insights. Learn how to scale your presence while maintaining authenticity."}),e.jsx("meta",{name:"keywords",content:"social media automation, marketing automation, social media tools, engagement automation, content scheduling"})]}),e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back to Academy"]})]})})}),e.jsx("article",{className:"max-w-7xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("div",{className:"space-y-12",children:[e.jsx(it,{title:"The Complete Guide to Social Media Automation in 2025",description:"Learn how to automate your social media presence while maintaining authenticity and driving real engagement. This comprehensive guide covers everything from tools to strategies, backed by real data and case studies.",category:"Automation",readTime:"15 min read",publishDate:"January 15, 2025",lastUpdated:"January 28, 2025",featuredImage:"https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=1200&h=400&fit=crop",author:{name:"Sarah Mitchell",role:"Head of Growth & Automation Strategy",avatar:"https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=100&h=100&fit=crop",bio:"10+ years leading social media automation at scale for SaaS companies"},stats:{views:"12.4K",shares:"847"}}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-12",children:[e.jsxs("section",{id:"why-automation",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Why Social Media Automation Matters in 2025"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 my-8",children:[e.jsx(Ze,{icon:Es,stat:"4.9B",description:"Active social media users worldwide",source:"DataReportal 2024"}),e.jsx(Ze,{icon:Cs,stat:"151 min",description:"Average daily time spent on social media",source:"GWI 2024"}),e.jsx(Ze,{icon:gs,stat:"73%",description:"Of businesses use automation for social media",source:"HubSpot State of Marketing 2024"}),e.jsx(Ze,{icon:Ht,stat:"$7.8B",description:"Social media automation market size by 2025",source:"Market Research Future"})]}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:`Social media automation has evolved from a "nice-to-have" to an essential strategy for businesses and individuals who want to scale their online presence without burning out. In 2025, the average business manages 4.8 social media platforms, posting 23 times per weekâa workload that's impossible to sustain manually.`}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"The key insight:"})," Successful automation isn't about replacing the human elementâit's about augmenting it. The best automation strategies handle repetitive tasks (scheduling, monitoring, reporting) while freeing you to focus on high-value activities like strategy, creative work, and genuine relationship building."]}),e.jsx(ct,{company:"TechFlow SaaS",industry:"B2B Software",challenge:"Marketing team of 3 managing 5 platforms, spending 40 hours/week on social media with declining engagement rates and no time for strategic work.",solution:"Implemented comprehensive automation stack: scheduling tool for content distribution, AI-powered discovery for relevant conversations, automated reporting dashboards.",results:["Reduced time spent on social media from 40 to 12 hours per week (70% reduction)","Increased engagement rate from 2.1% to 5.8% (176% improvement)","Generated 340 qualified leads in first 90 days from social engagement","ROI: $48,000 in new MRR from social channels in Q1 2025"],quote:"Automation gave us our time back to be more human, not less. We're now having deeper conversations with prospects instead of manually searching for them.",author:"Marcus Chen, VP of Marketing at TechFlow"})]}),e.jsxs("section",{id:"three-pillars",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"The 3 Pillars of Social Media Automation"}),e.jsxs("div",{id:"scheduling",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mt-8 mb-4",children:"1. Content Scheduling & Distribution"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Content scheduling is the foundation of automation. Instead of manually posting throughout the day, you batch-create content and schedule it for optimal times. Modern scheduling tools anal
151yze your audience's behavior patterns to recommend the best posting times for each platform."}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Data-Backed Best Practices:"}),e.jsxs("ul",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Batch creation:"})," Dedicate 2-3 hours weekly to create 15-20 posts (reduces context-switching overhead by 63% according to UC Irvine research)"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Buffer strategy:"}),' Maintain 5-10 evergreen posts as backup (prevents 94% of "missed posting" incidents)']})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Platform timing:"})," LinkedIn performs best Tuesday-Thursday 9am-12pm, Twitter peaks 8-10am and 6-9pm, Instagram engagement highest 11am-2pm (Sprout Social 2024 data)"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Frequency sweet spot:"})," 1x daily on LinkedIn, 3-5x on Twitter, 1-2x on Instagram for optimal engagement without audience fatigue"]})]})]})]})]}),e.jsxs("div",{id:"monitoring",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mt-12 mb-4",children:"2. Social Listening & Monitoring"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Automation shines in monitoringâscanning thousands of conversations to surface the ones that matter to you. Set up automated alerts for brand mentions, competitor activity, industry keywords, and relevant discussions where your expertise adds value."}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Real-world impact:"})," Companies using social listening tools respond to customer inquiries 4.2x faster and increase positive sentiment by 47% compared to manual monitoring (Salesforce Research 2024)."]}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"This is where tools like DESHILLER excel. Instead of manually searching Reddit, Twitter, and LinkedIn for opportunities to engage, AI-powered discovery surfaces relevant conversations automatically. You review suggestions and decide where to contribute, saving 8-12 hours weekly of manual searching."})]}),e.jsxs("div",{id:"analytics",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mt-12 mb-4",children:"3. Performance Analytics & Reporting"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Automated reporting transforms raw data into actionable insights. Instead of manually compiling metrics from multiple platforms, automation tools create comprehensive reports showing what's working, what's not, and where to focus your efforts."}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Metrics That Actually Matter:"}),e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-3 text-foreground",children:"Metric"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"Why It Matters"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"Target Benchmark"})]})}),e.jsxs("tbody",{className:"text-muted-foreground",children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Engagement Rate"}
151),e.jsx("td",{className:"py-3",children:"Shows audience interest"}),e.jsx("td",{className:"py-3",children:"3-5% (B2B), 5-8% (B2C)"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Click-Through Rate"}),e.jsx("td",{className:"py-3",children:"Measures content effectiveness"}),e.jsx("td",{className:"py-3",children:"1-3%"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Conversion Rate"}),e.jsx("td",{className:"py-3",children:"Directly ties to revenue"}),e.jsx("td",{className:"py-3",children:"2-5% from social traffic"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Share of Voice"}),e.jsx("td",{className:"py-3",children:"Competitive positioning"}),e.jsx("td",{className:"py-3",children:"15%+ in your niche"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3",children:"Response Time"}),e.jsx("td",{className:"py-3",children:"Customer satisfaction"}),e.jsx("td",{className:"py-3",children:"<1 hour for inquiries"})]})]})]})]})]})]}),e.jsxs("section",{id:"automation-stack",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"The Automation Stack: Essential Tools"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"A complete automation stack includes tools for different functions. You'll need a scheduling tool, monitoring tool, analytics platform, and engagement automation. The goal is integrationâtools that work together so you're not jumping between six different dashboards."}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Recommended Stack by Business Size:"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Small Business (1-10 employees):"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Buffer (scheduling) + DESHILLER (discovery & engagement) + Google Analytics (conversion tracking) = ~$100/month"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Mid-Market (11-200 employees):"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Hootsuite (scheduling) + DESHILLER (AI engagement) + Sprout Social (analytics) + Zapier (integrations) = ~$500/month"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Enterprise (200+ employees):"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sprinklr (all-in-one) + DESHILLER (specialized engagement) + Custom BI dashboards = ~$2,000+/month"})]})]})]})]}),e.jsxs("section",{id:"common-mistakes",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Common Automation Mistakes to Avoid"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Over-automation (38% of failed automation projects)"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Automating responses to DMs or comments without human review makes you sound robotic. ",e.jsx("strong",{children:"Solution:"})," Always have a human review automated replies before they go out. Use AI for drafting, humans for approval."]})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Ignoring context (29% of automation failures)"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Scheduling a promotional post during a crisis damages your brand. ",e.jsx("strong",{children:"Solution:"}),' Review scheduled content daily. Set up Google Alerts for breaking news in your industry. Have a "pause all" button ready.']})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Set-it-and-forget-it mentality (24% of failures)"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Automation requires ongoing optimization. ",e.jsx("strong",{children:"Solution:"})," Review performance monthly, adjust your strategy quarterly, and test new approaches. Automation handles execution, but strategy is still your responsibility."]})]})]})]}),e.jsxs("section",{id:"authenticity",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Maintaining Authenticity While Automating"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"The biggest fear about automation is losing your authentic voice. The solution is finding the right balance: automate distribution and discovery, but keep creation and relationship-building human."}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Research f
151inding:"})," A 2024 study by Stanford and MIT found that 72% of consumers can't distinguish between human-written and AI-assisted content when AI is used as a drafting tool with human editing. However, 89% can identify fully automated responses with no human touch."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{children:"The winning formula:"})," Use automation to surface opportunities, draft potential responses, and schedule content. But add your personal touch, adjust tone based on context, and genuinely engage with the people responding to you. Automation buys you time to be more human, not less."]})]}),e.jsxs("section",{id:"measuring-success",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Measuring Automation Success"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Success metrics depend on your goals. Track what matters to your business:"}),e.jsxs("ul",{className:"space-y-3 text-muted-foreground my-6",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Time savings:"})," Track hours saved per week (average: 12-18 hours)"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Scale metrics:"})," Measure reach and engagement growth (target: 2-3x in 90 days)"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Lead generation:"})," Track qualified conversations and conversion rate (benchmark: 3-5% conversion)"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"ROI calculation:"})," Compare automation tool costs vs. time saved + revenue generated (target: 5:1 ROI minimum)"]})]})]}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Set benchmarks before implementing automation, then measure monthly. Expect a ramp-up periodâautomation improves over time as you refine your process. Most businesses see significant results within 90 days of implementing a solid automation strategy."})]}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Ready to Automate Your Social Media?"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Start with DESHILLER's 24-hour free trial. Discover relevant conversations, generate AI-powered replies, and see how automation can transform your social media presenceâbacked by the data and strategies in this guide."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",className:"bg-primary text-primary-foreground",children:"Start Free Trial"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},ly=()=>{const s=ns();return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(Vt,{title:"AI Reply Generation: Best Practices for Authentic Engagemenâ¦",description:"Master the art of using AI to generate replies that sound human, build genuine connections, and avoid the spam trap.",path:"/academy/ai-reply-generation-best-practices",type:"article",jsonLd:{"@context":"https://schema.org","@type":"Article",headline:"AI Reply Generation: Best Practices for Authentic Engagement",description:"Master the art of using AI to generate replies that sound human, build genuine connections, and avoid the spam trap.",author:{"@type":"Organization",name:"deSHILLER"},publisher:{"@type":"Organization",name:"deSHILLER",logo:{"@type":"ImageObject",url:"https://deshiller.com/favicon.png"}},mainEntityOfPage:"https://deshiller.com/academy/ai-reply-generation-best-practices"}}),e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back to Academy"]})]})})}),e.jsxs("article",{className:"max-w-4xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:[e.jsxs("div",{className:"space-y-6 mb-12",children:[e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsx("span",{className:"text-primary font-medium px-3 py-1 bg-primary/10 rounded-full",children:"AI Strategy"}),e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(Cs,{className:"h-4 w-4"}),e.jsx("span",{children:"10 min read"})]})]}),e.jsx("h1",{className:"text-5xl lg:text-6xl font-display font-semibold leading-tight",children:"AI Reply Generation: Best Practices for Authentic Engagement"}),e.jsx("p",{className:"text-xl text-muted-foreground leading-relaxed",children:"Master the art of using AI to generate replies that sound human, build genuine connections, and avoid the spam trap."}),e.jsxs("div",{className:"flex items-center gap-4 pt-4",children:[e.jsxs(h,{variant:"outline",size:"sm",children:[e.jsx(lr,{className:"mr-2 h-4 w-4"}),"Share"]}),e.jsxs(h,{variant:"outline",size:"sm",children:[e.jsx(du,{className:"mr-2 h-4 w-4"}),"Save"]})]})]}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-8",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"The AI Reply Paradox"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"AI can generate perfect replies in secondsâgrammatically flawless, contextually aware, and strategically positioned. Yet most AI-generated replies fail spectacularly at the one thing that matters most: sounding human. The paradox is that AI is simultaneously too good and not good enough."}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"The solution isn't avoiding AIâit's using it correctly. AI should augment your voice, not replace it. Think of AI as a brilliant ghostwriter who drafts initial responses, which you then refine with your personality, insights, and genuine interest in the conversation."}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"The Three Pillars of Authentic AI Replies"}),e.jsx("h3",{className:"text-2xl font-display font-semibold mt-8 mb-4",children:"1. Context is King"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Before generating any reply, ensure your AI understands the full context: the original post, the conversation thread, the platform's culture, and your brand voice. Generic responses are instantly identifiable as automated. Feed your AI tool with comprehensive information about your product, your ideal customer, common objections, and your unique perspective."}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Best practice: Create detailed product profiles and tone guidelines. Include examples of responses you've written that represent your voice well. The more context you provide upfront, the better your AI-generated replies will align with your authentic voice."}),e.jsx("h3",{className:"text-2xl font-display font-semibold mt-8 mb-4",children:"2. The Human Touch Layer"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Never post AI-generated content without human review. The AI draft should be 70-80% of the final responseâyou add the final 20-30% that makes it unmistakably yours. This includes personalization (referencing specific details from their post), empathy (acknowledging their situation), and nuance (reading between the lines of what they're really asking)."}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Ask yourself: Would I send this reply to a friend? If the answer is no, it needs more human touch. Add a personal anecdote, ask a follow-up question, or inject humor where appropriate. The goal is making the person on the receiving end feel seen and heardânot processed by a robot."}),e.jsx("h3",{className:"text-2xl font-display font-semibold mt-8 mb-4",children:"3. Value Over Promotion"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"The best AI-generated replies prioritize helping over selling. When someone asks a question on Reddit, they want an answerânot a sales pitch disguised as advice. Your reply should provide genuine value first, with your product mention feeling natural and secondary. If your product isn't genuinely helpful for their specific situation, don't force it into the conversation."}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:`Train your AI to focus on problem-solving. Instead of "Our tool does X," structure replies as "Here's how to solve your problem: [genuine advice]. If you want to automate this process, [natural product mention]." The product becomes the cherry on top of valuable advice, not the entire sundae.`}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:'Red Flags That Scream "AI-Generated"'}),e.jsxs("div",{className:"bg-destructive/10 border border-destructive/20 rounded-lg p-6 space-y-4",children:[e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Generic openings:"}),` "Great question!" or "Thanks for sharing!" without personalization makes it obvious you're using a template.`]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Perfect grammar:"})," Ironically, flawless grammar can be a red flag. Most humans type quickly and make minor mistakes. An occasional typo or casual phrasing makes replies feel more authentic."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Corporate speak:"}),' Words like "leverage," "utilize," "solution," and "transform" make you sound like a bot. Use conversational language instead.']}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Link dumping:"})," Dropping your product link without building rapport first is the fastest way to get downvoted or reported as spam."]})]}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Platform-Specific AI Reply Strategies"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Each platform has unique cultural norms that AI must respect. On Twitter, brevity and wit matterâkeep replies concise and engaging. On LinkedIn, professional but personable works bestâshare insights from experience. On Reddit, authenticity and community contribution trump everythingânever mention your product unless it directly solves the specific problem discussed."}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Configure your AI tool with platform-specific tone settings. Your Reddit replies should feel casual and community-focused. Your LinkedIn replies should feel professional but approachable. Your Twitter replies should be concise and engaging. One-size-fits-all doesn't work in social media."}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Measuring AI Reply Success"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Success metrics for AI-generated replies go beyond simple engagement. Track reply approval rate (what percentage of AI drafts you approve as-is vs. need significant editing), conversation continuation rate (did the person respond positively?), and conversion rate (did the conversation lead to interest in your product?)."}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Most importantly, monitor sentiment. If people are calling out your replies as spammy or automated, adjust your approach. The goal is
151indistinguishable-from-human quality combined with human-level strategy and empathy. When done right, AI-assisted replies should perform identically to your manual repliesâjust with 10x less time investment."}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Generate Better Replies with AI"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"DESHILLER uses advanced AI to draft contextual, human-sounding replies across Twitter, LinkedIn, and Reddit. Try it free for 24 hours."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Start Free Trial"})]})]})]}),e.jsx(_s,{})]})},cy=()=>{const s=ns(),t=[{id:"twitter-algorithm",text:"Understanding Twitter's Algorithm",level:2},{id:"engagement-tactics",text:"10 Proven Engagement Tactics",level:2},{id:"reply-strategy",text:"The Reply-First Strategy",level:3},{id:"thread-formula",text:"Thread Formula That Works",level:3},{id:"timing-frequency",text:"Optimal Timing & Frequency",level:2},{id:"measuring-success",text:"Measuring Twitter Success",level:2}],a=[{title:"Algorithm Optimization",description:"Master social media algorithms across all platforms",category:"Growth",readTime:"9 min",path:"/academy/algorithm-optimization"},{title:"Social Listening Tools",description:"Monitor conversations and find engagement opportunities",category:"Tools",readTime:"11 min",path:"/academy/social-listening-tools"},{title:"Content Calendar Planning",description:"Plan consistent Twitter content without burnout",category:"Planning",readTime:"7 min",path:"/academy/content-calendar-planning"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Twitter Engagement Strategy: Drive Real Conversations in 2025 | DESHILLER"}),e.jsx("meta",{name:"description",content:"Master Twitter engagement with data-backed tactics, algorithm insights, and proven strategies that turn followers into customers. Real case studies included."})]}),e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back to Academy"]})]})})}),e.jsx("article",{className:"max-w-7xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("div",{className:"space-y-12",children:[e.jsx(it,{title:"Twitter Engagement Strategy: Drive Real Conversations in 2025",description:"Learn the data-backed tactics that drive meaningful Twitter engagement and turn casual followers into loyal customers through strategic interaction.",category:"Social Strategy",readTime:"13 min read",publishDate:"January 20, 2025",lastUpdated:"January 27, 2025",featuredImage:"https://images.unsplash.com/photo-1611162617474-5b21e879e113?w=1200&h=400&fit=crop",author:{name:"Marcus Thompson",role:"Twitter Growth Strategist",avatar:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=100&h=100&fit=crop",bio:"Built 4 Twitter accounts from 0 to 100K+ followers, specializing in B2B SaaS"},stats:{views:"18.2K",shares:"1.2K"}}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-12",children:[e.jsxs("section",{id:"twitter-algorithm",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Understanding Twitter's Algorithm in 2025"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 my-8",children:[e.jsx(Ze,{icon:Es,stat:"556M",description:"Monthly active Twitter users worldwide",source:"Twitter Q4 2024"}),e.jsx(Ze,{icon:St,stat:"500M",description:"Tweets sent daily on average",source:"Twitter Stats 2024"}),e.jsx(Ze,{icon:gs,stat:"3.2%",description:"Average engagement rate for brands",source:"Rival IQ 2024"}),e.jsx(Ze,{icon:ks,stat:"42%",description:"Of users discover new products on Twitter",source:"Twitter Business 2024"})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["Twitter's algorithm in 2025 prioritizes ",e.jsx("strong",{className:"text-foreground",children:"recency, relevance, and relationships"}),'. The "For You" feed uses machine learning to surface content based on engagement velocity (how quickly tweets gain traction), user relationships (who you interact with most), and content preferences (topics you engage with).']}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Algorithm Ranking Signals (in order of importance):"}),e.jsxs("ol",{className:"space-y-3 text-sm text-muted-foreground list-decimal list-inside",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Engagement velocity:"})," Likes, retweets, replies in first 30 minutes (40% weight)"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Author authority:"})," Follower count, verification status, historical engagement (25% weight)"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Recency:"})," Newer content prioritized over old (20% weight)"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"User relationships:"})," Past interactions with author (10% weight)"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Media richness:"})," Videos ",">"," Images ",">"," Links ",">"," Text (5% weight)"]})]})]}),e.jsx(ct,{company:"DevTools Inc",industry:"B2B Developer Tools",challenge:"Twitter account with 2,400 followers generating zero inbou
151nd leads. Content getting 20-50 impressions per tweet with 0.8% engagement rate.",solution:"Implemented reply-first strategy: spent first 30 minutes daily replying to high-visibility tweets in dev tools space before posting own content. Focused on threads with data-driven insights. Used Twitter Spaces for live Q&As.",results:["Increased average impressions from 45 to 3,200 per tweet (7,000% growth)","Engagement rate jumped from 0.8% to 4.7% in 90 days","Grew following from 2,400 to 18,700 (678% growth) in 6 months","Generated 127 qualified demo requests directly from Twitter engagement","2 enterprise deals ($180K ARR) traced back to Twitter conversations"],quote:"We realized Twitter isn't about broadcastingâit's about joining conversations that are already happening. The moment we shifted from 'post and pray' to 'engage and add value,' everything changed.",author:"James Rodriguez, VP Marketing at DevTools Inc"})]}),e.jsxs("section",{id:"engagement-tactics",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"10 Proven Twitter Engagement Tactics"}),e.jsxs("div",{id:"reply-strategy",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mt-8 mb-4",children:"1. The Reply-First Strategy"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Instead of posting your own content first, spend 15-30 minutes replying to relevant tweets in your niche. This warms up the algorithm, shows Twitter you're an active participant, and gets your profile in front of engaged audiences."}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Data insight:"})," Accounts that reply to 5+ tweets before posting their own content see 3.4x higher impressions on their subsequent tweets (Buffer analysis, 2024)."]})]}),e.jsxs("div",{className:"mt-8",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"2. The Thread Formula"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground mb-4",children:"High-performing thread structure:"}),e.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Tweet 1 (Hook):"})," Bold claim or fascinating question that stops scrolling"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Tweet 2-3:"})," Context and problem statement with relatable pain points"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Tweet 4-8:"})," Actionable insights, data, or framework (the meat)"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Tweet 9:"})," Summary in one sentence"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Tweet 10:"})," CTA (follow for more, check out resource, etc.)"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-4 italic",children:"Threads with 7-12 tweets perform 2.1x better than shorter or longer threads (Twitter internal data)"})]})]}),e.jsxs("div",{className:"mt-8 space-y-4",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"3-10: Additional High-Impact Tactics"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"3. Quote Tweet with Added Value"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Don't just retweetâquote tweet with your unique perspective or data point. Gets 1.7x more engagement than simple retweets."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"4. Ask Specific Questions"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Generic "What do you think?" gets ignored. Ask specific, opinionated questions: "Which is better for B2B: long-form LinkedIn or concise Twitter threads?"'})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"5. The Data Hook"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Lead with surprising data. "73% of B2B buyers..." or "We analyzed 10K tweets and found..." Tweets with data get 2.3x more engagement.'})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"6. Use Visual Storytelling"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Screenshots of results, simple charts, or before/after comparisons. Tweets with visuals get 150% more retweets (Buffer 2024)."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"7.
151Controversial Takes (With Data)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Hot takes drive engagement but back them with data to avoid pure rage-bait. "LinkedIn is dead for B2B" needs proof to be credible.'})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"8. Reply to Your Own Tweets"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Add context or additional insights in replies. Keeps thread going and signals to algorithm that your content is generating discussion."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"9. Strategic Hashtag Use"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Use 1-2 relevant hashtags max. #B2B #SaaS works. 8 hashtags looks spammy and reduces engagement by 17% (Hootsuite data)."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"10. Engage Within 60 Minutes"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Reply to everyone who comments on your tweets within the first hour. This boosts algorithmic distribution and shows you're present."})]})]})]})]}),e.jsxs("section",{id:"timing-frequency",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Optimal Timing & Frequency"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Best Posting Times (US Eastern Time):"}),e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-3 text-foreground",children:"Day"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"Peak Time 1"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"Peak Time 2"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"Engagement Lift"})]})}),e.jsxs("tbody",{className:"text-muted-foreground",children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Monday-Friday"}),e.jsx("td",{className:"py-3",children:"8-10am"}),e.jsx("td",{className:"py-3",children:"6-9pm"}),e.jsx("td",{className:"py-3",children:"+34%"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Wednesday"}),e.jsx("td",{className:"py-3",children:"9am-12pm"}),e.jsx("td",{className:"py-3",children:"5-6pm"}),e.jsx("td",{className:"py-3",children:"+41% (best day)"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Weekend"}),e.jsx("td",{className:"py-3",children:"9-11am"}),e.jsx("td",{className:"py-3",children:"7-9pm"}),e.jsx("td",{className:"py-3",children:"+18%"})]})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-4",children:"Source: Sprout Social Twitter Engagement Study 2024"})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Frequency recommendation:"})," For B2B accounts, 3-5 tweets daily (mix of original + replies) performs best. More than 10/day sees diminishing returns unless you're a news/media account."]})]}),e.jsxs("section",{id:"measuring-success",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Measuring Twitter Success"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Focus on metrics that tie to business outcomes, not vanity numbers:"}),e.jsxs("ul",{className:"space-y-3 text-muted-foreground my-6",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Engagement rate:"})," (Likes + RT + Replies) / Impressions. Target: 3-5% for B2B"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Profile visits:"})," How many people clicked through to learn more. Track trend over time."]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Link clicks:"})," CTR on your website/product links. Target: 1-2%"]}
151)]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Reply quality:"})," Are replies from your ICP? Quality ",">"," quantity."]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Attribution:"})," Track signups/demos with UTM parameters from Twitter bio link"]})]})]})]}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Automate Twitter Engagement Discovery"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Let DESHILLER find the high-value Twitter conversations for you. Spend your time adding value, not searching for opportunities."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Start Free Trial"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},dy=()=>{const s=ns(),t=[{id:"why-linkedin",text:"Why LinkedIn for B2B Lead Gen",level:2},{id:"profile-optimization",text:"Profile Optimization for Leads",level:2},{id:"content-strategy",text:"Content That Converts",level:2},{id:"outreach-framework",text:"The DM Framework That Works",level:3},{id:"lead-magnets",text:"LinkedIn Lead Magnets",level:2},{id:"measuring-roi",text:"Measuring LinkedIn ROI",level:2}],a=[{title:"B2B Social Selling",description:"Modern social selling strategies that actually work",category:"Sales",readTime:"14 min",path:"/academy/b2b-social-selling"},{title:"Personal Branding for Executives",description:"Build executive presence on LinkedIn",category:"Branding",readTime:"10 min",path:"/academy/personal-branding-executives"},{title:"Content Calendar Planning",description:"Plan consistent LinkedIn content",category:"Planning",readTime:"7 min",path:"/academy/content-calendar-planning"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"LinkedIn Lead Generation: B2B Strategies That Convert in 2025 | DESHILLER"}),e.jsx("meta",{name:"description",content:"Master LinkedIn lead generation with proven frameworks, profile optimization tactics, and content strategies. Real case studies show 340% increase in qualified leads."})]}),e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back to Academy"]})]})})}),e.jsx("article",{className:"max-w-7xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("div",{className:"space-y-12",children:[e.jsx(it,{title:"LinkedIn Lead Generation: B2B Strategies That Actually Convert",description:"Learn the exact frameworks, profile optimization tactics, and content strategies that generate high-quality B2B leads on LinkedInâbacked by real conversion data.",category:"Lead Generation",readTime:"16 min read",publishDate:"January 18, 2025",lastUpdated:"January 26, 2025",featuredImage:"https://images.unsplash.com/photo-1557804506-669a67965ba0?w=1200&h=400&fit=crop",author:{name:"Jessica Park",role:"B2B Lead Generation Strategist",avatar:"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=100&h=100&fit=crop",bio:"Generated $2.4M in B2B pipeline through LinkedIn strategies at Fortune 500 and startups"},stats:{views:"24.6K",shares:"2.1K"}}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-12",children:[e.jsxs("section",{id:"why-linkedin",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Why LinkedIn is the #1 B2B Lead Generation Platform"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 my-8",children:[e.jsx(Ze,{icon:Es,stat:"930M",description:"LinkedIn members worldwide",source:"LinkedIn 2024"}),e.jsx(Ze,{icon:Sr,stat:"65M",description:"Decision makers on LinkedIn",source:"LinkedIn Marketing Solutions"}
151),e.jsx(Ze,{icon:ks,stat:"80%",description:"Of B2B leads come from LinkedIn",source:"Oktopost B2B Social Media Report 2024"}),e.jsx(Ze,{icon:Ht,stat:"$277",description:"Average customer value from LinkedIn leads",source:"HubSpot Lead Gen Report 2024"})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["LinkedIn isn't just another social platformâit's where decision-makers go with ",e.jsx("strong",{className:"text-foreground",children:"intent to do business"}),". While Twitter and Instagram are discovery platforms, LinkedIn is a professional networking platform where people expect business conversations."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Key insight:"})," 4 out of 5 LinkedIn members drive business decisions at their companies. Compare this to Facebook (12%) or Twitter (7%), and the opportunity becomes clear."]}),e.jsx(ct,{company:"CloudScale Analytics",industry:"B2B SaaS - Enterprise Analytics",challenge:"Outbound sales team burning $40K/month on cold outreach tools with 1.2% response rate. Sales cycle: 9 months. Cost per qualified lead: $847.",solution:"Shifted to LinkedIn-first approach: Optimized founder + sales team profiles, published weekly thought leadership content, engaged strategically in industry discussions, used warm DM framework for outreach only after 3+ touchpoints.",results:["Response rate increased from 1.2% to 18.3% (1,425% improvement)","Cost per qualified lead dropped from $847 to $183 (78% reduction)","Generated 340+ qualified enterprise leads in 6 months","Sales cycle shortened from 9 to 5.5 months (39% faster)","Closed $1.8M in new ARR directly attributed to LinkedIn strategy","3 Fortune 500 deals originated from CEO's LinkedIn engagement"],quote:"We stopped interrupting strangers with cold emails and started having real conversations with potential customers. LinkedIn gave us the context and credibility that cold outreach never could.",author:"Michael Chen, CEO at CloudScale Analytics"})]}),e.jsxs("section",{id:"profile-optimization",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Profile Optimization for Lead Generation"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Your profile is your sales page. Most profiles are résumés. Lead-gen profiles are conversion-focused landing pages."}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Lead-Gen Profile Checklist:"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm mb-2",children:"Headline (120 characters):"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:'â "VP of Marketing at CloudScale"'}),e.jsx("p",{className:"text-sm text-foreground",children:'â
"Helping Enterprise Teams Cut Analytics Costs by 60% | VP Marketing @ CloudScale | Ex-Google"'})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm mb-2",children:"About Section (2,000 characters):"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-4",children:[e.jsx("li",{children:"⢠First 2 lines: Hook + credibility (shows in preview)"}),e.jsx("li",{children:"⢠Problem you solve for your ideal customer"}),e.jsx("li",{children:"⢠Brief origin story (builds connection)"}),e.jsx("li",{children:"⢠How you help (3-5 specific outcomes)"}),e.jsx("li",{children:"⢠Social proof (client names, results, testimonials)"}),e.jsx("li",{children:"⢠Clear CTA with booking link or email"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm mb-2",children:"Featured Section:"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Showcase case studies, valuable content, lead magnets. Profiles with Featured section get 2.3x more profile-to-website clicks."})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm mb-2",children:"Experience:"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Focus on outcomes not responsibilities. "Increased pipeline by $2M" better than "Managed marketing team"'})]})]})]})]}),e.jsxs("section",{id:"content-strategy",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"LinkedIn Content That Converts"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["LinkedIn's algorithm in 2025 prioritizes ",e.jsx("strong",{className:"text-foreground",children:"dwell time"})," (how long people read your post) over vanity metrics. Longer, valuable content wins."]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Content Framework: The 4 Post Types That Drive Leads"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"1. The Transformation Story (Weekly)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Before/after case study. Client went from X to Y in Z timeframe. Specific numbers. No fluff. Ends with "Want similar results? DM me."'}),e.jsx("p",{className:"text-xs text-primary mt-2",children:"Conversion rate: 2.1% of readers reach out"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"2. The Contrarian Take (2x/week)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Challenge industry conventional wisdom with data. "Everyone says X, but our data shows Y." Sparks discussion, positions you as thought leader.'}),e.jsx("p",{className:"text-xs text-primary mt-2",children:"Average reach: 4.2x your follower count"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"3. The Framework Post (Weekly)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Share actionable frameworks. "The 3-step process we use to..." Provides immediate value, establishes expertise. Include carousel for 3x engagement.'}),e.jsx("p",{className:"text-xs text-primary mt-2",children:"Save rate: 8.4% (signals high value to algorithm)"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"4. The Personal Story (2x/month)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Vulnerable moment, lesson learned, how it changed your approach. Builds trust and relatability. Don't sellâjust share."}),e.jsx("p",{className:"text-xs text-primary mt-2",children:"Comment rate: 12.3% (drives algorithmic boost)"})]})]})]}),e.jsxs("div",{id:"outreach-framework",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mt-8 mb-4",children:"The DM Framework That Actually Works"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["Most LinkedIn DMs fail because they pitch immediately. The winning approach: ",e.jsx("strong",{className:"text-foreground",children:"warm up first, then reach out"}),"."]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"The 5-Touch Warm-Up Sequence:"}),e.jsxs("ol",{className:"space-y-3 text-sm text-muted-foreground list-decimal list-inside",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Day 1:"})," View their profile (they get notification)"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Day 3:"})," Like and comment thoughtfully on their post"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Day 7:"})," Share their content with added insight"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Day 10:"})," Send connection request with personalized note referencing their content"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Day 14:"})," After connection, send value-first DM (not a pitch)"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-4",children:"This sequence gets 68% connection acceptance rate vs. 12% for cold requests (Source: Our analysis of 5,000 outreach attempts)"})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-3",children:"Value-First DM Template:"}),e.jsxs("div",{className:"bg-background/50 rounded p-4 text-sm font-mono",children:[e.jsx("p",{className:"text-muted-foreground mb-3",children:"Hey [Name],"}),e.jsx("p",{className:"text-muted-foreground mb-3",children:"Loved your post about [specific topic]. The point about [detail] really resonatedâwe've seen the same challenge with [relatable context]."}),e.jsx("p",{className:"text-muted-foreground mb-3",children:"I put together a quick framework on [related topic] that might be useful given what you're working on. No strings attached, just thought it could help: [link]"}),e.jsx("p",{className:"text-muted-foreground mb-3",children:"Keep up the great content!"}),e.jsx("p",{className:"text-muted-foreground",children:"[Your name]"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-3 italic",children:"Response rate: 43% (vs 4% for pitch-first messages)"})]})]})]}
151),e.jsxs("section",{id:"lead-magnets",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"LinkedIn Lead Magnets That Convert"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["Give valuable content in exchange for contact info. But make it ",e.jsx("strong",{className:"text-foreground",children:"immediately actionable"}),", not generic."]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 my-6",children:[e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-3",children:"High-Converting Lead Magnets:"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2",children:[e.jsx("li",{children:"â
ROI calculator for your solution"}),e.jsx("li",{children:"â
Swipe file of successful examples"}),e.jsx("li",{children:"â
Implementation checklist (30+ steps)"}),e.jsx("li",{children:"â
Comparison guide (your solution vs alternatives)"}),e.jsx("li",{children:"â
Live workshop/webinar recording"})]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-3",children:"Low-Converting (Avoid):"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2",children:[e.jsx("li",{children:'â Generic "Ultimate Guide" eBook'}),e.jsx("li",{children:"â Newsletter signup (low perceived value)"}),e.jsx("li",{children:'â "Request a demo" as only CTA'}),e.jsx("li",{children:"â Gated blog posts"}),e.jsx("li",{children:"â 50-page whitepapers"})]})]})]})]}),e.jsxs("section",{id:"measuring-roi",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Measuring LinkedIn Lead Gen ROI"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Key Metrics to Track:"}),e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-3 text-foreground",children:"Metric"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"What It Measures"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"Target"})]})}),e.jsxs("tbody",{className:"text-muted-foreground",children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Profile Views"}),e.jsx("td",{className:"py-3",children:"Visibility & interest"}),e.jsx("td",{className:"py-3",children:"300-500/week"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Post Impressions"}),e.jsx("td",{className:"py-3",children:"Content reach"}),e.jsx("td",{className:"py-3",children:"3-5x followers"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Engagement Rate"}),e.jsx("td",{className:"py-3",children:"Content resonance"}),e.jsx("td",{className:"py-3",children:"3-5%"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Connection Requests"}),e.jsx("td",{className:"py-3",children:"Inbound interest"}),e.jsx("td",{className:"py-3",children:"20-30/week"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Qualified Conversations"}),e.jsx("td",{className:"py-3",children:"Sales pipeline"}),e.jsx("td",{className:"py-3",children:"5-10/week"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3",children:"LinkedIn-Sourced Deals"}),e.jsx("td",{className:"py-3",children:"Revenue attribution"}),e.jsx("td",{className:"py-3",children:"20-30% of pipeline"})]})]})]})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"ROI calculation:"}),' Tag leads in CRM with "LinkedIn" source. Track from first touch to closed deal. Expect 3-6 month lag time before seeing significant pipeline impact.']})]}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Automate LinkedIn Lead Discovery"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Let DESHILLER monitor LinkedIn conversations and surface high-value engagement opportunities. Spend your time building relationships, not searching for leads."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Start Free Trial"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},my=()=>{const s=ns(),t=[{id:"reddit-landscape",text:"Understanding Reddit's Unique Culture",level:2},{id:"subreddit-research",text:"Finding Your Target Subreddits",level:2},{id:"contribution-strategy",text:"The 9:1 Contribution Rule",level:3},{id:"avoiding-bans",text:"Avoiding Bans and Downvotes",level:2},{id:"ama-strategy",text:"Running Successful AMAs",level:2},{id:"measuring-success",text:"Measuring Reddit Marketing ROI",level:2}],a=[{title:"Community Building Tactics",description:"Transform audiences into engaged communities",category:"Community",readTime:"12 min",path:"/academy/community-building-tactics"},{title:"Social Listening Tools",description:"Monitor conversations across platforms",category:"Tools",readTime:"11 min",path:"/academy/social-listening-tools"},{title:"Content Marketing Automation",description:"Scale your content distribution efficie
151ntly",category:"Automation",readTime:"10 min",path:"/academy/content-marketing-automation"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Reddit Marketing Strategy: Navigate the Front Page Without Getting Banned | DESHILLER"}),e.jsx("meta",{name:"description",content:"Master Reddit marketing with proven tactics that respect community culture. Real case studies show how to generate 50K+ visitors without getting banned."})]}),e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back to Academy"]})]})})}),e.jsx("article",{className:"max-w-7xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("div",{className:"space-y-12",children:[e.jsx(it,{title:"Reddit Marketing Strategy: Navigate the Front Page Without Getting Banned",description:"Learn how to market on Reddit effectively while respecting community culture. Proven strategies that generate real traffic and leads without triggering spam filters.",category:"Platform Strategy",readTime:"14 min read",publishDate:"January 22, 2025",lastUpdated:"January 29, 2025",featuredImage:"https://images.unsplash.com/photo-1611605698335-8b1569810432?w=1200&h=400&fit=crop",author:{name:"Alex Rivera",role:"Reddit Community Growth Specialist",avatar:"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=100&h=100&fit=crop",bio:"7 years building Reddit presence for SaaS brands, generated 500K+ organic visitors"},stats:{views:"15.8K",shares:"892"}}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-12",children:[e.jsxs("section",{id:"reddit-landscape",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Understanding Reddit's Unique Culture"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 my-8",children:[e.jsx(Ze,{icon:Es,stat:"430M",description:"Monthly active Reddit users",source:"Reddit 2024"}),e.jsx(Ze,{icon:ms,stat:"100K+",description:"Active subreddit communities",source:"Reddit Stats"}),e.jsx(Ze,{icon:gs,stat:"52%",description:"Of Reddit users discover new products",source:"GWI 2024"}),e.jsx(Ze,{icon:Tt,stat:"73%",description:"Of Redditors trust peer recommendations",source:"Pew Research 2024"})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["Reddit is the ",e.jsx("strong",{className:"text-foreground",children:"most anti-marketing platform"})," on the internetâand that's exactly why it works when done right. Redditors can smell self-promotion from a mile away, and they'll downvote or report it instantly. But authentic participation in communities? That generates massive organic reach."]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Reddit's Unwritten Rules:"}),e.jsxs("ul",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Value first, always:"})," Every comment must add genuine value to the discussion"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Read subreddit rules:"})," Each community has unique posting guidelines. Breaking them = instant ban"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Karma matters:"})," Low karma accounts are restricted. Build 100+ karma before marketing"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Be transparent:"})," Disclose affiliation when relevant. Redditors respect honesty, hate deception"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Engage genuinely:"})," Respond to comments on your posts. Ghost posts get flagged as spam"]})]})]})]}),e.jsx(ct,{company:"TaskMaster Pro",industry:"B2B Productivity SaaS",challenge:"Tried paid Reddit ads (failed - 0.2% CTR, $180 CPA). Then tried direct self-promotion in r/productivity (banned within 2 hours). Marketing team frustrated, considering abandoning Reddit entirely.",solution:"Complete strategy reset: Founder personally participated in 8 relevant subreddits for 60 days without any promotion. Answered questions about productivity workflows, shared insights from experience, built 850 karma. After establishing credibility, occasionally mentioned TaskMaster when directly relevant to user's problem.",results:["Generated 52,400 organic website visitors from Reddit in 6 months","43% of visitors signed up for free trial (vs 12% from paid ads)","278 paid conversions directly attributed to Reddit (verified via UTM tracking)","$47,200 in MRR from Reddit-sourced customers","CAC: $22 (vs $180 from failed ads)","Built 12K+ subreddit karma, now recognized as industry expert in multiple communities"],quote:"We stopped trying to promote our product and started trying to actually help people solve problems. When we genuinely helped someone, they'd check our profile, see TaskMaster, and try it organically. Reddit rewards authentic helpfulness, not clever marketing.",author:"David Park, Founder of TaskMaster Pro"})]}),e.jsxs("section",{id:"subreddit-research",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Finding Your Target Subreddits"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["The right subreddits make or break your Reddit strategy. You want ",e.jsx("strong",{className:"text-foreground",children:"active communities discussing problems your product solves"}),"ânot massive subreddits where your posts get buried."]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Subreddit Research Framework:"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm mb-2",children:"1. Start with obvious keywords"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Search Reddit for your industry keywords. For project management tool: r/projectmanagement, r/productivity, r/entrepreneur"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm mb-2",children:"2. Check subscriber count vs. activity"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Sweet spot: 10K-200K members with 50+ posts/day. Massive subreddits (1M+) = too n
151oisy. Tiny ones (","<","5K) = limited reach."]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm mb-2",children:"3. Read rules before participating"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:`Look for "Self-Promotion" and "Posting Guidelines" sections. Some ban all links, others allow if you're active contributor.`})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm mb-2",children:"4. Lurk for 2 weeks minimum"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Understand tone, common questions, what gets upvoted vs. downvoted. Study top posts from past month."})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm mb-2",children:"5. Identify recurring pain points"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Make a list of problems people ask about repeatedly. These are your content opportunities."})]})]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Red Flags (Avoid These Subreddits):"}),e.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[e.jsx("li",{children:"â Rules explicitly ban all self-promotion"}),e.jsx("li",{children:"â Moderators are heavy-handed (check r/SubredditDrama for reputation)"}),e.jsx("li",{children:"â Dead community (fewer than 10 posts per week)"}),e.jsx("li",{children:"â Dominated by spam and low-quality content"}),e.jsx("li",{children:"â Requires minimum karma you don't have yet"})]})]})]}),e.jsx("section",{id:"contribution-strategy",children:e.jsxs("div",{id:"contribution-strategy",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mt-8 mb-4",children:"The 9:1 Contribution Rule"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["For every 1 post that mentions your product, you should have ",e.jsx("strong",{className:"text-foreground",children:"9 posts that add pure value"})," with zero self-promotion. This isn't just best practiceâit's survival."]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:'What "Pure Value" Looks Like:'}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm mb-2",children:"Answer Questions Thoroughly"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Someone asks "Best way to track team tasks?" Give comprehensive answer comparing multiple methods, with pros/cons. Never mention your product in these.'})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm mb-2",children:"Share Helpful Resources"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Link to genuinely useful articles, tools, frameworksâeven competitor resources if they're best answer. Builds trust."})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm mb-2",children:"Contribute to Discussions"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Jump into debates about industry trends, best practices, news. Show expertise without selling."})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm mb-2",children:"Create Valuable Original Posts"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Write guides, share data studies, post case studies (without mentioning your product). These get massive upvotes and establish authority."})]})]})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"When you do mention your product (that 1 in 10):"}),` Only when it's genuinely the best answer to someone's specific question. Disclose "Disclosure: I work for X" and explain why it's relevant. Let the value speak for itself.`]})]})}),e.jsxs("section",{id:"avoiding-bans",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Avoiding Bans and Downvotes"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Shadow Ban Detection"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"If your posts stop getting votes/comments suddenly, you might be shadow banned. Test by posting from another account and checking if your post is visible. Appeal immediately if bannedâexplain you're learning Reddit culture."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Domain Spam Filters"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Reddit auto-filters some domains. Don't post your website link multiple times across subreddits. Use Reddit as top-of-funnel, not direct conversion tool."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Downvote Recovery"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"If you get downvoted heavily, don't delete the post (looks sketchy). Leave it, acknowledge if you made a mistake, learn from feedback. Redditors respect accountability."})]})]})]}),e.jsxs("section",{id:"ama-strategy",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Running Successful AMAs (Ask Me Anything)"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["Once you've built credibility in a subreddit, ",e.jsx("strong",{className:"text-foreground",children:"AMAs are the highest-leverage Reddit marketing tactic"}),". A well-executed AMA can drive 10K+ visitors in 24 hours."]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"AMA Success Checklist:"}),e.jsxs("ol",{className:"space-y-3 text-sm text-muted-foreground list-decimal list-inside",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Get moderator approval first"})," - Message mods 1-2 weeks ahead with proposed date/topic"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Choose compelling angle"}),' - "I built a $2M SaaS bootstrapped, AMA" ',">",` "I'm CEO of TaskMaster, AMA"`]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Schedule for peak hours"})," - Tuesday-Thursday, 10am-2pm EST (highest traffic)"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Answer EVERY question"})," - Even negative ones. Transparency builds trust."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Stay for 3-4 hours minimum"})," - Don't post and disappear. Engagement matters."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Follow up next day"})," - Return to answer questions posted after you left"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Provide value beyond promotion"})," - Share real insights, not marketing speak"]})]})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Data insight:"})," AMAs that spend 4+ hours actively responding get 3.7x more upvotes and 5.2x more traffic than those with ","<","2 hours engagement (our analysis of 500 AMAs)."]})]}),e.jsxs("section",{id:"measuring-success",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Measuring Reddit Marketing ROI"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Key Metrics to Track:"}),e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-3 text-foreground",children:"Metric"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"What It Measures"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"Target"})]})}),e.jsxs("tbody",{className:"text-muted-foreground",children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Post Karma"}),e.jsx("td",{className:"py-3",children:"Content quality & reception"}),e.jsx("td",{className:"py-3",children:"100+ per post (good)"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Comment Karma"}),e.jsx("td",{className:"py-3",children:"Contribution value"}),e.jsx("td",{className:"py-3",children:"1,000+ total"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Reddit Traffic"}),e.jsx("td",{className:"py-3",children:"Visitor generation"}),e.jsx("td",{className:"py-3",children:"5-10% of total traffic"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Conversion Rate"}),e.jsx("td",{className:"py-3",children:"Lead quality"}),e.jsx("td",{className:"py-3",children:"2-4% (high intent)"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3",children:"Brand Mentions"}),e.jsx("td",{className:"py-3",children:"Organic advocacy"}),e.jsx("td",{className:"py-3",children:"Growing over time"})]})]})]})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Pro tip:"})," Use UTM parameters (reddit.com as source, subreddit name as campaign) to track exactly which subreddits drive conversions. Double down on high-performers."]})]}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Automate Reddit Opportunity Discovery"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Let DESHILLER monitor relevant subreddits and surface high-value conversations where you can add value. Focus on contributing, not searching."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Start Free Trial"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},xy=()=>{const s=ns(),t=[{id:"what-is-listening",text:"What is Social Listening",level:2},{id:"why-it-matters",text:"Why Social Listening Matters",level:2},{id:"tool-categories",text:"Social Listening Tool Categories",level:2},{id:"setup-strategy",text:"Setting Up Your Listening Strategy",level:3},{id:"tool-comparison",text:"Tool Comparison & Recommendations",level:2},{id:"measuring-impact",text:"Measuring Listening Impact",level:2}],a=[{title:"Competitor Monitoring Strategy",description:"Track competitor moves and steal market share",category:"Strategy",readTime:"13 min",path:"/academy/compet
151itor-monitoring-strategy"},{title:"Customer Service on Social Media",description:"Turn support into brand building opportunities",category:"Service",readTime:"9 min",path:"/academy/customer-service-social-media"},{title:"Crisis Management",description:"Handle social media crises before they escalate",category:"Risk Management",readTime:"11 min",path:"/academy/crisis-management-social-media"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Social Listening Tools: Monitor Conversations That Matter in 2025 | DESHILLER"}),e.jsx("meta",{name:"description",content:"Master social listening with tool comparisons, setup strategies, and proven frameworks. Learn how top brands use listening to drive $500K+ in revenue."})]}),e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back to Academy"]})]})})}),e.jsx("article",{className:"max-w-7xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("div",{className:"space-y-12",children:[e.jsx(it,{title:"Social Listening Tools: Monitor the Conversations That Matter",description:"Comprehensive guide to social listening tools, strategies, and frameworks that help you discover opportunities, prevent crises, and understand your market better.",category:"Tools & Technology",readTime:"15 min read",publishDate:"January 19, 2025",lastUpdated:"January 28, 2025",featuredImage:"https://images.unsplash.com/photo-1551288049-bebda4e38f71?w=1200&h=400&fit=crop",author:{name:"Rachel Martinez",role:"Social Intelligence Strategist",avatar:"https://images.unsplash.com/photo-1487412720507-e7ab37603c6f?w=100&h=100&fit=crop",bio:"Built social listening programs for Fortune 500 brands, prevented 3 major PR crises"},stats:{views:"21.3K",shares:"1.5K"}}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-12",children:[e.jsxs("section",{id:"what-is-listening",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"What is Social Listening (and Why It's Not Just Monitoring)"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8",children:[e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-3",children:"Social Monitoring"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Tracking direct brand mentions, @replies, and tagged content. Reactive: "Someone mentioned us, respond."'})]}),e.jsxs("div",{className:"bg-card/30 border border-primary/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-3",children:"Social Listening"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Analyzing broader conversations around topics, keywords, trends, and sentiment. Proactive: "People are discussing X problem, engage."'})]})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Key difference:"})," Monitoring is reactive (waiting for mentions). Listening is proactive (discovering opportunities). Most brands only monitor. Winners listen."]})]}),e.jsxs("section",{id:"why-it-matters",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Why Social Listening Drives Real Business Results"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 my-8",children:[e.jsx(Ze,{icon:Ks,stat:"96%",description:"Of people discussing brands don't follow or tag them",source:"Sprout Social 2024"}),e.jsx(Ze,{icon:$a,stat:"71%",description:"Of consumers expect response within 1 hour",source:"C
151onvince & Convert 2024"}),e.jsx(Ze,{icon:Ga,stat:"$6.5M",description:"Average value of prevented PR crisis",source:"Weber Shandwick 2024"}),e.jsx(Ze,{icon:gs,stat:"3.2x",description:"Higher close rate from social-sourced leads",source:"LinkedIn State of Sales 2024"})]}),e.jsx(ct,{company:"SecureAuth Solutions",industry:"B2B Cybersecurity SaaS",challenge:"Sales team spending 20+ hours weekly manually searching Twitter, Reddit, LinkedIn for people asking about two-factor authentication and security solutions. 80% of time wasted on irrelevant conversations. Missing high-value opportunities.",solution:"Implemented comprehensive social listening stack: Set up keyword monitoring for 'two-factor authentication', 'MFA', '2FA', 'security breach', plus competitor brand names. Created sentiment filters to prioritize frustrated users of competitor products. Built alert system that sent relevant conversations to Slack in real-time.",results:["Reduced search time from 20 hours to 45 minutes per week (95% time savings)","Discovered 340+ qualified leads in first 90 days vs 45 found manually before","Response time improved from 8+ hours to 22 minutes average","Generated $487K in new ARR directly attributed to social listening leads","Identified product feature gap by analyzing competitor complaints (built it, stole 23 customers)","Prevented potential PR crisis by catching negative sentiment spike early"],quote:"Social listening transformed from a marketing luxury to a revenue-generating engine. We're now the first to respond when someone asks for 2FA solutions, and that timing advantage converts at 3x higher rate than cold outbound.",author:"Tom Williams, VP Sales at SecureAuth Solutions"})]}),e.jsxs("section",{id:"tool-categories",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Social Listening Tool Categories"}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Category 1: Enterprise Listening Platforms"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"Comprehensive tools that monitor everything, everywhere. High cost, steep learning curve."}),e.jsx("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Brandwatch ⢠$1,000-5,000/month"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Best for: Large brands, agencies, comprehensive market research"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"â Historical data back to 2010 ⢠â 100M+ sources ⢠â Advanced AI sentiment ⢠â Expensive ⢠â Complex setup"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Sprinklr ⢠$2,000-10,000/month"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Best for: Enterprise teams, omnichannel management"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"â Unified inbox across platforms ⢠â Workflow automation ⢠â Overkill for SMBs ⢠â Requires training"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Talkwalker ⢠$1,200-4,500/month"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Best for: Global brands, image recognition needs"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"â Logo recognition in images ⢠â 150+ languages ⢠â Steep learning curve ⢠â Pricey"})]})]})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Category 2: Mid-Market Listening Tools"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"Balanced features and pricing. Good for growing companies."}),e.jsx("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Mention ⢠$99-349/month"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Best for: SMBs, startups, straightforward monitoring"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"â Easy setup ⢠â Real-time alerts ⢠â Affordable ⢠â Limited historical data ⢠â Basic analytics"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Hootsuite Insights ⢠$299-739/month"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Best for: Teams already using Hootsuite for scheduling"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"â Integrated
151with publishing ⢠â Good sentiment analysis ⢠â Better options exist standalone"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Brand24 ⢠$99-399/month"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Best for: Marketing teams focused on PR and reputation"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"â Influencer identification ⢠â Discussion volume charts ⢠â Doesn't cover Reddit well"})]})]})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Category 3: Specialized Engagement Discovery"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"Focus on finding conversations where you can add value and engage."}),e.jsx("div",{className:"bg-card/30 border border-primary/50 rounded-lg p-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"DESHILLER ⢠$49-199/month"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Best for: B2B lead generation, finding engagement opportunities"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"â AI-powered discovery ⢠â Engagement-focused ⢠â Twitter/LinkedIn/Reddit ⢠â Reply generation ⢠â Not for comprehensive brand monitoring"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"F5Bot ⢠Free"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Best for: Reddit/Hacker News monitoring on a budget"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"â Completely free ⢠â Simple email alerts ⢠â Reddit/HN only ⢠â No sentiment analysis"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Google Alerts ⢠Free"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Best for: Basic news and blog monitoring"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"â Free ⢠â Easy setup ⢠â Misses social platforms ⢠â Noisy results"})]})]})})]})]}),e.jsxs("div",{id:"setup-strategy",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mt-12 mb-4",children:"Setting Up Your Listening Strategy"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"The 4-Layer Listening Framework:"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Layer 1: Brand Monitoring (Reactive)"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Your brand name + common misspellings"}),e.jsx("li",{children:"⢠Product names and features"}),e.jsx("li",{children:"⢠Executive names (CEO, founders)"}),e.jsx("li",{children:"⢠Branded hashtags"})]}),e.jsxs("p",{className:"text-xs text-primary mt-2",children:["Priority: High ⢠Response time: ","<","1 hour"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Layer 2: Industry Keywords (Proactive)"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Problem statements your product solves"}),e.jsx("li",{children:"⢠Industry jargon and terminology"}),e.jsx("li",{children:'⢠Pain point keywords ("struggling with...", "frustrated by...")'}),e.jsx("li",{children:'⢠Question patterns ("how do I...", "best way to...")'})]}),e.jsx("p",{className:"text-xs text-primary mt-2",children:"Priority: High ⢠Response time: 2-4 hours"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Layer 3: Competitor Intelligence"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Competitor brand names"}),e.jsx("li",{children:'⢠"[Competitor] alternatives" or "vs [Competitor]"'}),e.jsx("li",{children:"⢠Complaints about competitors"}),e.jsx("li",{children:"⢠Competitor product launches"})]}),e.jsx("p",{className:"text-xs text-primary mt-2",children:"Priority: Medium ⢠Response time: Same day"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Layer 4: Mar
151ket Trends"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Industry trends and shifts"}),e.jsx("li",{children:"⢠Emerging technologies"}),e.jsx("li",{children:"⢠Regulatory changes"}),e.jsx("li",{children:"⢠Customer behavior patterns"})]}),e.jsx("p",{className:"text-xs text-primary mt-2",children:"Priority: Low ⢠Response time: Weekly review"})]})]})]})]})]}),e.jsxs("section",{id:"tool-comparison",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Choosing the Right Tool for Your Business"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Decision Matrix:"}),e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-3 text-foreground",children:"Business Size"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"Primary Goal"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"Recommended Tool"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"Monthly Budget"})]})}),e.jsxs("tbody",{className:"text-muted-foreground",children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Startup/Solopreneur"}),e.jsx("td",{className:"py-3",children:"Lead generation"}),e.jsx("td",{className:"py-3",children:"DESHILLER + F5Bot"}),e.jsx("td",{className:"py-3",children:"$49-99"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Small Business"}),e.jsx("td",{className:"py-3",children:"Brand monitoring"}),e.jsx("td",{className:"py-3",children:"Mention or Brand24"}),e.jsx("td",{className:"py-3",children:"$99-199"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Mid-Market"}),e.jsx("td",{className:"py-3",children:"Market intelligence"}),e.jsx("td",{className:"py-3",children:"Hootsuite Insights"}),e.jsx("td",{className:"py-3",children:"$299-500"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Enterprise"}),e.jsx("td",{className:"py-3",children:"Comprehensive analysis"}),e.jsx("td",{className:"py-3",children:"Brandwatch or Sprinklr"}),e.jsx("td",{className:"py-3",children:"$1,000-5,000"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3",children:"Agency"}),e.jsx("td",{className:"py-3",children:"Multi-client management"}),e.jsx("td",{className:"py-3",children:"Talkwalker or Brandwatch"}),e.jsx("td",{className:"py-3",children:"$2,000-10,000"})]})]})]})]})]}),e.jsxs("section",{id:"measuring-impact",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Measuring Social Listening Impact"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Social listening is only valuable if it drives action. Track these metrics:"}),e.jsxs("ul",{className:"space-y-3 text-muted-foreground my-6",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Opportunity discovery rate:"})," Relevant conversations found per week"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Response time:"})," Time from mention to response (target: ","<","1 hour for urgent)"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Engagement conversion:"})," % of listened conversations that become leads/customers"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Crisis prevention:"})," Negative sentiment spikes caught and addressed early"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Competitive intelligence:"})," Insights that influenced product/marketing decisions"]})]})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"ROI calculation:"})," (Revenue from listening-sourced leads + Cost of prevented crises) - Tool cost = Net ROI. Most businesses see 5-10x ROI within 6 months."]})]}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Start Social Listening Today"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"DESHILLER automatically discovers relevant conversations across Twitter, LinkedIn, and Reddit. Focus on engagement, not endless searching."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Start Free Trial"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},uy=()=>{const s=ns(),t=[{id:"understanding-engagement",text:"Understanding Engagement Rate",level:2},{id:"why-it-matters",text:"Why Engagement Rate Matters More Than Followers",level:2},{id:"content-timing-interaction",text:"The Content-Timing-Interaction Triangle",level:2},{id:"platform-strategies",text:"Platform-Specific Strategies",level:3},{id:"doubling-engagement",text:"30-Day Plan to Double Engagement",level:2},{id:"tracking-progress",text:"Tracking & Measuring Progress",level:2}],a=[{title:"Algorithm Optimization",description:"Master platform algorithms for maximum visibility",category:"Growth",readTime:"9 min",path:"/academy/algorithm-optimization"},{title:"Content Calendar Planning",description:"Plan content that drives consistent engagement",category:"Planning",readTime:"7 min",path:"/academy/content-calendar-planning"},{title:"Community Building Tactics",description:"Transform audiences into engaged communities",category:"Community",readTime:"12 min",path:"/academy/community-building-tactics"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"How to Double Your Social Media Engagement Rate in 30 Days | DESHILLER"}),e.jsx("meta",{name:"description",content:"Data-driven strategies to significantly improve engagement metrics. Learn the proven framework that increased engagement rates from 2.1% to 8.4% in 90 days."})]}),e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back to Academy"]})]})})}),e.jsx("article",{className:"max-w-7xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("div",{className:"space-y-12",children:[e.jsx(it,{title:"How to Double Your Social Media Engagement Rate",description:"Data-driven strategies to significantly improve your engagement metrics across all platforms through content optimization and strategic interaction patterns.",category:"Growth Strategy",readTime:"14 min read",publishDate:"January 21, 2025",lastUpdated:"January 29, 2025",featuredImage:"https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=1200&h=400&fit=crop",author:{name:"Emma Chen",role:"Social Growth Consultant",avatar:"https://images.unsplash.com/photo-1580489944761-15a19d654956?w=100&h=100&fit=crop",bio:"Helped 50+ brands increase engagement rates by average 240% using data-driven frameworks"},stats:{views:"19.7K",shares:"1.4K"}}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-12",children:[e.jsxs("section",{id:"understanding-engagement",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Understanding Engagement Rate"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 my-8",children:[e.jsx(Ze,{icon:gs,stat:"3-5%",description:"Average engagement rate for B2B brands",source:"Rival IQ 2024"}),e.jsx(Ze,{icon:Pa,stat:"5-8%",description:"Average engagement rate for B2C brands",source:"Social Bakers 2024"}),e.jsx(Ze,{icon:St,stat:"2.3x",description:"Engagement drives reach vs. no engagement",source:"Facebook Business 2024"}),e.jsx(Ze,{icon:lr,stat:"4.7x",description:"Value of engaged follower vs. passive",source:"HubSpot 2024"})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["Engagement rate measures ",e.jsx("strong",{className:"text-foreground",children:"how actively your audience interacts with your content"})," relative to your reach or follower count. It's calculated as: (Likes + Comments + Shares + Saves) ÷ Impressions à 100."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Critical insight:"})," A smaller, highly engaged audience is infinitely more valuable than a large, passive one. 10K followers with 5% engagement (500 interactions) beats 100K followers with 0.5% engagement (500 interactions)âbut the first group actually reads and cares about your content."]}),e.jsx(ct,{company:"GrowthLab Marketing",industry:"B2B Marketing Agency",challenge:"LinkedIn account with 8,700 followers but dismal 0.9% engagement rate. Posts getting 60-80 likes with almost zero comments or shares. Leadership questioned value of social media entirely. Team spending 10 hours weekly on content with minimal results.",solution:"Complete engagement overhaul using The Triangle Framework: (1) Content shift from promotional to educational/controversial, (2) Posting time optimized via 2-week testing (moved from 2pm to 9am), (3) Proactive engagement strategyâspent first 30 min daily engaging with target audience before posting own content.",results:["Engagement rate increased from 0.9% to 4.7% in 60 days (422% improvement)","Average post impressions grew from 2,400 to 8,900 (271% growth) due to algorithmic boost","Comments per post jumped from 2-3 to 18-35 (real conversations, not just emoji reactions)","Generated 89 qualified leads directly from LinkedIn engagement (vs 4 in previous 6 months)","LinkedIn became #2 lead source after website, ahead of paid ads","Time spent on social reduced from 10 to 6 hours weekly (automation + focus)"],quote:"We realized we were broadcasting into the void. The moment we started treating LinkedIn as a conversation platform instead of a megaphone, engagement exploded. And those engaged followers actually buyâour close rate from LinkedIn leads is 34% vs 18% from cold outbound.",author:"Maria Santos, CMO at GrowthLab Marketing"})]}),e.jsxs("section",{id:"why-it-matters",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Why Engagement Rate Matters More Than Followers"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"The Engagement Multiplier Effect:"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"1. Algorithmic Distribution"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"High engagement signals quality to algorithms. Your content gets shown to more peopleâoften 3-5x more impressions than low-engagement posts."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"2. Social Proof Cascade"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Posts with visible engagement (comments, like
151s) attract more engagement. People engage with what others are engaging with. It's self-reinforcing."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"3. Relationship Depth"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Engaged followers become advocates, customers, and referral sources. Passive followers scroll past you forever."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"4. Conversion Correlation"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Research shows 73% correlation between engagement rate and conversion rate. Engaged audiences buy. Period."})]})]})]})]}),e.jsxs("section",{id:"content-timing-interaction",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"The Content-Timing-Interaction Triangle"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["High engagement requires ",e.jsx("strong",{className:"text-foreground",children:"three elements working together"}),". Most people optimize one or two and wonder why results plateau. You need all three."]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"The Three Pillars:"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h5",{className:"font-semibold text-foreground mb-3",children:"Pillar 1: Content That Resonates Emotionally"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Content formats with highest engagement rates (Hootsuite 2024 data):"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2 ml-4",children:[e.jsx("li",{children:"⢠Controversial opinions: 7.2% avg engagement (must be backed by reasoning)"}),e.jsx("li",{children:"⢠Personal stories with lessons: 6.8% avg engagement"}),e.jsx("li",{children:"⢠Data-driven insights (surprising stats): 5.9% avg engagement"}),e.jsx("li",{children:"⢠How-to guides with actionable steps: 5.4% avg engagement"}),e.jsx("li",{children:"⢠Behind-the-scenes / vulnerability: 5.1% avg engagement"}),e.jsx("li",{children:"⢠Question posts (specific, not generic): 4.7% avg engagement"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-3 italic",children:"Avoid: Promotional posts (0.8%), generic quotes (1.2%), news reposts without commentary (1.4%)"})]}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-semibold text-foreground mb-3",children:"Pillar 2: Optimal Posting Timing"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Best times vary by platform, but general patterns hold:"}),e.jsxs("div",{className:"bg-background/50 rounded p-4 text-sm",children:[e.jsxs("p",{className:"text-foreground mb-2",children:[e.jsx("strong",{children:"LinkedIn:"})," Tue-Thu 9am-12pm, Wed 9-10am is peak (+41% engagement)"]}),e.jsxs("p",{className:"text-foreground mb-2",children:[e.jsx("strong",{children:"Twitter:"})," Mon-Fri 8-10am & 6-9pm, avoid weekends for B2B"]}),e.jsxs("p",{className:"text-foreground mb-2",children:[e.jsx("strong",{children:"Instagram:"})," Mon-Fri 11am-2pm, Thu 11am-12pm is peak"]}),e.jsxs("p",{className:"text-foreground",children:[e.jsx("strong",{children:"Facebook:"})," Wed 11am-1pm, Thu-Fri 1-3pm for B2B"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-3",children:"Test for 2 weeks, track engagement by time slot, double down on your peaks"})]}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-semibold text-foreground mb-3",children:"Pillar 3: Proactive Interaction Strategy"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["The most overlooked pillar. You must ",e.jsx("strong",{className:"text-foreground",children:"prime the algorithm and audience"}),":"]}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2 ml-4",children:[e.jsx("li",{children:"⢠Engage with 5-10 target audience posts BEFORE posting your own content"}),e.jsx("li",{children:"⢠Respond to EVERY comment on your post within first hour (signals active conversation)"}),e.jsx("li",{children:'⢠Ask specific questions in your posts that invite responses (not "What do you think?")'}),e.jsx("li",{children:"⢠Reply to replies (keep conversation going in comments)"}),e.jsx("li",{children:"⢠Share others' valuable content regularly (reciprocity effect)"})]}),e.jsx("p",{className:"text-xs text-primary mt-3",children:"Accounts that engage first see 3.4x higher engagement on their own posts (Buffer study)"})]})]})]}),e.jsxs("div",{id:"platform-strategies",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mt-12 mb-4",children:"Platform-Specific Engagement Strategies"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-3",children:"LinkedIn: Value + Authority"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2",children:[e.jsx("li",{children:"â Long-form posts (1,200-1,900 characters) perform best"}),e.jsx("li",{children:"â Use line breaks for readability (dense paragraphs kill engagement)"}),e.jsx("li",{children:"â Include data/stats in first 2 sentences (hooks readers)"}
151),e.jsx("li",{children:"â Tag relevant people (sparinglyâ2-3 max, only when genuine)"}),e.jsx("li",{children:"â Post carousels for 2.1x more engagement than text-only"})]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-3",children:"Twitter: Personality + Frequency"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2",children:[e.jsx("li",{children:"â Threads (7-12 tweets) get 2.3x engagement of single tweets"}),e.jsx("li",{children:"â Reply to high-visibility tweets in your niche before posting own content"}),e.jsx("li",{children:"â Use visuals in 50%+ of tweets (150% more retweets)"}),e.jsx("li",{children:"â Ask questions, but make them specific and opinionated"}),e.jsx("li",{children:"â Post 3-5x daily for optimal reach without fatigue"})]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-3",children:"Instagram: Visual + Story"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2",children:[e.jsx("li",{children:"â Reels dominate (2,000% more reach than static posts in 2024)"}),e.jsx("li",{children:"â Use trending audio (seriouslyâalgorithm loves it)"}),e.jsx("li",{children:"â Carousel posts get 1.4x more engagement than single images"}),e.jsx("li",{children:"â Write caption hooks that stop scrolling (don't bury the lead)"}),e.jsx("li",{children:"â Stories with polls/questions get 3x more taps"})]})]})]})]})]}),e.jsxs("section",{id:"doubling-engagement",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"30-Day Plan to Double Your Engagement Rate"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Week-by-Week Breakdown:"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Week 1: Audit & Baseline"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Calculate current engagement rate (last 30 posts)"}),e.jsx("li",{children:"⢠Identify your top 10 performing posts (what patterns emerge?)"}),e.jsx("li",{children:"⢠Test posting times: try 3 different time slots"}),e.jsx("li",{children:"⢠Start engaging first (30 min before posting)"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Week 2: Content Shift"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Eliminate promotional content completely"}),e.jsx("li",{children:"⢠Post 2 controversial takes (backed by reasoning)"}),e.jsx("li",{children:"⢠Share 1 personal story with business lesson"}),e.jsx("li",{children:"⢠Create 1 data-driven insight post"}),e.jsx("li",{children:"⢠Continue daily engagement first routine"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Week 3: Interaction Amplification"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Respond to EVERY comment within 1 hour"}),e.jsx("li",{children:"⢠Ask specific questions in every post"}),e.jsx("li",{children:"⢠Share 3 other people's content with your insights"}),e.jsx("li",{children:"⢠Test carousel/thread formats"}),e.jsx("li",{children:"⢠Track which content types perform best"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Week 4: Optimize & Scale"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Double down on best-performing content types"}),e.jsx("li",{children:"⢠Lock in optimal posting times based on data"}),e.jsx("li",{children:"⢠Increase engagement first time to 45 minutes"}),e.jsx("li",{children:"⢠Measure new engagement rate vs. baseline"}),e.jsx("li",{children:"⢠Document learnings, refine strategy"})]})]})]})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Expected results:"})," Following this plan, most accounts see 80-150% engagement rate increase within 30 days. Continued optimization drives further gains."]})]}),e.jsxs("section",{id:"tracking-progress",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Tracking & Measuring Progress"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Track these metrics weekly to measure progress:"}),e.jsxs("ul",{className:"space-y-3 text-muted-foreground my-6",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Overall engagement rate:"})," Primary metric. Target 3-5% for B2B, 5-8% for B2C"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Comments per post:"})," Quality engagement indicator. Target ",">","2% of impressions"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Share/save rate:"})," Content value signal. Target 0.5-1% of impressions"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Profile visits:"})," Engagement driving discovery. Should grow proportionally"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Click-through rate:"})," For posts with links. Target 1-3%"]})]})]})]}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Boost Engagement Automatically"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:'Let DESHILLER find high-value conversations to engage with before you post. Implement the "engage first" strategy without manual searching.'}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Start Free Trial"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},hy=()=>{const s=ns(),t=[{id:"evolution",text:"The Evolution of B2B Sales",level:2},{id:"social-selling-framework",text:"The Social Selling Framework",level:2},{id:"ssi-score",text:"Building Your Social Selling Index",level:3},{id:"buying-signals",text:"Identifying Digital Buying Signals",level:2},{id:"outreach-playbook",text:"The Modern Outreach Playbook",level:2},{id:"measuring-results",text:"Measuring Social Selling Results",level:2}],a=[{title:"LinkedIn Lead Generation",description:"Master LinkedIn for B2B lead generation",category:"Lead Generation",readTime:"16 min",path:"/academy/linkedin-lead-generation"},{title:"Personal Branding for Executives",description:"Build executive presence that drives sales",category:"Branding",readTime:"10 min",path:"/academy/personal-branding-executives"},{title:"Content Marketing Automation",description:"Scale your social selling content efficiently",category:"Automation",readTime:"10 min",path:"/academy/content-marketing-automation"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"B2B Social Selling: The Modern Sales Playbook for 2025 | DESHILLER"}),e.jsx("meta",{name:"description",content:"Master B2B social selling with proven frameworks that close 31% more deals. Learn digital buying signals, outreach strategies, and social selling index building."})]}),e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back to Academy"]})]})})}),e.jsx("article",{className:"max-w-7xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("div",{className:"space-y-12",children:[e.jsx(it,{title:"B2B Social Selling: The Complete Modern Sales Playbook",description:"Learn the proven social selling framework that B2B sales teams use to close 31% more deals, reduce sales cycles by 40%, and build predictable pipeline through authentic relationship building.",category:"B2B Sales Strategy",readTime:"17 min read",publishDate:"January 17, 2025",lastUpdated:"January 28, 2025",featuredImage:"https://images.unsplash.com/photo-1553877522-43269d4ea984?w=1200&h=400&fit=crop",author:{name:"Robert Chen",role:"B2B Social Selling Strategist",avatar:"https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?w=100&h=100&fit=crop",bio:"Built social selling programs for 40+ B2B companies, $180M+ in influenced pipeline"},stats:{views:"28.4K",shares:"2.3K"}}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-12",children:[e.jsxs("section",{id:"evolution",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"The Evolution of B2B Sales: From Cold Calling to Social Selling"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 my-8",children:[e.jsx(Ze,{icon:Es,stat:"78%",description:"Of social sellers outsell peers who don't use social",source:"LinkedIn State of Sales 2024"}
151),e.jsx(Ze,{icon:gs,stat:"31%",description:"Higher close rates with social selling",source:"Forbes 2024"}),e.jsx(Ze,{icon:ks,stat:"45%",description:"More opportunities created via social vs cold outreach",source:"Sales Benchmark Index 2024"}),e.jsx(Ze,{icon:Ht,stat:"51%",description:"Of B2B buyers found vendor via social media",source:"Gartner 2024"})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"The fundamental shift:"})," Decision-makers no longer wait for sales calls. They research independently, read peer reviews, check LinkedIn profiles, and form opinions before ever speaking to sales. By the time they reach out, they're 57% through the buying journey (CEB research)."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["Social selling isn't about pitching on social media. It's about ",e.jsx("strong",{className:"text-foreground",children:"building relationships with buyers where they already spend time"}),"âestablishing credibility through content, engaging in relevant conversations, and becoming a trusted advisor before the formal sales process even begins."]}),e.jsx(ct,{company:"EnterpriseCloud Software",industry:"B2B SaaS - Enterprise Cloud Infrastructure",challenge:"Traditional sales approach: cold calling, email blasts, conference sponsorships. Cost per qualified lead: $2,400. Sales cycle: 11 months. Win rate: 18%. Buyer resistance highâprospects saw them as 'just another vendor.' Lost 3 major deals to competitor who had built relationships months earlier.",solution:"Complete shift to social selling methodology: (1) Built thought leadership on LinkedInâCEO and sales leaders posted 3x/week on cloud infrastructure challenges, (2) Sales team spent 45 min daily engaging with target accounts' posts before any outreach, (3) Created 'Digital Dossiers' on prospectsâtracked their content, interests, pain points before first conversation, (4) Warm introduction approachâonly reached out after 5+ meaningful interactions.",results:["Cost per qualified lead dropped from $2,400 to $680 (72% reduction)","Sales cycle shortened from 11 months to 6.5 months (41% faster)","Win rate increased from 18% to 34% (89% improvement)","Pipeline velocity improved 2.3xâdeals moved faster through stages","Generated $4.2M in influenced pipeline in first 6 months","Closed $890K in ARR directly attributed to social selling relationships","Sales team NPS from prospects increased from 32 to 67 (seen as advisors, not vendors)"],quote:"The moment we stopped cold calling and started building relationships three months before we needed them, everything changed. Prospects now come to us saying 'I've been following your content for months, can we talk?' That's the conversation you want to haveâthey're already halfway sold.",author:"Jennifer Wu, VP Sales at EnterpriseCloud Software"})]}),e.jsxs("section",{id:"social-selling-framework",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"The 4-Pillar Social Selling Framework"}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Pillar 1: Professional Brand (Your Digital First Impression)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Your profile is your 24/7 sales pitch. Buyers research you before responding to messages."}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2 ml-4",children:[e.jsxs("li",{children:['⢠Headline: Speak to customer outcomes, not your title ("I help CFOs reduce cloud costs by 40%" ',">",' "VP Sales @ CloudCo")']}),e.jsx("li",{children:"⢠About section: Problem you solve + credibility + clear CTA (booking link)"}),e.jsx("li",{children:"⢠Featured content: Case studies, valuable resources, social proof"}),e.jsx("li",{children:"⢠Recommendations: 10+ from customers describing specific results"}
151),e.jsx("li",{children:"⢠Activity: Post 2-3x weekly to show you're current and active"})]}),e.jsx("p",{className:"text-xs text-primary mt-3",children:"Profiles following this format get 5.7x more profile-to-meeting conversions"})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Pillar 2: Strategic Network (Quality Over Quantity)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Connect with ideal customer profiles and influencers in your space."}),e.jsxs("div",{className:"bg-background/50 rounded p-4 my-4",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground mb-2",children:"Ideal Network Composition (LinkedIn):"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-4",children:[e.jsx("li",{children:"⢠40% - Your ICP (decision-makers at target companies)"}),e.jsx("li",{children:"⢠25% - Industry influencers and thought leaders"}),e.jsx("li",{children:"⢠20% - Partners, vendors, ecosystem players"}),e.jsx("li",{children:"⢠15% - Current customers (for social proof and referrals)"})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Target 1,000-2,000 highly relevant connections, not 10K random ones. Quality compounds."})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Pillar 3: Content That Positions You as Expert"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Share insights buyers find valuable. Build credibility before you need it."}),e.jsx("div",{className:"space-y-3",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground mb-1",children:"Content Mix for Social Sellers:"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-4",children:[e.jsx("li",{children:"⢠50% Educational: Industry insights, trends, how-tos (builds expertise)"}),e.jsx("li",{children:"⢠30% Conversational: Engage with others' content, ask questions (builds relationships)"}),e.jsx("li",{children:"⢠15% Social proof: Customer wins, case studies (builds credibility)"}),e.jsx("li",{children:"⢠5% Promotional: Product updates, offers (subtle, infrequent)"})]})]})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-3 italic",children:"Sellers who post weekly close 45% more deals than those who don't (LinkedIn data)"})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Pillar 4: Strategic Engagement (The Sales Accelerator)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Engage with target accounts' content before you pitch. Build familiarity first."}),e.jsxs("div",{className:"bg-background/50 rounded p-4 my-4",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground mb-2",children:"The 5-3-1 Engagement Method:"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2 ml-4",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"5 days:"})," Engage with target account posts (like, thoughtful comment)"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"3 touchpoints:"})," Minimum interactions before reaching out"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"1 message:"})," Personalized connection/message referencing specific engagement"]})]})]}),e.jsx("p",{className:"text-xs text-primary mt-3",children:"This approach gets 68% connection acceptance vs 12% for cold requests"})]})]}),e.jsxs("div",{id:"ssi-score",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mt-12 mb-4",children:"Building Your Social Selling Index (SSI)"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"LinkedIn's Social Selling Index scores you 0-100 on four dimensions. Top performers (SSI 75+) create 45% more opportunities."}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"The 4 SSI Components:"}),e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-3 text-foreground",children:"Component"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"What It Measures"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"How to Improve"})]})}),e.jsxs("tbody",{className:"text-muted-foreground",children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Establish Brand"}),e.jsx("td",{className:"py-3",children:"Profile completeness, posting"}),e.jsx("td",{className:"py-3",children:"Complete profile, post 2
151-3x/week"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Find Right People"}),e.jsx("td",{className:"py-3",children:"ICP connections, search usage"}),e.jsx("td",{className:"py-3",children:"Connect with decision-makers, use Sales Nav"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Engage with Insights"}),e.jsx("td",{className:"py-3",children:"Content sharing, engagement"}),e.jsx("td",{className:"py-3",children:"Share valuable content, engage daily"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3",children:"Build Relationships"}),e.jsx("td",{className:"py-3",children:"InMail response, acceptance rates"}),e.jsx("td",{className:"py-3",children:"Send personalized messages, provide value"})]})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-4",children:"Check your SSI at: linkedin.com/sales/ssi"})]})]})]}),e.jsxs("section",{id:"buying-signals",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Identifying Digital Buying Signals"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Buyers leave digital breadcrumbs showing intent. Track these signals to prioritize outreach."}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"High-Intent Buying Signals:"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[e.jsx("h5",{className:"font-semibold text-foreground mb-2",children:"ð¥ Hot Signals (Reach out within 24 hours)"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Viewed your profile 3+ times in a week"}),e.jsx("li",{children:"⢠Engaged with multiple pieces of your content"}),e.jsx("li",{children:"⢠Posted about problem your product solves"}),e.jsx("li",{children:"⢠Changed job title to decision-maker role"}),e.jsx("li",{children:"⢠Company posted job opening related to your solution"})]})]}),e.jsxs("div",{className:"border-l-4 border-orange-500 pl-4",children:[e.jsx("h5",{className:"font-semibold text-foreground mb-2",children:"ð¸ Warm Signals (Add to nurture, engage regularly)"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Viewed your profile once"}),e.jsx("li",{children:"⢠Liked/commented on your content"}),e.jsx("li",{children:"⢠Accepted connection request"}),e.jsx("li",{children:"⢠Active in groups discussing your topic"}),e.jsx("li",{children:"⢠Following your company page"})]})]}),e.jsxs("div",{className:"border-l-4 border-blue-500 pl-4",children:[e.jsx("h5",{className:"font-semibold text-foreground mb-2",children:"âï¸ Cold Signals (Long-term relationship building)"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Fits ICP but no direct signals"}),e.jsx("li",{children:"⢠In network but no engagement yet"}),e.jsx("li",{children:"⢠Mentioned by mutual connection"}),e.jsx("li",{children:"⢠Posted content loosely related to your space"})]})]})]})]})]}),e.jsxs("section",{id:"outreach-playbook",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"The Modern Outreach Playbook"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"The Warm Intro Sequence (Use after 3-5 engagements):"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Message 1: Value-First Intro"}),e.jsxs("div",{className:"bg-background/50 rounded p-4 text-sm font-mono",children:[e.jsx("p",{className:"text-muted-foreground mb-3",children:"Hey [Name],"}),e.jsx("p",{className:"text-muted-foreground mb-3",children:"Saw your post about [specific topic]. Your point about [detail] really resonatedâwe've helped several [similar role] tackle that challenge."}),e.jsx("p",{className:"text-muted-foreground mb-3",children:"I put together a quick framework on [related topic] that might be useful. No strings attached: [link]"}),e.jsx("p",{className:"text-muted-foreground mb-3",children:"Happy to chat if you found it helpful."}),e.jsx("p",{className:"text-muted-foreground",children:"[Your name]"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Response rate: 34-42% (vs 4% cold outreach)"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Follow-up (if they respond positively):"}),e.jsxs("div",{className:"bg-background/50 rounded p-4 text-sm font-mono",children:[e.jsx("p",{className:"text-muted-foreground mb-3",children:"Glad it was useful! Since you're dealing with [problem], curiousâhow are you handling [specific aspect] today?"}),e.jsx("p",{className:"text-muted-foreground mb-3",children:"We've worked with [similar company] on this and found [insight]. Would a 15-min call to share what we learned be helpful?"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Meeting conversion: 28% (strong pre-qualification via engagement)"})]})]})]})]}),e.jsxs("section",{id:"measuring-results",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Measuring Social Selling Results"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Key Social Selling Metrics:"}),e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-3 text-foreground",children:"Metric"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"What It Measures"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"Target"})]})}),e.jsxs("tbody",{className:"text-muted-foreground",children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"SSI Score"}),e.jsx("td",{className:"py-3",children:"Overall social selling effectiveness"}),e.jsx("td",{className:"py-3",children:"75+ (top quartile)"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Connection Acceptance"}),e.jsx("td",{className:"py-3",children:"Profile appeal, targeting quality"}),e.jsx("td",{className:"py-3",children:"50%+ for warm, 15%+ cold"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Message Response Rate"}),e.jsx("td",{className:"py-3",children:"Outreach quality"}),e.jsx("td",{className:"py-3",children:"30%+ (after engagement)"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Profile Views"}),e.jsx("td",{className:"py-3",children:"Visibility and interest"}),e.jsx("td",{className:"py-3",children:"200+ per week"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Social-Sourced Opps"}),e.jsx("td",{className:"py-3",children:"Pipeline contribution"}),e.jsx("td",{className:"py-3",children:"25-40% of total pipeline"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3",children:"Sales Cycle"}),e.jsx("td",{className:"py-3",children:"Relationship impact on velocity"}),e.jsx("td",{className:"py-3",children:"30-40% shorter"})]})]})]})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Attribution best practice:"}),' Tag opportunities in CRM with "Social Source" and track from first social interaction through close. Expect 3-6 month lag before seeing significant resultsârelationship building takes time.']})]}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Accelerate Your Social Selling"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Let DESHILLER discover buying signals and engagement opportunities across LinkedIn, Twitter, and Reddit. Focus on selling, not searching."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Start Free Trial"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},py=()=>{const s=ns(),t=[{id:"automation-challenge",text:"The Content Distribution Challenge",level:2},{id:"what-to-automate",text:"What to Automate (and What Not To)",level:2},{id:"automation-stack",text:"Building Your Automation Stack",level:3},{id:"workflow-examples",text:"Real Automation Workflows",level:2},{id:"avoiding-robotic",text:"Avoiding the 'Robotic' Trap",level:2},{id:"measuring-roi",text:"Measuring Automation ROI",level:2}],a=[{title:"Social Media Automation Guide",description:"Complete guide to social media automation",category:"Automation",readTime:"15 min",path:"/academy/social-media-automation-guide"},{title:"Content Calendar Planning",description:"Build sustainable content calendar systems",category:"Planning",readTime:"7 min",path:"/academy/content-calendar-planning"},{title:"Social Media Analytics",description:"Track and optimize content performance",category:"Analytics",readTime:"13 min",path:"/academy/social-media-analytics"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Content Marketing Automation: S
151ave 15 Hours Weekly in 2025 | DESHILLER"}),e.jsx("meta",{name:"description",content:"Master content marketing automation with proven workflows that save 15+ hours weekly while maintaining quality. Real case studies show 3.2x distribution efficiency."})]}),e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back to Academy"]})]})})}),e.jsx("article",{className:"max-w-7xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("div",{className:"space-y-12",children:[e.jsx(it,{title:"Content Marketing Automation: Scale Distribution Without Losing Quality",description:"Learn which content marketing tasks to automate, which workflows save the most time, and how to maintain authenticity while scaling your content distribution 3x.",category:"Marketing Automation",readTime:"13 min read",publishDate:"January 23, 2025",lastUpdated:"January 29, 2025",featuredImage:"https://images.unsplash.com/photo-1557804506-669a67965ba0?w=1200&h=400&fit=crop",author:{name:"Daniel Foster",role:"Content Operations Strategist",avatar:"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=100&h=100&fit=crop",bio:"Built content automation systems for 30+ companies, saved 400+ hours monthly across clients"},stats:{views:"17.2K",shares:"1.1K"}}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-12",children:[e.jsxs("section",{id:"automation-challenge",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"The Content Distribution Challenge"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 my-8",children:[e.jsx(Ze,{icon:Cs,stat:"16 hours",description:"Average weekly time on content distribution",source:"Content Marketing Institute 2024"}),e.jsx(Ze,{icon:ws,stat:"73%",description:"Of marketers say automation saves significant time",source:"HubSpot 2024"}),e.jsx(Ze,{icon:gs,stat:"3.2x",description:"Distribution efficiency with automation",source:"Buffer State of Social 2024"}),e.jsx(Ze,{icon:ks,stat:"67%",description:"Higher consistency with automated workflows",source:"CoSchedule 2024"})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["The paradox of content marketing: ",e.jsx("strong",{className:"text-foreground",children:"Creating content takes 4-8 hours. Distributing it across platforms takes another 12-16 hours"}),". Most marketers spend more time copy-pasting into different platforms than actually creating content."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"The breaking point:"})," You publish a blog post. Now you need to: schedule tweets (5 variations), create LinkedIn post, write Reddit threads for 3 subreddits, design Instagram graphics, send newsletter, update Slack, create video clips for TikTok/YouTube Shorts. Suddenly your 2-hour blog post becomes an 8-hour distribution nightmare."]}),e.jsx(ct,{company:"FinTech Insights Blog",industry:"B2B Financial Technology Media",challenge:"Publishing 3 long-form articles weekly. Distribution process: manually posting to 7 platforms, creating 15+ social variations, tracking analytics in spreadsheets. Total time: 22 hours weekly just on distribution. Two-person marketing team burning out, considering reducing content output.",solution:"Built comprehensive automation system: (1) Zapier workflows auto-distribute blog posts to Buffer, LinkedIn, Reddit via APIs, (2) Created content templates for each platform with variable insertion (auto-pulls headline, excerpt, CTA), (3) Set up automated analytics aggregation (pulls metrics from all platforms into single dashboard), (4) AI-assisted repurposing (generates social variations from blog content).",results:["Distribution time reduced from 22 hours to 7 hours weekly (68% time savings)","Consistency improvedânever missed a scheduled post (vs 3-4 missed posts monthly before)","Increased posting frequency from 3 to 5 articles weekly with same team size","Audience growth accelerated 2.4x due to consistent multi-platform presence","Engagement per post increased 31% (consistency rewarded by algorithms)","Team bandwidth freed up to focus on content quality and strategy vs. manual posting"],quote:"We were drowning in distribution busywork. Automation didn't make us lazierâit made us better. We now spend those saved 15 hours on research, interviews, and creating genuinely valuable content instead of copying and pasting.",author:"Sarah Kim, Content Director at FinTech Insights"})]}),e.jsxs("section",{id:"what-to-automate",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"What to Automate (and What Never to Automate)"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8",children:[e.jsxs("div",{className:"bg-card/30 border border-primary/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"â
Automate These Tasks"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-3",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Content scheduling:"})," Plan posts weeks ahead, publish automatically at optimal times"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Cross-platform distribution:"})," Publish once, distribute everywhere with format adaptations"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Social media monitoring:"})," Track mentions, keywords, competitor activity automatically"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Analytics aggregation:"})," Pull metrics from all platforms into unified dashboard"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Email list sync:"})," Auto-add newsletter signups to email tool, segment by behavior"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Content repurposing:"})," Convert blog to social snippets, quotes, infographics automatically"]})]})]})]}),e.jsxs("div",{className:"bg-card/30 border border-red-500/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"â Never Automate These"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-3",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-red-500 mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Direct replies to people:"})," Personal responses need human touch, period"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-red-500 mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Customer complaints:"})," Automated responses to angry customers = PR disaster"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-red-500 mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Crisis communication:"})," Must be manually reviewed before posting during sensitive situations"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-red-500 mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Community engagement:"})," Joining discussions needs authentic participation, not bot comments"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-red-500 mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Influencer outreach:"})," Relationship building requires genuine, personalized communication"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-red-500 mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"DM responses:"})," Direct messages expect personal replies, automation feels spammy"]})]})]})]})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"The golden rule:"})," Automate distribution and data collection. Keep creation and genuine interaction human. Automation should buy you time to be MORE human, not less."]}),e.jsxs("div",{id:"automation-stack",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mt-12 mb-4",children:"Building Your Content Automation Stack"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"The 5-Tool Automation Stack:"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"1. Content Hub (Source of Truth)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Where all c
151ontent lives. Examples: Notion, Airtable, WordPress"}),e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Purpose: Single source for all content, metadata, and status tracking"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"2. Scheduler (Distribution Engine)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Publishes content across platforms. Examples: Buffer, Hootsuite, Later"}),e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Purpose: Multi-platform scheduling, optimal timing, queue management"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"3. Integration Layer (Connector)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Connects tools together. Examples: Zapier, Make, Integromat"}),e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Purpose: Automate workflows between tools without coding"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"4. Analytics Aggregator (Intelligence)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Unified metrics dashboard. Examples: Databox, Klipfolio, Google Data Studio"}),e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Purpose: See all metrics in one place, automate reporting"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-2",children:"5. Monitoring Tool (Listening)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Track mentions and engagement. Examples: DESHILLER, Mention, Brand24"}),e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Purpose: Auto-discover conversations, alert on important mentions"})]})]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Budget-Based Recommendations:"}),e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-3 text-foreground",children:"Budget Tier"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"Recommended Stack"}),e.jsx("th",{className:"text-left py-3 text-foreground",children:"Monthly Cost"})]})}),e.jsxs("tbody",{className:"text-muted-foreground",children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Bootstrap"}),e.jsx("td",{className:"py-3",children:"Notion + Buffer + Zapier Free + Google Analytics"}),e.jsx("td",{className:"py-3",children:"$15-30"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Small Team"}),e.jsx("td",{className:"py-3",children:"Airtable + Buffer + Zapier + DESHILLER"}),e.jsx("td",{className:"py-3",children:"$100-200"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3",children:"Growing Business"}),e.jsx("td",{className:"py-3",children:"Contentful + Hootsuite + Make + Databox"}),e.jsx("td",{className:"py-3",children:"$300-500"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3",children:"Enterprise"}),e.jsx("td",{className:"py-3",children:"Custom CMS + Sprinklr + Custom APIs + Tableau"}),e.jsx("td",{className:"py-3",children:"$2,000+"})]})]})]})]})]})]}),e.jsxs("section",{id:"workflow-examples",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Real Automation Workflows That Save 10+ Hours Weekly"}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Workflow 1: Blog Post â Multi-Platform Distribution"}),e.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-foreground",children:"Trigger:"})," New blog post published in WordPress"]}),e.jsx("p",{children:e.jsx("strong",{className:"text-foreground",children:"Automated actions:"})}),e.jsxs("ul",{className:"space-y-2 ml-6",children:[e.jsx("li",{children:"1. Extract headline, excerpt, featured image, URL"}),e.jsx("li",{children:'2. Create LinkedIn post using template: "[Headline] + [excerpt] + [link]"'}),e.jsx("li",{children:"3. Generate 5 tweet variations highlighting different points"}),e.jsx("li",{children:"4. Schedule all posts for next 7 days at optimal times"}),e.jsx("li",{children:"5. Send notification to Slack with preview links"}),e.jsx("li",{children:'6. Add to "Published Content" database in Notion'}
151),e.jsx("li",{children:"7. Create task for team to monitor comments"})]}),e.jsxs("p",{className:"text-primary mt-3",children:[e.jsx("strong",{children:"Time saved:"})," 45 minutes per post â 3.5 hours weekly for 5 posts"]})]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Workflow 2: Social Mention â Response Queue"}),e.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-foreground",children:"Trigger:"})," Brand mentioned on Twitter, LinkedIn, or Reddit"]}),e.jsx("p",{children:e.jsx("strong",{className:"text-foreground",children:"Automated actions:"})}),e.jsxs("ul",{className:"space-y-2 ml-6",children:[e.jsx("li",{children:"1. Capture mention text, author, platform, URL"}),e.jsx("li",{children:"2. Analyze sentiment (positive/negative/neutral)"}),e.jsx("li",{children:"3. If negative: send urgent Slack alert to support team"}),e.jsx("li",{children:'4. If positive: add to "testimonials" collection'}),e.jsx("li",{children:'5. Add all mentions to Airtable "Response Queue"'}),e.jsx("li",{children:"6. Send daily digest email with all mentions needing responses"})]}),e.jsxs("p",{className:"text-primary mt-3",children:[e.jsx("strong",{children:"Time saved:"})," 2 hours daily searching â 10 hours weekly"]})]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"Workflow 3: Weekly Analytics Report"}),e.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-foreground",children:"Trigger:"})," Every Monday at 9am"]}),e.jsx("p",{children:e.jsx("strong",{className:"text-foreground",children:"Automated actions:"})}),e.jsxs("ul",{className:"space-y-2 ml-6",children:[e.jsx("li",{children:"1. Pull metrics from Twitter, LinkedIn, Instagram, website"}),e.jsx("li",{children:"2. Calculate: total reach, engagement rate, top posts, growth %"}),e.jsx("li",{children:"3. Generate charts showing week-over-week trends"}),e.jsx("li",{children:"4. Create PDF report with insights and recommendations"}),e.jsx("li",{children:"5. Email report to team with executive summary"}),e.jsx("li",{children:"6. Post key wins in Slack #marketing channel"})]}),e.jsxs("p",{className:"text-primary mt-3",children:[e.jsx("strong",{children:"Time saved:"})," 3 hours weekly creating manual reports"]})]})]})]})]}),e.jsxs("section",{id:"avoiding-robotic",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Avoiding the 'Robotic' Trap"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Automation done poorly feels mechanical. Here's how to keep it human:"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-4",children:"The Human Touch Checklist:"}),e.jsxs("ul",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Vary posting times:"})," Don't post at exact same time daily (looks automated)"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Add personality:"})," Include emojis, questions, personal anecdotes in automated posts"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Review before publishing:"})," Check scheduled posts daily, adjust for current events"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Mix automated and manual:"})," 70% scheduled, 30% real-time spontaneous posts"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Engage after posting:"})," Don't just post and forgetâreply to comments within 1 hour"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Pause during crises:"})," Have kill switch to stop all scheduled content during sensitive times"]})]})]})]})]}),e.jsxs("section",{id:"measuring-roi",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Measuring Content Automation ROI"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Track these metrics to
151justify automation investment:"}),e.jsxs("ul",{className:"space-y-3 text-muted-foreground my-6",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Time savings:"})," Hours saved weekly on manual tasks (typical: 10-20 hours)"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Consistency improvement:"})," % of scheduled posts that actually get published (target: 100%)"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Reach multiplication:"})," Content distributed to X more platforms/channels"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Engagement growth:"})," Overall engagement increase due to consistent presence"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-primary mt-1",children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:"Cost comparison:"})," Tool costs vs. hiring another person ($300/month tools vs $4K/month employee)"]})]})]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"ROI formula:"})," (Hours saved à hourly rate) - Tool costs = Net benefit. Most teams see 5-10x ROI within first 3 months."]})]}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Automate Social Discovery & Engagement"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Let DESHILLER automate finding relevant conversations while you focus on creating content. Complements your existing content automation stack."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Start Free Trial"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},gy=()=>{const s=ns(),t=[{id:"why-monitor",text:"Why Monitor Competitors?",level:2},{id:"monitoring-framework",text:"4-Layer Monitoring Framework",level:2},{id:"tools-setup",text:"Tools & Setup",level:2},{id:"analysis-actions",text:"From Analysis to Action",level:2},{id:"automation",text:"Automating Competitor Intelligence",level:2}],a=[{title:"Social Listening Tools Guide",description:"Master social listening platforms to track brand mentions, sentiment, and industry trends in real-time.",category:"Tools",readTime:"14 min read",path:"/academy/social-listening-tools"},{title:"Content Marketing Automation",description:"Build automated content systems that analyze competitor performance and adapt your strategy accordingly.",category:"Automation",readTime:"18 min read",path:"/academy/content-marketing-automation"},{title:"Social Media Analytics",description:"Deep dive into analytics platforms that benchmark your performance against industry competitors.",category:"Analytics",readTime:"16 min read",path:"/academy/social-media-analytics"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Competitor Monitoring Strategy: Intelligence Framework for 2025 | DESHILLER Academy"}),e.jsx("meta",{name:"description",content:"Build a comprehensive competitor monitoring system using social listening, content tracking, and competitive intelligence automation for strategic advantage."})]}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("nav",{className:"border-b border-border/40 bg-card/30 backdrop-blur-sm sticky top-0 z-50",children:e.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back to Academy"]}),e.jsx("span",{className:"text-2xl font-display font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"DESHILLER"})]})}),e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("main",{className:"max-w-4xl",children:[e.jsx(it,{category:"Competitive Intelligence",title:"Competitor Monitoring Strategy: Intelligence Framework for 2025",description:"Build a comprehensive competitor monitoring system that transforms competitive intelligence into strategic advantage across social media channels.",author:{name:"Marcus Chen",avatar:"MC",role:"Competitive Intelligence Lead",bio:"Former strategy consultant specializing in competitive analysis and market intelligence frameworks."},publishDate:"2025-01-10",lastUpdated:"2025-01-28",readTime:"17 min read",featuredImage:"https://images.unsplash.com/photo-1551288049-bebda4e38f71?w=1200&h=600&fit=crop",stats:{views:"24.5K",shares:"892"}}),e.jsxs("article",{className:"prose prose-lg max-w-none mt-12",children:[e.jsx("h2",{id:"why-monitor",children:"Why Monitor Competitors?"}),e.jsx("p",{className:"lead text-xl text-muted-foreground",children:"Competitive intelligence isn't about copyingâit's about understanding the competitive landscape to identify gaps, opportunities, and threats before they impact your market position."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsx(Ze,{icon:ks,stat:"73%",description:"of B2B marketers use competitive intelligence to inform strategy decisions",source:"Crayon State of CI 2024"}),e.jsx(Ze,{icon:gs,stat:"2.3x",description:"higher win rates for companies with formal competitor monitoring programs",source:"Forrester Research"})]}),e.jsx(ct,{company:"DataFlow Analytics",industry:"B2B SaaS",challenge:"Losing deals to competitors with better social proof and content marketing strategies, unclear product differentiation.",solution:"Implemented comprehensive competitor monitoring across 12 direct competitors, tracking content themes, engagement rates, customer sentiment, and feature announcements. Built automated alerts for competitive moves.",results:["Identified 4 underserved market segments competitors were ignoring","Reduced competitive loss rate from 34% to 19% in 6 months","Created differentiated messaging that increased demo-to-close rate by 41%","Launched counter-positioning campaign that captured 12% market share"],quote:"Competitive intelligence transformed from reactive firefighting to proactive strategy. We now anticipate competitor moves and position ourselves ahead of market shifts.",author:"Jennifer Park, CMO at DataFlow Analytics"}),e.jsx("h2",{id:"monitoring-framework",children:"4-Layer Monitoring Framework"}),e.jsx("h3",{children:"Layer 1: Content & Messaging Intelligence"}),e.jsx("p",{children:"Track what competitors are saying, how they're positioning, and what content resonates with their audience."}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Content themes:"})," Topic clusters, messaging angles, pain points addressed"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Engagement patterns:"})," Which content formats and topics drive the most engagement"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Publishing frequency:"})," Cadence by platform and content type"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Tone & voice:"})," Brand personality, formality level, emotional triggers used"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"CTAs & offers:"})," Lead magnets, trial structures, promotional strategies"]})]}),e.jsx("h3",{children:"Layer 2: Audience & Community Intelligence"}),e.jsx("p",{children:"Understand who engages with competitors, what they care about, and where dissatisfaction exists."}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Follower growth:"})," Rate of audience expansion by platform"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Audience demographics:"})," Job titles, industries, company sizes"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Engagement quality:"})," Comment sentiment, question types, advocacy signals"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Community complaints:"})," Pain points and frustrations expressed by their customers"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Advocacy patterns:"})," User-generated content, testimonials, case study subjects"]})]}),e.jsx("h3",{children:"Layer 3: Product & Feature Intelligence"}),e.jsx("p",{children:"Monitor product announcements, feature releases, and roadmap signals from competitor communication."}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Feature announcements:"})," New capabilities, integrations, platform updates"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Pricing changes:"})," Plan adjustments, promotional offers, packaging shifts"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Customer feedback:"})," Feature requests, bug reports, satisfaction signals"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Partnership announcements:"})," Strategic alliances, technology integrations"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Market positioning:"})," Messaging shifts, target audience changes, category creation"]})]}),e.jsx("h3",{children:"Layer 4: Campaign & Initiative Intelligence"}),e.jsx("p",{children:"Track major campaigns, marketing initiatives, and go-to-market strategies competitors execute."}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Campaign launches:"})," Major marketing initiatives, themes, channels used"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Event participation:"}
151)," Conference presence, webinar topics, sponsorships"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Influencer partnerships:"})," Collaborations, ambassador programs, co-marketing"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Paid advertising:"})," Ad copy, creative themes, targeting strategies"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"PR & media coverage:"})," Press releases, media mentions, thought leadership placements"]})]}),e.jsx("h2",{id:"tools-setup",children:"Tools & Setup"}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Essential Competitor Monitoring Stack"}),e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Tool Category"}),e.jsx("th",{className:"text-left py-2",children:"Purpose"}),e.jsx("th",{className:"text-left py-2",children:"Recommended Tools"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Social Listening"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Track brand mentions, keywords, sentiment"}),e.jsx("td",{className:"py-3 text-sm",children:"Brandwatch, Mention, Hootsuite"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Content Tracking"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Monitor competitor content & engagement"}),e.jsx("td",{className:"py-3 text-sm",children:"BuzzSumo, SEMrush, Ahrefs"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Social Analytics"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Benchmark performance metrics"}),e.jsx("td",{className:"py-3 text-sm",children:"Rival IQ, Sprout Social, Socialbakers"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Web Tracking"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Monitor website & product changes"}),e.jsx("td",{className:"py-3 text-sm",children:"Visualping, BuiltWith, SimilarWeb"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"CI Platform"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Centralized intelligence hub"}),e.jsx("td",{className:"py-3 text-sm",children:"Crayon, Klue, Kompyte"})]})]})]})]}),e.jsx("h3",{children:"Setting Up Your Monitoring System"}),e.jsxs("div",{className:"bg-accent/20 border-l-4 border-primary p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-2",children:"Implementation Checklist:"}),e.jsxs("ol",{className:"space-y-2 ml-4",children:[e.jsx("li",{children:"â Define 10-15 primary competitors (direct + indirect)"}),e.jsx("li",{children:"â Create competitor profiles with key data points"}),e.jsx("li",{children:"â Set up monitoring for each competitor across all active social platforms"}),e.jsx("li",{children:"â Configure alerts for significant changes (product launches, pricing, campaigns)"}),e.jsx("li",{children:"â Establish weekly intelligence review cadence"}),e.jsx("li",{children:"â Build dashboards for competitive benchmarking"}),e.jsx("li",{children:"â Create action triggers for specific competitive scenarios"})]})]}),e.jsx("h2",{id:"analysis-actions",children:"From Analysis to Action"}),e.jsx("p",{children:"Intelligence only matters if it drives decisions. Here's how to transform competitor data into strategic actions."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Intelligence â Action Framework"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Scenario: Competitor launches new feature you don't have"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Analysis:"})," Assess feature importance, customer demand signals, development effort"]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Actions:"})," (1) Build counter-positioning around your strengths, (2) Create content showing alternative approaches, (3) Fast-track roadmap evaluation, (4) Prepare sales battle cards"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Scenario: Competitor content consistently outperforms yours"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Analysis:"})," Identify format, topics, distribution strategies driving engagement"]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Actions:"})," (1) Test similar formats with your unique angle, (2) Analyze their distribution tactics, (3) Engage their audience with superior content, (4) Identify content gaps they're missing"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Scenario: Competitor customer complaints trending on social"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Analysis:"})," Categorize pain points, assess if you solve these issues better"]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Actions:"})," (1) Create content addressing these pain points, (2) Engage frustrated users directly (tactfully), (3) Develop comparison content highlighting your strengths, (4) Train sales team on competitive differentiation"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Scenario: Competitor reduces pricing or launches aggressive promotion"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Analysis:"})," Evaluate business health signals, customer retention implications, profit margin pressures"]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Actions:"})," (1) Reinforce value-based messaging (avoid price war), (2) Consider limited counter-offer for at-risk prospects, (3) Highlight total cost of ownership advantages, (4) Strengthen retention strategies"]})]})]})]}),e.jsx("h2",{id:"automation",children:"Automating Competitor Intelligence"}),e.jsx("p",{children:"Manual monitoring doesn't scale. Automate data collection and alerts to focus human analysis on strategic insights."}),e.jsx("h3",{children:"Automation Priorities"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Alert systems:"})," Immediate notifications for significant competitor moves (launches, pricing, leadership changes)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Weekly digests:"})," Automated reports summarizing competitor activity across all monitored channels"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Performance dashboards:"})," Real-time benchmarking of engagement, growth, content performance"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Content tracking:"})," Automatic detection of new competitor content with sentiment analysis"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Integration workflows:"})," Push intelligence into Slack, CRM, project management tools"]})]}),e.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 rounded-lg p-8 my-12 text-center",children:[e.jsx("h3",{className:"text-2xl font-display font-bold mb-4",children:"Automate Competitor Monitoring"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"DESHILLER automatically discovers competitor mentions and tracks their social media activity, delivering intelligence reports to your dashboard."}),e.jsx(h,{size:"lg",onClick:()=>s("/auth"),children:"Start Monitoring Free"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},fy=()=>{const s=ns(),t=[{id:"influencer-landscape",text:"The Influencer Landscape 2025",level:2},{id:"identification",text:"Identifying the Right Influencers",level:2},{id:"outreach-framework",text:"The 5-Touch Outreach Framework",level:2},{id:"collaboration-models",text:"Collaboration Models That Work",level:2},{id:"measuring-roi",text:"Measuring Influencer ROI",level:2}],a=[{title:"Influencer Partnership Strategies",description:"Build long-term influencer relationships that drive sustained brand growth and authentic audie
151nce engagement.",category:"Partnerships",readTime:"15 min read",path:"/academy/influencer-partnerships"},{title:"UGC Content Strategy",description:"Leverage user-generated content from influencers and customers to build social proof and brand authenticity.",category:"Content",readTime:"13 min read",path:"/academy/ugc-content-strategy"},{title:"Social Proof Strategies",description:"Deploy social proof tactics including influencer endorsements, testimonials, and case studies for conversion optimization.",category:"Conversion",readTime:"12 min read",path:"/academy/social-proof-strategies"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Influencer Outreach Tactics: Partnership Playbook for 2025 | DESHILLER Academy"}),e.jsx("meta",{name:"description",content:"Master influencer outreach with proven tactics for identifying, contacting, and partnering with influencers who drive authentic brand growth."})]}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("nav",{className:"border-b border-border/40 bg-card/30 backdrop-blur-sm sticky top-0 z-50",children:e.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back to Academy"]}),e.jsx("span",{className:"text-2xl font-display font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"DESHILLER"})]})}),e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("main",{className:"max-w-4xl",children:[e.jsx(it,{category:"Influencer Marketing",title:"Influencer Outreach Tactics: Partnership Playbook for 2025",description:"Learn proven tactics for identifying, contacting, and partnering with influencers who authentically align with your brand and drive measurable growth.",author:{name:"Sophia Rodriguez",avatar:"SR",role:"Influencer Marketing Strategist",bio:"Creator partnerships expert with 8+ years building influencer programs for B2C and DTC brands."},publishDate:"2025-01-12",lastUpdated:"2025-01-29",readTime:"16 min read",featuredImage:"https://images.unsplash.com/photo-1557804506-669a67965ba0?w=1200&h=600&fit=crop",stats:{views:"31.2K",shares:"1.1K"}}),e.jsxs("article",{className:"prose prose-lg max-w-none mt-12",children:[e.jsx("h2",{id:"influencer-landscape",children:"The Influencer Landscape 2025"}),e.jsx("p",{className:"lead text-xl text-muted-foreground",children:"The influencer marketing ecosystem has matured beyond vanity metrics. Today's successful partnerships focus on authentic alignment, engaged micro-communities, and measurable business outcomes."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsx(Ze,{icon:wa,stat:"$24B",description:"Global influencer marketing industry size in 2024, growing 25% year-over-year",source:"Influencer Marketing Hub 2024"}),e.jsx(Ze,{icon:es,stat:"89%",description:"of marketers say ROI from influencer marketing is comparable to or better than other channels",source:"Mediakix Survey"})]}),e.jsx("h3",{children:"Micro vs Macro: The Engagement Paradox"}),e.jsx("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Influencer Tier"}),e.jsx("th",{className:"text-left py-2",children:"Follower Range"}),e.jsx("th",{className:"text-left py-2",children:"Avg Engagement Rate"}),e.jsx("th",{className:"text-left py-2",children:"Best Use Case"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Nano"}),e.jsx("td",{className:"py-3 text-sm",children:"1K-10K"}),e.jsx("td",{className:"py-3 text-sm text-primary font-semibold",children:"7-12%"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Niche communities, local markets"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Micro"}),e.jsx("td",{className:"py-3 text-sm",children:"10K-100K"}),e.jsx("td",{className:"py-3 text-sm text-primary font-semibold",children:"5-8%"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Product reviews, tutorials, authentic endorsements"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Mid-Tier"}),e.jsx("td",{className:"py-3 text-sm",children:"100K-500K"}),e.jsx("td",{className:"py-3 text-sm text-primary font-semibold",children:"3-5%"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Brand awareness, campaign amplification"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"Macro/Celebrity"}),e.jsx("td",{className:"py-3 text-sm",children:"500K+"}),e.jsx("td",{className:"py-3 text-sm text-primary font-semibold",children:"1-3%"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Mass reach, brand credibility, major launches"})]})]})]})}),e.jsx(ct,{company:"NutriVibe Supplements",industry:"Health & Wellness",challenge:"Limited brand awareness in competitive supplement market, high customer acquisition costs through paid ads ($87 CAC), needed authentic endorsements from trusted voices.",solution:"Shifted from celebrity macro-influencers (low engagement, high cost) to micro-influencer strategy: partnered with 47 fitness and wellness micro-influencers (15K-85K followers) using systematic outreach framework. Offered product seeding, affiliate commission, and content collaboration.",results:["Reduced CAC from $87 to $34 through influencer-driven sales","Generated 1,200+ pieces of user-generated content in 6 months","Increased brand search volume by 340% from influencer exposure","Built long-term partnerships with 23 influencers (ongoing ambassadors)","Achieved 6.8x ROI on influencer marketing investment"],quote:"Micro-influencers transformed our brand. Their audiences trust them deeply, and that trust transfers to us. The engagement and conversion rates far exceeded our celebrity campaigns at 1/10th the cost.",author:"David Kim, Growth Lead at NutriVibe"}),e.jsx("h2",{id:"identification",children:"Identifying the Right Influencers"}),e.jsxs("p",{children:["Finding influencers isn't hardâfinding the ",e.jsx("em",{children:"right"})," influencers is. Alignment matters more than reach."]}),e.jsx("h3",{children:"The 5 A's of Influencer Selection"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Alignment:"})," Do their values, content themes, and audience match your brand? Look for authentic overlap, not forced fit."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Audience:"})," Is their audience your target customer? Check demographics, psychographics, and engagement patterns beyond surface-level metrics."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Authenticity:"})," Do they genuinely use and believe in products they promote? Review past partnerships for authenticity signals."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Activity:"})," Are they consistently posting quality content? Dormant or sporadic influencers won't drive results."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Analytics:"})," Can they provide performance data? Professional influencers track and share metrics (reach, engagement, conversions)."]})]}),e.jsx("h3",{children:"Research & Vetting Process"}),e.jsxs("div",{className:"bg-accent/20 border-l-4 border-primary p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-2",children:"10-Point Influencer Evaluation Checklist:"}),e.jsxs("ol",{className:"space-y-2 ml-4",children:[e.jsx("li",{children:"â Engagement rate (comments, shares, saves relative to follower count)"}),e.jsx("li",{children:"â Audience authenticity (check for fake followers using tools like HypeAuditor)"}),e.jsx("li",{children:"â Content quality and consistency (posting frequency, production value)"}),e.jsx("li",{children:"â Past brand partnerships (relevance, frequency, performance if disclosed)"}),e.jsx("li",{children:"â Audience demographics (age, location, interests, purchasing power)"}),e.jsx("li",{children:"â Brand safety (controversial content, alignment with your values)"}),e.jsx("li",{children:"â Communication style (professional, responsive, collaborative)"}),e.jsx("li",{children:"â Platform distribution (where their audience is most active)"}),e.jsx("li",{children:"â Content rights and usage terms (what you can repurpose)"}),e.jsx("li",{children:"â Pricing and compensation expectations (fair market value)"})]})]}),e.jsx("h2",{id:"outreach-framework",children:"The 5-Touch Outreach Framework"}),e.jsx("p",{children:"Most influencer outreach fails because it's too transactional. Build genuine relationships through multi-touch engagement before making an ask."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Week-by-Week Outreach Sequence"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Touch 1: Authentic Engagement (Wee
151k 1)"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Goal:"})," Get on their radar authentically"]}),e.jsx("p",{className:"text-sm",children:"Like, comment thoughtfully on 3-5 recent posts. Share their content with your audience. No mention of partnershipâjust genuine engagement."})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Touch 2: Value-First DM (Week 2)"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Goal:"})," Open communication with zero ask"]}),e.jsx("p",{className:"text-sm mb-2",children:"Message template:"}),e.jsx("div",{className:"bg-background/50 p-4 rounded text-sm",children:`"Hey [Name], I've been following your content on [topic] and really appreciated your take on [specific post]. I work at [Company] in [niche] and thought you might find [valuable resource/insight] interesting. No askâjust wanted to share. Keep up the great work!"`})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Touch 3: Product Seeding (Week 3-4)"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Goal:"})," Let them experience your product naturally"]}),e.jsx("p",{className:"text-sm mb-2",children:"Message template:"}),e.jsx("div",{className:"bg-background/50 p-4 rounded text-sm",children:`"Hey [Name], loved your recent post about [topic]. We just launched [product] that solves [problem you know they have]. Would love to send you one to tryâno strings attached, no obligation to post. Just think you'd genuinely enjoy it. Interested?"`})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Touch 4: Follow-Up & Feedback (Week 5-6)"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Goal:"})," Gather genuine feedback and gauge interest"]}),e.jsx("p",{className:"text-sm mb-2",children:"After they receive the product:"}),e.jsx("div",{className:"bg-background/50 p-4 rounded text-sm",children:`"Hope you got a chance to try [product]! Would love to hear your honest thoughts. We're always improving based on user feedback. Alsoâno pressure at all, but if you genuinely enjoyed it and want to share with your audience, we'd be happy to discuss a collaboration."`})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Touch 5: Partnership Proposal (Week 7+)"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Goal:"})," Present formal collaboration opportunity"]}),e.jsx("p",{className:"text-sm mb-2",children:"If they show interest, send structured proposal:"}),e.jsx("div",{className:"bg-background/50 p-4 rounded text-sm",children:`"Thanks for the positive feedback on [product]! I'd love to explore a partnership. Here's what we're thinking: [specific campaign details, compensation, content requirements, timeline, creative freedom]. Does this align with what you're looking for? Happy to adjust based on your preferences."`})]})]})]}),e.jsx("h2",{id:"collaboration-models",children:"Collaboration Models That Work"}),e.jsx("p",{children:"Different influencers and goals require different partnership structures. Match the model to your objectives and the influencer's preferences."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-lg mb-3",children:"Product Seeding"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Send free products with no posting obligation"}),e.jsxs("p",{className:"text-xs",children:[e.jsx("strong",{children:"Best for:"})," Building relationships, generating organic mentions, testing influencer interest before paid campaigns"]}),e.jsxs("p",{className:"text-xs mt-2",children:[e.jsx("strong",{children:"Cost:"})," Product cost only ($50-$200)"]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-lg mb-3",children:"Affiliate Partnerships"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Commission on sales driven (10-30% typical)"}),e.jsxs("p",{className:"text-xs",children:[e.jsx("strong",{children:"Best for:"})," Performance-based campaigns, influencers with proven conversion rates, scaling partnerships"]}),e.jsxs("p",{className:"text-xs mt-2",children:[e.jsx("strong",{children:"Cost:"})," Commission only (zero upfront)"]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-lg mb-3",children:"Sponsored Content"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Fixed payment for specific deliverables (1-3 posts)"}),e.jsxs("p",{className:"text-xs",children:[e.jsx("strong",{children:"Best for:"})," Brand awareness campaigns, product launches, time-sensitive promotions"]}),e.jsxs("p",{className:"text-xs mt-2",children:[e.jsx("strong",{children:"Cost:"})," $500-$50K+ depending on tier"]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-lg mb-3",children:"Brand Ambassadorships"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Long-term partnership (3-12 months, recurring content)"}),e.jsxs("p",{className:"text-xs",children:[e.jsx("strong",{children:"Best for:"})," Sustained brand building, product line coverage, influencer loyalty and advocacy"]}),e.jsxs("p",{className:"text-xs mt-2",children:[e.jsx("strong",{children:"Cost:"})," $2K-$100K+/month retainer"]})]})]}),e.jsx("h2",{id:"measuring-roi",children:"Measuring Influencer ROI"}),e.jsx("p",{children:"Track beyond vanity metrics. Focus on business outcomes that tie influencer activity to revenue and customer acquisition."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Essential Influencer KPIs"}),e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Metric"}),e.jsx("th",{className:"text-left py-2",children:"What It Measures"}),e.jsx("th",{className:"text-left py-2",children:"How to Track"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Reach & Impressions"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Brand exposure and awareness"}),e.jsx("td",{className:"py-3 text-sm",children:"Influencer reporting + platform analytics"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Engagement Rate"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Audience interest and interaction quality"}),e.jsx("td",{className:"py-3 text-sm",children:"(Likes + Comments + Saves) / Followers"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Click-Through Rate"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Traffic driven to your site/landing page"}),e.jsx("td",{className:"py-3 text-sm",children:"UTM links + Google Analytics"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Conversions"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Direct sales or leads from campaign"}),e.jsx("td",{className:"py-3 text-sm",children:"Affiliate links, promo codes, attribution"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Cost Per Acquisition"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Efficiency of influencer spending"}),e.jsx("td",{className:"py-3 text-sm",children:"Total spend / Customers acquired"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"Brand Lift"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Increased brand awareness/sentiment"}),e.jsx("td",{className:"py-3 text-sm",children:"Brand search volume, sentiment analysis"})]})]})]})]}),e.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 rounded-lg p-8 my-12 text-center",children:[e.jsx("h3",{className:"text-2xl font-display font-bold mb-4",children:"Automate Influencer Discovery"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"DESHILLER identifies influencers already engaging with topics in your niche, helping you prioritize outreach to warm prospects."}),e.jsx(h,{size:"lg",onClick:()=>s("/auth"),children:"Find Influencers Free"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},by=()=>{const s=ns(),t=[{id:"why-roi-matters",text:"Why ROI Measurement Matters",level:2},{id:"attribution-models",text:"Attribution Models",level:2},{id:"metrics-framework",text:"The Complete Metrics Framework",level:2},{id:"calculating-roi",text:"Calculating Social Media ROI",level:2},{id:"reporting-stakeholders",text:"Reporting to Stakeholders",level:2}],a=[{title:"Social Media Analytics",description:"Master analytics platforms and metrics that matter for data-driven social media decision-making.",category:"Analytics",readTime:"16 min read",path:"/academy/social-media-analytics"},{title:"Paid Social Advertising",description:"Optimize paid social campaigns with advanced targeting, bidding strategies, and conversion tracking.",category:"Advertising",readTime:"19 min read",path:"/academy/paid-social-advertising"},{title:"Social Media Audit",description:"Conduct comprehensive social media audits to identify opportunities and optimize performance.",category:"Strategy",readTime:"14 min read",path:"/academy/social-media-audit"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Social Media ROI Measurement: Complete Attribution Guide | DESHILLER Academy"}),e.jsx("meta",{name:"description",content:"Learn to measure social media ROI with attribution models, metrics frameworks, and executive reporting strategies that prove business value."})]}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("nav",{className:"border-b border-border/40 bg-card/30 backdrop-blur-sm sticky top-0 z-50",children:e.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back to Academy"]}),e.jsx("span",{className:"text-2xl font-display font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"DESHILLER"})]})}),e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("main",{className:"max-w-4xl",children:[e.jsx(it,{category:"Analytics & Measurement",title:"Social Media ROI Measurement: Complete Attribution Guide",description:"Master the frameworks, metrics, and attribution models needed to measure social media ROI and prove business value to stakeholders.",author:{name:"Rachel Thompson",avatar:"RT",role:"Analytics & Measurement Lead",bio:"Data strategist specializing in marketing attribution and ROI modeling for enterprise social programs."},publishDate:"2025-01-14",lastUpdated:"2025-01-30",readTime:"18 min read",featuredImage:"https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=1200&h=600&fit=crop",stats:{views:"28.7K",shares:"967"}}),e.jsxs("article",{className:"prose prose-lg max-w-none mt-12",children:[e.jsx("h2",{id:"why-roi-matters",children:"Why ROI Measurement Matters"}),e.jsx("p",{className:"lead text-xl text-muted-foreground",children:`"Likes and followers don't pay the bills." CFOs and executives demand proof that social media investments drive revenue. Without clear ROI measurement, budgets get cut and resources reallocated.`}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsx(Ze,{icon:Ht,stat:"52%",description:"of CMOs struggle to prove social media ROI to leadership, citing attribution challenges",source:"Gartner CMO Survey 2024"}
151),e.jsx(Ze,{icon:gs,stat:"3.2x",description:"higher budget allocation for marketing teams that demonstrate clear ROI vs. those that don't",source:"HubSpot Marketing Trends"})]}),e.jsx(ct,{company:"TechFlow Solutions",industry:"B2B SaaS",challenge:"Social media budget under threat due to inability to prove ROI. CMO couldn't connect social activity to pipeline and revenue. Executives questioned $180K annual social spend.",solution:"Implemented comprehensive ROI tracking with multi-touch attribution, UTM parameters on all social content, integrated CRM and social analytics, and created executive dashboard showing revenue influence. Tracked metrics: CAC by channel, influenced pipeline, and assisted conversions.",results:["Proved social media influenced $2.4M in pipeline over 6 months","Social-assisted deals had 23% higher close rates than other channels","Reduced cost per qualified lead from $247 to $89 via organic social","Secured 40% budget increase after demonstrating 4.7x ROI","LinkedIn content directly attributed to 14 enterprise deals ($890K ARR)"],quote:"We went from 'social media is nice to have' to 'it's a core revenue driver.' The data changed the conversation completely. Now executives ask how they can invest MORE in social.",author:"Michael Chen, CMO at TechFlow Solutions"}),e.jsx("h2",{id:"attribution-models",children:"Attribution Models"}),e.jsx("p",{children:"Attribution determines which touchpoints get credit for conversions. Different models answer different strategic questions."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Common Attribution Models Compared"}),e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Model"}),e.jsx("th",{className:"text-left py-2",children:"How It Works"}),e.jsx("th",{className:"text-left py-2",children:"Best For"}),e.jsx("th",{className:"text-left py-2",children:"Limitation"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"First-Touch"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"100% credit to first interaction"}),e.jsx("td",{className:"py-3 text-sm",children:"Brand awareness campaigns"}),e.jsx("td",{className:"py-3 text-sm",children:"Ignores nurturing touchpoints"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Last-Touch"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"100% credit to last interaction"}),e.jsx("td",{className:"py-3 text-sm",children:"Direct response, conversions"}),e.jsx("td",{className:"py-3 text-sm",children:"Ignores earlier influence"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Linear"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Equal credit to all touchpoints"}),e.jsx("td",{className:"py-3 text-sm",children:"Understanding full journey"}),e.jsx("td",{className:"py-3 text-sm",children:"Oversimplifies importance"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Time Decay"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"More credit to recent touchpoints"}),e.jsx("td",{className:"py-3 text-sm",children:"Short sales cycles"}),e.jsx("td",{className:"py-3 text-sm",children:"Undervalues early awareness"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"U-Shaped"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"40% first, 40% last, 20% middle"}),e.jsx("td",{className:"py-3 text-sm",children:"Lead generation focus"}),e.jsx("td",{className:"py-3 text-sm",children:"Arbitrary weighting"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"W-Shaped"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"30% first, 30% lead creation, 30% last, 10% middle"}),e.jsx("td",{className:"py-3 text-sm",children:"B2B with clear milestones"}),e.jsx("td",{className:"py-3 text-sm",children:"Requires defined conversion events"})]})]})]})]}),e.jsx("h3",{children:"Multi-Touch Attribution (MTA)"}),e.jsx("p",{children:"The gold standard for B2B and complex customer journeys. MTA tracks every touchpoint and assigns appropriate credit based on influence."}),e.jsxs("div",{className:"bg-accent/20 border-l-4 border-primary p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-2",children:"Implementing Multi-Touch Attribution:"}),e.jsxs("ol",{className:"space-y-2 ml-4",children:[e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Tag everything:"})," UTM parameters on all social links (source, medium, campaign, content, term)"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Integrate systems:"})," Connect social platforms â website analytics â CRM â revenue data"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Define conversion events:"})," Page visits, form fills, demo requests, purchases"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Track user journeys:"})," Map touchpoint sequences from first click to closed deal"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Assign weighted credit:"})," Use data-driven or custom weighting based on historical conversion patterns"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Report consistently:"})," Dashboard showing influenced pipeline, assisted revenue, ROI by platform"]})]})]}),e.jsx("h2",{id:"metrics-framework",children:"The Complete Metrics Framework"}),e.jsx("p",{children:"Organize metrics into three tiers: Activity (what happened), Engagement (how audience responded), and Business Outcomes (revenue impact)."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Three-Tier Social Media Metrics"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Tier 1: Activity Metrics (Vanity Metrics)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"What you did and how far it spread"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Posts published, Reach, Impressions"}),e.jsx("li",{children:"⢠Follower growth, Profile visits"}),e.jsx("li",{children:"⢠Useful for: Tracking effort, benchmark comparisons"}),e.jsxs("li",{children:["⢠",e.jsx("span",{className:"text-red-500",children:"Don't report to executivesâthese don't tie to business value"})]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Tier 2: Engagement Metrics (Proxy Metrics)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"How your audience interacts and responds"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Engagement rate (likes + comments + shares / reach)"}),e.jsx("li",{children:"⢠Click-through rate (CTR), Link clicks, Video completion rate"}),e.jsx("li",{children:"⢠Comment sentiment, Share of voice, Brand mentions"}),e.jsx("li",{children:"⢠Useful for: Content optimization, audience insights"}),e.jsxs("li",{children:["⢠",e.jsx("span",{className:"text-amber-500",children:"Report with contextâexplain why engagement matters for business goals"})]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Tier 3: Business Outcome Metrics (ROI Metrics)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Revenue, pipeline, and customer impact"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Leads generated from social, Cost per lead (CPL)"}),e.jsx("li",{children:"⢠Influenced pipeline value, Social-assisted deal
151s"}),e.jsx("li",{children:"⢠Customer acquisition cost (CAC) via social, Conversion rate"}),e.jsx("li",{children:"⢠Revenue attributed to social, Lifetime value (LTV) of social-acquired customers"}),e.jsxs("li",{children:["⢠",e.jsx("span",{className:"text-green-500",children:"ALWAYS report these to executivesâthis is what matters"})]})]})]})]})]}),e.jsx("h2",{id:"calculating-roi",children:"Calculating Social Media ROI"}),e.jsxs("p",{children:["The fundamental ROI formula: ",e.jsx("strong",{children:"(Revenue Generated - Investment Cost) / Investment Cost à 100"})]}),e.jsx("h3",{children:"What to Include in Cost Calculation"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Labor costs:"})," Salaries of social media team (full-time employees + contractors)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Tool costs:"})," Social management platforms, analytics tools, content creation software"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Paid media:"})," Ad spend across all social platforms"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Content production:"})," Design, video production, photography, freelancer fees"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Agency fees:"})," If using external agencies for strategy or execution"]})]}),e.jsx("h3",{children:"What to Include in Revenue Calculation"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-3",children:"Direct Revenue Attribution"}),e.jsxs("ul",{className:"text-sm space-y-2 ml-4 mb-6",children:[e.jsx("li",{children:"⢠Sales from social commerce (Instagram Shop, Facebook Shops, TikTok Shop)"}),e.jsx("li",{children:"⢠Conversions tracked via UTM parameters from social posts"}),e.jsx("li",{children:"⢠Promo code redemptions shared exclusively on social media"}),e.jsx("li",{children:"⢠Purchases from paid social ads (tracked via pixel/conversion API)"})]}),e.jsx("p",{className:"font-semibold mb-3",children:"Influenced Revenue Attribution"}),e.jsxs("ul",{className:"text-sm space-y-2 ml-4",children:[e.jsx("li",{children:"⢠Pipeline influenced by social touchpoints (multi-touch attribution)"}),e.jsx("li",{children:"⢠Deals where social was an assist (not last touch, but in journey)"}),e.jsx("li",{children:"⢠Brand search increases correlated with social campaigns"}),e.jsx("li",{children:"⢠Customer expansion revenue from social community engagement"})]})]}),e.jsx("h3",{children:"Worked Example: B2B SaaS ROI Calculation"}),e.jsxs("div",{className:"bg-accent/10 border border-accent/30 rounded-lg p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-4",children:"Scenario: 6-Month Social Media Program"}),e.jsxs("div",{className:"space-y-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Investment Costs (6 months):"}),e.jsxs("ul",{className:"ml-4 space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Social Media Manager salary (6 months): $30,000"}),e.jsx("li",{children:"⢠Content Designer salary (50% allocation): $18,000"}),e.jsx("li",{children:"⢠Tools (Hootsuite, Canva, analytics): $3,600"}),e.jsx("li",{children:"⢠Paid social ads (LinkedIn, Twitter): $25,000"}),e.jsx("li",{children:"⢠Freelance video production: $8,400"}),e.jsx("li",{children:e.jsx("strong",{className:"text-primary",children:"Total Investment: $85,000"})})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Revenue Generated (6 months):"}),e.jsxs("ul",{className:"ml-4 space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Direct social-attributed deals (last-touch): $140,000 ARR"}
151),e.jsx("li",{children:"⢠Social-assisted deals (in journey, not last-touch): $310,000 ARR"}),e.jsx("li",{children:"⢠Total influenced revenue: $450,000 ARR"}),e.jsx("li",{children:"⢠Using conservative 50% credit for assisted deals: $295,000"}),e.jsx("li",{children:e.jsx("strong",{className:"text-primary",children:"Attributed Revenue: $295,000"})})]})]}),e.jsxs("div",{className:"pt-4 border-t border-border/30",children:[e.jsx("p",{className:"font-semibold text-lg text-primary",children:"ROI Calculation:"}),e.jsxs("p",{className:"text-base mt-2",children:["($295,000 - $85,000) / $85,000 à 100 = ",e.jsx("strong",{className:"text-primary text-xl",children:"247% ROI"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Or expressed as multiple: 3.47x return on investment"})]})]})]}),e.jsx("h2",{id:"reporting-stakeholders",children:"Reporting to Stakeholders"}),e.jsx("p",{children:"Different audiences need different reports. Tailor metrics and presentation to stakeholder priorities."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Stakeholder-Specific Reporting"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"For CFO / Finance Team"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"What they care about:"})," ROI, CAC, budget efficiency, revenue impact"]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Report:"})," Total investment, revenue attributed, ROI percentage, CAC by channel comparison, cost savings vs. other channels"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"For CEO / Executive Leadership"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"What they care about:"})," Business growth, market position, competitive advantage"]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Report:"})," Revenue influenced, pipeline contribution, brand awareness growth, share of voice vs. competitors, strategic wins (partnerships, media coverage)"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"For VP Sales"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"What they care about:"})," Lead quality, sales enablement, deal velocity"]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Report:"})," MQLs from social, sales-qualified rate, influenced deals by rep, social-assisted close rate, average deal size comparison"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"For CMO / Marketing Leadership"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"What they care about:"})," Channel performance, funnel efficiency, content ROI"]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Report:"})," Full-funnel metrics (awareness â consideration â conversion), CAC trends, engagement benchmarks, content performance, platform-specific insights"]})]})]})]}),e.jsx("h3",{children:"Executive Dashboard Must-Haves"}),e.jsxs("div",{className:"bg-accent/20 border-l-4 border-primary p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-2",children:"Essential Executive Dashboard Elements:"}),e.jsxs("ol",{className:"space-y-2 ml-4",children:[e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Top-line ROI:"})," Prominently displayed with trend arrow (up/down vs. last period)"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Revenue contribution:"})," Total influenced revenue and percentage of overall revenue"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Cost efficiency:"})," CAC comparison (social vs. other channels)"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Pipeline impact:"})," Dollar value of open opportunities with social touchpoints"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Key performance indicators:"})," 3-5 metrics aligned with company OKRs"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Narrative insights:"})," 2-3 sentences explaining what the data means and what actions you're taking"]})]})]}),e.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 rounded-lg p-8 my-12 text-center",children:[e.jsx("h3",{className:"text-2xl font-display font-bold mb-4",children:"Track ROI Automatically"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"DESHILLER provides built-in analytics and attribution tracking, connecting social activity to business outcomes without complex integrations."}),e.jsx(h,{size:"lg",onClick:()=>s("/auth"),children:"Start Tracking Free"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},jy=()=>{const s=ns(),t=[{id:"why-executives-brand",text:"Why Executives Need Personal Brands",level:2},{id:"foundation-elements",text:"Foundation: Brand Positioning",level:2},{id:"content-strategy",text:"Executive Content Strategy",level:2},{id:"linkedin-mastery",text:"LinkedIn Mastery for Executives",level:2},{id:"thought-leadership",text:"Building Thought Leadership",level:2}],a=[{title:"LinkedIn Lead Generation",description:"Master LinkedIn for B2B lead generation with profile optimization, content strategy, and outreach tactics.",category:"LinkedIn",readTime:"17 min read",path:"/academy/linkedin-lead-generation"},{title:"B2B Social Selling",description:"Transform social media into a revenue engine with modern B2B social selling frameworks and strategies.",category:"B2B",readTime:"19 min read",path:"/academy/b2b-social-selling"},{title:"Content Marketing Automation",description:"Automate content creation, distribution, and engagement to scale thought leadership efforts efficie
151ntly.",category:"Automation",readTime:"18 min read",path:"/academy/content-marketing-automation"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Personal Branding for Executives: Thought Leadership Playbook | DESHILLER Academy"}),e.jsx("meta",{name:"description",content:"Build a powerful executive personal brand that drives business opportunities, attracts talent, and establishes thought leadership in your industry."})]}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("nav",{className:"border-b border-border/40 bg-card/30 backdrop-blur-sm sticky top-0 z-50",children:e.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back to Academy"]}),e.jsx("span",{className:"text-2xl font-display font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"DESHILLER"})]})}),e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("main",{className:"max-w-4xl",children:[e.jsx(it,{category:"Executive Strategy",title:"Personal Branding for Executives: Thought Leadership Playbook",description:"Build a powerful executive personal brand that drives business opportunities, attracts top talent, and establishes you as an industry thought leader.",author:{name:"Victoria Sterling",avatar:"VS",role:"Executive Brand Strategist",bio:"Former Fortune 500 CMO, now helping C-suite executives build influential personal brands and thought leadership platforms."},publishDate:"2025-01-16",lastUpdated:"2025-01-31",readTime:"20 min read",featuredImage:"https://images.unsplash.com/photo-1556761175-b413da4baf72?w=1200&h=600&fit=crop",stats:{views:"19.3K",shares:"743"}}),e.jsxs("article",{className:"prose prose-lg max-w-none mt-12",children:[e.jsx("h2",{id:"why-executives-brand",children:"Why Executives Need Personal Brands"}),e.jsx("p",{className:"lead text-xl text-muted-foreground",children:"In an age of transparency and social connection, the executive who hides behind their company logo loses competitive advantage. Your personal brand is your company's most powerful assetâand your career insurance policy."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsx(Ze,{icon:Sr,stat:"82%",description:"of buyers are more likely to trust a company when senior executives are active on social media",source:"LinkedIn Edelman Trust Barometer"}),e.jsx(Ze,{icon:Es,stat:"7x",description:"more engagement on executive posts compared to corporate brand posts on LinkedIn",source:"LinkedIn Internal Data 2024"})]}),e.jsx("h3",{children:"The Hidden ROI of Executive Personal Brands"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Business development:"})," Warm inbound leads from prospects who follow your thought leadership"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Talent acquisition:"})," Top candidates attracted to companies led by visible, inspiring leaders"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Media opportunities:"})," Journalists and conference organizers seek executives with established voices"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Board opportunities:"})," Board recruiters look for executives with industry influence and networks"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Crisis resilience:"})," Pre-built trust and credibility protect reputation during difficult times"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Career optionality:"})," Your personal brand travels with youâit's not tied to any single company"]})]}),e.jsx(ct,{company:"Sarah Chen, CFO â CEO Transition",industry:"SaaS / FinTech",challenge:"CFO at mid-size fintech startup, virtually invisible outside the company. Aspired to CEO role but lacked external recognition and thought leadership platform. No media presence or speaking engagements.",solution:"18-month personal brand transformation: Published weekly LinkedIn posts on fintech trends, contributed articles to TechCrunch and Forbes, spoke at 12 industry conferences, built network of 28K engaged followers. Focused content on intersection of finance, technology, and leadership.",results:["Promoted to CEO of the same company (board cited her industry visibility)","Featured in Forbes '40 Under 40' list for fintech leaders","Received 14 inbound board seat inquiries over 18 months","Company valuation increased 3x during her tenure (brand helped recruiting & partnerships)","Published book deal secured based on LinkedIn thought leadership ($150K advance)"],quote:"Building my personal brand wasn't vanityâit was strategic career investment. The visibility and credibility opened doors I didn't even know existed. When the board considered the CEO role, they said my external reputation gave them confidence I could lead at scale.",author:"Sarah Chen, CEO (identity protected)"}),e.jsx("h2",{id:"foundation-elements",children:"Foundation: Brand Positioning"}),e.jsx("p",{children:"Before creating content, you must define what you stand for. Executive personal brands succeed when they're differentiated, authentic, and strategically aligned with business goals."}),e.jsx("h3",{children:"The Personal Brand Positioning Framework"}),e.jsx("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"1. Expertise Zone: What are you uniquely qualified to talk about?"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Intersection of:"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Your professional experience and deep domain knowledge"}),e.jsx("li",{children:"⢠Topics where you have contrarian or differentiated perspectives"}),e.jsx("li",{children:"⢠Areas where you can provide genuine value to your target audience"})]}),e.jsx("p",{className:"text-sm mt-2 italic",children:'Example: "AI implementation in enterprise finance operations" (CFO at AI-native company)'})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"2. Audience Definition: Who are you building brand equity with?"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Be specific about:"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Primary audience (e.g., other CFOs, PE investors, fintech founders)"}),e.jsx("li",{children:"⢠Secondary audience (e.g., tech journalists, board recruiters, enterprise buyers)"}),e.jsx("li",{children:"⢠Their pain points, aspirations, and information needs"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"3. Differentiation: What makes your perspective unique?"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Identify your unique angle:"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Contrarian viewpoints on industry conventional wisdom"}),e.jsx("li",{children:"⢠Rare combination of experiences (e.g., operator + investor + academic)"}),e.jsx("li",{children:"⢠Willingness to be transparent about failures and lessons"}),e.jsx("li",{children:"⢠Access to proprietary data or unique market position"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"4. Brand Attributes: How do you want to be perceived?"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Choose 3-4 core attributes that guide all communication:"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Examples: Visionary, Data-driven, Empathetic, Contrarian, Pragmatic, Innovative"}),e.jsx("li",{children:"⢠Ensure attributes are authentic to who you actually are"}),e.jsx("li",{children:"⢠Test: Would your team describe you using these words?"})]})]})]})}),e.jsxs("div",{className:"bg-accent/20 border-l-4 border-primary p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-2",children:"Brand Positioning Statement Template:"}),e.jsxs("div",{className:"bg-background/50 p-4 rounded text-sm",children:['"I help ',e.jsx("strong",{children:"[target audience]"})," ",e.jsx("strong",{children:"[achieve specific outcome]"})," by sharing insights on ",e.jsx("strong",{children:"[expertise areas]"}),", with a focus on ",e.jsx("strong",{children:"[unique differentiation]"}),". I'm known for being ",e.jsx("strong",{children:"[3-4 brand attributes]"}),'."']}),e.jsx("p",{className:"text-sm mt-4",children:e.jsx("strong",{children:"Example:"})}),e.jsxs("div",{className:"bg-background/50 p-4 rounded text-sm",children:['"I help ',e.jsx("strong",{children:"B2B SaaS founders and CEOs"})," ",e.jsx("strong",{children:"scale their companies profitably"})," by sharing insights on ",e.jsx("strong",{children:"go-to-market strategy, sales operations, and revenue architecture"}),", with a focus on ",e.jsx("strong",{children:"data-driven frameworks over guru tactics"}),". I'm known for being ",e.jsx("strong",{children:"analytical, transparent, and pragmatic"}),'."']})]}),e.jsx("h2",{id:"content-strategy",children:"Executive Content Strategy"}),e.jsx("p",{children:"Executives don't have time to become full-time content creators. The key is strategic consistency, not volume."}),e.jsx("h3",{children:"The 80/20 Executive Content Formula"}),e.jsx("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Content Type"}),e.jsx("th",{className:"text-left py-2",children:"Frequency"}),e.jsx("th",{className:"text-left py-2",children:"Time Investment"}),e.jsx("th",{className:"text-left py-2",children:"Impact Level"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Flagship Posts"}),e.jsx("td",{className:"py-3 text-sm",children:"1x per week"}),e.jsx("td",{className:"py-3 text-sm",children:"30-45 min"}),e.jsx("td",{className:"py-3 text-sm text-primary font-semibold",children:"High Impact"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Micro-content"}),e.jsx("td",{className:"py-3 text-sm",children:"2-3x per week"}),e.jsx("td",{className:"py-3 text-sm",children:"5-10 min each"}),e.jsx("td",{className:"py-3 text-sm",children:"Medium Impact"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Engagement"}),e.jsx("td",{className:"py-3 text-sm",children:"Daily (10 min)"}),e.jsx("td",{className:"py-3 text-sm",children:"10 min/day"}),e.jsx("td",{className:"py-3 text-sm",children:"Medium Impact"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Long-form Articles"}),e.jsx("td",{className:"py-3 text-sm",children:"1x per month"}),e.jsx("td",{className:"py-3 text-sm",children:"2-3 hours"}),e.jsx("td",{className:"py-3 text-sm text-primary font-semibold",children:"High Impact"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"Speaking/Podcasts"}),e.jsx("td",{className:"py-3 text-sm",children:"1x per quarter"}),e.jsx("td",{className:"py-3 text-sm",children:"Variable"}),e.jsx("td",{className:"py-3 text-sm text-primary font-semibold",children:"Very High Impact"})]})]})]})}),e.jsx("h3",{children:"Flagship Post Formula: The Executive Insight"}),e.jsx("p",{children:"Your weekly flagship post should showcase genuine insights only an executive with your experience could provide."}),e.jsxs("div",{className:"bg-accent/10 border border-accent/30 rounded-lg p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-4",children:"Flagship Post Structure (500-700 words):"}),e.jsxs("ol",{className:"space-y-3 ml-4",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Hook (2-3 sentences):"})," Bold statement, surprising stat, or provocative question that stops the scroll",e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:`Example: "We just turned down a $50M Series B term sheet. Here's why saying no was the right strategic decision..."`})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Context (1 paragraph):"})," Briefly set up the situation or challenge",e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'Example: "After 18 months of hyper-growth, we faced a critical decision about our next funding round..."'})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"The Framework (3-5 bullets):"})," Your mental model, decision framework, or key insights",e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'Example: "We evaluated the offer against three criteria: 1) Strategic alignment, 2) Founder control preservation, 3) Path to profitability..."'})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"The Lesson (1-2 paragraphs):"}
151)," What this means for your audience, how they can apply it",e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:`Example: "The lesson: Not all capital is good capital. Here's how to evaluate whether you should take funding..."`})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Call to Engagement (1 sentence):"})," Invite comments, shares, or discussion",e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'Example: "Have you faced a similar decision? How did you evaluate it?"'})]})]})]}),e.jsx("h2",{id:"linkedin-mastery",children:"LinkedIn Mastery for Executives"}),e.jsx("p",{children:"LinkedIn is the executive's primary platform. Master it before expanding to other channels."}),e.jsx("h3",{children:"Profile Optimization for Executives"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Headline:"}),' Not just your titleâstate the value you create (e.g., "CEO @ TechCo | Helping B2B SaaS companies scale from $10M to $100M ARR")']}),e.jsxs("li",{children:[e.jsx("strong",{children:"About section:"})," Tell your story in first person, include your positioning statement, mention 2-3 signature achievements"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Featured section:"})," Pin your best contentâflagship posts, articles, media mentions, speaking engagements"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Experience section:"})," Quantify impact with specific metrics and outcomes (grew revenue 340%, raised $75M, scaled team from 20 to 200)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Creator mode:"})," Enable it, add 5 hashtags relevant to your expertise zone"]})]}),e.jsx("h3",{children:"LinkedIn Posting Best Practices"}),e.jsx("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium mb-2",children:"â DO:"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Post native LinkedIn content (not links to external articlesâsave those for comments)"}),e.jsx("li",{children:"⢠Use line breaks and whitespace for readability (3-4 sentences per paragraph max)"}),e.jsx("li",{children:'⢠Start strongâfirst 2 lines show in feed before "see more"'}),e.jsx("li",{children:"⢠Share lessons from actual experiences (wins AND failures)"}),e.jsx("li",{children:"⢠Respond to comments within first hour to boost engagement"}),e.jsx("li",{children:"⢠Tag relevant people/companies sparingly (adds context, builds relationships)"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium mb-2",children:"â DON'T:"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Post AI-written generic content (readers spot it immediately)"}),e.jsx("li",{children:'⢠Humble-brag without providing value ("Honored to be on Forbes list...")'}),e.jsx("li",{children:"⢠Only share company press releases (this is personal brand, not corporate comms)"}),e.jsx("li",{children:"⢠Overshare personal life (keep 90% professional, 10% personal)"}),e.jsx("li",{children:"⢠Post and ghost (engagement in comments is crucial)"}),e.jsx("li",{children:"⢠Controversial political takes (rarely strategic for executives)"})]})]})]})}),e.jsx("h2",{id:"thought-leadership",children:"Building Thought Leadership"}),e.jsx("p",{children:"Thought leadership goes beyond social media posts. It's about establishing yourself as the go-to expert in your domain through multiple channels."}),e.jsx("h3",{children:"The Thought Leadership Ladder"}),e.jsx("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:e.jsxs("ol",{className:"space-y-4",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Level 1 - Social Presence:"})," Consistent, valuable content on LinkedIn",e.jsx("p",{className:"text-sm text-muted-foreground",children:"Time: 2-3 hours/week | Reach: 5K-50K"})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Level 2 - Media Contributor:"})," Regular columns in industry publications (Forbes, TechCrunch, Harvard Business Review)",e.jsx("p",{className:"text-sm text-muted-foreground",children:"Time: 4-6 hours/month | Reach: 50K-500K"})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Level 3 - Conference Speaker:"})," Speaking at industry conferences and company events",e.jsx("p",{className:"text-sm text-muted-foreground",children:"Time: 1-2 events/quarter | Reach: Direct + amplified"})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Level 4 - Podcast/Media Guest:"})," Regular appearances on industry podcasts and media interviews",e.jsx("p",{className:"text-sm text-muted-foreground",children:"Time: 2-4 appearances/month | Reach: Highly targeted"})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Level 5 - Book Author:"})," Published book establishing definitive expertise",e.jsx("p",{className:"text-sm text-muted-foreground",children:"Time: 6-18 months | Reach: Permanent credibility asset"})]})]})}),e.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 rounded-lg p-8 my-12 text-center",children:[e.jsx("h3",{className:"text-2xl font-display font-bold mb-4",children:"Amplify Your Executive Voice"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"DESHILLER helps executives maintain consistent thought leadership presence by automating content discovery, engagement, and audience insights."}),e.jsx(h,{size:"lg",onClick:()=>s("/auth"),children:"Build Your Brand Free"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},yy=()=>{const s=ns(),t=[{id:"crisis-landscape",text:"The Social Media Crisis Landscape",level:2},{id:"crisis-types",text:"Crisis Types & Response Protocols",level:2},{id:"response-framework",text:"The 24-Hour Response Framework",level:2},{id:"crisis-prevention",text:"Crisis Prevention & Monitoring",level:2},{id:"recovery-reputation",text:"Recovery & Reputation Repair",level:2}],a=[{title:"Social Listening Tools",description:"Deploy social listening platforms to detect potential crises before they escalate and damage your brand.",category:"Tools",readTime:"14 min read",path:"/academy/social-listening-tools"},{title:"Customer Service on Social Media",description:"Transform social media into a customer service powerhouse with rapid response protocols and escalation workflows.",category:"Customer Service",readTime:"15 min read",path:"/academy/customer-service-social-media"},{title:"Brand Voice Development",description:"Develop consistent brand voice guidelines that maintain trust and authenticity during both normal operations and crisis situations.",category:"Brand Strategy",readTime:"16 min read",path:"/academy/brand-voice-development"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Crisis Management on Social Media: Response Playbook | DESHILLER Academy"}),e.jsx("meta",{name:"description",content:"Master crisis management with proven response frameworks, prevention strategies, and reputation repair tactics for social media emergencie
151s."})]}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("nav",{className:"border-b border-border/40 bg-card/30 backdrop-blur-sm sticky top-0 z-50",children:e.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back to Academy"]}),e.jsx("span",{className:"text-2xl font-display font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"DESHILLER"})]})}),e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("main",{className:"max-w-4xl",children:[e.jsx(it,{category:"Crisis Management",title:"Crisis Management on Social Media: Response Playbook",description:"Master crisis response with proven frameworks for detecting, containing, and recovering from social media emergencies before they destroy your brand reputation.",author:{name:"James Mitchell",avatar:"JM",role:"Crisis Communications Director",bio:"20+ years managing corporate crises for Fortune 500 brands, specializing in rapid social media response and reputation repair."},publishDate:"2025-01-18",lastUpdated:"2025-02-01",readTime:"19 min read",featuredImage:"https://images.unsplash.com/photo-1563986768609-322da13575f3?w=1200&h=600&fit=crop",stats:{views:"22.8K",shares:"1.3K"}}),e.jsxs("article",{className:"prose prose-lg max-w-none mt-12",children:[e.jsx("h2",{id:"crisis-landscape",children:"The Social Media Crisis Landscape"}),e.jsx("p",{className:"lead text-xl text-muted-foreground",children:"In the age of instant communication, a single tweet can trigger a brand crisis within minutes. The difference between companies that survive crises and those that don't comes down to preparation and speed of response."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsx(Ze,{icon:Cs,stat:"67%",description:"of brand crises escalate within the first 24 hours if not addressed promptly with transparent communication",source:"Edelman Trust Barometer 2024"}),e.jsx(Ze,{icon:qt,stat:"3.8x",description:"more negative sentiment spread when brands stay silent vs. acknowledge issues early, even before full facts are known",source:"Sprout Social Crisis Study"})]}),e.jsx("h3",{children:"What Defines a Social Media Crisis?"}),e.jsxs("p",{children:["Not every negative comment is a crisis. A crisis is a ",e.jsx("strong",{children:"high-volume, high-velocity negative event"})," that threatens brand reputation, customer trust, or business operations."]}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Crisis vs. Normal Negative Feedback"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-red-500 mb-2",children:"ð¨ CRISIS Indicators:"}),e.jsxs("ul",{className:"text-sm space-y-1",children:[e.jsx("li",{children:"⢠Mentions spike 300%+ in <24 hours"}),e.jsx("li",{children:"⢠Media outlets picking up the story"}),e.jsx("li",{children:"⢠Hashtag campaigns against your brand trending"}),e.jsx("li",{children:"⢠Employees/partners publicly criticizing company"}),e.jsx("li",{children:"⢠Executive leadership being personally attacked"}),e.jsx("li",{children:"⢠Calls for boycotts or legal action"}),e.jsx("li",{children:"⢠Impact on stock price or business operations"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-amber-500 mb-2",children:"â ï¸ Normal Negative Feedback:"}),e.jsxs("ul",{className:"text-sm space-y-1",children:[e.jsx("li",{children:"⢠Individual customer complaints (manageable volume)"}),e.jsx("li",{children:"⢠Product feature requests or suggestions"}),e.jsx("li",{children:"⢠Service issues affecting small user segment"}),e.jsx("li",{children:"⢠Competitive criticism from industry peers"}),e.jsx("li",{children:"⢠Minor PR missteps with limited spread"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-3",children:"Response: Standard customer service protocols, no crisis activation needed"})]})]})]}),e.jsx(ct,{company:"CloudSync Technologies",industry:"B2B SaaS",challenge:"Major data breach affecting 40,000 enterprise customers discovered on Frid
151ay evening. News leaked to Twitter before internal comms prepared. Within 2 hours: #CloudSyncBreach trending, media inquiries flooding in, customers threatening to churn, stock price dropping 18%.",solution:"Activated crisis response protocol within 30 minutes. CEO posted transparent video acknowledging breach, outlining known facts, immediate actions taken, and timeline for updates. Posted updates every 3 hours. Established dedicated response team, crisis website, and customer hotline. Suspended all marketing. Engaged directly with angry customers on social media.",results:["Contained crisis within 48 hours (sentiment shifted from 89% negative to 52% neutral)","Prevented mass customer churn (retention rate 94% vs. projected 70%)","Media coverage shifted from 'scandal' to 'responsible response' within 5 days","Stock price recovered 14 of 18 points lost within 2 weeks","Transparent handling resulted in 2,800+ positive mentions praising crisis response","Lawsuit threat from 3 enterprise customers withdrawn after direct CEO outreach"],quote:"Speed and transparency saved us. We admitted what we knew, what we didn't know, and what we were doing. Trying to hide or spin would have destroyed trust permanently. Our customers appreciated the honesty even in a terrible situation.",author:"Lisa Patel, CEO at CloudSync (name changed)"}),e.jsx("h2",{id:"crisis-types",children:"Crisis Types & Response Protocols"}),e.jsx("p",{children:"Different crisis types require different response strategies. Categorize quickly to activate the right protocol."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Crisis Category Matrix"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Category 1: Product/Service Failure"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Examples:"})," Outage, data breach, product defect, service disruption"]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Response Priority:"})," Technical resolution + transparent communication about fix timeline. Acknowledge immediately, update frequently, compensate affected customers."]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Category 2: Customer Service Failure"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Examples:"})," Viral complaint video, discriminatory service incident, employee misconduct"]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Response Priority:"})," Direct personal outreach to affected customer, public acknowledgment, policy/training changes announced. Show empathy and accountability."]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Category 3: PR/Marketing Misstep"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Examples:"})," Offensive ad campaign, tone-deaf social post, insensitive messaging"]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Response Priority:"})," Swift apology, pull offending content, explain how it happened and steps to prevent recurrence. Don't defend or justifyâown it."]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Category 4: Executive/Leadership Crisis"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Examples:"})," CEO scandal, executive misconduct, controversial statement by founder"]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Response Priority:"})," Board-level response, separation of company from individual if needed. Emphasize company values. May require leadership changes."]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Category 5: Misinformation/False Rumors"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Examples:"})," False allegations, competitor sabotage, conspiracy theories"]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Response Priority:"})," Rapid factual correction with evidence, enlist third-party validators, legal action if warranted. Don't engage with trolls directly."]})]})]})]}),e.jsx("h2",{id:"response-framework",children:"The 24-Hour Response Framework"}),e.jsx("p",{children:"When a crisis hits, the first 24 hours determine the outcome. This framework guides your minute-by-minute response."}),e.jsxs("div",{className:"bg-accent/10 border border-accent/30 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Hour-by-Hour Crisis Response Timeline"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Hour 0-1: Detection & Assembly"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"â Social listening alerts trigger (volume spike + negative sentiment)"}),e.jsx("li",{children:"â Assemble crisis response team (comms lead, legal, exec sponsor, subject matter expert)"}),e.jsx("li",{children:"â Pause all scheduled social media posts"}),e.jsx("li",{children:"â Gather initial facts (what happened, who's affected, what's our exposure)"}),e.jsx("li",{children:"â Assess crisis category and severity level"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Hour 1-3: Initial Response"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:`â Post holding statement acknowledging awareness: "We're aware of [issue] and investigating. More information within [timeframe]."`}),e.jsx("li",{children:"â Do NOT make promises you can't keep or assign blame without facts"}),e.jsx("li",{children:"â Activate customer support escalation protocol"}),e.jsx("li",{children:"â Brief executive leadership and board (depending on severity)"}),e.jsx("li",{children:"â Draft detailed response statement (legal review required)"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Hour 3-6: Substantive Response"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"â Post detailed statement covering: What happened, who's affected, what we're doing, timeline for resolution"}),e.jsx("li",{children:'â Include accountability ("This is our responsibility") and empathy ("We understand the impact")'}),e.jsx("li",{children:"â Provide multiple contact channels for affected customers"}),e.jsx("li",{children:"â Begin responding to individual comments (prioritize high-influence accounts)"}),e.jsx("li",{children:"â Prepare executive spokesperson for media if needed"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Hour 6-12: Active Management"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"â Post update with progress made and next steps"}),e.jsx("li",{children:"â Engage with community members defending your brand (thank them privately)"}),e.jsx("li",{children:"â Monitor for misinformation and correct with facts"}),e.jsx("li",{children:"â Adjust messaging based on sentiment shifts"}),e.jsx("li",{children:"â Consider video statement from CEO if crisis is severe"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Hour 12-24: Resolution Path"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"â Post resolution timeline and concrete actions being taken"}),e.jsx("li",{children:"â Announce compensation/remediation for affected customers if applicable"}),e.jsx("li",{children:"â Share policy changes or preventative measures"}),e.jsx("li",{children:"â Begin shifting from crisis mode to recovery mode"}),e.jsx("li",{children:"â Document lessons learned for post-crisis review"})]})]})]})]}),e.jsx("h3",{children:"Crisis Response Statement Template"}),e.jsxs("div",{className:"bg-background/50 border border-border/50 p-6 rounded-lg my-6",children:[e.jsx("p",{className:"font-semibold mb-3",children:"Essential Elements of Crisis Statement:"}),e.jsxs("ol",{className:"space-y-3 text-sm",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Acknowledgment:"}),` "We're aware of [specific issue] affecting [who]."`]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Empathy:"}),' "We understand how [frustrating/concerning/upsetting] this is, and we take full responsibility."']}),e.jsxs("li",{children:[e.jsx("strong",{children:"Facts Known:"}),` "Here's what we know so far: [bullet points of confirmed information]."`]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Immediate Action:"}),` "Here's what we're doing right now: [concrete steps being taken]."`]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Timeline:"}),' "We expect [resolution/update] by [specific time/date]."']}),e.jsxs("li",{children:[e.jsx("strong",{children:"Support:"}),` "If you're affected, please contact us at [specific channel] and we'll prioritize your case."`]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Commitment:"}),` "We're committed to [preventing this/making it right/rebuilding trust]."`]})]})]}),e.jsx("h2",{id:"crisis-prevention",children:"Crisis Prevention & Monitoring"}),e.jsx("p",{children:"The best crisis management is crisis prevention. Build early warning systems and establish protocols before you need them."}),e.jsx("h3",{children:"Crisis Prevention Checklist"}),e.jsx("div",{className:"bg-accent/20 border-l-4 border-primary p-6 my-6",children:e.jsxs("ol",{className:"space-y-2 ml-4",children:[e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Social listening:"})," 24/7 monitoring with alerts for volume spikes, negative sentiment, and executive mentions"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Crisis playbook:"})," Written protocols for each crisis type with pre-approved statement templates"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Response team:"})," Designated roles with clear escalation paths and after-hours contacts"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Training:"})," Quarterly crisis simulation exercises for response team"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Approval workflows:"}
151)," Pre-established for different severity levels (who can approve what)"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Dark site:"})," Pre-built crisis website that can be activated in minutes"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Media relationships:"})," Established contacts with key journalists for rapid outreach"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Legal counsel:"})," On-call PR/crisis attorneys available 24/7"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Employee guidelines:"})," Clear social media policies and crisis protocols for all staff"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Executive training:"})," Media training and crisis communication prep for C-suite"]})]})}),e.jsx("h2",{id:"recovery-reputation",children:"Recovery & Reputation Repair"}),e.jsx("p",{children:"After the acute crisis phase, the real work begins: rebuilding trust and repairing reputation damage."}),e.jsx("h3",{children:"Post-Crisis Recovery Timeline"}),e.jsx("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Week 1-2: Immediate Aftermath"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Continue daily updates even as situation stabilizes"}),e.jsx("li",{children:"⢠Deliver on all commitments made during crisis"}),e.jsx("li",{children:"⢠Personal outreach to most affected customers"}),e.jsx("li",{children:"⢠Begin returning to normal social media activity (gradually)"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Week 3-4: Rebuilding Phase"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Publish detailed post-mortem explaining root cause and preventative measures"}),e.jsx("li",{children:"⢠Share positive customer stories and testimonials"}),e.jsx("li",{children:"⢠Resume thought leadership content (carefully)"}),e.jsx("li",{children:"⢠Monitor sentimentâshould be trending neutral/positive"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Month 2-3: Trust Restoration"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Launch positive initiatives tied to crisis lessons learned"}),e.jsx("li",{children:"⢠Increase transparency in operations (build credibility)"}),e.jsx("li",{children:"⢠Engage industry influencers and advocates to vouch for progress"}),e.jsx("li",{children:"⢠Return to full social media programming"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Month 4-6: Reputation Reinforcement"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Amplify success stories and positive customer outcomes"}),e.jsx("li",{children:"⢠Pursue awards and third-party validation"}),e.jsx("li",{children:"⢠Executive thought leadership reestablishing industry standing"}),e.jsx("li",{children:"⢠Crisis should be fading from recent memory searches"})]})]})]})}),e.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 rounded-lg p-8 my-12 text-center",children:[e.jsx("h3",{className:"text-2xl font-display font-bold mb-4",children:"Monitor Brand Health 24/7"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"DESHILLER provides real-time monitoring and alerts to detect potential crises before they escalate, giving you critical time to respond."}),e.jsx(h,{size:"lg",onClick:()=>s("/auth"),children:"Start Monitoring Free"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},vy=()=>{const s=ns(),t=[{id:"why-employee-advocacy",text:"Why Employee Advocacy Works",level:2},{id:"program-structure",text:"Building Your Advocacy Program",level:2},{id:"content-strategy",text:"Content Strategy for Advocates",level:2},{id:"incentives-gamification",text:"Incentives & Gamification",level:2},{id:"measuring-impact",text:"Measuring Program Impact",level:2}],a=[{title:"Personal Branding for Executives",description:"Help your leadership team build personal brands that amplify company messaging and attract top talent.",category:"Executive",readTime:"20 min read",path:"/academy/personal-branding-executives"},{title:"Content Marketing Automation",description:"Automate content distribution to employee advocates with scheduling tools and curated content libraries.",category:"Automation",readTime:"18 min read",path:"/academy/content-marketing-automation"},{title:"Social Proof Strategies",description:"Leverage employee advocacy as social proof to build trust and credibility with prospects and customers.",category:"Conversion",readTime:"12 min read",path:"/academy/social-proof-strategies"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Employee Advocacy Programs: Scale Your Brand Through Your Team | DESHILLER Academy"}),e.jsx("meta",{name:"description",content:"Build employee advocacy programs that turn your team into authentic brand ambassadors, amplifying reach and building trust at scale."})]}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("nav",{className:"border-b border-border/40 bg-card/30 backdrop-blur-sm sticky top-0 z-50",children:e.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back to Academy"]}),e.jsx("span",{className:"text-2xl font-display font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"DESHILLER"})]})}),e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("main",{className:"max-w-4xl",children:[e.jsx(it,{category:"Employee Engagement",title:"Employee Advocacy Programs: Scale Your Brand Through Your Team",description:"Build structured employee advocacy programs that transform your workforce into authentic brand ambassadors, amplifying reach and building trust without feeling forced or corporate.",author:{name:"Amanda Foster",avatar:"AF",role:"Employee Engagement Strategist",bio:"Built and scaled employee advocacy programs for companies from 50 to 50,000 employees across B2B and B2C industries."},publishDate:"2025-01-20",lastUpdated:"2025-02-02",readTime:"17 min read",featuredImage:"https://images.unsplash.com/photo-1522071820081-009f0129c71c?w=1200&h=600&fit=crop",stats:{views:"16.9K",shares:"621"}}),e.jsxs("article",{className:"prose prose-lg max-w-none mt-12",children:[e.jsx("h2",{id:"why-employee-advocacy",children:"Why Employee Advocacy Works"}),e.jsx("p",{className:"lead text-xl text-muted-foreground",children:"Corporate social media accounts face declining organic reach and trust. But employees? Their personal networks are engaged, trusting, and ready to amplify authentic messages. Employee advocacy turns your team into a distributed marketing force."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsx(Ze,{icon:lr,stat:"16x",description:"more reach when content is shared by employees vs. brand channels due to network effects and algorithm preference",source:"LinkedIn Social Selling Report"}),e.jsx(Ze,{icon:gs,stat:"5x",description:"higher engagement rates on employee-shared content compared to the same content from corporate accounts",source:"Hootsuite Employee Advocacy Study"})]}
151),e.jsx("h3",{children:"The Business Case for Employee Advocacy"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Amplified reach:"})," Every employee's network (avg 500-1000 connections) becomes brand distribution"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Trust & authenticity:"})," People trust recommendations from real employees 3x more than corporate messaging"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Talent attraction:"})," 79% of job seekers use social media to evaluate companies (Glassdoor)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Thought leadership:"})," Employees become industry voices, elevating company reputation"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Cost efficiency:"})," Employee advocacy has 10x lower cost per impression than paid social"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Sales enablement:"})," Sales reps with strong social presence generate 45% more opportunities (LinkedIn)"]})]}),e.jsx(ct,{company:"Visionary Software",industry:"B2B SaaS (150 employees)",challenge:"Brand awareness stagnant, paid acquisition costs rising ($340 CAC), minimal organic reach on corporate channels. Marketing team of 4 couldn't produce enough content to compete with well-funded competitors.",solution:"Launched employee advocacy program starting with 40 volunteers across sales, customer success, and product teams. Provided curated content library, social media training, and gamified recognition system. Made participation optional but incentivized with quarterly awards and executive visibility.",results:["Program grew from 40 to 118 active employee advocates in 9 months","Generated 2.4M additional impressions per quarter from employee shares","Increased inbound demo requests by 37% (directly attributed via UTM tracking)","Reduced cost per lead from $340 to $127 through organic employee advocacy","78% of new hires cited employee social presence as factor in application decision","3 employees invited to speak at industry conferences (thought leadership boost)"],quote:"Our employees became our best marketers. Their authentic posts about product features, customer wins, and company culture reached audiences we could never access through paid ads. It's like having 100+ mini influencers authentically advocating for us.",author:"Karen Zhang, CMO at Visionary Software"}),e.jsx("h2",{id:"program-structure",children:"Building Your Advocacy Program"}),e.jsx("p",{children:"Successful employee advocacy programs require structure, support, and voluntary participation. Forced advocacy feels inauthentic and backfires."}),e.jsx("h3",{children:"Phase 1: Foundation (Months 1-2)"}),e.jsx("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:e.jsxs("ol",{className:"space-y-3",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Define program goals & metrics"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"What are you optimizing for? Brand awareness, lead generation, talent attraction, thought leadership?"})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Establish guidelines & policies"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Clear do's and don'ts, legal/compliance boundaries, brand voice guidance. Make it empowering, not restrictive."})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Recruit pilot group (20-40 employees)"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Start with enthusiastic volunteers across departments. Look for employees already active on social media."})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Provide training & resources"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Social media best practices, personal brand building, content creation basics, platform-specific tips."})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Build content library"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Curated, share-ready content organized by themes. Include suggested captions employees can personalize."})]})]})}
151),e.jsx("h3",{children:"Phase 2: Launch & Activation (Months 3-4)"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Kickoff event:"})," Celebrate launch, explain program benefits, answer questions, build excitement"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Select advocacy platform:"})," Tools like GaggleAMP, Bambu, LinkedIn Elevate for content distribution and tracking"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Weekly content drops:"})," Fresh content added to library every week with notification to advocates"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Engagement tracking:"})," Monitor participation rates, shares, reach, engagement per advocate"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Recognition program:"})," Spotlight top advocates in company meetings, Slack channels, newsletters"]})]}),e.jsx("h3",{children:"Phase 3: Scale & Optimize (Months 5+)"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Expand participation:"})," Open enrollment to more employees, share success stories to recruit"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Advanced training:"})," Content creation workshops, personal branding sessions, platform deep-dives"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Ambassador tiers:"})," Create levels (Bronze, Silver, Gold, Platinum) based on participation and impact"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Content collaboration:"})," Employees submit their own content ideas and drafts"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Measure business impact:"})," Tie advocacy to pipeline, hires, and brand lift metrics"]})]}),e.jsx("h2",{id:"content-strategy",children:"Content Strategy for Advocates"}),e.jsx("p",{children:"The best advocacy content balances company messaging with personal perspective. It should never feel like employees are corporate mouthpieces."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Content Mix for Employee Advocates"}),e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Content Type"}),e.jsx("th",{className:"text-left py-2",children:"% of Mix"}),e.jsx("th",{className:"text-left py-2",children:"Purpose"}),e.jsx("th",{className:"text-left py-2",children:"Examples"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Company News"}),e.jsx("td",{className:"py-3 text-sm",children:"20%"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Brand awareness"}),e.jsx("td",{className:"py-3 text-sm",children:"Product launches, funding, awards, milestones"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Industry Insights"}),e.jsx("td",{className:"py-3 text-sm",children:"30%"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Thought leadership"}),e.jsx("td",{className:"py-3 text-sm",children:"Trend analysis, research reports, expert commentary"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Employee Stories"}),e.jsx("td",{className:"py-3 text-sm",children:"25%"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Culture & talent"}),e.jsx("td",{className:"py-3 text-sm",children:"Day in the life, team wins, personal growth"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Customer Success"}),e.jsx("td",{className:"py-3 text-sm",children:"15%"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Social proof"}),e.jsx("td",{className:"py-3 text-sm",children:"Case studies, testimonials, customer spotlights"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"Personal Content"}),e.jsx("td",{className:"py-3 text-sm",children:"10%"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Authenticity"}),e.jsx("td",{className:"py-3 text-sm",children:"Career learnings, industry observations, tips"})]})]})]})]}),e.jsx("h3",{children:"Content Creation Framework for Employees"}),e.jsxs("div",{className:"bg-accent/20 border-l-4 border-primary p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-2",children:`The "3 P's" of Employee Advocacy Content:`}),e.jsxs("ol",{className:"space-y-2 ml-4",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Personal:"})," Add your unique perspective or experience to company content",e.jsx("p",{className:"text-sm text-muted-foreground",children:`Example: "We just launched [feature]. As a [role], I'm excited because [personal reason]..."`})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Purposeful:"})," Explain why it matters to your network",e.jsx("p",{className:"text-sm text-muted-foreground",children:'Example: "This solves [problem] that many of you in [industry] face..."'})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Promotional (lightly):"})," Include company mention but don't make it the whole point",e.jsx("p",{className:"text-sm text-muted-foreground",children:`Example: "Proud to work at a company that [values/action]. Check out [link] if you're curious."`})]})]})]}),e.jsx("h2",{id:"incentives-gamification",children:"Incentives & Gamification"}),e.jsx("p",{children:"Participation should be voluntary, but thoughtful incentives and recognition boost engagement and sustain momentum."}),e.jsx("h3",{children:"Incentive Strategies That Work"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-lg mb-3",children:"Intrinsic Motivators"}),e.jsxs("ul",{className:"text-sm space-y-2",children:[e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Executive visibility:"})," CEO shoutouts for top advocates"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Professional development:"})," Advanced social media training, personal branding workshops"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Career advancement:"})," Advocacy participation noted in performance reviews"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Thought leadership:"})," Speaking opportunities at company events"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Network growth:"})," Help employees build their professional networks"]})]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold text-lg mb-3",children:"Extrinsic Rewards"}),e.jsxs("ul",{className:"text-sm space-y-2",children:[e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Quarterly awards:"})," Gift cards, experiences, or donations to employee's charity of choice"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Swag & perks:"})," Exclusive company merchandise for active advocates"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Team competitions:"})," Department vs. department advocacy challenges"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Points system:"})," Redeem points for PTO, parking spots, or other benefits"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Recognition wall:"})," Physical or digital showcase of top advocates"]})]})]})]}
151),e.jsx("h3",{children:"Gamification Elements"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Leaderboards:"})," Real-time rankings of top advocates by shares, reach, engagement"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Badges & achievements:"}),' "First Share," "Engagement Champion," "Thought Leader," "Monthly MVP"']}),e.jsxs("li",{children:[e.jsx("strong",{children:"Level progression:"})," Bronze â Silver â Gold â Platinum tiers with increasing perks"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Team challenges:"})," Department goals with collective rewards"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Milestone celebrations:"})," Recognize 50th share, 10K impressions reached, etc."]})]}),e.jsx("h2",{id:"measuring-impact",children:"Measuring Program Impact"}),e.jsx("p",{children:"Track both engagement metrics (activity) and business metrics (outcomes) to prove program ROI."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Employee Advocacy KPIs"}),e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Metric Category"}),e.jsx("th",{className:"text-left py-2",children:"Key Metrics"}),e.jsx("th",{className:"text-left py-2",children:"Target Benchmark"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Participation"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Active advocates, shares per advocate, program growth rate"}),e.jsx("td",{className:"py-3 text-sm",children:"15-30% of workforce actively participating"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Reach & Impressions"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Total impressions, reach amplification vs. corporate channels"}),e.jsx("td",{className:"py-3 text-sm",children:"10-20x reach multiplier vs. brand accounts"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Engagement"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Clicks, likes, comments, shares on employee posts"}),e.jsx("td",{className:"py-3 text-sm",children:"3-7% engagement rate (vs. 1-2% for brand)"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Business Impact"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Leads generated, traffic to site, job applications, deal influence"}),e.jsx("td",{className:"py-3 text-sm",children:"5-15% of total leads from advocacy"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"Brand Lift"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Brand search volume, sentiment, share of voice"}),e.jsx("td",{className:"py-3 text-sm",children:"15-25% increase in branded search"})]})]})]})]}),e.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 rounded-lg p-8 my-12 text-center",children:[e.jsx("h3",{className:"text-2xl font-display font-bold mb-4",children:"Launch Employee Advocacy"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"DESHILLER provides tools to curate content, track employee advocacy metrics, and gamify participation for sustained engagement."}),e.jsx(h,{size:"lg",onClick:()=>s("/auth"),children:"Start Program Free"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},Ny=()=>{const s=ns(),t=[{id:"hashtag-fundamentals",text:"Hashtag Fundamentals",level:2},{id:"research-discovery",text:"Research & Discovery",level:2},{id:"platform-strategies",text:"Platform-Specific Strategies",level:2},{id:"optimization-testing",text:"Optimization & Testing",level:2},{id:"advanced-tactics",text:"Advanced Hashtag Tactics",level:2}],a=[{title:"Algorithm Optimization",description:"Understand platform algorithms and optimize content distribution with strategic hashtag usage and engagement tactics.",category:"Growth",readTime:"15 min read",path:"/academy/algorithm-optimization"},{title:"Content Calendar Planning",description:"Plan strategic content calendars that incorporate trending and evergreen hashtags for consistent visibility.",category:"Planning",readTime:"14 min read",path:"/academy/content-calendar-planning"},{title:"Twitter Engagement Strategy",description:"Master Twitter-specific hashtag strategies to maximize engagement, reach trending topics, and build community.",category:"Twitter",readTime:"16 min read",path:"/academy/twitter-engagement-strategy"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Hashtag Strategy Guide: Research, Optimization & Platform Tactics | DESHILLER Academy"}),e.jsx("meta",{name:"description",content:"Master hashtag strategies across platforms with research frameworks, optimization tactics, and data-driven approaches to maximize reach and engagement."})]}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("nav",{className:"border-b border-border/40 bg-card/30 backdrop-blur-sm sticky top-0 z-50",children:e.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back to Academy"]}),e.jsx("span",{className:"text-2xl font-display font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"DESHILLER"})]})}),e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("main",{className:"max-w-4xl",children:[e.jsx(it,{category:"Content Strategy",title:"Hashtag Strategy Guide: Research, Optimization & Platform Tactics",description:"Master data-driven hashtag strategies that maximize discoverability, engagement, and reach across Instagram, Twitter, LinkedIn, and TikTok.",author:{name:"Derek Huang",avatar:"DH",role:"Growth Marketing Specialist",bio:"Former head of organic growth at consumer tech startup, scaled Instagram from 10K to 500K followers using strategic hashtag research."},publishDate:"2025-01-22",lastUpdated:"2025-02-03",readTime:"16 min read",featuredImage:"https://images.unsplash.com/photo-1611162617474-5b21e879e113?w=1200&h=600&fit=crop",stats:{views:"33.4K",shares:"1.2K"}}),e.jsxs("article",{className:"prose prose-lg max-w-none mt-12",children:[e.jsx("h2",{id:"hashtag-fundamentals",children:"Hashtag Fundamentals"}),e.jsx("p",{className:"lead text-xl text-muted-foreground",children:"Hashtags are searchable metadata that categorize content and expand reach beyond your follower base. Used strategically, they're discovery engines. Used poorly, they're spam that hurts engagement."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsx(Ze,{icon:gs,stat:"126%",description:"increase in engagement for Instagram posts using 20-30 hashtags vs. posts without hashtags",source:"Later Instagram Study 2024"}),e.jsx(Ze,{icon:Ks,stat:"78%",description:"of Instagram users have discovered new brands or products through hashtag searches",source:"Instagram Internal Data"})]}),e.jsx("h3",{children:"The Hashtag Hierarchy"}),e.jsx("p",{children:"Not all hashtags are created equal. Understanding the hierarchy helps you build balanced, discoverable sets."}),e.jsx("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Hashtag Type"}),e.jsx("th",{className:"text-left py-2",children:"Post Count"}),e.jsx("th",{className:"text-left py-2",children:"Competition"}),e.jsx("th",{className:"text-left py-2",children:"Best For"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Mega (1M+ posts)"}),e.jsx("td",{className:"py-3 text-sm",children:"Very High"}),e.jsx("td",{className:"py-3 text-sm text-red-500",children:"Extreme"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Brand awareness, trending topics"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"High (500K-1M)"}),e.jsx("td",{className:"py-3 text-sm",children:"High"}),e.jsx("td",{className:"py-3 text-sm text-orange-500",children:"Very High"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Broad category visibility"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Mid (100K-500K)"}),e.jsx("td",{className:"py-3 text-sm",children:"Moderate"}),e.jsx("td",{className:"py-3 text-sm text-amber-500",children:"High"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Niche targeting, engaged communities"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Low (10K-100K)"}),e.jsx("td",{className:"py-3 text-sm",children:"Low-Moderate"}),e.jsx("td",{className:"py-3 text-sm text-primary",children:"Moderate"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Best ROIâspecific, engaged audiences"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"Micro (<10K)"}),e.jsx("td",{className:"py-3 text-sm",children:"Very Low"}),e.jsx("td",{className:"py-3 text-sm text-green-500",children:"Low"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Hyper-niche, branded hashtags"})]})]})]})}),e.jsx(ct,{company:"NutriBlend Smoothies",industry:"Health & Wellness (DTC)",challenge:"Instagram account stuck at 8K followers, organic reach declining, hashtag strategy was random and inconsistent (using mega hashtags like #healthy, #fitness). Posts buried immediately in massive hashtag feeds.",s
151olution:"Implemented tiered hashtag strategy based on research: 30% low-competition (10K-50K posts), 50% mid-competition (50K-200K), 20% high-competition (200K-500K). Created branded hashtag #NutriBlendMorning. Analyzed top-performing posts in target hashtags and modeled content style. Used Instagram Insights to identify which hashtags drove actual engagement vs. just impressions.",results:["Increased average post reach from 2,400 to 18,700 (679% increase)","Engagement rate jumped from 2.1% to 7.8% by appearing in less saturated feeds","Grew from 8K to 47K followers in 6 months (organic only)","Branded hashtag #NutriBlendMorning reached 12K uses from community","3 posts hit Instagram Explore page, driving 120K+ views each","Direct sales attributed to Instagram increased from $3K/mo to $31K/mo"],quote:"We were competing with Nike and Gatorade in mega hashtags and getting crushed. Switching to low-competition, specific hashtags meant we actually showed up in feeds where people were looking for exactly what we offered.",author:"Maya Patel, Founder at NutriBlend"}),e.jsx("h2",{id:"research-discovery",children:"Research & Discovery"}),e.jsx("p",{children:"Effective hashtag strategy starts with research, not guessing. Use data to identify high-opportunity hashtags your competitors miss."}),e.jsx("h3",{children:"The 4-Step Hashtag Research Process"}),e.jsx("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:e.jsxs("ol",{className:"space-y-4",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Step 1: Seed List Generation (30 minutes)"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Start with obvious hashtags related to your niche, product, industry"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4 mt-2",children:[e.jsx("li",{children:"⢠Brainstorm 20-30 relevant hashtags"}),e.jsx("li",{children:"⢠Check hashtag volumes on each platform"}),e.jsx("li",{children:"⢠Note which are mega vs. mid vs. low competition"}),e.jsx("li",{children:"⢠Example seed list for coffee brand: #coffeeshop, #coffeeaddict, #coffeetime, #specialtycoffee, #coffeeculture"})]})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Step 2: Competitor Analysis (45 minutes)"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Study what hashtags your successful competitors use consistently"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4 mt-2",children:[e.jsx("li",{children:"⢠Identify 10-15 competitors in your space"}),e.jsx("li",{children:"⢠Analyze their last 20 posts, note hashtags used"}),e.jsx("li",{children:"⢠Track which hashtags appear on their best-performing posts"}),e.jsx("li",{children:"⢠Look for patterns: do they use branded hashtags? trending hashtags? niche-specific ones?"})]})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Step 3: Related Hashtag Expansion (30 minutes)"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Use platform tools and third-party tools to find related hashtags"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4 mt-2",children:[e.jsx("li",{children:'⢠Instagram: Search a hashtag, see "Related" section'}),e.jsx("li",{children:'⢠Twitter: Search hashtag, see "Related topics"'}),e.jsx("li",{children:"⢠Tools: Display Purposes, All Hashtag, RiteTag, Hashtagify"}),e.jsx("li",{children:"⢠Expand list to 100-150 potential hashtags"})]})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Step 4: Engagement Analysis & Filtering (60 minutes)"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Assess which hashtags have engaged, relevant communities (not just volume)"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4 mt-2",children:[e.jsx("li",{children:"⢠For each hashtag, check recent posts: Are they high quality? Relevant to your niche?"}),e.jsx("li",{children:"⢠Calculate engagement rate: (Likes + Comments) / Followers of poster"}),e.jsx("li",{children:"⢠Prioritize hashtags where average engagement rate is >3%"}),e.jsx("li",{children:"⢠Filter down to 50-75 high-opportunity hashtags for your master list"})]})]})]})}),e.jsx("h3",{children:"Red Flags: Hashtags to Avoid"}),e.jsxs("div",{className:"bg-accent/20 border-l-4 border-red-500 p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-2 text-red-500",children:"Warning Signs of Bad Hashtags:"}),e.jsxs("ul",{className:"space-y-1 ml-4",children:[e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Banned or shadowbanned hashtags:"})," Instagram and TikTok hide posts using flagged hashtags (check lists online)"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Spam-heavy hashtags:"})," Filled with low-quality, irrelevant posts (e.g., #followforfollow, #like4like)"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Dead hashtags:"})," No recent posts or very low engagement despite high volume"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Irrelevant mega hashtags:"})," Using #love or #instagood adds no value, just spam association"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Trademarked hashtags:"})," Using brand hashtags you don't own can cause legal issues"]})]})]}),e.jsx("h2",{id:"platform-strategies",children:"Platform-Specific Strategies"}),e.jsx("p",{children:"Each platform has different hashtag best practices. What works on Instagram fails on
151LinkedIn."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Platform-by-Platform Hashtag Guidelines"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"ð· Instagram"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Optimal Count:"})," 20-30 hashtags (use full limit)"]}),e.jsx("p",{className:"text-sm mb-2",children:e.jsx("strong",{children:"Best Practices:"})}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Mix of low (30%), mid (50%), high (20%) competition hashtags"}),e.jsx("li",{children:"⢠Place hashtags in first comment to keep caption clean"}),e.jsx("li",{children:"⢠Update hashtag sets monthly based on performance data"}),e.jsx("li",{children:"⢠Use niche-specific hashtags over generic ones"}),e.jsx("li",{children:"⢠Track which hashtags drive Explore page appearances"})]}),e.jsx("p",{className:"text-sm mt-2 italic",children:"Example set: #specialtycoffee #coffeeroaster #thirdwavecoffee #coffeeculture #manualbrewing #pourovercoffee..."})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"ð¦ Twitter (X)"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Optimal Count:"})," 1-2 hashtags per tweet"]}),e.jsx("p",{className:"text-sm mb-2",children:e.jsx("strong",{children:"Best Practices:"})}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Less is moreâtweets with 1-2 hashtags get 21% more engagement than 3+"}),e.jsx("li",{children:"⢠Use trending hashtags when relevant (check Trending sidebar)"}),e.jsx("li",{children:"⢠Integrate hashtags naturally into tweet copy, not as a list at the end"}),e.jsx("li",{children:"⢠Join Twitter chats using event-specific hashtags (#SaaSchat, #ContentChat)"}),e.jsx("li",{children:"⢠Create branded hashtags for campaigns and events"})]}),e.jsx("p",{className:"text-sm mt-2 italic",children:'Example: "Just launched our new feature that cuts onboarding time by 50% #SaaS #ProductLaunch"'})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"ð¼ LinkedIn"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Optimal Count:"})," 3-5 hashtags per post"]}),e.jsx("p",{className:"text-sm mb-2",children:e.jsx("strong",{children:"Best Practices:"})}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Focus on industry and topic hashtags, not trendy consumer ones"}),e.jsx("li",{children:"⢠Use LinkedIn's hashtag suggestions (they boost distribution)"}),e.jsx("li",{children:"⢠Follow hashtags relevant to your niche to stay updated"}),e.jsx("li",{children:"⢠Place hashtags at end of post, not mid-sentence"}),e.jsx("li",{children:"⢠Prioritize evergreen professional hashtags over fleeting trends"})]}),e.jsx("p",{className:"text-sm mt-2 italic",children:"Example: #B2BMarketing #SalesEnablement #LeadGeneration #MarketingAutomation"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"ðµ TikTok"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Optimal Count:"})," 4-8 hashtags per video"]}),e.jsx("p",{className:"text-sm mb-2",children:e.jsx("strong",{children:"Best Practices:"})}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Balance trending hashtags with niche-specific ones"}),e.jsx("li",{children:"⢠Use #FYP or #ForYouPage strategically (not on every post)"}),e.jsx("li",{children:"⢠Leverage challenge hashtags to join viral trends"}),e.jsx("li",{children:"⢠TikTok algorithm weights caption keywords over hashtags"}),e.jsx("li",{children:"⢠Test broad hashtags (#fitness) vs. specific (#homeworkout30days)"})]}),e.jsx("p",{className:"text-sm mt-2 italic",children:"Example: #coffeetok #baristalove #latteart #morningroutine #specialtycoffee"})]})]})]}),e.jsx("h2",{id:"optimization-testing",children:"Optimization & Testing"}),e.jsx("p",{children:"Hashtag performance degrades over time. Continuously test and optimize based on data."}),e.jsx("h3",{children:"A/B Testing Framework"}),e.jsxs("div",{className:"bg-accent/10 border border-accent/30 rounded-lg p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-4",children:"Monthly Hashtag Testing Protocol:"}),e.jsxs("ol",{className:"space-y-3 text-sm",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Week 1: Create 3 hashtag sets"})," (Set A, B, C) with different mixes of competition levels"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Week 2-4: Rotate sets"})," across similar content types, ensuring similar posting times"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Week 4: Analyze performance"}),e.jsxs("ul",{className:"ml-4 mt-2 space-y-1",children:[e.jsx("li",{children:"⢠Reach from hashtags (Instagram Insights shows this)"}),e.jsx("li",{children:"⢠Engagement rate per set"}),e.jsx("li",{children:"⢠Follower growth during each set rotation"}),e.jsx("li",{children:"⢠Profile visits from hashtag clicks"})]})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Action: Keep top performers, replace bottom 30%"})," with new experimental hashtags"]})]})]}),e.jsx("h2",{id:"advanced-tactics",children:"Advanced Hashtag Tactics"}),e.jsx("h3",{children:"1. Branded Hashtag Campaigns"}),e.jsx("p",{children:"Create unique branded hashtags that build community and encourage user-generated content."}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Campaign hashtags:"})," Specific to promotions (#NutriBlendChallenge, #30DayTransformation)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Community hashtags:"})," Evergreen tags customers use (#NutriBlendMorning, #NutriBlendFamily)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Incentivize usage:"})," Feature customer posts, run contests, offer rewards for best use of branded hashtag"]})]}),e.jsx("h3",{children:"2. Trending Hijacking (When Appropriate)"}),e.jsx("p",{children:"Jump on trending hashtags with relevant contentâbut only if it's authentic and adds value."}),e.jsxs("div",{className:"bg-accent/20 border-l-4 border-amber-500 p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-2 text-amber-500",children:"Rules for Trending Hashtag Use:"}),e.jsxs("ul",{className:"space-y-1 ml-4 text-sm",children:[e.jsx("li",{children:"â Your content must genuinely relate to the trend (not forced)"}),e.jsx("li",{children:"â Add unique value or perspective to the conversation"}),e.jsx("li",{children:"â Be sensitive to context (never hijack tragedy or crisis hashtags for marketing)"}),e.jsx("li",{children:"â Don't spam trending hashtags with unrelated contentâit damages reputation"})]})]}),e.jsx("h3",{children:"3. Hashtag Analytics & Performance Tracking"}),e.jsx("p",{children:"Track which hashtags drive the most valuable outcomes, not just vanity metrics."}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Instagram Insights:"})," See how many accounts you reached from hashtags per post"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Track follower quality:"})," Are hashtag-driven followers engaged or ghost accounts?"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"UTM tracking:"})," Add UTM parameters to bio links, see which hashtags drive site traffic"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Engagement by hashtag:"})," Which hashtags correlate with highest engagement rates?"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Profile visits:"})," Which hashtags drive the most profile clicks?"]})]}),e.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 rounded-lg p-8 my-12 text-center",children:[e.jsx("h3",{className:"text-2xl font-display font-bold mb-4",children:"Optimize Hashtag Performance"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"DESHILLER analyzes hashtag performance across your content and recommends high-opportunity hashtags based on engagement data."}),e.jsx(h,{size:"lg",onClick:()=>s("/auth"),children:"Optimize Hashtags Free"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},wy=()=>
151{const s=ns(),t=[{id:"video-landscape",text:"The Video Content Landscape",level:2},{id:"content-formats",text:"Video Formats That Convert",level:2},{id:"production-workflow",text:"Production Workflow",level:2},{id:"optimization-distribution",text:"Optimization & Distribution",level:2},{id:"measuring-success",text:"Measuring Video Success",level:2}],a=[{title:"Content Marketing Automation",description:"Automate video content distribution, repurposing, and cross-platform publishing for maximum efficiency.",category:"Automation",readTime:"18 min read",path:"/academy/content-marketing-automation"},{title:"Algorithm Optimization",description:"Understand platform algorithms that prioritize video content and optimize for maximum organic reach.",category:"Growth",readTime:"15 min read",path:"/academy/algorithm-optimization"},{title:"UGC Content Strategy",description:"Leverage user-generated video content from customers and community to build authenticity at scale.",category:"Content",readTime:"13 min read",path:"/academy/ugc-content-strategy"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Video Content Strategy: Production, Optimization & Distribution | DESHILLER Academy"}),e.jsx("meta",{name:"description",content:"Master video content strategy with production workflows, platform optimization tactics, and distribution frameworks that drive engagement and conversions."})]}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("nav",{className:"border-b border-border/40 bg-card/30 backdrop-blur-sm sticky top-0 z-50",children:e.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back to Academy"]}),e.jsx("span",{className:"text-2xl font-display font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"DESHILLER"})]})}),e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("main",{className:"max-w-4xl",children:[e.jsx(it,{category:"Video Marketing",title:"Video Content Strategy: Production, Optimization & Distribution",description:"Build scalable video content systems that drive engagement, conversions, and brand growth across short-form, long-form, and live video formats.",author:{name:"Tyler Brooks",avatar:"TB",role:"Video Content Strategist",bio:"Built video-first content engines for DTC brands generating 100M+ views, specializing in organic TikTok and YouTube growth."},publishDate:"2025-01-24",lastUpdated:"2025-02-04",readTime:"19 min read",featuredImage:"https://images.unsplash.com/photo-1492691527719-9d1e07e534b4?w=1200&h=600&fit=crop",stats:{views:"41.7K",shares:"1.5K"}}),e.jsxs("article",{className:"prose prose-lg max-w-none mt-12",children:[e.jsx("h2",{id:"video-landscape",children:"The Video Content Landscape"}),e.jsx("p",{className:"lead text-xl text-muted-foreground",children:"Video isn't just another content formatâit's the dominant format. Platforms algorithmically favor video, audiences prefer video, and conversion rates prove video works. If you're not prioritizing video, you're losing."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsx(Ze,{icon:Bt,stat:"88%",description:"of marketers say video content has directly increased sales, with video posts generating 1200% more shares than text + image combined",source:"Wyzowl Video Marketing Survey 2024"}),e.jsx(Ze,{icon:gs,stat:"10x",description:"more engagement on video posts compared to static image posts across major platforms (Instagram, LinkedIn, Facebook)",source:"HubSpot Social Media Trends"})]}),e.jsx("h3",{children:"Why Video Dominates in 2025"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Algorithm preference:"})," Every major platform prioritizes video in feeds (Instagram Reels, TikTok, YouTube Shorts, LinkedIn video)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Attention retention:"})," Video captures and holds attention 5x longer than static content"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Information density:"})," Convey complex ideas fasterâviewers retain 95% of video message vs. 10% reading text"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Emotional connection:"})," Face-to-camera builds trust and authenticity that images can't match"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Mobile consumption:"})," 75% of all video plays happen on mobile, where video UX is superior"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Lower production barriers:"})," Smartphone cameras rival professional equipment, editing apps are free/cheap"]})]}),e.jsx(ct,{company:"ProFit Apparel",industry:"DTC Fitness Apparel",challenge:"Static product photography performing poorly on Instagram and TikTok. Engagement rates below 1%, struggling to compete with established brands. Customer acquisition costs rising, organic reach declining. Small team (3 people) couldn't afford professional video production.",solution:"Shifted to video-first content strategy using iPhones and free editing apps. Posted 3-5 Reels/TikToks daily showing products in use, customer testimonials, behind-the-scenes production, and founder storytelling. Established simple production workflow: batch filming on Mondays (4 hours), editing throughout week (30 min/day), posting at optimal times. No professional videographersâall in-house.",results:["TikTok account grew from 2.1K to 187K followers in 6 months (all organic)","Average video views: 45K per video (vs. 800 views on static posts previously)","Engagement rate jumped from 0.8% to 8.3% with video content","Generated $340K in revenue directly attributed to TikTok traffic (tracked via unique discount codes)","Reduced CAC from $62 to $18 through organic video discovery","3 videos went viral (1M+ views each), driving surge orders and waitlists","Influencers organically started featuring products after discovering via TikTok"],quote:"We thought we needed a production crew and expensive equipment. Turns out, our iPhone and authentic behind-the-scenes content outperformed any polished ad we'd ever run. Video didn't just grow our audienceâit transformed our business.",author:"Jake Morrison, Founder at ProFit Apparel"}),e.jsx("h2",{id:"content-formats",children:"Video Formats That Convert"}),e.jsx("p",{children:"Different video formats serve different purposes. Build a content mix that covers awareness, consideration, and conversion."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Video Format Matrix"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"ð± Short-Form Video (15-90 seconds)"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Platforms:"})," TikTok, Instagram Reels, YouTube Shorts, LinkedIn video"]}),e.jsxs("p",{className:"text-sm mb-2",children:[e.jsx("strong",{children:"Best For:"})," Virality, discovery, top-of-funnel awareness"]}),e.jsx("p",{className:"text-sm mb-3",children:e.jsx("strong",{children:"Content Ideas:"})}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Quick tips and how-to's (solve one problem in 60 seconds)"}),e.jsx("li",{children:"⢠Behind-the-scenes glimpses (humanize your brand)"}),e.jsx("li",{children:"⢠Product demos and use-cases (show, don't tell)"}),e.jsx("li",{children:"⢠Trend participation (trending audio, challenges, formats)"}),e.jsx("li",{children:"⢠Customer testimonials (15-30 second soundbites)"}),e.jsx("li",{children:"⢠Educational snippets (one insight per video)"})]}),e.jsx("p",{className:"text-sm mt-2 italic",children:"Production Tip: Hook in first 1-2 seconds or viewers scroll past. Fast cut
151s, captions, trending audio."})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"ð¬ Mid-Form Video (2-5 minutes)"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Platforms:"})," YouTube, Instagram (IGTV/Feed), Facebook, LinkedIn"]}),e.jsxs("p",{className:"text-sm mb-2",children:[e.jsx("strong",{children:"Best For:"})," Consideration stage, building authority, education"]}),e.jsx("p",{className:"text-sm mb-3",children:e.jsx("strong",{children:"Content Ideas:"})}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Product comparisons and reviews"}),e.jsx("li",{children:"⢠Tutorial walkthroughs (step-by-step processes)"}),e.jsx("li",{children:"⢠Industry commentary and trend analysis"}),e.jsx("li",{children:"⢠Case study deep-dives"}),e.jsx("li",{children:"⢠FAQ videos answering common questions"}),e.jsx("li",{children:"⢠Founder/executive thought leadership"})]}),e.jsx("p",{className:"text-sm mt-2 italic",children:"Production Tip: Structure with clear intro (what you'll cover), body (deliver value), outro (CTA). Use B-roll and graphics."})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"ðº Long-Form Video (10+ minutes)"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Platforms:"})," YouTube, website, webinars"]}),e.jsxs("p",{className:"text-sm mb-2",children:[e.jsx("strong",{children:"Best For:"})," Deep education, conversions, community building"]}),e.jsx("p",{className:"text-sm mb-3",children:e.jsx("strong",{children:"Content Ideas:"})}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Comprehensive guides and courses"}),e.jsx("li",{children:"⢠Webinars and presentations"}),e.jsx("li",{children:"⢠Podcast-style interviews and discussions"}),e.jsx("li",{children:"⢠Product demos and onboarding"}),e.jsx("li",{children:"⢠Documentary-style brand stories"})]}),e.jsx("p",{className:"text-sm mt-2 italic",children:"Production Tip: Chapters, timestamps, and retention hooks every 2-3 minutes. Optimize for YouTube SEO (titles, descriptions, tags)."})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"ð´ Live Video"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Platforms:"})," Instagram Live, TikTok Live, YouTube Live, LinkedIn Live, Facebook Live"]}),e.jsxs("p",{className:"text-sm mb-2",children:[e.jsx("strong",{children:"Best For:"})," Community engagement, real-time interaction, authenticity"]}),e.jsx("p",{className:"text-sm mb-3",children:e.jsx("strong",{children:"Content Ideas:"})}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Q&A sessions with founders/experts"}),e.jsx("li",{children:"⢠Product launches and announcements"}),e.jsx("li",{children:"⢠Behind-the-scenes tours"}),e.jsx("li",{children:"⢠Live workshops and training"}),e.jsx("li",{children:"⢠Customer success stories and interviews"})]}),e.jsx("p",{className:"text-sm mt-2 italic",children:"Production Tip: Promote 24-48 hours in advance. Have talking points but allow authentic spontaneity. Engage with comments live."})]})]})]}),e.jsx("h2",{id:"production-workflow",children:"Production Workflow"}),e.jsx("p",{children:"Consistent video output requires systems, not inspiration. Build production workflows that scale without burning out your team."}),e.jsx("h3",{children:"The Batch Production Model"}),e.jsx("p",{children:"Film multiple videos in single sessions rather than producing one video at a time. Dramatically improves efficiency."}),e.jsxs("div",{className:"bg-accent/10 border border-accent/30 rounded-lg p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-4",children:"Weekly Batch Production Schedule (4-hour filming session):"}),e.jsxs("ol",{className:"space-y-3 text-sm",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Monday Morning (30 min): Content Planning"}),e.jsxs("ul",{className:"ml-4 mt-1 space-y-1",children:[e.jsx("li",{children:"⢠Review content calendar for week ahead"}),e.jsx("li",{children:"⢠Finalize topics, hooks, and scripts for 15-20 short-form videos"}),e.jsx("li",{children:"⢠Prepare props, outfit changes, locations"})]})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Monday Afternoon (3.5 hours): Batch Filming"}),e.jsxs("ul",{className:"ml-4 mt-1 space-y-1",children:[e.jsx("li",{children:"⢠Set up lighting, camera, audio once"}),e.jsx("li",{children:"⢠Film all videos back-to-back (average 10 min per video including retakes)"}),e.jsx("li",{children:"⢠Capture 15-20 videos in single session"}),e.jsx("li",{children:"⢠Quick outfit/backdrop changes between videos for variety"})]})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Tuesday-Friday (30 min/day): Editing & Posting"}),e.jsxs("ul",{className:"ml-4 mt-1 space-y-1",children:[e.jsx("li",{children:"⢠Edit 3-4 videos per day (template-based editing speeds this up)"}),e.jsx("li",{children:"⢠Add captions, music, effects"}),e.jsx("li",{children:"⢠Schedule posts for optimal times"}),e.jsx("li",{children:"⢠Repurpose: one video becomes TikTok + Reel + Short + LinkedIn post"})]})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-4 italic",children:"Result: 4 hours of production = 15-20 videos = 60-80 pieces of content (across platforms) = entire month of video content."})]}),e.jsx("h3",{children:"Minimum Viable Equipment"}),e.jsx("p",{children:"You don't need expensive gear. Start with smartphone and free tools, upgrade only when it becomes the bottleneck."}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-6",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Equipment Tiers"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Tier 1: Beginner Setup ($50-$200)"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Smartphone with good camera (iPhone 12+, Samsung S21+, Pixel 6+)"}),e.jsx("li",{children:"⢠Phone tripod with remote ($15-$30)"}),e.jsx("li",{children:"⢠Natural window lighting (free) or ring light ($30-$60)"}),e.jsx("li",{children:"⢠Wired earbuds as mic for voiceover (you already have these)"}),e.jsx("li",{children:"⢠Free editing: CapCut, iMovie, DaVinci Resolve"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Good enough for: TikTok, Instagram Reels, short-form content that prioritizes authenticity"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Tier 2: Intermediate Setup ($500-$1,500)"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Mirrorless camera (Sony ZV-E10, Canon M50) or upgrade to iPhone Pro"}
151),e.jsx("li",{children:"⢠External microphone (Rode VideoMic, lav mic)"}),e.jsx("li",{children:"⢠Softbox lighting kit (2-3 lights)"}),e.jsx("li",{children:"⢠Backdrop or green screen"}),e.jsx("li",{children:"⢠Adobe Premiere Pro or Final Cut Pro"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Good enough for: Professional looking mid-form content, YouTube, client-facing materials"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Tier 3: Professional Setup ($3K-$10K+)"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Cinema camera (Blackmagic, RED, Sony FX series)"}),e.jsx("li",{children:"⢠Professional audio setup (XLR mics, recorder, sound treatment)"}),e.jsx("li",{children:"⢠Advanced lighting (key, fill, back, LED panels)"}),e.jsx("li",{children:"⢠Editing workstation and monitors"}),e.jsx("li",{children:"⢠Motion graphics and color grading tools"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Needed for: Agency-level production, commercials, high-budget brand content"})]})]}),e.jsx("p",{className:"text-sm font-semibold mt-4 text-primary",children:"Reality Check: 90% of successful social video is shot on Tier 1 or 2 equipment. Authenticity > Production Value."})]}),e.jsx("h2",{id:"optimization-distribution",children:"Optimization & Distribution"}),e.jsx("p",{children:"Great video means nothing if the algorithm doesn't distribute it. Optimize for each platform's unique preferences."}),e.jsx("h3",{children:"Platform-Specific Optimization"}),e.jsx("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"TikTok Optimization"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Hook in first 1-2 seconds (question, shocking statement, visual intrigue)"}),e.jsx("li",{children:"⢠Use trending sounds (increases distribution 3-5x)"}),e.jsx("li",{children:"⢠Always add captions (85% watch without sound)"}),e.jsx("li",{children:"⢠Optimal length: 15-45 seconds for viral
151ity, up to 3 min for storytelling"}),e.jsx("li",{children:"⢠Post 1-3x daily for algorithm favor"}),e.jsx("li",{children:"⢠Hashtag mix: 3-5 tags (trending + niche + branded)"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Instagram Reels Optimization"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Vertical 9:16 format (full screen, no borders)"}),e.jsx("li",{children:"⢠Use Instagram's native editing tools and effects (algorithm boost)"}),e.jsx("li",{children:"⢠Include trending audio (check Reels audio section)"}),e.jsx("li",{children:"⢠Optimal length: 7-30 seconds for max reach"}),e.jsx("li",{children:"⢠Post Reels to feed (not stories) for longevity"}),e.jsx("li",{children:"⢠Strong CTA in caption to drive profile visits"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"YouTube Optimization"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Thumbnail + title combo is everything (45% of success)"}),e.jsx("li",{children:"⢠Front-load value in first 30 seconds (hook + payoff preview)"}),e.jsx("li",{children:"⢠Optimize title with searchable keywords (not clickbait lies)"}),e.jsx("li",{children:"⢠Detailed description with timestamps and links"}),e.jsx("li",{children:"⢠Use cards and end screens to promote other videos"}),e.jsx("li",{children:"⢠Encourage comments, likes, subscribes (engagement signals)"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"LinkedIn Video Optimization"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Native upload (don't link to YouTubeâalgorithm penalty)"}),e.jsx("li",{children:"⢠Professional but authentic tone (not overly corporate)"}),e.jsx("li",{children:"⢠Add captions/subtitles (most watch on silent)"}),e.jsx("li",{children:"⢠Optimal length: 30 seconds - 2 minutes"}),e.jsx("li",{children:"⢠Include text hook above video in post caption"}),e.jsx("li",{children:"⢠Tag relevant people/companies for extra reach"})]})]})]})}),e.jsx("h3",{children:"Repurposing Framework: One Video â 10 Pieces of Content"}),e.jsxs("div",{className:"bg-accent/20 border-l-4 border-primary p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-3",children:"Start with one 10-minute video â Create:"}),e.jsxs("ol",{className:"space-y-1 ml-4 text-sm",children:[e.jsx("li",{children:"1. Full video on YouTube"}),e.jsx("li",{children:"2-4. Three 60-second clips as Instagram Reels"}),e.jsx("li",{children:"5-7. Same three clips on TikTok (slight edit differences)"}),e.jsx("li",{children:"8. LinkedIn video post (1-2 min best segment)"}),e.jsx("li",{children:"9. YouTube Short (vertical edit of best moment)"}),e.jsx("li",{children:"10. Audiogram for Twitter/LinkedIn (quote + waveform visual)"}),e.jsx("li",{children:"11. Blog post transcript with embedded video"}),e.jsx("li",{children:"12. Email newsletter featuring video + key takeaways"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-3 italic",children:"Tools: Repurpose.io, Opus Clip, Descript for automated clipping and distribution"})]}),e.jsx("h2",{id:"measuring-success",children:"Measuring Video Success"}),e.jsx("p",{children:"Track metrics that matter for your business goals, not just vanity numbers."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Video Performance KPIs"}),e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Metric"}),e.jsx("th",{className:"text-left py-2",children:"What It Measures"}),e.jsx("th",{className:"text-left py-2",children:"Good Benchmark"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"View Rate"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"How many impressions turn into plays"}),e.jsx("td",{className:"py-3 text-sm",children:">20% (Instagram), >10% (YouTube)"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Completion Rate"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"% who watch entire video"}),e.jsx("td",{className:"py-3 text-sm",children:">50% short-form, >40% mid-form"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Engagement Rate"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"(Likes + Comments + Shares) / Views"}),e.jsx("td",{className:"py-3 text-sm",children:">5% (TikTok), >3% (Instagram)"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Click-Through Rate"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Profile/link clicks per view"}),e.jsx("td",{className:"py-3 text-sm",children:">2% (conversion-focused video)"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"Share Rate"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"How often video is shared"}),e.jsx("td",{className:"py-3 text-sm",children:">2% (indicates virality potential)"})]})]})]})]}),e.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 rounded-lg p-8 my-12 text-center",children:[e.jsx("h3",{className:"text-2xl font-display font-bold mb-4",children:"Automate Video Distribution"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"DESHILLER helps you repurpose and distribute video content across platforms, track performance, and optimize based on engagement data."}),e.jsx(h,{size:"lg",onClick:()=>s("/auth"),children:"Scale Video Content Free"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},ky=()=>{const s=ns(),t=[{id:"why-community",text:"Why Community Beats Audience",level:2},{id:"foundation-elements",text:"Community Foundation Elements",level:2},{id:"engagement-tactics",text:"Daily Engagement Tactics",level:2},{id:"scaling-community",text:"Scaling Your Community",level:2},{id:"measuring-health",text:"Measuring Community Health",level:2}],a=[{title:"Employee Advocacy Programs",description:"Turn your team into community champions who authentically engage and build relationships with your audience.",category:"Employee",readTime:"17 min read",path:"/academy/employee-advocacy-programs"},{title:"UGC Content Strategy",description:"Leverage community-generated content to build social proof, authenticity, and engagement at scale.",category:"Content",readTime:"13 min read",path:"/academy/ugc-content-strategy"},{title:"Customer Service on Social Media",description:"Transform social customer service into community building opportunities that strengthen relationships.",category:"Service",readTime:"15 min read",path:"/academy/customer-service-social-media"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Community Building Tactics: Transform Followers Into Advocates | DESHILLER Academy"}),e.jsx("meta",{name:"description",content:"Master community building with engagement tactics, moderation frameworks, and growth strategies that turn passive followers into active brand advocates."})]}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("nav",{className:"border-b border-border/40 bg-card/30 backdrop-blur-sm sticky top-0 z-50",children:e.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back to Academy"]}),e.jsx("span",{className:"text-2xl font-display font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"DESHILLER"})]})}),e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("main",{className:"max-w-4xl",children:[e.jsx(it,{category:"Community Building",title:"Community Building Tactics: Transform Followers Into Advocates",description:"Build engaged communities that drive word-of-mouth growth, customer retention, and authentic brand advocacy through strategic engagement and relationship building.",author:{name:"Emma Rodriguez",avatar:"ER",role:"Community Building Strategist",bio:"Built online communities from 0 to 100K+ engaged members for SaaS startups, focusing on retention and peer-to-peer value creation."},publishDate:"2025-01-26",lastUpdated:"2025-02-05",readTime:"18 min read",featuredImage:"https://images.unsplash.com/photo-1529156069898-49953e39b3ac?w=1200&h=600&fit=crop",stats:{views:"27.3K",shares:"892"}}),e.jsxs("article",{className:"prose prose-lg max-w-none mt-12",children:[e.jsx("h2",{id:"why-community",children:"Why Community Beats Audience"}),e.jsx("p",{className:"lead text-xl text-muted-foreground",children:"An audience consumes your content passively. A community engages with each other, creates content, advocates for your brand, and stays loyal through competition and market changes. Community is your competitive moat."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsx(Ze,{icon:Pa,stat:"4.2x",description:"higher customer lifetime value for community members vs. non-members, with 37% lower churn rates",source:"CMX Community Industry Report 2024"}),e.jsx(Ze,{icon:Es,stat:"92%",description:"of consumers trust recommendations from community members over branded content or advertising",source:"Nielsen Community Trust Study"})]}),e.jsx("h3",{children:"Audience vs. Community: The Critical Difference"}),e.jsx("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Characteristic"}),e.jsx("th",{className:"text-left py-2",children:"Audience"}),e.jsx("th",{className:"text-left py-2",children:"Community"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Relationship"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Brand â Followers (one-way)"}),e.jsx("td",{className:"py-3 text-sm text-primary",children:"Members â Members (many-to-many)"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Content Source"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Brand creates everything"}),e.jsx("td",{className:"py-3 text-sm text-primary",children:"Members create most content"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Value Exchange"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Brand broadcasts, followers consume"}),e.jsx("td",{className:"py-3 text-sm text-primary",children:"Members help each other, brand facilitates"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Loyalty"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Switches easily to competitors"}),e.jsx("td",{className:"py-3 text-sm text-primary",children:"Emotionally invested, advocates actively"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"Moderation Need"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Minimal (delete spam/trolls)"}),e.jsx("td",{className:"py-3 text-sm text-primary",children:"Active (nurture culture, resolve conflicts)"})]})]})]})}),e.jsx(ct,{company:"CodeCraft Learning",industry:"Online Education (Developer Training)",challenge:"High course completion rates (78%) but low customer retentionâonly 12% took second course. Students felt isolated learning alone. Customer acquisition cost ($240) made one-time customers unprofitable. Needed to increase LTV and create stickiness.",solution:"Shifted from content-only platform to community-first experience. Launched Discord community (5,000+ members now), implemented peer study groups, weekly live code-alongs with instructors, student showcase channels, and mentorship matching. Made community access the core product benef
151it, not just course material.",results:["Course completion rate jumped from 78% to 94% with peer accountability","Customer retention increased from 12% to 67% for second course purchase","Average LTV grew from $120 to $780 (students taking 4-5 courses vs. 1)","30% of customer acquisition now from community referrals (word-of-mouth)","Students created 2,400+ project showcases, becoming portfolio + marketing content","NPS score increased from 42 to 76 based on community experience","Community members contribute 40% of technical support (peer-to-peer help)"],quote:"The product isn't the courses anymoreâit's the community. Students stay because they've built friendships, accountability partners, and professional networks. The learning content is just the reason they came. Community is why they stay and bring their friends.",author:"Alex Chen, Founder at CodeCraft Learning"}),e.jsx("h2",{id:"foundation-elements",children:"Community Foundation Elements"}),e.jsx("p",{children:"Successful communities aren't accidents. They're built on intentional foundations: shared identity, clear values, and structured rituals."}),e.jsx("h3",{children:'1. Shared Identity: Who Are "We"?'}),e.jsx("p",{children:"Define who your community is FOR and what unites members beyond using your product."}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Common goal:"}),' What transformation or outcome do members seek? (e.g., "Become senior developers," "Build sustainable businesses," "Live healthier lives")']}),e.jsxs("li",{children:[e.jsx("strong",{children:"Shared values:"})," What principles unite the community? (e.g., transparency, continuous learning, helping others succeed)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Inside language:"})," Unique terminology, phrases, or jokes that signal belonging"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Origin story:"})," The founding narrative that explains why this community exists"]})]}),e.jsx("h3",{children:"2. Community Values & Guidelines"}),e.jsx("p",{children:"Written values shape culture and guide behavior. Make them visible and reinforce constantly."}),e.jsxs("div",{className:"bg-accent/20 border-l-4 border-primary p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-2",children:"Example Community Values Framework:"}),e.jsxs("ul",{className:"space-y-2 ml-4",children:[e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Be helpful, not judgmental:"})," No question is stupid. We all started somewhere."]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Share generously:"})," Knowledge grows when shared. Pay it forward."]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Celebrate wins together:"})," Support others' successesâthere's room for everyone."]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Fail in public:"})," Share lessons from failures to help others avoid same mistakes."]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"No self-promotion without value:"})," Share your work if it helps the community, not just to sell."]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Respect diversity:"})," Different perspectives make us stronger. Listen first."]})]})]}),e.jsx("h3",{children:"3. Rituals & Traditions"}),e.jsx("p",{children:"Regular events and traditions create rhythm, anticipation, and belonging."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Community Ritual Ideas"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-1",children:"Weekly/Monthly Rituals:"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Win Wednesday:"})," Members share wins (big or small) every Wednesday"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"AMA Friday:"})," Weekly Q&A with team, customers, or industry experts"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Sunday Study Hall:"})," Collective focus sessions (e.g., Pomodoro together)"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Monthly challenges:"})," Themed goals with prizes and showcases"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-1",children:"Milestone Rituals:"}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsx("li",{children:"⢠Welcome messages for new members (with intro template)"}),e.jsx("li",{children:"⢠Anniversary celebrations (1 year in community badge/shoutout)"}),e.jsx("li",{children:"⢠Level-up recognition (badges for contributions, milestones achieved)"}),e.jsx("li",{children:"⢠Graduation ceremonies (completed programs, achieved goals)"})]})]})]})]}),e.jsx("h2",{id:"engagement-tactics",children:"Daily Engagement Tactics"}),e.jsx("p",{children:"Community health requires daily nurturing. These tactics keep conversation flowing and members engaged."}),e.jsx("h3",{children:'The "Always Be Conversing" Framework'}),e.jsx("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-8",children:e.jsxs("ol",{className:"space-y-3",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Morning Spark (8-10 AM):"})," Post conversation starter",e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:`Example: "What's your biggest challenge this week?" or "What's one thing you learned yesterday?"`})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Midday Boost (12-2 PM):"})," Share valuable content + ask for opinions",e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:`Example: Share article/tool + "Have you tried this? What's your experience?"`})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Afternoon Engagement (3-5 PM):"})," Respond to every comment",e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Reply thoughtfully to comments from morning/midday posts. Ask follow-up questions to deepen conversation."})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Evening Wrap (6-8 PM):"}
151)," Celebrate community contributions",e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'Example: "Shoutout to @member for the incredible advice on X thread today. This is what community is about!"'})]})]})}),e.jsx("h3",{children:"Engagement Prompts That Work"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Ask for help/advice:"}),` "We're deciding between X and Y. What would you choose and why?"`]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Controversial takes:"}),' "Unpopular opinion: [statement]. Change my mind."']}),e.jsxs("li",{children:[e.jsx("strong",{children:"Behind-the-scenes:"}),` "Here's what we're working on. What would you add?"`]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Lessons learned:"}),` "Biggest mistake I made this month: [story]. What's yours?"`]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Resource requests:"}),' "Drop your favorite [tools/resources/tips] below!"']}),e.jsxs("li",{children:[e.jsx("strong",{children:"Hot takes:"}),' "Fill in the blank: The most overrated [trend/tool/advice] is ___"']}),e.jsxs("li",{children:[e.jsx("strong",{children:"Celebrations:"}),' "We hit [milestone]! Thank you for being part of this journey. Share yours!"']})]}),e.jsx("h3",{children:"The 90-9-1 Rule & How to Activate Lurkers"}),e.jsx("p",{children:"In most communities: 90% lurk, 9% engage occasionally, 1% create most content. Your job is to move lurkers to contributors."}),e.jsxs("div",{className:"bg-accent/10 border border-accent/30 rounded-lg p-6 my-6",children:[e.jsx("p",{className:"font-semibold mb-3",children:"Lurker Activation Tactics:"}),e.jsxs("ul",{className:"space-y-2 ml-4 text-sm",children:[e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Lower barrier to first contribution:"})," Use reactions/emojis before requiring comments"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Direct invitations:"})," DM lurkers personally inviting input on specific topics they care about"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Recognition for small acts:"})," Thank people publicly for even small contributions (likes, shares)"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Fill-in-the-blank posts:"})," Easy one-word answers get lurkers commenting"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Polls and surveys:"})," Simple clicks count as participation"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Showcase lurker expertise:"}),' "I noticed you work in [field], would love your take on..."']})]})]}),e.jsx("h2",{id:"scaling-community",children:"Scaling Your Community"}),e.jsx("p",{children:"As communities grow, personal touch becomes impossible. Scale through delegation, automation, and tiered engagement."}),e.jsx("h3",{children:"Community Leadership Ladder"}),e.jsx("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Level 1: Community Members (Everyone)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Role: Participate, ask questions, share experiences"}),e.jsx("p",{className:"text-sm",children:"Support needed: Moderation, content, engagement from you/team"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Level 2: Active Contributors (Top 10%)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Role: Answer questions, start discussions, create content regularly"}),e.jsx("p",{className:"text-sm",children:"Recognition: Badges, shoutouts, early access to features, exclusive content"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Level 3: Power Users (Top 3%)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Role: Mentor newcomers, lead initiatives, represent community values"}),e.jsx("p",{className:"text-sm",children:"Benefits: Direct line to team, input on roadmap, ambassador status, exclusive swag"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"Level 4: Community Moderators (Invited)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Role: Enforce guidelines, resolve conflicts, shape community culture"}),e.jsx("p",{className:"text-sm",children:"Compensation: Paid role, equity, free product, or significant perks depending on time commitment"})]})]})}),e.jsx("h3",{children:"When to Introduce Paid Community Tiers"}),e.jsx("p",{children:"Once free community has 1,000+ engaged members, consider premium tier for deeper access and exclusivity."}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Free tier:"})," Public content, basic access, large group discussions"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Paid tier ($10-$50/mo):"}
151)," Private channels, office hours with team/experts, advanced resources, smaller group coaching"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"VIP tier ($100-$500/mo):"})," 1-on-1 access, exclusive events, strategy sessions, early access to everything"]})]}),e.jsx("h2",{id:"measuring-health",children:"Measuring Community Health"}),e.jsx("p",{children:"Track engagement quality, not just size. A small, highly engaged community beats a large, inactive one."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Community Health Metrics"}),e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Metric"}),e.jsx("th",{className:"text-left py-2",children:"What It Measures"}),e.jsx("th",{className:"text-left py-2",children:"Healthy Target"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Daily Active Users"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"% of members active each day"}),e.jsx("td",{className:"py-3 text-sm",children:">15% DAU/MAU ratio"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Response Rate"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"% of questions that get answered"}),e.jsx("td",{className:"py-3 text-sm",children:">80% within 24 hours"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Member-to-Member"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"% of replies from members vs. staff"}),e.jsx("td",{className:"py-3 text-sm",children:">70% member replies"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Retention Rate"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"% of members still active after 90 days"}),e.jsx("td",{className:"py-3 text-sm",children:">40% at 90 days"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"NPS"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Net Promoter Score for community"}),e.jsx("td",{className:"py-3 text-sm",children:">50 (promoters - detractors)"})]})]})]})]}),e.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 rounded-lg p-8 my-12 text-center",children:[e.jsx("h3",{className:"text-2xl font-display font-bold mb-4",children:"Build Engaged Communities"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"DESHILLER helps you identify active community members, track engagement patterns, and automate relationship-building at scale."}),e.jsx(h,{size:"lg",onClick:()=>s("/auth"),children:"Start Building Free"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},Sy=()=>{const s=ns(),t=[{id:"social-commerce-rise",text:"The Rise of Social Commerce",level:2},{id:"platform-strategies",text:"Platform-Specific Strategies",level:2},{id:"content-that-sells",text:"Content That Sells",level:2},{id:"conversion-optimization",text:"Conversion Optimization",level:2},{id:"measuring-roi",text:"Measuring Social Commerce ROI",level:2}],a=[{title:"Paid Social Advertising",description:"Amplify social commerce success with targeted paid campaigns that drive product discovery and conversions.",category:"Advertising",readTime:"19 min read",path:"/academy/paid-social-advertising"},{title:"Influencer Outreach Tactics",description:"Partner with influencers to showcase products authentically and drive social commerce sales through trusted recommendations.",category:"Influencer",readTime:"16 min read",path:"/academy/influencer-outreach-tactics"},{title:"Video Content Strategy",description:"Create shoppable video content that demonstrates products in use and drives immediate purchase decisions.",category:"Video",readTime:"19 min read",path:"/academy/video-content-strategy"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Social Commerce Strategies: Turn Social Into Sales Channel | DESHILLER Academy"}),e.jsx("meta",{name:"description",content:"Master social commerce with platform-specific strategies, shoppable content tactics, and conversion optimization frameworks that turn social media into a revenue engine."})]}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("nav",{className:"border-b border-border/40 bg-card/30 backdrop-blur-sm sticky top-0 z-50",children:e.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back to Academy"]}),e.jsx("span",{className:"text-2xl font-display font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"DESHILLER"})]})}),e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("main",{className:"max-w-4xl",children:[e.jsx(it,{category:"E-Commerce",title:"Social Commerce Strategies: Turn Social Into Sales Channel",description:"Transform social platforms into direct sales channels with shoppable content, seamless checkout experiences, and conversion-optimized strategies that drive revenue.",author:{name:"Nina Patel",avatar:"NP",role:"Social Commerce Strategist",bio:"Scaled DTC brand from $0 to $12M ARR through Instagram and TikTok Shop, specializing in shoppable content and in-app purchasing."},publishDate:"2025-01-28",lastUpdated:"2025-02-06",readTime:"18 min read",featuredImage:"https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?w=1200&h=600&fit=crop",stats:{views:"35.8K",shares:"1.4K"}}),e.jsxs("article",{className:"prose prose-lg max-w-none mt-12",children:[e.jsx("h2",{id:"social-commerce-rise",children:"The Rise of Social Commerce"}),e.jsx("p",{className:"lead text-xl text-muted-foreground",children:"Social media isn't just for discovery anymoreâit's the entire shopping journey. Product discovery, research, purchase, and post-purchase all happen within social apps. Brands that master native social commerce win the future of retail."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsx(Ze,{icon:mu,stat:"$992B",description:"Global social commerce sales in 2024, projected to reach $2.9 trillion by 2028 with 30%+ annual growth",source:"Accenture Social Commerce Report"}),e.jsx(Ze,{icon:xu,stat:"68%",description:"of Gen Z and Millennials have made purchases directly within social media apps, preferring in-app checkout over website redirects",source:"Meta Commerce Insights 2024"})]}),e.jsx("h3",{children:"Why Social Commerce Is Exploding"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Frictionless buying:"})," No redirects to websitesâcomplete purchase without leaving the app"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Discovery + purchase unified:"})," See product in feed, buy instantly (impulse buying optimized)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Social proof integrated:"})," See what friends bought, real customer reviews, influencer recommendations in context"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Mobile-first shopping:"})," Optimized for how people actually shop (scrolling on phones, not desktop browsing)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Live shopping events:"})," Interactive product demos with real-time Q&A and limited-time offers"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Algorithmic merchandising:"})," Platforms show products based on engagement patterns, not just paid ads"]})]}),e.jsx(ct,{company:"Luna Botanicals",industry:"DTC Skincare",challenge:"Website traffic was good (50K monthly visitors) but conversion rate stuck at 1.8%. High cart abandonment (72%). Customers researched on social but left to purchase on websiteâfriction caused drop-off. Paid acquisition cost ($84 CAC) made profitability difficult with average order value of $62.",solution:"Launched Instagram Shop and TikTok Shop with full product catalogs. Created shoppable video content (product demos, customer reviews, ingredient education). Enabled in-app checkout. Shifted advertising budget to drive traffic to social shops instead of website. Partnered with 40 micro-influencers using affiliate links tied to social shops.",results:["Social commerce revenue grew from $0 to $480K/month in 8 months","Conversion rate on Instagram Shop: 8.2% (4.5x higher than website)","Average order value increased to $89 (bundles and impulse adds)","Cart abandonment dropped to 28% with simplified in-app checkout","CAC reduced to $31 (social commerce optimized for conversions)","40% of sales now through TikTok Shop (younger demographic)","Customer acquisition through influencer affiliate content grew 340%"],quote:"Social commerce changed everything. Customers no longer have to remember to come back to our website later. They see the product, love it, and buy it immediatelyâall without friction. Our conversion rates prove people prefer buying where they already are.",author:"Sara Martinez, Founder at Luna Botanicals"}),e.jsx("h2",{id:"platform-strategies",children:"Platform-Specific Strategies"}),e.jsx("p",{children:"Each platform has unique social commerce features and user behaviors. Optimize for platform-specific buying journeys."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Social Commerce Platform Guide"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"ð· Instagram Shopping"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Best For:"})," Visual products (fashion, beauty, home decor, lifestyle)"]}),e.jsx("p",{className:"text-sm mb-3",children:e.jsx("strong",{children:"Key Features:"})}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Shoppable posts/reels:"})," Tag products directly in content with prices"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Instagram Shop tab:"})," Full storefront with collections, product pages"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Checkout:"})," Native in-app checkout or redirect to website"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Live Shopping:"})," Host live product launches with real-time purchasing"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Product stickers:"})," Add product links to Stories for time-sensitive promos"]})]}),e.jsxs("p",{className:"text-sm mt-2 italic",children:[e.jsx("strong",{children:"Strategy:"})," Use Reels to showcase products in use, Stories for flash sales, Feed for lifestyle product photography."]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"ðµ TikTok Shop"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Best For:"})," Impulse purchases, trend-driven products, entertainment value"]}),e.jsx("p",{className:"text-sm mb-3",children:e.jsx("strong",{children:"Key Features:"})}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Product showcase tabs:"})," Dedicated storefront on your profile"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Shoppable videos:"})," Product links pinned directly to videos"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"LIVE Shopping:"})," Sell during live streams with flash deals"]}
151),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Affiliate program:"})," Creators can promote your products for commission"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Shop tab (For You page):"})," Discovery through TikTok's main feed"]})]}),e.jsxs("p",{className:"text-sm mt-2 italic",children:[e.jsx("strong",{children:"Strategy:"})," Create viral product demos, partner with creators for authentic reviews, use trending sounds to boost visibility."]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"ð Facebook Shop"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Best For:"})," Broad demographics, Facebook Marketplace integration, retargeting"]}),e.jsx("p",{className:"text-sm mb-3",children:e.jsx("strong",{children:"Key Features:"})}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Shop tab:"})," Full catalog storefront on business page"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Marketplace listings:"})," Products surface in local Marketplace searches"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Groups commerce:"})," Sell within Facebook Groups (community selling)"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Messenger commerce:"})," Customers can browse and buy via Messenger"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Dynamic product ads:"})," Retarget with personalized product recommendations"]})]}),e.jsxs("p",{className:"text-sm mt-2 italic",children:[e.jsx("strong",{children:"Strategy:"})," Leverage retargeting for abandoned carts, use Groups for niche communities, Marketplace for local discovery."]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-primary mb-2",children:"ð Pinterest Shopping"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{children:"Best For:"})," High purchase intent (users actively planning purchases), home/fashion/DIY"]}),e.jsx("p",{className:"text-sm mb-3",children:e.jsx("strong",{children:"Key Features:"})}),e.jsxs("ul",{className:"text-sm space-y-1 ml-4",children:[e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Product Pins:"})," Rich pins with real-time pricing, availability, buy buttons"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Shop tab:"}
151)," Shoppable catalog on profile"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Pinterest Lens:"})," Visual searchâsnap photo, find similar products"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Shopping ads:"})," Catalog ads that show relevant products based on user searches"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Idea Pins:"})," Multi-page storytelling with product tags"]})]}),e.jsxs("p",{className:"text-sm mt-2 italic",children:[e.jsx("strong",{children:"Strategy:"}),' SEO-optimize Pin descriptions, create lifestyle boards, target high-intent keywords (e.g., "wedding decor ideas").']})]})]})]}),e.jsx("h2",{id:"content-that-sells",children:"Content That Sells"}),e.jsx("p",{children:"Shoppable content requires different approach than brand awareness content. Focus on demonstrating value, building trust, and reducing friction."}),e.jsx("h3",{children:"The AIDA Framework for Social Commerce Content"}),e.jsx("div",{className:"bg-accent/10 border border-accent/30 rounded-lg p-6 my-6",children:e.jsxs("ol",{className:"space-y-3",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Attention (Hook): First 1-3 seconds"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Stop the scroll with problem statement, surprising visual, or bold claim"}),e.jsx("p",{className:"text-sm mt-1 italic",children:'Example: "This $12 serum replaced my $180 luxury one" or "Watch what happens when..."'})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Interest (Demonstration): Seconds 3-15"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Show product in action solving the problem. Demonstrate transformation or benefit"}),e.jsx("p",{className:"text-sm mt-1 italic",children:"Example: Before/after, product demo, unboxing with genuine reactions"})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Desire (Social Proof): Seconds 15-30"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Build credibility and trigger desire with testimonials, reviews, scarcity"}),e.jsx("p",{className:"text-sm mt-1 italic",children:'Example: "10,000+ customers love this," show customer reviews, "Selling out fast..."'})]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-primary",children:"Action (CTA + Product Link): Final 5 seconds"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Clear call-to-action with visible product tag/link. Create urgency if applicable"}),e.jsx("p",{className:"text-sm mt-1 italic",children:'Example: "Shop now ð" (pointing to product tag), "Link in bioâ25% off today only"'})]})]})}),e.jsx("h3",{children:"High-Converting Content Formats"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Product demo videos:"})," Show product being used in real situations (not staged studio shots)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Unboxing content:"})," First impressions, packaging reveals, excitement (triggers FOMO)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Before/after comparisons:"})," Visual proof of product effectiveness (skincare, home products, transformation)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Customer testimonials:"})," Real customers explaining why they love the product (video or text overlays)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Tutorial/how-to:"})," Educate on usage while showcasing multiple product applications"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Behind-the-scenes:"})," Production process, quality checks (builds trust and justifies price)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Comparison videos:"})," Your product vs. competitors (highlight differentiation)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Trend participation:"})," Use trending audio/formats with product integration"]})]}),e.jsx("h2",{id:"conversion-optimization",children:"Conversion Optimization"}),e.jsx("p",{children:"Optimize every element of the buying journey to reduce friction and increase conversion rates."}),e.jsx("h3",{children:"Product Page Optimization Checklist"}),e.jsx("div",{className:"bg-accent/20 border-l-4 border-primary p-6 my-6",children:e.jsxs("ol",{className:"space-y-2 ml-4",children:[e.jsxs("li",{children:["â ",e.jsx("strong",{children:"High-quality product images:"})," Multiple angles, zoom capability, lifestyle photos showing scale"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Clear pricing:"})," Prominently displayed, include any discounts or bundle offers"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Detailed descriptions:"})," Benefits-first (not just features), address common objections"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Social proof:"})," Display star ratings, review count, customer photos prominently"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Trust signals:"})," Badges (free shipping, money-back guarantee, secure checkout)"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Size/variant selection:"})," Easy to select options without confusion"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Urgency indicators:"})," Low stock alerts, limited-time offers, countdown timers"]}),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Related products:"}),' "Complete the look" or "Frequently bought together" bundles']}
151),e.jsxs("li",{children:["â ",e.jsx("strong",{children:"Mobile-optimized:"})," Fast loading, thumb-friendly buttons, readable text"]})]})}),e.jsx("h3",{children:"Checkout Flow Best Practices"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Guest checkout option:"})," Don't force account creation before purchase (reduces abandonment 35%)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Multiple payment methods:"})," Credit card, PayPal, Apple Pay, Google Pay, Shop Pay, Klarna"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Saved payment info:"})," Allow customers to save details for faster future checkouts"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Progress indicators:"})," Show checkout steps (shipping â payment â review)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Exit-intent offers:"})," Discount pop-up if user attempts to abandon cart"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Clear shipping info:"})," Delivery estimates, free shipping thresholds, tracking availability"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Security reassurance:"})," SSL badges, data privacy messaging, secure payment logos"]})]}),e.jsx("h3",{children:"Cart Abandonment Recovery"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("p",{className:"font-semibold mb-3",children:"Automated Recovery Sequence:"}),e.jsxs("ol",{className:"space-y-2 text-sm",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Hour 1:"})," Messenger/DM reminder with direct link to cart + 10% off code"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Hour 24:"})," Email with abandoned cart items, customer reviews, urgency messaging"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Day 3:"})," Retargeting ad on social feed featuring abandoned products + free shipping offer"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Day 7:"}),' Final email with "Last chance" messaging and best available offer']})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-3 italic",children:"Recovery rates: 10-15% from automated sequences alone"})]}),e.jsx("h2",{id:"measuring-roi",children:"Measuring Social Commerce ROI"}),e.jsx("p",{children:"Track full-funnel metrics from discovery to repeat purchase to optimize social commerce performance."}),e.jsxs("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h4",{className:"text-lg font-semibold mb-4",children:"Social Commerce KPIs"}),e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Metric"}),e.jsx("th",{className:"text-left py-2",children:"What It Measures"}),e.jsx("th",{className:"text-left py-2",children:"Target Benchmark"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Product View Rate"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"% of content viewers who click product tag"}),e.jsx("td",{className:"py-3 text-sm",children:">5% (Instagram), >8% (TikTok)"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Add-to-Cart Rate"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"% of product page visitors who add to cart"}),e.jsx("td",{className:"py-3 text-sm",children:">10% social commerce"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Conversion Rate"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"% of product viewers who complete purchase"}),e.jsx("td",{className:"py-3 text-sm",children:"3-8% (varies by platform/price point)"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Average Order Value"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Average $ per transaction"}),e.jsx("td",{className:"py-3 text-sm",children:"Track over time, optimize with bundles"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Customer Acquisition Cost"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Total spend / new customers acquired"}),e.jsx("td",{className:"py-3 text-sm",children:"<30% of LTV"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"Repeat Purchase Rate"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"% of customers who buy again within 90 days"}),e.jsx("td",{className:"py-3 text-sm",children:">25% (sustainable business)"})]})]})]})]}),e.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 rounded-lg p-8 my-12 text-center",children:[e.jsx("h3",{className:"text-2xl font-display font-bold mb-4",children:"Drive Social Commerce Sales"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"DESHILLER identifies high-intent buyers engaging with product-related content and helps you convert social engagement into revenue."}),e.jsx(h,{size:"lg",onClick:()=>s("/auth"),children:"Boost Sales Free"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},Cy=()=>{const s=ns(),t=[{id:"understanding-algorithms",text:"Understanding Platform Algorithms",level:2},{id:"ranking-factors",text:"Key Ranking Factors",level:2},{id:"content-optimization",text:"Content Optimization Strategies",level:2},{id:"engagement-signals",text:"Maximizing Engagement Signals",level:2},{id:"timing-frequency",text:"Timing & Frequency Optimization",level:2},{id:"platform-specific",text:"Platform-Specific Tactics",level:2},{id:"measurement",text:"Measuring Algorithm Performance",level:2}],a=[{title:"Engagement Rate Optimization",description:"Advanced strategies to boost your social media engagement metrics and build stronger audience connections.",category:"Engagement",readTime:"14 min read",path:"/academy/engagement-rate-optimization"},{title:"Content Marketing Automation",description:"Streamline your content workflow while maintaining quality and consistency across all platforms.",category:"Automation",readTime:"15 min read",path:"/academy/content-marketing-automation"},{title:"Video Content Strategy",description:"Master video content creation and distribution to dominate algorithm-friendly formats.",category:"Content",readTime:"16 min read",path:"/academy/video-content-strategy"}];return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container max-w-7xl mx-auto px-4 py-8",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"mb-6 hover:bg-accent",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back to Academy"]}),e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("article",{className:"max-w-3xl",children:[e.jsx(it,{category:"Algorithm Strategy",title:"Social Media Algorithm Optimization: Complete Guide for 2025",description:"Master platform algorithms to maximize organic reach, engagement, and content visibility across all social media channels.",author:{name:"Dr. Marcus Chen",role:"Algorithm Research Lead",avatar:"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=150",bio:"Algorithm Research Lead"},publishDate:"2025-01-15",readTime:"18 min read",featuredImage:"https://images.unsplash.com/photo-1551288049-bebda4e38f71?w=1200&h=600&fit=crop"}),e.jsxs("div",{className:"prose prose-slate max-w-none mt-12 space-y-8",children:[e.jsxs("section",{id:"understanding-algorithms",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Understanding Platform Algorithms"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 my-8",children:[e.jsx(Ze,{icon:gs,stat:"527% Higher",description:"Average reach for algorithm-optimized content vs. non-optimized",source:"Hootsuite 2024"}),e.jsx(Ze,{icon:Bt,stat:"3.2x More",description:"Impressions gained from understanding algorithm patterns",
151source:"Buffer State of Social 2024"})]}),e.jsx("p",{className:"text-lg text-foreground/90 leading-relaxed",children:"Social media algorithms are sophisticated systems designed to predict and surface content that users will find most valuable. Understanding how these algorithms work is essential for organic reach in 2025."}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-8",children:[e.jsxs("h3",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[e.jsx(ws,{className:"h-5 w-5 text-primary"}),"Core Algorithm Principles (2025)"]}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Relevance Scoring:"})," Content is ranked by predicted user interest based on past behavior"]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Recency Weighting:"})," Fresh content gets temporary ranking boost (decay varies by platform)"]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Engagement Velocity:"})," Rapid early engagement signals quality and triggers wider distribution"]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Relationship Strength:"})," Content from close connections (frequent interactions) ranks higher"]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Content Type Preference:"})," Native formats (Reels, Stories) receive algorithmic priority"]})]})]})]})]}),e.jsxs("section",{id:"ranking-factors",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Key Ranking Factors by Platform"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-6 bg-card/20",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4 text-primary",children:"Instagram Algorithm Factors"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"Engagement Rate (saves, shares, comments)"}),e.jsx("span",{className:"text-primary font-semibold",children:"35%"})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"Relationship Signals (DMs, profile visits)"}),e.jsx("span",{className:"text-primary font-semibold",children:"25%"})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"Timeliness (post recency)"}),e.jsx("span",{className:"text-primary font-semibold",children:"20%"})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"User Behavior (content type preference)"}),e.jsx("span",{className:"text-primary font-semibold",children:"15%"})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"Session Time (how long users view)"}),e.jsx("span",{className:"text-primary font-semibold",children:"5%"})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-4 italic",children:"Source: Meta Engineering Blog 2024"})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6 bg-card/20",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4 text-primary",children:"LinkedIn Algorithm Factors"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"Dwell Time (time spent reading)"}),e.jsx("span",{className:"text-primary font-semibold",children:"30%"})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"Engagement Quality (thoughtful comments)"}),e.jsx("span",{className:"text-primary font-semibold",children:"28%"})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"Personal Connection Strength"}),e.jsx("span",{className:"text-primary font-semibold",children:"22%"})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"Content Relevance to Industry"}),e.jsx("span",{className:"text-primary font-semibold",children:"15%"})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"Creator Authority Score"}),e.jsx("span",{className:"text-primary font-semibold",children:"5%"})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-4 italic",children:"Source: LinkedIn Engineering 2024"})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6 bg-card/20",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4 text-primary",children:"X (Twitter) Algorithm Factors"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"Engagement Velocity (speed of interactions)"}),e.jsx("span",{className:"text-primary font-semibold",children:"32%"})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"Retweet & Quote Tweet Ratio"}),e.jsx("span",{className:"text-primary font-semibold",children:"26%"})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"Media Richness (images, videos)"}),e.jsx("span",{className:"text-primary font-semibold",children:"18%"})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"Author Reputation Score"}),e.jsx("span",{className:"text-primary font-semibold",children:"14%"})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"font-medium",children:"Recency Bonus"}),e.jsx("span",{className:"text-primary font-semibold",children:"10%"})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-4 italic",children:"Source: X Engineering Blog 2024"})]})]})]}),e.jsxs("section",{id:"content-optimization",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Content Optimization Strategies"}),e.jsx(ct,{company:"TechFlow Solutions",industry:"B2B SaaS",challenge:"Organic reach dropped 67% after algorithm changes in Q3 2024. Only 4% of followers saw their content.",solution:"Implemented comprehensive algorithm optimization: switched to native video formats, optimized posting times using engagement velocity data, restructured content for conversation-starters (questions, polls), and focused on 'saves' rather than likes.",results:["412% increase in organic reach within 8 weeks","Engagement rate jumped from 1.2% to 8.7%","Average post impressions increased from 1,200 to 18,400","67% of content now triggers algorithmic 'viral' distribution","Follower growth accelerated by 340% organically"],quote:"Understanding that algorithms reward dwell time and meaningful engagementânot just likesâcompletely transformed our
151content strategy.",author:"Jennifer Park, Head of Social Media"}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"Algorithm-Friendly Content Formats"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-5 bg-card/20",children:[e.jsx("h4",{className:"font-semibold text-primary mb-3",children:"High-Performing Formats"}),e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Carousel Posts:"})," 3.1x higher engagement, algorithm favors multi-swipe content"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Native Video (Reels/Shorts):"})," 2.8x reach boost over external links"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Long-Form Text (LinkedIn):"})," 1,300+ words = 4x higher visibility"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Interactive Content:"})," Polls, quizzes get 2.4x comments"]})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5 bg-card/20",children:[e.jsx("h4",{className:"font-semibold text-destructive mb-3",children:"Algorithm Penalties to Avoid"}),e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"External Links:"})," 47% reach reduction on Instagram/Facebook"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Reposted Content:"})," 63% penalty for duplicate/borrowed posts"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Low-Quality Images:"})," Blurry or pixelated content suppressed"]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Engagement Bait:"}),' "Tag a friend" tactics trigger spam filters']})]})]})]})]})]}),e.jsxs("section",{id:"engagement-signals",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Maximizing Engagement Signals"}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-4 my-8",children:[e.jsx(Ze,{icon:Pa,stat:"Saves > Likes",description:"Instagram values saves 4x more than likes in ranking algorithm",source:"Meta Internal Data 2024"}),e.jsx(Ze,{icon:lr,stat:"Shares = Gold",description:"Content shared via DM gets 8.3x algorithmic boost",source:"Social Media Today"}),e.jsx(Ze,{icon:Es,stat:"90 Seconds",description:"Average dwell time needed to trigger 'quality content' signal",source:"LinkedIn Engineering"})]}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"Engagement Signal Hierarchy"}),e.jsx("div",{className:"bg-gradient-to-br from-primary/5 to-primary/10 border border-primary/20 rounded-lg p-6",children:e.jsxs("ol",{className:"space-y-4",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold",children:"1"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold",children:"Shares & Saves (Highest Value)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Indicates content worth keeping or sharing with network. Creates compounding distribution effect."})]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold",children:"2"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold",children:"Comments & DMs"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Signals meaningful engagement. Longer comments (20+ words) weighted higher."})]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold",children:"3"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold",children:"Dwell Time & Video Completion"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Time spent viewing post. 75%+ video completion rate triggers boost."})]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold",children:"4"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold",children:"Likes & Reactions"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Basic positive signal. Important for initial velocity but lowest algorithmic weight."})]})]})]})}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"Tactical Engagement Optimization"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[e.jsx("h4",{className:"font-semibold mb-2",children:'Create "Save-Worthy" Content'}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Educational carousels, templates, checklists, how-to guides users want to reference later. Add clear "Save this for later" CTA.'})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Engineer Conversation Starters"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:`Ask specific questions with 2-3 answer options. "What's your biggest challenge: A, B, or C?" generates higher quality comments than vague "thoughts?"`})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Optimize for Watch Time"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Hook in first 3 seconds, loop videos, use text overlays to increase completion rate. Aim for 45-90 second videos (sweet spot for full viewing)."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Respond Within Golden Hour"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Reply to comments within 60 minutes of posting. Signals active engagement to algorithm, triggers secondary distribution boost."})]})]})]}),e.jsxs("section",{id:"timing-frequency",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Timing & Frequency Optimization"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-8",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Optimal Posting Times by Platform (2025 Data)"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("span",{className:"font-semibold",children:"Instagram"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Best: Tue-Thu 9-11am, 7-9pm EST"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Peak engagement during morning commute and evening leisure. Avoid Monday mornings and Friday nights."})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("span",{className:"font-semibold",children:"LinkedIn"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Best: Tue-Thu 8-10am, 12-1pm EST"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"B2B audiences most active during work hours. Tuesday morning = 41% higher engagement than other days."})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("span",{className:"font-semibold",children:"X (Twitter)"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Best: Mon-Fri 8-10am, 5-6pm EST"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"News-focused platform peaks around news cycles. Weekday mornings optimal for professional content."})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("span",{className:"font-semibold",children:"Facebook"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Best: Wed-Fri 1-3pm EST"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Older demographics check during lunch breaks and afternoons. Weekend mornings strong for B2C."})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-4 italic",children:"Source: Sprout Social Q4 2024 Engagement Report"})]}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"Frequency Best Practices"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-3 text-primary",children:"Recommended Posting Frequency"}),e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Instagram:"})," 4-7 posts/week + daily Stories"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"LinkedIn:"})," 3-5 posts/week (quality > quantity)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"X (Twitter):"})," 3-5 tweets/day minimum"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Facebook:"})," 3-5 posts/week"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"TikTok:"})," 1-3 videos/day for algorithm favor"]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-3 text-primary",children:"Consistency > Volume"}),e.jsx("p",{className:"text-sm mb-3",children:"Algorithms reward consistent posting schedules. Posting 3x/week consistently outperforms erratic daily posting."}),e.jsx("div",{className:"bg-primary/10 p-3 rounded",children:e.jsx("p",{className:"text-xs font-medium",children:"Pro Tip: Algorithm learns your pattern. If you post Mon/Wed/Fri at 10am for 4 weeks, your audience gets notified at those times."})})]})]})]}),e.jsxs("section",{id:"platform-specific",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Platform-Specific Algorithm Tactics"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border border-primary/20 rounded-lg p-6 bg-gradient-to-br from-primary/5 to-transparent",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4 text-primary",children:"Instagram Algorithm Hacks"}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(ks,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Carousel Strategy:"})," Post 8-10 slide carousels. Users who don't swipe all get re-shown in feed 24hrs later (second chance algorithm boost)."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(ks,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Story Engagement Loop:"}),' Respond to every Story reply within 15 mins. Creates "close friends" signal, boosts all your content in their feed.']})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(ks,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Reel Audio Strategy:"})," Use trending audio within 24-48hrs of trending. Algorithm prioritizes current trends over older ones."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(ks,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Caption Length:"})," 1,800-2,200 characters = optimal for saves. Too short = low value perception. Too long = abandon rate."]})]})]})]}),e.jsxs("div",{className:"border border-primary/20 rounded-lg p-6 bg-gradient-to-br from-primary/5 to-transparent",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4 text-primary",children:"LinkedIn Algorithm Hacks"}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(ks,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"First-Hour Engagement Test:"})," LinkedIn tests posts with 10% of audience first hour. High engagement = broader distribution to entire network + 2nd degree connections."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(ks,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Document Posts:"})," Upload PDFs/documents natively. Get 3x longer dwell time than link posts. Algorithm heavily rewards time-on-platform."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(ks,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Comment Strategy:"})," Leave 50+ word thoughtful comments on relevant posts. Your visibility increases to that post's audience (indirect reach hack)."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(ks,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Newsletter Feature:"})," LinkedIn newsletters get pushed to all subscribers (email + notification). Powerful owned-distribution channel that bypasses algorithm entirely."]})]})]})]}),e.jsxs("div",{className:"border border-primary/20 rounded-lg p-6 bg-gradient-to-br from-primary/5 to-transparent",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4 text-primary",children:"X (Twitter) Algorithm Hacks"}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(ks,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Reply Guy Strategy:"})," Reply to larger accounts' tweets within first 5 mins. High-performing replies get shown to original poster's audience."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(ks,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Thread Momentum:"}),' Post threads in rapid succession (30 sec between tweets). Algorithm interprets as "breaking news" = priority distribution.']})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(ks,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Quote Tweet Tactic:"})," Quote tweet high-performing content with unique angle. Piggyback on trending topics for visibility boost."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(ks,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Media Richness:"})," Tweets with 4 images get 3.2x engagement vs single image. Video tweets get prioritized
151in For You feed."]})]})]})]})]})]}),e.jsxs("section",{id:"measurement",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Measuring Algorithm Performance"}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"Key Metrics to Track"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Reach Rate"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Impressions ÷ Followers à 100"}),e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-2xl font-bold text-primary",children:"15-25%"}),e.jsx("span",{className:"text-sm",children:"= Good performance"})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Engagement Velocity"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Engagement in first 60 mins after posting"}),e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-2xl font-bold text-primary",children:"80%"}),e.jsx("span",{className:"text-sm",children:"of final engagement happens in first 6 hours"})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Save Rate"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Saves ÷ Reach à 100"}),e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-2xl font-bold text-primary",children:"2-5%"}),e.jsx("span",{className:"text-sm",children:"= High-value content"})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Dwell Time"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Average time spent viewing post"}),e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-2xl font-bold text-primary",children:"60-90s"}),e.jsx("span",{className:"text-sm",children:"triggers quality signal"})]})]})]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 mt-8",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Algorithm Performance Audit Checklist"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Track reach rate weekly - declining trend = algorithm penalty"})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Monitor first-hour engagement - should be 40-50% of total"})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Analyze post format performance - double down on winners"})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Test posting times with A/B experiments - find your optimal window"})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Review saves-to-impressions ratio - aim for 2%+ on educational content"})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Check follower-to-non-follower reach split - goal is 60%+ non-followers"})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Audit content for algorithm penalties (external links, low-quality media)"})]})]})]})]}),e.jsxs("div",{className:"bg-gradient-to-br from-primary/10 to-primary/5 border-2 border-primary/20 rounded-xl p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Key Takeaways: Algorithm Mastery"}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Prioritize High-Value Signals:"})," Focus on saves, shares, and dwell time over vanity metrics like likes."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use Native Formats:"})," Platform-specific content formats (Reels, Carousels, native video) get algorithmic priority."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Optimize Engagement Velocity:"})," First 60 minutes determine post success. Respond to comments immediately."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Maintain Consistency:"})," Regular posting schedule trains algorithm and audience expectations."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Avoid Penalties:"})," External links, engagement bait, and low-quality content trigger algorithmic suppression."]})]})]})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})]})})},_y=()=>{const s=ns(),t=[{id:"social-customer-care",text:"The Rise of Social Customer Care",level:2},{id:"response-strategies",text:"Response Time & Strategy",level:2},{id:"platform-specific",text:"Platform-Specific Best Practices",level:2},{id:"crisis-management",text:"Managing Negative Feedback",level:2},{id:"automation-tools",text:"Automation & AI Tools",level:2},{id:"team-structure",text:"Building Your Social Care Team",level:2},{id:"measurement",text:"Measuring Success",level:2}],a=[{title:"Crisis Management on Social Media",description:"Prepare for and respond to social media crises with proven frameworks and real-world case studies.",category:"Crisis",readTime:"17 min read",path:"/academy/crisis-management-social-media"},{title:"Community Building Tactics",description:"Transform your social media presence into a thriving community that drives business growth.",category:"Community",readTime:"18 min read",path:"/academy/community-building-tactics"},{title:"Social Listening Tools",description:"Monitor conversations, track brand mentions, and uncover customer insights across all platforms.",category:"Tools",readTime:"16 min read",path:"/academy/social-listening-tools"}];return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container max-w-7xl mx-auto px-4 py-8",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"mb-6 hover:bg-accent",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back to Academy"]}),e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("article",{className:"max-w-3xl",children:[e.jsx(it,{category:"Customer Experience",title:"Social Media Customer Service: The Complete 2025 Guide",description:"Transform social channels into powerful customer support platforms. Master response strategies, automation, and crisis management.",author:{name:"Rachel Thompson",role:"CX Strategy Director",avatar:"https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=150",bio:"CX Strategy Director"},publishDate:"2025-01-18",readTime:"19 min read",featuredImage:"https://images.unsplash.com/photo-1556761175-b413da4baf72?w=1200&h=600&fit=crop"}),e.jsxs("div",{className:"prose prose-slate max-w-none mt-12 space-y-8",children:[e.jsxs("section",{id:"social-customer-care",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"The Rise of Social Customer Care"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 my-8",children:[e.jsx(Ze,{icon:St,stat:"67% Prefer",description:"Consumers prefer social media for customer service over phone/email",source:"Sprout Social 2024"}),e.jsx(Ze,{icon:Cs,stat:"<15 Minutes",description:"Expected response time on social media (vs 24hrs for email)",source:"HubSpot Research"})]}
151),e.jsx("p",{className:"text-lg text-foreground/90 leading-relaxed",children:"Social media has evolved from a marketing channel to a critical customer service touchpoint. Customers expect real-time, personalized support in public forumsâmaking every interaction a brand reputation opportunity."}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-8",children:[e.jsxs("h3",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[e.jsx(gs,{className:"h-5 w-5 text-primary"}),"Why Social Customer Service Matters"]}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Public Accountability:"})," 89% of consumers check a brand's social media before purchase decisions"]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Response Speed = Loyalty:"})," Customers who get <1 hour responses are 3.2x more likely to repurchase"]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Cost Efficiency:"})," Social support costs 1/6th of phone support per interaction"]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Marketing Opportunity:"})," 71% of positive service experiences get shared publicly"]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Customer Insight:"})," Public conversations reveal product issues and improvement opportunities"]})]})]})]}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"The Social Service Mindset Shift"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"border border-destructive/30 rounded-lg p-5 bg-destructive/5",children:[e.jsx("h4",{className:"font-semibold text-destructive mb-3",children:"â Traditional Support Thinking"}),e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsx("li",{children:"⢠Private, one-to-one interactions"}),e.jsx("li",{children:"⢠24-hour response windows acceptable"}),e.jsx("li",{children:"⢠Scripted, corporate responses"}),e.jsx("li",{children:"⢠Focus on issue resolution only"}),e.jsx("li",{children:"⢠Reactive problem-solving"})]})]}),e.jsxs("div",{className:"border border-primary/30 rounded-lg p-5 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold text-primary mb-3",children:"â Social Care Thinking"}),e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsx("li",{children:"⢠Public stage with audience watching"}),e.jsx("li",{children:"⢠<1 hour expected (15 min ideal)"}),e.jsx("li",{children:"⢠Human, empathetic, brand personality"}),e.jsx("li",{children:"⢠Opportunity to showcase values"}),e.jsx("li",{children:"⢠Proactive monitoring and outreach"})]})]})]})]}),e.jsxs("section",{id:"response-strategies",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Response Time & Strategy Framework"}),e.jsx(ct,{company:"CloudSync Software",industry:"B2B SaaS",challenge:"Customer complaints on Twitter were escalating publicly, with 72% of support mentions going unanswered. NPS dropped from 42 to 28 in 6 months. Response time averaged 6+ hours, leading to viral negative threads.",solution:"Implemented 24/7 social listening with tiered response protocol: <10 min acknowledgment for urgent issues, <30 min for general inquiries. Created empowered social care team with authority to issue refunds/credits without escalation. Trained team in de-escalation and public empathy.",results:["Average response time reduced from 6hrs to 12 minutes","Customer satisfaction on social support jumped from 34% to 92%","NPS recovered to 51 (highest company record)","Positive social mentions increased 340%","37% reduction in churn among customers who received social support"],quote:"Fast, empathetic public responses didn't just solve problemsâthey became our best marketing content. Prospects see how we treat customers.",author:"Marcus Lee, VP Customer Success"}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"The Response Time Hierarchy"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border-l-4 border-red-500 bg-red-500/5 pl-4 py-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"font-semibold text-red-600",children:"ð¨ Critical Issues"}),e.jsx("span",{className:"text-sm font-bold text-red-600",children:"<10 minutes"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Service outages, security concerns, billing errors, angry public complaints. Acknowledge immediately, resolve ASAP."})]}),e.jsxs("div",{className:"border-l-4 border-orange-500 bg-orange-500/5 pl-4 py-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"font-semibold text-orange-600",children:"â ï¸ High Priority"}),e.jsx("span",{className:"text-sm font-bold text-orange-600",children:"<30 minutes"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Product questions, feature requests, moderate complaints. Respond before customer follows up or vents publicly."})]}),e.jsxs("div",{className:"border-l-4 border-yellow-500 bg-yellow-500/5 pl-4 py-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"font-semibold text-yellow-700",children:"ð¬ General Inquiries"}),e.jsx("span",{className:"text-sm font-bold text-yellow-700",children:"<2 hours"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"General questions, positive feedback, non-urgent issues. Respond within business hours, maintain engagement."})]}),e.jsxs("div",{className:"border-l-4 border-green-500 bg-green-500/5 pl-4 py-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"font-semibold text-green-700",children:"ð Positive Mentions"}),e.jsx("span",{className:"text-sm font-bold text-green-700",children:"<4 hours"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Thank y
151ous, testimonials, recommendations. Acknowledge and amplify. These are marketing gold."})]})]}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"The HEAR Response Framework"}),e.jsx("div",{className:"bg-gradient-to-br from-primary/5 to-primary/10 border border-primary/20 rounded-lg p-6",children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-lg mb-2",children:"H - Hear & Acknowledge"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:`"I see you're experiencing [specific issue]. That's frustrating, and I'm here to help."`}),e.jsx("p",{className:"text-xs italic",children:"Validates their concern, shows you're paying attention. Critical first step."})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-lg mb-2",children:"E - Empathize"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:`"I completely understand why this is concerning. If I were in your position, I'd feel the same way."`}),e.jsx("p",{className:"text-xs italic",children:"Human connection before solution. Diffuses tension."})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-lg mb-2",children:"A - Act & Assist"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:`"Here's what I'm doing right now: [specific action]. Let me also [additional help]."`}),e.jsx("p",{className:"text-xs italic",children:"Concrete steps, not vague promises. Show progress."})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-lg mb-2",children:"R - Resolve & Follow Up"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:`"I've [solution]. Can you confirm this resolved the issue? I'll check back in 24hrs to make sure."`}),e.jsx("p",{className:"text-xs italic",children:"Close the loop. Follow-up separates good from great service."})]})]})})]}),e.jsxs("section",{id:"platform-specific",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Platform-Specific Best Practices"}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-4 my-8",children:[e.jsx(Ze,{icon:St,stat:"Twitter/X",description:"Fastest response expectations - <15 min average. Public complaints escalate quickly."}),e.jsx(Ze,{icon:Es,stat:"Facebook",description:"Messenger preferred for complex issues. Public comments for acknowledgment only."}),e.jsx(Ze,{icon:xa,stat:"Instagram",description:"DM-first platform. Public comment responses should redirect to DM for privacy."})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-6",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4 text-primary",children:"Twitter/X Customer Service Strategy"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Real-Time Monitoring Essential"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Set up advanced search streams for brand mentions, product names, common misspellings. Monitor 24/7 during business-critical periods."})]}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Public-to-Private Transition"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Acknowledge publicly: "I see your issue with [problem]. DMing you now to resolve quickly ð ï¸" Then handle details privately.'})]}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Personality Shines Here"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Twitter allows brand voice. Wendy's, Netflix, Moon Pie excel at personality-driven support that gets shared as entertainment."})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4 text-primary",children:"Facebook Customer Service Strategy"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Messenger as Primary Channel"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable automated greetings, away messages. Use saved replies for common questions. Messenger chat history creates continuous relationship."})]}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Comment Management"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Hide spam/offensive comments immediately. Reply to questions publicly if answer benefits others, otherwise redirect to Messenger."})]}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Response Time Badge"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Maintain "Very responsive to messages" badge by responding to 90%+ of messages within 15 minutes. Visible trust signal.'})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4 text-primary",children:"Instagram Customer Service Strategy"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"DM-First Approach"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Instagram users expect DM support. Bio should include "DM us for help ð¬" Quick replies feature essential for efficiency.'})]}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Story Interaction"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Reply to Story mentions immediately. Use Stories to announce service updates, outages. Create "Help" Story highlight for FAQs.'})]}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Visual Problem Solving"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Ask customers to DM photos/videos of issues. Send video tutorials as responses. Visual platform = visual solutions."})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4 text-primary",children:"LinkedIn Customer Service Strategy"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Professional Tone Required"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"B2B audience expects formal, solution-oriented responses. Less personality, more expertise demonstration."})]}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Decision-Maker Visibility"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Support interactions visible to prospects/partners. Every response is brand reputation management. Showcase expertise."})]}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Proactive Outreach"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Comment on customer success posts, offer help on industry discussions. LinkedIn rewards helpful engagement."})]})]})]})]})]}),e.jsxs("section",{id:"crisis-management",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Managing Negative Feedback & Public Complaints"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-8",children:[e.jsxs("h3",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[e.jsx(Tt,{className:"h-5 w-5 text-primary"}),"The Golden Rules of Negative Response"]}),e.jsxs("ol",{className:"space-y-3",children:[e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold text-sm",children:"1"}),e.jsxs("div",{children:[e.jsx("strong",{className:"block mb-1",children:"Never Delete (Unless Spam/Offensive)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Deleting criticism triggers "what are they hiding?" Screenshots spread fast. Address publicly, own mistakes.'})]})]}),e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold text-sm",children:"2"}),e.jsxs("div",{children:[e.jsx("strong",{className:"block mb-1",children:"Respond Quickly, Don't React Emotionally"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Take 5 minutes to craft empathetic response. Defensive tone escalates situations. Anger fuels viral posts."})]})]}),e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold text-sm",children:"3"}),e.jsxs("div",{children:[e.jsx("strong",{className:"block mb-1",children:"Own It When You're Wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:`"You're right, we messed up. Here's what we're doing to fix it." Accountability builds trust, excuses destroy it.`})]})]}),e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold text-sm",children:"4"}),e.jsxs("div",{children:[e.jsx("strong",{className:"block mb-1",children:"Move to Private Channels for Details"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Public: acknowledge + empathy. Private: solution details. "DMing you now with account-specific resolution."'})]})]}),e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold text-sm",children:"5"}),e.jsxs("div",{children:[e.jsx("strong",{className:"block mb-1",children:"Follow Up Publicly When Resolved"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'"Update: Worked with @customer, issue resolved! Thanks for your patience ð" Shows you close loops.'})]})]})]})]}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"Handling Different Complaint Types"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsxs("h4",{className:"font-semibold mb-2 flex items-center gap-2",children:[e.jsx(Ss,{className:"h-5 w-5 text-orange-500"}),"Legitimate Product/Service Issues"]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Customer has valid complaint about actual problem."}),e.jsxs("div",{className:"bg-primary/5 p-3 rounded",children:[e.jsx("p",{className:"text-sm font-medium mb-1",children:"Response Template:"}),e.jsx("p",{className:"text-sm italic",children:`"You're absolutely right, [specific issue] isn't working as it should. I've escalated this to our engineering team and will personally ensure it's fixed by [timeframe]. In the meantime, [immediate workaround]. DM me your account details so I can make this right."`})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsxs("h4",{className:"font-semibold mb-2 flex items-center gap-2",children:[e.jsx(Ss,{className:"h-5 w-5 text-red-500"}),"Angry/Emotional Complaints"]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Customer is venting frustration, needs to be heard."}),e.jsxs("div",{className:"bg-primary/5 p-3 rounded",children:[e.jsx("p",{className:"text-sm font-medium mb-1",children:"Response Template:"}),e.jsx("p",{className:"text-sm italic",children:`"I can hear how frustrating this experience has been. That's not the [brand] standard and I'm genuinely sorry we let you down. I'm taking ownership of this personally. Can I DM you to understand exactly what happened and make it right?"`})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsxs("h4",{className:"font-semibold mb-2 flex items-center gap-2",children:[e.jsx(Ss,{className:"h-5 w-5 text-yellow-500"}),"Misunderstandings/Confusion"]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Customer expected different feature/outcome."}),e.jsxs("div",{className:"bg-primary/5 p-3 rounded",children:[e.jsx("p",{className:"text-sm font-medium mb-1",children:"Response Template:"}),e.jsx("p",{className:"text-sm italic",children:`"I see the confusion! [Feature] works like [explanation]. That said, I hear your need for [their expectation]âI'm passing this feedback to our product team. Meanwhile, here's how to accomplish [their goal] with current features..."`})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsxs("h4",{className:"font-semibold mb-2 flex items-center gap-2",children:[e.jsx(Ss,{className:"h-5 w-5 text-purple-500"}),"Competitor Comparisons"]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:'"Brand X does this better than you."'}),e.jsxs("div",{className:"bg-primary/5 p-3 rounded",children:[e.jsx("p",{className:"text-sm font-medium mb-1",children:"Response Template:"}),e.jsx("p",{className:"text-sm italic",children:`"[Competitor] is great at [their strength]. Our approach is different because [unique value prop]. That said, if [specific feature] is critical for you, I'd love to understand your use caseâwe're always evolving based on customer needs."`})]})]})]})]}),e.jsxs("section",{id:"automation-tools",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Automation & AI Tools for Scale"}),e.jsxs("div",{className:"bg-gradient-to-br from-primary/10 to-primary/5 border border-primary/20 rounded-lg p-6 my-8",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4",children:"The 70/30 Automation Rule"}
151),e.jsx("p",{className:"mb-4 text-foreground/90",children:"Automate 70% of routine queries, reserve human touch for 30% complex/sensitive issues."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2 text-primary",children:"â Great for Automation"}),e.jsxs("ul",{className:"text-sm space-y-1",children:[e.jsx("li",{children:"⢠Order status inquiries"}),e.jsx("li",{children:"⢠FAQs (hours, shipping, returns)"}),e.jsx("li",{children:"⢠Password reset instructions"}),e.jsx("li",{children:"⢠Routing to correct department"}),e.jsx("li",{children:"⢠Appointment scheduling"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2 text-destructive",children:"â Requires Human Touch"}),e.jsxs("ul",{className:"text-sm space-y-1",children:[e.jsx("li",{children:"⢠Complaints/angry customers"}),e.jsx("li",{children:"⢠Refund requests"}),e.jsx("li",{children:"⢠Complex technical issues"}),e.jsx("li",{children:"⢠Account security concerns"}),e.jsx("li",{children:"⢠Crisis/PR situations"})]})]})]})]}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"Essential Tools for Social Customer Service"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("h4",{className:"font-semibold text-lg",children:"Social Inbox Platforms"}),e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-2 py-1 rounded",children:"Required"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Unified inbox for all social messages/mentions across platforms."}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:"text-xs bg-card border border-border px-3 py-1 rounded-full",children:"Sprout Social"}),e.jsx("span",{className:"text-xs bg-card border border-border px-3 py-1 rounded-full",children:"Hootsuite"}),e.jsx("span",{className:"text-xs bg-card border border-border px-3 py-1 rounded-full",children:"Agorapulse"}),e.jsx("span",{className:"text-xs bg-card border border-border px-3 py-1 rounded-full",children:"Buffer"})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("h4",{className:"font-semibold text-lg",children:"AI Chatbots"}),e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-2 py-1 rounded",children:"Recommended"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Instant responses to common questions, 24/7 first-line support."}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:"text-xs bg-card border border-border px-3 py-1 rounded-full",children:"ManyChat"}),e.jsx("span",{className:"text-xs bg-card border border-border px-3 py-1 rounded-full",children:"Chatfuel"}),e.jsx("span",{className:"text-xs bg-card border border-border px-3 py-1 rounded-full",children:"MobileMonkey"}),e.jsx("span",{className:"text-xs bg-card border border-border px-3 py-1 rounded-full",children:"Intercom"})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("h4",{className:"font-semibold text-lg",children:"Sentiment Analysis"}),e.jsx("span",{className:"text-xs bg-muted text-muted-foreground px-2 py-1 rounded",children:"Optional"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"AI categorizes mentions as positive/negative/urgent for prioritization."}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:"text-xs bg-card border border-border px-3 py-1 rounded-full",children:"Brandwatch"}),e.jsx("span",{className:"text-xs bg-card border border-border px-3 py-1 rounded-full",children:"Mention"}),e.jsx("span",{className:"text-xs bg-card border border-border px-3 py-1 rounded-full",children:"Talkwalker"})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("h4",{className:"font-semibold text-lg",children:"Knowledge Base Integration"}),e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-2 py-1 rounded",children:"Recommended"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Link help articles in responses, empower self-service."}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:"text-xs bg-card border border-border px-3 py-1 rounded-full",children:"Zendesk"}),e.jsx("span",{className:"text-xs bg-card border border-border px-3 py-1 rounded-full",children:"Help Scout"}),e.jsx("span",{className:"text-xs bg-card border border-border px-3 py-1 rounded-full",children:"Freshdesk"})]})]})]})]}),e.jsxs("section",{id:"team-structure",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Building Your Social Care Team"}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"Team Structure by Company Size"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Small Business (<50 employees)"}),e.jsxs("ul",{className:"text-sm space-y-2",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"1-2 people"})," handling social + marketing. Use tools heavily for efficiency."]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Chatbot for after-hours, escalation protocol to owner/manager for complex issues."})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Mid-Size (50-500 employees)"}),e.jsxs("ul",{className:"text-sm space-y-2",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"3-5 dedicated social care specialists"})," across shifts (business hours + evening monitoring)."]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Manager overseeing quality, analyzing trends, reporting to CX leadership."})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Enterprise (500+ employees)"}),e.jsxs("ul",{className:"text-sm space-y-2",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"10-20+ person team"})," with 24/7 coverage, specialized by platform/geography."]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Tiered support: L1 (routine), L2 (complex), L3 (escalations). Crisis management team."})]})]})]})]}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"Key Skills for Social Care Team"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"border border-primary/20 rounded-lg p-5 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Must-Have Skills"}),e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(ws,{className:"h-4 w-4 text-primary"}),e.jsx("span",{children:"Empathy & emotional intelligence"})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(ws,{className:"h-4 w-4 text-primary"}),e.jsx("span",{children:"Written communication excellence"})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(ws,{className:"h-4 w-4 text-primary"}),e.jsx("span",{children:"Problem-solving under pressure"})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(ws,{className:"h-4 w-4 text-primary"}),e.jsx("span",{children:"Brand voice consistency"})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(ws,{className:"h-4 w-4 text-primary"}),e.jsx("span",{children:"Platform knowledge (algorithms, features)"})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Nice-to-Have Skills"}),e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:"Crisis communication training"})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:"Multilingual capabilities"})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:"Technical product knowledge"})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:"Data analysis (trends, reporting)"})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:"Community management experience"})]})]})]})]})]}),e.jsxs("section",{id:"measurement",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Measuring Social Customer Service Success"}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"Key Performance Indicators"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-3 text-primary",children:"Speed Metrics"}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{children:[e.jsxs("div",{className:"flex justify-between items-baseline mb-1",children:[e.jsx("span",{className:"text-sm font-medium",children:"First Response Time"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Target: <15 min"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Time from customer message to first agent response"})]}),e.jsxs("li",{children:[e.jsxs("div",{className:"flex justify-between items-baseline mb-1",children:[e.jsx("span",{className:"text-sm font-medium",children:"Average Resolution Time"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Target: <2 hrs"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"From initial contact to issue fully resolved"})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-3 text-primary",children:"Quality Metrics"}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{children:[e.jsxs("div",{className:"flex justify-between items-baseline mb-1",children:[e.jsx("span",{className:"text-sm font-medium",children:"Customer Satisfaction (CSAT)"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Target: >85%"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Post-interaction survey rating"})]}),e.jsxs("li",{children:[e.jsxs("div",{className:"flex justify-between items-baseline mb-1",children:[e.jsx("span",{className:"text-sm font-medium",children:"First Contact Resolution"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Target: >70%"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Issues solved without escalation/follow-up"})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-3 text-primary",children:"Volume Metrics"}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{children:[e.jsxs("div",{className:"flex justify-between items-baseline mb-1",children:[e.jsx("span",{className:"text-sm font-medium",children:"Total Interactions"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Track trends"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Messages + comments requiring response"})]}),e.jsxs("li",{children:[e.jsxs("div",{className:"flex justify-between items-baseline mb-1",children:[e.jsx("span",{className:"text-sm font-medium",children:"Response Coverage"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Target: >95%"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"% of mentions that received response"})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-3 text-primary",children:"Sentiment Metrics"}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{children:[e.jsxs("div",{className:"flex justify-between items-baseline mb-1",children:[e.jsx("span",{className:"text-sm font-medium",children:"Net Sentiment Score"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Target: +40 or higher"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Positive minus negative mention %"})]}),e.jsxs("li",{children:[e.jsxs("div",{className:"flex justify-between items-baseline mb-1",children:[e.jsx("span",{className:"text-sm font-medium",children:"Complaint to Praise Ratio"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Target: <1:3"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Track improvement over time"})]})]})]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 mt-8",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Monthly Reporting Template"}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4 pb-2 border-b border-border/50 font-semibold",children:[e.jsx("span",{children:"Metric"}),e.jsx("span",{children:"This Month"}),e.jsx("span",{children:"Last Month"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx("span",{className:"text-muted-foreground",children:"Total Interactions"}),e.jsx("span",{children:"1,247"}),e.jsx("span",{children:"1,098"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx("span",{className:"text-muted-foreground",children:"Avg First Response Time"}),e.jsx("span",{children:"12 min"}),e.jsx("span",{children:"18 min"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx("span",{className:"text-muted-foreground",children:"CSAT Score"}),e.jsx("span",{children:"89%"}),e.jsx("span",{children:"84%"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx("span",{className:"text-muted-foreground",children:"First Contact Resolution"}),e.jsx("span",{children:"76%"}),e.jsx("span",{children:"71%"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx("span",{className:"text-muted-foreground",children:"Net Sentiment"}),e.jsx("span",{children:"+52"}),e.jsx("span",{children:"+47"})]})]})]})]}),e.jsxs("div",{className:"bg-gradient-to-br from-primary/10 to-primary/5 border-2 border-primary/20 rounded-xl p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Key Takeaways: Social Customer Service Excellence"}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Speed Wins:"})," <15 minute response times set you apart from 90% of competitors. Fast acknowledgment prevents escalation."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Empathy First:"})," Use the HEAR framework (Hear, Empathize, Act, Resolve) for consistent, human-centered responses."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrin
151k-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Public Stage Mindset:"})," Every response is marketing. Prospects watch how you treat customers before buying."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Automate Wisely:"})," Use chatbots for routine FAQs (70%), reserve human touch for complex/sensitive issues (30%)."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Own Mistakes:"}),` Never delete criticism, respond with accountability. "You're right, we messed up" builds trust.`]})]})]})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})]})})},Ty=()=>{const s=ns(),t=[{id:"ugc-power",text:"The Power of User-Generated Content",level:2},{id:"ugc-types",text:"Types of UGC Content",level:2},{id:"collection-strategies",text:"UGC Collection Strategies",level:2},{id:"campaigns",text:"Running UGC Campaigns",level:2},{id:"incentives",text:"Incentive Structures",level:2},{id:"rights-permissions",text:"Rights & Permissions",level:2},{id:"amplification",text:"Amplifying UGC",level:2}],a=[{title:"Influencer Partnerships",description:"Build strategic partnerships with creators and influencers to amplify your brand reach and credibility.",category:"Partnerships",readTime:"15 min read",path:"/academy/influencer-partnerships"},{title:"Social Proof Strategies",description:"Leverage testimonials, reviews, and social validation to build trust and drive conversions.",category:"Conversion",readTime:"14 min read",path:"/academy/social-proof-strategies"},{title:"Community Building Tactics",description:"Transform your social media presence into a thriving community that drives business growth.",category:"Community",readTime:"18 min read",path:"/academy/community-building-tactics"}];return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container max-w-7xl mx-auto px-4 py-8",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"mb-6 hover:bg-accent",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back to Academy"]}),e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("article",{className:"max-w-3xl",children:[e.jsx(it,{category:"Content Strategy",title:"User-Generated Content Strategy: Complete Guide for 2025",description:"Harness the power of customer content to build trust, reduce costs, and scale authentic marketing that drives real conversions.",author:{name:"Emily Rodriguez",role:"UGC Strategy Lead",avatar:"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=150",bio:"UGC Strategy Lead"},publishDate:"2025-01-20",readTime:"17 min read",featuredImage:"https://images.unsplash.com/photo-1611162618071-b39a2ec055fb?w=1200&h=600&fit=crop"}),e.jsxs("div",{className:"prose prose-slate max-w-none mt-12 space-y-8",children:[e.jsxs("section",{id:"ugc-power",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"The Power of User-Generated Content"}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-4 my-8",children:[e.jsx(Ze,{icon:tr,stat:"92% Trust",description:"Consumers trust UGC more than traditional branded content",source:"Stackla Consumer Report 2024"}),e.jsx(Ze,{icon:gs,stat:"5x Higher",description:"UGC converts 5x better than brand-created content",source:"Social Media Today"}),e.jsx(Ze,{icon:Ni,stat:"79% Say",description:"UGC highly impacts their purchasing decisions",source:"Nielsen Research"})]}),e.jsx("p",{className:"text-lg text-foreground/90 leading-relaxed",children:"User-Generated Content (UGC) is content created by customers, fans, or users about your brandâphotos, videos, reviews, testimonials, unboxings. It's the most authentic, cost-effective, and conversion-driving content type available in 2025."}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-8",children:[e.jsxs("h3",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[e.jsx(Bc,{className:"h-5 w-5 text-primary"}),"Why UGC Outperforms Branded Content"]}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Authenticity:"})," Real customers, real experiences. No scripted marketing speak or over-polished production."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Social Proof:"})," Seeing real people use/enjoy product reduces purchase anxiety and builds trust."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Relatability:"})," Customers see themselves in other users, making the product feel attainable."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Cost-Efficiency:"})," Content created for free or low cost vs expensive photoshoots/production."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Scalability:"})," Hundreds of customers creating content simultaneously = unlimited content library."]})]})]})]}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"The UGC Trust Factor"}),e.jsxs("div",{className:"bg-gradient-to-br from-primary/5 to-primary/10 border border-primary/20 rounded-lg p-6",children:[e.jsx("p",{className:"text-foreground
151/90 mb-4",children:"Modern consumers are marketing-savvy. They skip ads, ignore influencer sponsored posts, and distrust polished brand campaigns. But they pay attention to what other customers say."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 mt-6",children:[e.jsxs("div",{className:"bg-background/50 p-4 rounded",children:[e.jsx("p",{className:"font-semibold mb-2",children:"Before UGC Era:"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:`"This brand says their product is amazing. But they would say thatâthey're trying to sell it."`})]}),e.jsxs("div",{className:"bg-background/50 p-4 rounded border-2 border-primary/30",children:[e.jsx("p",{className:"font-semibold mb-2 text-primary",children:"With UGC:"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:`"100 real customers are showing how they use this product in real life. That's proof it actually works."`})]})]})]})]}),e.jsxs("section",{id:"ugc-types",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Types of UGC Content"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-6 bg-card/20",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("h3",{className:"text-xl font-semibold text-primary",children:"Photo UGC"}),e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-3 py-1 rounded-full",children:"Most Common"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Customers sharing product photos on Instagram, Facebook, Twitter. Easiest to collect at scale."}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"Best Use Cases:"}),e.jsxs("ul",{className:"text-sm space-y-1 text-muted-foreground",children:[e.jsx("li",{children:'⢠Website product galleries ("Real Customer Photos")'}),e.jsx("li",{children:"⢠Social media grid content"}),e.jsx("li",{children:"⢠Email marketing visuals"}),e.jsx("li",{children:"⢠Paid ad creative (with permission)"})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6 bg-card/20",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("h3",{className:"text-xl font-semibold text-primary",children:"Video UGC"}),e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-3 py-1 rounded-full",children:"Highest Converting"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Unboxings, tutorials, reviews, testimonials. More effort to create = more authentic and valuable."}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"Best Use Cases:"}),e.jsxs("ul",{className:"text-sm space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Product landing pages (above the fold video testimonials)"}),e.jsx("li",{children:"⢠TikTok/Reels native advertising"}),e.jsx("li",{children:"⢠Sales presentations & demos"}),e.jsx("li",{children:"⢠Case study content"})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6 bg-card/20",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("h3",{className:"text-xl font-semibold text-primary",children:"Review & Testimonial UGC"}),e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-3 py-1 rounded-full",children:"Trust Builder"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Written reviews, star ratings, detailed testimonials. Critical for SEO and conversion optimization."}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"Best Use Cases:"}),e.jsxs("ul",{className:"text-sm space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Product pages (social proof widgets)"}),e.jsx("li",{children:"⢠Google My Business (local SEO)"}),e.jsx("li",{children:"⢠Email nurture campaigns"}),e.jsx("li",{children:"⢠Sales enablement materials"})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6 bg-card/20",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("h3",{className:"text-xl font-semibold text-primary",children:"Social Media Mentions"}),e.jsx("span",{className:"text-xs bg-muted text-muted-foreground px-3 py-1 rounded-full",children:"Easy Collection"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Tags, shares, stories, tweets mentioning your brand. Organic advocacy from happy customers."}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"Best Use Cases:"}),e.jsxs("ul",{className:"text-sm space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Social media proof & reposting"}),e.jsx("li",{children:"⢠Influencer outreach validation"}),e.jsx("li",{children:"⢠PR & media kits"}),e.jsx("li",{children:"⢠Community highlight campaigns"})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6 bg-card/20",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("h3",{className:"text-xl font-semibold text-primary",children:"Blog Post & Long-Form UGC"}),e.jsx("span",{className:"text-xs bg-muted text-muted-foreground px-3 py-1 rounded-full",children:"SEO Value"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Customer blog posts, case studies, tutorials featuring your product. High SEO authority."}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"Best Use Cases:"}),e.jsxs("ul",{className:"text-sm space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Backlink building (SEO strategy)"}),e.jsx("li",{children:"⢠Guest content on brand blog"}),e.jsx("li",{children:"⢠Partner/affiliate marketing"}),e.jsx("li",{children:"⢠Thought leadership amplification"})]})]})]})]})]}),e.jsxs("section",{id:"collection-strategies",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"UGC Collection Strategies"}),e.jsx(ct,{company:"FitGear Athletic Wear",industry:"E-commerce / Fashion",challenge:"Marketing team spent $180K/year on product photography and model shoots. Content felt disconnected from real customers. Conversion rate stagnant at 1.8%.",solution:"Launched #FitGearRealLife UGC campaign: encouraged customers to
151share workout photos in FitGear products with branded hashtag. Offered 20% discount code for featured photos. Created dedicated UGC gallery on website. Repurposed best UGC for paid ads and email marketing.",results:["12,400+ customer photos collected in 6 months","Marketing content costs reduced 68% ($122K savings)","Website conversion rate increased from 1.8% to 4.2%","Product pages with UGC galleries converted 3.4x higher","93% of customers said UGC photos influenced purchase decision"],quote:"Switching from professional models to real customer photos was counterintuitive but transformative. Customers want to see themselves, not perfection.",author:"Sarah Chen, CMO"}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"7 Proven UGC Collection Methods"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"1. Branded Hashtag Campaigns"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Create a unique, memorable hashtag (e.g., #MyStarbucksOrder, #GoPro, #AirbnbExperiences). Promote across all channels."}),e.jsx("p",{className:"text-xs italic",children:"Pro Tip: Keep it short (3 words max), make it ownable, check it's not already in use."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"2. Post-Purchase Email Requests"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:'Send automated email 7-14 days after delivery: "Love your [product]? Share a photo and get 15% off your next order!"'}),e.jsx("p",{className:"text-xs italic",children:"Pro Tip: Include direct upload link, make it frictionless. One-click submission > multi-step processes."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"3. Social Media Contests"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:'Monthly UGC contests with prizes. "Share your best [product use case], winner gets $500 gift card + feature on our page."'}),e.jsx("p",{className:"text-xs italic",children:"Pro Tip: Prize should be brand-relevant (your products) to attract quality, not just volume."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"4. Product Packaging Inserts"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:'Physical card in every package: "Share your unboxing! Tag us @brand #hashtag for a chance to be featured."'}),e.jsx("p",{className:"text-xs italic",children:"Pro Tip: QR code linking to submission form = higher participation than just hashtag."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"5. Customer Spotlight Program"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:'"Customer of the Month" feature on website/social. Submit your story for a chance to be highlighted.'}),e.jsx("p",{className:"text-xs italic",children:"Pro Tip: Recognition + small reward (free product, discount) = authentic stories without feeling transactional."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"6. Review Request Campaigns"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Automated review requests via email, SMS, in-app prompts. Make leaving reviews/photos incredibly easy."}),e.jsx("p",{className:"text-xs italic",children:"Pro Tip: Use tools like Yotpo, Bazaarvoice, Trustpilot that allow photo/video upload with reviews."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"7. Influencer Seeding â UGC Pipeline"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Send products to micro-influencers (5-50K followers). Their content = creator UGC you can repurpose with permission."}),e.jsx("p",{className:"text-xs italic",children:"Pro Tip: Micro-influencer UGC often feels more authentic than mega-influencer content. Better for ads."})]})]})]}),e.jsxs("section",{id:"campaigns",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Running UGC Campaigns"}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"UGC Campaign Framework"}),e.jsx("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold",children:"1"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Define Clear Objective"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"What's the goal? Brand awareness? Product launch? Holiday sales? Social proof collection? Different goals = different campaign structures."})]})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold",children:"2"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Create Compelling Theme"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Generic "share your product photo" campaigns fail. Specific themes work: "Show us your home workspace setup" or "Unbox your first order reaction" or "Before & After transformation."'})]})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold",children:"3"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Make Participation Effortless"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Clear instructions, one hashtag, simple submission process. Every extra step = 40% drop-off in participation."})]})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold",children:"4"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Offer Meaningful Incentives"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Feature on brand channels (recognition), discounts, contest prizes, exclusive perks. Balance incentive with authenticity."})]})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold",children:"5"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Seed with Examples"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Post 5-10 examples of ideal submissions to set quality/tone expectations. Show, don't just tell."})]})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold",children:"6"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Engage & Feature Participants"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Like, comment, repost submissions immediately. Show that submissions are being seen and appreciated. This fuels more participation."})]})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold",children:"7"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Repurpose Strategically"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Best UGC becomes website content, paid ads, email campaigns, sales collateral. Maximize ROI from each piece."})]})]})]})}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"Successful UGC Campaign Examples"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border border-primary/20 rounded-lg p-6 bg-gradient-to-br from-primary/5 to-transparent",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/20 flex items-center justify-center",children:e.jsx(Ni,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold",children:"GoPro: #GoProAwards"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Adventure sports brand"})]})]}),e.jsx("p",{className:"text-sm mb-3",children:"Users submit their best GoPro footage for cash prizes ($1M+ distributed). Winners featured on GoPro channels. Essentially crowdsourced their entire marketing content library."}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-3 py-1 rounded-full",children:"5M+ submissions"}),e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-3 py-1 rounded-full",children:"98% UGC content strategy"})]})]}),e.jsxs("div",{className:"border border-primary/20 rounded-lg p-6 bg-gradient-to-br from-primary/5 to-transparent",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/20 flex items-center justify-center",children:e.jsx(Pa,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold",children:"Airbnb: #AirbnbExperiences"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Travel hospital
151ity"})]})]}),e.jsx("p",{className:"text-sm mb-3",children:"Guests share photos/stories from stays. Airbnb reposts best content, creating FOMO and social proof. User content shows real homes > perfect hotel stock photos."}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-3 py-1 rounded-full",children:"Authenticity over perfection"}),e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-3 py-1 rounded-full",children:"Massive brand trust"})]})]}),e.jsxs("div",{className:"border border-primary/20 rounded-lg p-6 bg-gradient-to-br from-primary/5 to-transparent",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/20 flex items-center justify-center",children:e.jsx(lr,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold",children:"Starbucks: #RedCupContest"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Food & beverage"})]})]}),e.jsx("p",{className:"text-sm mb-3",children:"Annual holiday campaign: share creative photos with red holiday cups. Prize: Starbucks gift card. Generated 40K+ submissions in first year, now iconic seasonal tradition."}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-3 py-1 rounded-full",children:"Seasonal engagement"}),e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-3 py-1 rounded-full",children:"Low cost, high volume"})]})]})]})]}),e.jsxs("section",{id:"incentives",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Incentive Structures That Work"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-xl font-semibold text-primary",children:"Non-Monetary Incentives"}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5 bg-card/20",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Feature & Recognition"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Most powerful motivator for many customers. Being featured on brand's Instagram = validation + exposure to their network."})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5 bg-card/20",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Early Access"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"New product previews, beta features, exclusive community membership for UGC contributors."})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5 bg-card/20",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Brand Swag"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Limited edition merchandise, branded items not for sale. Creates exclusivity and brand affinity."})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-xl font-semibold text-primary",children:"Monetary Incentives"}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5 bg-card/20",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Discounts & Credits"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"10-20% off next purchase for submitted UGC. Drives repeat purchases while collecting content."})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5 bg-card/20",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Contest Prizes"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Monthly winners get $100-500 prize. Creates lottery effectâmany submit for chance to win."})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5 bg-card/20",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Affiliate Commission"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Top UGC creators become affiliates earning % on sales driven by their content."})]})]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 mt-8",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4",children:"The Incentive Sweet Spot"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Incentive should be valuable enough to motivate but not so high it attracts low-quality submissions from people who don't actually use/love your product."}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"text-center p-4 bg-destructive/5 border border-destructive/20 rounded",children:[e.jsx("p",{className:"text-xs text-destructive font-semibold mb-2",children:"Too Low"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"5% discount = minimal effort from users"})]}),e.jsxs("div",{className:"text-center p-4 bg-primary/10 border-2 border-primary rounded",children:[e.jsx("p",{className:"text-xs text-primary font-semibold mb-2",children:"Sweet Spot â"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"15-20% discount or feature = quality submissions"})]}),e.jsxs("div",{className:"text-center p-4 bg-destructive/5 border border-destructive/20 rounded",children:[e.jsx("p",{className:"text-xs text-destructive font-semibold mb-2",children:"Too High"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"$500 prize = spam submissions from non-customers"})]})]})]})]}),e.jsxs("section",{id:"rights-permissions",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Rights & Permissions Management"}),e.jsx("div",{className:"bg-amber-500/10 border-2 border-amber-500/30 rounded-lg p-6 mb-8",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("div",{className:"w-10 h-10 rounded-full bg-amber-500/20 flex items-center justify-center",children:e.jsx(Ss,{className:"h-6 w-6 text-amber-600"})})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Legal Requirements: Non-Negotiable"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"You MUST have explicit permission to use customer content in your marketing. Simply tagging you doesn't grant usage rights. Always get consent."})]})]})}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"Permission Request Best Practices"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Method 1: Direct Message Request"}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"Template Message:"}),e.jsx("p",{className:"text-sm italic text-muted-foreground",children:`"Hi [Name]! We love your photo featuring [product]! ð Would you mind if we shared it on our Instagram page? We'll credit you and can offer [incentive] as a thank you!"`})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:'Wait for explicit "yes" before using content.'})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Method 2: Campaign Terms & Conditions"}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"Campaign Language:"}),e.jsx("p",{className:"text-sm italic text-muted-foreground",children:'"By using #YourBrandHashtag, you grant [Brand] permission to repost your content on our social media channels and website with credit. See full terms: [link]"'})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Make terms clearly visible in campaign rules."})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Method 3: Submission Form with Rights"}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"Upload Form Checkbox:"}),e.jsx("p",{className:"text-sm italic text-muted-foreground",children:'"â I grant [Brand] perpetual, royalty-free license to use my submitted content for marketing purposes across all channels. I confirm I own all rights to this content."'})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Required checkbox before form submission accepted."})]})]}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"What You Can/Can't Do with UGC"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"border border-primary/30 rounded-lg p-5 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-3 text-primary",children:"â Permitted Uses (With Permission)"}),e.jsxs("ul",{className:"text-sm space-y-2",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Reposting on social media with credit"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Featuring on website product pages"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Email marketing campaigns"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Paid advertising (social ads, PPC)"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Sales presentations & pitch decks"})]})]})]}),e.jsxs("div",{className:"border border-destructive/30 rounded-lg p-5 bg-destructive/5",children:[e.jsx("h4",{className:"font-semibold mb-3 text-destructive",children:"â Not Permitted (Even With Tag)"}),e.jsxs("ul",{className:"text-sm space-y-2",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Editing content to misrepresent product"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Using without attribution/credit"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Selling/licensing to third parties"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Using after explicit permission withdrawn"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Featuring minors without parental consent"})]})]})]})]})]}),e.jsxs("section",{id:"amplification",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Amplifying & Maximizing UGC"}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"Strategic UGC Placement"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Website Product Pages"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'UGC galleries near "Add to Cart" button = 3-5x conversion lift. Show real customers using product right at point of purchase decision.'})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Paid Social Ads"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"UGC-based ads outperform brand ads by 4-5x. Lower CPAs, higher trust, better engagement. Test multiple UGC creators for variety."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Email Campaigns"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'"Customer Spotlight" emails, review roundups, before/after transformations. UGC emails have 2x higher click rates than promotional emails.'})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Organic Social Feed"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Mix UGC with branded content (80/20 split). Keeps feed authentic, gives customers recognition, builds community."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Retargeting Campaigns"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:`Show cart abandoners UGC from happy customers. "Don't just take our wordâsee what customers say." Powerful social proof at critical moment.`})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Sales Enablement"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Equip sales team with UGC examples, testimonials, case studies. Real customer stories close deals better than pitch decks."})]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 mt-8",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4",children:"UGC Content Calendar Strategy"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Organize UGC into categories for consistent posting and easy repurposing."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"font-semibold text-sm w-32",children:"Monday:"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Customer Spotlight (story + photo)"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"font-semibold text-sm w-32",children:"Wednesday:"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Product in Action (UGC video/photo)"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"font-semibold text-sm w-32",children:"Friday:"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Review/Testimonial Highlight"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"font-semibold text-sm w-32",children:"Sunday:"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Weekly UGC Roundup (best submissions)"})]})]})]})]}),e.jsxs("div",{className:"bg-gradient-to-br from-primary/10 to-primary/5 border-2 border-primary/20 rounded-xl p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Key Takeaways: UGC Strategy Mastery"}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Authenticity Wins:"})," UGC converts 5x better than branded content because customers trust real people over polished ads."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Make It Easy:"})," Clear submission process + simple hashtag + meaningful incentive = high participation rates."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Get Permission Always:"})," Never use customer content without explicit consent. Direct message or campaign terms required."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Strategic Placement:"})," UGC on product pages, in paid ads, and email campaigns drives measurable conversion lift."]})]}),e.jsxs("li",{className:"flex items-start gap-3
151",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Recognition > Money:"})," Being featured on brand channels is often more motivating than discounts for quality creators."]})]})]})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})]})})},Ay=()=>{const s=ns(),t=[{id:"paid-social-landscape",text:"The Paid Social Landscape 2025",level:2},{id:"platform-selection",text:"Choosing the Right Platforms",level:2},{id:"campaign-structure",text:"Campaign Structure & Setup",level:2},{id:"targeting-strategies",text:"Advanced Targeting Strategies",level:2},{id:"creative-optimization",text:"Creative That Converts",level:2},{id:"budget-bidding",text:"Budget & Bidding Strategies",level:2},{id:"measurement",text:"Measurement & Optimization",level:2}],a=[{title:"Social Media ROI Measurement",description:"Track, measure, and prove the business impact of your social media investments with data-driven methodologies.",category:"Analytics",readTime:"16 min read",path:"/academy/social-media-roi-measurement"},{title:"Algorithm Optimization",description:"Master platform algorithms to maximize organic reach alongside your paid campaigns for compounding results.",category:"Strategy",readTime:"18 min read",path:"/academy/algorithm-optimization"},{title:"Content Marketing Automation",description:"Scale your content creation and distribution to support high-performing paid campaigns.",category:"Automation",readTime:"15 min read",path:"/academy/content-marketing-automation"}];return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container max-w-7xl mx-auto px-4 py-8",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"mb-6 hover:bg-accent",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back to Academy"]}),e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("article",{className:"max-w-3xl",children:[e.jsx(it,{category:"Paid Advertising",title:"Paid Social Advertising: Complete Performance Marketing Guide 2025",description:"Master paid social campaigns across all platforms. From targeting to creative to optimizationâdrive measurable ROI at scale.",author:{name:"David Martinez",role:"Performance Marketing Director",avatar:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=150",bio:"Performance Marketing Director"},publishDate:"2025-01-22",readTime:"20 min read",featuredImage:"https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=1200&h=600&fit=crop"}),e.jsxs("div",{className:"prose prose-slate max-w-none mt-12 space-y-8",children:[e.jsxs("section",{id:"paid-social-landscape",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"The Paid Social Landscape 2025"}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-4 my-8",children:[e.jsx(Ze,{icon:Ht,stat:"$207B",description:"Global social media ad spend in 2024, up 12% YoY",source:"eMarketer 2024"}),e.jsx(Ze,{icon:gs,stat:"3.2x ROI",description:"Average return on ad spend for optimized social campaigns",source:"Wordstream Benchmark Report"}),e.jsx(Ze,{icon:Es,stat:"89% Reach",description:"Brands using paid social to reach target audiences",source:"Social Media Examiner"})]}),e.jsx("p",{className:"text-lg text-foreground/90 leading-relaxed",children:"Paid social advertising has evolved from simple boosted posts to sophisticated performance marketing machines. With declining organic reach and advanced targeting capabilities, paid social is now essential for predictable, scalable growth."}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 my-8",children:[e.jsxs("h3",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[e.jsx(ws,{className:"h-5 w-5 text-primary"}),"Why Paid Social Outperforms Traditional Advertising"]}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Precision Targeting:"})," Reach specific demographics, interests, behaviors, and custom audiences with 95%+ accuracy"]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Real-Time Optimization:"})," Adjust campaigns instantly based on performance data, not waiting weeks for results"]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Budget Flexibility:"})," Start with $50/day or scale to $50K+/day with predictable cost-per-acquisition"]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Measurable Attribution:"})," Track every dollar spent to conversion, ROI visible in real-time dashboards"]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Retargeting Capabilities:"})," Re-engage website visitors, cart abandoners, email list with personalized messaging"]})]})]})]}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"2025 Paid Social Trends"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"border border-primary/20 rounded-lg p-5 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-3 text-primary",children:"Rising Trends"}),e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(gs,{className:"h-4 w-4 text-primary"}),e.jsxs("span",{children:[e.jsx("strong",{children:"AI-Powered Campaign Automation:"})," Meta Advantage+, Google Performance Max"]})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(gs,{className:"h-4 w-4 text-primary"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Video-First Creative:"})," 73% of ad spend shifting to video formats"]})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(gs,{className:"h-4 w-4 text-primary"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Influencer Whitelisting:"})," Ads from creator accounts, not brand accounts"]})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(gs,{className:"h-4 w-4 text-primary"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Privacy-First Targeting:"})," First-party data > third-party cookies"]}
151)]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Declining Tactics"}),e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:"Interest-based targeting (iOS14+ privacy changes)"})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:"Static image ads (lower engagement than video)"})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:"Single-platform strategies (omnichannel required)"})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:"Manual bid management (automated bidding wins)"})]})]})]})]})]}),e.jsxs("section",{id:"platform-selection",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Choosing the Right Platforms"}),e.jsx(ct,{company:"NutriBox Meal Delivery",industry:"E-commerce / Food",challenge:"Spent $45K/month across all social platforms with 1.2 ROAS (losing money). No clear understanding of which platforms drove actual customers vs clicks. Targeting broad audiences with generic creative.",solution:"Consolidated budget into Meta (Facebook/Instagram) and TikTok onlyâplatforms where ideal customers (health-conscious millennials) actually convert. Created platform-specific creative. Implemented proper conversion tracking with server-side events. Narrowed targeting to custom audiences (website visitors, email subscribers, lookalikes).",results:["ROAS improved from 1.2 to 4.7 in 90 days","Cost per acquisition dropped 67% ($78 to $26)","Monthly revenue from paid social: $98K to $312K","TikTok generated 52% of new customer acquisitions","Reduced monthly ad spend to $35K while 3x-ing revenue"],quote:"We were wasting money on platforms where our audience didn't convert. Focus beats coverage.",author:"Lisa Chang, Growth Lead"}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"Platform Selection Framework"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-6 bg-card/20",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("h3",{className:"text-xl font-semibold text-primary",children:"Meta Ads (Facebook & Instagram)"}),e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-3 py-1 rounded-full",children:"Best for: E-commerce, B2C, DTC"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Most mature advertising platform. 3 billion+ users, sophisticated targeting, proven conversion tracking."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2 text-sm",children:"Strengths"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Advanced lookalike modeling"}),e.jsx("li",{children:"⢠Catalog integration for dynamic ads"}),e.jsx("li",{children:"⢠Meta Pixel retargeting capabilities"}),e.jsx("li",{children:"⢠Lower CPMs than TikTok/LinkedIn"})]})]}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2 text-sm",children:"Best For"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Product sales (DTC brands)"}),e.jsx("li",{children:"⢠Lead generation (B2B & B2C)"}),e.jsx("li",{children:"⢠App installs & engagement"}),e.jsx("li",{children:"⢠Local business awareness"})]})]})]}),e.jsx("div",{className:"mt-4 bg-primary/5 p-3 rounded",children:e.jsx("p",{className:"text-xs font-medium",children:"Avg Performance: CPC $0.50-1.50 | CPM $8-15 | Conv Rate 2-5%"})})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6 bg-card/20",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("h3",{className:"text-xl font-semibold text-primary",children:"TikTok Ads"}),e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-3 py-1 rounded-full",children:"Best for: Gen Z/Millennials, Viral Products"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Highe
151st engagement rates, native video format, younger audience skew. Algorithm favors entertaining content over hard sells."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2 text-sm",children:"Strengths"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠3-5x higher engagement vs Meta"}),e.jsx("li",{children:"⢠Viral discovery algorithm boosts"}),e.jsx("li",{children:"⢠Spark Ads (boost organic posts)"}),e.jsx("li",{children:"⢠Creator Marketplace integration"})]})]}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2 text-sm",children:"Best For"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Product discovery & awareness"}),e.jsx("li",{children:"⢠Under-35 audience targeting"}),e.jsx("li",{children:"⢠Trendy/impulse purchase items"}),e.jsx("li",{children:"⢠Building brand personality"})]})]})]}),e.jsx("div",{className:"mt-4 bg-primary/5 p-3 rounded",children:e.jsx("p",{className:"text-xs font-medium",children:"Avg Performance: CPC $0.80-2.00 | CPM $6-12 | Conv Rate 1-3% (but higher AOV)"})})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6 bg-card/20",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("h3",{className:"text-xl font-semibold text-primary",children:"LinkedIn Ads"}),e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-3 py-1 rounded-full",children:"Best for: B2B, High-Value Services"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Most expensive platform but highest quality B2B leads. Decision-makers actively browse during work hours."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2 text-sm",children:"Strengths"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Job title/company targeting"}),e.jsx("li",{children:"⢠Professional intent mindset"}),e.jsx("li",{children:"⢠Lead gen forms pre-filled"}),e.jsx("li",{children:"⢠Account-based marketing (ABM)"})]})]}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2 text-sm",children:"Best For"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠SaaS & enterprise software"}),e.jsx("li",{children:"⢠Professional services (consulting)"}),e.jsx("li",{children:"⢠High-ticket B2B products"}),e.jsx("li",{children:"⢠Recruitment campaigns"})]})]})]}),e.jsx("div",{className:"mt-4 bg-primary/5 p-3 rounded",children:e.jsx("p",{className:"text-xs font-medium",children:"Avg Performance: CPC $5-12 | CPM $30-80 | Conv Rate 2-6% (qualified leads)"})})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6 bg-card/20",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("h3",{className:"text-xl font-semibold text-primary",children:"X (Twitter) Ads"}),e.jsx("span",{className:"text-xs bg-muted text-muted-foreground px-3 py-1 rounded-full",children:"Best for: News, Tech, Real-Time Events"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Conversation-driven platform. Great for timely campaigns, thought leadership, and tech-savvy audiences."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2 text-sm",children:"Strengths"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Trend-jacking opportunities"}),e.jsx("li",{children:"⢠Tech/crypto audience concentration"}),e.jsx("li",{children:"⢠High engagement from influencers"}),e.jsx("li",{children:"⢠Keyword targeting in tweets"})]})]}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("h4",{className:"font-semibold mb-2 text-sm",children:"Best For"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Tech product launches"}),e.jsx("li",{children:"⢠News/media organizations"}),e.jsx("li",{children:"⢠Event promotion"}),e.jsx("li",{children:"⢠Thought leadership content"})]})]})]}),e.jsx("div",{className:"mt-4 bg-primary/5 p-3 rounded",children:e.jsx("p",{className:"text-xs font-medium",children:"Avg Performance: CPC $0.50-2.00 | CPM $6-10 | Conv Rate 1-2%"})})]})]}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6 mt-8",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Platform Selection Decision Tree"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold text-sm",children:"1"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold mb-1",children:"Start with audie
151nce demographics"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Where does your ICP spend time? 25-45 = Meta. Under 30 = TikTok. B2B = LinkedIn."})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold text-sm",children:"2"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold mb-1",children:"Consider product type & AOV"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Low AOV impulse (<$100) = TikTok/Meta. High-value B2B (>$5K) = LinkedIn. E-commerce = Meta first."})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold text-sm",children:"3"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold mb-1",children:"Test with 20% of budget across 2-3 platforms"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Run for 30 days minimum. Compare CPA, ROAS, LTV. Double down on winner, cut losers."})]})]})]})]})]}),e.jsxs("section",{id:"campaign-structure",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Campaign Structure & Setup"}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"The Campaign Hierarchy"}),e.jsx("div",{className:"bg-gradient-to-br from-primary/5 to-primary/10 border border-primary/20 rounded-lg p-6",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/20 flex items-center justify-center",children:e.jsx("span",{className:"font-bold text-primary",children:"1"})}),e.jsx("h4",{className:"font-semibold text-lg",children:"Campaign Level"})]}),e.jsx("p",{className:"text-sm text-muted-foreground ml-13",children:"Objective selection (conversions, traffic, awareness). Budget allocation. Overall strategy definition."}),e.jsxs("div",{className:"mt-2 ml-13 text-xs bg-card/50 p-3 rounded",children:[e.jsx("strong",{children:"Example:"}),' "Q1 Product Launch - Conversions Campaign" with $10K monthly budget']})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/20 flex items-center justify-center",children:e.jsx("span",{className:"font-bold text-primary",children:"2"})}),e.jsx("h4",{className:"font-semibold text-lg",children:"Ad Set Level"})]}),e.jsx("p",{className:"text-sm text-muted-foreground ml-13",children:"Audience targeting, placement selection, bidding strategy, schedule, budget distribution."}),e.jsxs("div",{className:"mt-2 ml-13 text-xs bg-card/50 p-3 rounded",children:[e.jsx("strong",{children:"Example:"}),' 3 ad sets - "Warm Audience (Retargeting)", "Cold Audience (Lookalike)", "Interest-Based Prospecting"']})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/20 flex items-center justify-center",children:e.jsx("span",{className:"font-bold text-primary",children:"3"})}),e.jsx("h4",{className:"font-semibold text-lg",children:"Ad Level"})]}),e.jsx("p",{className:"text-sm text-muted-foreground ml-13",children:"Creative assets (images, videos, copy), CTA buttons, landing page URL, tracking parameters."}),e.jsxs("div",{className:"mt-2 ml-13 text-xs bg-card/50 p-3 rounded",children:[e.jsx("strong",{children:"Example:"})," 5 ads per ad set - testing different headlines, visuals, offers"]})]})]})}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"Campaign Structure Best Practices"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Separate Warm vs Cold Traffic"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Never mix retargeting audiences with cold prospecting in same ad set. Different messaging, different c
151onversion rates, skews data."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Test 3-5 Creatives Per Ad Set"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Give algorithm options to optimize toward best performer. More than 5 splits budget too thin. Less than 3 = not enough data."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Use Campaign Budget Optimization (CBO)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Let platform allocate budget across ad sets automatically. Outperforms manual allocation by 15-30% on average."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-5 py-3 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Start Broad, Then Narrow"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Let AI learning phase (50 conversions) find your audience before manual constraints. Over-targeting limits delivery."})]})]})]}),e.jsxs("section",{id:"targeting-strategies",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Advanced Targeting Strategies"}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"The Targeting Funnel"}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-6 bg-card/20",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/20 flex items-center justify-center mb-4",children:e.jsx(ks,{className:"h-6 w-6 text-primary"})}),e.jsx("h4",{className:"font-semibold mb-3",children:"Top of Funnel (TOF)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Cold audiences. Awareness & education focus."}),e.jsxs("ul",{className:"text-xs space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Broad Targeting:"})," Demographics + interests"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Lookalike Audiences:"})," 1-3% of customer list"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Competitor Targeting:"})," Interest in rival brands"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Content Engagers:"})," People who watch your videos"]})]}),e.jsx("div",{className:"mt-4 pt-4 border-t border-border/50",children:e.jsx("p",{className:"text-xs font-medium",children:"Goal: 1-2% CTR, build retargeting pool"})})]}),e.jsxs("div",{className:"border border-primary/30 rounded-lg p-6 bg-gradient-to-br from-primary/10 to-primary/5",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/30 flex items-center justify-center mb-4",children:e.jsx(Es,{className:"h-6 w-6 text-primary"})}),e.jsx("h4",{className:"font-semibold mb-3",children:"Middle of Funnel (MOF)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Warm audiences. Consideration & intent."}),e.jsxs("ul",{className:"text-xs space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Website Visitors:"})," Last 30-90 days"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Video Viewers:"})," 50%+ completion"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Engagement Custom Audiences:"})," Post interactions"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Email Subscribers:"})," Uploaded customer lists"]})]}),e.jsx("div",{className:"mt-4 pt-4 border-t border-primary/20",children:e.jsx("p",{className:"text-xs font-medium",children:"Goal: 3-5% CTR, nurture to purchase"})})]}),e.jsxs("div",{className:"border border-primary/30 rounded-lg p-6 bg-gradient-to-br from-primary/20 to-primary/10",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/40 flex items-center justify-center mb-4",children:e.jsx(uu,{className:"h-6 w-6 text-primary"})}),e.jsx("h4",{className:"font-semibold mb-3",children:"Bottom of Funnel (BOF)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Hot audiences. Conversion focus."}),e.jsxs("ul",{className:"text-xs space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Cart Abandoners:"})," Added to cart, didn't buy"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Product Page Viewers:"})," Last 7-14 days"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Checkout Initiators:"})," Started but didn't complete"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Past Purchasers:"})," Cross-sell/upsell campaigns"]})]}),e.jsx("div",{className:"mt-4 pt-4 border-primary/30",children:e.jsx("p",{className:"text-xs font-medium",children:"Goal: 10-25% conversion rate, maximize ROAS"})})]})]}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"High-Performance Targeting Tactics"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Lookalike Audience Stacking"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create multiple seed audiences, test which generates best lookalikes."}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("p",{className:"text-xs font-medium mb-2",children:"Example Stack:"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠1% Lookalike of top 10% customers (by LTV)"}),e.jsx("li",{children:"⢠2% Lookalike of all purchasers last 90 days"}),e.jsx("li",{children:"⢠3-5% Lookalike of email subscribers"}),e.jsx("li",{children:"⢠1% Lookalike of high-intent page visitors (pricing, demo)"})]}),e.jsx("p",{className:"text-xs mt-3 italic",children:"Test each in separate ad sets. Scale winner, pause losers after 7-14 days."})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Dynamic Product Retargeting"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Show users exact products they viewed. 3-5x conversion lift vs generic retargeting."}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("p",{className:"text-xs font-medium mb-2",children:"Setup Requirements:"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Product catalog uploaded to platform"}),e.jsx("li",{children:"⢠Pixel tracking ViewContent events with product IDs"}),e.jsx("li",{children:"⢠Dynamic template ads with product feed"}),e.jsx("li",{children:"⢠Exclusion: people who already purchased those items"})]}),e.jsx("p",{className:"text-xs mt-3 italic",children:"Platforms: Meta, TikTok, Pinterest support dynamic product ads."})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Sequential Retargeting Campaigns"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Different messages based on customer journey stage. Not one-size-fits-all."}),e.jsxs("div",{className:"bg-card/30 p-4 rounded",children:[e.jsx("p",{className:"text-xs font-medium mb-2",children:"Sequence Example:"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-xs",children:[e.jsx("strong",{children:"Days 0-3:"}),` "Noticed you checked out [Product]! Here's 10% off to complete your order."`]}
151),e.jsxs("div",{className:"text-xs",children:[e.jsx("strong",{children:"Days 4-7:"})," Social proof ad showing customer reviews + testimonials"]}),e.jsxs("div",{className:"text-xs",children:[e.jsx("strong",{children:"Days 8-14:"}),' Scarcity/urgency ad "Only 3 left in stock" or limited-time offer']}),e.jsxs("div",{className:"text-xs",children:[e.jsx("strong",{children:"Days 15+:"})," Educational content or new product suggestions"]})]})]})]})]})]}),e.jsxs("section",{id:"creative-optimization",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Creative That Converts"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 my-8",children:[e.jsx(Ze,{icon:gs,stat:"75% Impact",description:"Creative accounts for 75% of campaign performance (targeting only 25%)",source:"Meta Creative Shop Research"}),e.jsx(Ze,{icon:cr,stat:"6-8 Weeks",description:"Average creative fatigue timeline before refresh needed",source:"AdEspresso Benchmark Study"})]}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"High-Converting Creative Elements"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border border-primary/20 rounded-lg p-6 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Hook in First 3 Seconds (Video)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"85% of users scroll past within 3 seconds. Pattern interrupt essential."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold mb-2 text-primary",children:"â Strong Hooks"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Surprising visual (unexpected action)"}),e.jsx("li",{children:"⢠Bold text overlay with stat/claim"}),e.jsx("li",{children:"⢠Question that creates curiosity"}),e.jsx("li",{children:"⢠Before/after transformation tease"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold mb-2 text-destructive",children:"â Weak Hooks"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Slow product pan/beauty shot"}),e.jsx("li",{children:"⢠Logo animation intro"}),e.jsx("li",{children:`⢠Generic "Hi, I'm..."`}),e.jsx("li",{children:"⢠Setup without payoff promise"})]})]})]})]}),e.jsxs("div",{className:"border border-primary/20 rounded-lg p-6 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"UGC-Style Over Polished Production"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Authentic, phone-shot content outperforms studio production by 2-3x on most platforms."}),e.jsxs("div",{className:"bg-card/50 p-4 rounded",children:[e.jsx("p",{className:"text-xs font-medium mb-2",children:"Why UGC Ads Work:"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:'⢠Blends with organic content (less "ad-like")'}),e.jsx("li",{children:"⢠Trust signal from real person vs brand"}),e.jsx("li",{children:"⢠Platform algorithms favor native-looking content"}),e.jsx("li",{children:"⢠Lower production costs = faster iteration"})]})]})]}),e.jsxs("div",{className:"border border-primary/20 rounded-lg p-6 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Benefits-First Copywriting"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Lead with transformation outcome, not product features."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-destructive/10 border border-destructive/30 p-3 rounded",children:[e.jsx("p",{className:"text-xs font-semibold mb-2",children:"â Feature-First (Weak)"}),e.jsx("p",{className:"text-xs italic",children:'"Our CRM has 200+ integrations, advanced reporting, and AI-powered insights."'})]}),e.jsxs("div",{className:"bg-primary/10 border border-primary/30 p-3 rounded",children:[e.jsx("p",{className:"text-xs font-semibold mb-2",children:"â Benefit-First (Strong)"}),e.jsx("p",{className:"text-xs italic",children:'"Close 40% more deals with the CRM that actually helps you sell, not just track data."'})]})]})]}),e.jsxs("div",{className:"border border-primary/20 rounded-lg p-6 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Social Proof Integration"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Numbers, testimonials, logos build instant credibility."}),e.jsxs("div",{className:"bg-card/50 p-4 rounded",children:[e.jsx("p",{className:"text-xs font-medium mb-2",children:"Effective Social Proof Elements:"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:'⢠"10,000+ customers" or "4.8â
from 2,400 reviews"'}),e.jsx("li",{children:"⢠Customer quote overlaid on video"}),e.jsx("li",{children:'⢠Brand logos "As seen in" or "Trusted by"'}),e.jsx("li",{children:"⢠Before/after results with real customer name"})]})]})]}),e.jsxs("div",{className:"border border-primary/20 rounded-lg p-6 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Clear, Urgent Call-to-Action"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Specific action + reason to act now = higher conversion."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-card/50 p-3 rounded",children:[e.jsx("p",{className:"text-xs font-semibold mb-2",children:"Generic CTAs (Weak)"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:'⢠"Learn More"'}),e.jsx("li",{children:'⢠"Get Started"'}),e.jsx("li",{children:'⢠"Sign Up"'})]})]}),e.jsxs("div",{className:"bg-primary/10 p-3 rounded",children:[e.jsx("p",{className:"text-xs font-semibold mb-2",children:"Specific CTAs (Strong)"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:'⢠"Claim Your 30% Discount Today"'}),e.jsx("li",{children:'⢠"Start Free 14-Day Trial (No CC)"'}),e.jsx("li",{children:'⢠"See How [Outcome] in 5 Minutes"'})]})]})]})]})]}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"Creative Testing Framework"}),e.jsxs("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Test one variable at a time to isolate what drives performance improvement."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"font-semibold text-sm w-32",children:"Week 1-2:"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Test 3-4 different hooks (same body, same CTA)"})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"font-semibold text-sm w-32",children:"Week 3-4:"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Test 3 headline variations (winning hook, same body, same CTA)"})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"font-semibold text-sm w-32",children:"Week 5-6:"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Test 3 CTA variations (winning hook + headline, same body)"})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"font-semibold text-sm w-32",children:"Week 7+:"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:'Combine winners = "champion creative" then repeat process'})]})]})]})]}),e.jsxs("section",{id:"budget-bidding",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Budget & Bidding Strategies"}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"Budget Allocation Framework"}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6 bg-card/20",children:[e.jsx("h4",{className:"font-semibold mb-4",children:"The 70-20-10 Rule"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"flex-shrink-0 w-16 h-16 rounded-lg bg-primary/20 flex items-center justify-center",children:e.jsx("span",{className:"text-2xl font-bold text-primary",children:"70%"})}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-semibold mb-1",children:"Proven Winners"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Scale what's already working. Campaigns with proven ROAS > 3x. Maximize return from validated strategies."})]})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"flex-shrink-0 w-16 h-16 rounded-lg bg-primary/20 flex items-center justify-center",children:e.jsx("span",{className:"text-2xl font-bold text-primary",children:"20%"})}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-semibold mb-1",children:"Optimization & Testing"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Test new audiences, creative variations, landing pages. Iterate on existing campaigns to beat control."})]})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"flex-shrink-0 w-16 h-16 rounded-lg bg-primary/20 flex items-center justify-center",children:e.jsx("span",{className:"text-2xl font-bold text-primary",children:"10%"})}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-semibold mb-1",children:"Experimental/New Channels"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Test completely new platforms, formats, strategies. High-risk, high-reward innovation budget."})]})]})]})]}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"Bidding Strategy Selection"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Lowest Cost (Automated Bidding)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Platform gets cheapest conversions within budget. Best for most advertisers."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-primary/5 p-3 rounded",children:[e.jsx("p",{className:"text-xs font-semibold mb-2",children:"When to Use"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Large budget (>$1K/day)"}),e.jsx("li",{children:"⢠Volume-focused goals"}),e.jsx("li",{children:"⢠Learning phase (first 50 conversions)"}),e.jsx("li",{children:"⢠Trust platform AI optimization"})]})]}),e.jsxs("div",{className:"bg-card/30 p-3 rounded",children:[e.jsx("p",{className:"text-xs font-semibold mb-2",children:"Results"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Typically beats manual by 15-25%"}),e.jsx("li",{children:"⢠Fluctuating daily CPA (evens out)"}),e.jsx("li",{children:"⢠Requires conversion data to optimize"})]})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Target CPA / Target ROAS"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Tell platform exact efficiency target. Optimization focused on hitting that number."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-primary/5 p-3 rounded",children:[e.jsx("p",{className:"text-xs font-semibold mb-2",children:"When to Use"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Strict profitability constraints"}),e.jsx("li",{children:"⢠Campaigns with 50+ conversions/week"}),e.jsx("li",{children:"⢠Stable conversion tracking data"}),e.jsx("li",{children:"⢠Need predictable CAC"})]})]}),e.jsxs("div",{className:"bg-card/30 p-3 rounded",children:[e.jsx("p",{className:"text-xs font-semibold mb-2",children:"Results"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Lower volume than lowest cost"}),e.jsx("li",{children:"⢠More consistent CPA/ROAS"}),e.jsx("li",{children:"⢠May limit exploration/testing"})]})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-6",children:[e.jsx("h4",{className:"font-semibold mb-3",children:"Bid Cap (Manual Bidding)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Set maximum bid you'll pay. Full control but requires expertise and monitoring."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-primary/5 p-3 rounded",children:[e.jsx("p",{className:"text-xs font-semibold mb-2",children:"When to Use"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Experienced advertisers only"}),e.jsx("li",{children:"⢠Highly competitive auctions"}),e.jsx("li",{children:"⢠Need absolute cost control"}),e.jsx("li",{children:"⢠Platform algo underperforming"})]})]}),e.jsxs("div",{className:"bg-card/30 p-3 rounded",children:[e.jsx("p",{className:"text-xs font-semibold mb-2",children:"Results"}),e.jsxs("ul",{className:"text-xs space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"⢠Lowest volume (bid too low = no delivery)"}),e.jsx("li",{children:"⢠Can beat automated if optimized well"}),e.jsx("li",{children:"⢠Requires daily monitoring/adjustment"})]})]})]})]})]}),e.jsx("div",{className:"bg-amber-500/10 border-2 border-amber-500/30 rounded-lg p-6 mt-8",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(Ss,{className:"h-6 w-6 text-amber-600 flex-shrink-0 mt-1"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Budget Pacing Warning"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:`Platforms "pace" budget delivery. If you set $1000 daily budget and get 200 conversions at $5 CPA, you've only spent $1000âbut platform may throttle delivery thinking you hit limit.`}),e.jsx("p",{className:"text-sm font-medium",children:"Solution: Use campaign-level lifetime budgets or bid caps to force aggressive delivery when you have conversion capacity."})]})]})})]}),e.jsxs("section",{id:"measurement",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Measurement & Optimization"}),e.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"Key Performance Metrics"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"ROAS (Return on Ad Spend)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Revenue
151÷ Ad Spend. Primary profitability metric."}),e.jsxs("div",{className:"bg-primary/5 p-3 rounded",children:[e.jsx("p",{className:"text-xs font-medium mb-2",children:"Benchmarks:"}),e.jsxs("ul",{className:"text-xs space-y-1",children:[e.jsx("li",{children:"⢠<2.0 = Losing money (typical for new campaigns)"}),e.jsx("li",{children:"⢠2-3 = Break-even to slight profit"}),e.jsx("li",{children:"⢠3-5 = Good performance"}),e.jsx("li",{children:"⢠5+ = Excellent, scale aggressively"})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"CPA (Cost Per Acquisition)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Ad Spend ÷ Conversions. Efficiency metric."}),e.jsxs("div",{className:"bg-primary/5 p-3 rounded",children:[e.jsx("p",{className:"text-xs font-medium mb-2",children:"Calculate Target CPA:"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"If LTV = $300 and target profit margin = 60%, max CPA = $120 ($300 à 0.40)"})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"CTR (Click-Through Rate)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Clicks ÷ Impressions. Creative effectiveness."}),e.jsxs("div",{className:"bg-primary/5 p-3 rounded",children:[e.jsx("p",{className:"text-xs font-medium mb-2",children:"Platform Benchmarks:"}),e.jsxs("ul",{className:"text-xs space-y-1",children:[e.jsx("li",{children:"⢠Facebook/Instagram: 0.9-1.5% average"}),e.jsx("li",{children:"⢠LinkedIn: 0.4-0.8%"}),e.jsx("li",{children:"⢠TikTok: 1.5-2.5%"}),e.jsx("li",{children:"⢠Below benchmark = creative fatigue"})]})]})]}),e.jsxs("div",{className:"border border-border/50 rounded-lg p-5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Conversion Rate"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Conversions ÷ Clicks. Landing page quality."}),e.jsxs("div",{className:"bg-primary/5 p-3 rounded",children:[e.jsx("p",{className:"text-xs font-medium mb-2",children:"Industry Averages:"}),e.jsxs("ul",{className:"text-xs space-y-1",children:[e.jsx("li",{children:"⢠E-commerce: 2-4%"}),e.jsx("li",{children:"⢠Lead gen: 5-10%"}),e.jsx("li",{children:"⢠SaaS: 3-7%"}),e.jsx("li",{children:"⢠High > average = good offer/targeting match"})]})]})]})]})]}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"Weekly Optimization Checklist"}),e.jsx("div",{className:"bg-card/30 border border-border/50 rounded-lg p-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Review performance by ad set - pause any with CPA >1.5x target for 7+ days"})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Check frequency cap - if >3 per user per week, audience too narrow or creative fatigued"})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Launch 2-3 new creative variations to combat fatigue (refresh every 4-6 weeks)"})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Scale winning ad sets by 20% budget increase (avoid shocking algo with 2x jumps)"})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Expand lookalike audiences to next tier (1% â 2% â 3%) once current saturates"})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Review landing page conversion rate - if <industry avg, fix page before increasing spend"})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Audit conversion tracking - test purchase flow to confirm pixel/API firing correctly"})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-sm",children:"Update retargeting exclusions - remove recent converters from retargeting pools"})]})]})}),e.jsx("h3",{className:"text-2xl font-semibold mt-8 mb-4",children:"When to Scale vs Kill Campaigns"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"border border-primary/30 rounded-lg p-6 bg-primary/5",children:[e.jsx("h4",{className:"font-semibold mb-4 text-primary",children:"â Scale These C
151ampaigns"}),e.jsxs("ul",{className:"space-y-3 text-sm",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"ROAS consistently >4x for 14+ days"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"CPA below target with room to grow"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Audience size >500K with <2 frequency"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"CTR > platform benchmark"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Stable performance (not one lucky day)"})]})]})]}),e.jsxs("div",{className:"border border-destructive/30 rounded-lg p-6 bg-destructive/5",children:[e.jsx("h4",{className:"font-semibold mb-4 text-destructive",children:"â Pause These Campaigns"}),e.jsxs("ul",{className:"space-y-3 text-sm",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"CPA >2x target for 7+ consecutive days"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"ROAS <1.5 after learning phase (50 conversions)"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Frequency >4 with declining performance"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Zero conversions after $200-500 spend"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ss,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"CTR dropping 50%+ week-over-week"})]})]})]})]})]}),e.jsxs("div",{className:"bg-gradient-to-br from-primary/10 to-primary/5 border-2 border-primary/20 rounded-xl p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Key Takeaways: Paid Social Mastery"}),e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Platform Selection Matters:"})," Test 2-3 platforms, double down on winner. Meta for e-comm, TikTok for viral, LinkedIn for B2B."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Creative = 75% of Success:"})," UGC-style content, strong hooks, benefit-first copy. Refresh every 6-8 weeks."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Funnel-Based Targeting:"})," Separate cold, warm, hot audiences with tailored messaging for each stage."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Trust Automated Bidding:"})," Lowest cost bidding beats manual 80% of the time. Let AI optimize."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ve,{className:"h-6 w-6 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"70-20-10 Budget Rule:"})," 70% on proven winners, 20% on optimization, 10% on experimentation."]})]})]})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})]})})},Iy=()=>{const s=ns();return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(Vt,{title:"Social Media Analytics: Metrics That Actually Matter | deSHâ¦",description:"Focus on the KPIs that drive business results, not vanity metrics that look good but mean nothing.",path:"/academy/social-media-analytics",type:"article",jsonLd:{"@context":"https://schema.org","@type":"Article",headline:"Social Media Analytics: Metrics That Actually Matter",description:"Focus on the KPIs that drive business results, not vanity metrics that look good but mean nothing.",author:{"@type":"Organization",name:"deSHILLER"},publisher:{"@type":"Organization",name:"deSHILLER",logo:{"@type":"ImageObject",url:"https://deshiller.com/favicon.png"}},mainEntityOfPage:"https://deshiller.com/academy/social-media-analytics"}}),e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back"]})]})})}),e.jsxs("article",{className:"max-w-4xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:[e.jsxs("div",{className:"space-y-6 mb-12",children:[e.jsx("span",{className:"text-primary font-medium px-3 py-1 bg-primary/10 rounded-full text-sm",children:"Analytics"}),e.jsx("h1",{className:"text-5xl font-display font-semibold leading-tight",children:"Social Media Analytics: Metrics That Actually Matter"}),e.jsx("p",{className:"text-xl text-muted-foreground",children:"Focus on the KPIs that drive business results, not vanity metrics that look good but mean nothing."})]}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-8",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Vanity Metrics vs. Business Metrics"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Follower count, total likes, and impressions are vanity metricsâthey feel good but don't correlate with revenue. Business metrics include engagement rate, click-through rate, conversion rate, cost per acquisition, and customer lifetime value. Measure what impacts the bottom line, not what inflates ego."}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Building Your Analytics Dashboard"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Track weekly and monthly: engagement rate by platform, traffic from social to website, leads generated, revenue attributed, and audience growth rate. Set benchmarks, monitor trends, and focus on improvement over time rather than absolute numbers. What matters is trajectoryâare you getting better each month?"}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Track Performance Automatically"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Get comprehensive engagement analytics across all platforms with DESHILLER's unified dashboard."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"View Analytics"})]})]})]}),e.jsx(_s,{})]})},Ly=()=>{const s=ns();return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(Vt,{title:"Influencer Partnership Guide: From Outreach to ROI | deSHILâ¦",description:"Build mutually beneficial influencer relationships that deliver measurable results through strategic partnership management.",path:"/academy/influencer-partnerships",type:"article",jsonLd:{"@context":"https://schema.org","@type":"Article",headline:"Influencer Partnership Guide: From Outreach to ROI",description:"Build mutually beneficial influencer relationships that deliver measurable results through strategic partnership management.",author:{"@type":"Organization",name:"deSHILLER"},publisher:{"@type":"Organization",name:"deSHILLER",logo:{"@type":"ImageObject",url:"https://deshiller.com/favicon.png"}},mainEntityOfPage:"https://deshiller.com/academy/influencer-partnerships"}}),e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back"]})]})})}),e.jsxs("article",{className:"max-w-4xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:[e.jsxs("div",{className:"space-y-6 mb-12",children:[e.jsx("span",{className:"text-primary font-medium px-3 py-1 bg-primary/10 rounded-full text-sm",children:"Partnerships"}),e.jsx("h1",{className:"text-5xl font-display font-semibold leading-tight",children:"Influencer Partnership Guide: From Outreach to ROI"}),e.jsx("p",{className:"text-xl text-muted-foreground",children:"Build mutually beneficial influencer relationships that deliver measurable results through strategic partnership management."})]}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-8",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Choosing the Right Influencers"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Follower count matters less than audience alignment. A micro-influencer with 10K highly engaged followers in your niche outperforms a celebrity with 1M disengaged followers. Evaluate engagement rate, audience demographics, content quality, brand alignment, and previous partnership performance. Quality over quantity always wins."}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Structuring Win-Win Partnerships"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Best partnerships provide value to both parties. Offer fair compensation (monetary or product), creative freedom within brand guidelines, long-term relationship potential, and authentic belief in mutual benefit. One-off transactional relationships feel forced. Ongoing partnerships build genuine advocacy that audiences trust."}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Discover Partnership Opp
151ortunities"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Find influencers already discussing topics relevant to your product and build relationships organically."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Find Influencers"})]})]})]}),e.jsx(_s,{})]})},zy=()=>{const s=ns();return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(Vt,{title:"Developing a Distinctive Brand Voice on Social Media | deSHâ¦",description:"Create a consistent, recognizable voice that resonates with your target audience and differentiates you from competitors.",path:"/academy/brand-voice-development",type:"article",jsonLd:{"@context":"https://schema.org","@type":"Article",headline:"Developing a Distinctive Brand Voice on Social Media",description:"Create a consistent, recognizable voice that resonates with your target audience and differentiates you from competitors.",author:{"@type":"Organization",name:"deSHILLER"},publisher:{"@type":"Organization",name:"deSHILLER",logo:{"@type":"ImageObject",url:"https://deshiller.com/favicon.png"}},mainEntityOfPage:"https://deshiller.com/academy/brand-voice-development"}}),e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back"]})]})})}),e.jsxs("article",{className:"max-w-4xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:[e.jsxs("div",{className:"space-y-6 mb-12",children:[e.jsx("span",{className:"text-primary font-medium px-3 py-1 bg-primary/10 rounded-full text-sm",children:"Branding"}),e.jsx("h1",{className:"text-5xl font-display font-semibold leading-tight",children:"Developing a Distinctive Brand Voice on Social Media"}),e.jsx("p",{className:"text-xl text-muted-foreground",children:"Create a consistent, recognizable voice that resonates with your target audience and differentiates you from competitors."})]}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-8",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"What is Brand Voice?"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Brand voice is your personality expressed through words. It's how y
151ou say things, not just what you say. Mailchimp is witty and approachable. IBM is authoritative and professional. Dollar Shave Club is irreverent and humorous. Your voice should reflect your values and resonate with your ideal customer's communication style."}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Documenting Your Voice Guidelines"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Create a brand voice chart defining your personality traits (professional vs. casual, serious vs. humorous, formal vs. conversational), example phrases, words to use and avoid, and platform-specific adaptations. This ensures consistency whether the CEO, marketing manager, or freelancer is posting. Everyone sounds like the same brand."}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Maintain Consistent Brand Voice"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Train AI on your brand voice and generate on-brand replies automatically across all platforms with DESHILLER."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Try It Free"})]})]})]}),e.jsx(_s,{})]})},Ey=()=>{const s=ns();return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(Vt,{title:"Social Media Audit Checklist: Optimize Your Presence | deSHâ¦",description:"Conduct a comprehensive audit to identify opportunities and fix weaknesses across your social media channels.",path:"/academy/social-media-audit",type:"article",jsonLd:{"@context":"https://schema.org","@type":"Article",headline:"Social Media Audit Checklist: Optimize Your Presence",description:"Conduct a comprehensive audit to identify opportunities and fix weaknesses across your social media channels.",author:{"@type":"Organization",name:"deSHILLER"},publisher:{"@type":"Organization",name:"deSHILLER",logo:{"@type":"ImageObject",url:"https://deshiller.com/favicon.png"}},mainEntityOfPage:"https://deshiller.com/academy/social-media-audit"}}),e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back"]})]})})}),e.jsxs("article",{className:"max-w-4xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:[e.jsxs("div",{className:"space-y-6 mb-12",children:[e.jsx("span",{className:"text-primary font-medium px-3 py-1 bg-primary/10 rounded-full text-sm",children:"Strategy"}),e.jsx("h1",{className:"text-5xl font-display font-semibold leading-tight",children:"Social Media Audit Checklist: Optimize Your Presence"}),e.jsx("p",{className:"text-xl text-muted-foreground",children:"Conduct a comprehensive audit to identify opportunities and fix weaknesses across your social media channels."})]}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-8",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Why Regular Audits Matter"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Social media moves fast. What worked six months ago may be outdated today. Quarterly audits identify what's performing, what's not, and where you're leaving opportunities on the table. Think of audits as strategic tune-upsâcatching small issues before they become big problems and optimizing for continuous improvement."}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Your Audit Checklist"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Review: profile completeness and branding consistency, content performance by type and topic, engagement rates and trends, follower growth trajectory, competitor positioning, response times to comments and messages, and goal alignment. Document findings with specific action items and owners. An audit without action is wasted effort."}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Automate Performance Monitoring"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Track engagement metrics and identify optimization opportunities automatically with DESHILLER analytics."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Start Audit"})]})]})]}),e.jsx(_s,{})]})},Ry=()=>{const s=ns();return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(Vt,{title:"Content Calendar Planning: Stay Consistent Without Burnoutâ¦",description:"Create a sustainable content calendar that keeps you consistent and strategic while preventing creator burnout.",path:"/academy/content-calendar-planning",type:"article",jsonLd:{"@context":"https://schema.org","@type":"Article",headline:"Content Calendar Planning: Stay Consistent Without Burnout",description:"Create a sustainable content calendar that keeps you consistent and strategic while preventing creator burnout.",author:{"@type":"Organization",name:"deSHILLER"},publisher:{"@type":"Organization",name:"deSHILLER",logo:{"@type":"ImageObject",url:"https://deshiller.com/favicon.png"}},mainEntityOfPage:"https://deshiller.com/academy/content-calendar-planning"}}),e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back"]})]})})}),e.jsxs("article",{className:"max-w-4xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:[e.jsxs("div",{className:"space-y-6 mb-12",children:[e.jsx("span",{className:"text-primary font-medium px-3 py-1 bg-primary/10 rounded-full text-sm",children:"Planning"}),e.jsx("h1",{className:"text-5xl font-display font-semibold leading-tight",children:"Content Calendar Planning: Stay Consistent Without Burnout"}),e.jsx("p",{className:"text-xl text-muted-foreground",children:"Create a sustainable content calendar that keeps you consistent and strategic while preventing creator burnout."})]}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-8",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Why Content Calendars Fail"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Most content calendars are overambitiousâplanning daily posts across five platforms with complex themes. Reality hits, you miss a few days, the calendar becomes outdated, and
151you abandon it entirely. The solution: build buffers, batch content creation, focus on quality over quantity, and leave room for timely, reactive content."}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"The Batch-and-Buffer System"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Dedicate one day per week to content creation. Batch-produce 2-3 weeks of content in advance. Maintain a buffer of 10-15 evergreen posts for emergency use. This system eliminates daily content stress while ensuring consistency. When inspiration strikes, capture ideas immediatelyâbut schedule them strategically."}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Automate Content Distribution"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Schedule and distribute content across platforms effortlessly. Focus your time on creation, not manual posting."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Save Time"})]})]})]}),e.jsx(_s,{})]})},Py=()=>{const s=ns();return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(Vt,{title:"Social Proof Strategies to Build Trust and Credibility | deâ¦",description:"Leverage testimonials, reviews, and social validation to increase conversions and accelerate buyer decisions.",path:"/academy/social-proof-strategies",type:"article",jsonLd:{"@context":"https://schema.org","@type":"Article",headline:"Social Proof Strategies to Build Trust and Credibility",description:"Leverage testimonials, reviews, and social validation to increase conversions and accelerate buyer decisions.",author:{"@type":"Organization",name:"deSHILLER"},publisher:{"@type":"Organization",name:"deSHILLER",logo:{"@type":"ImageObject",url:"https://deshiller.com/favicon.png"}},mainEntityOfPage:"https://deshiller.com/academy/social-proof-strategies"}}),e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back"]})]})})}),e.jsxs("article",{className:"max-w-4xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:[e.jsxs("div",{className:"space-y-6 mb-12",children:[e.jsx("span",{className:"text-primary font-medium px-3 py-1 bg-primary/10 rounded-full text-sm",children:"Conversion"}),e.jsx("h1",{className:"text-5xl font-display font-semibold leading-tight",children:"Social Proof Strategies to Build Trust and Credibility"}),e.jsx("p",{className:"text-xl text-muted-foreground",children:"Leverage testimonials, reviews, and social validation to increase conversions and accelerate buyer decisions."})]}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-8",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"The Psychology of Social Proof"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Humans are social creatures who look to others when making decisions. When prospects see others like them successfully using your product, it reduces perceived risk and accelerates purchase decisions. Social proof isn't just nice-to-haveâit's the difference between skepticism and trust, especially for unknown brands."}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Types of Social Proof That Convert"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Customer testimonials with specific results, case studies showing transformation, user-generated content featuring real customers, expert endorsements from industry leaders, social media engagement metrics, and media mentions all build credibility. The most powerful social proof is specific, authentic, and from someone the prospect identifies with."}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Amplify Your Social Proof"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Share customer success stories in relevant conversations where prospects are evaluating solutions. Convert awareness into trust."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Build Credibility"})]})]})]}),e.jsx(_s,{})]})},My=()=>{const s=ns();return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(Vt,{title:"Cross-Platform Social Media Strategy: Maximize Your Reach |â¦",description:"Coordinate your efforts across platforms while respecting each platform's unique culture and maximizing efficiency.",path:"/academy/cross-platform-strategy",type:"article",jsonLd:{"@context":"https://schema.org","@type":"Article",headline:"Cross-Platform Social Media Strategy: Maximize Your Reach",description:"Coordinate your efforts across platforms while respecting each platform's unique culture and maximizing efficiency.",author:{"@type":"Organization",name:"deSHILLER"},publisher:{"@type":"Organization",name:"deSHILLER",logo:{"@type":"ImageObject",url:"https://deshiller.com/favicon.png"}},mainEntityOfPage:"https://deshiller.com/academy/cross-platform-strategy"}}),e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back"]})]})})}),e.jsxs("article",{className:"max-w-4xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:[e.jsxs("div",{className:"space-y-6 mb-12",children:[e.jsx("span",{className:"text-primary font-medium px-3 py-1 bg-primary/10 rounded-full text-sm",children:"Strategy"}),e.jsx("h1",{className:"text-5xl font-display font-semibold leading-tight",children:"Cross-Platform Social Media Strategy: Maximize Your Reach"}),e.jsx("p",{className:"text-xl text-muted-foreground",children:"Coordinate your efforts across platforms while respecting each platform's unique culture and maximizing efficiency."})]}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-8",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"The Cross-Platform Reality"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Your audience isn't on one platformâthey're everywhere. LinkedIn for professional insights, Twitter for quick takes, Instagram for visual stories, Reddit for deep discu
151ssions. A cross-platform strategy meets your audience where they are, adapting your message for each platform's unique culture while maintaining brand consistency."}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"The Core-and-Adapt Framework"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Start with one core piece of content (blog post, video, case study), then adapt it for each platform rather than creating unique content for each. LinkedIn gets the professional angle, Twitter gets the hot take, Instagram gets the visual story, Reddit gets the detailed discussion. Same core message, platform-optimized delivery."}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Platform Prioritization"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"You can't be everywhere at full capacity. Choose 2-3 primary platforms where your audience is most active and engaged. Go deep there with consistent, high-quality content and engagement. Use other platforms opportunisticallyâsharing when relevant but not stressing about daily presence. Depth beats breadth every time."}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Manage All Platforms from One Dashboard"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Discover conversations, generate replies, and engage across Twitter, LinkedIn, and Reddit from a single interface with DESHILLER."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Simplify Multi-Platform"})]})]})]}),e.jsx(_s,{})]})},Dy=()=>{const s=ns(),[t,a]=i.useState("weekly_digest"),[r,o]=i.useState(""),[n,l]=i.useState(""),[c,x]=i.useState(!1),[d,u]=i.useState([]),[m,p]=i.useState({totalSent:0,totalOpened:0,totalClicked:0,openRate:0,clickRate:0}),[g,v]=i.useState(!1),[b,z]=i.useState(null),[C,j]=i.useState(!0);i.useEffect(()=>{if(!b)return;let f=!1;return(async()=>{x(!0);try{const R="https://iqikbtfdddpbyxpztpbh.supabase.co",M="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImlxaWtidGZkZGRwYnl4cHp0cGJoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ0MDY4OTUsImV4cCI6MjA3OTk4Mjg5NX0.Ousbd6qOJMMRzWXeihaGZ0Lm_itZUKN3n2GKVujYEiQ",_=await(await fetch(`${R}/functions/v1/preview-email?template=${t}`,{headers:{apikey:M,Authorization:`Bearer ${M}`}})).json();if(f)return;_.html?(o(_.html),l(_.subject||"")):(o('<div style="padding:40px;color:#888;font-family:sans-serif;background:#08090c;">No preview available for this template.</div>'),l(""))}catch{f||o('<div style="padding:40px;color:#c00;font-family:sans-serif;background:#08090c;">Failed to load preview.</div>')}finally{f||x(!1)}})(),()=>{f=!0}},[t,b]),i.useEffect(()=>{(async()=>{try{const{data:{user:R}}=await w.auth.getUser();if(!R){k.error("Please sign in to access this page"),s("/auth");return}const{data:M}=await w.rpc("has_role",{_user_id:R.id,_role:"admin"});if(!M){k.error("Access denied. Admin privileges required."),s("/dashboard");return}z(!0)}catch{s("/dashboard")}finally{j(!1)}})()},[s]);const y=async()=>{v(!0);try{const{data:f,error:R}=await w.from("email_tracking").select("email_id, email_type, recipient, created_at").eq("event_type","sent").order("created_at",{ascending:!1}).limit(20);if(R)throw R;const{data:M,error:q}=await w.from("email_tracking").select("email_id, event_type").order("created_at",{ascending:!1}).limit(500);if(q)throw q;const _=(M||[]).reduce(($,be)=>($[be.email_id]||($[be.email_id]={opens:0,clicks:0}),be.event_type==="opened"&&$[be.email_id].opens++,be.event_type==="clicked"&&$[be.email_id].clicks++,$),{}),A=(f||[]).map($=>{var be,Y;return{id:$.email_id,email_id:$.email_id,type:$.email_type,recipient:$.recipient,sent_at:$.created_at,opens:((be=_[$.email_id])==null?void 0:be.opens)||0,clicks:((Y=_[$.email_id])==null?void 0:Y.clicks)||0}}),B=A.length,P=A.filter($=>$.opens>0).length,I=A.filter($=>$.clicks>0).length;p({totalSent:B,totalOpened:P,totalClicked:I,openRate:B>0?Math.round(P/B*100):0,clickRate:B>0?Math.round(I/B*100):0}),u(A)}catch{}finally{v(!1)}};i.useEffect(()=>{b&&y()},[b]);const N=f=>({weekly_digest:"bg-blue-500/20 text-blue-400",trial_expiring:"bg-yellow-500/20 text-yellow-400",trial_expired:"bg-red-500/20 text-red-400",discovery_alert:"bg-green-500/20 text-green-400",engagement_success:"bg-green-500/20 text-green-400",linkedin_approved:"bg-blue-500/20 text-blue-400",credential_warning:"bg-orange-500/20 text-orange-400",onboarding_help:"bg-teal-500/20 text-teal-400"})[f]||"bg-muted text-muted-foreground";return C?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Pe,{className:"h-8 w-8 animate-spin mx-auto mb-4 text-primary"}),e.jsx("p",{className:"text-muted-foreground",children:"Checking access..."})]})}):b?e.jsx("div",{className:"min-h-screen bg-background text-foreground",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[e.jsxs("div",{className:"mb-8 flex items-center gap-3",children:[e.jsx(Tt,{className:"h-6 w-6 text-primary"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-semibold",children:"Email Templates"}),e.jsx("p",{className:"text-muted-foreground",children:"Admin: Preview and manage notification emails"})]})]}
151),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4 mb-8",children:[e.jsxs(U,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-primary",children:m.totalSent}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Sent"})]}),e.jsxs(U,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-green-500",children:m.totalOpened}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Opened"})]}),e.jsxs(U,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-blue-500",children:m.totalClicked}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Clicked"})]}),e.jsxs(U,{className:"p-4 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold",children:[m.openRate,"%"]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Open Rate"})]}),e.jsxs(U,{className:"p-4 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold",children:[m.clickRate,"%"]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Click Rate"})]})]}),e.jsxs("div",{className:"grid lg:grid-cols-3 gap-8",children:[e.jsx("div",{className:"lg:col-span-1",children:e.jsxs(U,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(Fs,{className:"h-5 w-5 text-primary"}),"Recent Emails"]}),e.jsx(h,{variant:"ghost",size:"sm",onClick:y,disabled:g,children:e.jsx(st,{className:`h-4 w-4 ${g?"animate-spin":""}`})})]}),e.jsx("div",{className:"space-y-3",children:g?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(st,{className:"h-5 w-5 animate-spin mx-auto mb-2"}),e.jsx("p",{className:"text-sm",children:"Loading..."})]}):d.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Fs,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No emails sent yet"})]}):d.map(f=>e.jsxs("div",{className:"p-3 bg-muted/30 rounded-lg border border-border/50",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx(W,{className:N(f.type),children:f.type.replace(/_/g," ")}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsxs("span",{className:"flex items-center gap-1",title:"Opens",children:[e.jsx(Bt,{className:"h-3 w-3 text-green-500"}),f.opens]}),e.jsxs("span",{className:"flex items-center gap-1",title:"Clicks",children:[e.jsx(Vl,{className:"h-3 w-3 text-blue-500"}),f.clicks]})]})]}),e.jsx("p",{className:"text-sm text-foreground truncate",children:f.recipient}),e.jsxs("div",{className:"flex items-center gap-1 mt-1 text-xs text-muted-foreground",children:[e.jsx(Cs,{className:"h-3 w-3"}),at(new Date(f.sent_at),"MMM d, h:mm a")]})]},f.id))}),e.jsxs("div",{className:"mt-6 pt-4 border-t border-border/50",children:[e.jsx("h3",{className:"text-sm font-medium mb-3",children:"Email Schedule"}),e.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Onboarding Help"}),e.jsx("span",{className:"text-foreground",children:"24h after signup"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Weekly Digest"}),e.jsx("span",{className:"text-foreground",children:"Mon 9:00 AM UTC"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Trial Warnings"}),e.jsx("span",{className:"text-foreground",children:"24h, 2h before expiry"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Credential Alerts"}),e.jsx("span",{className:"text-foreground",children:"On failure detection"})]})]})]})]})}),e.jsx("div",{className:"lg:col-span-2",children:e.jsxs(U,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Template Preview"}),e.jsxs(Gs,{value:t,onValueChange:f=>a(f),children:[e.jsx(qs,{className:"w-[220px]",children:e.jsx(Us,{})}),e.jsxs(Hs,{children:[e.jsx(Te,{value:"onboarding_help",children:"Onboarding Help"}),e.jsx(Te,{value:"weekly_digest",children:"Weekly Digest"}),e.jsx(Te,{value:"trial_expiring",children:"Trial Expiring"}),e.jsx(Te,{value:"discovery_alert",children:"Discovery Alert"}),e.jsx(Te,{value:"engagement_success",children:"Engagement Success"})]})]})]}),e.jsx("div",{className:"mb-4 p-3 bg-muted/30 rounded-lg",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Subject:"}),e.jsx("span",{className:"font-medium",children:n||"â"})]})}),e.jsxs("div",{className:"border border-border rounded-lg overflow-hidden relative min-h-[400px]",children:[c&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60 backdrop-blur-sm z-10",children:e.jsx(Pe,{className:"h-6 w-6 animate-spin text-primary"})}),e.jsx("iframe",{title:"Email preview",srcDoc:r,className:"w-full",style:{height:"1000px",border:"none",background:"#08090c"}})]})]})})]})]})}):null},Oy=()=>{const s=ns(),[t,a]=i.useState(!1),r=[{name:"Starter",credits:"500",price:"99",pricePerCredit:"0.198",description:"For developers testing the API",features:["500 API credits","All API endpoints","Standard rate limits","Email support","Credits never expire"]},{name:"Growth",credits:"1,500",price:"249",pricePerCredit:"0.166",description:"For growing applications",features:["1,500 API credits","All API endpoints","Higher rate limits","Priority support","Credits never expire","16% savings"],popular:!0},{name:"Enterprise",credits:"5,000",price:"499",pricePerCredit:"0.10",description:"For high-volume usage",features:["5,000 API credits","All API endpoints","Highest rate limits","Dedicated support","Credits never expire","50% savings"]}],o=[{method:"POST",path:"/discover",description:"Discover relevant posts across platforms",credits:5},{method:"POST",path:"/generate-comment",description:"Generate AI-
151powered comments",credits:2},{method:"POST",path:"/post-comment",description:"Post comments to platforms",credits:3},{method:"GET",path:"/usage",description:"Check your API usage and credits",credits:0}],n=`curl -X POST "${window.location.origin}/functions/v1/enterprise-api" \\ 152 -H "Authorization: Bearer YOUR_API_KEY" \\ 153 -H "Content-Type: application/json" \\ 154 -d '{ 155 "action": "discover", 156 "platform": "twitter", 157 "keywords": ["saas", "startup"], 158 "limit": 10 159 }'`;return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("button",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight hover:opacity-80 transition-opacity",children:"DESHILLER"}),e.jsxs("div",{className:"hidden md:flex items-center gap-8 text-sm",children:[e.jsx("button",{onClick:()=>s("/"),className:"text-muted-foreground hover:text-foreground transition-colors",children:"Home"}),e.jsx("a",{href:"#pricing",className:"text-muted-foreground hover:text-foreground transition-colors",children:"Pricing"}),e.jsx("a",{href:"#endpoints",className:"text-muted-foreground hover:text-foreground transition-colors",children:"Endpoints"}),e.jsx("a",{href:"#docs",className:"text-muted-foreground hover:text-foreground transition-colors",children:"Documentation"})]}),e.jsxs("div",{className:"hidden md:flex items-center gap-4",children:[e.jsx(h,{variant:"ghost",onClick:()=>s("/auth"),className:"text-sm",children:"Sign in"}),e.jsx(h,{onClick:()=>s("/auth"),className:"text-sm",children:"Get API Access"})]}),e.jsxs(En,{open:t,onOpenChange:a,children:[e.jsx(Zc,{asChild:!0,className:"md:hidden",children:e.jsx(h,{variant:"ghost",size:"icon",children:e.jsx(Ti,{className:"h-5 w-5"})})}),e.jsx(Hr,{side:"right",className:"w-[300px]",children:e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center justify-between pb-6 border-b border-border/50",children:[e.jsx("span",{className:"text-lg font-semibold",children:"DESHILLER"}),e.jsx(h,{variant:"ghost",size:"icon",onClick:()=>a(!1),children:e.jsx(zs,{className:"h-5 w-5"})})]}),e.jsxs("nav",{className:"flex flex-col gap-6 py-8",children:[e.jsx("button",{onClick:()=>{a(!1),s("/")},className:"text-lg font-medium text-left",children:"Home"}),e.jsx("a",{href:"#pricing",onClick:()=>a(!1),className:"text-lg font-medium",children:"Pricing"}),e.jsx("a",{href:"#endpoints",onClick:()=>a(!1),className:"text-lg font-medium",children:"Endpoints"}),e.jsx("a",{href:"#docs",onClick:()=>a(!1),className:"text-lg font-medium",children:"Documentation"})]}),e.jsxs("div",{className:"mt-auto space-y-3 pt-6 border-t border-border/50",children:[e.jsx(h,{variant:"outline",onClick:()=>{a(!1),s("/auth")},className:"w-full",children:"Sign in"}),e.jsx(h,{onClick:()=>{a(!1),s("/auth")},className:"w-full",children:"Get API Access"})]})]})})]})]})})}),e.jsxs("section",{className:"max-w-7xl mx-auto px-6 lg:px-8 pt-20 pb-24 lg:pt-32 lg:pb-32",children:[e.jsxs("div",{className:"max-w-4xl mx-auto text-center space-y-8",children:[e.jsxs(W,{variant:"outline",className:"px-4 py-1.5",children:[e.jsx(Wc,{className:"h-3.5 w-3.5 mr-2"}),"Enterprise API"]}),e.jsx("h1",{className:"text-5xl lg:text-6xl font-display font-semibold leading-tight",children:"Programmatic access to social engagement"}),e.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Integrate DESHILLER's AI-powered discovery, comment generation, and posting directly into your applications. No UI needed."}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center pt-4",children:[e.jsxs(h,{size:"lg",onClick:()=>s("/auth"),className:"group",children:["Get API Key",e.jsx(Ns,{className:"ml-2 h-4 w-4 group-hover:translate-x-1 transition-transform"})]}),e.jsxs(h,{size:"lg",variant:"outline",onClick:()=>{var l;return(l=document.getElementById("docs"))==null?void 0:l.scrollIntoView({behavior:"smooth"})},children:[e.jsx(Vc,{className:"mr-2 h-4 w-4"}),"View Documentation"]})]})]}),e.jsx("div",{className:"mt-24 grid md:grid-cols-4 gap-6",children:[{icon:bt,title:"Multi-Platform",description:"Twitter, LinkedIn, Reddit, Facebook"},{icon:ws,title:"Fast & Reliable",description:"99.9% uptime SLA"},{icon:Tt,title:"Secure",description:"Enterprise-grade security"},{icon:hu,title:"Usage-Based",description:"Pay only for what you use"}].map((l,c)=>e.jsxs(U,{className:"p-6 text-center bg-card/50 border-border/50",children:[e.jsx(l.icon,{className:"h-8 w-8 mx-auto mb-3 text-primary"}),e.jsx("h3",{className:"font-semibold mb-1",children:l.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:l.description})]},c))})]}),e.jsxs("section",{id:"pricing",className:"max-w-7xl mx-auto px-6 lg:px-8 py-24 border-t border-border/50",children:[e.jsxs("div",{className:"text-center mb-16",children:[e.jsx("h2",{className:"text-4xl font-display font-semibold mb-4",children:"Simple, usage-based pricing"}),e.jsx("p",{className:"text-muted-foreground text-lg",children:"Purchase credits that never expire. Use them whenever you need."})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-8 max-w-5xl mx-auto",children:r.map((l,c)=>e.jsxs(U,{className:`p-8 relative ${l.popular?"border-primary shadow-lg scale-105":"border-border/50 hover:border-primary/30"} transition-all`,children:[l.popular&&e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2",children:e.jsx(W,{className:"bg-primary text-primary-foreground",children:"Most Popular"})}),e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h3",{className:"text-xl font-semibold mb-1",children:l.name}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:l.description}),e.jsx("div",{className:"flex items-baseline justify-center gap-1",children:e.jsxs("span",{className:"text-4xl font-bold",children:["$",l.price]})}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[l.credits," credits"]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["$",l.pricePerCredit,"/credit"]})]}),e.jsx("ul",{className:"space-y-3 mb-8",children:l.features.map((x,d)=>e.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[e.jsx(bs,{className:"h-4 w-4 text-primary shrink-0"}),e.jsx("span",{children:x})]},d))}),e.jsx(h,{className:"w-full",variant:l.popular?"default":"outline",onClick:()=>s("/auth"),children:"Get Started"})]},c))}),e.jsx("div",{className:"text-center mt-12",children:e.jsxs("p",{className:"text-muted-foreground",children:["Need custom volume pricing?"," ",e.jsx("button",{className:"text-primary hover:underline",onClick:()=>s("/auth"),children:"Contact us"})]})})]}),e.jsxs("section",{id:"endpoints",className:"max-w-7xl mx-auto px-6 lg:px-8 py-24 border-t border-border/50",children:[e.jsxs("div",{className:"text-center mb-16",children:[e.jsx("h2",{className:"text-4xl font-display font-semibold mb-4",children:"API Endpoints"}),e.jsx("p",{className:"text-muted-foreground text-lg",children:"Full access to discovery, AI generation, and posting capabilities"})]}
159),e.jsx("div",{className:"max-w-3xl mx-auto space-y-4",children:o.map((l,c)=>e.jsxs(U,{className:"p-4 flex items-center justify-between bg-card/50 border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(W,{variant:l.method==="POST"?"default":"secondary",className:"font-mono",children:l.method}),e.jsx("code",{className:"font-mono text-sm",children:l.path})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:l.description}),e.jsxs(W,{variant:"outline",className:"shrink-0",children:[l.credits," credits"]})]})]},c))})]}),e.jsxs("section",{id:"docs",className:"max-w-7xl mx-auto px-6 lg:px-8 py-24 border-t border-border/50",children:[e.jsxs("div",{className:"text-center mb-16",children:[e.jsx("h2",{className:"text-4xl font-display font-semibold mb-4",children:"Quick Start"}),e.jsx("p",{className:"text-muted-foreground text-lg",children:"Get started in minutes with our simple API"})]}),e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsxs(U,{className:"overflow-hidden bg-zinc-950 border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border/50 bg-zinc-900",children:[e.jsxs("div",{className:"flex gap-1.5",children:[e.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500/80"}),e.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500/80"}),e.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500/80"})]}),e.jsx("span",{className:"text-xs text-muted-foreground ml-2",children:"Terminal"})]}),e.jsx("pre",{className:"p-6 overflow-x-auto text-sm",children:e.jsx("code",{className:"text-green-400",children:n})})]}),e.jsxs("div",{className:"mt-8 grid md:grid-cols-3 gap-6",children:[e.jsxs(U,{className:"p-6 bg-card/50 border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"text-primary font-bold",children:"1"})}),e.jsx("h3",{className:"font-semibold",children:"Get API Key"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign up and generate your API key from the dashboard"})]}),e.jsxs(U,{className:"p-6 bg-card/50 border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"text-primary font-bold",children:"2"})}),e.jsx("h3",{className:"font-semibold",children:"Purchase Credits"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Buy credits that never expire - use them when needed"})]}),e.jsxs(U,{className:"p-6 bg-card/50 border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"text-primary font-bold",children:"3"})}),e.jsx("h3",{className:"font-semibold",children:"Start Building"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Make API calls to discover, generate, and post"})]})]}),e.jsx("div",{className:"text-center mt-12",children:e.jsxs(h,{size:"lg",onClick:()=>s("/auth"),className:"group",children:["Get Your API Key",e.jsx(Ns,{className:"ml-2 h-4 w-4 group-hover:translate-x-1 transition-transform"})]})})]})]}),e.jsx(_s,{})]})},Fy=()=>{const s=ns(),[t,a]=i.useState(null),r=(b,z)=>{navigator.clipboard.writeText(b),a(z),k.success("Copied to clipboard"),setTimeout(()=>a(null),2e3)},o="https://iqikbtfdddpbyxpztpbh.supabase.co/functions/v1/enterprise-api",n=`curl -X POST "${o}" \\ 160 -H "x-api-key: YOUR_API_KEY" \\ 161 -H "Content-Type: application/json" \\ 162 -d '{ 163 "action": "discover", 164 "platform": "twitter", 165 "keywords": ["saas", "startup tools"], 166 "limit": 10 167 }'`,l=`curl -X POST "${o}" \\ 168 -H "x-api-key: YOUR_API_KEY" \\ 169 -H "Content-Type: application/json" \\ 170 -d '{ 171 "action": "generate-comment", 172 "platform": "linkedin", 173 "post_url": "https://linkedin.com/feed/update/urn:li:activity:123" 174 }'`,c=`curl -X POST "${o}" \\ 175 -H "x-api-key: YOUR_API_KEY" \\ 176 -H "Content-Type: application/json" \\ 177 -d '{ 178 "action": "post-comment", 179 "platform": "reddit", 180 "post_url": "https://reddit.com/r/SaaS/comments/abc123", 181 "comment_text": "Great question! We solved this with..." 182 }'`,x=`import requests 183 184API_KEY = "your_api_key_here" 185BASE_URL = "${o}" 186 187# Discover relevant posts
188response = requests.post(BASE_URL, json={ 189 "action": "discover", 190 "platform": "twitter", 191 "keywords": ["saas", "automation"] 192}, headers={ 193 "x-api-key": API_KEY, 194 "Content-Type": "application/json" 195}) 196 197posts = response.json() 198print(f"Found {posts.get('posts_discovered', 0)} posts") 199 200# Generate a comment for a post 201response = requests.post(BASE_URL, json={ 202 "action": "generate-comment", 203 "platform": "linkedin", 204 "post_url": "https://linkedin.com/feed/update/urn:li:activity:123" 205}, headers={ 206 "x-api-key": API_KEY, 207 "Content-Type": "application/json" 208}) 209 210suggestions = response.json() 211print(suggestions["suggestions"])`,d=`const API_KEY = "your_api_key_here"; 212const BASE_URL = "${o}"; 213 214// Discover posts 215const discover = await fetch(BASE_URL, { 216 method: "POST", 217 headers: { 218 "x-api-key": API_KEY, 219 "Content-Type": "application/json", 220 }, 221 body: JSON.stringify({ 222 action: "discover", 223 platform: "twitter", 224 keywords: ["saas", "startup"], 225 }), 226}); 227 228const posts = await discover.json(); 229console.log(\`Found \${posts.posts_discovered} posts\`); 230 231// Generate comment 232const comment = await fetch(BASE_URL, { 233 method: "POST", 234 headers: { 235 "x-api-key": API_KEY, 236 "Content-Type": "application/json", 237 }, 238 body: JSON.stringify({ 239 action: "generate-comment", 240 platform: "linkedin", 241 post_url: "https://linkedin.com/feed/...", 242 }), 243}); 244
245const result = await comment.json(); 246console.log(result.suggestions);`,u=`// n8n HTTP Request Node Configuration 247// 248// Method: POST 249// URL: ${o} 250// 251// Headers: 252// x-api-key: {{$credentials.deshillerApiKey}} 253// Content-Type: application/json 254// 255// Body (JSON): 256{ 257 "action": "discover", 258 "platform": "twitter", 259 "keywords": ["{{$json.keyword}}"], 260 "limit": 10 261} 262 263// Workflow: Trigger â deSHILLER Discover â Filter â deSHILLER Generate Comment â Slack Notify`,m=`// Claude / AI Agent Integration 264// Use deSHILLER as a tool in your AI agent's toolkit 265// 266// Tool Definition: 267{ 268 "name": "deshiller_discover", 269 "description": "Find relevant social media posts about a topic", 270 "parameters": { 271 "type": "object", 272 "properties": { 273 "platform": { 274 "type": "string", 275 "enum": ["twitter", "linkedin", "reddit", "facebook", "quora"], 276 "description": "Social platform to search" 277 }, 278 "keywords": { 279 "type": "array", 280 "items": { "type": "string" }, 281 "description": "Keywords to search for" 282 } 283 }, 284 "required": ["platform", "keywords"] 285 } 286} 287 288// Implementation: 289async function deshiller_discover({ platform, keywords }) { 290 const response = await fetch("${o}", { 291 method: "POST", 292 headers: { 293 "x-api-key": process.env.DESHILLER_API_KEY, 294 "Content-Type": "application/json" 295 }, 296 body: JSON.stringify({ 297 action: "discover", 298 platform, 299 keywords 300 }) 301 }); 302 return await response.json(); 303}`,p=[{action:"discover",method:"POST",description:"Discover relevant posts across social platforms",credits:5,platforms:["twitter","linkedin","reddit","facebook","quora"],params:[{name:"action",type:"string",required:!0,desc:'"discover"'},{name:"platform",type:"string",required:!0,desc:"Target platform"},{name:"keywords",type:"string[]",required:!0,desc:"Keywords to search"},{name:"limit",type:"number",required:!1,desc:"Max results (default 10)"}]},{action:"generate-comment",method:"POST",description:"Generate AI-powered comment suggestions for a post",credits:2,platforms:["twitter","linkedin","reddit","facebook","quora"],params:[{name:"action",type:"string",required:!0,desc:'"generate-comment"'},{name:"platform",type:"string",required:!0,desc:"Target platform"},{name:"post_url",type:"string",required:!0,desc:"URL of the post"}]},{action:"post-comment",method:"POST",description:"Post a comment to a social platform",credits:3,platforms:["twitter","linkedin","reddit","facebook","quora"],params:[{name:"action",type:"string",required:!0,desc:'"post-comment"'},{name:"platform",type:"string",required:!0,desc:"Target platform"},{name:"post_url",type:"string",required:!0,desc:"URL of the post"},{name:"comment_text",type:"string",required:!0,desc:"Comment text"}]},{action:"balance",method:"POST",description:"Check your remaining API credits",credits:0,platforms:[],params:[{name:"action",type:"string",required:!0,desc:'"balance"'}]},{action:"usage",method:"POST",description:"Get your recent API usage history",credits:0,platforms:[],params:[{name:"action",type:"string",required:!0,desc:'"usage"'}]}],g=[{name:"Claude (Anthropic)",icon:Et,description:"Use deSHILLER as a tool in Claude's function calling. Let Claude discover posts and generate contextual replies autonomously.",steps:["Get your API key from the deSHILLER dashboard","Define deSHILLER endpoints as tools in your Claude prompt","Claude will call discover â generate-comment â post-comment in sequence","Monitor usage via the balance/usage endpoints"]},{name:"Perplexity",icon:bt,description:"Combine Perplexity's real-time search with deSHILLER's engagement. Find trending topics, then engage on social platforms.",steps:["Use Perplexity to identify trending topics in your niche","Pass those topics as keywords to deSHILLER's discover endpoint","Generate relevant comments using the generate-comment endpoint","Post automatically or queue for review"]},{name:"Replit Agent",icon:Wc,description:"Build social engagement bots on Replit using deSHILLER's API. Deploy always-on automations with Replit Deployments.",steps:["Create a new Replit project (Python or Node.js)","Store your deSHILLER API key as a Replit Secret","Use the code examples below to build your workflow","Deploy as an always-on Replit Deployment for continuous engagement"]},{name:"n8n",icon:_n,description:"Create visual automation workflows with
303n8n. Connect deSHILLER to Slack, email, CRM, and 400+ other apps.",steps:["Add an HTTP Request node in n8n","Configure the endpoint URL and your API key header","Chain discover â generate-comment â post-comment nodes","Add triggers (schedule, webhook, or manual) and connect to Slack/email for notifications"]}],v=({code:b,id:z})=>e.jsx("div",{className:"relative",children:e.jsxs(U,{className:"overflow-hidden bg-zinc-950 border-border/50",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border/50 bg-zinc-900",children:[e.jsxs("div",{className:"flex gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/80"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-yellow-500/80"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-green-500/80"})]}),e.jsxs("button",{onClick:()=>r(b,z),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t===z?e.jsx(bs,{className:"h-3 w-3"}):e.jsx(ta,{className:"h-3 w-3"}),t===z?"Copied":"Copy"]})]}),e.jsx("pre",{className:"p-4 overflow-x-auto text-sm leading-relaxed",children:e.jsx("code",{className:"text-green-400",children:b})})]})});return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(Ma,{}),e.jsx("section",{className:"max-w-7xl mx-auto px-6 lg:px-8 pt-28 pb-16 lg:pt-32 lg:pb-24",children:e.jsxs("div",{className:"max-w-4xl mx-auto text-center space-y-6",children:[e.jsxs(W,{variant:"outline",className:"px-4 py-1.5",children:[e.jsx(pu,{className:"h-3.5 w-3.5 mr-2"}),"API Documentation for AI Agents"]}),e.jsx("h1",{className:"text-4xl lg:text-6xl font-display font-semibold leading-tight",children:"Connect your AI agents to social engagement"}),e.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Full API documentation for Claude, Perplexity, Replit, n8n, and any HTTP-capable agent. Discover posts, generate comments, and engage across Twitter/X, LinkedIn, Reddit, Facebook, and Quora."}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center pt-4",children:[e.jsxs(h,{size:"lg",onClick:()=>s("/auth"),className:"group",children:["Get API Key ",e.jsx(Ns,{className:"ml-2 h-4 w-4 group-hover:translate-x-1 transition-transform"})]}),e.jsxs(h,{size:"lg",variant:"outline",onClick:()=>{var b;return(b=document.getElementById("endpoints"))==null?void 0:b.scrollIntoView({behavior:"smooth"})},children:[e.jsx(Vc,{className:"mr-2 h-4 w-4"})," View Endpoints"]})]})]})}),e.jsxs("section",{id:"agents",className:"max-w-7xl mx-auto px-6 lg:px-8 py-20 border-t border-border/50",children:[e.jsxs("div",{className:"text-center mb-16",children:[e.jsx("h2",{className:"text-4xl font-display font-semibold mb-4",children:"Connect your favorite AI agent"}),e.jsx("p",{className:"text-muted-foreground text-lg",children:"Step-by-step guides for the most popular AI agents and automation platforms"})]}),e.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:g.map((b,z)=>e.jsxs(U,{className:"p-8 bg-card/50 border-border/50 hover:border-primary/30 transition-all",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(b.icon,{className:"h-5 w-5 text-primary"})}),e.jsx("h3",{className:"text-xl font-semibold",children:b.name})]}),e.jsx("p",{className:"text-muted-foreground mb-6",children:b.description}),e.jsx("ol",{className:"space-y-3",children:b.steps.map((C,j)=>e.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[e.jsx("span",{className:"w-6 h-6 rounded-full bg-primary/10 flex items-center justify-center text-primary font-medium text-xs shrink-0 mt-0.5",children:j+1}),e.jsx("span",{className:"text-muted-foreground",children:C})]},j))})]},z))})]}),e.jsx("section",{className:"max-w-7xl mx-auto px-6 lg:px-8 py-20 border-t border-border/50",children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Authentication"}),e.jsxs("p",{className:"text-muted-foreground mb-6",children:["All API requests require an API key passed in the ",e.jsx("code",{className:"bg-muted px-2 py-0.5 rounded text-sm",children:"x-api-key"})," header. Get your key from the DESHILLER dashboard under Settings â API."]}),e.jsxs(U,{className:"p-6 bg-card/50 border-border/50",children:[e.jsx("h3",{className:"font-semibold mb-3",children:"Base URL"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("code",{className:"bg-zinc-950 px-4 py-2 rounded text-sm text-green-400 flex-1 overflow-x-auto",children:o}),e.jsx("button",{onClick:()=>r(o,"base-url"),className:"text-muted-foreground hover:text-foreground",children:t==="base-url"?e.jsx(bs,{className:"h-4 w-4"}):e.jsx(ta,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"mt-6 grid md:grid-cols-3 gap-4",children:[e.jsxs(U,{className:"p-4 bg-card/50 border-border/50",children:[e.jsx(Tt,{className:"h-5 w-5 text-primary mb-2"}),e.jsx("h4",{className:"font-medium text-sm mb-1",children:"Rate Limited"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"60 req/min (Starter), 120 req/min (Growth), 300 req/min (Enterprise)"})]}),e.jsxs(U,{className:"p-4 bg-card/50 border-border/50",children:[e.jsx(ws,{className:"h-5 w-5 text-primary mb-2"}),e.jsx("h4",{className:"font-medium text-sm mb-1",children:"Credit-Based"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Each endpoint costs credits. Check balance via the balance endpoint."})]}),e.jsxs(U,{className:"p-4 bg-card/50 border-border/50",children:[e.jsx(bt,{className:"h-5 w-5 text-primary mb-2"}),e.jsx("h4",{className:"font-medium text-sm mb-1",children:"5 Platforms"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Twitter/X, LinkedIn, Reddit, Facebook, Quora"})]})]})]})}),e.jsxs("section",{id:"endpoints",className:"max-w-7xl mx-auto px-6 lg:px-8 py-20 border-t border-border/50",children:[e.jsxs("div",{className:"text-center mb-16",children:[e.jsx("h2",{className:"text-4xl font-display font-semibold mb-4",children:"API Endpoints"}),e.jsxs("p",{className:"text-muted-foreground text-lg",children:["All requests are POST to the same base URL. The ",e.jsx("code",{className:"bg-muted px-2 py-0.5 rounded text-sm",children:"action"})," field determines the endpoint."]})]}
303),e.jsx("div",{className:"max-w-4xl mx-auto space-y-8",children:p.map((b,z)=>e.jsxs(U,{className:"p-6 bg-card/50 border-border/50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(W,{className:"font-mono",children:b.method}),e.jsxs("code",{className:"font-mono text-sm font-medium",children:['action: "',b.action,'"']})]}),e.jsxs(W,{variant:"outline",children:[b.credits," credits"]})]}),e.jsx("p",{className:"text-muted-foreground mb-4",children:b.description}),b.platforms.length>0&&e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Platforms:"}),b.platforms.map(C=>e.jsx(W,{variant:"secondary",className:"text-xs",children:C},C))]}),e.jsxs("div",{className:"border-t border-border/50 pt-4",children:[e.jsx("h4",{className:"text-sm font-medium mb-3",children:"Parameters"}),e.jsx("div",{className:"space-y-2",children:b.params.map((C,j)=>e.jsxs("div",{className:"flex items-start gap-4 text-sm",children:[e.jsx("code",{className:"bg-muted px-2 py-0.5 rounded text-xs font-mono shrink-0",children:C.name}),e.jsx("span",{className:"text-muted-foreground text-xs shrink-0",children:C.type}),C.required&&e.jsx(W,{variant:"outline",className:"text-[10px] h-4 shrink-0",children:"required"}),e.jsx("span",{className:"text-muted-foreground text-xs",children:C.desc})]},j))})]})]},z))})]}),e.jsxs("section",{id:"examples",className:"max-w-7xl mx-auto px-6 lg:px-8 py-20 border-t border-border/50",children:[e.jsxs("div",{className:"text-center mb-16",children:[e.jsx("h2",{className:"text-4xl font-display font-semibold mb-4",children:"Code Examples"}),e.jsx("p",{className:"text-muted-foreground text-lg",children:"Ready-to-use code for every platform"})]}),e.jsx("div",{className:"max-w-4xl mx-auto",children:e.jsxs(Ct,{defaultValue:"curl",className:"w-full",children:[e.jsxs(wt,{className:"grid w-full grid-cols-5 mb-6",children:[e.jsx(cs,{value:"curl",children:"cURL"}),e.jsx(cs,{value:"python",children:"Python"}),e.jsx(cs,{value:"node",children:"Node.js"}),e.jsx(cs,{value:"n8n",children:"n8n"}),e.jsx(cs,{value:"claude",children:"Claude/AI"})]}),e.jsxs(us,{value:"curl",className:"space-y-6",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Discover Posts"}),e.jsx(v,{code:n,id:"curl-discover"}),e.jsx("h3",{className:"text-lg font-semibold",children:"Generate Comment"}),e.jsx(v,{code:l,id:"curl-generate"}),e.jsx("h3",{className:"text-lg font-semibold",children:"Post Comment"}),e.jsx(v,{code:c,id:"curl-post"})]}),e.jsx(us,{value:"python",children:e.jsx(v,{code:x,id:"python"})}),e.jsx(us,{value:"node",children:e.jsx(v,{code:d,id:"node"})}),e.jsx(us,{value:"n8n",children:e.jsx(v,{code:u,id:"n8n"})}),e.jsx(us,{value:"claude",children:e.jsx(v,{code:m,id:"claude"})})]})})]}),e.jsx("section",{className:"max-w-7xl mx-auto px-6 lg:px-8 py-20 border-t border-border/50",children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mb-6",children:"Response Format"}),e.jsxs("p",{className:"text-muted-foreground mb-6",children:["All responses are JSON. Successful responses include ",e.jsx("code",{className:"bg-muted px-2 py-0.5 rounded text-sm",children:"success: true"})," and a ",e.jsx("code",{className:"bg-muted px-2 py-0.5 rounded text-sm",children:"credits_remaining"})," field."]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs(U,{className:"p-6 bg-card/50 border-border/50",children:[e.jsx("h3",{className:"font-semibold mb-3 text-green-400",children:"Success (200)"}),e.jsx(v,{code:`{ 304 "success": true, 305 "platform": "twitter", 306 "posts_discovered": 8, 307 "credits_used": 5, 308 "credits_remaining": 495 309}`,id:"success-resp"})]}),e.jsxs(U,{className:"p-6 bg-card/50 border-border/50",children:[e.jsx("h3",{className:"font-semibold mb-3 text-red-400",children:"Error (401 / 402 / 400)"}),e.jsx(v,{code:`{ 310 "error": "Insufficient credits", 311 "message": "Required: 5, Available: 2", 312 "credits_remaining": 2 313}`,id:"error-resp"})]})]})]})}),e.jsx("section",{className:"max-w-7xl mx-auto px-6 lg:px-8 py-20 border-t border-border/50",children:e.jsxs(U,{className:"p-12 md:p-16 text-center bg-gradient-to-br from-primary/10 via-card to-accent/5 border-primary/20",children:[e.jsx("h2",{className:"text-3xl md:text-4xl font-display font-semibold mb-4",children:"Ready to automate social engagement?"}),e.jsx("p",{className:"text-muted-foreground max-w-xl mx-auto mb-8",children:"Get your API key in 30 seconds and start building."}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[e.jsxs(h,{size:"lg",onClick:()=>s("/auth"),className:"group",children:["Get API Key ",e.jsx(Ns,{className:"ml-2 h-4 w-4 group-hover:translate-x-1 transition-transform"})]}),e.jsx(h,{size:"lg",variant:"outline",onClick:()=>s("/api"),children:"View Pricing"})]})]})}),e.jsx(_s,{})]})},By=()=>{const s=ns();return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(Vt,{title:"How to Rank in AI Search (AIO) Using Social Comments | deSHâ¦",description:"AI search engines like ChatGPT, Perplexity, and Google AI Overviews prioritize real human conversations. Here's how to leverage social commenting to dominateâ¦",path:"/academy/aio-ranking-social-comments",type:"article",jsonLd:{"@context":"https://schema.org","@type":"Article",headline:"How to Rank in AI Search (AIO) Using Social Comments",description:"AI search engines like ChatGPT, Perplexity, and Google AI Overviews prioritize real human conversations. Here's how to leverage social commenting to dominate AI-generated answers.",author:{"@type":"Organization",name:"deSHILLER"},publisher:{"@type":"Organization",name:"deSHILLER",logo:{"@type":"ImageObject",url:"https://deshiller.com/favicon.png"}},mainEntityOfPage:"https://deshiller.com/academy/aio-ranking-social-comments"}}),e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back"]})]})})}),e.jsxs("article",{className:"max-w-4xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:[e.jsxs("div",{className:"space-y-6 mb-12",children:[e.jsx("span",{className:"text-primary font-medium px-3 py-1 bg-primary/10 rounded-full text-sm",children:"AI Strategy"}),e.jsx("h1",{className:"text-5xl font-display font-semibold leading-tight",children:"How to Rank in AI Search (AIO) Using Social Comments"}),e.jsx("p",{className:"text-xl text-muted-foreground",children:"AI search engines like ChatGPT, Perplexity, and Google AI Overviews prioritize real human conversations. Here's how to leverage social commenting to dominate AI-generated answers."})]}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-8",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"What Is AIO (AI Overview Optimization)?"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"AIOâAI Overview Optimizationâis the practice of optimizing your brand's visibility in AI-generated search results. Unlike traditional SEO where you optimize web pages, AIO means ensuring your brand appears when AI models like GPT, Gemini, or Perplexity synthesize answers from the internet. The
313se models heavily weight real human conversations from platforms like Reddit, X/Twitter, LinkedIn, and Quoraâmaking social comments a powerful AIO lever."}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Why AI Search Engines Love Social Comments"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:`AI models are trained on and retrieve data from the open web. Platforms like Reddit and X rank extremely well in traditional search, and AI models use these as primary sources for understanding real-world sentiment and recommendations. When someone asks ChatGPT "What's the best tool for LinkedIn outreach?", the model synthesizes answers partly from Reddit threads, Twitter discussions, and LinkedIn posts where real people share recommendations.`}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"This means that consistent, helpful commenting on relevant social threads directly influences what AI models recommend. It's not about gaming the systemâit's about genuinely participating in conversations so that when AI crawls those threads, your brand appears as a credible recommendation."}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"The AIO Social Commenting Framework"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Step 1: Identify High-Signal Threads."}),' Find conversations where people ask questions your product answers. Look for "What tool do you recommend for X?", "Has anyone tried Y?", or "Best alternative to Z?" threads. These are the threads AI models are most likely to cite.']}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Step 2: Provide Genuine Value First."})," Never lead with a pitch. Answer the question thoroughly, share your expertise, and add context. Then, when relevant, mention your product as one option. AI models detect promotional content and downweight itâauthenticity is key."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Step 3: Be Consistent Across Platforms."})," AI models cross-reference sources. If your brand consistently shows up in helpful Reddit comments, LinkedIn discussions, and X threads about the same topic, AI models build a stronger association between your brand and that topic category."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Step 4: Target Long-Tail AI Queries."}),' Think about the specific questions people ask AI assistants: "best cold outreach tool for startups with small teams" rather than just "best outreach tool." Comment on threads that match these long-tail queries.']}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Platforms That Matter Most for AIO"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Reddit"})," is the #1 platform for AIO. Google has a direct partnership with Reddit for AI training data, and ChatGPT/Perplexity actively cite Reddit threads. Every helpful comment you leave on a relevant subreddit is a potential data point for AI recommendations."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"X/Twitter"})," is the real-time pulse. AI models use X for understanding current sentiment and trending tools. Engaging in industry conversations on X builds your brand's association with your category."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"LinkedIn"})," carries professional authority. When AI models look for B2B recommendations, LinkedIn discussions carry extra weight because they're tied to verified professional identities."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Quora"})," is a direct Q&A format that aligns perfectly with how people query AI assistants. Answers on Quora are frequently cited by Perplexity and Google AI Overviews."]}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Measuring AIO Success"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Track your brand mentions in AI search results by regularly querying ChatGPT, Perplexity, and Google AI Overviews with your target keywords. Monitor which threads your comments appear in and whether those threads show up in AI-generated answers. Tools like deSHILLER can automate the discovery and engagement process so you're consistently present in the right conversations."}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Common AIO Mistakes to Avoid"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Don't spam identical comments across threadsâAI models detect patterns and devalue repetitive content. Don't be overly promotionalâprovide genuine value and let the product mention feel natural. Don't ignore platform cultureâwhat works on Reddit won't work on LinkedIn. And don't expect overnight resultsâAIO is a compounding strategy where consistent effort over weeks and months builds lasting visibility."}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Automate Your AIO Strategy"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"deSHILLER finds the exact conversations where AI models look for recommendations, generates authentic replies, and helps you build consistent presence across Reddit, X, LinkedIn, and Quora."}),e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Start Ranking in AI Search"})]})]})]}),e.jsx(_s,{})]})},$y=()=>{const s=ns();return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(Vt,{title:"Why Social Engagement Must Be Part of Your AI Agent Stack |â¦",description:"AI agents can write code, analyze data, and manage workflows. But without social engagement, they're missing the most powerful growth channel: real conversatâ¦",path:"/academy/social-engagement-ai-agents",type:"article",jsonLd:{"@context":"https://schema.org","@type":"Article",headline:"Why Social Engagement Must Be Part of Your AI Agent Stack",description:"AI agents can write code, analyze data, and manage workflows. But without social engagement, they're missing the most powerful growth channel: real conversations with real people.",author:{"@type":"Organization",name:"deSHILLER"},publisher:{"@type":"Organization",name:"deSHILLER",logo:{"@type":"ImageObject",url:"https://deshiller.com/favicon.png"}},mainEntityOfPage:"https://deshiller.com/academy/social-engagement-ai-agents"}}),e.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsx("span",{onClick:()=>s("/"),className:"text-lg font-semibold tracking-tight cursor-pointer hover:text-primary transition-colors",children:"DESHILLER"}),e.jsxs(h,{onClick:()=>s("/academy"),variant:"ghost",size:"sm",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back"]})]})})}),e.jsxs("article",{className:"max-w-4xl mx-auto px-6 lg:px-8 pt-16 pb-24",children:[e.jsxs("div",{className:"space-y-6 mb-12",children:[e.jsx("span",{className:"text-primary font-medium px-3 py-1 bg-primary/10 rounded-full text-sm",children:"AI Agents"}),e.jsx("h1",{className:"text-5xl font-display font-semibold leading-tight",children:"Why Social Engagement Must Be Part of Your AI Agent Stack"}),e.jsx("p",{className:"text-xl text-muted-foreground",children:"AI agents can write code, analyze data, and manage workflows. But without social engagement, they're missing the most powerful growth channel: real conversations with real people."})]}),e.jsxs("div",{className:"prose prose-lg prose-invert max-w-none space-y-8",children:[e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"The Missing Piece in AI Agent Workflows"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:`Most AI agent setups focus on internal tasksâdata analysis, c
313ontent generation, customer support automation. But the highest-ROI use of AI agents is external: engaging with potential customers in the social conversations they're already having. When someone on Reddit asks "What's the best tool for X?", that's a buying signal. An AI agent that can discover, analyze, and help you respond to these signals is worth more than any internal automation.`}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"How AI Agents + Social Engagement Work Together"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Discovery Agent:"})," Your AI agent monitors X, LinkedIn, Reddit, Facebook, and Quora for conversations relevant to your product. Instead of manually scrolling through feeds, the agent uses the deSHILLER API to continuously discover high-intent posts mentioning your keywords, competitors, or industry problems."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Analysis Agent:"})," Once posts are discovered, your agent analyzes relevance, sentiment, and intent. Is this person asking a question your product solves? Is there a competitor mention you can respond to? Is the conversation still active and worth engaging with?"]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Engagement Agent:"})," The agent generates contextual, platform-appropriate responses that provide genuine value while naturally mentioning your product. The key is authenticityâAI-generated responses that sound robotic get downvoted and ignored."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Feedback Loop:"})," Track which responses get engagement (upvotes, replies, clicks). Feed this data back into your agent to continuously improve tone, timing, and targeting."]}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Building Your Social Engagement Agent"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Here's a practical architecture for adding social engagement to your AI agent stack:"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Step 1: Connect the deSHILLER API."})," Use your preferred agent framework (Claude function calling, n8n workflows, custom Python scripts, or Replit). The API provides three core actions: discover posts, generate comments, and post comments."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Step 2: Define your engagement rules."})," Set keywords, target platforms, relevance thresholds, and tone preferences. Your agent should know when to engage and when to skipânot every conversation is worth joining."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Step 3: Create a review pipeline."})," For most brands, fully autonomous posting isn't ideal. Have your agent draft responses and queue them for human review (or auto-post with high-confidence scores). This maintains quality while scaling output 10x."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Step 4: Schedule and automate."})," Run your discovery agent on a schedule (hourly for fast-moving platforms like X, daily for Reddit and LinkedIn). Use n8n or cron jobs to trigger the workflow automatically."]}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Agent Platforms That Work Best"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Claude (Anthropic):"})," Define deSHILLER endpoints as tools in Claude's function calling. Claude can reason about which posts to engage with and craft nuanced responses. Best for quality over volume."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"n8n:"})," Build visual workflows that trigger on schedule, call deSHILLER for discovery, filter by relevance, generate comments, and send drafts to Slack for review. Best for teams who want no-code automation."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Replit:"})," Deploy always-on Python or Node.js scripts that run your engagement loop continuously. Best for developers who want full control."]}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:[e.jsx("strong",{className:"text-foreground",children:"Perplexity:"})," Combine Perplexity's real-time search (to find trending topics) with deSHILLER's engagement (to participate in those conversations). Best for trend-riding strategies."]}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"ROI of Social Engagement Agents"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"A well-configured social engagement agent can discover 50-100 relevant conversations per day across platforms, generate responses in seconds (instead of 15-20 minutes manually), and maintain consistent presence that c
313ompounds over time. Brands using this approach report 3-5x more qualified inbound leads compared to cold outreach, because they're reaching people at the exact moment they're looking for a solution."}),e.jsx("h2",{className:"text-3xl font-display font-semibold mt-12 mb-6",children:"Getting Started Today"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"You don't need a complex setup. Start with the deSHILLER API, a simple cron job, and a Slack channel for review. As you see results, expand to more platforms, add more keywords, and increase automation. The key is startingâevery day you're not in these conversations, your competitors might be."}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-8 mt-12",children:[e.jsx("h3",{className:"text-2xl font-display font-semibold mb-4",children:"Add Social Engagement to Your AI Stack"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Get your deSHILLER API key and connect it to Claude, n8n, Replit, or any agent framework. Full documentation and code examples included."}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsx(h,{onClick:()=>s("/auth"),size:"lg",children:"Get API Key"}),e.jsx(h,{onClick:()=>s("/api-docs"),variant:"outline",size:"lg",children:"View API Docs"})]})]})]})]}),e.jsx(_s,{})]})},qy=()=>{const s=ns(),t=[{id:"what-is-geo",text:"What GEO Actually Is",level:2},{id:"how-engines-cite",text:"How Engines Pick What to Cite",level:2},{id:"ranking-factors",text:"The 7 GEO Ranking Factors",level:2},{id:"thirty-day-sprint",text:"30-Day GEO Sprint",level:2},{id:"measurement",text:"Measuring GEO Honestly",level:2},{id:"stop-doing",text:"What to Stop Doing",level:2}],a=[{title:"How to Rank in AI Search (AIO) Using Social Comments",description:"The Google-AI-Overview-specific subset of GEO. How social comments influence what ChatGPT, Perplexity and Google AI Overviews recommend.",category:"AI Strategy",readTime:"14 min read",path:"/academy/aio-ranking-social-comments"},{title:"Topical Authority Through Social Conversations",description:"The modern E-E-A-T playbook. How off-site social signals lift every URL on your domain and feed the AI engine entity graph.",category:"SEO",readTime:"14 min read",path:"/academy/topical-authority-social-conversations"},{title:"Reddit SEO: How Reddit Threads Rank #1 on Google",description:"Reddit owns the first page of nearly every commercial-intent SERP. Make sure the thread that ranks mentions you.",category:"SEO",readTime:"13 min read",path:"/academy/reddit-seo-rank-on-google"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Generative Engine Optimization (GEO): The 2026 Playbook | DESHILLER Academy"}),e.jsx("meta",{name:"description",content:"GEO is how brands rank inside ChatGPT, Perplexity, Claude and Google AI Overviews. Citation factors, content patterns and a 30-day sprint that actually move the needle."})]}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("nav",{className:"border-b border-border/40 bg-card/30 backdrop-blur-sm sticky top-0 z-50",children:e.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back to Academy"]}),e.jsx("span",{className:"text-2xl font-display font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"DESHILLER"})]})}),e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("main",{className:"max-w-4xl",children:[e.jsx(it,{category:"AI Strategy",title:"Generative Engine Optimization (GEO): The 2026 Playbook",description:"Search isn't ten blue links anymore. It's a paragraph written by an AI that decides â in milliseconds â which brands to mention by name. GEO is how you become one of them.",author:{name:"Shahar Levi",avatar:"SL",role:"Head of GEO Research, deSHILLER",bio:"Studies how generative engines retrieve, rerank and cite sources. Builds the citation-tracking framework deSHILLER uses to benchmark brand presence inside ChatGPT, Perplexity, Claude and Google AI Overviews."},publishDate:"2026-05-28",lastUpdated:"2026-06-02",readTime:"15 min read",featuredImage:"https://images.unsplash.com/photo-1677442136019-21780ecad995?w=1200&h=600&fit=crop",stats:{views:"12.8K",shares:"640"}}),e.jsxs("article",{className:"prose prose-lg max-w-none mt-12",children:[e.jsx("h2",{id:"what-is-geo",children:"What GEO Actually Is (And How It Differs From SEO and AIO)"}),e.jsx("p",{className:"lead text-xl text-muted-foreground",children:"Generative Engine Optimization is the discipline of getting cited inside answers produced by large language models â ChatGPT, Perplexity, Claude, Gemini, Google AI Overviews, and the growing layer of vertical AI search products."}),e.jsx("p",{children:"SEO optimizes for a ranked list of URLs. GEO optimizes for inclusion in a synthesized paragraph. The difference matters: in SEO a #4 ranking still gets traffic; in GEO if you're not in the citation set you don't exist."}),e.jsx("p",{children:"AIO (AI Overview Optimization) is the Google-specific subset of GEO. GEO is the umbrella. Treat it that way when you brief your team â the tactics overlap but the surface areas, retrieval indexes and ranking signals are different per engine."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsx(Ze,{icon:es,stat:"58%",description:"of US adults used AI search at least once a week by Q1 2026, up from 11% two years earlier",source:"Pew Research, AI Search Adoption Tracker 2026"}),e.jsx(Ze,{icon:Et,stat:"3.4",description:"average number of sources cited per AI-generated answer across ChatGPT, Perplexity and Gemini",source:"deSHILLER GEO Benchmark Q1 2026"})]}),e.jsx("h2",{id:"how-engines-cite",children:"How Generative Engines Pick What to Cite"}),e.jsx("p",{children:"Every generative engine runs roughly the same pipeline: rewrite the user's prompt into one or more retrieval queries, fetch a candidate set of documents from a search index, rerank that set with an LLM, then generate an answer that quotes or paraphrases the top sources. You're optimizing for three sequential filters."}),e.jsx("h3",{children:"Retrieval"}),e.jsx("p",{children:"The engine has to find your source. This is classic SEO plus a heavy weight on indexes the model trusts: Reddit, Wiki
313pedia, Stack Overflow, Quora, well-known publications, and the platform's own crawler corpus. If you're not in those, you're not in the candidate set."}),e.jsx("h3",{children:"Reranking"}),e.jsx("p",{children:"The candidates get scored for relevance to the rewritten query. LLM rerankers reward dense, on-topic passages that answer the specific question â not pages stuffed with keywords. Short, clearly-attributed claims beat long marketing prose."}),e.jsx("h3",{children:"Citation"}),e.jsx("p",{children:"Even after reranking, the model only cites a few sources. It picks the ones that say something specific, are quotable, and reinforce each other. Brand consistency across multiple retrieved documents is the single biggest predictor of being mentioned."}),e.jsx("h2",{id:"ranking-factors",children:"The Seven GEO Ranking Factors That Matter in 2026"}),e.jsx("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8 not-prose",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Factor"}),e.jsx("th",{className:"text-left py-2",children:"Weight"}),e.jsx("th",{className:"text-left py-2",children:"Hardest to Fake"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Mention density across corpora"}),e.jsx("td",{className:"py-3 text-sm",children:"Very High"}),e.jsx("td",{className:"py-3 text-sm text-primary",children:"Yes"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Co-occurrence with category term"}),e.jsx("td",{className:"py-3 text-sm",children:"Very High"}),e.jsx("td",{className:"py-3 text-sm text-primary",children:"Yes"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Quotable answers on owned pages"}),e.jsx("td",{className:"py-3 text-sm",children:"High"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"No"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Third-party validation"}),e.jsx("td",{className:"py-3 text-sm",children:"High"}),e.jsx("td",{className:"py-3 text-sm text-primary",children:"Yes"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Freshness signals"}),e.jsx("td",{className:"py-3 text-sm",children:"Medium"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"No"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Structured comparison content"}),e.jsx("td",{className:"py-3 text-sm",children:"High"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"No"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"Bot accessibility"}),e.jsx("td",{className:"py-3 text-sm",children:"Required"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"No"})]})]})]})}),e.jsxs("p",{children:[e.jsx("strong",{children:"Mention density."}),` If your brand appears in five Reddit threads, three Quora answers, two transcribed podcasts and a Wikipedia "see also" â you'll get cited. One owned page, no matter how well written, will not.`]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Co-occurrence with the category term."}),' AI engines learn that "deSHILLER" co-occurs with "social engagement automation" the way embeddings learn "Paris" co-occurs with "France." Every time you appear next to your category, the association strengthens.']}),e.jsxs("p",{children:[e.jsx("strong",{children:"Quotable answers on your own pages."})," Open every important page with a 40-80 word definition that an LLM can quote verbatim. Add a TL;DR section. Use schema.org/FAQPage and HowTo where applicable."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Third-party validation."})," A G2 review, a comparison post on a respected newsletter, a Hacker News thread where someone defends you â these are the citations rerankers love."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Freshness."})," Perplexity and Google AI Overviews aggressively prefer content updated in the last 90 days. Date your pages. Republish meaningfully."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Structured comparison content."}),' "X vs Y" pages, alternatives pages, and feature matrices are disproportionately cited because they directly answer comparison queries.']}),e.jsxs("p",{children:[e.jsx("strong",{children:"Bot accessibility."})," Allow GPTBot, PerplexityBot, ClaudeBot, Google-Extended in robots.txt unless you have a strategic reason to block. Serve fully-rendered HTML â most AI crawlers don't execute JavaScript."]}),e.jsx(ct,{company:"Lattice (B2B HR Platform)",industry:"HR Tech SaaS",challenge:"Strong organic SEO presence but invisible inside ChatGPT and Perplexity for category queries like 'best performance review software for engineering teams.' Competitor 15Five was being recommended in 7 out of 10 AI answers despite ranking lower in Google.",solution:"Audited 40 high-intent prompts to map citation gaps. Rewrote 18 priority pages with quotable openers and FAQ schema. Seeded and participated in 24 Reddit and Quora threads where the category was discussed. Built four 'Lattice vs [competitor]' comparison pages with structured matrices. Updated all bylined author pages with sameAs LinkedIn links.",results:["Share-of-AI-voice climbed from 11% to 47% across the 40 prompt set in 9 weeks","Cited by ChatGPT in 6/10 priority category queries (was 0/10)","Perplexity referral traffic grew from negligible to 2,800 monthly visits","Branded search volume up 34% over the same period","Win-call mentions of 'I asked ChatGPT' rose from 2 to 19 per month"],quote:"GEO felt fuzzy until we put a measurable prompt set against it. Once we were tracking share of voice weekly, the work prioritized
313itself.",author:"Director of Growth, Lattice"}),e.jsx("h2",{id:"thirty-day-sprint",children:"A 30-Day GEO Sprint You Can Actually Run"}),e.jsx("h3",{children:"Week 1 â Baseline"}),e.jsx("p",{children:"Run ten of your highest-intent prompts through ChatGPT, Perplexity and Google AI Overviews. Record which brands get cited. That's your share-of-AI-voice baseline. Audit your top 20 pages for direct answers, schema, and last-updated dates."}),e.jsx("h3",{children:"Week 2 â Owned Content"}),e.jsx("p",{children:'Rewrite each priority page with a quotable opener, an FAQ section, and a clear definition of your category. Publish two comparison pages targeting the head-term "X vs Y" queries your customers ask.'}),e.jsx("h3",{children:"Week 3 â Earned Mentions"}),e.jsx("p",{children:"Show up in Reddit threads, Quora answers and LinkedIn discussions where your category gets asked about. Provide a real answer first; mention your product only when it genuinely belongs. Volume matters â twenty thoughtful comments outperform two polished blog posts."}),e.jsx("h3",{children:"Week 4 â Measure and Iterate"}),e.jsx("p",{children:"Re-run the same ten prompts. Track which sources the engines now cite and which moved the needle. Double down on the platforms where you started appearing; reinvest content time away from anything inert."}),e.jsx("h2",{id:"measurement",children:"How to Measure GEO Without a Real Attribution Surface"}),e.jsx("p",{children:"GEO has no Search Console. The pragmatic metric stack is:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Share of voice"})," across a fixed prompt set, run weekly"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Referral traffic"})," from chat.openai.com, perplexity.ai, gemini.google.com"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Brand-search volume"})," in Google, which tends to climb 4-8 weeks after AI citation density grows"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Qualitative win-call mentions"}),' ("I asked ChatGPT and you came up")']})]}),e.jsx("p",{children:"None of these are perfect. Together they're directionally honest enough to budget against."}),e.jsx("h2",{id:"stop-doing",children:"What to Stop Doing"}),e.jsx("p",{children:`Stop writing 3,000-word "ultimate guides" that no AI can extract a clean answer from. Stop hiding key claims behind interactive components that don't render in static HTML. Stop blocking AI crawlers reflexively â you can't be cited if you can't be read. Stop measuring GEO in clicks the way you measure SEO; the value is being the recommended brand, not driving the visit.`}),e.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 rounded-lg p-8 my-12 text-center",children:[e.jsx("h3",{className:"text-2xl font-display font-bold mb-4",children:"Build Your GEO Citation Footprint on Autopilot"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"DESHILLER finds the Reddit, Quora, LinkedIn and X conversations that AI engines retrieve from, then helps you participate authentically â so your brand appears in the citation set instead of getting left out of the answer."}),e.jsx(h,{size:"lg",onClick:()=>s("/auth"),children:"Start Your GEO Sprint"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},Hy=()=>{const s=ns(),t=[{id:"why-reddit-wins",text:"Why Reddit Dominates Google",level:2},{id:"find-threads",text:"Find Threads That Already Rank",level:2},{id:"what-makes-rank",text:"What Makes a Thread Rank",level:2},{id:"get-cited",text:"Getting Cited in a Ranking Thread",level:2},{id:"seeding",text:"Seeding Your Own Threads",level:2},{id:"anchor-links",text:"Anchor Text, Links, Crawl Traps",level:2},{id:"monitoring",text:"Monitoring New Ranking Threads",level:2},{id:"mistakes",text:"Common Reddit SEO Mistakes",level:2}],a=[{title:"Reddit Marketing Without Getting Banned",description:"Navigate Reddit's community guidelines while effectively promoting your product. The companion to ranking â staying in the game long enough to matter.",category:"Reddit",readTime:"14 min read",path:"/academy/reddit-marketing-strategy"},{title:"Generative Engine Optimization (GEO): The 2026 Playbook",description:"Reddit is one of the heaviest-weighted retrieval indexes for ChatGPT and Perplexity. Ranking on Reddit feeds GEO too.",category:"AI Strategy",readTime:"15 min read",path:"/academy/generative-engine-optimization-guide"},{title:"Topical Authority Through Social Conversations",description:"Reddit comments compound into entity-level authority Google rewards across every URL on your domain.",category:"SEO",readTime:"14 min read",path:"/academy/topical-authority-social-conversations"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Reddit SEO: How Reddit Threads Rank #1 on Google (2026) | DESHILLER Academy"}),e.jsx("meta",{name:"description",content:"Reddit dominates Google's first page. Why it happens, how to seed and comment on threads that rank, and how to get your brand cited inside them â without getting banned."})]}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("nav",{className:"border-b border-border/40 bg-card/30 backdrop-blur-sm sticky top-0 z-50",children:e.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back to Academy"]}),e.jsx("span",{className:"text-2xl font-display font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"DESHILLER"})]})}),e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("main",{className:"max-w-4xl",children:[e.jsx(it,{category:"SEO",title:"Reddit SEO: How Reddit Threads Rank #1 on Google",description:"Since the 2024 RedditâGoogle data deal, Reddit threads sit on top of more commercial-intent SERPs than any other domain. Here's how to make sure the thread on page one mentions you.",author:{name:"Maya Cohen",avatar:"MC",role:"Senior SEO Strategist, deSHILLER",bio:"Ten years running organic growth for B2B SaaS, the last three focused almost entirely on community-driven search â Reddit, Quora, and the new generation of forum-flavored SERPs."},publishDate:"2026-05-30",lastUpdated:"2026-06-02",readTime:"13 min read",featuredImage:"https://images.unsplash.com/photo-1611605698335-8b1569810432?w=1200&h=600&fit=crop",stats:{views:"18.1K",shares:"912"}}
313),e.jsxs("article",{className:"prose prose-lg max-w-none mt-12",children:[e.jsx("h2",{id:"why-reddit-wins",children:"Why Reddit Dominates Google in 2026"}),e.jsx("p",{className:"lead text-xl text-muted-foreground",children:'Three forces compounded. The February 2024 data licensing agreement gave Google real-time access to Reddit content. Helpful Content updates downranked thin affiliate sites in favor of "real human perspectives." And users started appending "reddit" to queries to escape AI-generated dreck.'}),e.jsx("p",{children:'Google noticed and adjusted. The result: for nearly any "best X" or "X vs Y" query, a Reddit thread is in the top three results, often the featured snippet.'}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsx(Ze,{icon:Ks,stat:"42%",description:"of commercial-intent first-page Google results include at least one Reddit thread (US, 2026)",source:"SparkToro SERP Composition Study 2026"}),e.jsx(Ze,{icon:gs,stat:"1.3B",description:"estimated monthly Google visits to Reddit, up from 400M before the data deal",source:"Similarweb, Reddit Traffic Tracker"})]}),e.jsx("p",{children:"For marketers, this rewrites the playbook. You can spend nine months writing a comparison post that ranks at position 8, or you can spend an afternoon making sure the Reddit thread already at position 1 includes your product as a credible recommendation."}),e.jsx("h2",{id:"find-threads",children:"How to Find the Reddit Threads That Already Rank"}),e.jsxs("p",{children:["Open Google. Search your highest-intent keywords with ",e.jsx("code",{children:"site:reddit.com"})," appended. Then drop the operator and check which Reddit threads appear in the unrestricted SERP â those are the ones with real downstream traffic. Save every URL where a Reddit result is in the top ten."]}),e.jsx("p",{children:"For a faster pass, these three patterns surface 80% of the threads that matter to a B2B SaaS or DTC brand:"}),e.jsxs("ul",{children:[e.jsx("li",{children:e.jsx("code",{children:'"best [your category]" site:reddit.com'})}),e.jsx("li",{children:e.jsx("code",{children:'"alternatives to [competitor]" site:reddit.com'})}),e.jsx("li",{children:e.jsx("code",{children:'"is [competitor] worth it" site:reddit.com'})})]}),e.jsx("h2",{id:"what-makes-rank",children:"What Makes a Reddit Thread Rank â and Stay Ranked"}),e.jsx("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8 not-prose",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Signal"}),e.jsx("th",{className:"text-left py-2",children:"Why It Matters"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Subreddit authority"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"r/SaaS, r/marketing, r/Entrepreneur outrank smaller subs at the same upvote count"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Question-shaped title"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Matches user queries one-to-one. Statements lose to questions every time"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Comment recency"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"A 4-year-old thread with a top comment from last week beats the same thread with stale comments"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"Sentiment cluster"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:'Multiple independent mentions of the same product form a "consensus" Google trusts'})]})]})]})}),e.jsx("p",{children:"Reviving old threads with a thoughtful new top-comment is one of the highest-ROI moves available in 2026 SEO. The thread already has trust; you're just refreshing the answer."}),e.jsx("h2",{id:"get-cited",children:"The Right Way to Get Cited in a Ranking Thread"}),e.jsx("p",{children:"Lead with the answer the asker needs. Use your real Reddit account with karma history â fresh accounts get auto-filtered by every serious subreddit. Write 3-6 sentences. Acknowledge the tradeoffs of the tool you mention."}),e.jsxs("p",{children:["Disclose if you're affiliated; ",e.jsx("em",{children:'"Founder here, biased, butâ¦"'})," performs better than a stealth pitch and the mods won't nuke you. Never copy-paste the same comment across threads â both Reddit's spam filter and Google's near-duplicate detection will catch you."]}),e.jsx("p",{children:"The comments that get upvoted (and therefore stay visible in the Google snippet) all share a pattern: specific, slightly self-deprecating, contain at least one concrete number or detail, and include a competitor mention to show you're being honest."}),e.jsx(ct,{company:"Beehiiv (Newsletter Platform)",industry:"Creator Tools SaaS",challenge:"Substack dominated every 'best newsletter platform' Reddit thread that ranked on Google's first page. Beehiiv was visible in product comparisons on its own site but absent from the conversations where buyers actually formed opinions.",s
313olution:"Identified 28 ranking Reddit threads using site:reddit.com queries. Mapped which threads had moderator-friendly cultures. Founder and three team members commented from karma-aged personal accounts, always answering the question first, then disclosing affiliation. Seeded two AMA-style threads in r/Substack alternatives and r/newsletters with founder-written posts that invited comparison.",results:["Brand-mention share in ranking threads went from 7% to 51% in 4 months","Reddit became the #2 source of trial signups (after direct/branded search)","Featured-snippet appearance for 'best Substack alternatives' (Reddit thread cited Beehiiv as top recommendation)","Organic branded search +63% over the same window","Zero accounts banned, zero comments removed â disclosure + helpfulness held"],quote:"We stopped trying to outrank Reddit and started showing up inside it. Cheaper, faster, and more trusted than any blog post we could have written.",author:"Head of Growth, Beehiiv"}),e.jsx("h2",{id:"seeding",children:"Seeding Your Own Threads Without Getting Banned"}),e.jsx("p",{children:"If no good thread exists for a query you care about, you can seed one. The rule is simple: the post has to be a genuinely interesting question that a real practitioner would post."}),e.jsxs("p",{children:[e.jsx("strong",{children:"Bad seed:"}),` "What's the best tool for cold email?" â every mod has seen this a thousand times.`]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Good seed:"}),` "Spent $4k on cold email tools last year â here's what actually worked and what didn't. AMA." Lead with a story, invite discussion, let other commenters bring up product names. You're not a salesperson in your own thread; you're the host.`]}),e.jsx("p",{children:"Post from an account with at least 6 months of activity and visible karma in the subreddit. Engage in comments for the first 24 hours â Google indexes the early comment trajectory."}),e.jsx("h2",{id:"anchor-links",children:"Anchor Text, Links and Crawl Traps"}),e.jsx("p",{children:`Reddit nofollows external links, so don't chase link equity â chase brand mention equity. Plain-text brand mentions ("we use deSHILLER for this") are worth more than linked mentions because Google reads them as unsolicited recommendations rather than promotion.`}),e.jsx("p",{children:"If you do link, use a clean canonical URL â not a UTM-tagged one. UTM strings in Reddit comments are one of the most reliable promotional flags moderators look for."}),e.jsx("h2",{id:"monitoring",children:"Monitoring: Catch New Ranking Threads Within Hours"}),e.jsx("p",{children:"The window between a thread getting posted and Google indexing it as a ranking result is usually 24-72 hours. If you're the second or third comment, you stay near the top forever."}),e.jsxs("p",{children:["Set up alerts for your category keywords on Reddit (the platform's own search plus a Google Alert with ",e.jsx("code",{children:"site:reddit.com"}),"). Better, use a tool that monitors continuously and surfaces the threads worth engaging in."]}),e.jsx("h2",{id:"mistakes",children:"Common Reddit SEO Mistakes"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Treating Reddit like a posting channel instead of a conversation channel"}),e.jsx("li",{children:"Using brand accounts (always lose to personal accounts)"}),e.jsx("li",{children:"Posting in subreddits without reading the rules and last month of removed posts"}),e.jsx("li",{children:"Linking out aggressively or with UTM parameters"}),e.jsx("li",{children:"Ignoring downvotes â a -3 comment is invisible to Google"}),e.jsx("li",{children:"Failing to disclose affiliation"}),e.jsx("li",{children:"Posting near-identical content across multiple subs in quick succession"})]}),e.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 rounded-lg p-8 my-12 text-center",children:[e.jsx("h3",{className:"text-2xl font-display font-bold mb-4",children:"Get Cited in the Reddit Threads Google Already Ranks"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"DESHILLER continuously finds the high-intent Reddit threads in your category, surfaces the ones with SERP traction, and helps you participate without burning your accounts."}),e.jsx(h,{size:"lg",onClick:()=>s("/auth"),children:"Find Ranking Threads in Your Category"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},Gy=()=>{const s=ns(),t=[{id:"restated",text:"Topical Authority, Restated",level:2},{id:"eeat-signals",text:"The Four E-E-A-T Signals",level:2},{id:"map-category",text:"Map Your Category First",level:2},{id:"compounding-loop",text:"The Social-to-Search Loop",level:2},{id:"internal-external",text:"Internal vs External Authority",level:2},{id:"knowledge-graph",text:"What the Knowledge Graph Rewards",level:2},{id:"measurement",text:"Measurement That Survives Audit",level:2},{id:"mistakes",text:"Mistakes That Erase Authority",level:2}],a=[{title:"Generative Engine Optimization (GEO): The 2026 Playbook",description:"Topical authority is the upstream signal that drives GEO citation patterns. Pair the two for compounding visibility.",category:"AI Strategy",readTime:"15 min read",path:"/academy/generative-engine-optimization-guide"},{title:"Reddit SEO: How Reddit Threads Rank #1 on Google",description:"Reddit comments are one of the highest-leverage authority-building surfaces in 2026 SEO.",category:"SEO",readTime:"13 min read",path:"/academy/reddit-seo-rank-on-google"},{title:"Personal Branding for Executives",description:"The named-author authority signal Google's Knowledge Graph rewards starts with personal-brand consistency.",category:"Branding",readTime:"13 min read",path:"/academy/personal-branding-executives"}];return e.jsxs(e.Fragment,{children:[e.jsxs(yt,{children:[e.jsx("title",{children:"Topical Authority Through Social Conversations: The Modern E-E-A-T Playbook | DESHILLER Academy"}),e.jsx("meta",{name:"description",content:"Topical authority is now built off-site as much as on-site. How to use LinkedIn, X and Reddit to send Google and AI engines the E-E-A-T signals that lift every URL on your domain."})]}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("nav",{className:"border-b border-border/40 bg-card/30 backdrop-blur-sm sticky top-0 z-50",children:e.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[e.jsxs(h,{variant:"ghost",onClick:()=>s("/academy"),className:"gap-2",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back to Academy"]}),e.jsx("span",{className:"text-2xl font-display font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"DESHILLER"})]})}),e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-12",children:[e.jsxs("main",{className:"max-w-4xl",children:[e.jsx(it,{category:"SEO",title:"Topical Authority Through Social Conversations",description:"Google and the AI engines don't measure authority by backlinks anymore. They measure it by whether the same humans keep showing up across the same topic â wherever the conversation is happening.",author:{name:"Daniel Park",avatar:"DP",role:"Director of Organic Strategy, deSHILLER",bio:"Built topical authority programs at three Series-B SaaS companies. Spends most of his week thinking about how entity-level signals replace domain-level signals in modern SEO."},publishDate:"2026-05-31",lastUpdated:"2026-06-02",readTime:"14 min read",featuredImage:"https://images.unsplash.com/photo-1552664730-d307ca884978?w=1200&h=600&fit=crop",stats:{views:"9.6K",shares:"421"}}),e.jsxs("article",{className:"prose prose-lg max-w-none mt-12",children:[e.jsx("h2",{id:"restated",children:"Topical Authority, Restated for 2026"}),e.jsx("p",{className:"lead text-xl text-muted-foreground",children:`For a decade, "topical authority" meant covering every subtopic in a category on your own domain â pillar pages, content cluster
313s, internal linking. That model still works, but it's no longer sufficient.`}),e.jsx("p",{children:"Google's algorithm and the LLM rerankers behind AI search now read off-domain signals just as heavily: who talks about you on LinkedIn, which Reddit threads quote you, whether your team members appear in podcasts and panel discussions about the same topic."}),e.jsx("p",{children:"The shift is straightforward: authority used to be a property of a domain. Now it's a property of an entity â a person, a brand, a category â measured across the entire web. E-E-A-T (Experience, Expertise, Authoritativeness, Trust) is the framework Google uses to score that entity. The social web is where most of those signals get generated."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 my-8 not-prose",children:[e.jsx(Ze,{icon:Es,stat:"3.4x",description:"ranking lift on pages bylined by authors with strong cross-platform entity signals vs anonymous content",source:"Authoritas E-E-A-T Author Study 2025"}),e.jsx(Ze,{icon:Na,stat:"72%",description:"of B2B buyers say they researched the named author or company spokesperson before booking a demo",source:"LinkedIn B2B Buying Behavior Report 2026"})]}),e.jsx("h2",{id:"eeat-signals",children:"The Four E-E-A-T Signals You Can Actually Move"}),e.jsx("h3",{children:"Experience"}),e.jsx("p",{children:`First-person accounts. "I tried this, here's what happened." LinkedIn posts from your team's real accounts, Reddit comments that share specifics, X threads with screenshots. Experience signals can only come from people, not from brand pages â which is why personal LinkedIn outperforms company LinkedIn for SEO purposes.`}),e.jsx("h3",{children:"Expertise"}),e.jsx("p",{children:"Demonstrable knowledge. Long comments answering hard technical questions, podcast appearances, conference talks, written long-form. Crucially, expertise compounds when the same person is seen answering questions on the same topic across multiple platforms â Google's Knowledge Graph builds an entity profile that strengthens every page that person is bylined on."}),e.jsx("h3",{children:"Authoritativeness"}),e.jsx("p",{children:"Other people in your category citing you, tagging you, asking your opinion. This is harder to manufacture and easier to ruin. Authority is earned by consistently being helpful, then occasionally being right about something contrarian."}),e.jsx("h3",{children:"Trust"}),e.jsx("p",{children:"The composite. Consistent name, consistent voice, consistent claims across every surface. Mismatches between what your site says, what your team says on LinkedIn, and what third parties say about you erode trust scores faster than any single weak signal can be repaired."}),e.jsx("h2",{id:"map-category",children:"Map Your Category Before You Start Posting"}),e.jsx("p",{children:"Topical authority is built on consistency, not volume. Before any team starts posting, write down the five or six subtopics you want to own â narrowly."}),e.jsx("p",{children:`A B2B sales platform shouldn't try to own "sales." It should own "cold email deliverability," "sales objection handling for technical buyers," "CRM hygiene for outbound teams" â that level of specificity. Every social post, every comment, every podcast pitch maps back to one of those subtopics.`}),e.jsx("p",{children:"The mistake most teams make is letting employees post about anything interesting. Interesting is the enemy of authoritative. Pick the lanes; stay in them for at least two quarters before you measure."}),e.jsx("h2",{id:"compounding-loop",children:"The Social-to-Search Compounding Loop"}),e.jsx("div",{className:"bg-card/50 border border-border/50 rounded-lg p-6 my-8 not-prose",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("th",{className:"text-left py-2",children:"Stage"}),e.jsx("th",{className:"text-left py-2",children:"Timeline"}),e.jsx("th",{className:"text-left py-2",children:"Signal Generated"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Sharp LinkedIn take"}),e.jsx("td",{className:"py-3 text-sm",children:"Week 0"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Authorâtopic association"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Peer engagement, replies"}),e.jsx("td",{className:"py-3 text-sm",children:"Week 1-2"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Social proof, citations"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Roundup article cites post"}),e.jsx("td",{className:"py-3 text-sm",children:"Week 3-6"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Backlink + named-author citation"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"Roundup ranks for keyword"}),e.jsx("td",{className:"py-3 text-sm",children:"Month 2-3"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"SERP visibility, entity reinforcement"})]}),e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-3 font-medium",children:"LinkedIn profile starts ranking"}),e.jsx("td",{className:"py-3 text-sm",children:"Month 3-4"}),e.jsx("td",{className:"py-3 text-sm text-muted-foreground",children:"Direct entity SERP presence"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 font-medium",children:"AI engines cite team member"}),e.jsx("td",{className:"py-3 text-sm",children:"Month 5-6"}),e.jsx("td",{className:"py-3 text-sm text-primary",children:"GEO citation visibility"})]})]})]})}),e.jsx("p",{children:"None of those steps are accidents. They're predictable second-order effects of consistent first-person posting in the right lanes."}),e.jsx("h2",{id:"internal-external",children:"Internal vs External Authority â A Practical Split"}),e.jsxs("p",{children:[e.jsx("strong",{children:"On-site (40%):"}
313)," pillar page per subtopic, 5-8 supporting articles per pillar, consistent author bylines linking to bylined author pages with ",e.jsx("code",{children:"schema.org/Person"})," markup. Author pages should link out to that person's verified LinkedIn and X."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Off-site, owned (30%):"})," personal LinkedIn posts from named team members, X threads, YouTube videos. Owned in the sense that you control the account; off-site in the sense that the URL is on someone else's domain."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Off-site, earned (30%):"})," Reddit comments, Quora answers, podcast guest spots, newsletter mentions, conference talks. This is the part most teams underinvest in because it's slow and hard to attribute."]}),e.jsx(ct,{company:"Vanta (Compliance Automation)",industry:"B2B Security SaaS",challenge:"Strong domain authority for 'SOC 2 compliance' but losing share-of-voice for adjacent subtopics ('ISO 27001 for startups,' 'HIPAA gap analysis,' 'continuous compliance monitoring'). Competitors with smaller content libraries were outranking them because their founders were more visible on LinkedIn and security podcasts.",solution:"Picked 5 subtopics for the next 2 quarters. Assigned each subtopic to a named team member with relevant expertise. Built bylined author hubs with full schema markup and sameAs links. Each named author committed to 3 LinkedIn posts per week and 2 Reddit/security-forum comments per week within their assigned lane. Pitched 12 podcasts in the same window.",results:["Average ranking position across 5 priority subtopics moved from #14 to #6","4 named authors started ranking on page 1 for personal-brand + topic queries","Inbound podcast invitations climbed from 2/month to 11/month","Pages bylined by the 5 authors saw a 47% organic lift independent of new content","Cited in ChatGPT and Perplexity answers for 'best continuous compliance tool' by month 5"],quote:"The shift was treating our team's expertise as the SEO asset, not our blog. Once we structured the program around named authors and locked them into lanes, the rankings followed within two quarters.",author:"VP Marketing, Vanta"}),e.jsx("h2",{id:"knowledge-graph",children:"What Google's Knowledge Graph Actually Rewards"}),e.jsx("p",{children:"Google maintains an entity graph that connects people, organizations and topics. When the graph confidently associates a person with a topic â based on consistent bylined content, social presence and third-party citations â pages bylined by that person rank higher for that topic. The signal is real and measurable."}),e.jsx("p",{children:"To strengthen entity associations:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Use the same name and headshot everywhere"}),e.jsxs("li",{children:["Add ",e.jsx("code",{children:"sameAs"})," links in author schema pointing to LinkedIn, X, GitHub, company bio"]}),e.jsx("li",{children:"Get bylined in publications in your category"}),e.jsx("li",{children:'Have team members give consistent answers to "what do you do?" across every public surface'})]}),e.jsx("h2",{id:"measurement",children:"Measurement That Survives Audit"}),e.jsx("p",{children:"Topical authority is a 6-12 month investment, so the metrics have to be honest about that timeframe. Track:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Average ranking position for your priority subtopic keywords (monthly cohort, not weekly noise)"}),e.jsx("li",{children:"Branded search volume for your team members' names (Google Trends works)"}),e.jsx("li",{children:"Inbound podcast and roundup invitations (leading indicator that authority is compounding)"}),e.jsx("li",{children:"AI-engine citation share for your subtopics"})]}),e.jsx("p",{children:"Don't measure social engagement as the goal. Engagement is the input, not the output. The output is downstream organic and AI visibility â measured cohort by cohort."}),e.jsx("h2",{id:"mistakes",children:"The Mistakes That Erase Authority"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Switching topics chasing what's trending"}),e.jsx("li",{children:"Letting AI write all your social posts in a recognizable AI voice â rerankers now have stylometric detectors and downweight formulaic content"}),e.jsx("li",{children:"Outsourcing thought leadership to ghostwriters who write across competing accounts"}),e.jsx("li",{children:"Using the same boilerplate company bio everywhere instead of tailoring per-person"}),e.jsx("li",{children:"Posting and then disappearing from the comments â the conversation underneath the post is half the signal"})]}),e.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 rounded-lg p-8 my-12 text-center",children:[e.jsx("h3",{className:"text-2xl font-display font-bold mb-4",children:"Build Topical Authority Across Every Conversation in Your Category"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"DESHILLER finds the relevant conversations on LinkedIn, X, Reddit and Quora, drafts authentic responses from your team's named accounts, and tracks the off-site signals that compound into search and AI visibility."}),e.jsx(h,{size:"lg",onClick:()=>s("/auth"),children:"Start Building Topical Authority"})]})]}),e.jsx(lt,{articles:a})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(ot,{items:t})})]})}),e.jsx(_s,{})]})]})},Uy=()=>{const s=[{code:"401",title:"Authentication Failed / Token Expired",symptoms:['"LinkedIn session expired"','"invali
313d_token" error','"Please reconnect your LinkedIn account"'],causes:["Your LinkedIn access token has expired (tokens expire after 60 days)","You revoked app access in LinkedIn settings","Token was invalidated due to password change"],solutions:["Go to Settings â Credentials â LinkedIn",'Click "Disconnect" to remove old credentials','Click "Connect to LinkedIn" to re-authorize'],icon:yi,severity:"warning"},{code:"403",title:"Permission Denied / Missing Scopes",symptoms:['"ACCESS_DENIED" error','"w_member_social" scope missing','"socialActions.CREATE.NO_VERSION"'],causes:['"Share on LinkedIn" product not enabled in your LinkedIn Developer app',"OAuth authorization didn't include posting permissions","LinkedIn app hasn't been approved for posting access"],solutions:["Go to LinkedIn Developer Portal","Select your app â Products tab",'Request "Share on LinkedIn" product access',"Wait for approval (typically 6 hours)","Reconnect your LinkedIn account in DESHILLER"],icon:Tt,severity:"error",hasExternalLink:!0,externalLink:"https://www.linkedin.com/developers/apps",externalLinkText:"Open LinkedIn Developer Portal"},{code:"404",title:"Post Not Found",symptoms:['"Could not find the LinkedIn post"','"ugcPost" not found error','"Post may have been deleted"'],causes:["The LinkedIn post was deleted by its author","The post was made private or visible only to connections","The post URL format is not recognized"],solutions:["Verify the post still exists by opening the URL in a browser","Ensure the post is publicly visible","Use a direct link to the post (not a shared or embedded link)"],icon:Rt,severity:"warning"},{code:"429",title:"Rate Limit Exceeded",symptoms:['"Rate limit exceeded"','"Too many requests"','"Please wait before trying again"'],causes:["You've posted too many comments in a short time","LinkedIn has daily/hourly limits on API actions","Multiple rapid retry attempts"],solutions:["Wait 5-10 minutes before trying again","Reduce the frequency of your engagements","Spread your comments throughout the day"],icon:po,severity:"info"},{code:"500+",title:"LinkedIn Server Error",symptoms:['"LinkedIn servers are experiencing issues"','"Internal server error"',"Timeout errors"],causes:["LinkedIn's servers are temporarily down","API infrastructure issues on LinkedIn's end","Network connectivity problems"],solutions:["Wait a few minutes and try again","Check LinkedIn's status page for outages","If persistent, try disconnecting and reconnecting your account"],icon:st,severity:"info"}],t=[{step:1,title:"Create a LinkedIn Developer App",description:"Go to LinkedIn Developer Portal and create a new application. You'll need a LinkedIn account and a company page.",link:"https://www.linkedin.com/developers/apps/new"},{step:2,title:"Configure OAuth 2.0 Settings",description:"Add the redirect URL from DESHILLER to your app's OAuth 2.0 settings. This allows LinkedIn to send you back after authorization."},{step:3,title:"Request 'Share on LinkedIn' Product",description:"In your app's Products tab, request access to 'Share on LinkedIn'. This is required for posting comments. Approval typically takes 6 hours."},{step:4,title:"Copy Client ID and Secret",description:"From your app's Auth tab, copy the Client ID and Client Secret to use in DESHILLER's credential setup."},{step:5,title:"Connect in DESHILLER",description:"Go to Settings â Credentials â LinkedIn, enter your credentials, and click 'Connect to LinkedIn' to complete OAuth authorization."}];return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs(yt,{children:[e.jsx("title",{children:"LinkedIn API Troubleshooting | DESHILLER"}),e.jsx("meta",{name:"description",content:"Troubleshoot common LinkedIn API errors. Learn how to fix authentication failures, permission issues, and connection problems."})]}),e.jsx(Ya,{}),e.jsxs("main",{className:"container mx-auto px-4 py-12 max-w-4xl",children:[e.jsxs(Ls,{to:"/dashboard",className:"inline-flex items-center gap-2 text-muted-foreground hover:text-foreground mb-8 transition-colors",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Back to Dashboard"]}),e.jsx("div",{className:"mb-12",children:e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"p-3 rounded-xl bg-[#0077B5]/10",children:e.jsx(Zs,{className:"h-8 w-8 text-[#0077B5]"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:"LinkedIn Troubleshooting"}),e.jsx("p",{className:"text-muted-foreground",children:"Common errors and how to fix them"})]})]})}),e.jsxs(Xt,{className:"mb-8 border-primary/20 bg-primary/5",children:[e.jsx(Va,{className:"h-4 w-4"}
313),e.jsx(_a,{children:"Quick Links"}),e.jsxs(Qt,{className:"mt-2 flex flex-wrap gap-2",children:[e.jsx(h,{variant:"outline",size:"sm",asChild:!0,children:e.jsxs("a",{href:"https://www.linkedin.com/developers/apps",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1",children:["Developer Portal ",e.jsx(Ys,{className:"h-3 w-3"})]})}),e.jsx(h,{variant:"outline",size:"sm",asChild:!0,children:e.jsxs("a",{href:"https://www.linkedin-status.com/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1",children:["LinkedIn Status ",e.jsx(Ys,{className:"h-3 w-3"})]})}),e.jsx(h,{variant:"outline",size:"sm",asChild:!0,children:e.jsx(Ls,{to:"/dashboard",children:"Reconnect Account"})})]})]}),e.jsxs("section",{className:"mb-12",children:[e.jsx("h2",{className:"text-2xl font-semibold mb-6",children:"Common Errors"}),e.jsx("div",{className:"space-y-4",children:s.map(a=>e.jsxs(U,{className:"overflow-hidden",children:[e.jsx(Be,{className:"pb-3",children:e.jsx("div",{className:"flex items-start justify-between",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`p-2 rounded-lg ${a.severity==="error"?"bg-destructive/10 text-destructive":a.severity==="warning"?"bg-amber-500/10 text-amber-600":"bg-muted text-muted-foreground"}`,children:e.jsx(a.icon,{className:"h-5 w-5"})}),e.jsx("div",{children:e.jsxs($e,{className:"text-lg flex items-center gap-2",children:[a.title,e.jsx(W,{variant:"outline",className:"font-mono text-xs",children:a.code})]})})]})})}),e.jsxs(ye,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Symptoms"}),e.jsx("ul",{className:"space-y-1",children:a.symptoms.map((r,o)=>e.jsxs("li",{className:"text-sm flex items-start gap-2",children:[e.jsx(qt,{className:"h-3 w-3 mt-1 text-amber-500 flex-shrink-0"}),e.jsx("code",{className:"text-xs bg-muted px-1.5 py-0.5 rounded",children:r})]},o))})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Possible Causes"}),e.jsx("ul",{className:"space-y-1",children:a.causes.map((r,o)=>e.jsxs("li",{className:"text-sm flex items-start gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"â¢"}),r]},o))})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"How to Fix"}),e.jsx("ol",{className:"space-y-1",children:a.solutions.map((r,o)=>e.jsxs("li",{className:"text-sm flex items-start gap-2",children:[e.jsxs("span",{className:"text-primary font-medium",children:[o+1,"."]}
313),r]},o))}),a.hasExternalLink&&e.jsx(h,{variant:"outline",size:"sm",className:"mt-3",asChild:!0,children:e.jsxs("a",{href:a.externalLink,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1",children:[a.externalLinkText," ",e.jsx(Ys,{className:"h-3 w-3"})]})})]})]})]},a.code))})]}),e.jsxs("section",{className:"mb-12",children:[e.jsx("h2",{className:"text-2xl font-semibold mb-6",children:"LinkedIn App Setup Checklist"}),e.jsxs(U,{children:[e.jsxs(Be,{children:[e.jsx($e,{className:"text-lg",children:"Complete these steps to enable LinkedIn posting"}),e.jsx(os,{children:"If you haven't set up a LinkedIn Developer app yet, follow this guide."})]}),e.jsx(ye,{children:e.jsx("div",{className:"space-y-4",children:t.map(a=>e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 text-primary flex items-center justify-center font-semibold text-sm",children:a.step}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-medium",children:a.title}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:a.description}),a.link&&e.jsxs("a",{href:a.link,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm text-primary hover:underline mt-2",children:["Open Link ",e.jsx(Ys,{className:"h-3 w-3"})]})]})]},a.step))})})]})]}),e.jsxs("section",{className:"mb-12",children:[e.jsx("h2",{className:"text-2xl font-semibold mb-6",children:"Important Notes"}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(U,{className:"border-amber-500/20 bg-amber-500/5",children:[e.jsx(Be,{className:"pb-2",children:e.jsxs($e,{className:"text-base flex items-center gap-2",children:[e.jsx(po,{className:"h-4 w-4 text-amber-600"}),"Approval Time"]})}),e.jsx(ye,{children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:['The "Share on LinkedIn" product typically takes ',e.jsx("strong",{children:"6 hours"})," to be approved after you request it. You cannot post comments until approval is complete."]})})]}),e.jsxs(U,{className:"border-primary/20 bg-primary/5",children:[e.jsx(Be,{className:"pb-2",children:e.jsxs($e,{className:"text-base flex items-center gap-2",children:[e.jsx(_t,{className:"h-4 w-4 text-primary"}),"Token Expiry"]})}),e.jsx(ye,{children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["LinkedIn access tokens expire after ",e.jsx("strong",{children:"60 days"}),". You'll need to reconnect your account periodically to maintain access."]})})]}),e.jsxs(U,{className:"border-green-500/20 bg-green-500/5",children:[e.jsx(Be,{className:"pb-2",children:e.jsxs($e,{className:"text-base flex items-center gap-2",children:[e.jsx(ys,{className:"h-4 w-4 text-green-600"}),"Required Scopes"]})}),e.jsx(ye,{children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["DESHILLER requests: ",e.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:"openid"}),", ",e.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:"profile"}),", ",e.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:"email"}),", and ",e.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:"w_member_social"})," scopes."]})})]}),e.jsxs(U,{className:"border-blue-500/20 bg-blue-500/5",children:[e.jsx(Be,{className:"pb-2",children:e.jsxs($e,{className:"text-base flex items-center gap-2",children:[e.jsx(st,{className:"h-4 w-4 text-blue-600"}),"When in Doubt"]})}),e.jsx(ye,{children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"If nothing else works, disconnect and reconnect your LinkedIn account. This forces a fresh OAuth flow and refreshes all tokens."})})]})]})]}),e.jsx(U,{className:"bg-muted/50",children:e.jsxs(ye,{className:"py-6 text-center",children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Still having issues?"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Contact support with your error message and we'll help you troubleshoot."}),e.jsx(h,{asChild:!0,children:e.jsx("a",{href:"mailto:[email protected]",children:"Contact Support"})})]})})]}),e.jsx(_s,{})]})}
313,Wy=()=>{const s=ns(),[t,a]=i.useState(0),r=[{label:"Product Showcase",platform:"LinkedIn",size:"1200 à 628",mockup:e.jsxs("div",{className:"aspect-[16/9] rounded-lg bg-gradient-to-br from-[hsl(var(--primary)/0.12)] to-[hsl(var(--accent)/0.08)] p-6 flex flex-col justify-between relative overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/20 flex items-center justify-center",children:e.jsx(es,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold",children:"Acme Analytics"}),e.jsx("p",{className:"text-[9px] text-muted-foreground",children:"Product update"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-lg font-bold leading-tight mb-1",children:"We just shipped v2.0 ð"}),e.jsx("p",{className:"text-[11px] text-muted-foreground mb-3",children:"3à faster · Real-time dashboards · Team collaboration"}),e.jsx("div",{className:"inline-flex px-3 py-1 rounded-full bg-primary/15 text-primary text-[10px] font-medium",children:"Try free â"})]}),e.jsx("div",{className:"absolute top-3 right-3 px-2 py-0.5 rounded bg-background/60 text-[9px] text-muted-foreground backdrop-blur-sm",children:"1200 à 628"})]})},{label:"Quote Card",platform:"X / Twitter",size:"1600 à 900",mockup:e.jsxs("div",{className:"aspect-[16/9] rounded-lg bg-gradient-to-b from-card to-background p-6 flex flex-col items-center justify-center text-center relative overflow-hidden border border-border/20",children:[e.jsx(Or,{className:"h-6 w-6 text-primary/30 mb-3"}),e.jsx("p",{className:"text-base font-semibold leading-snug max-w-[85%] mb-3",children:`"The best marketing doesn't feel like marketing."`}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-full bg-primary/20"}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"@acmeanalytics"})]}),e.jsx("div",{className:"absolute top-3 right-3 px-2 py-0.5 rounded bg-background/60 text-[9px] text-muted-foreground backdrop-blur-sm",children:"1600 à 900"})]})},{label:"Carousel",platform:"LinkedIn + Instagram",size:"1080 à 1080",mockup:e.jsxs("div",{className:"aspect-square rounded-lg bg-gradient-to-br from-[hsl(var(--accent)/0.08)] to-[hsl(var(--primary)/0.06)] p-5 flex flex-col justify-between relative overflow-hidden border border-border/20",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:"Slide 1 of 4"}),e.jsx(qa,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("h4",{className:"text-base font-bold",children:"Why Users Churn"}),e.jsx("p",{className:"text-[11px] text-muted-foreground max-w-[80%] mx-auto",children:"84% of churn happens in the first 7 days. Here's what founders get wrong."})]}),e.jsx("div",{className:"flex items-center justify-center gap-1.5",children:[0,1,2,3].map(o=>e.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${o===0?"bg-primary":"bg-muted-foreground/25"}`},o))}),e.jsx("div",{className:"absolute top-3 right-3 px-2 py-0.5 rounded bg-background/60 text-[9px] text-muted-foreground backdrop-blur-sm",children:"1080 à 1080"})]})},{label:"Motion Graphic",platform:"All platforms",size:"1920 à 1080",mockup:e.jsxs("div",{className:"aspect-[16/9] rounded-lg bg-gradient-to-br from-background to-card p-6 flex flex-col justify-between relative overflow-hidden border border-border/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Yn,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:"5-second MP4"})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-20 h-20 rounded-2xl bg-primary/10 flex items-center justify-center",children:e.jsx(es,{className:"h-8 w-8 text-primary"})}),e.jsx("div",{className:"absolute -inset-3 rounded-3xl border border-primary/20 animate-pulse"}),e.jsx("div",{className:"absolute -inset-6 rounded-[2rem] border border-primary/10 animate-pulse",style:{animationDelay:"0.5s"}})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex gap-1.5",children:["Ken Burns","Text overlay","Logo intro"].map((o,n)=>e.jsx("span",{className:"text-[8px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:o},n))}),e.jsx("span",{className:"text-[9px] text-muted-foreground",children:"1920 à 1080"})]})]})}
313,{label:"Story / Reel",platform:"Instagram + TikTok",size:"1080 à 1920",mockup:e.jsxs("div",{className:"aspect-[9/16] max-h-[280px] rounded-lg bg-gradient-to-b from-primary/8 to-card p-4 flex flex-col justify-between relative overflow-hidden border border-border/20 mx-auto",children:[e.jsxs("div",{className:"text-center pt-4",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground mb-1",children:"@acmeanalytics"}),e.jsx("div",{className:"w-10 h-10 rounded-full bg-primary/15 mx-auto mb-2 flex items-center justify-center",children:e.jsx(es,{className:"h-5 w-5 text-primary"})})]}),e.jsxs("div",{className:"text-center space-y-1.5",children:[e.jsx("h4",{className:"text-sm font-bold",children:"Did you know?"}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"73% of B2B buyers check social before purchasing"}),e.jsx("div",{className:"inline-flex px-2.5 py-1 rounded-full bg-primary/15 text-primary text-[9px] font-medium",children:"Swipe up â"})]}),e.jsx("div",{className:"h-1 bg-muted rounded-full",children:e.jsx("div",{className:"h-full w-1/3 bg-primary rounded-full"})})]})}];return i.useEffect(()=>{const o=setInterval(()=>a(n=>(n+1)%r.length),4e3);return()=>clearInterval(o)},[]),e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(Ma,{}),e.jsx("section",{className:"pt-32 pb-16 px-6 lg:px-8",children:e.jsxs("div",{className:"max-w-5xl mx-auto text-center",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-primary/10 border border-primary/20 text-primary text-sm font-medium mb-6",children:[e.jsx(Oi,{className:"h-4 w-4"}),"Coming Soon"]}),e.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-display font-semibold leading-[1.1] tracking-tight mb-6",children:"Your AI Creative Agency"}),e.jsx("p",{className:"text-muted-foreground text-lg max-w-2xl mx-auto leading-relaxed mb-10",children:"Upload brand assets. AI generates platform-ready creatives â product showcases, quote cards, carousels, and motion graphics. Then auto-posts them via the extension."}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[e.jsxs(h,{size:"lg",onClick:()=>s("/auth"),className:"rounded-full px-8 bg-primary text-primary-foreground hover:bg-primary/90",children:["Join the Waitlist ",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]}),e.jsx(h,{size:"lg",variant:"outline",onClick:()=>{var o;return(o=document.getElementById("examples"))==null?void 0:o.scrollIntoView({behavior:"smooth"})},className:"rounded-full px-8",children:"See Examples"})]})]})}),e.jsx("section",{id:"examples",className:"py-20 px-6 lg:px-8 border-t border-border/50",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h2",{className:"text-3xl md:text-4xl font-display font-semibold mb-3",children:"5 creative formats, zero design skills"}),e.jsx("p",{className:"text-muted-foreground max-w-xl mx-auto",children:"Every format auto-sized for the target platform. Click to preview."})]}),e.jsxs("div",{className:"grid lg:grid-cols-[1fr_420px] gap-8 items-start",children:[e.jsx("div",{className:"space-y-2.5",children:r.map((o,n)=>e.jsxs("button",{onClick:()=>a(n),className:`w-full text-left p-4 rounded-xl border transition-all duration-300 flex items-center gap-4 ${t===n?"border-primary/40 bg-primary/5":"border-border/30 bg-card/30 hover:border-border/60"}`,children:[e.jsxs("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0 ${t===n?"bg-primary/15":"bg-muted/50"}`,children:[n===0&&e.jsx(ga,{className:`h-5 w-5 ${t===n?"text-primary":"text-muted-foreground"}`}),n===1&&e.jsx(Or,{className:`h-5 w-5 ${t===n?"text-primary":"text-muted-foreground"}`}),n===2&&e.jsx(qa,{className:`h-5 w-5 ${t===n?"text-primary":"text-muted-foreground"}`}),n===3&&e.jsx(Yn,{className:`h-5 w-5 ${t===n?"text-primary":"text-muted-foreground"}`}),n===4&&e.jsx(Hc,{className:`h-5 w-5 ${t===n?"text-primary":"text-muted-foreground"}`})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-sm font-semibold",children:o.label}),e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[o.platform," · ",o.size]})]}),t===n&&e.jsx("div",{className:"w-1.5 h-8 rounded-full bg-primary"})]},n))}),e.jsx("div",{className:"sticky top-24",children:e.jsxs("div",{className:"rounded-2xl border border-border/40 bg-card/80 backdrop-blur-sm overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border/30 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-primary/40"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-muted"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-muted"})]}),e.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[r[t].label," â ",r[t].platform]})]}),e.jsx("div",{className:"p-4",children:r[t].mockup})]})})]})]})}),e.jsx("section",{className:"py-20 px-6 lg:px-8 border-t border-border/50 bg-card/20",children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-3xl md:text-4xl font-display font-semibold mb-3",children:"From raw assets to live posts"}),e.jsx("p",{className:"text-muted-foreground",children:"Four steps. No designers. No templates. No Canva."})]}),e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-6",children:[{icon:An,title:"Upload Brand Kit",desc:"Logos, product shots, colors, and tone guidelines"},{icon:es,title:"AI Generates",desc:"Platform-optimized images, carousels, and motion clips"}
313,{icon:Bt,title:"Preview & Edit",desc:"See mockups per platform, regenerate or tweak"},{icon:At,title:"Auto-Post",desc:"Schedule and post via the DESHILLER extension"}].map((o,n)=>e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"p-5 rounded-xl border border-border/30 bg-card/40 h-full",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center mb-3",children:e.jsx(o.icon,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{className:"text-[10px] text-primary font-semibold mb-1",children:["Step ",n+1]}),e.jsx("h3",{className:"text-sm font-semibold mb-1",children:o.title}),e.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:o.desc})]}),n<3&&e.jsx("div",{className:"hidden lg:block absolute top-1/2 -right-3 w-6 h-px bg-border/50"})]},n))})]})}),e.jsx("section",{className:"py-20 px-6 lg:px-8 border-t border-border/50",children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-3xl md:text-4xl font-display font-semibold mb-3",children:"Under the hood"}),e.jsx("p",{className:"text-muted-foreground",children:"Serious technology for serious creators."})]}),e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[{icon:ga,title:"AI Image Gen",desc:"Flux-powered generation from text prompts + your brand assets"},{icon:Yn,title:"In-Browser Video",desc:"ffmpeg-wasm stitches 3-5 frames into 5-15s MP4s with Ken Burns effects"},{icon:In,title:"Brand Kit Engine",desc:"Colors, logos, and tone locked in â every creative stays on-brand"},{icon:cn,title:"Platform Sizing",desc:"Auto-resized for LinkedIn, X, Instagram, Facebook â pixel-perfect"},{icon:qa,title:"Batch Mode",desc:"4 variations per prompt. Pick the best, regenerate the rest"},{icon:Cs,title:"Smart Scheduling",desc:"Posts queued at optimal times per platform via the extension"}].map((o,n)=>e.jsxs("div",{className:"p-5 rounded-xl border border-border/30 bg-card/40",children:[e.jsx(o.icon,{className:"h-5 w-5 text-primary mb-3"}),e.jsx("h3",{className:"text-sm font-semibold mb-1",children:o.title}),e.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:o.desc})]},n))})]})}),e.jsx("section",{className:"py-20 px-6 lg:px-8 border-t border-border/50",children:e.jsxs("div",{className:"max-w-2xl mx-auto text-center",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-accent/10 border border-accent/20 text-accent text-sm font-medium mb-6",children:[e.jsx(ys,{className:"h-4 w-4"}),"In Active Development"]}),e.jsx("h2",{className:"text-3xl md:text-4xl font-display font-semibold mb-4",children:"Be the first to create with AI"}),e.jsx("p",{className:"text-muted-foreground text-lg mb-8 max-w-xl mx-auto",children:"Creative Studio launches soon. Join the waitlist for early access."}),e.jsxs(h,{size:"lg",onClick:()=>s("/auth"),className:"rounded-full px-10 bg-primary text-primary-foreground hover:bg-primary/90 text-base",children:["Get Early Access ",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]})]})}),e.jsx(_s,{})]})},Fa=[{id:1,area:"Setup",flow:"Open /dashboard â Cold Reach with extension NOT installed.",expected:"Coach banner shows 'Install the extension'. Discover tab still loads.",singleTab:null},{id:2,area:"Setup",flow:"Install extension â reload. Bridge PING â PONG.",expected:"Coach banner clears. Header pill shows 'Extension connected â'.",singleTab:null},{id:3,area:"Discover",flow:"Search: 'founders at seed-stage AI startups in NYC'.",expected:"Prospects render; AI enrichment auto-runs; cards show hook / pains / email guess + confidence.",singleTab:null},{id:4,area:"Enrich",flow:"Edit a hook in EnrichmentReviewCard â approve.",expected:"DM/Email lock unlocks; live preview updates and highlights the edited hook.",singleTab:null},{id:5,area:"Enrich",flow:"Bulk approve 3 prospects, reject 1.",expected:"All 3 unlock at once; toolbar counter updates; rejected stays locked + greyed.",singleTab:null},{id:6,area:"DM",flow:"Approve LinkedIn DM â 'Send via extension' on 3 prospects sequentially.",expected:"Same tab is reused for all 3. No popup window. Each navigates â sends â moves on.",singleTab:!0},{id:7,area:"Email",flow:"Approve Email for 3 prospects â 'Send all'.",expected:"send-cold-email queues; toast confirms; cold_email_campaigns rows created.",singleTab:null},{id:8,area:"DM",flow:"Trigger LinkedIn premium block (free account).",expected:"DM returns requiresPremium; coach surfaces 'switch to Email' suggestion + Troubleshoot button.",singleTab:!0},{id:9,area:"Hot Now",flow:"Hot Now tab â Run scan â click hot signal â 'Use signal'.",expected:"Returns to Discover with prospect + hook pre-filled in the input.",singleTab:null},{id:10,area:"Hot Now",flow:"Manually pause / dismiss a signal in Hot Now â reload page.",expected:"State persists (manual_status column written).",singleTab:null},{id:11,area:"Warm Path",flow:"Open Warm Path dialog from OutreachCard
313warm badge â fill mutual contact â Generate intro â Send via extension.",expected:"Same shared tab navigates to mutual contact's profile, sends intro DM, returns success.",singleTab:!0},{id:12,area:"Inbox",flow:"Insert a cold_email_campaigns row with replied_at set.",expected:"Inbox shows reply with intent badge from reply-classifier. Sequence auto-pauses.",singleTab:null},{id:13,area:"Resilience",flow:"Send 5 DMs in rapid succession.",expected:"Tab id stays constant across all 5 in service-worker logs. RELEASE_COLD_REACH_TAB closes it after.",singleTab:!0},{id:14,area:"Resilience",flow:"Close the Cold Reach tab mid-batch.",expected:"Service worker recreates it once and continues; coach banner shows 'Tab was closed â resumed in a fresh tab.'",singleTab:!0}],wl="cold_reach_qa_state_v1",Vy=4*1024*1024,tn=()=>{const s={};for(const t of Fa)s[t.id]={status:"todo",notes:"",screenshots:[],expanded:!1};return s};async function Yy(s){const t=s.includes(",")?s.slice(s.indexOf(",")+1):s;if(typeof crypto<"u"&&crypto.subtle){const r=new TextEncoder().encode(t),o=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(o)).map(n=>n.toString(16).padStart(2,"0")).join("")}let a=0;for(let r=0;r<t.length;r++)a=(a<<5)-a+t.charCodeAt(r)|0;return`fallback_${a}_${t.length}`}function kl(s){const t={};for(const n of Fa){const l=s[n.id];l&&(l.status==="todo"&&!l.notes||(t[n.id]=[l.status,l.notes||""]))}const r=JSON.stringify({v:1,s:t});return btoa(unescape(encodeURIComponent(r))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ky(s){try{const t=s.replace(/-/g,"+").replace(/_/g,"/")+"===".slice((s.length+3)%4),a=decodeURIComponent(escape(atob(t))),r=JSON.parse(a);return(r==null?void 0:r.v)!==1||typeof r.s!="object"?null:r}catch{return null}}const Ar={todo:{label:"Pending",className:"border-border",chipClassName:"bg-muted text-muted-foreground"},pass:{label:"Pass",className:"border-emerald-500/40 bg-emerald-500/5",chipClassName:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400"},fail:{label:"Fail",className:"border-destructive/40 bg-destructive/5",chipClassName:"bg-destructive/15 text-destructive"},skip:{label:"Skip",className:"border-border bg-muted/30",chipClassName:"bg-muted text-muted-foreground"}};function Xy(){const[s,t]=i.useState(tn),[a,r]=i.useState(!1),o=i.useRef({});i.useEffect(()=>{try{const j=(typeof window<"u"?window.location.hash:"").match(/#share=([^&]+)/);if(j){const N=Ky(decodeURIComponent(j[1]));if(N){const f=tn();for(const R of Fa){const M=N.s[R.id];M&&(f[R.id]={...f[R.id],status:M[0],notes:M[1],expanded:M[0]==="fail"})}t(f),k.success("Loaded shared QA state â screenshots not included."),history.replaceState(null,"",window.location.pathname+window.location.search),r(!0);return}k.error("This share link is invalid or corrupted.")}const y=localStorage.getItem(wl);if(y){const N=JSON.parse(y),f=tn();for(const R of Fa)N[R.id]&&(f[R.id]={...f[R.id],...N[R.id]});t(f)}}catch{}finally{r(!0)}},[]),i.useEffect(()=>{if(a)try{localStorage.setItem(wl,JSON.stringify(s))}catch{k.error("Couldn't save â local storage is full. Remove some screenshots.")}},[s,a]);const n=i.useMemo(()=>{var j;const C={pass:0,fail:0,skip:0,todo:0};for(const y of Fa)C[((j=s[y.id])==null?void 0:j.status)??"todo"]++;return C},[s]),l=Math.round((n.pass+n.fail+n.skip)/Fa.length*100),c=(C,j)=>{t(y=>({...y,[C]:{...y[C],status:j,expanded:j==="fail"?!0:y[C].expanded}}))},x=(C,j)=>{t(y=>({...y,[C]:{...y[C],notes:j}}))},d=C=>{t(j=>({...j,[C]:{...j[C],expanded:!j[C].expanded}}))},u=(C,j)=>{if(!j||j.length===0)return;const y=Array.from(j).map(N=>new Promise((f,R)=>{if(!N.type.startsWith("image/")){R(new Error(`${N.name} is not an image`));return}const M=new FileReader;M.onload=async()=>{const q=String(M.result),_=await Yy(q);f({name:N.name,dataUrl:q,hash:_})},M.onerror=()=>R(M.error??new Error("Failed to read file")),M.readAsDataURL(N)}));Promise.all(y).then(N=>{t(f=>{const R=new Set(f[C].screenshots.map(I=>I.hash).filter(Boolean)),M=new Set,q=[],_=[],A=[];for(const I of N){if(R.has(I.hash)){_.push(I.name);continue}if(M.has(I.hash)){A.push(I.name);continue}M.add(I.hash),q.push(I)}if(_.length>0&&k.warning(_.length===1?`Skipped duplicate: "${_[0]}" is already attached to this step.`:`Skipped ${_.length} duplicates already attached to this step.`),A.length>0&&k.warning(`Skipped ${A.length} duplicate${A.length>
3131?"s":""} within this upload.`),q.length===0)return f;const B={...f,[C]:{...f[C],screenshots:[...f[C].screenshots,...q],expanded:!0}};return JSON.stringify(B).length>Vy&&k.warning("Approaching local-storage limit â consider exporting and clearing screenshots soon."),k.success(`Added ${q.length} screenshot${q.length>1?"s":""}`),B})}).catch(N=>k.error((N==null?void 0:N.message)??"Failed to add screenshots"))},m=(C,j)=>{t(y=>({...y,[C]:{...y[C],screenshots:y[C].screenshots.filter((N,f)=>f!==j)}}))},p=()=>{confirm("Reset all checklist state, notes, and screenshots? This can't be undone.")&&(t(tn()),k.success("Checklist reset"))},g=()=>{const j=["# Cold Reach AâZ QA Report",`Generated: ${new Date().toISOString()}`,"",`**Summary:** ${n.pass} pass · ${n.fail} fail · ${n.skip} skip · ${n.todo} pending (${l}% complete)`,"","| # | Area | Status | Single-tab | Flow | Expected | Notes | Screenshots |","|---|------|--------|------------|------|----------|-------|-------------|"],y=Fa.map(N=>{const f=s[N.id],R=(f.notes||"").replace(/\n/g," <br/> ").replace(/\|/g,"\\|");return`| ${N.id} | ${N.area} | ${f.status.toUpperCase()} | ${N.singleTab===!0?"â ":N.singleTab===!1?"â":"â"} | ${N.flow.replace(/\|/g,"\\|")} | ${N.expected.replace(/\|/g,"\\|")} | ${R||"â"} | ${f.screenshots.length} |`});return[...j,...y].join(` 314`)},v=async()=>{try{await navigator.clipboard.writeText(g()),k.success("Markdown report copied to clipboard")}catch{k.error("Couldn't copy â try Export instead")}},b=()=>{const C=g(),j=new Blob([C],{type:"text/markdown"}),y=document.createElement("a");y.href=URL.createObjectURL(j),y.download=`cold-reach-qa-${new Date().toISOString().slice(0,10)}.md`,y.click(),URL.revokeObjectURL(y.href),k.success("Report downloaded")},z=async()=>{try{const C=kl(s),j=`${window.location.origin}${window.location.pathname}#share=${C}`;j.length>6e3&&k.warning("Link is long â some chat apps may truncate it. Consider trimming long notes."),await navigator.clipboard.writeText(j),k.success("Share link copied â screenshots are not included, only statuses + notes.")}catch(C){try{const j=kl(s),y=`${window.location.origin}${window.location.pathname}#share=${j}`;window.prompt("Copy this share link:",y)}catch{k.error((C==null?void 0:C.message)??"Couldn't generate share link")}}};return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ls,{to:"/dashboard",children:e.jsxs(h,{variant:"ghost",size:"sm",className:"gap-1",children:[e.jsx(Ts,{className:"h-4 w-4"})," Dashboard"]})}),e.jsx("div",{className:"h-5 w-px bg-border"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-primary/15 flex items-center justify-center",children:e.jsx(gu,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Cold Reach AâZ QA"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Walk every Cold Reach flow end-to-e
314nd and capture evidence."})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(h,{variant:"ghost",size:"sm",onClick:p,className:"gap-1.5 text-muted-foreground",children:[e.jsx(Dr,{className:"h-3.5 w-3.5"})," Reset"]}),e.jsxs(h,{variant:"outline",size:"sm",onClick:z,className:"gap-1.5",children:[e.jsx(Lc,{className:"h-3.5 w-3.5"})," Share link"]}),e.jsxs(h,{variant:"outline",size:"sm",onClick:v,className:"gap-1.5",children:[e.jsx(ta,{className:"h-3.5 w-3.5"})," Copy report"]}),e.jsxs(h,{size:"sm",onClick:b,className:"gap-1.5",children:[e.jsx(Ut,{className:"h-3.5 w-3.5"})," Export .md"]})]})]}),e.jsxs(U,{className:"p-4 mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 flex-wrap gap-2",children:[e.jsxs("p",{className:"text-sm font-medium text-foreground",children:[l,"% complete"]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(W,{variant:"outline",className:Ar.pass.chipClassName,children:[n.pass," pass"]}),e.jsxs(W,{variant:"outline",className:Ar.fail.chipClassName,children:[n.fail," fail"]}),e.jsxs(W,{variant:"outline",className:Ar.skip.chipClassName,children:[n.skip," skip"]}),e.jsxs(W,{variant:"outline",className:Ar.todo.chipClassName,children:[n.todo," pending"]})]})]}),e.jsx(zt,{value:l,className:"h-2"})]}),e.jsx("div",{className:"space-y-2.5",children:Fa.map(C=>{const j=s[C.id],y=Ar[j.status];return e.jsx(U,{className:Z("border transition-colors",y.className),children:e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("button",{onClick:()=>d(C.id),className:"flex items-center gap-1.5 shrink-0 group","aria-label":j.expanded?"Collapse":"Expand",children:[j.expanded?e.jsx(nt,{className:"h-4 w-4 text-muted-foreground group-hover:text-foreground"}):e.jsx($t,{className:"h-4 w-4 text-muted-foreground group-hover:text-foreground"}),e.jsx("div",{className:"w-7 h-7 rounded-full bg-card border border-border text-xs font-semibold text-foreground flex items-center justify-center",children:C.id})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[e.jsx(W,{variant:"secondary",className:"text-[10px] uppercase tracking-wide",children:C.area}
314),C.singleTab===!0&&e.jsx(W,{variant:"outline",className:"text-[10px] border-primary/40 text-primary",children:"single-tab"}),e.jsx(W,{variant:"outline",className:Z("text-[10px]",y.chipClassName),children:y.label})]}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:C.flow}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[e.jsx("span",{className:"font-medium text-foreground/70",children:"Expected:"})," ",C.expected]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx(h,{size:"icon",variant:j.status==="pass"?"default":"ghost",className:Z("h-8 w-8",j.status==="pass"&&"bg-emerald-500 hover:bg-emerald-600 text-white"),onClick:()=>c(C.id,j.status==="pass"?"todo":"pass"),title:"Mark pass",children:e.jsx(bs,{className:"h-4 w-4"})}),e.jsx(h,{size:"icon",variant:j.status==="fail"?"destructive":"ghost",className:"h-8 w-8",onClick:()=>c(C.id,j.status==="fail"?"todo":"fail"),title:"Mark fail",children:e.jsx(zs,{className:"h-4 w-4"})}),e.jsx(h,{size:"icon",variant:j.status==="skip"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>c(C.id,j.status==="skip"?"todo":"skip"),title:"Skip",children:e.jsx(Dc,{className:"h-4 w-4"})})]})]}),j.expanded&&e.jsxs("div",{className:"mt-4 pl-10 space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-foreground mb-1.5 block",children:"Log notes"}),e.jsx(Vs,{value:j.notes,onChange:N=>x(C.id,N.target.value),placeholder:"Console output, network response, observationsâ¦",className:"text-xs font-mono min-h-[80px] bg-background"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsxs("label",{className:"text-xs font-medium text-foreground",children:["Screenshots (",j.screenshots.length,")"]}),e.jsx("input",{ref:N=>o.current[C.id]=N,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:N=>{u(C.id,N.target.files),N.target&&(N.target.value="")}}),e.jsxs(h,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5",onClick:()=>{var N;return(N=o.current[C.id])==null?void 0:N.click()},children:[e.jsx(Ni,{className:"h-3.5 w-3.5"})," Add screenshot"]})]}),j.screenshots.length>0&&e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-2",children:j.screenshots.map((N,f)=>e.jsxs("div",{className:"relative group rounded-md overflow-hidden border border-border bg-muted",children:[e.jsx("img",{src:N.dataUrl,alt:N.name,className:"w-full h-24 object-cover"}),e.jsx("button",{onClick:()=>m(C.id,f),className:"absolute top-1 right-1 h-6 w-6 rounded bg-background/90 border border-border flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity","aria-label":`Remove ${N.name}`,children:e.jsx(ua,{className:"h-3 w-3 text-destructive"})}),e.jsx("p",{className:"absolute bottom-0 inset-x-0 px-1 py-0.5 text-[10px] text-white bg-gradient-to-t from-black/80 to-transparent truncate",children:N.name})]},f))})]})]})]})},C.id)})}),e.jsx("p",{className:"text-xs text-muted-foreground text-center mt-6",children:"State is saved locally in your browser. Export the report when you're done â screenshots are not included in the markdown export, but their counts are."})]})})}const Sl="deshiller_publish_extension_progress_v1";function fr({text:s,label:t}){return e.jsxs("div",{className:"rounded-md border border-border/60 bg-muted/40 p-3 flex items-start gap-2",children:[e.jsx("pre",{className:"text-xs whitespace-pre-wrap flex-1 font-mono text-foreground/90",children:s}),e.jsx(h,{size:"sm",variant:"ghost",className:"h-7 shrink-0",onClick:async()=>{await navigator.clipboard.writeText(s),k.success(t?`${t} copied`:"Copied to clipboard")},children:e.jsx(ta,{className:"h-3.5 w-3.5"})})]})}function Ir({href:s,children:t}){return e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"inline-flex",children:e.jsxs(h,{size:"sm",variant:"outline",className:"gap-1.5",children:[t,e.jsx(Ys,{className:"h-3.5 w-3.5"})]})})}const Qy="deSHILLER â AI Marketing Agency",Jy="Your AI marketing agency in a browser. Discover relevant conversations and draft on-brand replies in seconds.",Zy=`deSHILLER turns your browser into an AI-powered marketing agency. 315 316WHAT IT DOES 317⢠Surfaces relevant conversations on the social platforms you already use 318⢠Drafts on-brand replies and direct messages that match your tone of voice 319⢠Helps you engage with prospects without leaving the page you're on 320⢠Connects to your deSHILLER dashboard for outreach, lead pipelines and analytics 321 322HOW IT WORKS 3231. Install the extension and connect it to your deSHILLER account 3242. Set your product profile and tone of voice in the dashboard 3253. Browse normally â deSHILLER surfaces high-intent posts and one-click replies inside your existing feed 326 327PRIVACY 328deSHILLER only activates on the sites listed in the permissions. It never reads your messages in the background and never sends data to any third party other than your own deSHILLER workspace. 329 330LEARN MORE 331https://deshiller.com`,ev=`storage â Saves your dashboard connection token and per-platform preferences locally s
331o you don't sign in on every page load. 332 333activeTab â Lets the user trigger an action (e.g. "Reply with deSHILLER") on the tab they're currently viewing. 334 335tabs â Used to open and reuse a single background tab when sending a batch of DMs, so we don't spam the user with popup windows. 336 337scripting â Injects the site-specific helper script on demand to draft and post replies. 338 339notifications â Notifies the user when a long-running engagement batch completes or when an account warning needs their attention. 340 341Host permissions â Each listed host (linkedin.com, x.com, reddit.com, facebook.com, quora.com, youtube.com, mail.google.com, outlook.*) is required because deSHILLER reads visible posts on that domain to draft a relevant reply. lovable.app / lovableproject.com / deshiller.com are required for the dashboard â extension bridge.`,sv="deSHILLER assists users in discovering relevant social media conversations and drafting on-brand replies and direct messages, in connection with their deSHILLER marketing dashboard.",tv="https://deshiller.com/privacy";function av(){const[s,t]=i.useState({}),[a,r]=i.useState("download");i.useEffect(()=>{try{const p=localStorage.getItem(Sl);p&&t(JSON.parse(p))}catch{}},[]),i.useEffect(()=>{try{localStorage.setItem(Sl,JSON.stringify(s))}catch{}},[s]);const o=i.useMemo(()=>[{id:"download",icon:Ut,title:"Download the latest extension build",estimate:"1 min",body:e.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("p",{children:["Grab the freshly packaged ZIP â it already has the deSHILLER name, logo and version ",e.jsx("code",{className:"text-xs",children:"2.6.1"}),". You'll upload this exact file to the Chrome Web Store in step 4."]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("a",{href:"/downloads/chrome-extension-23042026.zip",download:!0,children:e.jsxs(h,{size:"sm",className:"gap-1.5",children:[e.jsx(Ut,{className:"h-3.5 w-3.5"}),"Download deSHILLER extension ZIP"]})}),e.jsx(Ls,{to:"/install-extension",children:e.jsx(h,{size:"sm",variant:"outline",className:"gap-1.5",children:"Install page"})})]}),e.jsx("p",{className:"text-xs",children:"Tip: store the ZIP somewhere you'll remember â Chrome will ask for it when you create the listing."})]})},{id:"developer-account",icon:Sa,title:"Create a Chrome Web Store developer account",estimate:"10 min",body:e.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("p",{children:["You'll need a Google account and a one-time ",e.jsx("strong",{children:"$5 USD"})," registration fee. Use the same Google account you want to own the listing long-term."]}),e.jsxs("ol",{className:"list-decimal pl-5 space-y-1.5",children:[e.jsx("li",{children:"Open the Chrome Web Store Developer Dashboard."}),e.jsx("li",{children:"Sign in with the Google account that should own the listing."}),e.jsx("li",{children:"Pay the $5 registration fee with a credit card."}),e.jsx("li",{children:"Verify your contact email when Google sends the confirmation."})]}),e.jsx(Ir,{href:"https://chrome.google.com/webstore/devconsole",children:"Open Developer Dashboard"}),e.jsxs("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/5 p-3 flex gap-2 text-xs text-foreground/80",children:[e.jsx(qt,{className:"h-4 w-4 text-amber-500 shrink-0 mt-0.5"}),e.jsxs("p",{children:["If you plan to sell in-app or list under a company, also complete the ",e.jsx("strong",{children:"Account â Verify identity"})," and ",e.jsx("strong",{children:"Account â Group publishing"})," sections now â Google can take 1â2 days to review them."]})]})]})},{id:"assets",icon:ga,title:"Prepare the store listing assets",estimate:"20 min",body:e.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsx("p",{children:"The Web Store requires a fixed set of images. Sizes below are exact â Google rejects off-by-one dimensions."}),e.jsxs("ul",{className:"space-y-1.5 list-disc pl-5",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Icon"})," â 128Ã128 PNG (already included in the ZIP at ",e.jsx("code",{className:"text-xs",children:"icons/icon128.png"}),")"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Small promo tile"})," â 440Ã280 PNG/JPG (required)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Marquee promo tile"})," â 1400Ã560 PNG/JPG (optional but boosts placement)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Screenshots"})," â 1280Ã800 or 640Ã400, between 1 and 5 images (required)"]})]}),e.jsx("p",{className:"text-xs",children:"Easiest path: take 3 screenshots of the deSHILLER dashboard + extension popup at 1280Ã800, drop a short caption on each in Figma or Canva, and export as PNG."}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(Ir,{href:"https://www.figma.com/",children:"Figma"}),e.jsx(Ir,{href:"https://www.canva.com/",children:"Canva"})]})]})},{id:"create-listing",icon:fu,title:"Create the listing & upload the ZIP",estimate:"15 min",body:e.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("ol",{className:"list-decimal pl-5 space-y-1.5",children:[e.jsxs("li",{children:["In the Developer Dashboard, click ",e.jsx("strong",{children:"Items â Add new item"}),"."]}),e.jsxs("li",{children:["Upload ",e.jsx("code",{className:"text-xs",children:"chrome-extension-23042026.zip"})," from step 1."]}),e.jsx("li",{children:"Wait for Google's automatic manifest validation to pass (usually < 30s)."}),e.jsxs("li",{children:["You'll land on the ",e.jsx("strong",{children:"Store listing"})," tab â that's the next step."]})]}),e.jsx(Ir,{href:"https://chrome.google.com/webstore/devconsole",children:"Open Developer Dashboard"})]})},{id:"store-listing",icon:Ai,title:"Fill in the store listing copy",estimate:"10 min",body:e.jsxs("div",{className:"space-y-4 text-sm text-muted-foreground",children:[e.jsx("p",{children:"Copy each block straight into the matching field in the Developer Dashboard."}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-foreground
341/70",children:"Title (max 75 chars)"}),e.jsx(fr,{text:Qy,label:"Title"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-foreground/70",children:"Summary (max 132 chars)"}),e.jsx(fr,{text:Jy,label:"Summary"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-foreground/70",children:"Description"}),e.jsx(fr,{text:Zy,label:"Description"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-foreground/70",children:"Category"}),e.jsxs("p",{children:["Select ",e.jsx("strong",{children:"Productivity â Workflow & Planning"}),"."]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-foreground/70",children:"Language"}),e.jsxs("p",{children:["Set primary language to ",e.jsx("strong",{children:"English (United States)"}),". You can add localizations later."]})]})]})},{id:"privacy",icon:Na,title:"Privacy practices & permission justifications",estimate:"15 min",body:e.jsxs("div",{className:"space-y-4 text-sm text-muted-foreground",children:[e.jsxs("p",{children:["This is the section that gets most extensions rejected. Be specific â ",e.jsx("strong",{children:"one sentence per permission"}),", explaining the user benefit."]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-foreground/70",children:"Single purpose statement"}),e.jsx(fr,{text:sv,label:"Single purpose"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-foreground/70",children:"Permission justifications"}),e.jsx(fr,{text:ev,label:"Permission justifications"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-foreground/70",children:"Privacy policy URL"}),e.jsx(fr,{text:tv,label:"Privacy policy URL"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-foreground/70",children:"Data usage disclosures"}),e.jsxs("ul",{className:"list-disc pl-5 space-y-1",children:[e.jsxs("li",{children:["â
Personally identifiable information â ",e.jsx("em",{children:"email of the user (used for dashboard auth only)"})]}),e.jsxs("li",{children:["â
Authentication information â ",e.jsx("em",{children:"session token stored in chrome.storage.local"})]}),e.jsxs("li",{children:["â
Website content â ",e.jsx("em",{children:"read on the listed platforms to draft replies"})]}),e.jsxs("li",{children:["â Health, financial, location, communications â ",e.jsx("strong",{children:"none of these"})]})]}),e.jsx("p",{className:"text-xs",children:"Tick the three certifications at the bottom: no sale of data, no unrelated use, no creditworthiness scoring."})]})]})},{id:"submit",icon:Lt,title:"Submit for review",estimate:"5 min",body:e.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("ol",{className:"list-decimal pl-5 space-y-1.5",children:[e.jsxs("li",{children:["Pick visibility: ",e.jsx("strong",{children:"Public"})," (anyone can install) or ",e.jsx("strong",{children:"Unlisted"})," (only people with the link)."]}),e.jsxs("li",{children:["Pick distribution regions â leave default ",e.jsx("strong",{children:"All regions"})," unless you have a reason not to."]}),e.jsxs("li",{children:["Click ",e.jsx("strong",{children:"Submit for review"})," at the top right."]})]}),e.jsxs("p",{children:["Review usually takes ",e.jsx("strong",{children:"1â3 business days"}),". First-ever submissions and broad host permissions can push it to 5â7 days. You'll get an email either way."]}),e.jsxs("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/5 p-3 flex gap-2 text-xs text-foreground/80",children:[e.jsx(qt,{className:"h-4 w-4 text-amber-500 shrink-0 mt-0.5"}),e.jsx("p",{children:"If rejected, the email cites the exact policy section. The most common cause is a permission justification that's too vague â re-paste the block from step 6 verbatim and resubmit."})]})]})},{id:"post-publish",icon:st,title:"After approval â auto-updates & version bumps",estimate:"ongoing",body:e.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("p",{children:["Once published, every user's Chrome auto-updates the extension within ",e.jsx("strong",{children:"24 hours"}),' of you uploading a new ZIP â no more "click Refresh" loops.']}),e.jsx("p",{children:"To ship an update:"}),e.jsxs("ol",{className:"list-decimal pl-5 space-y-1.5",children:[e.jsxs("li",{children:["Bump ",e.jsx("code",{className:"text-xs",children:"version"})," in ",e.jsx("code",{className:"text-xs",children:"manifest.json"})," (e.g. ",e.jsx("code",{className:"text-xs",children:"2.6.1 â 2.6.2"}),")."]}),e.jsx("li",{children:"Repackage the ZIP (the dashboard's Install page already does this)."}),e.jsxs("li",{children:["In the Developer Dashboard, open your item â ",e.jsx("strong",{children:"Package â Upload new package"}),"."]}),e.jsxs("li",{children:["Click ",e.jsx("strong",{children:"Submit for review"}),". Updates are usually approved in < 24h."]})]}),e.jsx("p",{className:"text-xs",children:"Pro tip: include a one-line changelog in the description so users see what changed when Chrome notifies them of the update."}),e.jsx(Ir,{href:"https://developer.chrome.com/docs/webstore/update",children:"Chrome auto-update docs"})]})}],[]),n=o.filter(p=>s[p.id]).length,l=Math.round(n/o.length*100),c=o.find(p=>p.id===a)??o[0],x=o.findIndex(p=>p.id===c.id),d=p=>t(g=>({...g,[p]:!g[p]})),u=()=>{t(p=>({...p,[c.id]:!0})),x<o.length-1&&r(o[x+1].id)},m=()=>{x>0&&r(o[x-1].id)};return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-8",children:[e.jsx("div",{className:"mb-6",children:e.jsxs(Ls,{to:"/install-extension",className:"inline-flex items-center text-xs text-muted-foreground hover:text-foreground gap-1",children:[e.jsx(Ts,{className:"h-3 w-3"}
341),"Back to Install Extension"]})}),e.jsxs("div",{className:"mb-8 flex flex-col md:flex-row md:items-end md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs(W,{variant:"secondary",className:"mb-3 gap-1",children:[e.jsx(es,{className:"h-3 w-3"}),"In-app guide"]}),e.jsx("h1",{className:"text-3xl font-semibold text-foreground",children:"Publish deSHILLER to the Chrome Web Store"}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-2 max-w-2xl",children:["An end-to-end walkthrough that turns your unpacked extension into a Web Store listing with automatic background updates. Estimated total time: ",e.jsx("strong",{children:"~1 hour"}),", plus 1â3 days of review."]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-2 min-w-[200px]",children:[e.jsxs("div",{className:"text-xs text-muted-foreground",children:[n," of ",o.length," steps complete"]}),e.jsx(zt,{value:l,className:"w-48"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[280px_1fr] gap-6",children:[e.jsxs(U,{className:"p-3 h-fit lg:sticky lg:top-6",children:[e.jsxs("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground px-2 py-1.5 flex items-center gap-1.5",children:[e.jsx(bu,{className:"h-3.5 w-3.5"}),"Steps"]}),e.jsx("ol",{className:"space-y-1",children:o.map((p,g)=>{const v=p.id===c.id,b=!!s[p.id];return e.jsx("li",{children:e.jsxs("button",{onClick:()=>r(p.id),className:`w-full text-left px-2 py-2 rounded-md text-xs flex items-start gap-2 transition-colors ${v?"bg-primary/10 text-foreground":"hover:bg-muted/60 text-muted-foreground"}`,children:[e.jsx("div",{className:`mt-0.5 h-4 w-4 rounded-full flex items-center justify-center text-[10px] font-medium shrink-0 ${b?"bg-emerald-500 text-white":v?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:b?e.jsx(bs,{className:"h-3 w-3"}):g+1}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:`leading-tight ${v?"font-medium text-foreground":""}`,children:p.title}),e.jsx("p",{className:"text-[10px] mt-0.5 opacity-70",children:p.estimate})]})]})},p.id)})}),e.jsx(da,{className:"my-3"}),e.jsxs("div",{className:"px-2 pb-1 space-y-1.5",children:[e.jsxs("a",{href:"https://developer.chrome.com/docs/webstore/publish",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground inline-flex items-center gap-1",children:[e.jsx(bt,{className:"h-3 w-3"}),"Official publish guide"]}),e.jsx("br",{}),e.jsxs("a",{href:"https://developer.chrome.com/docs/webstore/program-policies",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground inline-flex items-center gap-1",children:[e.jsx(bt,{className:"h-3 w-3"}),"Program policies"]})]})]}),e.jsxs(U,{className:"p-6",children:[e.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[e.jsx("div",{className:"h-10 w-10 rounded-md bg-primary/10 text-primary flex items-center justify-center shrink-0",children:e.jsx(c.icon,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(W,{variant:"outline",className:"text-[10px]",children:["Step ",x+1," of ",o.length]}),e.jsx(W,{variant:"secondary",className:"text-[10px]",children:c.estimate})]}),e.jsx("h2",{className:"text-xl font-semibold text-foreground mt-1.5",children:c.title})]})]}),e.jsx("div",{className:"pt-2 pb-6",children:c.body}),e.jsx(da,{className:"my-4"}),e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground cursor-pointer",children:[e.jsx(Ot,{checked:!!s[c.id],onCheckedChange:()=>d(c.id)}),"Mark this step as done"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(h,{size:"sm",variant:"outline",onClick:m,disabled:x===0,className:"gap-1.5",children:[e.jsx(Ts,{className:"h-3.5 w-3.5"}),"Previous"]}),e.jsxs(h,{size:"sm",onClick:u,disabled:x===o.length-1&&!!s[c.id],className:"gap-1.5",children:[x===o.length-1?"Mark complete":"Next step",e.jsx(Ns,{className:"h-3.5 w-3.5"})]})]})]})]})]}),n===o.length&&e.jsx(U,{className:"mt-6 p-5 border-emerald-500/40 bg-emerald-500/5",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-full bg-emerald-500 text-white flex items-center justify-center shrink-0",children:e.jsx(bs,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium text-foreground",children:"Listing submitted ð"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"You'll get an email from Google within 1â3 days. Once approved, every future ZIP you upload here auto-rolls out to all installed users within 24 hours â no more manual reloads."})]})]})})]})})}const rv=()=>{const s=ns();return i.useEffect(()=>{document.title="Welcome to deSHILLER â Set up your AI marketing agency";const t=document.querySelector('meta[name="description"]');t&&t.setAttribute("content","You installed deSHILLER. Create your account in 60 seconds and start discovering and engaging with relevant posts on autopilot.")},[]),e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-background via-background to-primary/5",children:[e.jsx("nav",{className:"sticky top-0 z-40 backdrop-blur-md bg-background/80 border-b border-border/50",children:e.jsxs("div",{className:"container mx-auto px-4 py-3 flex items-center justify-between",children:[e.jsx(Ls,{to:"/",className:"text-xl font-display font-bold hover:text-primary transition-colors",children:"DESHILLER"}),e.jsx(Ls,{to:"/auth",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Sign in"})]})}),e.jsxs("main",{className:"container mx-auto px-4 py-12 max-w-4xl",children:[e.jsxs("div",{className:"text-center space-y-6 mb-12",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20 text-primary text-sm font-medium",children:[e.jsx(ys,{className:"h-4 w-4"}),"Extension installed successfully"]}),e.jsxs("h1",{className:"font-display text-4xl md:text-6xl font-bold tracking-tight",children:["Welcome to ",e.jsx("span",{className:"text-primary",children:"deSHILLER"})]}),e.jsx("p",{className:"text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto",children:"You're 60 seconds away from your AI marketing agency. The extension is your engine â now let's give it a brain."}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center pt-4",children:[e.jsxs(h,{size:"lg",onClick:()=>s("/lp"),className:"gap-2 text-base",children:["Start free trial",e.jsx(Ns,{className:"h-5 w-5"})]}),e.jsx(h,{size:"lg",variant:"outline",onClick:()=>s("/auth"),className:"gap-2 text-base",children:"I already have an account"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"No credit card · 24-hour free trial · Cancel anytime"})]}),e.jsxs("div",{className:"bg-card/50 backdrop-blur border border-border/50 rounded-2xl p-6 md:p-10 mb-8",children:[e.jsx("h2",{className:"font-display text-2xl md:text-3xl font-bold mb-8 text-center",children:"How it works in 3 steps"}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"font-display font-bold text-primary text-lg",children:"1"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(es,{className:"h-4 w-4 text-primary"}),e.jsx("h3",{className:"font-semibold",children:"Tell us about your business"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Drop your website URL. Our AI builds a marketing strategy and audience profile in under a minute."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"font-display font-bold text-primary text-lg",children:"2"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ks,{className:"h-4 w-4 text-primary"}),e.jsx("h3",{className:"font-semibold",children:"We discover ideal posts"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"deSHILLER scans LinkedIn, X, Reddit, Quora, Facebook and YouTube for posts where your product fits naturally."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"font-display font-bold text-primary text-lg",children:"3"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ms,{className:"h-4 w-4 text-primary"}),e.jsx("h3",{className:"font-semibold",children:"Engage with one click"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"The extension drafts on-brand replies and posts them from your own account. You stay in full control."})]})]})]}),e.jsxs("div",{className:"bg-card/50 backdrop-blur border border-border/50 rounded-2xl p-6 md:p-10 mb-8",children:[e.jsxs("h2",{className:"font-display text-xl md:text-2xl font-bold mb-4 flex items-center gap-2",children:[e.jsx(Lt,{className:"h-5 w-5 text-primary"}),"Why you need an account"]}),e.jsxs("p",{className:"text-muted-foreground mb-4",children:["The deSHILLER extension is the ",e.jsx("strong",{children:"execution layer"})," â it logs into your social accounts and posts replies on your behalf, safely and at human speed. The ",e.jsx("strong",{children:"brain"})," lives on deshiller.com:"]}),e.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[e.jsxs("li",{className:"flex gap-2",children:[e.jsx(ys,{className:"h-4 w-4 text-primary mt-0.5 shrink-0"})," AI-driven discovery of relevant posts across 6 platforms"]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx(ys,{className:"h-4 w-4 text-primary mt-0.5 shrink-0"})," On-brand reply generation that sounds like you"]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx(ys,{className:"h-4 w-4 text-primary mt-0.5 shrink-0"})," Cold outreach via email and DMs"]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx(ys,{className:"h-4 w-4 text-primary mt-0.5 shrink-0"})," Lead pipeline and follow-up automation"]})]})]}),e.jsxs("div",{className:"text-center space-y-4 py-8",children:[e.jsx("h2",{className:"font-display text-2xl md:text-3xl font-bold",children:"Ready to start?"}),e.jsx("p",{className:"text-muted-foreground",children:"Free for 24 hours. No card needed."}),e.jsxs(h,{size:"lg",onClick:()=>s("/lp"),className:"gap-2 text-base",children:["Set up my account",e.jsx(Ns,{className:"h-5 w-5"})]})]})]}),e.jsx("footer",{className:"border-t border-border/50 py-6 px-4 mt-8",children:e.jsxs("div",{className:"container mx-auto text-center text-sm text-muted-foreground",children:["© ",new Date().getFullYear()," DESHILLER · ",e.jsx(Ls,{to:"/privacy",className:"hover:text-foreground",children:"Privacy"})," · ",e.jsx(Ls,{to:"/terms",className:"hover:text-foreground",children:"Terms"})]})})]})},nv=()=>(i.useEffect(()=>{document.title="Safety architecture | deSHILLER â scale social selling without bans";const s=document.querySelector('meta[name="description"]');s&&s.setAttribute("content","How deSHILLER runs social selling agents through your own browser session â without account bans, without headless bots, with risk controls and audit logs.")},[]),e.jsxs("div",{className:"min-h-screen bg-background text-foreground relative overflow-hidden",children:[e.jsxs("div",{className:"fixed inset-0 pointer-events-none z-0",children:[e.jsx("div",{className:"absolute w-[600px] h-[600px] rounded-full blur-3xl bg-primary/[0.06] -top-40 -right-40"}),e.jsx("div",{className:"absolute w-[500px] h-[500px] rounded-full blur-3xl bg-accent/[0.04] -bottom-32 -left-32"})]}),e.jsx(Ma,{}),e.jsxs("main",{className:"relative z-10 max-w-5xl mx-auto px-6 lg:px-8 pt-32 pb-24",children:[e.jsxs("div",{className:"text-center mb-20",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full border border-primary/20 bg-primary/5 mb-6",children:[e.jsx(Na,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"text-[11px] uppercase tracking-wider text-primary font-medium",children:"Safety architecture"})]}),e.jsx("h1",{className:"text-4xl md:text-6xl font-display font-semibold mb-6 leading-[1.05] tracking-tight",children:"Scale social selling. Keep your accounts."}),e.jsx("p",{className:"text-base md:text-lg text-muted-foreground max-w-2xl mx-auto leading-relaxed",children:"Most automation tools optimize for throughput. We optimize for account longevity. Here's exactly how the deSHILLER agent layer stays inside platform-safe behavior."})]}),e.jsxs("section",{className:"mb-20",children:[e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold mb-8",children:"Architecture overview"}),e.jsxs("div",{className:"rounded-2xl border border-white/[0.08] bg-card/40 backdrop-blur-xl p-8 shadow-2xl shadow-black/10",children:[e.jsx("p",{className:"text-base text-muted-foreground leading-relaxed mb-6",children:"deSHILLER runs social actions through a Chrome extension that lives in your own browser session. There are no headless bots, no proxy farms, no credential vaulting on our side. From the platform's perspective, every reply, like and DM looks identical to one you'd post manually â because functionally, it is."}),e.jsx("pre",{className:"text-xs md:text-sm font-mono text-muted-foreground
341/80 bg-background/40 border border-border/30 rounded-xl p-5 overflow-x-auto leading-relaxed",children:`Listening agents (cloud) Reply agents (cloud) 342 â â 343 â¼ â¼ 344 Buying signal âââ¶ Risk classifier âââ¶ Approval queue 345 â 346 â¼ 347 deSHILLER extension (your browser) 348 â 349 â¼ 350 Social platform â your real session`})]})]}),e.jsxs("section",{className:"mb-20",children:[e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold mb-8",children:"Anti-ban controls"}),e.jsx("div",{className:"grid md:grid-cols-2 gap-5",children:[{icon:Hl,title:"Device & user-agent fidelity",body:"Actions execute through your real browser tab. Same device fingerprint, same network, same cookies. No cloud browser farms or rotating proxies that platforms easily flag."},{icon:Gl,title:"Human-like cadence",body:"Throttled posting with randomized intervals, typing simulation, pause-between-actions. Per-account throughput stays under platform-safe thresholds we tune per channel."},{icon:ju,title:"Content risk policies",body:"Replies pass classifier checks for spam patterns, banned phrases, repeated openers and over-promotion. Risky-class drafts route to manual review; safe-class can auto-post."},{icon:Bt,title:"Review queue + audit log",body:"Every action â drafted, approved, posted, skipped â is logged. You can roll back, retrain the brand voice and audit who shipped what."},{icon:qt,title:"Failure containment",body:"When a channel returns a soft block or rate-limit hint, the agent halts that channel for that account immediately. We never push through warnings."},{icon:_t,title:"Mobile-native execution",body:"Mobile actions run inside your real iOS/Android social apps, not via cloud browsers. Same session, same trust signals as everything else."}].map((s,t)=>e.jsxs("div",{className:"rounded-2xl border border-white/[0.08] bg-card/40 backdrop-blur-xl p-6 shadow-2xl shadow-black/10",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-primary/10 border border-primary/10 flex items-center justify-center mb-4",children:e.jsx(s.icon,{className:"h-5 w-5 text-primary"})}),e.jsx("h3",{className:"font-display font-semibold text-lg mb-2",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:s.body})]},t))})]}),e.jsxs("section",{className:"mb-20",children:[e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold mb-8",children:"Data handling"}),e.jsx("div",{className:"space-y-5",children:[{icon:yu,title:"Where data lives",body:"Profiles, ICP config, listening queues, engagement history and pipeline data are stored in our managed backend (encrypted at rest, encrypted in transit)."},{icon:vu,title:"Credentials",body:"Social account credentials never leave your browser. The extension acts inside your already-logged-in session â we never ask for, store or proxy your platform passwords."},{icon:Bt,title:"Access scopes",body:"The extension reads and writes only on the social platform tabs it actively uses for your configured workflows. It does not access mail, files, banking, or unrelated tabs."},{icon:_t,title:"Retention",body:"Engagement records are retained for the lifetime of your account. You can request deletion at any time â see the Privacy Policy for the full data-rights flow."}].map((s,t)=>e.jsxs("div",{className:"rounded-2xl border border-white/[0.08] bg-card/40 backdrop-blur-xl p-6 shadow-2xl shadow-black/10 flex gap-5",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-accent/15 border border-accent/10 flex items-center justify-center shrink-0",children:e.jsx(s.icon,{className:"h-5 w-5 text-accent"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-semibold text-lg mb-2",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:s.body})]})]},t))})]}),e.jsxs("section",{className:"mb-20",children:[e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold mb-8",children:"Monitoring & incident response"}),e.jsxs("div",{className:"rounded-2xl border border-white/[0.08] bg-card/40 backdrop-blur-xl p-8 shadow-2xl shadow-black/10",children:[e.jsx("p",{className:"text-base text-muted-foreground leading-relaxed mb-4",children:"We monitor extension health, queue throughput and platform-side error responses continuously. If we detect a behavior pattern that could put accounts at risk, the affected channel pauses automatically and we notify the affected workspaces."}),e.jsxs("p",{className:"text-base text-muted-foreground leading-relaxed",children:["Report a security concern: ",e.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:text-primary/80 transition-colors",children:"[email protected]"})]})]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold mb-4",children:"Want a deeper walkthrough?"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"We'll walk your team through the architecture and show the live audit log."}),e.jsx(h,{asChild:!0,size:"lg",className:"rounded-full bg-primary text-primary-foreground hover:bg-primary/90",children:e.jsxs(Ls,{to:"/lp",children:["Talk to us about a pilot",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]})})]})]}),e.jsx(_s,{})]})),iv=[{tag:"X · LinkedIn",title:"Steal frustrated competitor users",problem:"Competitors have unhappy users posting publicly. Most of them are warm-to-hot for an alternative â but you'll never find them by scrolling.",setup:['Listening agent: track competitor brand names + churn vocabulary ("switching from", "any alternative to", "frustrated with")',"Reply agent: empathy-first opener, soft positioning of your alternative, no hard pitch","Risk policy: human approval required when reply mentions a named competitor"],channels:["X","LinkedIn","Reddit"],metrics:["5â20 qualifying signals per week per competitor","10â25% reply-to-DM conversion","First meeting in week 1â2"]},{tag:"Reddit · Quora",title:'Capture "looking for a tool likeâ¦" posts',problem:"High-intent buyers ask for tool recommendations in subreddits and Quora threads every day. Whoever shows up first with a useful, non-spammy answer wins the click.",setup:["Listening agent: subreddit-scoped detection of tool-search intent in your category","Reply agent: long-form helpful answer, exactly one product mention, anecdotal tone","Anti-spam: reply once per thread, never edit to insert links, respect subreddit rules"],channels:["Reddit","Quora"],metrics:["10â40 high-intent posts per week per niche","Top-3 sorted reply on most threads","Compounding SEO + AI-search visibility"]},{tag:"LinkedIn",title:"Re-engage launch-post interactors",problem:"People who liked or c
350ommented on your launch are warm. Most teams let that signal die in the LinkedIn UI. The 72-hour window after a post is the highest-conversion moment you'll get.",setup:["Connect LinkedIn account; pin recent launch posts as targets","Reply agent: contextual DM opener that references the post they engaged with","Cadence: max 1 DM per prospect per 90 days, throttled per platform-safe rate"],channels:["LinkedIn"],metrics:["20â60% of likers become DM-eligible warm leads","30â45% DM open rate when contextual","5â15% reply rate to first DM"]},{tag:"All channels",title:"Buying-signal radar across networks",problem:"Your ICP is dropping signals â pricing complaints, churn frustration, feature requests â across X, Reddit, LinkedIn, YouTube comments, Quora and Facebook groups. No human team can monitor all six.",setup:["Listening agents per channel with shared ICP and keyword config","Unified queue with intent score; SDRs / founder triage from one inbox","Auto-tag into pipeline stages (signal â engaged â meeting)"],channels:["X","LinkedIn","Reddit","Quora","YouTube","Facebook"],metrics:["100â500 scored signals per week per ICP","1 unified pipeline view","Cuts manual prospecting time ~70%"]},{tag:"X",title:"Newsjack adjacent launches",problem:"When a competitor or category-adjacent product launches, the conversation is happening in real time on X. Showing up with a sharp, useful comment puts you in front of the same audience for free.",setup:["Listening agent: track competitor handles and launch hashtags",'Reply agent: one-line value-add comments, no "we do this too" energy',"Cap replies per launch wave to avoid pattern detection"],channels:["X"],metrics:["Tens of thousands of impressions per launch wave","Profile visits + organic follows","DMs from observers in same ICP"]},{tag:"LinkedIn · Email",title:"Cold reach from intent-matched leads",problem:"Inbound social signals get you halfway. Cold outreach to qualified-but-quiet ICP accounts closes the gap â but generic sequences burn domains and accounts.",setup:["Free OSINT discovery â public web + your installed browser extensions","AI-drafted DMs and emails grounded in the prospect's recent activity","Multi-channel sequence with 5-step follow-up engine"],channels:["LinkedIn DMs","Email"],metrics:["3â8% reply rate on first touch","12â20% across the full sequence","0 domain reputation incidents"]}],ov=()=>(i.useEffect(()=>{document.title="Playbooks | deSHILLER â proven social selling workflows";const s=document.querySelector('meta[name="description"]');s&&s.setAttribute("content","Repeatable social selling plays for B2B teams: competitor steal, intent capture, launch re-engagement, cold reach. Each playbook with setup, channels and typical metrics.")},[]),e.jsxs("div",{className:"min-h-screen bg-background text-foreground relative overflow-hidden",children:[e.jsxs("div",{className:"fixed inset-0 pointer-events-none z-0",children:[e.jsx("div",{className:"absolute w-[600px] h-[600px] rounded-full blur-3xl bg-primary/[0.06] -top-40 -right-40"}),e.jsx("div",{className:"absolute w-[500px] h-[500px] rounded-full blur-3xl bg-accent/[0.04] -bottom-32 -left-32"})]}),e.jsx(Ma,{}),e.jsxs("main",{className:"relative z-10 max-w-6xl mx-auto px-6 lg:px-8 pt-32 pb-24",children:[e.jsxs("div",{className:"text-center mb-20",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full border border-primary/20 bg-primary/5 mb-6",children:[e.jsx(_n,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"text-[11px] uppercase tracking-wider text-primary font-medium",children:"Playbooks"})]}),e.jsx("h1",{className:"text-4xl md:text-6xl font-display font-semibold mb-6 leading-[1.05] tracking-tight",children:"Plays that already work for B2B teams."}),e.jsx("p",{className:"text-base md:text-lg text-muted-foreground max-w-2xl mx-auto leading-relaxed",children:"Not features. Repeatable workflows you can configure inside deSHILLER and deploy this week. Each one ships with the listening agent, reply agent, risk rules and the metrics we typically see."})]}),e.jsx("div",{className:"space-y-6",children:iv.map((s,t)=>e.jsxs("div",{className:"rounded-2xl border border-white/[0.08] bg-card/40 backdrop-blur-xl p-7 md:p-9 shadow-2xl shadow-black/10",children:[e.jsx("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-4 mb-6",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-primary/15 border border-primary/10 flex items-center justify-center shrink-0",children:e.jsx(ks,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider px-2.5 py-1 rounded-full bg-accent/10 border border-accent/15 text-accent font-medium",children:s.tag}),e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold mt-3",children:s.title})]})]})}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"md:col-span-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wider text-primary/80 font-medium mb-2",children:"Problem"}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:s.problem})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wider text-primary/80 font-medium mb-3",children:"Agent setup"}),e.jsx("ul",{className:"space-y-2",children:s.setup.map((a,r)=>
350e.jsxs("li",{className:"text-sm text-muted-foreground leading-relaxed flex gap-2",children:[e.jsx("span",{className:"text-primary/60 mt-1 shrink-0",children:"·"}),e.jsx("span",{children:a})]},r))})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wider text-primary/80 font-medium mb-3",children:"Channels"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.channels.map((a,r)=>e.jsx("span",{className:"px-2.5 py-1 rounded-lg bg-primary/8 border border-primary/10 text-primary text-xs font-medium",children:a},r))})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wider text-primary/80 font-medium mb-3",children:"Typical metrics"}),e.jsx("ul",{className:"space-y-2",children:s.metrics.map((a,r)=>e.jsxs("li",{className:"text-sm text-muted-foreground leading-relaxed flex gap-2",children:[e.jsx("span",{className:"text-accent/70 mt-1 shrink-0",children:"·"}),e.jsx("span",{children:a})]},r))})]})]})]},t))}),e.jsxs("div",{className:"text-center mt-16",children:[e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold mb-4",children:"Want one of these running for your team?"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"We'll set it up during the 4-week pilot."}),e.jsx(h,{asChild:!0,size:"lg",className:"rounded-full bg-primary text-primary-foreground hover:bg-primary/90",children:e.jsxs(Ls,{to:"/lp",children:["Talk to us about a pilot",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]})})]})]}),e.jsx(_s,{})]})),lv=()=>{i.useEffect(()=>{document.title="About | deSHILLER â the agent layer for B2B social selling";const t=document.querySelector('meta[name="description"]');t&&t.setAttribute("content","Why deSHILLER exists, who builds it, and where it's going. The agent layer for every B2B team running social selling at scale.")},[]);const s=[{date:"2024",title:"First prototype",body:"Built to scratch our own itch â finding buying signals on X for a B2B SaaS we ran."},{date:"Q1 2025",title:"Extension shipped",body:"Moved from cloud bots to a browser extension after watching peers lose accounts. Zero bans since."},{date:"Q2 2025",title:"Multi-channel agents",body:"LinkedIn, Reddit, Quora, YouTube and Facebook discovery added. Unified pipeline view."},{date:"Q3 2025",title:"Cold Reach + Lead Pipeline",body:"Closed the loop from social signal to attributed meeting and CRM hand-off."},{date:"Now",title:"Agent Builder + API",body:"Visual workflow canvas and an API for AI agent ecosystems (Claude, n8n, Replit, etc.)."}];return e.jsxs("div",{className:"min-h-screen bg-background text-foreground relative overflow-hidden",children:[e.jsxs("div",{className:"fixed inset-0 pointer-events-none z-0",children:[e.jsx("div",{className:"absolute w-[600px] h-[600px] rounded-full blur-3xl bg-primary/[0.06] -top-40 -right-40"}),e.jsx("div",{className:"absolute w-[500px] h-[500px] rounded-full blur-3xl bg-accent/[0.04] -bottom-32 -left-32"})]}),e.jsx(Ma,{}),e.jsxs("main",{className:"relative z-10 max-w-4xl mx-auto px-6 lg:px-8 pt-32 pb-24",children:[e.jsxs("div",{className:"text-center mb-20",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full border border-primary/20 bg-primary/5 mb-6",children:[e.jsx(es,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"text-[11px] uppercase tracking-wider text-primary font-medium",children:"About"})]}),e.jsx("h1",{className:"text-4xl md:text-6xl font-display font-semibold mb-6 leading-[1.05] tracking-tight",children:"The agent layer for B2B social selling."}),e.jsx("p",{className:"text-base md:text-lg text-muted-foreground max-w-2xl mx-auto leading-relaxed",children:"We're building the infrastructure every serious B2B team will use to run social selling agents â across every major network â without losing their accounts."})]}),e.jsxs("section",{className:"mb-20",children:[e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold mb-6",children:"Why we built it"}),e.jsxs("div",{className:"space-y-5 text-base md:text-lg text-muted-foreground leading-relaxed",children:[e.jsx("p",{children:"We were running a B2B SaaS and spending hours every day scrolling X and Reddit for buying signals. Every tool we tried either missed half the conversations, sounded robotic in replies, or burned the test accounts we connected to it within weeks."}),e.jsxs("p",{children:['The category was full of "AI engagement" products optimizing for output. None of them were optimizing for the only thing that matters at scale: ',e.jsx("span",{className:"text-foreground",children:"your account staying alive long enough to compound"}),"."]}),e.jsx("p",{children:"So we built deSHILLER as the opposite. The reply layer runs through a browser extension on your real session. Every action looks identical to one you'd post manually â because functionally, it is. The intelligence (signal detection, brand voice, risk policies, attribution) lives in the cloud. The execution lives where it can't get you banned."})]})]}),e.jsxs("section",{className:"mb-20",children:[e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold mb-6",children:"Who builds it"}),e.jsxs("div",{className:"rounded-2xl border border-white/[0.08] bg-card/40 backdrop-blur-xl p-8 shadow-2xl shadow-black/10",children:[e.jsx("p",{className:"text-base text-muted-foreground leading-relaxed mb-4",children:"The team has spent years inside marketing, growth and adtech systems â first as operators running social channels for B2B and consumer brands, then as engineers building the infrastru
350cture that powers them."}),e.jsx("p",{className:"text-base text-muted-foreground leading-relaxed",children:"That mix matters. Building safe automation on top of social platforms requires understanding both the platforms' adversarial detection systems and what a real growth team actually needs out of a queue. We've shipped on both sides."})]})]}),e.jsxs("section",{className:"mb-20",children:[e.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold mb-8",children:"Where we are"}),e.jsx("div",{className:"space-y-4",children:s.map((t,a)=>e.jsxs("div",{className:"rounded-2xl border border-white/[0.08] bg-card/40 backdrop-blur-xl p-6 shadow-2xl shadow-black/10 flex gap-6",children:[e.jsx("div",{className:"text-xs font-mono text-primary shrink-0 w-20 pt-1",children:t.date}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-semibold text-lg mb-1",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:t.body})]})]},a))})]}),e.jsx("section",{className:"mb-16",children:e.jsxs("div",{className:"rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/[0.06] via-card/40 to-card/40 backdrop-blur-2xl p-8 md:p-12 shadow-2xl shadow-primary/10 text-center",children:[e.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-primary font-medium mb-4",children:"Mission"}),e.jsx("h2",{className:"text-2xl md:text-4xl font-display font-semibold leading-tight",children:"Powering every serious B2B team's social selling agents â across every major network."})]})}),e.jsx("div",{className:"text-center",children:e.jsx(h,{asChild:!0,size:"lg",className:"rounded-full bg-primary text-primary-foreground hover:bg-primary/90",children:e.jsxs(Ls,{to:"/lp",children:["Talk to us about a pilot",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]})})})]}),e.jsx(_s,{})]})},Ja=[{key:"company",title:"Tell us about your company",subtitle:"A few details so the agent knows who it's working for.",icon:fa},{key:"extension",title:"Install the browser extension",subtitle:"This is how deSHILLER acts on your behalf â safely, with no passwords shared.",icon:pa},{key:"profile",title:"Create your product profile",subtitle:"What you sell, who you help, and what good engagement looks like.",icon:es}],hi="deshiller_onboarding_kickoff_v1",Cl={company:{companyName:"",website:"",role:""},profile:{product:"",idealCustomer:"",valueProp:""}},cv=()=>{const s=ns(),{toast:t}=zn(),[a,r]=i.useState(0),[o,n]=i.useState(Cl),[l,c]=i.useState(!1),[x,d]=i.useState(!1),[u,m]=i.useState(!1),[p,g]=i.useState({name:"",email:"",message:""}),[v,b]=i.useState(!1);i.useEffect(()=>{try{const q=localStorage.getItem(hi);if(q){const _=JSON.parse(q);_!=null&&_.state&&n({...Cl,..._.state}),typeof(_==null?void 0:_.stepIdx)=="number"&&r(_.stepIdx),_!=null&&_.extensionConfirmed&&c(!0)}}catch{}},[]),i.useEffect(()=>{try{localStorage.setItem(hi,JSON.stringify({state:o,stepIdx:a,extensionConfirmed:l}))}catch{}},[o,a,l]),i.useEffect(()=>{document.title="Onboarding · deSHILLER"},[]);const z=i.useMemo(()=>(a+1)/Ja.length*100,[a]),C=i.useMemo(()=>{const q=Ja[a];return q.key==="company"?o.company.companyName.trim().length>1:q.key==="extension"?l:q.key==="profile"?o.profile.product.trim().length>2&&o.profile.idealCustomer.trim().length>2:!1},[a,o,l]),j=async()=>{if(a<Ja.length-1){r(q=>q+1);return}await N()},y=()=>r(q=>Math.max(0,q-1)),N=async()=>{var q,_;d(!0);try{const{data:A}=await w.auth.getSession(),B=(_=(q=A.session)==null?void 0:q.user)==null?void 0:_.id;if(!B){localStorage.setItem(`${hi}_pending`,JSON.stringify({state:o,finishedAt:new Date().toISOString()})),t({title:"Almost there",description:"Sign in to save your setup and continue."}),s("/auth?redirect=/dashboard");return}await w.from("onboarding_progress").upsert({user_id:B,product_profile_completed:!0,credentials_added:l},{onConflict:"user_id"});try{await w.from("user_preferences").upsert({user_id:B,product_description:o.profile.product,ideal_customer:o.profile.idealCustomer,value_proposition:o.profile.valueProp,company_name:o.company.companyName,company_website:o.company.website},{onConflict:"user_id"})}catch{}t({title:"Setup saved",description:"Heading to your dashboard."}),s("/dashboard")}
350catch{t({title:"Couldn't save setup",description:"Try again in a moment.",variant:"destructive"})}finally{d(!1)}},f=async()=>{if(!p.email.trim()||!p.message.trim()){t({title:"Email and message required",variant:"destructive"});return}b(!0);try{await w.functions.invoke("send-notification-email",{body:{to:"[email protected]",subject:`[Onboarding] Talk to us â ${p.name||p.email}`,html:`<p><strong>From:</strong> ${p.name||"â"} (${p.email})</p> 351 <p><strong>Company:</strong> ${o.company.companyName||"â"}</p> 352 <p><strong>Message:</strong></p> 353 <p>${p.message.replace(/\n/g,"<br/>")}</p>`}}),t({title:"Message sent",description:"We'll be in touch shortly."}),m(!1),g({name:"",email:"",message:""})}catch{t({title:"Couldn't send",description:"Email [email protected] directly.",variant:"destructive"})}finally{b(!1)}},R=Ja[a],M=R.icon;return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Ma,{}),e.jsx("main",{className:"pt-32 pb-24 px-4",children:e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsxs("div",{className:"mb-8 text-center",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-primary/8 border border-primary/15 text-xs text-primary mb-4",children:[e.jsx(es,{className:"h-3.5 w-3.5"}),"Onboarding kickoff"]}),e.jsx("h1",{className:"text-3xl md:text-4xl font-display font-semibold tracking-tight mb-2",children:"Get your AI agent live in 3 steps"}),e.jsx("p",{className:"text-muted-foreground text-sm md:text-base",children:"About 4 minutes. You can pause and come back â we'll save your progress."})]}),e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 text-xs text-muted-foreground",children:[e.jsxs("span",{children:["Step ",a+1," of ",Ja.length]}),e.jsxs("button",{onClick:()=>m(!0),className:"inline-flex items-center gap-1.5 hover:text-foreground transition-colors",children:[e.jsx(ms,{className:"h-3.5 w-3.5"}),"Talk to us"]})]}),e.jsx(zt,{value:z,className:"h-1.5"}),e.jsx("div",{className:"grid grid-cols-3 gap-2 mt-3",children:Ja.map((q,_)=>e.jsx("button",{onClick:()=>_<a&&r(_),disabled:_>a,className:`text-left text-xs px-3 py-2 rounded-lg border transition-colors ${_===a?"border-primary/40 bg-primary/5 text-foreground":_<a?"border-border/40 bg-muted/30 text-muted-foreground hover:text-foreground":"border-border/30 bg-transparent text-muted-foreground/60"}`,children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[_<a?e.jsx(bs,{className:"h-3 w-3 text-primary"}):e.jsx("span",{className:"h-3 w-3 inline-flex items-center justify-center text-[10px] rounded-full border border-current",children:_+1}),e.jsx("span",{className:"truncate",children:q.title.split(" ").slice(0,4).join(" ")})]})},q.key))})]}),e.jsxs("div",{className:"rounded-2xl border border-border/40 bg-card/60 backdrop-blur-sm shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"px-6 md:px-8 py-6 border-b border-border/30 flex items-start gap-4",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary/10 text-primary flex items-center justify-center flex-shrink-0",children:e.jsx(M,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-xl font-semibold tracking-tight font-display",children:R.title}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:R.subtitle})]})]}),e.jsx("div",{className:"px-6 md:px-8 py-8",children:e.jsxs("div",{className:"space-y-5 animate-in fade-in slide-in-from-bottom-2 duration-200",children:[R.key==="company"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"companyName",children:"Company name *"}),e.jsx(Je,{id:"companyName",value:o.company.companyName,onChange:q=>n(_=>({..._,company:{..._.company,companyName:q.target.value}})),placeholder:"Acme Inc.",maxLength:120})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"website",children:"Website"}),e.jsx(Je,{id:"website",value:o.company.website,onChange:q=>n(_=>({..._,company:{..._.company,website:q.target.value}})),placeholder:"https://acme.com",maxLength:200})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"role",children:"Your role"}),e.jsx(Je,{id:"role",value:o.company.role,onChange:q=>n(_=>({..._,company:{..._.company,role:q.target.value}})),placeholder:"Head of Growth",maxLength:80})]})]})]}),R.key==="extension"&&e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"rounded-xl border border-border/40 bg-muted/20 p-5",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(pa,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm space-y-2",children:[e.jsx("p",{className:"font-medium text-foreground",children:"Why an extension?"}),e.jsx("p",{className:"text-muted-foreground",children:"Actions run inside your own logged-in browser session. We never receive your platform passwords, and there are no third-party API keys to manage."})]})]})}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[e.jsxs(h,{onClick:()=>{window.open("/install-extension","_blank","noopener"),c(!0)},className:"flex-1 h-11 rounded-full",children:[e.jsx(pa,{className:"mr-2 h-4 w-4"}),"Install the extension"]}),e.jsx(h,{variant:"outline",onClick:()=>c(!0),className:"flex-1 h-11 rounded-full",children:"I've already installed it"})]}),l&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-primary",children:[e.jsx(bs,{className:"h-4 w-4"}),"Extension confirmed â you can continue."]})]}),R.key==="profile"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"product",children:"What do you sell? *"}),e.jsx(Vs,{id:"product",value:o.profile.product,onChange:q=>n(_=>({..._,profile:{..._.profile,product:q.target.value}})),placeholder:"A short description of your product or serviceâ¦",rows:3,maxLength:600})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"idealCustomer",children:"Who's your ideal customer? *"}),e.jsx(Vs,{id:"idealCustomer",value:o.profile.idealCustomer,onChange:q=>n(_=>({..._,profile:{..._.profile,idealCustomer:q.target.value}})),placeholder:"Role, company size, industry, the pain you solveâ¦",rows:3,maxLength:600})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"valueProp",children:"One-sentence value prop"}),e.jsx(Vs,{id:"valueProp",value:o.profile.valueProp,onChange:q=>n(_=>({..._,profile:{..._.profile,valueProp:q.target.value}}
353)),placeholder:"We help [who] do [what] without [pain].",rows:2,maxLength:300})]})]})]},R.key)}),e.jsxs("div",{className:"px-6 md:px-8 py-5 border-t border-border/30 flex items-center justify-between gap-3 bg-muted/10",children:[e.jsxs(h,{variant:"ghost",onClick:y,disabled:a===0||x,className:"rounded-full",children:[e.jsx(Ts,{className:"mr-2 h-4 w-4"}),"Back"]}),e.jsx(h,{onClick:j,disabled:!C||x,className:"rounded-full",children:x?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"mr-2 h-4 w-4 animate-spin"}),"Savingâ¦"]}):a===Ja.length-1?e.jsxs(e.Fragment,{children:["Finish setup",e.jsx(bs,{className:"ml-2 h-4 w-4"})]}):e.jsxs(e.Fragment,{children:["Continue",e.jsx(Ns,{className:"ml-2 h-4 w-4"})]})})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground text-center mt-6",children:["Prefer a guided walkthrough?"," ",e.jsx("button",{onClick:()=>m(!0),className:"text-primary hover:underline",children:"Talk to our team"}),"."]})]})}),e.jsx(gt,{open:u,onOpenChange:m,children:e.jsxs(dt,{className:"sm:max-w-md",children:[e.jsxs(mt,{children:[e.jsx(xt,{children:"Talk to our team"}),e.jsx(Mt,{children:"We'll get back within one business day."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"talkName",children:"Name"}),e.jsx(Je,{id:"talkName",value:p.name,onChange:q=>g(_=>({..._,name:q.target.value})),maxLength:80})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"talkEmail",children:"Email *"}),e.jsx(Je,{id:"talkEmail",type:"email",value:p.email,onChange:q=>g(_=>({..._,email:q.target.value})),maxLength:200})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ce,{htmlFor:"talkMessage",children:"What would you like to discuss? *"}),e.jsx(Vs,{id:"talkMessage",value:p.message,onChange:q=>g(_=>({..._,message:q.target.value})),rows:4,maxLength:1e3})]})]}),e.jsxs(Ft,{children:[e.jsx(h,{variant:"ghost",onClick:()=>m(!1),disabled:v,children:"Cancel"}),e.jsx(h,{onClick:f,disabled:v,children:v?e.jsx(Pe,{className:"h-4 w-4 animate-spin"}):"Send"})]})]})}),e.jsx(_s,{})]})},dv=()=>{const s=ns();return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsxs("div",{className:"text-center space-y-8 max-w-md animate-fade-up",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h1",{className:"text-9xl font-display font-bold text-primary",children:"404"}),e.jsx("h2",{className:"text-2xl font-semibold",children:"Page not found"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"The page you're looking for doesn't exist or has been moved."})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[e.jsxs(h,{onClick:()=>s(-1),variant:"outline",className:"gap-2 hover:bg-accent/5 transition-all",children:[e.jsx(Ts,{className:"h-4 w-4"}),"Go back"]}),e.jsxs(h,{onClick:()=>s("/"),className:"bg-primary text-primary-foreground hover:bg-primary/90 hover:shadow-lg gap-2 transition-all",children:[e.jsx(Nu,{className:"h-4 w-4"}),"Go home"]})]})]})})},_l="https://wa.me/34711079539",mv=()=>{const s=t=>{t.preventDefault(),Ha(_l)};return e.jsxs("a",{href:_l,target:"_blank",rel:"noopener noreferrer",onClick:s,className:"fixed bottom-6 right-6 z-50 flex items-center gap-2 bg-[#25D366] hover:bg-[#20BA5C] text-white px-4 py-3 rounded-full shadow-lg transition-all hover:scale-105 group cursor-pointer",title:"Chat with us on WhatsApp","aria-label":"Chat with us on WhatsApp",children:[e.jsx(St,{className:"h-5 w-5"}),e.jsx("span",{className:"hidden group-hover:inline text-sm font-medium pr-1",children:"Need help?"})]})},xv=new wu({defaultOptions:{queries:{staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:1}}}),uv=()=>{const{pathname:s}=_i(),t=_u();return i.useEffect(()=>{t!=="POP"&&window.scrollTo({top:0,left:0,behavior:"instant"})},[s,t]),null},hv=()=>e.jsx(ku,{client:xv,children:e.jsxs(Ka,{children:[e.jsx(Du,{}),e.jsx(Ou,{}),e.jsxs(Su,{children:[e.jsx(uv,{}),e.jsxs(Cu,{children:[e.jsx(rs,{path:"/",element:e.jsx(lh,{})}),e.jsx(rs,{path:"/features",element:e.jsx(mh,{})}),e.jsx(rs,{path:"/auth",element:e.jsx(Vh,{})}),e.jsx(rs,{path:"/get-started",element:e.jsx(Yh,{})}),e.jsx(rs,{path:"/install-extension",element:e.jsx(ep,{})}),e.jsx(rs,{path:"/dashboard",element:e.jsx(Hb,{})}),e.jsx(rs,{path:"/agent-builder",element:e.jsx(qh,{})}),e.jsx(rs,{path:"/admin",element:e.jsx(mj,{})}),e.jsx(rs,{path:"/payment",element:e.jsx(xj,{})}),e.jsx(rs,{path:"/terms",element:e.jsx(uj,{})}),e.jsx(rs,{path:"/privacy",element:e.jsx(hj,{})}),e.jsx(rs,{path:"/anti-spam",element:e.jsx(pj,{})}),e.jsx(rs,{path:"/how-it-works",element:e.jsx(Ij,{})}),e.jsx(rs,{path:"/lp-free-trial",element:e.jsx(Fj,{})}),e.jsx(rs,{path:"/lp-case-study",element:e.jsx(Bj,{})}),e.jsx(rs,{path:"/lp-limited-offer",element:e.jsx($j,{})}),e.jsx(rs,{path:"/lp",element:e.jsx(ny,{})}),e.jsx(rs,{path:"/academy",element:e.jsx(iy,{})}),e.jsx(rs,{path:"/academy/social-media-automation-guide",element:e.jsx(oy,{})}),e.jsx(rs,{path:"/academy/ai-reply-generation-best-practices",element:e.jsx(ly,{})}),e.jsx(rs,{path:"/academy/twitter-engagement-strategy",element:e.jsx(cy,{})}),e.jsx(rs,{path:"/academy/linkedin-lead-generation",element:e.jsx(dy,{})}),e.jsx(rs,{path:"/academy/reddit-marketing-strategy",element:e.jsx(my,{})}),e.jsx(rs,{path:"/academy/social-listening-tools",element:e.jsx(xy,{})}),e.jsx(rs,{path:"/academy/engagement-rate-optimization",element:e.jsx(uy,{})}),e.jsx(rs,{path:"/academy/b2b-social-selling",element:e.jsx(hy,{})}),e.jsx(rs,{path:"/academy/content-marketing-automation",element:e.jsx(py,{})}
353),e.jsx(rs,{path:"/academy/competitor-monitoring-strategy",element:e.jsx(gy,{})}),e.jsx(rs,{path:"/academy/influencer-outreach-tactics",element:e.jsx(fy,{})}),e.jsx(rs,{path:"/academy/social-media-roi-measurement",element:e.jsx(by,{})}),e.jsx(rs,{path:"/academy/personal-branding-executives",element:e.jsx(jy,{})}),e.jsx(rs,{path:"/academy/crisis-management-social-media",element:e.jsx(yy,{})}),e.jsx(rs,{path:"/academy/employee-advocacy-programs",element:e.jsx(vy,{})}),e.jsx(rs,{path:"/academy/hashtag-strategy-guide",element:e.jsx(Ny,{})}),e.jsx(rs,{path:"/academy/video-content-strategy",element:e.jsx(wy,{})}),e.jsx(rs,{path:"/academy/community-building-tactics",element:e.jsx(ky,{})}),e.jsx(rs,{path:"/academy/social-commerce-strategies",element:e.jsx(Sy,{})}),e.jsx(rs,{path:"/academy/algorithm-optimization",element:e.jsx(Cy,{})}),e.jsx(rs,{path:"/academy/customer-service-social-media",element:e.jsx(_y,{})}),e.jsx(rs,{path:"/academy/ugc-content-strategy",element:e.jsx(Ty,{})}),e.jsx(rs,{path:"/academy/paid-social-advertising",element:e.jsx(Ay,{})}),e.jsx(rs,{path:"/academy/social-media-analytics",element:e.jsx(Iy,{})}),e.jsx(rs,{path:"/academy/influencer-partnerships",element:e.jsx(Ly,{})}),e.jsx(rs,{path:"/academy/brand-voice-development",element:e.jsx(zy,{})}),e.jsx(rs,{path:"/academy/social-media-audit",element:e.jsx(Ey,{})}),e.jsx(rs,{path:"/academy/content-calendar-planning",element:e.jsx(Ry,{})}),e.jsx(rs,{path:"/academy/social-proof-strategies",element:e.jsx(Py,{})}),e.jsx(rs,{path:"/academy/cross-platform-strategy",element:e.jsx(My,{})}),e.jsx(rs,{path:"/email-preview",element:e.jsx(Dy,{})}),e.jsx(rs,{path:"/api",element:e.jsx(Oy,{})}),e.jsx(rs,{path:"/api-docs",element:e.jsx(Fy,{})}),e.jsx(rs,{path:"/academy/aio-ranking-social-comments",element:e.jsx(By,{})}),e.jsx(rs,{path:"/academy/social-engagement-ai-agents",element:e.jsx($y,{})}),e.jsx(rs,{path:"/academy/generative-engine-optimization-guide",element:e.jsx(qy,{})}),e.jsx(rs,{path:"/academy/reddit-seo-rank-on-google",element:e.jsx(Hy,{})}),e.jsx(rs,{path:"/academy/topical-authority-social-conversations",element:e.jsx(Gy,{})}),e.jsx(rs,{path:"/linkedin-troubleshooting",element:e.jsx(Uy,{})}),e.jsx(rs,{path:"/creative-studio",element:e.jsx(Wy,{})}),e.jsx(rs,{path:"/cold-reach-qa",element:e.jsx(Xy,{})}),e.jsx(rs,{path:"/publish-extension-guide",element:e.jsx(av,{})}),e.jsx(rs,{path:"/welcome",element:e.jsx(rv,{})}),e.jsx(rs,{path:"/security",element:e.jsx(nv,{})}),e.jsx(rs,{path:"/playbooks",element:e.jsx(ov,{})}),e.jsx(rs,{path:"/about",element:e.jsx(lv,{})}),e.jsx(rs,{path:"/onboarding",element:e.jsx(cv,{})}),e.jsx(rs,{path:"*",element:e.jsx(dv,{})})]}),e.jsx(mv,{})]})]})});Tu(document.getElementById("root")).render(e.jsx(Au,{children:e.jsx(hv,{})}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.