1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56981],{431:(e,s,t)=>{t.d(s,{A:()=>n});let n=(0,t(71847).A)("repeat-2",[["path",{d:"m2 9 3-3 3 3",key:"1ltn5i"}],["path",{d:"M13 18H7a2 2 0 0 1-2-2V6",key:"1r6tfw"}],["path",{d:"m22 15-3 3-3-3",key:"4rnwn2"}],["path",{d:"M11 6h6a2 2 0 0 1 2 2v10",key:"2f72bc"}]])},18756:(e,s,t)=>{t.d(s,{A:()=>n});let n=(0,t(71847).A)("at-sign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]])},56981:(e,s,t)=>{t.r(s),t.d(s,{XPanel:()=>b});var n=t(95155),a=t(12115),l=t(93499),r=t(18756),i=t(35299),c=t(33789),d=t(90235),o=t(50020),x=t(4246),m=t(46258),u=t(83457),h=t(431),p=t(5937),f=t(57828),g=t(65313);function j(e){var s,t,l;let{quiet:r,onThemeSelect:i}=e,[c,d]=(0,a.useState)(0),m=(0,o.oo)({platform:"x"},c),u=m.data,h=null!=(s=null==u?void 0:u.total)?s:0,p=Math.max(0,Math.ceil(h/(null!=(t=null==u?void 0:u.pageSize)?t:25))-1);return m.isLoading?(0,n.jsx)(x._T,{}):m.isError?(0,n.jsx)(g.E,{onRetry:()=>void m.refetch()}):0===h?(0,n.jsxs)("div",{className:"glass-surface px-4 py-10 text-center",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-foreground",children:r?"X is quiet for this brand":"No X mentions yet"}),(0,n.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:r?"The last search finished cleanly but found no tweets â small brands often have sparse X volume. We keep checking on every re-sync.":"Mentions appear here once the first X search finishes."})]}):(0,n.jsxs)("div",{className:"space-y-2",children:[(null!=(l=null==u?void 0:u.mentions)?l:[]).map(e=>{var s,t;return(0,n.jsx)(v,{mention:e,themes:null!=(t=null==u||null==(s=u.themesByMention)?void 0:s[e.id])?t:[],onThemeSelect:i},e.id)}),p>0&&(0,n.jsx)(x.ed,{page:c,lastPage:p,onPage:d})]})}function v(e){var s;let{mention:t,themes:a=[],onThemeSelect:r}=e,i=null==(s=t.tags)?void 0:s.x;return(0,n.jsxs)("div",{className:"glass-surface space-y-1.5 px-3 py-2.5",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground",children:[(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:["comment"===t.data_type&&(0,n.jsx)("span",{className:"glass-pill px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide",children:"Reply"}),t.posted_at&&new Date(t.posted_at).toLocaleDateString()]}),t.url&&(0,n.jsx)("a",{href:t.url,target:"_blank",rel:"noreferrer","aria-label":"Open on X",className:"text-muted-foreground hover:text-brand-secondary",children:(0,n.jsx)(l.A,{className:"h-3 w-3"})})]}),(0,n.jsx)("p",{className:"text-sm leading-snug text-foreground",children:t.body}),i&&(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-[11px] text-muted-foreground",children:[null!=i.likes&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,n.jsx)(u.A,{className:"h-3 w-3"})," ",i.likes]}),null!=i.retweets&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,n.jsx)(h.A,{className:"h-3 w-3"})," ",i.retweets]}),null!=i.replies&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,n.jsx)(p.A,{className:"h-3 w-3"})," ",i.replies]}),null!=i.views&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,n.jsx)(f.A,{className:"h-3 w-3"})," ",i.views]})]}),(0,n.jsx)(x.Fo,{themes:a,onSelect:r})]})}function b(e){var s,t,r,i,c,d,u,h;let{profile:p,source:f,mentionCount:g}=e,[b,y]=(0,a.useState)(!1),[w,k]=(0,a.useState)(null),S=null==f||null==(s=f.meta)?void 0:s.x,A=!!(null==S?void 0:S.confirmedAt),X=b||!A,_=!!f&&A&&!X,C=(0,o.lV)("brand","x",_),M=null!=(r=null==f?void 0:f.status)?r:"available",T=null==f||null==(t=f.meta)?void 0:t.lastError,P=Object.entries(null!=(i=null==S?void 0:S.queryStats)?i:{}).filter(e=>{let[,s]=e;return s.flagged}).map(e=>{let[s]=e;return s});if((0,a.useEffect)(()=>{k(null)},[null==f?void 0:f.id,null==S?void 0:S.handle]),f&&A&&!X){let e=null==(c=C.data)?void 0:c.themes.find(e=>e.id===w),s=(null==S?void 0:S.handle)?"@".concat(S.handle):"Name search only";return(0,n.jsx)(x.UT,{rail:(0,n.jsx)(x.CL,{identity:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)(m.v,{sourceType:"x"}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"truncate text-sm font-semibold text-foreground",children:s}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:(null==S?void 0:S.handle)?"Handle and brand-name listening":"No X handle â searching by brand name"})]})]}),(null==S?void 0:S.handle)&&(0,n.jsxs)("a",{href:"https://x.com/".concat(S.handle),target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs font-medium text-brand-secondary",children:["Open on X ",(0,n.jsx)(l.A,{className:"h-3 w-3"})]})]}),source:f,vitals:(0,n.jsxs)("div",{className:"glass-surface flex items-center justify-between gap-3 px-3 py-2 text-xs",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Mentions kept"}),(0,n.jsx)("b",{className:"tabular-nums text-foreground",children:g})]}),themes:C,selectedThemeId:w,onSelectTheme:k,countOf:e=>{var s,t;return null!=(t=null==(s=e.slice)?void 0:s.frequency)?t:0},footer:(0,n.jsx)("button",{type:"button",className:"btn-frost-soft",onClick:()=>y(!0),children:"Change handle"})}),children:(0,n.jsxs)("div",{className:"space-y-3",children:[T&&"error"===M&&(0,n.jsxs)("div",{className:"banner-resume p-3 text-xs",children:[T.message," â we'll retry on the next pass."]}),P.length>0&&(0,n.jsxs)("div",{className:"glass-surface border border-amber-200/70 px-3 py-2 text-xs text-muted-foreground",children:[(0,n.jsx)("b",{className:"font-semibold text-amber-700",children:P.join(", ")})," ",1===P.length?"is":"are"," too generic on X â most matches were unrelated, so only @handle mentions are reliable for this brand."]}),e?(0,n.jsx)(x.Fz,{theme:e,platform:"x",renderMention:e=>(0,n.jsx)(v,{mention:e}),onClear:()=>k(null)}):(0,n.jsx)(j,{quiet:"synced"===M&&0===g&&(null==S||null==(d=S.lastRun)?void 0:d.zeroItems)===!0,onThemeSelect:k})]})})}return(0,n.jsx)("div",{className:"section-frost",children:(0,n.jsxs)("div",{className:"space-y-4 p-4",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,n.jsx)(m.v,{sourceType:"x",size:"sm"}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold",children:"X (Twitter)"}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"Posts and replies mentioning your brand â collected from X search, filtered before analysis."})]})]}),(0,n.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:A&&!X&&(0,n.jsx)("button",{type:"button",className:"btn-frost-soft flex-none",onClick:()=>y(!0),children:"Change handle"})})]}),T&&"error"===M&&(0,n.jsxs)("div",{className:"banner-resume text-xs",children:[T.message," â we'll retry on the next pass."]}),P.length>0&&!X&&(0,n.jsxs)("div",{className:"glass-surface border border-amber-200/70 px-3 py-2 text-xs text-muted-foreground",children:[(0,n.jsx)("b",{className:"font-semibold text-amber-700",children:P.join(", ")})," ",1===P.length?"is":"are"," too generic on X â most matches were unrelated, so only @handle mentions are reliable for this brand."]}),X||!f?(0,n.jsx)(N,{profile:p,initialHandle:null!=(u=null==S?void 0:S.handle)?u:function(e){let s=e.name_variants.find(e=>e.trim().startsWith("@"));return s?s.trim().replace(/^@/,""):""}(p),initialNameSearchOnly:null!=(h=null==S?void 0:S.nameSearchOnly)&&h,onSubmitted:()=>y(!1)}):null]})})}function N(e){let{profile:s,initialHandle:t,initialNameSearchOnly:l,onSubmitted:x}=e,m=(0,o.Be)(),[u,h]=(0,a.useState)(t),[p,f]=(0,a.useState)(l),g=!m.isPending&&(p||""!==u.trim()),j=s.name_variants.filter(e=>""!==e.trim());return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(d.J,{className:"text-xs",children:"Your brand's X handle"}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)(r.A,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,n.jsx)(c.p,{value:u,onChange:e=>h(e.target.value),placeholder:"yourbrand",disabled:p,className:"glass-surface h-9 border-purple-100/70 pl-8 text-sm shadow-none disabled:opacity-50"})]}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"We collect tweets that tag this account (excluding the brand's own posts) â the highest-signal voice-of-customer on X. Paste the profile URL if that's easier."})]}),(0,n.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,n.jsx)("input",{type:"checkbox",checked:p,onChange:e=>f(e.target.checked),className:"h-3.5 w-3.5 rounded border-purple-200 accent-[var(--brand-primary)]"}),"No X handle â search by brand name only"]}),j.length>0&&(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:["We'll also search for:"," ",j.map((e,s)=>(0,n.jsxs)("span",{children:[s>0&&" \xb7 ",(0,n.jsxs)("span",{className:"glass-pill inline-flex px-1.5 py-0.5 text-[11px] text-foreground",children:["â",e,"â"]})]},e))]}),(0,n.jsxs)("button",{type:"button",className:"btn-frost-primary inline-flex items-center gap-1.5 disabled:opacity-50",disabled:!g,onClick:()=>m.mutate({handle:p?null:u.trim(),nameSearchOnly:p},{onSuccess:x}),children:[m.isPending?(0,n.jsx)(i.A,{className:"h-3.5 w-3.5 animate-spin motion-reduce:animate-none"}):(0,n.jsx)(r.A,{className:"h-3.5 w-3.5"}),"Start listening on X"]})]})}},57828:(e,s,t)=>{t.d(s,{A:()=>n});let n=(0,t(71847).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])}}]);
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.