PageSourceSearch

https://www.goglobal.to/assets/GeoPromptsPage-BvVoqMkW.js

js goglobal.to collected 2026-09-24 13:21:54 UTC 46,735 bytes, 4 lines download raw bytes

1import{j as e,d as m}from"./react-vendor-BYeqKmV6.js";import{aF as je,aJ as Q,aE as k,aK as ps,aC as us,aD as g,B as h,v as Ae,a as ze,e as Ue,f as Ve,i as We,j as Qe,g as qe,F as He,h as Ye,a1 as hs,Z as gs}from"./index-C5_t1zCf.js";import{A as js,c as fs,f as vs,g as Ns,d as bs,e as ys,b as ws,a as Ps}from"./alert-dialog-CcIHKvQp.js";import{B as J}from"./badge-DDIK1BT-.js";import{c as L,i as Cs,a as B,G as As}from"./posthog-CYMG7Nw8.js";import{G as Ss}from"./GeoModelLogo-DUXzNYXU.js";import{G as ks}from"./GeoCreditLimitedDataNote-KltlNKiG.js";import{C as E,a as G,d as pe,e as ue,b as he}from"./card-CpuziIzR.js";import{I as z}from"./input-D3p5gISb.js";import{u as fe,G as le}from"./geoUiCopy-jvE7LZMg.js";import{c as ie,g as Ts}from"./geoRoutes-IP1PRfbB.js";import{S as ce,c as de,d as Ce,a as me,b as T}from"./select-DxBpsrxc.js";import{S as _}from"./skeleton-BKdYNRVY.js";import{r as _s}from"./simpleMarkdown-fp2xUfgk.js";import{L as I}from"./loader-circle-KzlnbA1r.js";import{P as Z}from"./plus-CNbRgllw.js";import{R as ge}from"./refresh-ccw-DJcIrc7q.js";import{S as Is}from"./search-CPQmojDe.js";import{L as Ms}from"./layers-C--6LFkV.js";import{E as Ls}from"./earth-CUwKJVQM.js";import{M as Ds}from"./message-square-text-BpV5DmY5.js";import{E as Es}from"./eye-BZocqjwv.js";import{C as Gs}from"./chart-column-DoFtPw3F.js";import{D as Ze}from"./download-Pb_KD9Ax.js";import{M as Rs}from"./map-pin-DF0PP0La.js";import{C as Fs}from"./calendar-days-CvvqXBaB.js";import{A as Os}from"./arrow-up-right-CHGGTm3p.js";import{T as Ke}from"./trash-2-DlOR620m.js";import{C as Xe}from"./clock-3-B0iX2vUx.js";import{R as De,a as $s,C as Ee,X as Ge,Y as Re,T as Fe,A as Bs,b as zs,B as Us,c as Vs}from"./recharts-vendor-fiJAX7F7.js";import{C as Ws}from"./circle-alert-QU3QF0Rm.js";import{C as Qs}from"./circle-check-BvsAa5Ld.js";import{T as qs}from"./trending-up-BmIs1-qC.js";import{T as Hs}from"./trending-down-UDRCmzxu.js";import{C as Ys}from"./chevron-up-C9yeKF70.js";import{C as Zs}
1from"./chevron-down-l7Tj8UlJ.js";import"./ui-vendor-FeF8SYpf.js";import"./data-vendor-JFafzwTy.js";import"./label-BjIbRJ8Q.js";import"./arrow-right-DXFT9Efz.js";import"./planCatalog-BFCIikEt.js";const Ks=69/700,Xs=.5,H={chatgpt:.12,claude:.15,gemini:.07,perplexity:.08,"google-ai-overviews":.09,grok:.12};function Y(t){const o=t/(1-Xs);return Math.max(1,Math.ceil(o/Ks))}const Oe={chatgpt:Y(H.chatgpt),claude:Y(H.claude),gemini:Y(H.gemini),perplexity:Y(H.perplexity),"google-ai-overviews":Y(H["google-ai-overviews"]),grok:Y(H.grok)};function Js(t,o="all"){const d=Math.max(0,Math.floor(t)),i=o==="all"?Object.values(Oe).reduce((a,l)=>a+l,0):Oe[o];return{promptCount:d,creditsPerPrompt:i,credits:d*i}}const $e=20;function Je(t,o){if(!t||t.eligible)return null;if(t.reason==="already-scanning")return o?"当前扫描完成后才能再次重扫。":"Rescan will be available after the current scan finishes.";if(t.availableAt){const d=new Date(t.availableAt);if(!Number.isNaN(d.getTime())){const i=new Intl.DateTimeFormat(o?"zh-CN":"en",{dateStyle:"medium",timeStyle:"short"}).format(d);return o?`计划刷新窗口将于 ${i} 后开放重扫。`:`Rescan available after ${i}, when the plan refresh window resets.`}}return o?"计划刷新窗口结束后才能再次重扫。":"Rescan will be available after the plan refresh window resets."}const xe={visibility:"Visibility",sentiment:"Sentiment",position:"Position",citations:"Citations",mentions:"Mentions"},et={visibility:"Your brand's presence across tracked answers",sentiment:"Average sentiment score from persisted model runs",position:"Average ranking position across the latest answers",citations:"Average citation count captured per refresh window",mentions:"Average mention count across tracked model answers"},st={all:"All models",chatgpt:"ChatGPT",claude:"Claude",gemini:"Gemini",perplexity:"Research (Auto)","google-ai-overviews":"Google AI Overviews",grok:"Grok"};function Be(t,o){return t==="visibility"?`${o}%`:t==="sentiment"?o.toFixed(2):o.toFixed(1)}function es({value:t}){const o=t>=0,d=o?qs:Hs;return e.jsxs("span",{className:`inline-flex items-center gap-1 text-xs font-medium ${o?"text-emerald-600":"text-rose-500"}`,children:[e.jsx(d,{className:"h-3 w-3"}),o?"+":"",t.toFixed(1),"%"]})}function ss({scan:t}){if(!t)return null;const o=t.status==="running"?e.jsx(I,{className:"h-3 w-3 animate-spin"}):t.status==="failed"?e.jsx(Ws,{className:"h-3 w-3"}):t.status==="success"?e.jsx(Qs,{className:"h-3 w-3"}):e.jsx(Xe,{className:"h-3 w-3"}),d=t.status==="running"?"rounded-full bg-blue-50 text-blue-700 hover:bg-blue-50":t.status==="failed"?"rounded-full bg-rose-50 text-rose-700 hover:bg-rose-50":t.status==="success"?"rounded-full bg-emerald-50 text-emerald-700 hover:bg-emerald-50":"rounded-full bg-amber-50 text-amber-700 hover:bg-amber-50";return e.jsxs(J,{className:d,children:[o,t.label]})}function ts(t,o,d){const i=[o,...d].map(j=>j.map(x=>`"${String(x).replaceAll('"','""')}"`).join(",")),a=URL.createObjectURL(new Blob([i.join(`
2`)],{type:"text/csv;charset=utf-8"})),l=document.createElement("a");l.href=a,l.download=t,l.click(),URL.revokeObjectURL(a)}function tt({open:t,onOpenChange:o}){const{user:d}=je(),{language:i}=Q(),a=fe(),l=i==="zh",j=k.useUtils(),[x,u]=m.useState("Primary GEO Tracking"),[y,P]=m.useState(""),[c,f]=m.useState(""),[N,w]=m.useState("Worldwide"),[b,n]=m.useState(""),C=k.geoAnalytics.projects.create.useMutation({onSuccess:async r=>{await Promise.all([j.geoAnalytics.projects.list.invalidate(),j.geoAnalytics.usage.invalidate(),j.geoAnalytics.prompts.list.invalidate(),j.geoAnalytics.overview.invalidate(),j.geoAnalytics.referrals.invalidate()]),L("geo_project_created",{project_id:r.id,project_name:r.name},{userId:d?.id}),g.success(r.generatedPromptCount?l?`项目已创建,并生成了 ${r.generatedPromptCount} 条 AI Prompts`:`Project created with ${r.generatedPromptCount} AI prompts`:l?"项目已创建":"Project created"),o(!1),u("Primary GEO Tracking"),P(""),f(""),w("Worldwide"),n("")},onError:r=>g.error(r.message||(l?"创建项目失败":"Failed to create project"))}),A=()=>{if(!x.trim()||!y.trim()){g.error(l?"项目名称和品牌名称不能为空":"Project name and brand name are required");return}C.mutate({name:x.trim(),brandName:y.trim(),brandDomain:c.trim()||void 0,primaryMarket:N.trim()||void 0,competitors:b.split(",").map(r=>
2r.trim()).filter(Boolean).map(r=>({brand:r}))})};return e.jsx(Ue,{open:t,onOpenChange:o,children:e.jsxs(Ve,{className:"sm:max-w-xl",children:[e.jsxs(We,{children:[e.jsx(Qe,{children:l?"创建 GEO 项目":"Create GEO Project"}),e.jsx(qe,{children:l?"先设置主要品牌和市场,再开始追踪 Prompts。":"Set the primary brand and market before you start tracking prompts."})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(z,{value:x,onChange:r=>u(r.target.value),placeholder:l?"项目名称":"Project name"}),e.jsx(z,{value:y,onChange:r=>P(r.target.value),placeholder:l?"品牌名称":"Brand name"}),e.jsx(z,{value:c,onChange:r=>f(r.target.value),placeholder:l?"品牌域名":"Brand domain"}),e.jsx(z,{value:N,onChange:r=>w(r.target.value),placeholder:l?"主要市场":"Primary market"}),e.jsx(He,{value:b,onChange:r=>n(r.target.value),placeholder:l?"竞品,使用逗号分隔":"Competitors, separated by commas",rows:4})]}),e.jsxs(Ye,{children:[e.jsx(h,{variant:"outline",onClick:()=>o(!1),children:a.common.cancel}),e.jsxs(h,{variant:"geo",onClick:A,disabled:C.isPending,children:[C.isPending?e.jsx(I,{className:"h-4 w-4 animate-spin"}):e.jsx(Z,{className:"h-4 w-4"}),l?"创建项目":"Create Project"]})]})]})})}function at({open:t,onOpenChange:o,projectId:d,promptQuotaReached:i}){const{user:a}=je(),{language:l}=Q(),j=fe(),x=l==="zh",u=k.useUtils(),[y,P]=m.useState(""),[c,f]=m.useState(""),[N,w]=m.useState("Worldwide"),[b,n]=m.useState("en"),C=()=>{P(""),f(""),w("Worldwide"),n("en")},A=k.geoAnalytics.prompts.create.useMutation({onSuccess:v=>{u.geoAnalytics.prompts.list.invalidate(),u.geoAnalytics.overview.invalidate(),u.geoAnalytics.referrals.invalidate(),u.geoAnalytics.usage.invalidate(),L("geo_prompt_created",{project_id:d,prompt_id:v.id,topic:c.trim(),location:N.trim()||"Worldwide"},{userId:a?.id}),g.success(x?"Prompt 已添加":"Prompt added"),o(!1),C()},onError:v=>g.error(hs(v,x?"添加 Prompt 失败":"Failed to add prompt"))}),r=k.geoAnalytics.prompts.generate.useMutation({onSuccess:async v=>{await Promise.all([u.geoAnalytics.prompts.list.invalidate(),u.geoAnalytics.overview.invalidate(),u.geoAnalytics.referrals.invalidate(),u.geoAnalytics.projects.list.invalidate(),u.geoAnalytics.usage.invalidate()]),v.warningMessage&&g.warning(v.warningMessage),g.success(v.generatedPromptCount?`Generated ${v.generatedPromptCount} AI prompts`:"No new AI prompts were generated"),o(!1),C()},onError:v=>g.error(v.message||"Failed to generate AI prompts")}),ee=()=>{if(!d){g.error(x?"请先选择项目":"Select a project first");return}if(!y.trim()||!c.trim()){g.error(x?"Prompt 和主题不能为空":"Prompt and topic are required");return}if(y.trim().length<8){g.error(x?"Prompt 至少需要 8 个字符":"Prompt must be at least 8 characters");return}if(c.trim().length<2){g.error(x?"主题至少需要 2 个字符":"Topic must be at least 2 characters");return}A.mutate({projectId:d,promptText:y.trim(),topic:c.trim(),location:N.trim(),language:b.trim(),priority:"medium"})},S=()=>{if(!d){g.error("Select a project first");return}r.mutate({projectId:d,force:!0})};return e.jsx(Ue,{open:t,onOpenChange:o,children:e.jsxs(Ve,{className:"sm:max-w-2xl",children:[e.jsxs(We,{children:[e.jsx(Qe,{children:x?"添加 Prompt":"Add Prompt"}),e.jsx(qe,{children:x?"保存手动 Prompt,或者让 AI 为当前追踪项目补充更多 Prompt。":"Save a manual prompt or let AI generate prompts for this tracking project."})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(He,{value:y,onChange:v=>P(v.target.value),placeholder:x?"例如:适合初创公司的最佳全球营销平台有哪些?":"What are the best global marketing platforms for startups?",rows:5}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsx(z,{value:c,onChange:v=>f(v.target.value),placeholder:x?"主题":"Topic"}),e.jsx(z,{value:N,onChange:v=>w(v.target.value),placeholder:x?"地区":"Location"}),e.jsx(z,{value:b,onChange:v=>n(v.target.value),placeholder:x?"语言":"Language"})]})]}),e.jsxs(Ye,{children:[e.jsx(h,{variant:"outline",onClick:()=>o(!1),children:j.common.cancel}),e.jsxs(h,{variant:"outline",className:"gap-2",onClick:S,disabled:!d||i||r.isPending||A.isPending,title:i?x?"Tracked Prompt 额度已达上限":"Tracked prompt quota reached":void 0,children:[r.isPending?e.jsx(I,{className:"h-4 w-4 animate-spin"}):e.jsx(Ae,{className:"h-4 w-4"}),x?"用 AI 生成":"Generate with AI"]}),e.jsxs(h,{variant:"geo",onClick:ee,disabled:A.isPending,children:[A.isPending?e.jsx(I,{className:"h-4 w-4 animate-spin"}):e.jsx(Z,{className:"h-4 w-4"}),x?"保存 Prompt":"Save Prompt"]})]})]})})}
2function rt({detail:t,onBack:o,onRescan:d,onRescanModel:i,onDelete:a,isRescanning:l,isRescanningModelId:j,isDeleting:x}){const{user:u}=je(),{language:y}=Q(),P=fe(),c=y==="zh",[f,N]=m.useState("visibility"),w=Je(t.prompt.rescanAvailability,c);m.useEffect(()=>{L("geo_prompt_detail_viewed",{prompt_id:t.prompt.id,topic:t.prompt.topic,project_id:t.project.id},{userId:u?.id})},[t.project.id,t.prompt.id,t.prompt.topic,u?.id]);const b=()=>{L("geo_prompt_detail_exported",{prompt_id:t.prompt.id,project_id:t.project.id},{userId:u?.id}),ts(`geo-prompt-${t.prompt.id}.csv`,["Prompt","Topic","Volume","Location","Visibility","Sentiment","Position","Mentions"],[[t.prompt.prompt,t.prompt.topic,t.prompt.volume,t.prompt.location,t.prompt.visibility,t.prompt.sentiment,t.prompt.position,t.prompt.mentions]]),g.success("Prompt analysis exported")};return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("header",{className:"flex flex-col gap-4 border-b border-neutral-200 pb-5 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{children:[e.jsxs("button",{type:"button",className:"mb-3 inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",onClick:o,children:[e.jsx(ze,{className:"h-4 w-4"}),c?"返回 Prompts":"Back to Prompts"]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("span",{children:P.common.analyze}),e.jsx("span",{children:"/"}),e.jsx("span",{children:P.nav.prompts}),e.jsx("span",{children:"/"}),e.jsx("span",{className:"font-semibold text-foreground",children:c?"详情":"Details"})]}),e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:t.notice}),w?e.jsxs("p",{className:"mt-2 inline-flex items-center gap-1.5 text-xs text-amber-700",children:[e.jsx(Xe,{className:"h-3.5 w-3.5"}),w]}):null]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(h,{variant:"outline",className:"gap-2 rounded-xl",onClick:()=>d(t.prompt.id),disabled:!!w||l||x,title:w??void 0,children:[l?e.jsx(I,{className:"h-4 w-4 animate-spin"}):e.jsx(ge,{className:"h-4 w-4"}),c?"重扫":"Rescan"]}),e.jsxs(h,{variant:"outline",className:"gap-2 rounded-xl text-rose-600 hover:text-rose-700",onClick:()=>
2a({id:t.prompt.id,prompt:t.prompt.prompt}),disabled:x,children:[x?e.jsx(I,{className:"h-4 w-4 animate-spin"}):e.jsx(Ke,{className:"h-4 w-4"}),P.common.delete]}),e.jsxs(h,{variant:"outline",className:"gap-2 rounded-xl",onClick:b,children:[e.jsx(Ze,{className:"h-4 w-4"}),P.common.export]})]})]}),e.jsx(E,{className:"rounded-2xl border-neutral-200 shadow-none",children:e.jsxs(G,{className:"p-5",children:[e.jsxs("div",{className:"flex flex-col gap-4 xl:flex-row xl:items-start xl:justify-between",children:[e.jsxs("div",{className:"max-w-4xl",children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[e.jsx(J,{variant:"secondary",className:"rounded-full font-normal",children:t.prompt.topic}),e.jsx(ss,{scan:t.prompt.scan})]}),e.jsx("h1",{className:"text-xl font-semibold leading-8 text-neutral-950",children:t.prompt.prompt})]}),e.jsx(es,{value:t.prompt.trend})]}),t.prompt.scan?.status==="failed"&&t.prompt.scan.errorMessage?e.jsxs("div",{className:"mt-4 rounded-xl border border-rose-200 bg-rose-50 px-3 py-2 text-xs text-rose-700",children:[c?"扫描失败:":"Scan failed: "," ",t.prompt.scan.errorMessage]}):null,e.jsxs("div",{className:"mt-5 grid gap-3 border-t pt-5 sm:grid-cols-2 xl:grid-cols-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:c?"添加日期":"Date added"}),e.jsx("p",{className:"mt-1 text-sm font-semibold",children:t.prompt.dateAdded})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:c?"主题":"Topic"}),e.jsx("p",{className:"mt-1 text-sm font-semibold",children:t.prompt.topic})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:c?"AI 体量":"AI volume"}),e.jsx("p",{className:"mt-1 text-sm font-semibold",children:t.prompt.volume.toLocaleString()})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:c?"地区":"Location"}),e.jsx("p",{className:"mt-1 text-sm font-semibold",children:t.prompt.location})]})]})]})}),e.jsxs("div",{className:"grid gap-5 xl:grid-cols-2",children:[e.jsxs(E,{className:"rounded-2xl border-neutral-200 shadow-none",children:[e.jsxs(pe,{children:[e.jsx("div",{className:"-mx-1 overflow-x-auto px-1 pb-1",children:e.jsx("div",{className:"inline-flex min-w-max items-center gap-1 rounded-xl border border-neutral-200 bg-neutral-100 p-1",children:Object.keys(xe).map(n=>e.jsx("button",{type:"button",onClick:()=>N(n),"aria-pressed":f===n,className:`shrink-0 rounded-lg px-3 py-1.5 text-xs font-medium transition ${f===n?"bg-[#ea580c] text-white shadow-sm":"text-neutral-600 hover:text-neutral-950"}`,children:xe[n]},n))})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs(ue,{className:"text-lg",children:[xe[f]," ",c?"趋势":"Trend"]}),e.jsx(he,{children:et[f]})]})]}),e.jsx(G,{children:e.jsx("div",{className:"h-[330px] rounded-xl border bg-white p-3",children:e.jsx(De,{width:"100%",height:"100%",children:e.jsxs($s,{data:t.timeline,margin:{top:12,right:12,left:-18,bottom:0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"visibilityFill",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#ec4899",stopOpacity:.24}),e.jsx("stop",{offset:"100%",stopColor:"#ec4899",stopOpacity:.02})]})}),e.jsx(Ee,{vertical:!1,stroke:"#ececec"}),e.jsx(Ge,{dataKey:"date",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"#737373"}}),e.jsx(Re,{domain:f==="visibility"?[0,100]:f==="sentiment"?[0,1]:f==="position"?[0,10]:[0,"auto"],axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"#737373"},tickFormatter:n=>Be(f,Number(n))}),e.jsx(Fe,{formatter:n=>[Be(f,Number(n)),xe[f]],contentStyle:{borderRadius:12,border:"1px solid #e5e5e5"}}),e.jsx(Bs,{type:"monotone",dataKey:f,stroke:"#ec4899",strokeWidth:3,fill:"url(#visibilityFill)",activeDot:{r:5}})]})})})})]}),e.jsxs(E,{className:"rounded-2xl border-neutral-200 shadow-none",children:[e.jsxs(pe,{children:[e.jsx(ue,{className:"text-lg",children:c?"平台可见度":"Visibility by Platform"}),e.jsx(he,{children:c?"各模型回答中提及你品牌的占比":"Share of model responses mentioning your brand"})]}),e.jsx(G,{children:e.jsx("div",{className:"h-[330px] rounded-xl border bg-white p-3",children:e.jsx(De,{width:"100%",height:"100%",children:e.jsxs(zs,{data:t.platformVisibility,margin:{top:12,right:12,left:-18,bottom:0},children:[e.jsx(Ee,{vertical:!1,stroke:"#ececec"}
2),e.jsx(Ge,{dataKey:"platform",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"#737373"}}),e.jsx(Re,{domain:[0,100],axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"#737373"},tickFormatter:n=>`${n}%`}),e.jsx(Fe,{formatter:n=>[`${n}%`,c?"可见度":"Visibility"],cursor:{fill:"#fafafa"},contentStyle:{borderRadius:12,border:"1px solid #e5e5e5"}}),e.jsx(Us,{dataKey:"visibility",radius:[8,8,0,0],children:t.platformVisibility.map(n=>e.jsx(Vs,{fill:n.fill},n.platform))})]})})})})]})]}),e.jsxs(E,{className:"overflow-hidden rounded-2xl border-neutral-200 shadow-none",children:[e.jsxs(pe,{children:[e.jsx(ue,{className:"text-lg",children:c?"模型结果":"Model results"}),e.jsx(ks,{availability:t.dataAvailability,language:c?"zh":"en"}),e.jsx(he,{children:c?"每个已追踪模型最近一次持久化输出快照":"Latest persisted output snapshot for each tracked model"})]}),e.jsxs(G,{className:"grid gap-3 p-4 md:grid-cols-2 xl:grid-cols-3",children:[t.answerPerformance.map(n=>e.jsxs("div",{className:"rounded-2xl border bg-white p-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",children:[e.jsx("p",{className:"font-semibold",children:n.model}),e.jsx(Ss,{model:n.model,label:n.model,size:18})]}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[c?"最近检查":"Last checked"," ",n.lastChecked]})]}),e.jsx(J,{className:n.mentioned?"rounded-full bg-emerald-50 text-emerald-700 hover:bg-emerald-50":"rounded-full bg-neutral-100 text-neutral-700 hover:bg-neutral-100",children:n.mentioned?c?"已提及":"Mentioned":c?"未提及":"Not mentioned"})]}),e.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-3 text-sm",children:[e.jsxs("div",{className:"rounded-xl border bg-neutral-50 px-3 py-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:c?"可见度":"Visibility"}),e.jsxs("p",{className:"mt-1 font-semibold",children:[n.visibility,"%"]})]}),e.jsxs("div",{className:"rounded-xl border bg-neutral-50 px-3 py-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:c?"提及数":"Mentions"}),e.jsx("p",{className:"mt-1 font-semibold",children:n.mentions})]}),e.jsxs("div",{className:"rounded-xl border bg-neutral-50 px-3 py-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:c?"情绪":"Sentiment"}),e.jsx("p",{className:"mt-1 font-semibold",children:n.sentiment.toFixed(2)})]}),e.jsxs("div",{className:"rounded-xl border bg-neutral-50 px-3 py-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:c?"排名":"Position"}),e.jsx("p",{className:"mt-1 font-semibold",children:n.position.toFixed(1)})]})]}),e.jsxs("div",{className:"mt-3 rounded-xl border bg-neutral-50 px-3 py-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:c?"回答摘要":"Answer summary"}),e.jsx(ot,{summary:n.summary})]}),e.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:c?"主要引用来源":"Top citations"}),e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded-lg border border-neutral-200 bg-white px-2 py-1 text-[11px] text-muted-foreground hover:bg-neutral-50 hover:text-foreground disabled:opacity-40 transition-colors",onClick:()=>
2i(t.prompt.id,n.modelId),disabled:!!w||j===n.modelId||l||x,title:w??(c?`立即用 ${n.model} 重扫`:`Rescan with ${n.model}`),children:[j===n.modelId?e.jsx(I,{className:"h-3 w-3 animate-spin"}):e.jsx(ge,{className:"h-3 w-3"}),c?"重扫":"Rescan"]})]}),e.jsx("div",{className:"mt-1",children:e.jsx("div",{className:"flex flex-wrap gap-2",children:n.citationSources.length?n.citationSources.map(C=>e.jsx(J,{variant:"outline",className:"rounded-full font-normal",children:C},C)):e.jsx("span",{className:"text-xs text-muted-foreground",children:c?"暂无引用来源":"No citations captured"})})})]},n.model)),t.answerPerformance.length?null:e.jsx("div",{className:"rounded-2xl border border-dashed px-4 py-10 text-center text-sm text-muted-foreground",children:c?"暂时还没有模型结果。":"No model results available yet."})]})]})]})}function ot({summary:t}){const{language:o}=Q(),d=o==="zh",[i,a]=m.useState(!1),l=m.useMemo(()=>String(t??"").replace(/\r\n/g,`
3`).trim(),[t]),j=l.length>220||l.split(`
4`).length>5;return l?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:gs("relative mt-1 overflow-hidden",!i&&j&&"max-h-36"),children:[e.jsx("div",{className:"prose prose-sm max-w-none break-words text-neutral-700 prose-headings:my-2 prose-headings:font-semibold prose-p:my-1.5 prose-ol:my-2 prose-ul:my-2 prose-li:my-0.5",dangerouslySetInnerHTML:{__html:_s(l)}}),!i&&j?e.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-neutral-50 to-transparent"}):null]}),j?e.jsx(h,{type:"button",variant:"ghost",size:"sm",className:"mt-2 h-auto px-0 py-0 text-xs font-medium text-[#ea580c] hover:bg-transparent hover:text-[#c2410c]",onClick:()=>a(x=>!x),children:i?e.jsxs(e.Fragment,{children:[d?"收起":"Show less",e.jsx(Ys,{className:"h-3.5 w-3.5"})]}):e.jsxs(e.Fragment,{children:[d?"展开更多":"Show more",e.jsx(Zs,{className:"h-3.5 w-3.5"})]})}):null]}):e.jsx("p",{className:"mt-1 text-sm leading-6 text-neutral-700",children:d?"该模型暂时还没有持久化摘要。":"No persisted summary available for this model yet."})}function nt({isLoading:t,message:o,onBack:d}){const{language:i}=Q(),a=i==="zh";return e.jsx("div",{className:"flex min-h-[520px] items-center justify-center px-4",children:e.jsx(E,{className:"w-full max-w-xl rounded-2xl border-neutral-200 shadow-none",children:e.jsx(G,{className:"py-14 text-center",children:t?e.jsxs(e.Fragment,{children:[e.jsx(I,{className:"mx-auto h-7 w-7 animate-spin text-[#ea580c]"}),e.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:a?"正在加载 Prompt 详情…":"Loading prompt details…"})]}):e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-xl font-semibold",children:a?"未找到 Prompt":"Prompt not found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:o}),e.jsxs(h,{variant:"outline",className:"mt-5 rounded-xl",onClick:d,children:[e.jsx(ze,{className:"h-4 w-4"}),a?"返回 Prompts":"Back to Prompts"]})]})})})})}function lt({rowCount:t=6}){const{language:o}=Q(),d=o==="zh";return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[980px] text-sm",children:[e.jsx("thead",{className:"border-y bg-neutral-50 text-left text-xs text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-3 font-medium",children:"Prompt"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:d?"主题":"Topic"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:d?"AI 体量":"AI Volume"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:d?"可见度":"Visibility"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:d?"情绪":"Sentiment"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:d?"排名":"Position"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:d?"趋势":"Trend"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:d?"操作":"Actions"})]})}),e.jsx("tbody",{children:Array.from({length:t}).map((i,a)=>e.jsxs("tr",{className:"border-b last:border-0",children:[e.jsxs("td",{className:"px-6 py-4",children:[e.jsx(_,{className:"h-4 w-64 roun
4ded-full"}),e.jsx(_,{className:"mt-3 h-3 w-40 rounded-full"})]}),e.jsx("td",{className:"px-4 py-4",children:e.jsx(_,{className:"h-6 w-24 rounded-full"})}),e.jsx("td",{className:"px-4 py-4",children:e.jsx(_,{className:"h-4 w-20 rounded-full"})}),e.jsxs("td",{className:"px-4 py-4",children:[e.jsx(_,{className:"h-4 w-14 rounded-full"}),e.jsx(_,{className:"mt-2 h-1.5 w-20 rounded-full"})]}),e.jsx("td",{className:"px-4 py-4",children:e.jsx(_,{className:"h-4 w-12 rounded-full"})}),e.jsx("td",{className:"px-4 py-4",children:e.jsx(_,{className:"h-4 w-12 rounded-full"})}),e.jsx("td",{className:"px-4 py-4",children:e.jsx(_,{className:"h-4 w-16 rounded-full"})}),e.jsx("td",{className:"px-4 py-4",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(_,{className:"h-9 w-9 rounded-full"}),e.jsx(_,{className:"h-9 w-9 rounded-full"}),e.jsx(_,{className:"h-9 w-9 rounded-full"})]})})]},a))})]})})}function it({routePromptId:t}){const{user:o}=je(),{language:d}=Q(),i=fe(),a=d==="zh",l=k.useUtils(),[j,x]=ps(),u=s=>x(s),[y,P]=m.useState(""),[c,f]=m.useState(""),[N,w]=m.useState("all"),[b,n]=m.useState("all"),[C,A]=m.useState(1),[r,ee]=m.useState(null),[S,v]=m.useState("all"),[as,Se]=m.useState(!1),[rs,se]=m.useState(!1),[K,ve]=m.useState(null),Ne=m.useRef(!1),be=m.useRef(!1),D=m.useMemo(()=>{if(!t)return null;const s=Number(t);return Number.isInteger(s)&&s>0?s:null},[t]),q=k.geoAnalytics.projects.list.useQuery(void 0,{staleTime:60*1e3,refetchOnWindowFocus:!1}),ke=k.geoAnalytics.usage.useQuery(void 0,{enabled:q.isSuccess,staleTime:30*1e3,refetchOnWindowFocus:!1});m.useEffect(()=>{us(j.split("?")[0]??j).startsWith(ie.legacyIntents)&&/(?:\?|&)view=trend(?:&|$)/.test(j)&&u(ie.promptTrends)},[j,u]),m.useEffect(()=>{!r&&q.data?.activeProjectId&&ee(q.data.activeProjectId)},[q.data?.activeProjectId,r]),m.useEffect(()=>{const s=window.setTimeout(()=>{f(y.trim())},250);return()=>window.clearTimeout(s)},[y]);const U=k.geoAnalytics.prompts.list.useQuery({projectId:r,search:c||void 0,topic:N==="all"?void 0:N,location:b==="all"?void 0:b,page:C,pageSize:$e},{enabled:!!r,refetchOnWindowFocus:!1,refetchInterval:5e3}),te=k.geoAnalytics.prompts.detail.useQuery({promptId:D??0,range:"30"},{enabled:!!D,refetchOnWindowFocus:!1,refetchInterval:5e3}),ye=k.geoAnalytics.scans.trigger.useMutation({onSuccess:s=>{l.geoAnalytics.prompts.list.invalidate(),l.geoAnalytics.overview.invalidate(),l.geoAnalytics.referrals.invalidate(),D&&l.geoAnalytics.prompts.detail.invalidate({promptId:D,range:"30"}),L("geo_prompt_scan_triggered",{project_id:r,prompt_count:s.promptCount,scan_id:s.scanId,model:S},{userId:o?.id}),g.success(s.message)},onError:s=>g.error(s.message||"Failed to start manual scan")}),M=k.geoAnalytics.prompts.rescan.useMutation({onSuccess:s=>{l.geoAnalytics.prompts.list.invalidate(),l.geoAnalytics.overview.invalidate(),l.geoAnalytics.referrals.invalidate(),l.geoAnalytics.prompts.detail.invalidate({promptId:s.id,range:"30"}),L("geo_prompt_manual_rescan_triggered",{project_id:s.projectId,prompt_id:s.id,scan_id:s.scanId,model:s.model},{userId:o?.id}),g.success(s.message)},onError:s=>g.error(s.message||"Failed to rescan prompt")}),R=k.geoAnalytics.prompts.delete.useMutation({onSuccess:s=>{l.geoAnalytics.prompts.list.invalidate(),l.geoAnalytics.overview.invalidate(),l.geoAnalytics.referrals.invalidate(),l.geoAnalytics.prompts.detail.invalidate({promptId:s.id,range:"30"}),L("geo_prompt_deleted",{project_id:s.projectId,prompt_id:s.id},{userId:o?.id}),g.success("Prompt deleted"),D===s.id&&u(ie.intents),ve(null)},onError:s=>g.error(s.message||"Failed to delete prompt")}),ae=q.data?.projects??[],F=U.data?.items??[],we=!!(y.trim()||N!=="all"||b!=="all"),V=U.data?.stats,re=U.data?.filterOptions??{topics:[],locations:[]},O=ke.data?.usage,$=ke.data?.quota,Te=!!(O&&$&&O.projects>=$.maxProjects),W=!!(O&&$&&O.trackedPrompts>=$.maxTrackedPrompts),_e=m.useMemo(()=>Js(1,S).creditsPerPrompt,[S]),os=m.useMemo(()=>Array.from(new Set([...re.topics,...N==="all"?[]:[N]])),[re.topics,N]),ns=m.useMemo(()=>Array.from(new Set([...re.locations,...b==="all"?[]:[b]])),[re.locations,b]),X=m.useMemo(()=>ae.find(s=>
4s.id===r)??null,[ae,r]),p=U.data?.pagination??{page:C,pageSize:$e,totalItems:F.length,totalPages:1,hasPreviousPage:!1,hasNextPage:!1},ls=U.isLoading,oe=p.totalItems?(p.page-1)*p.pageSize+1:0,ne=Math.min(p.page*p.pageSize,p.totalItems),Pe=p.totalItems>F.length?a?"当前页快照":"Current page snapshot":a?"基于最新持久化模型运行":"Across latest persisted model runs",is=Cs(X,U.isSuccess&&p.totalItems>0),Ie=s=>{L("geo_prompt_detail_opened",{prompt_id:s,project_id:r},{userId:o?.id}),u(Ts(s))},Me=()=>u(ie.intents);m.useEffect(()=>{!r||Ne.current||(Ne.current=!0,L("geo_prompts_viewed",{project_id:r},{userId:o?.id}))},[r,o?.id]),m.useEffect(()=>{if(r){if(!be.current){be.current=!0;return}L("geo_prompts_filters_changed",{project_id:r,search_length:y.trim().length,topic:N,location:b},{userId:o?.id})}},[c,b,r,N,o?.id]),m.useEffect(()=>{p.totalPages>=C||A(p.totalPages)},[C,p.totalPages]);const cs=()=>{L("geo_prompts_exported",{project_id:r,prompt_count:F.length},{userId:o?.id}),ts(`geo-analytics-prompts-page-${p.page}.csv`,["Prompt","Topic","Volume","Location","Visibility","Sentiment","Position","Mentions"],F.map(s=>[s.prompt,s.topic,s.volume,s.location,s.visibility,s.sentiment,s.position,s.mentions])),g.success(`Page ${p.page} exported`)},ds=()=>{if(!r){g.error("Select a project first");return}ye.mutate({projectId:r,model:S})},Le=s=>{ve(s)},ms=()=>{K&&R.mutate({promptId:K.id})};return t?D&&te.data?e.jsx(rt,{detail:te.data,onBack:Me,onRescan:s=>M.mutate({promptId:s,model:S}),onRescanModel:(s,xs)=>M.mutate({promptId:s,model:xs}),onDelete:Le,isRescanning:M.isPending&&M.variables?.promptId===D,isRescanningModelId:M.isPending&&M.variables?.promptId===D?M.variables?.model??null:null,isDeleting:R.isPending&&K?.id===D}):e.jsx(nt,{isLoading:te.isLoading,message:D?te.isError?"We couldn't load this prompt right now.":"This prompt is unavailable or no longer belongs to your workspace.":"This prompt URL is invalid.",onBack:Me}):q.isLoading&&!ae.length?e.jsx("div",{className:"flex min-h-[520px] items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(I,{className:"mx-auto h-7 w-7 animate-spin text-[#ea580c]"}),e.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:a?"正在加载 GEO 项目…":"Loading GEO projects…"})]})}):e.jsxs("div",{className:"relative min-w-0 space-y-5 pb-10",children:[e.jsx(js,{open:!!K,onOpenChange:s=>{!s&&!R.isPending&&ve(null)},children:e.jsxs(fs,{children:[e.jsxs(vs,{children:[e.jsx(Ns,{children:a?"删除 Prompt?":"Delete prompt?"}),e.jsx(bs,{children:a?"这会把该 Prompt 从当前 GEO 工作区中移除。后续如果需要,你仍然可以再次添加。":"This removes the prompt from your live GEO workspace. You can add the same prompt again later if needed."})]}),e.jsx("div",{className:"rounded-xl border bg-neutral-50 px-3 py-2 text-sm text-neutral-700",children:K?.prompt}),e.jsxs(ys,{children:[e.jsx(ws,{disabled:R.isPending,children:i.common.cancel}),e.jsxs(Ps,{onClick:ms,disabled:R.isPending,className:"bg-rose-600 hover:bg-rose-500",children:[R.isPending?e.jsx(I,{className:"h-4 w-4 animate-spin"}):null,i.common.delete]})]})]})}),e.jsx(tt,{open:as,onOpenChange:Se}),e.jsx(at,{open:rs,onOpenChange:se,projectId:r,promptQuotaReached:W}),e.jsxs("header",{className:"flex flex-col gap-4 border-b border-neutral-200 pb-5",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("span",{children:i.nav.diagnose}),e.jsx("span",{children:"/"}),e.jsx("span",{className:"font-semibold text-foreground",children:i.nav.intentsAndPrompts})]}),e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:U.data?.notice??(a?"实时追踪工作区":"Live tracking workspace")})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(h,{variant:"outline",className:"rounded-xl",onClick:()=>Se(!0),disabled:Te,title:Te?a?"项目额度已达上限":"Project quota reached":void 0,children:[e.jsx(Z,{className:"h-4 w-4"}),a?"新建项目":"New Project"]}),e.jsxs(h,{variant:"geo",className:"gap-2 rounded-xl",onClick:()=>se(!0),disabled:W||!r,title:W?a?"Tracked Prompt 额度已达上限":"Tracked prompt quota reached":void 0,children:[e.jsx(Z,{className:"h-4 w-4"}),a?"添加 Prompt":"Add Prompt"]}),e.jsxs(h,{variant:"outline",className:"gap-2 rounded-xl",onClick:ds,disabled:!r||!F.length||ye.isPending,children:[ye.isPending?e.jsx(I,{className:"h-4 w-4 animate-spin"}):e.jsx(ge,{className:"h-4 w-4"}),a?"全部重扫":"Rescan All"]})]})]}),O&&$?e.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[e.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-neutral-50 px-3 py-2 text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:a?"项目":"Projects"}),e.jsxs("strong",{className:"ml-2 text-neutral-950",children:[O.projects," / ",$.maxProjects]})]}),e.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-neutral-50 px-3 py-2 text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:i.common.trackedPrompts}),e.jsxs("strong",{className:"ml-2 text-neutral-950",children:[O.trackedPrompts," / ",$.maxTrackedPrompts]})]}),e.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-neutral-50 px-3 py-2 text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:a?"本月报告数":"Reports this month"}),e.jsxs("strong",{className:"ml-2 text-neutral-950",children:[O.reportsThisMonth," / ",$.maxReportsPerMonth]})]})]}):null,e.jsxs("div",{className:"grid gap-3 lg:grid-cols-[minmax(240px,280px)_minmax(200px,240px)_minmax(0,1fr)]",children:[e.jsxs(ce,{value:r?String(r):void 0,onValueChange:s=>{ee(Number(s)),P(""),f(""),w("all"),n("all"),A(1),Ne.current=!1,be.current=!1},children:[e.jsxs(de,{className:"h-11 bg-white",children:[e.jsx(Ae,{className:"mr-2 h-4 w-4"}),e.jsx(Ce,{placeholder:i.common.selectProject})]}),e.jsx(me,{children:ae.map(s=>e.jsx(T,{value:String(s.id),children:s.name},s.id))})]}),e.jsxs(ce,{value:S,onValueChange:s=>v(s),children:[e.jsx(de,{className:"h-11 bg-white",children:e.jsx(B,{model:S,label:le[a?"zh":"en"][S]})}),e.jsxs(me,{children:[e.jsx(T,{value:"all",children:e.jsx(B,{model:"all",label:le[a?"zh":"en"].all})}),e.jsx(T,{value:"chatgpt",children:e.jsx(B,{model:"chatgpt",label:"ChatGPT"})}),e.jsx(T,{value:"claude",children:e.jsx(B,{model:"claude",label:"Claude"})}),e.jsx(T,{value:"gemini",children:e.jsx(B,{model:"gemini",label:"Gemini"})}),e.jsx(T,{value:"perplexity",children:e.jsx(B,{model:"perplexity",label:"Perplexity"})}),e.jsx(T,{value:"google-ai-overviews",children:e.jsx(B,{model:"google-ai-overviews",label:le[a?"zh":"en"]["google-ai-overviews"]})}),e.jsx(T,{value:"grok",children:e.jsx(B,{model:"grok",label:"Grok"})})]})]}),e.jsxs("div",{className:"rounded-2xl border border-neutral-200 bg-white px-4 py-3 text-sm",children:[e.jsx("p",{className:"font-medium text-neutral-950",children:X?.brandName||i.common.noProjectSelected}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[X?.brandDomain||i.common.noDomainYet," · ",X?.primaryMarket||i.common.worldwide]}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:a?`手动重扫使用 ${le.zh[S].toLowerCase()}。`:`Manual rescan uses ${st[S].toLowerCase()}.`}),e.jsx("p",{className:"mt-1 text-xs text-[#c45c22]",children:a?`当前手动重扫按 ${_e}
4 credits / prompt 计费。`:`Manual rescans are currently billed at ${_e} credits per prompt.`})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[e.jsxs("div",{className:"relative min-w-0 flex-1",children:[e.jsx(Is,{className:"absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(z,{value:y,onChange:s=>{P(s.target.value),A(1)},placeholder:a?"搜索 Prompts 或主题":"Search prompts or topics",className:"h-11 rounded-xl bg-white pl-10"})]}),e.jsxs(ce,{value:N,onValueChange:s=>{w(s),A(1)},children:[e.jsxs(de,{className:"h-11 rounded-xl bg-white lg:w-[210px]",children:[e.jsx(Ms,{className:"mr-2 h-4 w-4"}),e.jsx(Ce,{placeholder:i.common.allTopics})]}),e.jsxs(me,{children:[e.jsx(T,{value:"all",children:i.common.allTopics}),os.map(s=>e.jsx(T,{value:s,children:s},s))]})]}),e.jsxs(ce,{value:b,onValueChange:s=>{n(s),A(1)},children:[e.jsxs(de,{className:"h-11 rounded-xl bg-white lg:w-[210px]",children:[e.jsx(Ls,{className:"mr-2 h-4 w-4"}),e.jsx(Ce,{placeholder:i.common.allLocations})]}),e.jsxs(me,{children:[e.jsx(T,{value:"all",children:i.common.allLocations}),ns.map(s=>e.jsx(T,{value:s,children:s},s))]})]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[e.jsx(E,{className:"rounded-2xl border-neutral-200 shadow-none",children:e.jsxs(G,{className:"p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:i.common.trackedPrompts}),e.jsx(Ds,{className:"h-4 w-4 text-violet-500"})]}),e.jsx("p",{className:"mt-2 text-2xl font-semibold",children:V?.trackedPrompts??0}),e.jsxs("p",{className:"mt-1 text-xs text-emerald-600",children:[V?.velocityDelta&&V.velocityDelta>=0?"+":"",V?.velocityDelta?.toFixed(1)??"0.0"," ",a?"可见度变化":"visibility delta"]})]})}),e.jsx(E,{className:"rounded-2xl border-neutral-200 shadow-none",children:e.jsxs(G,{className:"p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:i.common.avgVisibility}),e.jsx(Es,{className:"h-4 w-4 text-blue-500"})]}),e.jsxs("p",{className:"mt-2 text-2xl font-semibold",children:[V?.avgVisibility?.toFixed(1)??"0.0","%"]}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:Pe})]})}),e.jsx(E,{className:"rounded-2xl border-neutral-200 shadow-none",children:e.jsxs(G,{className:"p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:i.common.avgPosition}),e.jsx(Gs,{className:"h-4 w-4 text-amber-500"})]}),e.jsx("p",{className:"mt-2 text-2xl font-semibold",children:V?.avgPosition?.toFixed(1)??"0.0"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:Pe==="Current page snapshot"?"Current page snapshot":"Lower is better"})]})}),e.jsx(E,{className:"rounded-2xl border-neutral-200 shadow-none",children:e.jsxs(G,{className:"p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:a?"总提及数":"Total mentions"}),e.jsx(Ae,{className:"h-4 w-4 text-emerald-500"})]}),e.jsx("p",{className:"mt-2 text-2xl font-semibold",children:V?.totalMentions??0}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:Pe==="Current page snapshot"?"Mention count on this page":"Mention count from latest prompt snapshots"})]})})]}),e.jsxs(E,{className:"overflow-hidden rounded-2xl border-neutral-200 shadow-none",children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(ue,{className:"text-lg",children:a?"高价值 Prompts":"High-value prompts"}),e.jsx(he,{children:a?"对你的 AI 可见度影响最大的提问。":"Questions with the greatest potential impact on your AI visibility"})]}),e.jsxs("div",{className:"flex w-full flex-col items-start gap-1.5 sm:w-auto sm:items-end",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(h,{variant:"geo",className:"gap-2 rounded-xl",onClick:()=>se(!0),disabled:W||!r,title:W?a?"Tracked Prompt 额度已达上限":"Tracked prompt quota reached":void 0,children:[e.jsx(Z,{className:"h-4 w-4"}),a?"添加 Prompt":"Add Prompt"]}),e.jsxs(h,{variant:"outline",className:"gap-2 rounded-xl",onClick:cs,disabled:!F.length,children:[e.jsx(Ze,{className:"h-4 w-4"}),i.common.export]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a?`${oe}-${ne} / 共 ${p.totalItems} 条`:`${oe}-${ne} of ${p.totalItems} results`})]})]})}),e.jsx(G,{className:"px-0 pb-0",children:ls?e.jsx(lt,{rowCount:6}):F.length?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[980px] text-sm",children:[e.jsx("thead",{className:"border-y bg-neutral-50 text-left text-xs text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-3 font-medium",children:"Prompt"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:a?"主题":"Topic"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:a?"AI 体量":"AI Volume"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:a?"可见度":"Visibility"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:a?"情绪":"Sentiment"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:a?"排名":"Position"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:a?"趋势":"Trend"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:a?"操作":"Actions"})]})}),e.jsx("tbody",{children:F.map(s=>e.jsxs("tr",{className:"border-b transition hover:bg-neutral-50 last:border-0",children:[e.jsxs("td",{className:"max-w-[360px] px-6 py-4",children:[e.jsx("button",{type:"button",className:"line-clamp-2 text-left font-medium leading-5 hover:underline",onClick:()=>Ie(s.id),children:s.prompt}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(Rs,{className:"h-3 w-3"}),s.location,e.jsx("span",{children:"·"}),e.jsx(Fs,{className:"h-3 w-3"}),s.dateAdded]}),s.scan?e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[e.jsx(ss,{scan:s.scan}),s.scan.status==="failed"&&s.scan.errorMessage?e.jsx("span",{className:"line-clamp-1 text-xs text-rose-600",children:s.scan.errorMessage}):null]}):null]}),e.jsx("td",{className:"px-4 py-4",children:e.jsx(J,{variant:"outline",className:"whitespace-nowrap rounded-full font-normal",children:s.topic})}),e.jsx("td",{className:"px-4 py-4 font-medium",children:s.volume.toLocaleStr
4ing()}),e.jsxs("td",{className:"px-4 py-4",children:[e.jsxs("div",{className:"font-medium",children:[s.visibility,"%"]}),e.jsx("div",{className:"mt-1 h-1.5 w-20 overflow-hidden rounded-full bg-neutral-100",children:e.jsx("div",{className:"h-full rounded-full bg-neutral-800",style:{width:`${s.visibility}%`}})})]}),e.jsx("td",{className:"px-4 py-4",children:s.sentiment.toFixed(2)}),e.jsx("td",{className:"px-4 py-4",children:s.position.toFixed(1)}),e.jsx("td",{className:"px-4 py-4",children:e.jsx(es,{value:s.trend})}),e.jsx("td",{className:"px-4 py-4",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(h,{variant:"ghost",size:"icon",className:"rounded-full",onClick:()=>Ie(s.id),children:e.jsx(Os,{className:"h-4 w-4"})}),e.jsx(h,{variant:"ghost",size:"icon",className:"rounded-full",onClick:()=>M.mutate({promptId:s.id,model:S}),disabled:s.rescanAvailability?.eligible===!1||M.isPending||R.isPending,title:Je(s.rescanAvailability,a)??void 0,children:M.isPending&&M.variables?.promptId===s.id?e.jsx(I,{className:"h-4 w-4 animate-spin"}):e.jsx(ge,{className:"h-4 w-4"})}),e.jsx(h,{variant:"ghost",size:"icon",className:"rounded-full text-rose-600 hover:text-rose-700",onClick:()=>Le({id:s.id,prompt:s.prompt}),disabled:R.isPending,children:e.jsx(Ke,{className:"h-4 w-4"})})]})})]},s.id))})]})}),p.totalPages>1?e.jsxs("div",{className:"flex flex-col gap-3 border-t px-6 py-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:a?`显示 ${oe}-${ne} / 共 ${p.totalItems} 条 Prompts`:`Showing ${oe}-${ne} of ${p.totalItems} prompts`}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{variant:"outline",className:"rounded-xl",onClick:()=>A(s=>Math.max(1,s-1)),disabled:!p.hasPreviousPage,children:i.common.previous}),e.jsx("div",{className:"min-w-[108px] text-center text-sm text-muted-foreground",children:a?`第 ${p.page} / ${p.totalPages} 页`:`Page ${p.page} / ${p.totalPages}`}),e.jsx(h,{variant:"outline",className:"rounded-xl",onClick:()=>A(s=>s+1),disabled:!p.hasNextPage,children:i.common.next})]})]}):null]}):e.jsxs("div",{className:"px-6 py-16 text-center",children:[e.jsx("h3",{className:"text-lg font-semibold",children:we?a?"没有 Prompts 匹配当前筛选":"No prompts match these filters":a?"还没有 Prompts":"No prompts yet"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:we?a?"清空当前搜索和筛选条件,查看全部已追踪 Prompts。":"Clear the current search and filters to see all tracked prompts.":a?"添加第一个 Prompt,为这个项目生成持久化 GEO 追踪数据。":"Add your first prompt to generate persisted GEO tracking data for this project."}),we?e.jsx(h,{variant:"outline",className:"mt-5 rounded-xl",onClick:()=>{P(""),w("all"),n("all")},children:a?"清空筛选":"Clear filters"}):e.jsx("div",{className:"mt-5 flex items-center justify-center gap-3",children:e.jsxs(h,{variant:"outline",className:"rounded-xl",onClick:()=>se(!0),disabled:!r||W,title:W?a?"Tracked Prompt 额度已达上限":"Tracked prompt quota reached":void 0,children:[e.jsx(Z,{className:"h-4 w-4"}),a?"添加 Prompt":"Add Prompt"]})})]})})]}),e.jsx(As,{project:X,visible:is,surface:"prompts"})]})}function Zt({promptId:t}){return e.jsx(it,{routePromptId:t})}export{it as GeoPromptsContent,Zt as default};

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.