1import{y as Gs,aJ as Ls,a as Us,n as U,aC as V,az as T,j as e,F as xs,B as i,aM as hs,bh as gs,N as ps,E as Vs,G as Ks,I as le,C as p,b as R,c as D,d as j,aP as _s,aQ as zs,aR as Ne,aS as K,aT as Hs,aU as k,e as ie,a5 as Qe,aa as be,bf as ye,bi as Be,aV as Ge,i as js,aY as F,aD as q,_ as y,$ as w,a0 as C,a1 as S,a2 as c,am as Le,aZ as _,bI as Ws,a_ as z,a$ as H,b0 as W,b1 as Y,K as f,b3 as J,ac as we,bk as Ys,X as fs,ag as Js,ah as Xs,aF as Zs}from"./index-Byg2HWAE.js";import{r as t}from"./vendor-Qgthw7N1.js";import{u as ea,r as sa,c as aa,d as ta,e as la,g as ia,h as na,i as ra,j as ca,k as da}from"./api-DBoyQ-on.js";import{T as oa,a as vs}from"./toggle-group-BVV0MziZ.js";import{C as Ue}from"./calendar-days-CZv4Giu2.js";import{P as Ns,S as ne}from"./save-CiqQszcI.js";import{S as ma}from"./sun-CgGJiP3e.js";import{P as bs}from"./play-BTJ7KJDO.js";/** 2 * @license lucide-react v0.453.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const ua=Gs("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),Ce={draft:{label:"Draft",color:"bg-gray-100 text-gray-700 hover:bg-gray-100"},review:{label:"Review",color:"bg-amber-100 text-amber-700 hover:bg-amber-100"},published:{label:"Published",color:"bg-green-100 text-green-700 hover:bg-green-100"},archived:{label:"Archived",color:"bg-slate-100 text-slate-700 hover:bg-slate-100"},rewrite_in_progress:{label:"Rewriting",color:"bg-blue-100 text-blue-700 hover:bg-blue-100"},rewrite_failed:{label:"Rewrite Failed",color:"bg-red-100 text-red-700 hover:bg-red-100"}};function xa(P){return P.status!=="published"?Ce[P.status]||Ce.draft:P.publishedMethod==="auto"?{label:"Auto-Published",color:"bg-emerald-100 text-emerald-700 hover:bg-emerald-100"}:{label:"Manually Published",color:"bg-blue-100 text-blue-700 hover:bg-blue-100"}}const ys={title:"",slug:"",content:"",excerpt:"",featuredImageUrl:"",seoTitle:"",seoDescription:"",status:"draft",categoryId:0,authorId:0,tagIds:[]};function ws(P){return P.toLowerCase().replace(/[^\w\s-]/g,"").replace(/[\s_]+/g,"-").replace(/^-+|-+$/g,"")}function ya({embedded:P}){var ms;const m=Ls(),{toast:v}=Us(),[re,Cs]=t.useState("all"),[Ss,ce]=t.useState(!1),[Is,de]=t.useState(!1),[ks,X]=t.useState(!1),[A,I]=t.useState(null),[l,r]=t.useState({...ys}),[Ps,Se]=t.useState(!1),[As,Ie]=t.useState(!1),[E,ke]=t.useState(null),[oe,Pe]=t.useState(""),[M,me]=t.useState(""),[Ae,Ve]=t.useState(!1),[Ke,Te]=t.useState(""),[Ts,Re]=t.useState(!1),[_e,De]=t.useState(!1),[d,ze]=t.useState(null),[Z,He]=t.useState("posts"),[ee,We]=t.useState("Monday"),[N,Fe]=t.useState("07:00"),[O,Ye]=t.useState("weekly"),[se,Je]=t.useState(!1),[ue,Xe]=t.useState(!1),[Ze,es]=t.useState(""),[xe,$]=t.useState(null),[he,Q]=t.useState(!1),[Rs,qe]=t.useState(!1),[B,ge]=t.useState({displayName:"",slug:"",bio:""}),[pe,ae]=t.useState(null),b=t.useRef(null),ss=t.useRef(0),Ds=[{id:"research",label:"Researching topics"},{id:"topic_selection",label:"Selecting topic"},{id:"content_brief",label:"Creating content brief"},{id:"drafting",label:"Drafting article"},{id:"seo",label:"Generating SEO metadata"},{id:"image_gen",label:"Generating image"},{id:"saving",label:"Saving to database"}],{data:je=[],isLoading:as}=U({queryKey:["admin-blog-posts"],queryFn:la,refetchInterval:15e3}),{data:fe=[]}=U({queryKey:["admin-blog-categories"],queryFn:ia}),{data:ve=[]}=U({queryKey:["admin-blog-tags"],queryFn:na}),{data:G=[]}=U({queryKey:["admin-blog-authors"],queryFn:ra}),{data:o}=U({queryKey:["admin-blog-settings"],queryFn:ca,enabled:Z==="settings"});t.useEffect(()=>{o&&(We(o.day||"Monday"),Fe(o.time||"07:00"),Ye(o.frequency||"weekly"),Je(o.autoPublish??!1),Xe(o.qualityGateEnabled??!1),es((o.competitorDomains??[]).join(` 7`)))},[o]);const{data:ts=[],isLoading:Fs}=U({queryKey:["blog-quality-gate-attempts",d==null?void 0:d.id],queryFn:()=>da(d.id),enabled:_e&&!!d}),ls=t.useMemo(()=>Object.fromEntries(fe.map(s=>[s.id,s])),[fe]),is=t.useMemo(()=>Object.fromEntries(G.map(s=>[s.id,s])),[G]),L=t.useMemo(()=>re==="all"?je:je.filter(s=>s.status===re),[je,re]),Ee=V({mutationFn:async s=>{const a={title:s.title,slug:s.slug,content:s.content,excerpt:s.excerpt||void 0,featuredImageUrl:s.featuredImageUrl||void 0,seoTitle:s.seoTitle||void 0,seoDescription:s.seoDescription||void 0,status:s.status,categoryId:s.categoryId>0?s.categoryId:void 0,authorId:s.authorId>0?s.authorId:void 0};return(await T("POST","/api/admin/blog/posts",a)).json()},onSuccess:async(s,a)=>{a.tagIds.length>0&&await T("POST",`/api/admin/blog/posts/${s.id}/tags`,{tagIds:a.tagIds}
7),m.invalidateQueries({queryKey:["admin-blog-posts"]}),ce(!1),te()}}),Me=V({mutationFn:async s=>{const a={title:s.title,slug:s.slug,content:s.content,excerpt:s.excerpt||void 0,featuredImageUrl:s.featuredImageUrl||void 0,seoTitle:s.seoTitle||void 0,seoDescription:s.seoDescription||void 0,status:s.status,categoryId:s.categoryId>0?s.categoryId:void 0,authorId:s.authorId>0?s.authorId:void 0};await T("PATCH",`/api/admin/blog/posts/${s.id}`,a),await T("POST",`/api/admin/blog/posts/${s.id}/tags`,{tagIds:s.tagIds})},onSuccess:()=>{m.invalidateQueries({queryKey:["admin-blog-posts"]}),de(!1),I(null),te()}}),Oe=V({mutationFn:s=>T("DELETE",`/api/admin/blog/posts/${s}`),onMutate:async s=>{await m.cancelQueries({queryKey:["admin-blog-posts"]});const a=m.getQueryData(["admin-blog-posts"]);return m.setQueryData(["admin-blog-posts"],n=>(n==null?void 0:n.filter(u=>u.id!==s))??[]),{previousPosts:a}},onError:(s,a,n)=>{n!=null&&n.previousPosts&&m.setQueryData(["admin-blog-posts"],n.previousPosts),v({title:"Delete failed",description:s.message,variant:"destructive"})},onSuccess:()=>{X(!1),I(null)},onSettled:()=>{m.invalidateQueries({queryKey:["admin-blog-posts"]})}}),x=V({mutationFn:s=>ea(s),onSuccess:s=>{s.success&&m.invalidateQueries({queryKey:["admin-blog-settings"]})}}),ns=V({mutationFn:s=>sa(s),onSuccess:()=>{v({title:"Quality gate started",description:"Evaluating and, if needed, refining this draft in the background."}
7),m.invalidateQueries({queryKey:["admin-blog-posts"]})},onError:s=>{v({title:"Failed to start quality gate",description:s.message,variant:"destructive"})}});function qs(){const s=Ze.split(` 8`).map(a=>a.trim()).filter(Boolean);x.mutate({day:ee,time:N,frequency:O,competitorDomains:s})}const $e=V({mutationFn:s=>aa(s),onSuccess:()=>{m.invalidateQueries({queryKey:["admin-blog-authors"]}),qe(!1),ge({displayName:"",slug:"",bio:""})},onError:s=>{v({title:"Failed to create author",description:s.message,variant:"destructive"})}});async function Es(){$e.mutate(B)}async function Ms(){Q(!0),$(null),ae(null),ss.current=je.length;try{const a=await(await T("POST","/api/blog/run-pipeline")).json();if($(a),a.success){let u=0;b.current=setInterval(async()=>{u++;try{const h=await(await fetch("/api/blog/pipeline-status")).json();if(h.running===!0){ae({stage:h.stage,stageIndex:h.stageIndex,totalStages:h.totalStages,progress:h.progress,message:h.message});return}if("success"in h){clearInterval(b.current),b.current=null,Q(!1),ae(null),$(h),h.success?v({title:"Blog post generated",description:h.message}):v({title:"Pipeline failed",description:h.message,variant:"destructive"});return}}catch{}
8await m.invalidateQueries({queryKey:["admin-blog-posts"]});const g=m.getQueryData(["admin-blog-posts"]);g&&g.length>ss.current?(clearInterval(b.current),b.current=null,Q(!1),ae(null),$({success:!0,message:`Pipeline complete! New article "${g[0].title}" saved in Review.`}),v({title:"New blog post generated",description:g[0].title})):u>=60&&(clearInterval(b.current),b.current=null,Q(!1),ae(null),$(us=>us??{success:!0,message:"Pipeline started â refresh the page to see the new article."}))},5e3)}else Q(!1)}catch(s){$({success:!1,message:s.message||"Failed to run pipeline"}),Q(!1)}}t.useEffect(()=>()=>{b.current&&clearInterval(b.current)},[]);function rs(s){ke(s),Pe(""),me(""),Te(""),Re(!1),Ie(!0)}async function Os(){if(!(!E||!oe.trim())){Ve(!0),Te(""),me(""),Re(!1);try{const s=await ta(E.id,oe);me(s.refinedContent)}catch(s){Te(s.message||"AI refinement failed")}finally{Ve(!1)}}}async function $s(){if(!(!E||!M))try{await T("PATCH",`/api/admin/blog/posts/${E.id}`,{content:M}),m.invalidateQueries({queryKey:["admin-blog-posts"]}),ke(s=>s&&{...s,content:M}),v({title:"Changes applied",description:"Blog post updated. You can refine further."}),Pe(""),me(""),Re(!0)}catch(s){v({title:"Failed to apply",description:s.message,variant:"destructive"})}}function te(){r({...ys}),Se(!1)}function cs(s){I(s),r({title:s.title,slug:s.slug,content:s.content,excerpt:s.excerpt||"",featuredImageUrl:s.featuredImageUrl||"",seoTitle:s.seoTitle||"",seoDescription:s.seoDescription||"",status:s.status||"draft",categoryId:s.categoryId||0,authorId:s.authorId||0,tagIds:[]}),Se(!0),de(!0)}function Qs(){te(),ce(!0)}function Bs(s){r(a=>({...a,title:s,slug:Ps?a.slug:ws(s)}))}function ds(){A?Me.mutate({...l,id:A.id}):Ee.mutate(l)}function os(s){r(a=>({...a,tagIds:a.tagIds.includes(s)?a.tagIds.filter(n=>n!==s):[...a.tagIds,s]}))}return e.jsxs("div",{className:P?"space-y-6 p-4":"space-y-6 p-4 md:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xs,{className:"h-5 w-5 md:h-6 md:w-6 text-primary"}),e.jsx("h1",{className:"text-xl md:text-2xl font-semibold",children:Z==="settings"?"Blog Settings":"Blog Management"})]}),e.jsx("div",{className:"flex items-center gap-2",children:Z==="posts"?e.jsxs(e.Fragment,{children:[e.jsxs(i,{variant:"outline",size:"sm",onClick:()=>He("settings"),className:"gap-2",children:[e.jsx(hs,{className:"h-4 w-4"}),"Settings"]}),e.jsxs(i,{onClick:Qs,className:"gap-2",size:"sm",children:[e.jsx(gs,{className:"h-4 w-4"}),"New Post"]})]}):e.jsxs(i,{variant:"outline",size:"sm",onClick:()=>He("posts"),className:"gap-2",children:[e.jsx(xs,{className:"h-4 w-4"}),"Posts"]})})]}),Z==="posts"&&e.jsxs(e.Fragment,{children:[e.jsx(ps,{}),e.jsx("div",{className:"overflow-x-auto -mx-6 px-6",children:e.jsx(Vs,{value:re,onValueChange:Cs,children:e.jsxs(Ks,{children:[e.jsx(le,{value:"all",className:"whitespace-nowrap text-sm",children:"All"}),e.jsx(le,{value:"draft",className:"whitespace-nowrap text-sm",children:"Draft"}),e.jsx(le,{value:"review",className:"whitespace-nowrap text-sm",children:"Review"}),e.jsx(le,{value:"published",className:"whitespace-nowrap text-sm",children:"Published"}),e.jsx(le,{value:"archived",className:"whitespace-nowrap text-sm",children:"Archived"})]})})}),e.jsxs(p,{className:"hidden md:block",children:[e.jsx(R,{className:"pb-3",children:e.jsxs(D,{className:"text-lg font-medium",children:["Posts ",L.length>0&&`(${L.length})`]})}),e.jsx(j,{className:"p-0",children:e.jsxs(_s,{children:[e.jsx(zs,{children:e.jsxs(Ne,{children:[e.jsx(K,{children:"Title"}),e.jsx(K,{children:"Status"}),e.jsx(K,{children:"Category"}),e.jsx(K,{children:"Author"}),e.jsx(K,{children:"Published Date"}),e.jsx(K,{className:"w-[140px]",children:"Actions"})]})}),e.jsx(Hs,{children:as?e.jsx(Ne,{children:e.jsx(k,{colSpan:6,className:"text-center text-muted-foreground py-8",children:"Loading posts..."})}):L.length===0?e.jsx(Ne,{children:e.jsx(k,{colSpan:6,className:"text-center text-muted-foreground py-8",children:"No posts found."})}):L.map(s=>{const a=s.categoryId?ls[s.categoryId]:null,n=s.authorId?is[s.authorId]:null,u=xa(s);return e.jsxs(Ne,{children:[e.jsx(k,{className:"font-medium max-w-[300px] truncate",children:s.title}),e.jsxs(k,{children:[e.jsx(ie,{variant:"outline",className:`${u.color} border-0 rounded-md`,children:u.label}),s.qualityScore!==null&&e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Score: ",s.qualityScore.toFixed(1),"/10"]})]}),e.jsx(k,{className:"text-muted-foreground",children:(a==null?void 0:a.name)||"â"}),e.jsx(k,{className:"text-muted-foreground",children:(n==null?void 0:n.displayName)||"â"}),e.jsx(k,{className:"text-muted-foreground text-sm",children:s.publishedAt?e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ue,{className:"h-3.5 w-3.5"}),Qe(new Date(s.publishedAt),"MMM d, yyyy")]}):"â"}),e.jsx(k,{children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(i,{variant:"ghost",size:"icon",onClick:()=>cs(s),title:"Edit",children:e.jsx(Ns,{className:"h-4 w-4"})}),e.jsx(i,{variant:"ghost",size:"icon",onClick:()=>rs(s),title:"AI Refine",children:e.jsx(be,{className:"h-4 w-4"})}),s.status!=="draft"&&e.jsx(i,{variant:"ghost",size:"icon",onClick:()=>{ze(s),De(!0)},title:"Quality Gate History",children:e.jsx(ye,{className:"h-4 w-4"})}),e.jsx(i,{variant:"ghost",size:"icon",onClick:()=>{I(s),X(!0)},title:"Delete",className:"text-destructive hover:text-destructive",children:e.jsx(Be,{className:"h-4 w-4"})})]})})]},s.id)})})]})})]}),e.jsx("div",{className:"block md:hidden space-y-3",children:as?e.jsx(p,{children:e.jsx(j,{className:"py-8 text-center text-muted-foreground",children:"Loading posts..."})}):L.length===0?e.jsx(p,{children:e.jsx(j,{className:"py-8 text-center text-muted-foreground",children:"No posts found."})}):L.map(s=>{const a=s.categoryId?ls[s.categoryId]:null,n=s.authorId?is[s.authorId]:null,u=Ce[s.status]||Ce.draft,g=s.readingTimeMinutes?`${s.readingTimeMinutes} min read`:"";return e.jsx(p,{className:"overflow-hidden",children:e.jsxs(j,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[e.jsx("h3",{className:"font-semibold text-sm leading-tight flex-1 line-clamp-2",children:s.title}),e.jsxs("div",{className:"flex flex-col items-end gap-1 shrink-0",children:[e.jsx(ie,{variant:"outline",className:`${u.color} border-0 rounded-md text-[10px]`,children:u.label}),s.qualityScore!==null&&e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["Score: ",s.qualityScore.toFixed(1),"/10"]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-muted-foreground mb-3",children:[a&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ua,{className:"h-3 w-3"}),a.name]}),n&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ge,{className:"h-3 w-3"}),n.displayName]}),s.publishedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ue,{className:"h-3 w-3"}),Qe(new Date(s.publishedAt),"MMM d, yyyy")]}),g&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(js,{className:"h-3 w-3"}),g]})]}),s.excerpt&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-3",children:s.excerpt}),e.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[e.jsxs(i,{variant:"ghost",size:"sm",className:"h-8 text-xs gap-1.5 flex-1",onClick:()=>cs(s),children:[e.jsx(Ns,{className:"h-3.5 w-3.5"}),"Edit"]}),e.jsxs(i,{variant:"ghost",size:"sm",className:"h-8 text-xs gap-1.5 flex-1",onClick:()=>rs(s),title:"AI Refine",children:[e.jsx(be,{className:"h-3.5 w-3.5"}),"AI"]}),s.status!=="draft"&&e.jsxs(i,{variant:"ghost",size:"sm",className:"h-8 text-xs gap-1.5 flex-1",onClick:()=>{ze(s),De(!0)},title:"Quality Gate History",children:[e.jsx(ye,{className:"h-3.5 w-3.5"}),"Gate"]}),e.jsxs(i,{variant:"ghost",size:"sm",className:"h-8 text-xs gap-1.5 flex-1 text-destructive hover:text-destructive",onClick:()=>{I(s),X(!0)},children:[e.jsx(Be,{className:"h-3.5 w-3.5"}),"Delete"]})]})]})},s.id)})})]}),Z==="settings"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs(p,{children:[e.jsx(R,{children:e.jsxs(D,{className:"text-lg font-medium flex items-center gap-2",children:[e.jsx(js,{className:"h-4 w-4"}),"Current Schedule"]})}),e.jsx(j,{children:o?e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium",children:o.frequency==="daily"?e.jsxs(e.Fragment,{children:["Runs ",e.jsx("span",{className:"text-primary",children:"every day"})," at ",e.jsxs("span",{className:"text-primary",children:[o.time," UTC"]})]}):e.jsxs(e.Fragment,{children:["Runs every ",e.jsx("span",{className:"text-primary",children:o.day})," at ",e.jsxs("span",{className:"text-primary",children:[o.time," UTC"]})]})}),e.jsxs("p",{className:"text-muted-foreground text-xs mt-1",children:["Next run: ",o.nextRun]})]}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})})]}),e.jsxs(p,{children:[e.jsx(R,{children:e.jsxs(D,{className:"text-lg font-medium flex items-center gap-2",children:[e.jsx(F,{className:"h-4 w-4"}),"Auto-Publish"]})}),e.jsxs(j,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Auto-publish draft blog posts"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"When enabled, AI-generated posts skip the review queue and are published immediately."})]}),e.jsx("button",{type:"button",onClick:()=>{const s=!se;Je(s),x.mutate({day:ee,time:N,frequency:O,autoPublish:s})},className:`relative inline-flex h-7 w-12 shrink-0 cursor-pointer items-center rounded-full border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${se?"border-green-500 bg-green-500":"border-input bg-muted"}`,role:"switch","aria-checked":se,children:e.jsx("span",{className:`pointer-events-none block h-5 w-5 rounded-full bg-white shadow-sm ring-0 transition-transform ${se?"translate-x-6":"translate-x-0.5"}`})})]}),se&&e.jsxs("div",{className:"mt-3 flex items-center gap-1.5 text-xs text-green-600",children:[e.jsx(F,{className:"h-3.5 w-3.5"}),"New blog posts will be auto-published when the pipeline runs."]})]})]}),e.jsxs(p,{children:[e.jsx(R,{children:e.jsxs(D,{className:"text-lg font-medium flex items-center gap-2",children:[e.jsx(ye,{className:"h-4 w-4"}),"Content Quality Gate"]})}),e.jsxs(j,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Run automated quality gate on new drafts"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Checks competitor links, broken links, and 8 weighted quality criteria. Drafts that fail are automatically refined and re-checked (up to 3 rewrites) before publishing, or marked Rewrite Failed for manual review."})]}),e.jsx("button",{type:"button",onClick:()=>{const s=!ue;Xe(s),x.mutate({day:ee,time:N,frequency:O,qualityGateEnabled:s})},className:`relative inline-flex h-7 w-12 shrink-0 cursor-pointer items-center rounded-full border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${ue?"border-green-500 bg-green-500":"border-input bg-muted"}`,role:"switch","aria-checked":ue,children:e.jsx("span",{className:`pointer-events-none block h-5 w-5 rounded-full bg-white shadow-sm ring-0 transition-transform ${ue?"translate-x-6":"translate-x-0.5"}`})})]}),e.jsxs("div",{className:"mt-4 space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Competitor domains"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"One domain per line. Posts linking to these domains fail the quality gate."}
8),e.jsx(q,{value:Ze,onChange:s=>es(s.target.value),placeholder:`competitor-a.com 9competitor-b.com`,className:"font-mono text-xs h-24"}),e.jsxs(i,{size:"sm",variant:"outline",onClick:qs,disabled:x.isPending,className:"gap-1.5",children:[e.jsx(ne,{className:"h-3.5 w-3.5"}),"Save Domains"]})]})]})]}),e.jsxs(p,{children:[e.jsx(R,{children:e.jsxs(D,{className:"text-lg font-medium flex items-center gap-2",children:[e.jsx(hs,{className:"h-4 w-4"}),"Edit Schedule"]})}),e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-1.5 mb-4",children:[e.jsx("label",{className:"text-sm font-medium",children:"Frequency"}),e.jsxs(oa,{type:"single",value:O,onValueChange:s=>{s&&Ye(s)},variant:"outline",size:"sm",children:[e.jsxs(vs,{value:"daily",className:"gap-1.5",children:[e.jsx(ma,{className:"h-3.5 w-3.5"}),"Every Day"]}),e.jsxs(vs,{value:"weekly",className:"gap-1.5",children:[e.jsx(Ue,{className:"h-3.5 w-3.5"}),"Weekly"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-md",children:[O==="weekly"?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Day of Week"}),e.jsxs(y,{value:ee,onValueChange:We,children:[e.jsx(w,{children:e.jsx(C,{})}),e.jsx(S,{children:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"].map(s=>e.jsx(c,{value:s,children:s},s))})]})]}):e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Day"}),e.jsx("div",{className:"flex items-center h-10 px-3 rounded-md border border-border bg-muted/30 text-sm text-muted-foreground",children:"Every day"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Time (UTC)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(y,{value:N.split(":")[0],onValueChange:s=>Fe(`${s}:${N.split(":")[1]}`),children:[e.jsx(w,{className:"w-20",children:e.jsx(C,{})}),e.jsx(S,{children:Array.from({length:24},(s,a)=>String(a).padStart(2,"0")).map(s=>e.jsx(c,{value:s,children:s},s))})]}),e.jsx("span",{className:"text-muted-foreground",children:":"}),e.jsxs(y,{value:N.split(":")[1]||"00",onValueChange:s=>Fe(`${N.split(":")[0]}:${s}`),children:[e.jsx(w,{className:"w-20",children:e.jsx(C,{})}),e.jsx(S,{children:["00","15","30","45"].map(s=>e.jsx(c,{value:s,children:s},s))})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[parseInt(N.split(":")[0])>=12?"PM":"AM"," · 24-hour format"]})]})]}),e.jsxs("div",{className:"mt-4",children:[e.jsxs(i,{onClick:()=>x.mutate({day:ee,time:N,frequency:O}),disabled:x.isPending,className:"gap-2",children:[e.jsx(ne,{className:"h-4 w-4"}),x.isPending?"Saving...":"Save Schedule"]}),x.isSuccess&&((ms=x.data)==null?void 0:ms.success)&&e.jsxs("p",{className:"text-sm text-green-600 mt-2 flex items-center gap-1",children:[e.jsx(F,{className:"h-4 w-4"}),"Schedule saved! ",x.data.message]}),x.isError&&e.jsxs("p",{className:"text-sm text-red-600 mt-2 flex items-center gap-1",children:[e.jsx(Le,{className:"h-4 w-4"}),"Failed to save schedule"]})]})]})]}),e.jsxs(p,{children:[e.jsx(R,{children:e.jsxs(D,{className:"text-lg font-medium flex items-center gap-2",children:[e.jsx(Ge,{className:"h-4 w-4"}),"Authors"]})}),e.jsxs(j,{children:[G.length===0?e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"No authors yet. Create one to publish blog posts."}):e.jsx("div",{className:"space-y-2 mb-3",children:G.map(s=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Ge,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{children:s.displayName}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(@",s.slug,")"]})]},s.id))}),e.jsxs(_,{open:Rs,onOpenChange:qe,children:[e.jsx(Ws,{asChild:!0,children:e.jsxs(i,{variant:"outline",size:"sm",className:"gap-1.5",children:[e.jsx(gs,{className:"h-3.5 w-3.5"}),"New Author"]})}
9),e.jsxs(z,{children:[e.jsxs(H,{children:[e.jsx(W,{children:"Create Author"}),e.jsx(Y,{children:"Add a new blog author for the pipeline to use."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Display Name"}),e.jsx(f,{value:B.displayName,onChange:s=>ge(a=>({...a,displayName:s.target.value,slug:ws(s.target.value)})),placeholder:"e.g. John Doe"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Slug"}),e.jsx(f,{value:B.slug,onChange:s=>ge(a=>({...a,slug:s.target.value})),placeholder:"john-doe"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Bio (optional)"}),e.jsx(q,{value:B.bio,onChange:s=>ge(a=>({...a,bio:s.target.value})),placeholder:"Short author biography...",rows:3})]})]}),e.jsxs(J,{children:[e.jsx(i,{variant:"outline",onClick:()=>qe(!1),children:"Cancel"}),e.jsx(i,{onClick:Es,disabled:!B.displayName||!B.slug||$e.isPending,className:"gap-2",children:$e.isPending?e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"h-4 w-4 animate-spin"})," Creating..."]}):"Create Author"})]})]})]})]})]}),e.jsxs(p,{children:[e.jsx(R,{children:e.jsxs(D,{className:"text-lg font-medium flex items-center gap-2",children:[e.jsx(bs,{className:"h-4 w-4"}),"Manual Pipeline Run"]})}),e.jsxs(j,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["Run the AI blog pipeline right now. The article will be saved in ",e.jsx("strong",{children:"Review"})," status and will not be published until you approve it."]}),e.jsx(i,{onClick:Ms,disabled:he,className:"gap-2",children:he?e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"h-4 w-4 animate-spin"})," Running..."]}):e.jsxs(e.Fragment,{children:[e.jsx(bs,{className:"h-4 w-4"})," Run Pipeline Now"]})}),he&&pe&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsx(Ys,{value:pe.progress,className:"h-2"}),e.jsx("div",{className:"grid gap-1.5",children:Ds.map((s,a)=>{const n=pe.stageIndex,u=a<n,g=a===n;return e.jsxs("div",{className:`flex items-center gap-2 text-xs ${u?"text-green-600":g?"text-foreground font-medium":"text-muted-foreground/50"}`,children:[u?e.jsx(F,{className:"h-3.5 w-3.5 shrink-0"}):g?e.jsx(we,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}):e.jsx("div",{className:"h-3.5 w-3.5 shrink-0 rounded-full border border-muted-foreground/30"}),e.jsx("span",{children:s.label})]},s.id)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:pe.message})]}),xe&&!he&&e.jsx("div",{className:`mt-3 p-3 rounded-md text-sm ${xe.success?"bg-green-50 text-green-700 border border-green-200":"bg-red-50 text-red-700 border border-red-200"}`,children:e.jsxs("p",{className:"flex items-start gap-2",children:[xe.success?e.jsx(F,{className:"h-4 w-4 mt-0.5 shrink-0"}):e.jsx(Le,{className:"h-4 w-4 mt-0.5 shrink-0"}),e.jsx("span",{children:xe.message})]})})]})]})]}),e.jsx(_,{open:Ss,onOpenChange:ce,children:e.jsxs(z,{className:"max-w-2xl max-h-[85vh] overflow-y-auto",children:[e.jsxs(H,{
9children:[e.jsx(W,{children:"Create New Post"}),e.jsx(Y,{children:"Fill in the details below to create a new blog post."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Title"}),e.jsx(f,{value:l.title,onChange:s=>Bs(s.target.value),placeholder:"Post title"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Slug"}),e.jsx(f,{value:l.slug,onChange:s=>{r(a=>({...a,slug:s.target.value})),Se(!0)},placeholder:"post-slug"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Category"}),e.jsxs(y,{value:String(l.categoryId),onValueChange:s=>r(a=>({...a,categoryId:parseInt(s)})),children:[e.jsx(w,{children:e.jsx(C,{placeholder:"Select category"})}),e.jsxs(S,{children:[e.jsx(c,{value:"0",children:"None"}),fe.map(s=>e.jsx(c,{value:String(s.id),children:s.name},s.id))]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Status"}),e.jsxs(y,{value:l.status,onValueChange:s=>r(a=>({...a,status:s})),children:[e.jsx(w,{children:e.jsx(C,{placeholder:"Select status"})}),e.jsxs(S,{children:[e.jsx(c,{value:"draft",children:"Draft"}),e.jsx(c,{value:"review",children:"Review"}),e.jsx(c,{value:"published",children:"Published"}),e.jsx(c,{value:"archived",children:"Archived"})]})]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Author"}),e.jsxs(y,{value:String(l.authorId),onValueChange:s=>r(a=>({...a,authorId:parseInt(s)})),children:[e.jsx(w,{children:e.jsx(C,{placeholder:"Select author"})}),e.jsxs(S,{children:[e.jsx(c,{value:"0",children:"None"}),G.map(s=>e.jsx(c,{value:String(s.id),children:s.displayName},s.id))]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Content (Markdown)"}),e.jsx(q,{value:l.content,onChange:s=>r(a=>({...a,content:s.target.value})),placeholder:"Write your post content in Markdown...",rows:12})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"SEO Title"}),e.jsx(f,{value:l.seoTitle,onChange:s=>r(a=>({...a,seoTitle:s.target.value})),placeholder:"SEO title (optional)"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"SEO Description"}),e.jsx(q,{value:l.seoDescription,onChange:s=>r(a=>({...a,seoDescription:s.target.value})),placeholder:"SEO description (optional)",rows:2})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Tags"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[ve.map(s=>e.jsxs(ie,{variant:l.tagIds.includes(s.id)?"default":"outline",className:`cursor-pointer rounded-md ${l.tagIds.includes(s.id)?"bg-orange-500 hover:bg-orange-600":""}`,onClick:()=>os(s.id),children:[s.name,l.tagIds.includes(s.id)&&e.jsx(fs,{className:"ml-1 h-3 w-3"})]},s.id)),ve.length===0&&e.jsx("span",{className:"text-sm text-muted-foreground",children:"No tags available."})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Featured Image URL"}),e.jsx(f,{value:l.featuredImageUrl,onChange:s=>r(a=>({...a,featuredImageUrl:s.target.value})),placeholder:"https://example.com/image.jpg (optional)"})]})]}),e.jsxs(J,{children:[e.jsx(i,{variant:"outline",onClick:()=>{ce(!1),te()},children:"Cancel"}),e.jsxs(i,{onClick:ds,disabled:Ee.isPending||!l.title||!l.slug,className:"gap-2",children:[e.jsx(ne,{className:"h-4 w-4"}),Ee.isPending?"Creating...":"Create Post"]})]})]})}),e.jsx(_,{open:Is,onOpenChange:de,children:e.jsxs(z,{className:"max-w-2xl max-h-[85vh] overflow-y-auto",children:[e.jsxs(H,{
9children:[e.jsx(W,{children:"Edit Post"}),e.jsx(Y,{children:"Update the details of this blog post."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Title"}),e.jsx(f,{value:l.title,onChange:s=>r(a=>({...a,title:s.target.value})),placeholder:"Post title"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Slug"}),e.jsx(f,{value:l.slug,onChange:s=>r(a=>({...a,slug:s.target.value})),placeholder:"post-slug"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Category"}),e.jsxs(y,{value:String(l.categoryId),onValueChange:s=>r(a=>({...a,categoryId:parseInt(s)})),children:[e.jsx(w,{children:e.jsx(C,{placeholder:"Select category"})}),e.jsxs(S,{children:[e.jsx(c,{value:"0",children:"None"}),fe.map(s=>e.jsx(c,{value:String(s.id),children:s.name},s.id))]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Status"}),e.jsxs(y,{value:l.status,onValueChange:s=>r(a=>({...a,status:s})),children:[e.jsx(w,{children:e.jsx(C,{placeholder:"Select status"})}),e.jsxs(S,{children:[e.jsx(c,{value:"draft",children:"Draft"}),e.jsx(c,{value:"review",children:"Review"}),e.jsx(c,{value:"published",children:"Published"}),e.jsx(c,{value:"archived",children:"Archived"})]})]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Author"}),e.jsxs(y,{value:String(l.authorId),onValueChange:s=>r(a=>({...a,authorId:parseInt(s)})),children:[e.jsx(w,{children:e.jsx(C,{placeholder:"Select author"})}),e.jsxs(S,{children:[e.jsx(c,{value:"0",children:"None"}),G.map(s=>e.jsx(c,{value:String(s.id),children:s.displayName},s.id))]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Content (Markdown)"}),e.jsx(q,{value:l.content,onChange:s=>r(a=>({...a,content:s.target.value})),placeholder:"Write your post content in Markdown...",rows:12})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"SEO Title"}),e.jsx(f,{value:l.seoTitle,onChange:s=>r(a=>({...a,seoTitle:s.target.value})),placeholder:"SEO title (optional)"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"SEO Description"}),e.jsx(q,{value:l.seoDescription,onChange:s=>r(a=>({...a,seoDescription:s.target.value})),placeholder:"SEO description (optional)",rows:2})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Tags"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[ve.map(s=>e.jsxs(ie,{variant:l.tagIds.includes(s.id)?"default":"outline",className:`cursor-pointer rounded-md ${l.tagIds.includes(s.id)?"bg-orange-500 hover:bg-orange-600":""}`,onClick:()=>os(s.id),children:[s.name,l.tagIds.includes(s.id)&&e.jsx(fs,{className:"ml-1 h-3 w-3"})]},s.id)),ve.length===0&&e.jsx("span",{className:"text-sm text-muted-foreground",children:"No tags available."})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Featured Image URL"}),e.jsx(f,{value:l.featuredImageUrl,onChange:s=>r(a=>({...a,featuredImageUrl:s.target.value})),placeholder:"https://example.com/image.jpg (optional)"})]})]}),e.jsxs(J,{children:[e.jsx(i,{variant:"outline",onClick:()=>{de(!1),I(null),te()},children:"Cancel"}),e.jsxs(i,{onClick:ds,disabled:Me.isPending||!l.title||!l.slug,className:"gap-2",children:[e.jsx(ne,{className:"h-4 w-4"}),Me.isPending?"Saving...":"Save Changes"]})]})]})}),e.jsx(_,{open:ks,onOpenChange:s=>{X(s),s||I(null)}
9,children:e.jsxs(z,{className:"max-w-md",children:[e.jsxs(H,{children:[e.jsx(W,{children:"Delete Post"}),e.jsxs(Y,{children:["Are you sure you want to delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:A==null?void 0:A.title}),"? This cannot be undone."]})]}),e.jsxs(J,{children:[e.jsx(i,{variant:"outline",onClick:()=>{X(!1),I(null)},children:"Cancel"}),e.jsxs(i,{variant:"destructive",onClick:()=>{A&&Oe.mutate(A.id)},disabled:Oe.isPending,className:"gap-2",children:[e.jsx(Be,{className:"h-4 w-4"}),Oe.isPending?"Deleting...":"Delete"]})]})]})}),e.jsx(_,{open:As,onOpenChange:Ie,children:e.jsxs(z,{className:"max-w-3xl max-h-[85vh] overflow-y-auto",children:[e.jsxs(H,{children:[e.jsxs(W,{className:"flex items-center gap-2",children:[e.jsx(be,{className:"h-5 w-5 text-primary"}),"AI Refinement",E?` â ${E.title}`:""]}),e.jsx(Y,{children:"Tell the AI what changes to make to this blog post."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Your instruction"}),e.jsx(q,{placeholder:'e.g. "Make the intro more engaging and add SEO keywords about REPS tax benefits"',value:oe,onChange:s=>Pe(s.target.value),rows:3,disabled:Ae})]}),e.jsx(i,{onClick:Os,disabled:Ae||!oe.trim(),className:"gap-2",children:Ae?e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"h-4 w-4 animate-spin"})," Refining..."]}):e.jsxs(e.Fragment,{children:[e.jsx(be,{className:"h-4 w-4"})," Refine with AI"]})}),Ke&&e.jsxs("div",{className:"flex items-start gap-2 p-3 bg-destructive/10 text-destructive rounded-md text-sm",children:[e.jsx(Le,{className:"h-4 w-4 mt-0.5 shrink-0"}),e.jsx("span",{children:Ke})]}),M&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(ps,{}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{className:"h-4 w-4 text-green-600"}),e.jsx("span",{className:"text-sm font-medium text-green-600",children:"AI Refinement Result"})]}),e.jsx("div",{className:"bg-muted rounded-md p-4 text-sm max-h-[400px] overflow-y-auto border prose prose-sm dark:prose-invert max-w-none",children:e.jsx(Js,{remarkPlugins:[Xs],children:M})}),e.jsxs(J,{children:[e.jsx(i,{variant:"outline",onClick:()=>{Ie(!1),ke(null)},children:"Cancel"}),e.jsxs(i,{onClick:$s,className:"gap-2",children:[e.jsx(ne,{className:"h-4 w-4"}),"Apply Changes"]})]})]}),Ts&&!M&&e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-green-50 dark:bg-green-950/30 text-green-700 dark:text-green-400 rounded-md text-sm border border-green-200 dark:border-green-800",children:[e.jsx(F,{className:"h-4 w-4 shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Changes applied!"})," Type a new instruction above to refine further."]})]})]})]})}),e.jsx(_,{open:_e,onOpenChange:De,children:e.jsxs(z,{className:"max-w-2xl",children:[e.jsxs(H,{
9children:[e.jsxs(W,{className:"flex items-center gap-2",children:[e.jsx(ye,{className:"h-4 w-4"}),"Quality Gate History"]}),e.jsxs(Y,{children:[d==null?void 0:d.title,d&&e.jsxs(e.Fragment,{children:[" â ",d.rewriteAttempts," rewrite",d.rewriteAttempts===1?"":"s"," so far"]})]})]}),e.jsx("div",{className:"max-h-[60vh] overflow-y-auto space-y-3",children:Fs?e.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"Loading attempts..."}):ts.length===0?e.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"The quality gate hasn't run for this post yet."}):ts.map(s=>e.jsxs("div",{className:"border rounded-md p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["Attempt #",s.attemptNumber]}),e.jsxs("div",{className:"flex items-center gap-2",children:[s.overallScore!==null&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.overallScore.toFixed(1),"/10"]}),e.jsx(ie,{variant:"outline",className:`border-0 rounded-md text-[10px] ${s.passed?"bg-green-100 text-green-700":s.outcome==="rewrite_failed"?"bg-red-100 text-red-700":"bg-amber-100 text-amber-700"}`,children:s.passed?"Passed":s.outcome==="rewrite_failed"?"Rewrite Failed":"Failed"})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[Qe(new Date(s.createdAt),"MMM d, yyyy h:mm a")," · Phase 1:"," ",s.phase1Passed?"Passed":"Failed"]}),s.competitorViolations.length>0&&e.jsxs("p",{className:"text-xs text-red-600",children:["Competitor links: ",s.competitorViolations.join(", ")]}),s.brokenLinks.length>0&&e.jsxs("p",{className:"text-xs text-red-600",children:["Broken links: ",s.brokenLinks.map(a=>a.url).join(", ")]}),s.phase2Result&&s.phase2Result.correctiveActions.length>0&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsx("p",{className:"font-medium mb-0.5",children:"Corrective actions:"}),e.jsx("ul",{className:"list-disc list-inside space-y-0.5",children:s.phase2Result.correctiveActions.map((a,n)=>e.jsx("li",{children:a},n))})]})]},s.id))}),e.jsx(J,{children:e.jsxs(i,{variant:"outline",onClick:()=>d&&ns.mutate(d.id),disabled:!d||d.status==="rewrite_in_progress"||ns.isPending,className:"gap-1.5",children:[e.jsx(Zs,{className:"h-3.5 w-3.5"}),"Re-run Quality Gate"]})})]})})]})}export{ya 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.