PageSourceSearch

https://task.com.tw/assets/SeoCompetitorGap-BWYTNR1r.js

js task.com.tw collected 2026-10-08 16:05:56 UTC 27,081 bytes, 1 lines download raw bytes

1import{r as i,t as a,j as e,aF as fe,L as A,d as Z,P as ye,aC as ve,ah as K,T as we,an as be,F,W as ee}from"./vendor-react-Cek5_fI5.js";import{b as Ae,V as ie,t as x,e as Te,f as ke,g as Ie,C as P,d as $,p as h,B as o,L as u,I as z,i as _,y as se,z as te,A as ae,E as oe,G as ce,F as le}from"./index-DnYEcI1T.js";import{u as De,S as Oe}from"./SeoAdminLayout-Bgrt4li3.js";import"./vendor-charts-CdtAEet6.js";import"./vendor-export-Do0PDzts.js";import"./seoEnums-Cxf0PcGh.js";const re=["虛擬主機","雲主機","專屬主機","SSL 憑證","網頁設計","UI/UX 設計","Logo / 品牌設計","SEO","網路行銷","Google Ads","Facebook Ads","Email 行銷","社群行銷","Google 商家","影音 / 直播","公關","AI 客服","RPA / 自動化","電子發票","其他"];function Ke(){const{currentOrg:r}=Ae(),c=r?.orgId??0,C=ie(),{can:G}=De(),n=G("competitor-gap","edit"),f=G("competitor-gap","view"),[t,j]=i.useState(re[0]),[H,ne]=i.useState(100),[R,pe]=i.useState(!0),[de,y]=i.useState(!1),[T,B]=i.useState(""),[Q,W]=i.useState(""),[xe,k]=i.useState(!1),[l,me]=i.useState(null),[I,U]=i.useState(null),[S,v]=i.useState(new Set),p=x.useUtils(),V=x.seo.competitorGap.listCompetitors.useQuery({orgId:c,category:t},{enabled:!!c}),D=x.seo.competitorGap.gapAnalysis.useQuery({orgId:c,category:t,minTraffic:H,onlyMissingArticle:R,limit:200},{enabled:!!c}),O=x.seo.competitorGap.addCompetitor.useMutation({onSuccess:()=>{a.success("對手已加入"),y(!1),B(""),W(""),p.seo.competitorGap.listCompetitors.invalidate()},onError:s=>a.error(s.message)}),ge=x.seo.competitorGap.removeCompetitor.useMutation({onSuccess:()=>{a.success("已移除"),p.seo.competitorGap.listCompetitors.invalidate(),p.seo.competitorGap.gapAnalysis.invalidate()},onError:s=>a.error(s.message)}),M=x.seo.competitorGap.autoDiscover.useMutation({onSuccess:s=>{a.success(`自動發現完成:新增/更新 ${s.added} 個對手`+(s.skipped?`(${s.skipped} 個跳過)`:"")),p.seo.competitorGap.listCompetitors.invalidate()},onError:s=>a.error("自動發現失敗:"+s.message)}),E=x.seo.competitorGap.syncCompetitorKeywords.useMutation({onSuccess:s=>{a.success(`已同步 ${s.synced} 筆關鍵字(${s.durationMs} ms)`),p.seo.competitorGap.listCompetitors.invalidate(),p.seo.competitorGap.gapAnalysis.invalidate()},onError:s=>a.error("同步失敗:"+s.message)}),w=x.seo.competitorGap.generateOutline.useMutation({onSuccess:s=>{a.success(C?"AI 大綱已生成":"AI 大綱已生成(扣 30 點)"),U(s),p.seo.competitorGap.gapAnalysis.invalidate()},onError:s=>a.error("AI 生成失敗:"+s.message)}),X=x.seo.competitorGap.createWritingTask.useMutation({onSuccess:s=>{a.success(`已建立任務 #${s.taskId}:${s.title}`),p.seo.competitorGap.gapAnalysis.invalidate()},onError:s=>a.error("建立任務失敗:"+s.message)}),b=V.data||[],d=D.data?.keywords||[],he=()=>{if(!T.trim()){a.warning("請填 domain");return}O.mutate({orgId:c,category:t,domain:T.trim(),displayName:Q.trim()||void 0})},ue=()=>{confirm(`系統將用 NSS (nss.com.tw) 反查「${t}」分類的相似對手(前 8 個),扣 DataForSEO 額度約 $0.05,確定?`)&&M.mutate({orgId:c,category:t,limit:8})},Se=s=>{confirm(`同步 ${s.domain} 在 Google 上的關鍵字(最多 200 筆、排名前 50),扣 DataForSEO 額度約 $0.5,確定?`)&&E.mutate({orgId:c,competitorId:s.id,limit:200,maxPosition:50})},Ce=s=>{confirm(`移除「${s.domain}」?(軟刪除,可重新加回)`)&&ge.mutate({orgId:c,competitorId:s.id,hardDelete:!1})},Y=s=>{me(s),U(null),k(!0)},q=()=>
1{l&&w.mutate({orgId:c,keyword:l.keyword,category:t})},J=s=>{confirm(`建立撰寫任務:「${s.suggestedTitle||s.keyword}」?`)&&X.mutate({orgId:c,keyword:s.keyword,category:t,suggestionId:s.suggestionId??void 0})},Ge=()=>{const s=d.filter(g=>S.has(g.keyword));if(s.length===0)return a.info("請先勾選關鍵字");if(!confirm(`為勾選的 ${s.length} 筆關鍵字一次建立撰寫任務?`))return;let m=0;s.forEach(g=>{setTimeout(()=>{X.mutate({orgId:c,keyword:g.keyword,category:t,suggestionId:g.suggestionId??void 0})},m*150),m++}),v(new Set)},L=i.useMemo(()=>{const s={not_in_nss:0,no_article:0,has_article:0};for(const m of d)s[m.status]++;return s},[d]);return e.jsxs(Oe,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:232",title:"競品缺口分析",children:[e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:233",className:"max-w-[1400px] mx-auto px-4 py-6 space-y-5",children:[e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:235",children:[e.jsxs("h1",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:236",className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(fe,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:237",className:"w-7 h-7 text-red-600"})," 競品缺口分析"]}),e.jsx("p",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:239",className:"text-sm text-muted-foreground mt-1",children:"選分類 → 加對手(手動 / 自動發現) → 同步對手關鍵字 → 看「對手有但 NSS 沒寫」的缺口 → AI 大綱 + 一鍵建立撰寫任務"})]}),e.jsx(Te,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:245",value:t,onValueChange:j,children:e.jsx(ke,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:246",className:"flex flex-wrap h-auto",children:re.map(s=>e.jsx(Ie,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:248",value:s,className:"text-xs sm:text-sm",children:s},s))})}),e.jsx(P,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:254",children:e.jsxs($,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:255",className:"p-4 space-y-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:256",className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:257",className:"flex items-center gap-2",children:[e.jsxs("h2",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:258",className:"text-lg font-semibold",children:["「",t,"」競爭對手"]}),e.jsx(h,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:259",variant:"secondary",children:b.length})]}),n&&e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:262",className:"flex gap-2 flex-wrap",children:[e.jsxs(o,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:263",size:"sm",variant:"outline",onClick:ue,disabled:M.isPending,children:[M.isPending?e.jsx(A,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:264",className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(Z,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:264",className:"w-4 h-4 mr-1"}),"自動發現"]}),e.jsxs(o,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:267",size:"sm",onClick:()=>y(!0),children:[e.jsx(ye,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:268",className:"w-4 h-4 mr-1"})," 加入對手"]})]})]}),V.isLoading?e.jsx("p",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:275",className:"text-sm text-muted-foreground py-6 text-center",children:"載入中…"}):b.length===0?e.jsx("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:277",className:"rounded-lg border border-dashed bg-amber-50 p-4 text-sm text-amber-700",children:"還沒有對手。可手動加入(如 hinet.net / godaddy.com)或按「自動發現」用 NSS 反查。"}):e.jsx("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:281",className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:b.map(s=>e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:283",className:"rounded-lg border p-3 space-y-2 hover:shadow-sm transition-shadow",children:[e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:284",className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:285",className:"flex-1 min-w-0",children:[e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:286",className:"flex items-center gap-1.5",children:[e.jsx("a",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:287",href:`https://${s.domain}`,target:"_blank",rel:"noreferrer",className:"font-medium hover:underline truncate",children:s.displayName||s.domain}),e.jsx(ve,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:290",className:"w-3 h-3 text-muted-foreground shrink-0"})]}),e.jsx("p",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:292",className:"text-xs text-muted-foreground truncate",children:s.domain})]}),e.jsx(h,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:294",variant:s.source==="auto"?"secondary":"outline",className:"text-[10px] shrink-0",children:s.source==="auto"?"自動":"手動"})]}),(s.organicTraffic!=null||s.organicKeywords!=null)&&e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:299",className:"flex gap-3 text-xs text-muted-foreground",children:[s.organicTraffic!=null&&e.jsxs("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:300",children:["流量 ~",s.organicTraffic.toLocaleStr
1ing()]}),s.organicKeywords!=null&&e.jsxs("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:301",children:["關鍵字 ",s.organicKeywords.toLocaleString()]})]}),s.lastSyncedAt&&e.jsxs("p",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:305",className:"text-[11px] text-muted-foreground",children:["最近同步:",new Date(s.lastSyncedAt).toLocaleString("zh-TW"),s.lastSyncStatus==="error"&&e.jsx("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:307",className:"text-red-500 ml-1",children:"(錯誤)"})]}),n&&e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:311",className:"flex gap-1",children:[e.jsxs(o,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:312",size:"sm",variant:"outline",className:"text-xs h-7 flex-1",onClick:()=>Se(s),disabled:E.isPending,children:[e.jsx(K,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:313",className:`w-3 h-3 mr-1 ${E.isPending?"animate-spin":""}`}),"同步關鍵字"]}),e.jsx(o,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:316",size:"sm",variant:"ghost",className:"text-xs h-7 text-red-500",onClick:()=>Ce(s),children:e.jsx(we,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:317",className:"w-3 h-3"})})]})]},s.id))})]})}),e.jsx(P,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:329",children:e.jsxs($,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:330",className:"p-4 space-y-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:331",className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("h2",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:332",className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(be,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:333",className:"w-5 h-5 text-blue-600"})," 缺口分析"]}),e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:335",className:"flex items-center gap-3 text-xs",children:[e.jsxs("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:336",className:"text-muted-foreground",children:["合計 ",d.length," 筆 · 對手覆蓋池 ",D.data?.totalCandidate??0]}),e.jsxs("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:337",className:"px-2 py-0.5 rounded bg-red-50 text-red-700 border border-red-200",children:["NSS 沒收 ",L.not_in_nss]}),e.jsxs("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:338",className:"px-2 py-0.5 rounded bg-amber-50 text-amber-700 border border-amber-200",children:["沒文章 ",L.no_article]}),e.jsxs("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:339",className:"px-2 py-0.5 rounded bg-green-50 text-green-700 border border-green-200",children:["已有文章 ",L.has_article]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:343",className:"flex items-center gap-4 flex-wrap text-sm",children:[e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:344",className:"flex items-center gap-2",children:[e.jsx(u,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:345",className:"text-xs",children:"最低月流量"}),e.jsx(z,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:346",type:"number",className:"w-24 h-8",value:H,onChange:s=>ne(Number(s.target.value)||0)})]}),e.jsxs("label",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:348",className:"flex items-center gap-2 cursor-pointer",children:[e.jsx(_,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:349",checked:R,onCheckedChange:s=>pe(!!s)}),e.jsx("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:350",className:"text-xs",children:"只看缺口(沒文章 / NSS 沒收)"})]}),e.jsxs(o,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:352",size:"sm",variant:"outline",onClick:()=>p.seo.competitorGap.gapAnalysis.invalidate(),children:[e.jsx(K,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:353",className:"w-3.5 h-3.5 mr-1"})," 重新分析"]}),n&&S.size>0&&e.jsxs(o,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:356",size:"sm",onClick:Ge,children:[e.jsx(F,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:357",className:"w-3.5 h-3.5 mr-1"})," 為勾選 ",S.size," 筆建立任務"]})]})]})}),e.jsx(P,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:365",children:e.jsx($,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:366",className:"p-0 overflow-x-auto",children:D.isLoading?e.jsx("p",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:368",className:"text-sm text-muted-foreground py-12 text-center",children:"分析中…"}):d.length===0?e.jsx("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:370",className:"py-12 text-center",children:b.length===0?e.jsx("p",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:372",className:"text-sm text-muted-foreground",children:"先在上方加入並同步對手,才能看到缺口分析。"}):e.jsx("p",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:374",className:"text-sm text-muted-foreground",children:"沒有符合條件的缺口關鍵字。試降低「最低月流量」或關閉「只看ç¼
1ºå£ã€ã€‚"})}):e.jsxs("table",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:378",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:379",className:"bg-muted/50 sticky top-0",children:e.jsxs("tr",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:380",className:"text-left",children:[n&&e.jsx("th",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:382",className:"w-8 p-2",children:e.jsx(_,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:383",checked:S.size===d.length&&d.length>0,onCheckedChange:s=>{v(s?new Set(d.map(m=>m.keyword)):new Set)}})}),e.jsx("th",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:392",className:"p-2",children:"關鍵字"}),e.jsx("th",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:393",className:"p-2 text-right",children:"月流量"}),e.jsx("th",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:394",className:"p-2 text-center",children:"對手"}),e.jsx("th",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:395",className:"p-2",children:"對手覆蓋"}),e.jsx("th",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:396",className:"p-2 text-center",children:"NSS 狀態"}),e.jsx("th",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:397",className:"p-2 text-right",children:"動作"})]})}),e.jsx("tbody",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:400",children:d.map(s=>{const m=S.has(s.keyword);return e.jsxs("tr",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:404",className:"border-t hover:bg-muted/30",children:[n&&e.jsx("td",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:406",className:"p-2",children:e.jsx(_,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:407",checked:m,onCheckedChange:g=>{const N=new Set(S);g?N.add(s.keyword):N.delete(s.keyword),v(N)}})}),e.jsxs("td",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:414",className:"p-2 font-medium",children:[s.keyword,s.suggestedTitle&&e.jsx("p",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:417",className:"text-[11px] text-muted-foreground mt-0.5 line-clamp-1",children:s.suggestedTitle})]}),e.jsx("td",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:420",className:"p-2 text-right",children:s.monthlyTraffic.toLocaleString()}),e.jsx("td",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:421",className:"p-2 text-center",children:e.jsx(h,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:422",variant:"secondary",children:s.competitorCount})}),e.jsx("td",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:424",className:"p-2 text-xs",children:e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:425",className:"flex flex-wrap gap-1 max-w-[260px]",children:[s.coverage.slice(0,3).map((g,N)=>{const[je,Ne]=g.split(":");return e.jsxs("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:429",className:"inline-flex items-center px-1.5 py-0.5 rounded bg-blue-50 text-blue-700 border border-blue-200",children:[je," ",e.jsxs("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:430",className:"text-[10px] text-blue-500 ml-1",children:["#",Ne]})]},N)}),s.coverage.length>3&&e.jsxs("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:435",className:"text-[10px] text-muted-foreground",children:["+",s.coverage.length-3]})]})}),e.jsxs("td",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:439",className:"p-2 text-center",children:[s.status==="not_in_nss"&&e.jsx(h,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:440",variant:"destructive",className:"text-[10px]",children:"NSS 沒收"}),s.status==="no_article"&&e.jsx(h,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:441",className:"bg-amber-500 text-[10px]",children:"沒文章"}),s.status==="has_article"&&e.jsx("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:443",title:s.nssArticleTitle||"",children:e.jsx(h,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:444",variant:"outline",className:"text-[10px] text-green-700 border-green-300",children:"有文章 "})})]}),e.jsx("td",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:448",className:"p-2 text-right",children:e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:449",className:"flex gap-1 justify-end",children:[s.suggestedTitle?e.jsxs(o,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:457",size:"sm",variant:"outline",className:"text-xs h-7",onClick:()=>Y(s),children:[e.jsx(F,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:458",className:"w-3 h-3 mr-1"})," 看大綱"]}):f&&e.jsxs(o,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:452",size:"sm",variant:"outline",className:"text-xs h-7",onClick:()=>Y(s),children:[e.jsx(ee,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:453",className:"w-3 h-3 mr-1"})," AI 大綱"]}),s.taskId?e.jsxs(h,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:462",variant:"outline",className:"text-[10px] text-green-700",children:["任務 #",s.taskId]}):n&&e.jsx(o,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:465",size:"sm",className:"text-xs h-7",onClick:()=>J(s),children:"建任務"})]})})]},s.keyword)})})]})})})]}),e.jsx(se,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:483",open:de,onOpenChange:y,children:e.jsxs(te,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:484",children:[e.jsxs(ae,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:485",children:[e.jsx(oe,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:486",children:"加入競爭對手"}),e.jsxs(ce,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:487",children:["分類:",t]})]}),e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:489",className:"space-y-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:490",children:[e.jsxs(u,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:491",className:"text-xs",children:["Domain ",e.jsx("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:491",className:"text-red-500",children:"*"})]}),e.jsx(z,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:492",value:T,onChange:s=>B(s.target.value),placeholder:"如 hinet.net、godaddy.com",autoFocus:!0}),e.jsx("p",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:498",className:"text-[11px] text-muted-foreground mt-1",children:"不用加 https://、www.、結尾斜線"})]}),e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:500",children:[e.jsx(u,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:501",className:"text-xs",children:"顯示名稱(選填)"}),e.jsx(z,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:502",value:Q,onChange:s=>W(s.target.value),placeholder:"如 HiNet"})]})]}),e.jsxs(le,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:509",children:[e.jsx(o,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:510",variant:"outline",onClick:()=>y(!1),children:"取消"}),e.jsxs(o,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:511",onClick:he,disabled:O.isPending,children:[O.isPending&&e.jsx(A,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:512",className:"w-4 h-4 mr-1 animate-spin"}),"加入"]})]})]})}),e.jsx(se,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:519",open:xe,onOpenChange:k,children:e.jsxs(te,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:520",className:"max-w-2xl max-h-[85vh] overflow-y-auto",children:[e.jsxs(ae,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:521",children:[e.jsxs(oe,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:522",className:"flex items-center gap-2",children:[e.jsx(ee,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:523",className:"w-5 h-5 text-violet-600"})," AI 文章大綱"]}),e.jsxs(ce,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:525",children:["關鍵字:",e.jsx("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:526",className:"font-medium",children:l?.keyword}),l&&e.jsxs("span",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:528",className:"ml-2 text-xs",children:["(月流量 ",l.monthlyTraffic.toLocaleStr
1ing(),")"]})]})]}),!I&&!l?.suggestedTitle?e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:534",className:"py-4 text-sm space-y-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:535",className:"rounded-lg border border-violet-200 bg-violet-50 p-3 text-violet-700",children:[e.jsx("p",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:536",className:"font-medium mb-1",children:"AI 會幫你生成:"}),e.jsxs("ul",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:537",className:"text-xs space-y-1 list-disc pl-5",children:[e.jsx("li",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:538",children:"吸睛 SEO 標題(含關鍵字)"}),e.jsx("li",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:539",children:"5-8 個 H2 章節大綱"}),e.jsx("li",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:540",children:"80-140 字 meta description"}),e.jsx("li",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:541",children:"3-8 個相關長尾關鍵字"})]}),!C&&e.jsx("p",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:543",className:"text-xs mt-2 text-violet-600",children:"每次扣 30 點"})]}),e.jsx(o,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:545",className:"w-full",onClick:q,disabled:w.isPending,children:w.isPending?e.jsxs(e.Fragment,{children:[e.jsx(A,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:546",className:"w-4 h-4 mr-1 animate-spin"})," 生成中…"]}):e.jsxs(e.Fragment,{children:[e.jsx(Z,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:546",className:"w-4 h-4 mr-1"})," ",C?"AI 生成大綱":"AI 生成大綱(30 點)"]})})]}):e.jsx(Me,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:550",data:I||{suggestedTitle:l?.suggestedTitle,suggestedH2s:[],suggestedMetaDescription:"",suggestedKeywords:[]},onCreateTask:()=>{l&&(J({...l,suggestionId:I?.suggestionId??l.suggestionId}),k(!1))},onRegenerate:q,regenerating:w.isPending,canView:f,canEdit:n})]})})]})}function Me({data:r,onCreateTask:c,onRegenerate:C,regenerating:G,canView:n,canEdit:f}){return e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:591",className:"space-y-3 text-sm",children:[r.suggestedTitle&&e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:593",children:[e.jsx(u,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:594",className:"text-xs text-muted-foreground",children:"建議標題"}),e.jsx("p",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:595",className:"font-semibold text-base mt-1",children:r.suggestedTitle})]}),Array.isArray(r.suggestedH2s)&&r.suggestedH2s.length>0&&e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:599",children:[e.jsx(u,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:600",className:"text-xs text-muted-foreground",children:"H2 大綱"}),e.jsx("ol",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:601",className:"list-decimal pl-5 mt-1 space-y-1",children:r.suggestedH2s.map((t,j)=>e.jsx("li",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:603",children:t},j))})]}),r.suggestedMetaDescription&&e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:609",children:[e.jsx(u,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:610",className:"text-xs text-muted-foreground",children:"Meta Description"}),e.jsx("p",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:611",className:"mt-1 text-xs bg-muted/30 p-2 rounded",children:r.suggestedMetaDescription})]}),Array.isArray(r.suggestedKeywords)&&r.suggestedKeywords.length>0&&e.jsxs("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:615",children:[e.jsx(u,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:616",className:"text-xs text-muted-foreground",children:"相關長尾關鍵字"}),e.jsx("div",{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:617",className:"flex flex-wrap gap-1 mt-1",children:r.suggestedKeywords.map((t,j)=>e.jsx(h,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:619",variant:"secondary",className:"text-[11px]",children:t},j))})]}),e.jsxs(le,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:624",className:"pt-2",children:[n&&e.jsxs(o,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:626",variant:"outline",onClick:C,disabled:G,children:[G?e.jsx(A,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:627",className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(K,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:627",className:"w-4 h-4 mr-1"}),ie()?"重新生成":"重新生成(再扣 30 點)"]}),f&&e.jsxs(o,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:632",onClick:c,children:[e.jsx(F,{"data-loc":"client/src/pages/seo/SeoCompetitorGap.tsx:633",className:"w-4 h-4 mr-1"})," 建立撰寫任務"]})]})]})}export{Ke 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.