PageSourceSearch

https://writer-gpt.com/assets/Generate-De0d5AoD.js

js writer-gpt.com collected 2026-10-03 19:29:33 UTC 223,240 bytes, 349 lines download raw bytes

1import{c as ul,b as Ae,r as a,j as e,f as Gl,S as cr,B as I,i as u,d as xc,u as Rn,s as oe,L as rs,h as ml,k as ms,X as $l,e as dc,a as Ql,g as Jl,l as Xl,m as Zl,t as eo,T as so}from"./index-DEE2k2I2.js";import{a as to}from"./frictionTracker-JsK4ytbu.js";import{S as ao}from"./SEO-C2jiMBFA.js";import{u as no,D as ro}from"./DashboardLayout-oWv6dpHO.js";import{T as ye}from"./textarea-BsAdiKEM.js";import{I as Y}from"./input-BqRoER_N.js";import{L as r}from"./label-C-RZGl6M.js";import{B as W}from"./badge-CaBntYTQ.js";import{S as O,a as q,b as K,c as z,d as o}from"./select-C4Cs7y8V.js";import{S as H}from"./slider-DzmP27T3.js";import{R as io,a as co}from"./radio-group-sqF0H_5U.js";import{A as Tn,a as ne,b as re,c as ie}from"./accordion-Bbo_Nd8o.js";import{A as In,a as Ln,b as An,c as En,d as Dn,e as Pn,f as Mn,g as Fn}from"./alert-dialog-DEmxxPqG.js";import{V as On}from"./video-link-ZGE6Ry6V.js";import{Z as pc}from"./zap-CCzOhOHw.js";import{L as hl}from"./lock-BltHj06N.js";import{S as xl}from"./scroll-area-VKicQLxr.js";import{L as Wc}from"./layers-leFO47DJ.js";import{L as Ft}from"./link-2-BRphQqNq.js";import{T as ic}from"./target-BZdoLJwC.js";import{N as Gc}from"./network-BS6xBFAc.js";import{G as lo,L as oo}from"./layout-list-C8E_xU9W.js";import{A as $c}from"./arrow-right-DcJn1afb.js";import{S as Le}from"./sparkles-BwOLhAcY.js";import{F as Ve}from"./file-text-pAMgX0O6.js";import{L as uo,Q as mo}from"./quote-CMB2yfCQ.js";import{T as ho}from"./table-DUK5ONQW.js";import{B as lr}from"./book-open-BKS5JB5d.js";import{M as ir}from"./message-square-Dlsl3Y9Q.js";import{A as xo}from"./award-DT0YsPiu.js";import{F as po}from"./filter-DAJoaRz7.js";import{T as go}from"./tags-Bf-Q6E6G.js";import{S as jo}from"./share-2-h0iFMy7-.js";import{D as Qc}from"./database-CLumb1kj.js";import{P as fo}from"./puzzle-D_AyWKGK.js";import{T as Jc}from"./type-DVjxPjhB.js";import{E as yo}from"./eye-C7yu3TtZ.js";import{A as vo}from"./align-left--pUF35Pa.js";import{B as bo}from"./ban-BcLsOgag.js";import{L as _o}from"./lightbulb-B_tzMTjZ.js";import{C as pl}from"./circle-check-big-CvLIafCe.js";import{R as Xc}from"./repeat-DVH3ospT.js";import{H as No}from"./hash-CLjmdkxJ.js";import{T as Zc}from"./trending-up-DR-R7eFg.js";import{C as el}from"./chart-column-BHp4UUJ8.js";import{G as mr}from"./globe-DTrW5Acr.js";import{S as gc}from"./search-DMEWQECv.js";import{C as wo}from"./circle-help-C_QxuCW4.js";import{C as ko}from"./compass-BhlmRxtE.js";import{B as So}from"./brain-DHxG564a.js";import{G as Co}from"./gauge-JwuxuJzc.js";import{C as To}from"./cpu-CEGDRfyZ.js";import{H as Io}from"./heart-pulse-CorWDZzm.js";import{C as Lo}from"./circle-x-DyTKaApg.js";import{K as or}from"./key-xcyo2xlX.js";import{H as Ao}from"./heading-rBXBXrS3.js";import{C as jc}from"./checkbox-B5b7leSS.js";import{C as gl,a as Eo}from"./card-hR8LrYZW.js";import{u as fc}from"./useSEOTemplates-eno7vVjZ.js";import{D as yc,a as vc,b as bc,c as _c,d as jl,e as fl,f as Do}from"./dialog-CNbQF2T8.js";import{L as He}from"./loader-circle-BSyeuoBS.js";import{S as dr}from"./save-vjQ3HohX.js";import{S as Po}from"./settings-2-Bm7u82lc.js";import{S as yl}from"./star-C3yyEiDJ.js";import{T as hs}from"./trash-2-BmMFNL6M.js";import{R as Mo}from"./refresh-cw-BvKkR_k3.js";import{C as Fo}from"./useKnowledgeBase-BJ_JXg6x.js";import{u as vl,F as Ro}from"./useArticleFolders-BgYwEPsb.js";import{u as Oo}from"./useBrandVoiceSites-CKNQvpwM.js";import{E as qo}from"./external-link-DqJO281o.js";import{C as Ko}from"./check-D2tgyCPN.js";import{F as zo,D as Uo,a as Bo,b as Vo,c as Ho,d as Yo,e as Wo}from"./drawer-DrikKIsR.js";import{W as Nc,C as tr}from"./wand-sparkles-CVL6x7yr.js";import{u as Go}from"./use-mobile-Cc8eyPvS.js";import{u as Cn}from"./useMutation-BA87R7bK.js";import{P as $o}from"./plus-BUc6783y.js";import{A as ar,a as nr,b as rr}from"./alert-Coqgtwrs.js";import{L as Qo}from"./LanguageCombobox-Cv6VjFd3.js";import{R as sl}from"./rotate-ccw-CsZu63Ea.js";import{C as bl}from"./circle-check-BS1djYfd.js";import{T as Ss}from"./triangle-alert-UVNELC-r.js";import{C as Jo}from"./circle-arrow-up-BnEBrp-g.js";import{U as Xo}from"./upload-Bwx8W7w3.js";import{S as uc}from"./sliders-horizontal-CXuUuhCr.js";import{S as cc}from"./settings-C6TVzL8g.js";import{L as Zo}from"./list-checks-C0UefsY0.js";import{L as ed}from"./languages-DO_Hnhds.js";import{I as sd}from"./image-2Lzj_cYa.js";import{C as tl}from"./chevron-left-2DGVj3CW.js";import"./Logo-DqK2NfI4.js";import"./useFeaturePreferences-DU0v27AU.js";import"./infinity-C6_Jjd4l.js";import"./panel-left-DoXDlyxn.js";import"./heart-DvYuSsuu.js";import"./layout-dashboard-DwbrXrmv.js";import"./pen-tool-CULLXmnM.js";import"./key-round-g0EnKxHf.js";import"./repeat-2-C7ii46b1.js";import"./calendar-days-DCHRO22S.js";import"./credit-card-BaPfOH75.js";import"./dropdown-menu-swy5A05I.js";import"./index-B8mvpLaw.js";import"./Combination-BWs1x3Zl.js";import"./index-C7HwHaRY.js";import"./avatar-haCXPPU5.js";import"./tabs-Cl2PuyHE.js";import"./useAdminAnnouncements-CtUHezDl.js";import"./en-US-DgaeWpfW.js";import"./constructFrom-rJN6zrQ_.js";import"./startOfWeek-CGNiWUve.js";import"./info-DQaxphPF.js";import"./formatDistanceToNow-CTraltex.js";import"./differenceInCalendarMonths-DdVU3xYm.js";import"./endOfDay-A-ioHiWL.js";import"./endOfMonth-CoG5-XNs.js";import"./circle-alert-C2xxRh9c.js";import"./megaphone-BZ4f1ELR.js";import"./bell-nd8lhLhc.js";import"./check-check-BjbrLplr.js";import"./startOfMonth-BqpJtJQc.js";import"./crown-CvaVEfF_.js";import"./LanguageSwitcher-D6cVDzy6.js";import"./useProfile-CQfNtlU1.js";import"./sun-DsYfn0nZ.js";import"./user-CR5_ltgY.js";import"./log-out-CqlM66nC.js";import"./BottomNav-cK2LBe1A.js";import"./index-BdQq_4o_.js";import"./index-BONtJRP0.js";import"./index-BzPNQJpr.js";import"./play-DmBsAyAT.js";import"./edgeFunctionError-BI5SFFeM.js";import"./useUserIds-DcLA9-E8.js";import"./popover-BKmC39QR.js";import"./command-DFw8u7zX.js";import"./languages--evqGpzI.js";/**
2 * @license lucide-react v0.462.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 al=ul("ScanLine",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const nl=ul("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),td=[{key:"relaxed",icon:pc,tKey:"generate.relaxed",colors:{active:"bg-emerald-600 text-white shadow-lg shadow-emerald-500/25",inactive:"text-emerald-400 hover:bg-emerald-500/15",ring:"ring-emerald-500/30"}},{key:"recommended",icon:cr,tKey:"generate.recommended",colors:{active:"bg-blue-600 text-white shadow-lg shadow-blue-500/25",inactive:"text-blue-400 hover:bg-blue-500/15",ring:"ring-blue-500/30"}},{key:"strict",icon:hl,tKey:"generate.strict",colors:{active:"bg-amber-600 text-white shadow-lg shadow-amber-500/25",inactive:"text-amber-400 hover:bg-amber-500/15",ring:"ring-amber-500/30"}}];function hr({onApplyPreset:i,activePreset:d}){const{t:p}=Ae(),[m,c]=a.useState(d??null),l=g=>{c(g),i(g)};return e.jsx("div",{className:"inline-flex items-center rounded-lg border border-border bg-muted/40 p-0.5 gap-0.5",children:td.map(g=>{const n=m===g.key,f=g.icon;return e.jsxs("button",{onClick:()=>l(g.key),className:Gl("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-semibold transition-all duration-200 focus-visible:outline-none focus-visible:ring-2",g.colors.ring,n?g.colors.active:g.colors.inactive),children:[e.jsx(f,{className:"h-3.5 w-3.5"}),p(g.tKey)]},g.key)})})}const _l={semantic:{title:"Semantic Structure",icon:Wc,colorClasses:{border:"border-cyan-500/40",bg:"bg-cyan-500/10",iconBg:"bg-cyan-500/20",iconColor:"text-cyan-400"},rules:[{id:"semantic_triples",name:"Semantic Triples",description:"Use Subject + Predicate + Object structure",icon:Ft,promptInstruction:"Use semantic triples (Subject-Predicate-Object) in key sentences."},{id:"entity_focus",name:"Entity Focus",description:"Write about entities, not just keywords",icon:ic,promptInstruction:"Focus on named entities and their attributes rather than generic keywords."},{id:"topic_clustering",name:"Topic Clustering",description:"Group related concepts together",icon:Gc,promptInstruction:"Organize content into tight topical clusters of related concepts."},{id:"semantic_folding",name:"Semantic Folding",description:"Hierarchical semantic layers",icon:Wc,promptInstruction:"Layer content semantically from broad concepts to specific details."},{id:"coreference_resolution",name:"Coreference Resolution",description:"Clear pronoun-entity mapping",icon:lo,promptInstruction:'Ensure every pronoun clearly maps to its referent entity — avoid ambiguous "it" or "they".'},{id:"predicate_argument",name:"Predicate-Argument",description:"Clear action-object relationships",icon:$c,promptInstruction:"Structure sentences with clear predicate-argument relationships (who does what to whom)."},{id:"discourse_markers",name:"Discourse Markers",description:"Logical connective signals",icon:nl,promptInstruction:"Use discourse markers (however, therefore, consequently) to signal logical relationships between ideas."}]},snippets:{title:"Featured Snippets",icon:Le,colorClasses:{border:"border-amber-500/40",bg:"bg-amber-500/10",iconBg:"bg-amber-500/20",iconColor:"text-amber-400"},rules:[{id:"paragraph_snippets",name:"Paragraph Snippets",description:"40-60 word direct answers",icon:Ve,promptInstruction:"Include concise 40-60 word paragraph answers directly below question headings for snippet capture."},{id:"list_snippets",name:"List Snippets",description:"Ordered/unordered lists for ranking",icon:uo,promptInstruction:"Include numbered or bulleted lists under relevant headings to target list-style featured snippets."},{id:"table_snippets",name:"Table Snippets",description:"Comparison tables for snippet capture",icon:ho,promptInstruction:"Include markdown comparison tables to target table-style featured snippets."},{id:"definition_boxes",name:"Definition Boxes",description:'"X is..." definitions for snippets',icon:lr,promptInstruction:'Include "X is..." definition sentences that directly answer "What is X?" queries.'},{id:"direct_answer",name:"Direct Answer Format",description:"Question → immediate answer pattern",
11icon:ir,promptInstruction:"Place a direct, concise answer immediately after each question heading before elaborating."},{id:"position_zero",name:"Position Zero Targeting",description:"Optimize for Google Position 0",icon:xo,promptInstruction:"Structure each H2 section with a question heading followed by a clear, self-contained answer paragraph optimized for Position Zero."}]},entity:{title:"Entity Optimization",icon:ic,colorClasses:{border:"border-violet-500/40",bg:"bg-violet-500/10",iconBg:"bg-violet-500/20",iconColor:"text-violet-400"},rules:[{id:"entity_salience",name:"Entity Salience",description:"Emphasize primary entity throughout",icon:ic,promptInstruction:"Establish the primary entity early and maintain high salience throughout the content."},{id:"entity_disambiguation",name:"Entity Disambiguation",description:"Clarify entity meaning precisely",icon:po,promptInstruction:"Disambiguate entities that could have multiple meanings — be specific about which entity you mean."},{id:"entity_attributes",name:"Entity Attributes",description:"Include entity properties and facts",icon:go,promptInstruction:"Include factual attributes (dates, locations, properties) for key entities."},{id:"entity_relationships",name:"Entity Relationships",description:"Map connections between entities",icon:jo,promptInstruction:'Explicitly state relationships between entities (e.g., "X is a subsidiary of Y", "A was founded by B").'},{id:"knowledge_panel",name:"Knowledge Panel Signals",description:"Structured data for Knowledge Graph",icon:Qc,promptInstruction:"Include structured factual statements that align with Knowledge Graph entries."},{id:"cooccurring_entities",name:"Co-occurring Entities",description:"Mention related entities together",icon:fo,promptInstruction:"Include co-occurring entities that Google expects to see together in this topic."},{id:"entity_first_sentences",name:"Entity-First Sentences",description:"Lead sentences with entity names",icon:Jc,promptInstruction:"Begin key sentences with the entity name rather than pronouns or generic subjects."}]},clarity:{title:"Content Clarity",icon:yo,colorClasses:{border:"border-green-500/40",bg:"bg-green-500/10",iconBg:"bg-green-500/20",iconColor:"text-green-400"},rules:[{id:"short_sentences",name:"Short Sentences",description:"Keep under 20 words for clarity",icon:vo,promptInstruction:"Keep most sentences under 20 words with simple dependency trees."},{id:"avoid_analogies",name:"Avoid Analogies",description:'No "like" or "as if" comparisons',icon:bo,promptInstruction:'Avoid analogies, similes, and "like/as if" comparisons — use direct factual statements.'},{id:"active_voice",name:"Active Voice",description:"Prefer active over passive constructions",icon:pc,promptInstruction:"Use active voice predominantly — subject performs the action."},{id:"concrete_language",name:"Concrete Language",description:"Specific nouns over abstract terms",icon:_o,promptInstruction:"Use concrete, specific nouns and verbs instead of abstract or vague language."},{id:"front_loading",name:"Front-Loading",description:"Key info at start of paragraphs",icon:$c,promptInstruction:"Front-load paragraphs with the most important information in the first sentence."},{id:"one_idea_per_sentence",name:"One Idea Per Sentence",description:"Single concept per sentence",icon:pl,promptInstruction:"Express one idea per sentence — avoid compound sentences with multiple clauses."},{id:"transition_signals",name:"Transition Signals",description:"Clear logical flow between ideas",icon:Xc,promptInstruction:"Use transition words and phrases to signal relationships between consecutive ideas."}]},factual:{title:"Factual Precision",icon:cr,colorClasses:{border:"border-rose-500/40",bg:"bg-rose-500/10",iconBg:"bg-rose-500/20",iconColor:"text-rose-400"},rules:[{id:"numeric_specifics",name:"Numeric Specifics",description:'"5 reasons" not "many reasons"',icon:No,promptInstruction:'Use specific numbers instead of vague quantifiers ("5 key factors" not "several factors").'},{id:"cite_sources",name:"Cite Sources",description:"Reference authoritative sources",icon:mo,promptInstruction:"Cite authoritative sources, studies, and research to support claims."},{id:"data_recency",name:"Data Recency",description:"Use current statistics and data",icon:Zc,promptInstruction:"Use the most recent available data and statistics — include the year of the data."},{id:"statistical_context",name:"Statistical Context",description:"Contextualize numbers meaningfully",icon:el,promptInstruction:"Provide context for statistics — comparisons, percentages, before/after, growth rates."},{id:"source_diversity",name:"Source Diversity",description:"Multiple source types and domains",icon:mr,promptInstruction:"Reference diverse source types: academic papers, industry reports, government data, expert opinions."},{id:"fact_checkable",name:"Fact-Checkable Claims",description:"Verifiable statements only",icon:cr,promptInstruction:"Make only fact-checkable claims that can be verified — avoid unsubstantiated opinions."}]},query:{title:"Query Matching",icon:gc,colorClasses:{border:"border-blue-500/40",bg:"bg-blue-500/10",iconBg:"bg-blue-500/20",iconColor:"text-blue-400"},rules:[{id:"qa_pairing",name:"Question-Answer Pairing",description:"Match questions with direct answers",icon:wo,promptInstruction:"Structure content as question-answer pairs where the question is an H2/H3 and the answer follows immediately."},{id:"search_intent",name:"Search Intent Alignment",description:"Match user search intent precisely",icon:ko,promptInstruction:"Align content structure and depth to the search intent (informational, navigational, transactional, commercial)."},{id:"query_reformulation",name:"Query Reformulation",description:"Address query variations naturally",icon:Xc,promptInstruction:"Address common reformulations and variations of the main query throughout the content."},{id:"longtail_coverage",name:"Long-Tail Coverage",description:"Cover niche query variations",icon:al,promptInstruction:"Include long-tail keyword variations and niche subto
11pics related to the main query."},{id:"paa_optimization",name:"PAA Optimization",description:"Target People Also Ask queries",icon:ir,promptInstruction:'Include sections that answer "People Also Ask" style questions related to the topic.'},{id:"conversational_queries",name:"Conversational Queries",description:"Natural language question patterns",icon:ir,promptInstruction:"Include natural-language phrased questions as headings (how, why, what, when, where)."}]},readability:{title:"Readability & NLP Signals",icon:So,colorClasses:{border:"border-orange-500/40",bg:"bg-orange-500/10",iconBg:"bg-orange-500/20",iconColor:"text-orange-400"},rules:[{id:"lexical_diversity",name:"Lexical Diversity",description:"Varied vocabulary, avoid repetition",icon:Jc,promptInstruction:"Use high lexical diversity — avoid repeating the same words and phrases. Use synonyms and varied vocabulary."},{id:"tfidf_balance",name:"TF-IDF Balance",description:"Optimal term frequency distribution",icon:el,promptInstruction:"Balance keyword frequency — include the main keyword naturally without stuffing, and use related terms."},{id:"ngram_optimization",name:"N-gram Optimization",description:"Natural phrase-level patterns",icon:Co,promptInstruction:"Use natural n-gram patterns (2-3 word phrases) that match how users search and speak."},{id:"latent_semantic",name:"Latent Semantic Terms",description:"Include LSI keywords naturally",icon:Gc,promptInstruction:"Include latent semantic indexing (LSI) terms — related words and concepts Google expects in this topic."},{id:"keyword_proximity",name:"Keyword Proximity",description:"Keep related terms close together",icon:Ft,promptInstruction:"Keep related keywords and phrases in close proximity within sentences and paragraphs."},{id:"reading_level_target",name:"Reading Level Targeting",description:"Match target audience reading level",icon:lr,promptInstruction:"Write at the appropriate reading level for the target audience — clear but not oversimplified."}]},technical:{title:"Technical NLP",icon:To,colorClasses:{border:"border-emerald-500/40",bg:"bg-emerald-500/10",iconBg:"bg-emerald-500/20",iconColor:"text-emerald-400"},rules:[{id:"schema_hints",name:"Schema Markup Hints",description:"Content structured for schema extraction",icon:Qc,promptInstruction:"Structure content so it can be easily extracted for Article, FAQ, and HowTo schema markup."},{id:"passage_ranking",name:"Passage Ranking",description:"Self-contained passage blocks",icon:Ve,promptInstruction:"Write self-contained passages that can independently answer a query for Google Passage Ranking."},{id:"ner_optimization",name:"Named Entity Recognition",description:"Clear entity boundaries for NLP",icon:al,promptInstruction:"Write with clear entity boundaries that NLP systems can easily identify and classify."},{id:"sentiment_consistency",name:"Sentiment Consistency",description:"Maintain consistent tone throughout",icon:Io,promptInstruction:"Maintain consistent sentiment and tone throughout the article — avoid jarring tonal shifts."},{id:"coherence_score",name:"Content Coherence Score",description:"Logical flow between sections",icon:nl,promptInstruction:"Ensure high coherence: each section logically follows from the previous one with clear connections."},{id:"information_gain",name:"Information Gain",description:"Each section adds new value",icon:Zc,promptInstruction:"Ensure each section provides new information — avoid restating points already covered. Maximize information gain."}]}},xs=Object.values(_l).flatMap(i=>i.rules.map(d=>d.id)),ad=Object.fromEntries(xs.map(i=>[i,!0])),nd={relaxed:Object.fromEntries(xs.map(i=>[i,["semantic_triples","entity_focus","paragraph_snippets","entity_salience","short_sentences","active_voice","numeric_specifics","cite_sources","qa_pairing","search_intent","lexical_diversity","tfidf_balance","passage_ranking","information_gain","direct_answer","front_loading","concrete_language","entity_first_sentences","fact_checkable","reading_level_target","topic_clustering","definition_boxes","paa_optimization","schema_hints","coherence_score","statistical_context","latent_semantic","keyword_proximity","transition_signals","entity_attributes"].includes(i)])),recommended:Object.fromEntries(xs.map(i=>[i,!["coreference_resolution","predicate_argument","table_snippets","knowledge_panel","one_idea_per_sentence","source_diversity","query_reformulation","ngram_optimization","ner_optimization","sentiment_consistency"].includes(i)])),strict:Object.fromEntries(xs.map(i=>[i,!0]))},mc=xs.length;function rl({nlpRules:i,setNlpRules:d,onApplyPreset:p}){const{t:m}=Ae(),c=xs.filter(f=>i[f]).length,l=f=>{d({...i,[f]:!i[f]})},g=()=>{const f={...i};xs.forEach(y=>{f[y]=!0}),d(f)},n=()=>{const f={...i};xs.forEach(y=>{f[y]=!1}),d(f)};return e.jsxs("div",{className:"rounded-xl bg-card border border-border p-4 md:p-6 space-y-4 opacity-0 animate-fade-in",style:{animationDelay:"120ms"},children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-purple-500"}),e.jsx("h3",{className:"font-semibold text-foreground",children:m("generate.nlp.title")}),e.jsxs(W,{variant:"outline",className:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30",children:[c,"/",mc," ",m("generate.enabledOf")]})]}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs(I,{onClick:g,size:"sm",className:"bg-gradient-to-r from-emerald-600 to-green-500 hover:from-emerald-700 hover:to-green-600 text-white text-xs h-7",children:[e.jsx(pl,{className:"mr-1.5 h-3.5 w-3.5"}),"Enable All"]}),e.jsxs(I,{onClick:n,size:"sm",variant:"outline",className:"bg-muted/50 hover:bg-muted text-muted-foreground text-xs h-7",children:[e.jsx(Lo,{className:"mr-1.5 h-3.5 w-3.5"}),"Disable All"]}),p&&e.jsx(hr,{onApplyPreset:p})]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[mc," NLP optimization rules for maximum semantic relevance and featured snippet capture."]}),e.jsx(xl,{className:"h-[500px] pr-4",children:e.jsx("div",{className:"space-y-4",children:Object.entries(_l).map(([f,y])=>e.jsxs("div",{className:`rounded-lg border ${y.colorClasses.border} ${y.colorClasses.bg} p-4`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:`p-1.5 rounded-lg ${y.colorClasses.iconBg}`,children:e.jsx(y.icon,{className:`h-4 w-4 ${y.colorClasses.iconColor}`})}),e.jsx("h4",{className:"font-medium text-sm",children:y.title}),e.jsxs(W,{variant:"outline",className:"ml-auto text-xs",children:[y.rules.filter(T=>i[T.id]).length,"/",y.rules.length]})]}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:y.rules.map(T=>{const A=i[T.id]||!1;return e.jsxs("div",{className:`flex items-start gap-2.5 p-2.5 rounded-md border transition-all cursor-pointer ${A?"border-emerald-500/40 bg-emerald-500/10":"border-border/50 bg-muted/30 opacity-60"}`,onClick:()=>l(T.id),children:[e.jsx("div",{className:`p-1 rounded-md shrink-0 ${A?"bg-emerald-500/20":"bg-muted"}`,children:e.jsx(T.icon,{className:`h-3.5 w-3.5 ${A?"text-emerald-400":"text-muted-foreground"}`})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[e.jsx("span",{className:"text-xs font-medium truncate",children:T.name}),e.jsx(u,{checked:A,onCheckedChange:()=>l(T.id),onClick:h=>h.stopPropagation(),className:"scale-75"})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 line-clamp-2",children:T.description})]})]},T.id)})})]},f))})})]})}
11function il({rmTargetScore:i,setRmTargetScore:d,rmMinHeadings:p,setRmMinHeadings:m,rmHumanStyle:c,setRmHumanStyle:l,rmLsiKeywords:g,setRmLsiKeywords:n,rmPowerWords:f,setRmPowerWords:y,rmFaqCount:T,setRmFaqCount:A,rmKeywordInTitle:h,setRmKeywordInTitle:v,rmKeywordAtBeginning:b,setRmKeywordAtBeginning:k,rmKeywordInMeta:E,setRmKeywordInMeta:M,rmKeywordInUrl:j,setRmKeywordInUrl:U,rmKeywordInFirst10:L,setRmKeywordInFirst10:ce,rmKeywordInContent:w,setRmKeywordInContent:pe,rmKeywordInSubheadings:de,setRmKeywordInSubheadings:S,rmKeywordInAlt:D,setRmKeywordInAlt:B,rmMinContentLength:J,setRmMinContentLength:ue,rmShortParagraphs:Z,setRmShortParagraphs:xe,rmMaxParagraphLength:ee,setRmMaxParagraphLength:Ee,rmTableOfContents:ge,setRmTableOfContents:De,rmMediaPresence:Ce,setRmMediaPresence:Ye,rmMinImages:Pe,setRmMinImages:We,rmMinVideos:Me,setRmMinVideos:Ge,rmSearchIntent:Te,setRmSearchIntent:$e,rmTopOfPageClarity:ve,setRmTopOfPageClarity:is,rmEntityCoverage:be,setRmEntityCoverage:Qe,rmOriginalValue:_e,setRmOriginalValue:Je,rmMinExternalLinks:Ne,setRmMinExternalLinks:Xe,rmDofollowExternal:we,setRmDofollowExternal:x,rmMinInternalLinks:Ie,setRmMinInternalLinks:Ze,rmDuplicateKeywordCheck:Fe,setRmDuplicateKeywordCheck:cs,rmKeywordDensity:Re,setRmKeywordDensity:ls,rmTitleSentiment:os,setRmTitleSentiment:ps,rmNumberInTitle:es,setRmNumberInTitle:gs,rmUrlLengthCheck:Oe,setRmUrlLengthCheck:js,onApplyPreset:qe}){const ss=[h,b,E,j,L,w,de,D].filter(Boolean).length,Ke=[Z,ge,Ce].filter(Boolean).length+4,ts=[ve,be,_e].filter(Boolean).length+1,ze=[we,Fe].filter(Boolean).length+3,as=[f,es,Oe].filter(
11Boolean).length+1,ns=ss+Ke+ts+ze+as;return e.jsxs("div",{className:"rounded-xl bg-card border border-border p-4 md:p-6 space-y-4 opacity-0 animate-fade-in",style:{animationDelay:"120ms"},children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),e.jsx("h3",{className:"font-semibold text-foreground",children:"Rank Math SEO Settings"}),e.jsx(On,{youtubeId:"eErogJrG8go"})]}),e.jsxs("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-1 rounded-full",children:[ns,"/26 checks enabled"]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Optimize for Rank Math 80+ score with 26 comprehensive SEO checks."}),qe&&e.jsx(hr,{onApplyPreset:qe}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2 pb-4 border-b border-border",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Target SEO Score: ",i]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"60"}),e.jsx(H,{value:[i],onValueChange:$=>d($[0]),max:100,min:60,step:5,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"100"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Minimum Headings"}),e.jsx(Y,{type:"number",value:p,onChange:$=>m(parseInt($.target.value)||25),min:10,max:50,className:"bg-input"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["FAQ Count: ",T]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"4"}),e.jsx(H,{value:[T],onValueChange:$=>A($[0]),max:10,min:4,step:1,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"10"})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{htmlFor:"rm-human",className:"cursor-pointer",children:"Human-Like Style"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Idioms, interjections, natural flow"})]}),e.jsx(u,{id:"rm-human",checked:c,onCheckedChange:l})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{htmlFor:"rm-lsi",className:"cursor-pointer",children:"LSI Keyword Integration"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Latent semantic indexing keywords"})]}),e.jsx(u,{id:"rm-lsi",checked:g,onCheckedChange:n})]})]}),e.jsxs(Tn,{type:"multiple",defaultValue:["keyword-placement","content-quality"],className:"space-y-2",children:[e.jsxs(ne,{value:"keyword-placement",className:"border border-border rounded-lg px-4",children:[e.jsx(re,{className:"hover:no-underline",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(or,{className:"h-4 w-4 text-green-500"}),e.jsx("span",{className:"font-medium",children:"Focus Keyword Placement"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",ss,"/8)"]})]})}),e.jsx(ie,{className:"pt-4 pb-2",children:e.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyword in SEO Title"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Include focus keyword in title"})]}),e.jsx(u,{checked:h,onCheckedChange:v})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyword at Title Start"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Begin title with keyword"})]}),e.jsx(u,{checked:b,onCheckedChange:k})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyword in Meta Description"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Include in meta de
11scription"})]}),e.jsx(u,{checked:E,onCheckedChange:M})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyword in URL"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Include in page slug"})]}),e.jsx(u,{checked:j,onCheckedChange:U})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyword in First 10%"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Appear early in content"})]}),e.jsx(u,{checked:L,onCheckedChange:ce})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyword in Content"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Present in body text"})]}),e.jsx(u,{checked:w,onCheckedChange:pe})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyword in Subheadings"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Appear in H2/H3/H4"})]}),e.jsx(u,{checked:de,onCheckedChange:S})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyword in Image Alt"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use in alt attributes"})]}),e.jsx(u,{checked:D,onCheckedChange:B})]})]})})]}),e.jsxs(ne,{value:"content-quality",className:"border border-border rounded-lg px-4",children:[e.jsx(re,{className:"hover:no-underline",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-blue-500"}),e.jsx("span",{className:"font-medium",children:"Content Quality & Structure"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",Ke,"/7)"]})]})}),e.jsx(ie,{className:"pt-4 pb-2",children:e.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Min Content Length: ",J]}
11)}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"500"}),e.jsx(H,{value:[J],onValueChange:$=>ue($[0]),max:5e3,min:500,step:100,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"5000"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Max Paragraph Length: ",ee]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"100"}),e.jsx(H,{value:[ee],onValueChange:$=>Ee($[0]),max:200,min:100,step:10,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"200"})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Short Paragraphs"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Keep paragraphs readable"})]}),e.jsx(u,{checked:Z,onCheckedChange:xe})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Table of Contents"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Add TOC for long content"})]}),e.jsx(u,{checked:ge,onCheckedChange:De})]})]})})]}),e.jsxs(ne,{value:"search-intent",className:"border border-border rounded-lg px-4",children:[e.jsx(re,{className:"hover:no-underline",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(gc,{className:"h-4 w-4 text-purple-500"}),e.jsx("span",{className:"font-medium",children:"Search Intent & Clarity"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",ts,"/5)"]})]})}),e.jsx(ie,{className:"pt-4 pb-2",children:e.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Search Intent Type"}),e.jsxs(O,{value:Te,onValueChange:$e,children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{placeholder:"Select intent"})}),e.jsxs(z,{children:[e.jsx(o,{value:"informational",children:"Informational"}),e.jsx(o,{value:"commercial",children:"Commercial"}),e.jsx(o,{value:"transactional",children:"Transactional"}),e.jsx(o,{value:"local",children:"Local"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Target one clear intent"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Top-of-Page Clarity"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Answer query in first 2-4 lines"})]}),e.jsx(u,{checked:ve,onCheckedChange:is}
11)]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Entity Coverage"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Include relevant entities/concepts"})]}),e.jsx(u,{checked:be,onCheckedChange:Qe})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Original Value"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Case study, checklist, template"})]}),e.jsx(u,{checked:_e,onCheckedChange:Je})]})]})})]}),e.jsxs(ne,{value:"link-strategy",className:"border border-border rounded-lg px-4",children:[e.jsx(re,{className:"hover:no-underline",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ft,{className:"h-4 w-4 text-orange-500"}),e.jsx("span",{className:"font-medium",children:"Link Strategy"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",ze,"/5)"]})]})}),e.jsx(ie,{className:"pt-4 pb-2",children:e.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Min External Links: ",Ne]})}),e.jsx(H,{value:[Ne],onValueChange:$=>Xe($[0]),max:5,min:1,step:1,className:"flex-1"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Min Internal Links: ",Ie]})}),e.jsx(H,{value:[Ie],onValueChange:$=>Ze($[0]),max:10,min:2,step:1,className:"flex-1"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Keyword Density: ",Re,"%"]})}),e.jsx(H,{value:[Re*10],onValueChange:$=>ls($[0]/10),max:30,min:5,step:1,className:"flex-1"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"DoFollow External Link"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"At least one dofollow link"})]}),e.jsx(u,{checked:we,onCheckedChange:x})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Duplicate Keyword Check"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Warn about reused keywords"})]}),e.jsx(u,{checked:Fe,onCheckedChange:cs})]})]})})]}),e.jsxs(ne,{value:"title-optimization",className:"border border-border rounded-lg px-4",children:[e.jsx(re,{className:"hover:no-underline",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ao,{className:"h-4 w-4 text-pink-500"}),e.jsx("span",{className:"font-medium",children:"Title Optimization"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",as,"/4)"]})]})}),e.jsx(ie,{className:"pt-4 pb-2",children:e.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Title Sentiment"}),e.jsxs(O,{value:os,onValueChange:ps,children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{placeholder:"Select sentiment"})}),e.jsxs(z,{children:[e.jsx(o,{value:"neutral",children:"Neutral"}),e.jsx(o,{value:"positive",children:"Positive"}),e.jsx(o,{value:"negative",children:"Negative"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Emotional tone of title"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Power Words in Title"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Emotional trigger words"})]}),e.jsx(u,{checked:f,onCheckedChange:y})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Number in Title"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Include a number"})]}),e.jsx(u,{checked:es,onCheckedChange:gs})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"URL Length Check"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Keep URL reasonably short"})]}),e.jsx(u,{checked:Oe,onCheckedChange:js})]})]})})]})]})]})}function cl(i){const{yoastKeywordDensity:d,setYoastKeywordDensity:p,yoastTransitionPct:m,setYoastTransitionPct:c,yoastPassiveMax:l,setYoastPassiveMax:g,yoastFleschTarget:n,setYoastFleschTarget:f,yoastSubheadingCheck:y,setYoastSubheadingCheck:T,yoastSentenceCheck:A,setYoastSentenceCheck:
11h,yoastKeyphraseLength:v,setYoastKeyphraseLength:b,yoastKeyphraseInTitle:k,setYoastKeyphraseInTitle:E,yoastKeyphraseInSlug:M,setYoastKeyphraseInSlug:j,yoastKeyphraseInMeta:U,setYoastKeyphraseInMeta:L,yoastKeyphraseInIntro:ce,setYoastKeyphraseInIntro:w,yoastKeyphraseInSubheading:pe,setYoastKeyphraseInSubheading:de,yoastKeyphraseInConclusion:S,setYoastKeyphraseInConclusion:D,yoastKeyphraseDistribution:B,setYoastKeyphraseDistribution:J,yoastCheckDuplicateKeyphrase:ue,setYoastCheckDuplicateKeyphrase:Z,yoastUseSynonyms:xe,setYoastUseSynonyms:ee,yoastTitleWidth:Ee,setYoastTitleWidth:ge,yoastSingleH1:De,setYoastSingleH1:Ce,yoastMetaLength:Ye,setYoastMetaLength:Pe,yoastTitleUniqueness:We,setYoastTitleUniqueness:Me,yoastMetaUniqueness:Ge,setYoastMetaUniqueness:Te,yoastOpenGraph:$e,setYoastOpenGraph:ve,yoastSchemaType:is,setYoastSchemaType:be,yoastMinTextLength:Qe,setYoastMinTextLength:_e,yoastTextStructure:Je,setYoastTextStructure:Ne,yoastSubheadingInterval:Xe,setYoastSubheadingInterval:we,yoastMaxParagraphLength:x,setYoastMaxParagraphLength:Ie,yoastIncludeLists:Ze,setYoastIncludeLists:Fe,
11yoastCornerstone:cs,setYoastCornerstone:Re,yoastTableOfContents:ls,setYoastTableOfContents:os,yoastMaxSentenceLength:ps,setYoastMaxSentenceLength:es,yoastConsecutiveSentences:gs,setYoastConsecutiveSentences:Oe,yoastWordComplexity:js,setYoastWordComplexity:qe,yoastInclusiveLanguage:ss,setYoastInclusiveLanguage:Ke,yoastMinOutboundLinks:ts,setYoastMinOutboundLinks:ze,yoastMinInternalLinks:as,setYoastMinInternalLinks:ns,yoastInternalSuggestions:$,setYoastInternalSuggestions:fs,yoastOrphanedCheck:Cs,setYoastOrphanedCheck:F,yoastCompetingLinks:ke,setYoastCompetingLinks:qn,yoastLinkAuthorityType:Kn,setYoastLinkAuthorityType:Ue,yoastNofollowExternal:zn,setYoastNofollowExternal:pr,yoastMaxSlugLength:ys,setYoastMaxSlugLength:Ts,yoastRemoveStopWords:Is,setYoastRemoveStopWords:vs,yoastCleanSlug:Ls,setYoastCleanSlug:bs,onApplyPreset:ds}=i,Rt=[k,M,U,ce,pe,S,B,ue,xe,De,We,Ge,$e,Je,Ze,cs,ls,y,A,gs,ss,$,Cs,ke,zn,Is,Ls].filter(Boolean).length;return e.jsxs("div",{className:"rounded-xl bg-card border border-border p-4 md:p-6 space-y-4 opacity-0 animate-fade-in",style:{animationDelay:"120ms"},children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-orange-500"}),e.jsx("h3",{className:"font-semibold text-foreground",children:"Yoast SEO Settings"}),e.jsxs(W,{variant:"secondary",className:"text-xs",children:[Rt,"/30 checks"]})]}),ds&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(I,{variant:"outline",size:"sm",onClick:()=>ds("relaxed"),className:"text-xs h-7",children:[e.jsx(pc,{className:"h-3 w-3 mr-1"}),"Relaxed"]}),e.jsxs(I,{variant:"outline",size:"sm",onClick:()=>ds("recommended"),className:"text-xs h-7",children:[e.jsx(Le,{className:"h-3 w-3 mr-1"}),"Recommended"]}),e.jsxs(I,{variant:"outline",size:"sm",onClick:()=>ds("strict"),className:"text-xs h-7",children:[e.jsx(cr,{className:"h-3 w-3 mr-1"}),"Strict"]})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Comprehensive Yoast SEO optimization with 50+ checks for green-light content."}),e.jsxs(Tn,{type:"multiple",defaultValue:["keyphrase","readability"],className:"space-y-2",children:[e.jsxs(ne,{value:"keyphrase",className:"border rounded-lg px-4",children:[e.jsx(re,{className:"hover:no-underline py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(or,{className:"h-4 w-4 text-orange-500"}),e.jsx("span",{className:"font-medium",children:"Keyphrase Optimization"}),e.jsx(W,{variant:"outline",className:"text-xs ml-2",children:"11 checks"})]})}),e.jsx(ie,{className:"pb-4",children:e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Keyphrase Length: ",v," words"]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"1"}),e.jsx(H,{value:[v],onValueChange:R=>b(R[0]),max:6,min:1,step:1,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"6"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Keyword Density: ",d.toFixed(1),"%"]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"0.5%"}),e.jsx(H,{value:[d*10],onValueChange:R=>p(R[0]/10),max:30,min:5,step:1,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"3.0%"})]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyphrase in Title"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Place at beginning of SEO title"})]}),e.jsx(u,{checked:k,onCheckedChange:E})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyphrase in Slug"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Include in URL slug"})]}),e.jsx(u,{checked:M,onCheckedChange:j})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyphrase in Meta"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Include in meta de
11scription"})]}),e.jsx(u,{checked:U,onCheckedChange:L})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyphrase in Intro"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Place in first paragraph"})]}),e.jsx(u,{checked:ce,onCheckedChange:w})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyphrase in Subheading"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Include in H2/H3 headings"})]}),e.jsx(u,{checked:pe,onCheckedChange:de})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyphrase in Conclusion"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Place near end of content"})]}),e.jsx(u,{checked:S,onCheckedChange:D})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Keyphrase Distribution"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Spread naturally throughout"})]}),e.jsx(u,{checked:B,onCheckedChange:J})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Check Duplicate Keyphrase"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Avoid keyword cannibalization"})]}),e.jsx(u,{checked:ue,onCheckedChange:Z})]}),e.jsxs("div",{className:"flex items-center justify-between sm:col-span-2",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Use Synonyms & Related Terms"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Include keyphrase variations"})]}),e.jsx(u,{checked:xe,onCheckedChange:ee})]})]})]})})]}),e.jsxs(ne,{value:"title-meta",className:"border rounded-lg px-4",children:[e.jsx(re,{className:"hover:no-underline py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-blue-500"}),e.jsx("span",{className:"font-medium",children:"Title & Meta"}),e.jsx(W,{variant:"outline",className:"text-xs ml-2",children:"7 checks"})]})}),e.jsx(ie,{className:"pb-4",children:e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["SEO Title Width: ",Ee," chars"]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"40"}),e.jsx(H,{value:[Ee],onValueChange:R=>ge(R[0]),max:70,min:40,step:5,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"70"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Meta Description Length: ",Ye," chars"]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"120"}),e.jsx(H,{value:[Ye],onValueChange:R=>Pe(R[0]),max:165,min:120,step:5,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"165"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Schema Type"}),e.jsxs(O,{value:is,onValueChange:be,children:[e.jsx(q,{children:e.jsx(K,{placeholder:"Select schema type"})}),e.jsxs(z,{children:[e.jsx(o,{value:"Article",children:"Article"}),e.jsx(o,{value:"BlogPosting",children:"Blog Post"}),e.jsx(o,{value:"NewsArticle",children:"News Article"}),e.jsx(o,{value:"HowTo",children:"How-To Guide"}),e.jsx(o,{value:"FAQ",children:"FAQ"}),e.jsx(o,{value:"Product",children:"Product"}),e.jsx(o,{value:"Review",children:"Review"})]})]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Single H1 Title"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Only one H1 per page"})]}),e.jsx(u,{checked:De,onCheckedChange:Ce})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Title Uniqueness"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Distinct SEO title"})]}),e.jsx(u,{checked:We,onCheckedChange:Me})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Meta Uniqueness"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Unique meta description"})]}),e.jsx(u,{checked:Ge,onCheckedChange:Te})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Open Graph Tags"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Social sharing metadata"})]}),e.jsx(u,{checked:$e,onCheckedChange:ve})]})]})]})})]}),e.jsxs(ne,{value:"content-structure",className:"border rounded-lg px-4",children:[e.jsx(re,{className:"hover:no-underline py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(oo,{className:"h-4 w-4 text-green-500"}),e.jsx("span",{className:"font-medium",children:"Content Structure"}),e.jsx(W,{variant:"outline",className:"text-xs ml-2",children:"7 checks"})]})}),e.jsx(ie,{className:"pb-4",children:e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Minimum Text Length: ",Qe," words"]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"300"}),e.jsx(H,{value:[Qe],onValueChange:R=>_e(R[0]),max:3e3,min:300,step:100,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"3000"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Subheading Every: ",Xe," words"]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"150"}),e.jsx(H,{value:[Xe],onValueChange:R=>we(R[0]),max:500,min:150,step:50,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"500"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Max Paragraph Length: ",x," words"]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"75"}),e.jsx(H,{value:[x],onValueChange:R=>Ie(R[0]),max:200,min:75,step:25,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"200"})]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Text Structure Check"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Verify headings & paragraphs"})]}),e.jsx(u,{checked:Je,onCheckedChange:Ne})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Include Lists"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use bullet/numbered lists"})]}),e.jsx(u,{checked:Ze,onCheckedChange:Fe})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Cornerstone Content"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Apply stricter checks"})]}),e.jsx(u,{checked:cs,onCheckedChange:Re})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Table of Contents"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Generate TOC for navigation"})]}),e.jsx(u,{checked:ls,onCheckedChange:os})]})]})]})})]}),e.jsxs(ne,{value:"readability",className:"border rounded-lg px-4",children:[e.jsx(re,{className:"hover:no-underline py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(lr,{className:"h-4 w-4 text-purple-500"}),e.jsx("span",{className:"font-medium",children:"Readability"}),e.jsx(W,{variant:"outline",className:"text-xs ml-2",children:"8 checks"})]})}),e.jsx(ie,{className:"pb-4",children:e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Max Sentence Length: ",ps," words"]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"15"}),e.jsx(H,{value:[ps],onValueChange:R=>es(R[0]),max:30,min:15,step:1,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"30"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Flesch Reading Ease: ",n]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"50"}),e.jsx(H,{value:[n],onValueChange:R=>f(R[0]),max:80,min:50,step:5,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"80"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Transition Words: ",m,"%"]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"20%"}),e.jsx(H,{value:[m],onValueChange:R=>c(R[0]),max:50,min:20,step:5,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"50%"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Max Passive Voice: ",l,"%"]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"5%"}),e.jsx(H,{value:[l],onValueChange:R=>g(R[0]),max:20,min:5,step:1,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"20%"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Word Complexity"}),e.jsxs(O,{value:js,onValueChange:qe,children:[e.jsx(q,{children:e.jsx(K,{placeholder:"Select complexity level"})}),e.jsxs(z,{children:[e.jsx(o,{value:"simple",children:"Simple (6th grade)"}),e.jsx(o,{value:"medium",children:"Medium (8th grade)"}),e.jsx(o,{value:"advanced",children:"Advanced (College)"})]})]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Subheading Distribution"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Check after 300 words"})]}),e.jsx(u,{checked:y,onCheckedChange:T})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Sentence Length Check"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Keep sentences readable"})]}),e.jsx(u,{checked:A,onCheckedChange:h})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Consecutive Sentences"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Vary sentence starters"})]}),e.jsx(u,{checked:gs,onCheckedChange:Oe})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Inclusive Language"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use bias-free wording"})]}),e.jsx(u,{checked:ss,onCheckedChange:Ke})]})]})]})})]}),e.jsxs(ne,{value:"links",className:"border rounded-lg px-4",children:[e.jsx(re,{className:"hover:no-underline py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ft,{className:"h-4 w-4 text-cyan-500"}),e.jsx("span",{className:"font-medium",children:"Links & References"}),e.jsx(W,{variant:"outline",className:"text-xs ml-2",children:"7 checks"})]})}),e.jsx(ie,{className:"pb-4",children:e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Min Outbound Links: ",ts]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"0"}),e.jsx(H,{value:[ts],onValueChange:R=>ze(R[0]),max:10,min:0,step:1,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"10"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Min Internal Links: ",as]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"0"}),e.jsx(H,{value:[as],onValueChange:R=>ns(R[0]),max:15,min:0,step:1,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"15"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Link Authority Type"}),e.jsxs(O,{value:Kn,onValueChange:Ue,children:[e.jsx(q,{children:e.jsx(K,{placeholder:"Select link type"})}),e.jsxs(z,{children:[e.jsx(o,{value:"authority",children:"Authority Sites (.edu, .gov)"}),e.jsx(o,{value:"educational",children:"Educational Resources"}),e.jsx(o,{value:"industry",children:"Industry Leaders"}),e.jsx(o,{value:"mixed",children:"Mixed Sources"})]})]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Internal Link Suggestions"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"AI suggests related pages"})]}),e.jsx(u,{checked:$,onCheckedChange:fs})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Orphaned Content Check"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Flag pages with no links"})]}),e.jsx(u,{checked:Cs,onCheckedChange:F})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Competing Links Check"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Avoid anchor conflicts"})]}),e.jsx(u,{checked:ke,onCheckedChange:qn})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Nofollow External Links"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'Add rel="nofollow"'})]}),e.jsx(u,{checked:zn,onCheckedChange:pr})]})]})]})})]}),e.jsxs(ne,{value:"url-slug",className:"border rounded-lg px-4",children:[e.jsx(re,{className:"hover:no-underline py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(mr,{className:"h-4 w-4 text-amber-500"}),e.jsx("span",{className:"font-medium",children:"URL & Slug"}),e.jsx(W,{variant:"outline",className:"text-xs ml-2",children:"3 checks"})]})}),e.jsx(ie,{className:"pb-4",children:e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:["Max Slug Length: ",ys," words"]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"2"}),e.jsx(H,{value:[ys],onValueChange:R=>
11Ts(R[0]),max:10,min:2,step:1,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"10"})]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Remove Stop Words"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'Exclude "and", "the", etc.'})]}),e.jsx(u,{checked:Is,onCheckedChange:vs})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"cursor-pointer",children:"Clean Slug"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"No special characters"})]}),e.jsx(u,{checked:Ls,onCheckedChange:bs})]})]})]})})]})]})]})}function ll({eeatOutlineTable:i,setEeatOutlineTable:d,eeatFaqCount:p,setEeatFaqCount:m,eeatCitations:c,setEeatCitations:l,eeatExpertQuotes:g,setEeatExpertQuotes:n,eeatStatistics:f,setEeatStatistics:y,eeatExperience:T,setEeatExperience:A,eeatExternalLinks:h,setEeatExternalLinks:v,onApplyPreset:b}){const{t:k}
11=Ae(),E=[i,c,g,f,T].filter(Boolean).length;return e.jsxs("div",{className:"rounded-xl bg-card border border-border p-4 md:p-6 space-y-4 opacity-0 animate-fade-in",style:{animationDelay:"120ms"},children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-blue-500"}),e.jsx("h3",{className:"font-semibold text-foreground",children:k("generate.eeat.title")}),e.jsxs("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:[E,"/5 ",k("generate.enabledOf")]})]}),b&&e.jsx(hr,{onApplyPreset:b})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:k("generate.eeat.description")}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:[k("generate.eeat.faqCount"),": ",p]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"4"}),e.jsx(H,{value:[p],onValueChange:M=>m(M[0]),max:12,min:4,step:1,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"12"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:[k("generate.eeat.externalLinks"),": ",h]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"0"}),e.jsx(H,{value:[h],onValueChange:M=>v(M[0]),max:8,min:0,step:1,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"8"})]})]})]}),e.jsxs("div",{className:"grid gap-3 md:gap-4 grid-cols-1 sm:grid-cols-2 pt-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{htmlFor:"eeat-outline",className:"cursor-pointer",children:k("generate.eeat.outlineTable")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:k("generate.eeat.outlineTableDesc")})]}),e.jsx(u,{id:"eeat-outline",checked:i,onCheckedChange:d})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{htmlFor:"eeat-citations",className:"cursor-pointer",children:k("generate.eeat.citations")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:k("generate.eeat.citationsDesc")})]}),e.jsx(u,{id:"eeat-citations",checked:c,onCheckedChange:l})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{htmlFor:"eeat-quotes",className:"cursor-pointer",children:k("generate.eeat.expertQuotes")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:k("generate.eeat.expertQuotesDesc")})]}),e.jsx(u,{id:"eeat-quotes",checked:g,onCheckedChange:n})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{htmlFor:"eeat-stats",className:"cursor-pointer",children:k("generate.eeat.statistics")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:k("generate.eeat.statisticsDesc")})]}),e.jsx(u,{id:"eeat-stats",checked:f,onCheckedChange:y})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{htmlFor:"eeat-exp",className:"cursor-pointer",children:k("generate.eeat.experience")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:k("generate.eeat.experienceDesc")})]}),e.jsx(u,{id:"eeat-exp",checked:T,onCheckedChange:A})]})]})]})}const rd=["Auto Detect","Definition","How-to","List","Comparison","Yes or No","Recommendation","Troubleshooting","Calculation","Local Answer"],id=["Short paragraph","Numbered steps","Bulleted list","Comparison table","Definition box","Pros and cons","Requirements checklist","Quick facts","Examples"],cd=["What","Why","How","When","Where","Who","Can","Should","Cost","Comparison","Problems"],Nl={answerType:"Auto Detect",summaryLength:"standard",relatedQuestions:8,questionSource:"auto",questionTypes:["What","Why","How"],answerFormats:[],voiceFriendly:!0,sourcePolicy:"auto",minSources:3,freshnessWindow:"any",inlineCitations:!0,sourceList:!0};function ld({value:i,onChange:d}){const[p,m]=a.useState(i??Nl),c=i??p,l=n=>{const f={...c,...n};m(f),d==null||d(f)},g=(n,f)=>{const y=c[n];l({[n]:y.includes(f)?y.filter(T=>T!==f):[...y,f]})};return e.jsxs("div",{className:"rounded-xl bg-card border border-border p-4 md:p-6 space-y-6 o
11pacity-0 animate-fade-in",style:{animationDelay:"120ms"},children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-emerald-500"}),e.jsx("h3",{className:"font-semibold text-foreground",children:"AEO Settings"}),e.jsx(W,{variant:"outline",className:"text-xs bg-emerald-500/10 text-emerald-600 border-emerald-500/30",children:"New"})]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Internal content-quality controls — not a ranking guarantee."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"A. Answer Target"}),e.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Primary Answer Type"}),e.jsxs(O,{value:c.answerType,onValueChange:n=>l({answerType:n}),children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsx(z,{children:rd.map(n=>e.jsx(o,{value:n,children:n},n))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Auto detects intent per topic / CSV row."})]})})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsxs("h4",{className:"text-sm font-semibold",children:["B. Direct Answer Summary ",e.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:"(locked on)"})]}),e.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Summary Length"}),e.jsxs(O,{value:c.summaryLength,onValueChange:n=>l({summaryLength:n}),children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"short",children:"Short (30–50 words)"}),e.jsx(o,{value:"standard",children:"Standard (50–80 words)"}),e.jsx(o,{value:"detailed",children:"Detailed (80–120 words)"}),e.jsx(o,{value:"auto",children:"Auto"})]})]})]})})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"C. Related Question Coverage"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(r,{children:["Related Questions: ",c.relatedQuestions]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"3"}),e.jsx(H,{value:[c.relatedQuestions],onValueChange:n=>l({relatedQuestions:n[0]}),min:3,max:15,step:1,className:"flex-1"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"15"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Source"}),e.jsxs(O,{value:c.questionSource,onValueChange:n=>l({questionSource:n}),children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"auto",children:"Auto-discover"}),e.jsx(o,{value:"supplied",children:"Supplied only"}),e.jsx(o,{value:"combined",children:"Combined"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Question Types"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:cd.map(n=>e.jsxs("label",{className:`px-2.5 py-1 rounded-full border text-xs cursor-pointer transition ${c.questionTypes.includes(n)?"bg-primary/10 border-primary text-primary":"border-border text-muted-foreground hover:border-primary/50"}`,children:[e.jsx("input",{type:"checkbox",className:"hidden",checked:c.questionTypes.includes(n),onChange:()=>g("questionTypes",n)}),n]},n))})]})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"D. Answer Formats"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Leave empty for Auto — the model picks formats based on detected intent."}),e.jsx("div",{className:"grid gap-2 grid-cols-1 sm:grid-cols-2",children:id.map(n=>e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[e.jsx(jc,{checked:c.answerFormats.includes(n),onCheckedChange:()=>g("answerFormats",n)}),n]},n))})]}),e.jsxs("section",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(r,{className:"text-sm font-semibold",children:"E. Voice-Friendly Answers"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Complete sentences, expanded abbreviations, units with numbers, short direct-answer sentences. Speakable schema is not implied."})]}),e.jsx(u,{checked:c.voiceFriendly,onCheckedChange:n=>l({voiceFriendly:n})})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"F. AEO Source Support"}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Source Policy"}),e.jsxs(O,{value:c.sourcePolicy,onValueChange:n=>l({sourcePolicy:n}),children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"auto",children:"Auto"}),e.jsx(o,{value:"none",children:"No external research"}),e.jsx(o,{value:"primary",children:"Primary sources only"}),e.jsx(o,{value:"primary-secondary",children:"Primary + trusted secondary"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(r,{children:["Minimum Sources: ",c.minSources]}),e.jsx(H,{value:[c.minSources],onValueChange:n=>l({minSources:n[0]}),min:0,max:8,step:1})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Source Freshness"}),e.jsxs(O,{value:c.freshnessWindow,onValueChange:n=>l({freshnessWindow:n}),children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"any",children:"Any time"}),e.jsx(o,{value:"12m",children:"Last 12 months"}),e.jsx(o,{value:"24m",children:"Last 24 months"})]})]})]})]}),e.jsxs("div",{className:"grid gap-2 grid-cols-1 sm:grid-cols-2 pt-2",children:[e.jsxs("label",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{children:"Inline citations"}),e.jsx(u,{checked:c.inlineCitations,onCheckedChange:n=>l({inlineCitations:n})})]}),e.jsxs("label",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{children:"Add source list"}),e.jsx(u,{checked:c.sourceList,onCheckedChange:n=>l({sourceList:n})})]})]})]}),e.jsxs("section",{className:"rounded-lg bg-muted/40 border border-border p-3 text-xs text-muted-foreground space-y-1",children:[e.jsx("p",{className:"font-semibold text-foreground",children:"G. AEO Structure (locked defaults)"}),e.jsx("p",{children:"Direct answer under H1 · H2 headings · Related Questions · Bold · Italic removed · Conclusion & Key Summary off · No introduction section."})]})]})}const od=["All AI search surfaces","Google AI Overviews & AI Mode","ChatGPT Search","Microsoft Copilot","Perplexity","Gemini","DeepSeek"],dd=["Answer summary","Definition","Evidence-backed explanation","Comparison table","Original example","Statistics","Expert quotation","Process steps","Limitations","Alternatives","Source list","Update date"],wl={aiSurfaces:["All AI search surfaces"],fanoutDepth:"balanced",primarySourcesOnly:!0,minCitedSources:5,statisticsMode:"auto",expertQuotesMo
11de:"auto",firstPartyRecommended:!0,examplesOn:!0,freshnessWindow:"any",removeUnsupported:!0,contentElements:[],brandMentionPolicy:"neutral",brandName:"",productDetails:"",authorInfo:"",originalResearch:"",internalStats:"",caseStudies:"",firstHandExperience:"",forbiddenClaims:"",supportingUrls:"",publicationDate:"",primaryEntity:"",entityType:"",alternateNames:"",entityWebsite:"",entityLocation:"",relatedEntities:""};function ud({value:i,onChange:d}){const[p,m]=a.useState(i??wl),c=i??p,l=n=>{const f={...c,...n};m(f),d==null||d(f)},g=(n,f)=>{const y=c[n];l({[n]:y.includes(f)?y.filter(T=>T!==f):[...y,f]})};return e.jsxs("div",{className:"rounded-xl bg-card border border-border p-4 md:p-6 space-y-6 opacity-0 animate-fade-in",style:{animationDelay:"120ms"},children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-purple-500"}),e.jsx("h3",{className:"font-semibold text-foreground",children:"GEO Settings"}),e.jsx(W,{variant:"outline",className:"text-xs bg-purple-500/10 text-purple-600 border-purple-500/30",children:"New"})]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Content-preparation for AI search — not a citation guarantee."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"A. Target AI Surfaces"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:od.map(n=>e.jsxs("label",{className:`px-2.5 py-1 rounded-full border text-xs cursor-pointer transition ${c.aiSurfaces.includes(n)?"bg-primary/10 border-primary text-primary":"border-border text-muted-foreground hover:border-primary/50"}`,children:[e.jsx("input",{type:"checkbox",className:"hidden",checked:c.aiSurfaces.includes(n),onChange:()=>g("aiSurfaces",n)}),n]},n))})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"B. Query Fan-Out Depth"}),e.jsxs(O,{value:c.fanoutDepth,onValueChange:n=>l({fanoutDepth:n}),children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"focused",children:"Focused"}),e.jsx(o,{value:"balanced",children:"Balanced"}),e.jsx(o,{value:"broad",children:"Broad"})]})]})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"C. Evidence & Sources"}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(r,{children:["Minimum Cited Sources: ",c.minCitedSources]}),e.jsx(H,{value:[c.minCitedSources],onValueChange:n=>l({minCitedSources:n[0]}),min:3,max:12,step:1})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Source Freshness"}),e.jsxs(O,{value:c.freshnessWindow,onValueChange:n=>l({freshnessWindow:n}),children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"any",children:"Any time"}),e.jsx(o,{value:"12m",children:"Last 12 months"}),e.jsx(o,{value:"24m",children:"Last 24 months"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Statistics & Data"}),e.jsxs(O,{value:c.statisticsMode,onValueChange:n=>l({statisticsMode:n}),children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"auto",children:"Auto"}),e.jsx(o,{value:"on",children:"Always include"}),e.jsx(o,{value:"off",children:"Skip"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Expert Quotations"}),e.jsxs(O,{value:c.expertQuotesMode,onValueChange:n=>l({expertQuotesMode:n}),children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"auto",children:"Auto"}),e.jsx(o,{value:"on",children:"Always include"}),e.jsx(o,{value:"off",children:"Skip"})]})]})]})]}),e.jsxs("div",{className:"grid gap-2 grid-cols-1 sm:grid-cols-2 pt-2",children:[e.jsxs("label",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{children:"Primary sources only"}),e.jsx(u,{checked:c.primarySourcesOnly,onCheckedChange:n=>l({primarySourcesOnly:n})})]}),e.jsxs("label",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{children:"First-party evidence recommended"}),e.jsx(u,{checked:c.firstPartyRecommended,onCheckedChange:n=>l({firstPartyRecommended:n})})]}),e.jsxs("label",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{children:"Examples & case studies"}),e.jsx(u,{checked:c.examplesOn,onCheckedChange:n=>l({examplesOn:n})})]}),e.jsxs("label",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{children:"Remove unsupported claims"}),e.jsx(u,{checked:c.removeUnsupported,onCheckedChange:n=>l({removeUnsupported:n})})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Research citations, date/number verification, and contradiction check are locked on for GEO."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"D. First-Party Knowledge"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The generator will never invent first-hand experience, statistics, customers or quotations."}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r,{children:"Brand / Company Name"}),e.jsx(Y,{value:c.brandName,onChange:n=>l({brandName:n.target.value}),className:"bg-input"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r,{children:"Author / Expert Info"}),e.jsx(Y,{value:c.authorInfo,onChange:n=>l({authorInfo:n.target.value}),className:"bg-input"})]}),e.jsxs("div",{className:"space-y-1.5 md:col-span-2",children:[e.jsx(r,{children:"Product Details"}),e.jsx(ye,{rows:2,value:c.productDetails,onChange:n=>l({productDetails:n.target.value}),className:"bg-input"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r,{children:"Original Research"}),e.jsx(ye,{rows:2,value:c.originalResearch,onChange:n=>l({originalResearch:n.target.value}),className:"bg-input"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r,{children:"Internal Statistics"}),e.jsx(ye,{rows:2,value:c.internalStats,onChange:n=>l({internalStats:n.target.value}),className:"bg-input"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r,{children:"Case Studies"}),e.jsx(ye,{rows:2,value:c.caseStudies,onChange:n=>l({caseStudies:n.target.value}),className:"bg-input"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r,{children:"First-Hand Experience"}),e.jsx(ye,{rows:2,value:c.firstHandExperience,onChange:n=>l({firstHandExperience:n.target.value}),className:"bg-input"})]}),e.jsxs("div",{className:"space-y-1.5 md:col-span-2",children:[e.jsx(r,{children:"Claims that must NOT be made"}),e.jsx(ye,{rows:2,value:c.forbiddenClaims,onChange:n=>l({forbiddenClaims:n.target.value}),className:"bg-input"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r,{children:"Supporting Document URLs"}),e.jsx(ye,{rows:2,value:c.supportingUrls,onChange:n=>l({supportingUrls:n.target.value}),className:"bg-input",placeholder:"One URL per line"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r,{children:"Publication / Update Date"}),e.jsx(Y,{type:"date",value:c.publicationDate,onChange:n=>l({publicationDate:n.target.value}),className:"bg-input"})]})]})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"E. Entity Information"}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r,{children:"Primary Entity"}),e.jsx(Y,{value:c.primaryEntity,onChange:n=>l({primaryEntity:n.target.value}),className:"bg-input"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r,{children:"Entity Type"}
11),e.jsx(Y,{value:c.entityType,onChange:n=>l({entityType:n.target.value}),className:"bg-input",placeholder:"Organization, Product, Person…"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r,{children:"Alternate Names"}),e.jsx(Y,{value:c.alternateNames,onChange:n=>l({alternateNames:n.target.value}),className:"bg-input"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r,{children:"Website"}),e.jsx(Y,{value:c.entityWebsite,onChange:n=>l({entityWebsite:n.target.value}),className:"bg-input"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r,{children:"Location"}),e.jsx(Y,{value:c.entityLocation,onChange:n=>l({entityLocation:n.target.value}),className:"bg-input"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r,{children:"Related Entities"}),e.jsx(Y,{value:c.relatedEntities,onChange:n=>l({relatedEntities:n.target.value}),className:"bg-input"})]})]})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"F. GEO Content Elements"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Leave empty for Auto — the model selects relevant elements."}),e.jsx("div",{className:"grid gap-2 grid-cols-1 sm:grid-cols-2",children:dd.map(n=>e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[e.jsx(jc,{checked:c.contentElements.includes(n),onCheckedChange:()=>g("contentElements",n)}),n]},n))})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"G. Brand Mention Policy"}),e.jsxs(O,{value:c.brandMentionPolicy,onValueChange:n=>l({brandMentionPolicy:n}),children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"neutral",children:"Neutral educational content"}),e.jsx(o,{value:"mention",children:"Mention brand where relevant"}),e.jsx(o,{value:"brand-led",children:"Brand-led content"}),e.jsx(o,{value:"comparison",children:"Product comparison"}),e.jsx(o,{value:"none",children:"Do not mention brand"})]})]})]})]})}function md({hcuStyleMode:i,setHcuStyleMode:d,hcuFaqCount:p,setHcuFaqCount:m,hcuWhoThisIsFor:c,setHcuWhoThisIsFor:l,hcuMistakesToAvoid:g,setHcuMistakesToAvoid:n,hcuComparisonTables:f,setHcuComparisonTables:y,hcuChecklists:T,setHcuChecklists:A,hcuAnswerFirst:h,setHcuAnswerFirst:v,hcuSentenceVariation:b,setHcuSentenceVariation:k,hcuLexicalDiversity:E,setHcuLexicalDiversity:M,hcuAvoidCliches:j,setHcuAvoidCliches:U,hcuIdiomatic:L,setHcuIdiomatic:ce,hcuEmotionalVariance:w,setHcuEmotionalVariance:pe,hcuMetaphorOriginality:de,setHcuMetaphorOriginality:S,hcuRequireCitations:D,setHcuRequireCitations:B,hcuStatisticalValidation:J,setHcuStatisticalValidation:ue,hcuSourceQuality:Z,setHcuSourceQuality:xe,hcuNoKeywordStuffing:ee,setHcuNoKeywordStuffing:Ee,hcuNoThinContent:ge,setHcuNoThinContent:De,hcuNoFakeExperts:Ce,setHcuNoFakeExperts:Ye,hcuNoExcessiveCTA:Pe,setHcuNoExcessiveCTA:We,hcuNoAutoFAQ:Me,setHcuNoAutoFAQ:Ge,hcuSchemaGrounding:Te,setHcuSchemaGrounding:$e,hcuStructuredFAQ:ve,setHcuStructuredFAQ:is,hcuSemanticHTML:be,setHcuSemanticHTML:Qe,hcuSpeakableSchema:_e,setHcuSpeakableSchema:Je,hcuLLMUtility:Ne,setHcuLLMUtility:Xe,onApplyPreset:we}){const{t:x}=Ae(),Ie=[c,g,f,T,h].filter(Boolean).length,Ze=[b,E,j,L,w,de].filter(Boolean).length,Fe=[D,J,Z].filter(Boolean).length,cs=[ee,ge,Ce,Pe,Me].filter(Boolean).length,Re=[Te,ve,be,_e,Ne].filter(Boolean).length;return e.jsxs("div",{className:"rounded-xl bg-card border border-border p-4 md:p-6 space-y-6 opacity-0 animate-fade-in",style:{animationDelay:"120ms"},children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-amber-500"}),e.jsx("h3",{className:"font-semibold text-foreground",children:x("generate.hcu.title")}),e.jsx(W,{variant:"outline",className:"text-[10px] border-amber-500/30 text-amber-600",children:x("generate.hcu.contentCertification")}),e.jsx(On,{youtubeId:"OGtf7XfueDI"})]}),we&&e.jsx(hr,{onApplyPreset:we})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:x("generate.hcu.description")}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h4",{className:"text-sm font-medium text-foreground",children:x("generate.hcu.contentQuality")}),e.jsxs("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:[Ie,"/5"]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:x("generate.hcu.styleMode")}),e.jsxs(O,{value:i,onValueChange:d,children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"simple",children:x("generate.hcu.simple")}),e.jsx(o,{value:"technical",children:x("generate.hcu.technical")}),e.jsx(o,{value:"conversational",children:x("generate.hcu.conversational")}),e.jsx(o,{value:"mixed",children:x("generate.hcu.mixed")})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(r,{children:[x("generate.hcu.minFaqCount"),": ",p]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"3"}),e.jsx(H,{value:[p],onValueChange:ls=>m(ls[0]),min:3,max:8,step:1,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"8"})]})]})]}),e.jsxs("div",{className:"grid gap-3 grid-cols-1 sm:grid-cols-2 pt-1",children:[e.jsx(G,{id:"hcu-who",label:x("generate.hcu.whoThisIsFor"),desc:x("generate.hcu.whoThisIsForDesc"),checked:c,onChange:l}),e.jsx(G,{id:"hcu-mistakes",label:x("generate.hcu.mistakesToAvoid"),desc:x("generate.hcu.mistakesToAvoidDesc"),checked:g,onChange:n}),e.jsx(G,{id:"hcu-tables",label:x("generate.hcu.comparisonTables"),desc:x("generate.hcu.comparisonTablesDesc"),checked:f,onChange:y}),e.jsx(G,{id:"hcu-checklists",label:x("generate.hcu.checklists"),desc:x("generate.hcu.checklistsDesc"),checked:T,onChange:A}),e.jsx(G,{id:"hcu-answer",label:x("generate.hcu.answerFirst"),desc:x("generate.hcu.answerFirstDesc"),checked:h,onChange:v})]})]}),e.jsxs("div",{className:"space-y-3 border-t border-border pt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h4",{className:"text-sm font-medium text-foreground",children:x("generate.hcu.aiSignatureReduction")}),e.jsxs("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:[Ze,"/6"]})]}),e.jsxs("div",{className:"grid gap-3 grid-cols-1 sm:grid-cols-2",children:[e.jsx(G,{id:"hcu-sentence",label:x("generate.hcu.sentenceVariation"),desc:x("generate.hcu.sentenceVariationDesc"),checked:b,onChange:k}),e.jsx(G,{id:"hcu-lexical",label:x("generate.hcu.lexicalDiversity"),desc:x("generate.hcu.lexicalDiversityDesc"),checked:E,onChange:M}),e.jsx(G,{id:"hcu-cliches",label:x("generate.hcu.avoidCliches"),desc:x("generate.hcu.avoidClichesDesc"),checked:j,onChange:U}),e.jsx(G,{id:"hcu-idioms",label:x("generate.hcu.idiomatic"),desc:x("generate.hcu.idiomaticDesc"),checked:L,onChange:ce}),e.jsx(G,{id:"hcu-emotion",label:x("generate.hcu.emotionalVariance"),desc:x("generate.hcu.emotionalVarianceDesc"),checked:w,onChange:pe}),e.jsx(G,{id:"hcu-metaphor",label:x("generate.hcu.metaphorOriginality"),desc:x("generate.hcu.metaphorOriginalityDesc"),checked:de,onCh
11ange:S})]})]}),e.jsxs("div",{className:"space-y-3 border-t border-border pt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h4",{className:"text-sm font-medium text-foreground",children:x("generate.hcu.factSafety")}),e.jsxs("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:[Fe,"/3"]})]}),e.jsxs("div",{className:"grid gap-3 grid-cols-1 sm:grid-cols-2",children:[e.jsx(G,{id:"hcu-cite",label:x("generate.hcu.requireCitations"),desc:x("generate.hcu.requireCitationsDesc"),checked:D,onChange:B}),e.jsx(G,{id:"hcu-stats",label:x("generate.hcu.statisticalValidation"),desc:x("generate.hcu.statisticalValidationDesc"),checked:J,onChange:ue}),e.jsx(G,{id:"hcu-source",label:x("generate.hcu.sourceQuality"),desc:x("generate.hcu.sourceQualityDesc"),checked:Z,onChange:xe})]})]}),e.jsxs("div",{className:"space-y-3 border-t border-border pt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h4",{className:"text-sm font-medium text-foreground",children:x("generate.hcu.hardVetoRules")}),e.jsxs("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:[cs,"/5"]})]}),e.jsxs("div",{className:"grid gap-3 grid-cols-1 sm:grid-cols-2",children:[e.jsx(G,{id:"hcu-stuff",label:x("generate.hcu.noKeywordStuffing"),desc:x("generate.hcu.noKeywordStuffingDesc"),checked:ee,onChange:Ee}),e.jsx(G,{id:"hcu-thin",label:x("generate.hcu.noThinContent"),desc:x("generate.hcu.noThinContentDesc"),checked:ge,onChange:De}),e.jsx(G,{id:"hcu-fake",label:x("generate.hcu.noFakeExperts"),desc:x("generate.hcu.noFakeExpertsDesc"),checked:Ce,onChange:Ye}),e.jsx(G,{id:"hcu-cta",label:x("generate.hcu.noExcessiveCTA"),desc:x("generate.hcu.noExcessiveCTADesc"),checked:Pe,onChange:We}),e.jsx(G,{id:"hcu-autofaq",label:x("generate.hcu.noAutoFAQ"),desc:x("generate.hcu.noAutoFAQDesc"),checked:Me,onChange:Ge})]})]}),e.jsxs("div",{className:"space-y-3 border-t border-border pt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h4",{className:"text-sm font-medium text-foreground",children:x("generate.hcu.aiDiscoveryReadiness")}),e.jsxs("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:[Re,"/5"]})]}),e.jsxs("div",{className:"grid gap-3 grid-cols-1 sm:grid-cols-2",children:[e.jsx(G,{id:"hcu-schema",label:x("generate.hcu.schemaGrounding"),desc:x("generate.hcu.schemaGroundingDesc"),checked:Te,onChange:$e}),e.jsx(G,{id:"hcu-faqschema",label:x("generate.hcu.structuredFAQ"),desc:x("generate.hcu.structuredFAQDesc"),checked:ve,onChange:is}
11),e.jsx(G,{id:"hcu-html",label:x("generate.hcu.semanticHTML"),desc:x("generate.hcu.semanticHTMLDesc"),checked:be,onChange:Qe}),e.jsx(G,{id:"hcu-speak",label:x("generate.hcu.speakableSchema"),desc:x("generate.hcu.speakableSchemaDesc"),checked:_e,onChange:Je}),e.jsx(G,{id:"hcu-llm",label:x("generate.hcu.llmUtility"),desc:x("generate.hcu.llmUtilityDesc"),checked:Ne,onChange:Xe})]})]})]})}function G({id:i,label:d,desc:p,checked:m,onChange:c}){return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{htmlFor:i,className:"cursor-pointer",children:d}),e.jsx("p",{className:"text-xs text-muted-foreground",children:p})]}),e.jsx(u,{id:i,checked:m,onCheckedChange:c})]})}const ol={"rank-math":"Rank Math",yoast:"Yoast SEO","nlp-semantic":"NLP Semantic","full-seo-faqs":"Fully SEO (E-E-A-T)","hybrid-max":"Hybrid Max","hcu-optimized":"HCU Optimized",custom:"Custom Mode"};function hd({open:i,onOpenChange:d,onSave:p,seoMode:m,isPending:c}){const[l,g]=a.useState(""),[n,f]=a.useState(!1),y=async()=>{l.trim()&&(await p(l.trim(),n),g(""),f(!1),d(!1))};return e.jsx(yc,{open:i,onOpenChange:d,children:e.jsxs(vc,{className:"sm:max-w-md",children:[e.jsxs(bc,{children:[e.jsx(_c,{children:"Save SEO Template"}),e.jsxs(jl,{children:["Save your current ",ol[m]||m," settings ",e.jsx("strong",{children:"and brand voice"})," as a reusable template. Applying this template later will restore both."]})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"template-name",children:"Template Name"}),e.jsx(Y,{id:"template-name",placeholder:"e.g., Blog Posts, Product Reviews...",value:l,onChange:T=>g(T.target.value),onKeyDown:T=>T.key==="Enter"&&y(),autoFocus:!0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(r,{htmlFor:"set-default",children:"Set as default"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Auto-load when selecting ",ol[m]||m]})]}),e.jsx(u,{id:"set-default",checked:n,onCheckedChange:f})]})]}),e.jsxs(fl,{children:[e.jsx(I,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),e.jsxs(I,{onClick:y,disabled:!l.trim()||c,children:[c?e.jsx(He,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(dr,{className:"mr-2 h-4 w-4"}),"Save Template"]})]})]})})}const xd={"rank-math":"Rank Math",yoast:"Yoast SEO","nlp-semantic":"NLP Semantic","full-seo-faqs":"Fully SEO (E-E-A-T)","hybrid-max":"Hybrid Max","hcu-optimized":"HCU Optimized",custom:"Custom Mode"};function pd(){var A;const{t:i}=Ae(),{templates:d,isLoading:p,deleteTemplate:m}=fc(),[c,l]=a.useState(null),[g,n]=a.useState(!1),f=(A=d==null?void 0:d.find(h=>h.id===c))==null?void 0:A.name,y=(d||[]).reduce((h,v)=>{const b=v.seo_mode||"unknown";return h[b]||(h[b]=[]),h[b].push(v),h},{}),T=async()=>{c&&(await m.mutateAsync(c),l(null))};return e.jsxs(e.Fragment,{children:[e.jsxs(yc,{open:g,onOpenChange:n,children:[e.jsx(Do,{asChild:!0,children:e.jsxs(I,{variant:"outline",size:"sm",className:"h-9",children:[e.jsx(Po,{className:"mr-2 h-4 w-4"}),i("generate.templates.manageAll","Manage All")]})}),e.jsxs(vc,{className:"max-w-lg max-h-[70vh] overflow-y-auto",children:[e.jsx(bc,{children:e.jsx(_c,{children:i("generate.templates.manageAllTitle","Manage All Templates")})}),p?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(He,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):d!=null&&d.length?e.jsx("div",{className:"space-y-4",children:Object.entries(y).map(([h,v])=>e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:xd[h]||h}),e.jsx("div",{className:"space-y-1",children:v.map(b=>e.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[b.is_default&&e.jsx(yl,{className:"h-3 w-3 text-yellow-500 fill-yellow-500 shrink-0"}),e.jsx("span",{className:"truncate",children:b.name}),e.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(b.created_at).toLocaleDateString()})]}),e.jsx(I,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive shrink-0",onClick:()=>l(b.id),children:e.jsx(hs,{className:"h-4 w-4"})})]},b.id))})]},h))}):e.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:i("generate.templates.noTemplatesYet","No templates saved yet.")})]})]}),e.jsx(In,{open:!!c,onOpenChange:h=>!h&&l(null),children:e.jsxs(Ln,{children:[e.jsxs(An,{children:[e.jsx(En,{children:i("generate.templates.deleteTemplate","Delete Template")}),e.jsx(Dn,{children:i("generate.templates.deleteConfirm",{name:f})})]}),e.jsxs(Pn,{children:[e.jsx(Mn,{children:i("common.cancel","Cancel")}),e.jsxs(Fn,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[m.isPending?e.jsx(He,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(hs,{className:"mr-2 h-4 w-4"}),i("common.delete","Delete")]})]})]})})]})}const gd={"rank-math":"Rank Math",yoast:"Yoast SEO","nlp-semantic":"NLP Semantic","full-seo-faqs":"Fully SEO (E-E-A-T)","hybrid-max":"Hybrid Max","hcu-optimized":"HCU Optimized",custom:"Custom Mode"};
11function jd({seoMode:i,onApplyTemplate:d,collectCurrentSettings:p,openSaveRequest:m=0,onSelectedTemplateChange:c}){const{t:l}=Ae(),{user:g}=xc(),{templates:n,defaultTemplate:f,isLoading:y,saveTemplate:T,updateTemplate:A,deleteTemplate:h,setDefaultTemplate:v}=fc(i),[b,k]=a.useState(null),[E,M]=a.useState(!1),[j,U]=a.useState(!1);a.useEffect(()=>{m>0&&M(!0)},[m]);const L=n==null?void 0:n.find(B=>B.id===b),ce=B=>{if(B==="none"){k(null),c==null||c(null);return}const J=n==null?void 0:n.find(ue=>ue.id===B);J&&(k(B),d(J),c==null||c(J))},w=async(B,J)=>{if(!(g!=null&&g.id))return;const ue=p();await T.mutateAsync({...ue,user_id:g.id,name:B,seo_mode:i,is_default:J})},pe=async()=>{if(!L)return;const B=p();await A.mutateAsync({id:L.id,...B})},de=async()=>{b&&(await h.mutateAsync(b),k(null),U(!1))},S=async()=>{L&&(L.is_default?await A.mutateAsync({id:L.id,is_default:!1}):await v.mutateAsync({id:L.id,seoMode:i}))};if(!g)return null;const D=gd[i]||i;return e.jsxs(e.Fragment,{children:[e.jsx(gl,{className:"border-border/50 bg-muted/30",children:e.jsxs(Eo,{className:"p-4",children:[e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("span",{className:"text-sm font-medium",children:[D," ",l("generate.templates.label")]}),f&&!b&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(Default: ",f.name,")"]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(O,{value:b||"none",onValueChange:ce,disabled:y,children:[e.jsx(q,{className:"w-[180px] h-9 hover:brand-gradient hover:text-white",children:e.jsx(K,{placeholder:l("generate.templates.selectTemplate")})}),e.jsxs(z,{children:[e.jsx(o,{value:"none",children:l("generate.templates.noTemplate")}),n==null?void 0:n.map(B=>e.jsx(o,{value:B.id,children:e.jsxs("div",{className:"flex items-center gap-2",children:[B.is_default&&e.jsx(yl,{className:"h-3 w-3 text-yellow-500 fill-yellow-500"}),B.name]})},B.id))]})]}),e.jsxs(I,{variant:"outline",size:"sm",onClick:()=>M(!0),className:"h-9 hover:brand-gradient hover:text-white",children:[e.jsx(dr,{className:"mr-2 h-4 w-4"}),l("generate.templates.saveCurrent")]}),e.jsx(pd,{}),L&&e.jsxs(e.Fragment,{children:[e.jsxs(I,{variant:"outline",size:"sm",onClick:pe,disabled:A.isPending,className:"h-9",children:[A.isPending?e.jsx(He,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(Mo,{className:"mr-2 h-4 w-4"}),l("generate.templates.update")]}),e.jsx(I,{variant:"outline",size:"sm",onClick:()=>U(!0),className:"h-9 text-destructive hover:text-destructive",children:e.jsx(hs,{className:"h-4 w-4"})})]})]})]}),L&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-border/50 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(u,{id:"template-default",checked:L.is_default,onCheckedChange:S,disabled:v.isPending||A.isPending}),e.jsx(r,{htmlFor:"template-default",className:"text-sm cursor-pointer",children:l("generate.templates.setAsDefault",{mode:D})})]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[l("generate.templates.lastUpdated"),": ",new Date(L.updated_at).toLocaleDateString()]})]})]})}),e.jsx(hd,{open:E,onOpenChange:M,onSave:w,seoMode:i,isPending:T.isPending}),e.jsx(In,{open:j,onOpenChange:U,children:e.jsxs(Ln,{children:[e.jsxs(An,{children:[e.jsx(En,{children:l("generate.templates.deleteTemplate")}),e.jsx(Dn,{children:l("generate.templates.deleteConfirm",{name:L==null?void 0:L.name})})]}),e.jsxs(Pn,{children:[e.jsx(Mn,{children:l("common.cancel")}),e.jsxs(Fn,{onClick:de,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[h.isPending?e.jsx(He,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(hs,{className:"mr-2 h-4 w-4"}),l("common.delete")]})]})]})})]})}const ur=16e3;function fd({enabled:i,onEnabledChange:d,selectedDocIds:p,onSelectedDocsChange:m,instructions:c,onInstructionsChange:l}){const{t:g}=Ae(),{user:n}=xc(),{folders:f}=vl(),[y,T]=a.useState("all"),{data:A=[]}=Rn({queryKey:["knowledge-documents-active",n==null?void 0:n.id],queryFn:async()=>{const{data:j,error:U}=await oe.from("knowledge_documents").select("id, title, category, content_text, file_name, is_active, folder_id").eq("is_active",!0).order("title");if(U)throw U;return j},enabled:!!n});if(A.length===0)return null;const h=f.length>0&&A.some(j=>j.folder_id),v=A.filter(j=>y==="all"?!0:y==="global"?j.folder_id===null:j.folder_id===y||j.folder_id===null),b=j=>{p.includes(j)?m(p.filter(U=>U!==j)):m([...p,j])},k=A.filter(j=>
11p.includes(j.id)).reduce((j,U)=>{var L;return j+(((L=U.content_text)==null?void 0:L.length)||0)},0),E=k>ur,M=j=>{var U;return j?((U=f.find(L=>L.id===j))==null?void 0:U.name)??"Project":"Global"};return e.jsxs("div",{className:"rounded-xl bg-card border border-border p-4 md:p-6 space-y-4 opacity-0 animate-fade-in",style:{animationDelay:"150ms"},children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(lr,{className:"h-4 w-4 text-primary"}),e.jsx(r,{className:"font-semibold cursor-pointer",children:"Knowledge Base"}),e.jsx(W,{variant:"secondary",className:"text-[10px]",children:g("runtimeUi.documentCount",{count:A.length})}),e.jsx(On,{youtubeId:"WmIzRA1FaZo"})]}),e.jsx(u,{checked:i,onCheckedChange:d})]}),i&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Select documents to provide context for content generation. The AI will reference these for factual accuracy."}),h&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r,{className:"text-xs text-muted-foreground shrink-0",children:"Project:"}),e.jsxs(O,{value:y,onValueChange:T,children:[e.jsx(q,{className:"h-8 text-xs bg-secondary/30",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"all",children:"All documents"}),e.jsx(o,{value:"global",children:"Global only"}),f.map(j=>e.jsxs(o,{value:j.id,children:[j.name," + Global"]},j.id))]})]})]}),e.jsx("div",{className:"space-y-1.5 max-h-48 overflow-y-auto",children:v.length===0?e.jsx("p",{className:"text-xs text-muted-foreground py-3 text-center",children:"No documents match this project."}):v.map(j=>{var U;return e.jsxs("label",{className:"flex items-center gap-3 p-2 rounded-lg hover:bg-secondary/50 cursor-pointer transition-colors",children:[e.jsx(jc,{checked:p.includes(j.id),onCheckedChange:()=>b(j.id)}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx(Ve,{className:"h-3 w-3 text-muted-foreground shrink-0"}),e.jsx("span",{className:"text-sm truncate",children:j.title}),e.jsx(W,{variant:"outline",className:"text-[9px] shrink-0",children:((U=Fo.find(L=>L.value===j.category))==null?void 0:U.label)||j.category}),h&&e.jsxs(W,{variant:"outline",className:`text-[9px] shrink-0 gap-0.5 ${j.folder_id?"bg-primary/5 text-primary border-primary/20":"bg-muted text-muted-foreground border-border"}`,children:[j.folder_id?e.jsx(Ro,{className:"h-2 w-2"}):e.jsx(mr,{className:"h-2 w-2"}),M(j.folder_id)]})]})}),j.content_text&&e.jsxs("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[(j.content_text.length/1e3).toFixed(0),"k"]})]},j.id)})}),p.length>0&&e.jsx("p",{className:`text-xs ${E?"text-destructive":"text-muted-foreground"}`,children:E?g("runtimeUi.contextLimitExceeded",{selected:(k/1e3).toFixed(0),limit:ur/1e3}):g("runtimeUi.documentsSelected",{count:p.length,chars:(k/1e3).toFixed(0)})}),e.jsxs("div",{className:"space-y-1.5 pt-1 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ir,{className:"h-3 w-3 text-muted-foreground"}),e.jsx(r,{className:"text-xs text-muted-foreground",children:"Usage Instructions (optional)"})]}),e.jsx(ye,{placeholder:"E.g. Use pricing from the proposal document. Cite specific statistics. Focus on product features from the spec sheet...",value:c,onChange:j=>l(j.target.value),className:"text-sm min-h-[60px] resize-y bg-secondary/30",maxLength:500}),e.jsxs("p",{className:"text-[10px] text-muted-foreground text-right",children:[c.length,"/500"]})]})]})]})}function yd(i,d,p){if(!d.length)return"";const m=i.filter(l=>d.includes(l.id)&&l.content_text);if(!m.length)return"";let c="";p!=null&&p.trim()&&(c+=`[Knowledge Base Instructions]
12${p.trim()}
13
14`);for(const l of m){const g=`[Document: ${l.title}]
15${l.content_text}
16
17`;if(c.length+g.length>ur){const n=ur-c.length;n>200&&(c+=`[Document: ${l.title}]
18${l.content_text.substring(0,n-50)}
19[Truncated]
20
21`);break}c+=g}return c}const lc="__none__";function vd({value:i,onChange:d,compact:p=!1}){const{data:m=[],isLoading:c}=Oo(),{t:l}=Ae(),g=a.useMemo(()=>i?m.find(n=>`${n.site_type}:${n.site_id}`===i)??null:null,[i,m]);return e.jsxs(gl,{className:p?"space-y-3 border-0 bg-transparent p-0 shadow-none":"p-4 space-y-3 border-primary/20 bg-primary/5",children:[!p&&e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Le,{className:"h-4 w-4 text-primary"}),e.jsx(r,{className:"text-sm font-semibold",children:l("generate.websiteBrandVoice")}),e.jsx(W,{variant:"secondary",className:"text-[10px]",children:l("generate.optional")})]}),e.jsxs(rs,{to:"/wordpress?tab=settings",className:"text-xs text-muted-foreground hover:text-foreground inline-flex items-center gap-1",children:[l("generate.manageBrandVoices")," ",e.jsx(qo,{className:"h-3 w-3"})]})]}),e.jsxs(O,{value:i??lc,onValueChange:n=>{if(n===lc)return d(null);const f=m.find(y=>`${y.site_type}:${y.site_id}`===n)??null;d(f)}
21,disabled:c,children:[e.jsx(q,{className:"bg-input hover:brand-gradient hover:text-white",children:e.jsx(K,{placeholder:l(c?"generate.loadingSites":"generate.selectBrandVoiceSite")})}),e.jsxs(z,{children:[e.jsx(o,{value:lc,children:l("generate.defaultVoice")}),m.map(n=>e.jsxs(o,{value:`${n.site_type}:${n.site_id}`,children:[n.label,e.jsx("span",{className:"text-muted-foreground ms-2 text-xs uppercase",children:n.site_type})]},`${n.site_type}:${n.site_id}`))]})]}),!c&&m.length===0&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[l("generate.noBrandVoices")," ",e.jsx(rs,{to:"/wordpress?tab=settings",className:"text-primary hover:underline",children:l("generate.createBrandVoice")})," ",l("generate.autoApplyBrandVoice")]}),g&&e.jsxs("div",{className:"space-y-1.5 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2 text-emerald-500",children:[e.jsx(Ko,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:[l("generate.brandVoice"),": ",e.jsx("b",{children:g.company_name||g.label}),g.tone?` — ${g.tone}`:"",g.audience?` · ${g.audience}`:""]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(zo,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:l("generate.saveToFolder",{folder:g.label})})]})]})]})}const bd=[{label:"Content",templates:[{label:"Comparison Article",prompt:`Write a detailed, well-structured comparison article between [Product A] and [Product B].
22
23The article should include:
24
251. Introduction
26- Briefly explain both products
27- Highlight why this comparison is important for the reader
28- Define who this comparison is for (beginners, professionals, businesses, etc.)
29
302. Overview of Each Product
31- Short description of Product A
32- Short description of Product B
33
343. Feature-by-Feature Comparison
35- Compare key features side-by-side
36- Include performance, usability, integrations, and unique capabilities
37- Present a clear pros and cons table for both products
38
394. Pricing & Value Analysis
40- Compare pricing plans (if applicable)
41- Evaluate what users get for the price
42- Mention hidden costs or limitations
43
445. Use Case Scenarios
45- Explain real-world situations where Product A is better
46- Explain situations where Product B is more suitable
47
486. Strengths & Weaknesses Summary
49- Highlight key advantages and disadvantages of each
50
517. Final Verdict & Recommendation
52- Clearly state which product is better for specific needs
53- Provide decision criteria to help readers choose
54
55Requirements:
56- Write in clear, easy-to-understand English
57- Maintain a neutral and informative tone
58- Use headings, bullet points, and tables for readability
59- Keep the content engaging and practical`},{label:"Listicle",prompt:`Write a listicle-style article titled "[Number] Best [Topic]".
60
61The article should include:
62
631. Introduction
64- Explain what the list covers and why it matters
65- Define the selection criteria used to pick the items
66- Mention who this list is for (beginners, professionals, etc.)
67
682. Each List Item (repeat for each entry)
69- Use a descriptive H2 heading with the item number and name
70- Write 2-3 paragraphs explaining why it's included
71- List key features or benefits in bullet points
72- Include pros and cons for each item
73- Add a quick verdict or best-for recommendation
74
753. Comparison Table
76- Summarize all items in a side-by-side comparison table
77- Include columns for key differentiators (price, features, best for, rating)
78
794. Final Recommendation
80- Summarize the top picks for different use cases
81- Provide a clear "best overall" and "best value" recommendation
82
83Requirements:
84- Write in clear, easy-to-understand English
85- Use headings, bullet points, and tables for readability
86- Keep descriptions practical and actionable
87- Maintain a neutral, informative tone throughout`},{label:"How-To Guide",prompt:`Write a comprehensive step-by-step how-to guide on [Topic].
88
89The guide should include:
90
911. Introduction
92- Explain what the reader will learn and why it matters
93- Mention the expected difficulty level and time required
94- Define who this guide is for
95
962. Prerequisites & Tools Needed
97- List all required tools, software, materials, or knowledge
98- Include links or references where applicable
99
1003. Step-by-Step Instructions
101- Number each step clearly with a descriptive heading
102- Provide detailed explanations for each step
103- Include tips, warnings, or notes where helpful
104- Add screenshot or diagram placeholders where relevant
105
1064. Common Mistakes to Avoid
107- List 3-5 frequent errors beginners make
108- Explain how to prevent or fix each mistake
109
1105. Troubleshooting FAQ
111- Address 3-5 common issues readers might encounter
112- Provide clear solutions for each problem
113
1146. Expected Outcomes
115- Describe what success looks like after completing the guide
116- Suggest next steps or advanced techniques to explore
117
118Requirements:
119- Write in clear, simple English suitable for beginners
120- Use numbered steps, bullet points, and headings for easy scanning
121- Keep instructions practical and actionable
122- Include real-world examples where possible`},{label:"Opinion / Editorial",prompt:`Write a compelling opinion piece on [Topic].
123
124The article should include:
125
1261. Attention-Grabbing Opening
127- Start with a bold statement, surprising fact, or provocative question
128- Clearly state your thesis or main argument within the first two paragraphs
129
1302. Supporting Arguments (3-4 sections)
131- Present each argument with its own heading
132- Back up every claim with data, statistics, examples, or expert references
133- Use real-world scenarios to illustrate your points
134- Include personal insights or experiences where relevant
135
1363. Counterarguments & Rebuttals
137- Acknowledge 1-2 opposing viewpoints fairly
138- Explain why your position is stronger with evidence
139- Address potential criticisms directly
140
1414. Personal Insights
142- Share your unique perspective or experience on the topic
143- Explain what shaped your opinion and why it matters
144
1455. Conclusion & Call to Action
146- Summarize your main argument concisely
147- End with a strong call to action or forward-looking statement
148- Encourage readers to think critically or take specific steps
149
150Requirements:
151- Write in a confident but respectful tone
152- Support opinions with facts and evidence
153- Use headings and short paragraphs for readability
154- Keep the content engaging and thought-provoking`},{label:"Newsletter",prompt:`Write a newsletter edition about [Topic].
155
156The newsletter should include:
157
1581. Subject Line
159- Suggest 2-3 compelling subject line options (under 60 characters each)
160- Make them curiosity-driven or benefit-focused
161
1622. Personal Greeting & Hook
163- Start with a warm, conversational greeting
164- Include a hook that makes the reader want to continue (a question, surprising fact, or relatable scenario)
165
1663. Main Stories (2-3 sections)
167- Each story should have a clear heading
168- Write brief summaries (100-150 words each)
169- Include key takeaways or insights
170- Add links or references where applicable
171
1724. Actionable Tip or Resource
173- Provide one practical tip the reader can implement immediately
174- Include a recommended tool, article, or resource
175
1765. Upcoming Events or Announcements
177- Mention any relevant events, launches, or deadlines
178- Keep this section brief and scannable
179
1806. Sign-Off
181- End with a conversational, friendly closing
182- Include a question to encourage reader replies
183- Add social media or contact links
184
185Requirements:
186- Keep the tone friendly, personal, and scannable
187- Use short paragraphs and bullet points
188- Make every section valuable and skippable independently
189- Target 500-800 words total`}]},{label:"Reviews",templates:[{label:"Product Review",prompt:`Write an in-depth, honest product review of [Product Name].
190
191The review should include:
192
1931. Product Overview
194- Name, brand, category, and target audience
195- Key specifications and features at a glance
196- Current pricing and availability
197
1982. First Impressions
199- Unboxing experience or initial setup process
200- Build quality, design, and aesthetics
201- Ease of getting started
202
2033. Hands-On Testing
204- Explain your testing methodology and duration
205- Describe real-world usage scenarios tested
206- Include specific performance results or observations
207
2084. Performance & Benchmarks
209- Provide measurable performance data where applicable
210- Compare results against manufacturer claims
211- Test under different conditions or use cases
212
2135. Pros & Cons
214- List 4-6 genuine advantages with explanations
215- List 3-5 honest disadvantages or limitations
216- Be specific and avoid generic statements
217
2186. Comparison with Alternatives
219- Compare with 2-3 top competing products at similar price points
220- Highlight what makes this product stand out or fall short
221- Include a brief comparison table
222
2237. Value for Money Analysis
224- Evaluate whether the price is justified
225- Mention any hidden costs (accessories, subscriptions, maintenance)
226- Suggest who should and shouldn't buy this product
227
2288. Final Verdict
229- Provide an overall rating out of 10 with justification
230- Summarize the key decision factors
231- State clearly who this product is best for
232
233Requirements:
234- Write in clear, easy-to-understand English
235- Maintain an honest, balanced, and unbiased tone
236- Use headings, bullet points, and tables for readability
237- Include specific details rather than vague opinions`},{label:"Case Study",prompt:`Write a detailed case study about [Company/Project].
238
239The case study should include:
240
2411. Executive Summary
242- Summarize the key challenge, solution, and results in 2-3 sentences
243- Include the most impressive metric or outcome upfront
244
2452. Background & Challenge
246- Describe the company or project context
247- Explain the specific problem or challenge faced
248- Quantify the impact of the problem (lost revenue, wasted time, etc.)
249- Mention any previous attempts to solve it
250
2513. Solution & Implementation
252- Describe the chosen solution or approach
253- Provide an implementation timeline with key milestones
254- Explain why this approach was selected over alternatives
255- Detail specific strategies, tools, or tactics used
256
2574. Results & Impact
258- Present measurable before-and-after data
259- Include specific metrics: revenue growth, time saved, efficiency gains, etc.
260- Use charts, tables, or data visualizations where applicable
261- Highlight unexpected positive outcomes
262
2635. Key Lessons Learned
264- Share 3-5 important insights discovered during the process
265- Explain what worked well and what could be improved
266- Mention any challenges encountered during implementation
267
2686. Actionable Takeaways
269- Provide 3-5 concrete steps readers can apply to their own situation
270- Include tips for avoiding common pitfalls
271- Suggest resources for further learning
272
273Requirements:
274- Write in a professional but engaging tone
275- Use real data and specific numbers wherever possible
276- Structure with clear headings and bullet points
277- Make the content actionable and relatable`}]},{label:"Academic",templates:[{label:"Essay",prompt:`Write a short and simple story about "[Topic/Keyword]" in easy English.
278
279The story should:
280- Be written in a clear and simple style (suitable for students)
281- Include a beginning, middle, and ending
282- Follow a natural narrative flow with characters and events
283- Be around 150-200 words
284- Include a moral lesson at the end
285
286Requirements:
287- Keep the tone engaging, easy to understand, and suitable for school-level reading
288- Use simple vocabulary and short sentences
289- Do not use subheadings, bullet points, bold, or italic formatting
290- Write in a natural storytelling style that feels human and relatable
291- The moral should feel organic, not forced`},{label:"Research Paper",prompt:`Write a formal research paper on [Topic].
292
293The paper should include:
294
2951. Abstract (150-250 words)
296- Summarize the research question, methodology, key findings, and conclusions
297- Make it self-contained and informative
298
2992. Introduction
300- Present the research question or hypothesis clearly
301- Explain the significance and relevance of the topic
302- Provide context with background information
303- State the objectives and scope of the paper
304
3053. Literature Review
306- Summarize existing research and key studies on the topic
307- Identify gaps in current knowledge
308- Explain how this paper addresses those gaps
309- Cite relevant sources and authorities
310
3114. Methodology
312- Describe the research approach and design
313- Explain data collection methods and tools used
314- Justify why this methodology was chosen
315- Address any limitations of the approach
316
3175. Findings & Results
318- Present key findings with supporting data
319- Use tables, charts, or statistics where applicable
320- Organize results logically by theme or research question
321
3226. Discussion
323- Interpret the results in context of existing research
324- Explain unexpected findings or patterns
325- Discuss practical implications of the results
326
3277. Limitations
328- Acknowledge study limitations honestly
329- Suggest how future research could address them
330
3318. Conclusion
332- Summarize key findings and their significance
333- State implications for the field
334- Recommend directions for future research
335
3369. References
337- Include placeholder references in proper academic format
338
339Requirements:
340- Use formal academic tone throughout
341- Support all claims with evidence or citations
342- Use clear headings and structured paragraphs
343- Follow standard academic writing conventions`}]}];function _d({customPrompt:i,setCustomPrompt:d}){Ae();const p=m=>{d(m)};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(r,{htmlFor:"custom-prompt",className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Nc,{className:"h-4 w-4 text-primary"}),"Custom Instructions / Prompt"]}),e.jsx(ye,{id:"custom-prompt",placeholder:`Describe exactly what you want the AI to write. This is the primary input — no separate topic field needed.
344
345Example: Write a 2000-word comparison article between Next.js and Remix. Include a pros/cons table, performance benchmarks, developer experience comparison, and a clear recommendation for different use cases.`,className:"min-h-[240px] bg-input resize-y font-mono text-sm",value:i,onChange:m=>d(m.target.value)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your instructions will be sent directly to the AI. Language, word count, and image settings still apply."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(r,{className:"text-xs text-muted-foreground",children:"Quick Templates (click to insert):"}),bd.map(m=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/70",children:m.label}),e.jsx("div",{className:"flex flex-wrap gap-2",children:m.templates.map(c=>e.jsx(W,{variant:"outline",className:"cursor-pointer hover:bg-accent transition-colors px-3 py-1.5 text-xs",onClick:()=>p(c.prompt),children:c.label},c.label))})]},m.label))]})]})}const oc={company_name:"",audience:"",tone:"",writing_style:"",cta_style:"",point_of_view:"",preferred_words:[],avoid_words:[],sample_paragraph:"",reading_level:"",sentence_length:""},Nd=new Set(["informative","conversational","professional","casual","friendly","authoritative","enthusiastic","neutral","persuasive","academic","empathetic","witty","inspirational","technical"]);function wd(i){if(!i)return null;const d=i.trim().toLowerCase();return Nd.has(d)?d:d==="trustworthy"?"authoritative":d==="playful"?"witty":null}function kd(i){return i?i.startsWith("first")?"first":i==="second"?"second":i==="third"?"third":null:null}function Sd(i){if(!i)return null;switch(i){case"grade-6":return"grade5";case"grade-8":return"grade7";case"grade-10":return"grade9";case"college":return"college";default:return null}}function Cd({open:i,onOpenChange:d,title:p,description:m,children:c,footer:l,className:g}){return Go()?e.jsx(Uo,{open:i,onOpenChange:d,children:e.jsxs(Bo,{className:g,children:[e.jsxs(Vo,{className:"text-left",children:[e.jsx(Ho,{children:p}),m&&e.jsx(Yo,{children:m})]}),e.jsx("div",{className:"px-4 pb-4 overflow-y-auto max-h-[60vh]",children:c}),l&&e.jsx(Wo,{children:l})]})}):e.jsx(yc,{open:i,onOpenChange:d,children:e.jsxs(vc,{className:g,children:[e.jsxs(bc,{children:[e.jsx(_c,{children:p}),m&&e.jsx(jl,{children:m})]}),c,l&&e.jsx(fl,{children:l})]})})}function kl(i){const d=ml(),[p,m]=a.useState(!1),{data:c=[],isLoading:l}=Rn({queryKey:["internal-links",i],queryFn:async()=>{const h=i?(()=>{try{let E=i.trim();return E.startsWith("http")||(E=`https://${E}`),new URL(E).origin}catch{return i}})():void 0,v=[],b=1e3;let k=0;for(;;){let E=oe.from("internal_link_targets").select("*").order("page_title",{ascending:!0}).range(k,k+b-1);h&&(E=E.eq("site_url",h));const{data:M,error:j}=await E;if(j)throw j;if(!M||M.length===0||(v.push(...M),M.length<b))break;k+=b}return v}}),g=c.filter(h=>h.is_active).length,n=async h=>{m(!0);try{const{data:v,error:b}=await oe.functions.invoke("fetch-sitemap",{body:{url:h}});if(b)throw b;if(v!=null&&v.error)throw new Error(v.error);return ms.success(v.message||`Found ${v.count} pages`),d.invalidateQueries({queryKey:["internal-links"]}),v}catch(v){throw ms.error(v.message||"Failed to fetch sitemap"),v}finally{m(!1)}},f=Cn({mutationFn:async({id:h,is_active:v})=>{const{error:b}=await oe.from("internal_link_targets").update({is_active:v}).eq("id",h);if(b)throw b},onSuccess:()=>d.invalidateQueries({queryKey:["internal-links"]})}),y=Cn({mutationFn:async h=>{const{error:v}=await oe.from("internal_link_targets").delete().eq("id",h);if(v)throw v},onSuccess:()=>{ms.success("Link removed"),d.invalidateQueries({queryKey:["internal-links"]})}}),T=Cn({mutationFn:async({ids:h,is_active:v})=>
345{if(h.length===0)return;const b=500;for(let k=0;k<h.length;k+=b){const E=h.slice(k,k+b),{error:M}=await oe.from("internal_link_targets").update({is_active:v}).in("id",E);if(M)throw M}},onSuccess:(h,v)=>{ms.success(v.is_active?"All links enabled":"All links disabled"),d.invalidateQueries({queryKey:["internal-links"]})},onError:()=>ms.error("Failed to update links")}),A=Cn({mutationFn:async h=>{const{data:{user:v}}=await oe.auth.getUser();if(!v)throw new Error("Not authenticated");const{error:b}=await oe.from("internal_link_targets").insert({user_id:v.id,page_url:h.page_url,page_title:h.page_title,keywords:h.keywords,site_url:h.site_url,source:"manual",is_active:!0});if(b)throw b},onSuccess:()=>{ms.success("Link added"),d.invalidateQueries({queryKey:["internal-links"]})},onError:h=>{var v;(v=h.message)!=null&&v.includes("unique")?ms.error("This URL already exists"):ms.error("Failed to add link")}});return{links:c,activeCount:g,isLoading:l,isFetching:p,fetchSitemap:n,toggleLink:f,bulkToggleLinks:T,deleteLink:y,addLink:A}}function dl({siteUrl:i,onFetchSitemap:d,isFetching:p}){const{t:m}=Ae(),{links:c,activeCount:l,toggleLink:g,bulkToggleLinks:n,deleteLink:f,addLink:y}=kl(i),[T,A]=a.useState(!1),[h,v]=a.useState(""),[b,k]=a.useState(!1),[E,M]=a.useState(""),[j,U]=a.useState(""),[L,ce]=a.useState(""),w=c.filter(S=>{var D,B;return!h||S.page_url.toLowerCase().includes(h.toLowerCase())||((D=S.page_title)==null?void 0:D.toLowerCase().includes(h.toLowerCase()))||((B=S.keywords)==null?void 0:B.toLowerCase().includes(h.toLowerCase()))}),pe=()=>{if(!E)return;let S="";try{let D=i.trim();D.startsWith("http")||(D=`https://${D}`),S=new URL(D).origin}catch{S=i}y.mutate({page_url:E,page_title:j||E,keywords:L,site_url:S},{onSuccess:()=>{M(""),U(""),ce(""),k(!1)}})},de=S=>{try{const D=new URL(S);return D.pathname==="/"?D.hostname:D.pathname}catch{return S}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2 mt-2 flex-wrap",children:[e.jsxs(I,{type:"button",size:"sm",variant:"outline",onClick:d,disabled:!i||p,className:"text-xs",children:[p?e.jsx(He,{className:"h-3 w-3 animate-spin mr-1"}):e.jsx(mr,{className:"h-3 w-3 mr-1"}),m("generate.fetchSitemap")]}),e.jsxs(I,{type:"button",size:"sm",variant:"ghost",onClick:()=>A(!0),disabled:!i,className:"text-xs",children:[e.jsx(Ft,{className:"h-3 w-3 mr-1"}),m("generate.manageLinks"),l>0&&e.jsx(W,{variant:"secondary",className:"ml-1 text-[10px] px-1.5 py-0",children:l})]}),e.jsx(On,{youtubeId:"RqS2MBE5gxs"})]}),e.jsx(Cd,{open:T,onOpenChange:A,title:m("generate.internalLinkTargets"),description:m("generate.activeLinksFor",{count:l,site:i||m("generate.yourSite")}),className:"max-w-3xl",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(gc,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(Y,{placeholder:m("generate.searchLinksPlaceholder"),value:h,onChange:S=>v(S.target.value),className:"pl-9 h-9"}),h&&e.jsx("button",{onClick:()=>v(""),className:"absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground",children:e.jsx($l,{className:"h-4 w-4"})})]}),e.jsxs(I,{size:"sm",variant:b?"secondary":"default",onClick:()=>k(!b),className:"shrink-0",children:[e.jsx($o,{className:"h-4 w-4 mr-1"}),m("common.add")]})]}),b&&e.jsxs("div",{className:"border border-primary/20 rounded-lg p-4 space-y-3 bg-primary/5",children:[e.jsx("p",{className:"text-xs font-medium text-primary",children:"Add a new link target"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(r,{className:"text-xs text-muted-foreground",children:"Page URL *"}),e.jsx(Y,{placeholder:"https://yoursite.com/page",value:E,onChange:S=>M(S.target.value),className:"h-8 text-sm"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(r,{className:"text-xs text-muted-foreground",children:"Page Title"}),e.jsx(Y,{placeholder:"My Blog Post",value:j,onChange:S=>U(S.target.value),className:"h-8 text-sm"})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(r,{className:"text-xs text-muted-foreground",children:"Keywords (comma-separated)"}),e.jsx(Y,{placeholder:"seo, content marketing, blog",value:L,onChange:S=>ce(S.target.value),className:"h-8 text-sm"})]}),e.jsxs("div",{className:"flex gap-2 pt-1",children:[e.jsx(I,{size:"sm",onClick:pe,disabled:!E||y.isPending,children:y.isPending?e.jsxs(e.Fragment,{children:[e.jsx(He,{className:"h-3 w-3 animate-spin mr-1"})," Adding..."]}):"Add Link"}),e.jsx(I,{size:"sm",variant:"ghost",onClick:()=>k(!1),children:"Cancel"})]})]}),w.length>0&&(()=>{const S=w.filter(Z=>Z.is_active).length,D=S===w.length,J=D?"All on":S===0?"All off":`${S} of ${w.length} on`,ue=Z=>{const xe=w.map(ee=>ee.id);!Z&&xe.length>=10&&!window.confirm(`Disable all ${xe.length} link${xe.length>
3451?"s":""}?`)||n.mutate({ids:xe,is_active:Z})};return e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-primary/30 bg-primary/5 px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(u,{checked:D,onCheckedChange:ue,disabled:n.isPending,"aria-label":"Toggle all visible links",className:"shrink-0"}),e.jsxs("div",{className:"text-sm min-w-0",children:[e.jsx("div",{className:"font-semibold text-foreground leading-tight",children:h?`Toggle all matching (${w.length})`:`Toggle all links (${c.length})`}),e.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:J})]})]}),n.isPending&&e.jsx(He,{className:"h-4 w-4 animate-spin text-muted-foreground shrink-0"})]})})(),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground px-1",children:[e.jsx("span",{children:h?`${w.length} of ${c.length} links`:`${c.length} total links`}),e.jsxs("span",{className:"text-primary font-medium",children:[l," active"]})]}),e.jsx(xl,{className:"h-[350px] -mx-1",children:e.jsx("div",{className:"space-y-1.5 px-1",children:w.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(Ft,{className:"h-8 w-8 text-muted-foreground/40 mb-3"}),e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"No links found"}),e.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"Fetch your sitemap or add links manually"})]}):w.map(S=>e.jsxs("div",{className:`group flex items-start gap-3 p-2.5 rounded-lg border transition-all hover:bg-muted/40 ${S.is_active?"border-border bg-card":"border-border/50 bg-muted/20 opacity-60"}`,children:[e.jsx(u,{checked:S.is_active,onCheckedChange:D=>g.mutate({id:S.id,is_active:D}),className:"mt-0.5 shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[e.jsx("p",{className:"font-medium text-sm leading-tight truncate",children:S.page_title||de(S.page_url)}),e.jsx("p",{className:"text-[11px] text-muted-foreground truncate leading-tight",title:S.page_url,children:S.page_url})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 mt-0.5",children:[e.jsx(W,{variant:S.source==="manual"?"default":"secondary",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:S.source}),e.jsx(I,{size:"icon",variant:"ghost",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>f.mutate(S.id),children:e.jsx(hs,{className:"h-3 w-3 text-destructive"})})]})]},S.id))})})]})})]})}function Td(){const i=ml(),{toast:d}=dc(),p=Rn({queryKey:["previous-sites"],queryFn:async()=>{const{data:c,error:l}=await oe.rpc("get_user_site_urls");if(l)throw l;return(c||[]).map(g=>g.site_url).filter(Boolean)}}),m=Cn({mutationFn:async c=>{const{error:l}=await oe.from("internal_link_targets").delete().eq("site_url",c);if(l)throw l},onSuccess:()=>{i.invalidateQueries({queryKey:["previous-sites"]}),i.invalidateQueries({queryKey:["internal-links"]}),d({title:"Site removed",description:"All internal link targets for this site have been removed."})},onError:c=>{d({title:"Failed to remove site",description:c.message,variant:"destructive"})}});return{...p,deleteSite:m}}const xr=2,hc="writer-gpt-generate-settings",Id=new Set(["topics","optimize","customize","review"]);function wc(i){return`writer-gpt:generate-draft:v${xr}:${i}`}function Ld(i){if(!i)return null;try{const d=JSON.parse(i);return d.version!==xr||typeof d.savedAt!="string"||typeof d.topics!="string"||typeof d.jobName!="string"||typeof d.seoMode!="string"||!Id.has(d.activeStep)||!d.settings||typeof d.settings!="object"||!d.ui||typeof d.ui!="object"||!d.extras||typeof d.extras!="object"?null:d}catch{return null}}function Ad(i,d){return Ld(i.getItem(wc(d)))}function Sl(i,d,p){try{return i.setItem(wc(d),JSON.stringify(p)),!0}catch{return!1}}function Ed(i,d){try{i.removeItem(wc(d)),i.removeItem(hc)}catch{}}function Dd(i,d){try{const p=i.getItem(hc);if(!p)return null;const m=JSON.parse(p);if(!m.settings||typeof m.settings!="object")return null;const c={version:xr,savedAt:new Date().toISOString(),activeStep:"topics",topics:"",jobName:"",seoMode:typeof m.seoMode=="string"?m.seoMode:"full-seo-faqs",settings:m.settings,ui:{topicAccordionItems:[],showOptionalSettings:!1,showStructureFormat:!1}
345,extras:{imageCount:2,isCustomWordCount:!1,customInstructions:"",internalLinkingUrl:"",urlSlug:"",brandSiteKey:null,brandSite:null,knowledgeBaseEnabled:!1,selectedKnowledgeDocIds:[],knowledgeBaseInstructions:"",aeoSettings:{},geoSettings:{}}};return Sl(i,d,c),i.removeItem(hc),c}catch{return null}}const Pd=[{id:"aeo",name:"AEO Content",description:"Answer Engine Optimized — direct, question-focused content with answer summaries, definitions, steps, tables, related questions and citations. Best for direct answers and question searches.",badge:"Beta",group:"ai"},{id:"geo",name:"GEO Content",description:"Generative Engine Optimized — evidence-backed content for AI search with query fan-out, source research, statistics, entity clarity and claim verification. Best for AI citations and brand visibility.",badge:"Beta",group:"ai"},{id:"full-seo-faqs",name:"Fully SEO Optimized Articles with FAQ's (E-E-A-T) Optimized",description:"Outline table, H1-H6 hierarchy, 6+ FAQs, external links, Grade 7 readability",videoId:"oCqDZZQx5LA",group:"search"},{id:"nlp-semantic",name:"NLP Semantic SEO (Koray Method)",description:`${mc} NLP rules, semantic triples, entity-focused, featured snippet optimization`,group:"search"},{id:"rank-math",name:"Rank Math Optimized",description:"25+ headings, LSI keywords, 80+ score target, human-like with idioms",videoId:"eErogJrG8go",group:"search"},{id:"yoast",name:"Yoast SEO Optimized",description:"3000+ words, ≤2.5% keyword density, 30%+ transition words, Flesch focus",group:"search"},{id:"hybrid-max",name:"Hybrid Maximum SEO",description:"Combines ALL methods: NLP + Yoast + Rank Math + E-E-A-T for ultimate optimization",group:"search"},{id:"hcu-optimized",name:"HCU Optimized (Content Certification)",description:"Human-quality content with AI-signature reduction, information gain scoring, abuse veto checks, and AI discovery readiness. Google HCU compliant.",badge:"Beta",betaBadge:!0,premiumOnly:!0,group:"search"},{id:"custom",name:"Custom Mode (100% Manual)",description:"Write your own instructions. Full control over the AI prompt. All settings still apply.",badge:"Beta",group:"search"}],Mt=[{id:"topics",label:"Topics",description:"What to create",icon:Ve},{id:"optimize",label:"Optimize",description:"Choose a strategy",icon:uc},{id:"customize",label:"Customize",description:"Voice and structure",icon:Nc},{id:"review",label:"Review",description:"Confirm and generate",icon:bl}];function gh(){var Yc;const[i,d]=a.useState("topics"),[p,m]=a.useState(!1),[c,l]=a.useState(!1),[g,n]=a.useState(!1),[f,y]=a.useState(0),[T,A]=a.useState(null),[h,v]=a.useState(!1),[b,k]=a.useState(!1),[E,M]=a.useState([]),[j,U]=a.useState(""),[L,ce]=a.useState(""),[w,pe]=a.useState("full-seo-faqs"),[de,S]=a.useState(Nl),[D,B]=a.useState(wl),[J,ue]=a.useState([6]),[Z,xe]=a.useState("English"),[ee,Ee]=a.useState("1500"),[ge,De]=a.useState(!1),[Ce,Ye]=a.useState("informative"),[Pe,We]=a.useState("third"),[Me,Ge]=a.useState("grade7"),[Te,$e]=a.useState(!0),[ve,is]=a.useState(!0),[be,Qe]=a.useState(!0),[_e,Je]=a.useState(!0),[Ne,Xe]=a.useState(!0),[we,x]=a.useState(!0),[Ie,Ze]=a.useState(!1),[Fe,cs]=a.useState(!1),[Re,ls]=a.useState(!1),[os,ps]=a.useState("balanced"),[es,gs]=a.useState("statistic"),[Oe,js]=a.useState(!0),[qe,ss]=a.useState(!0),[Ke,ts]=a.useState(!1),[ze,as]=a.useState(!1),[ns,$]=a.useState(!1),[fs,Cs]=a.useState("1.3"),[F,ke]=a.useState(""),{isFetching:qn,fetchSitemap:Kn}=kl(F),{data:Ue=[],deleteSite:zn}
345=Td(),[pr,ys]=a.useState(!1),[Ts,Is]=a.useState(null),[vs,Ls]=a.useState(""),[bs,ds]=a.useState("authority"),[Rt,R]=a.useState(null),[le,kc]=a.useState(null),[Se,Un]=a.useState(oc),[Md,Bn]=a.useState(null),{folders:Cl,createFolder:Tl}=vl(),{toast:Sc}=dc(),Il=a.useCallback(async s=>{try{const{data:N}=await oe.from("site_brand_profiles").select("*").eq("site_id",s.site_id).eq("site_type",s.site_type).maybeSingle();if(N){Un({company_name:N.company_name??"",audience:N.audience??"",tone:N.tone??"",writing_style:N.writing_style??"",cta_style:N.cta_style??"",point_of_view:N.point_of_view??"",preferred_words:N.preferred_words??[],avoid_words:N.avoid_words??[],sample_paragraph:N.sample_paragraph??"",reading_level:N.reading_level??"",sentence_length:N.sentence_length??""});const C=wd(N.tone),fe=kd(N.point_of_view),V=Sd(N.reading_level);C&&Ye(C),fe&&We(fe),V&&Ge(V),Bn(s.label),Sc({title:`Brand voice applied from ${s.label}`,description:"Edit any field below to override for this batch."})}else Un(oc),Bn(s.label)}catch(N){console.warn("Failed to load brand voice for site",N)}}
345,[Sc]),[se,Cc]=a.useState(!1),[As,Tc]=a.useState(2),[Vn,Ic]=a.useState(!1),[Ot,Lc]=a.useState(!1),[qt,Ac]=a.useState([]),[Hn,Ec]=a.useState(""),[te,Kt]=a.useState(()=>({...ad})),[zt,Es]=a.useState(80),[Ut,Ds]=a.useState(25),[Bt,gr]=a.useState(!0),[Vt,jr]=a.useState(!0),[Ht,Ps]=a.useState(!0),[Yt,Ms]=a.useState(6),[Wt,Fs]=a.useState(!0),[Gt,Rs]=a.useState(!0),[$t,Os]=a.useState(!0),[Qt,qs]=a.useState(!0),[Jt,Ks]=a.useState(!0),[Xt,zs]=a.useState(!0),[Zt,Us]=a.useState(!0),[ea,Bs]=a.useState(!0),[sa,Vs]=a.useState(1500),[ta,Hs]=a.useState(!0),[aa,Ys]=a.useState(150),[na,Ws]=a.useState(!0),[ra,Gs]=a.useState(!0),[ia,$s]=a.useState(2),[ca,fr]=a.useState(0),[la,yr]=a.useState("informational"),[oa,Qs]=a.useState(!0),[da,Js]=a.useState(!0),[ua,Xs]=a.useState(!0),[ma,Zs]=a.useState(2),[ha,xa]=a.useState(!0),[pa,et]=a.useState(3),[ga,vr]=a.useState(!0),[ja,st]=a.useState(1.3),[fa,br]=a.useState("neutral"),[ya,tt]=a.useState(!0),[va,_r]=a.useState(!0),[ba,at]=a.useState(1.3),[_a,nt]=a.useState(30),[Na,rt]=a.useState(10),[wa,it]=a.useState(60),[ka,Nr]=a.useState(!0),[Sa,wr]=a.useState(!0),[Ca,ct]=a.useState(3),[Ta,lt]=a.useState(!0),[Ia,ot]=a.useState(!0),[La,dt]=a.useState(!0),[Aa,ut]=a.useState(!0),[Ea,mt]=a.useState(!0),[Da,ht]=a.useState(!0),[Pa,xt]=a.useState(!0),[Ma,Yn]=a.useState(!0),[Fa,Ra]=a.useState(!0),[Oa,pt]=a.useState(60),[qa,kr]=a.useState(!0),[Ka,gt]=a.useState(155),[za,Sr]=a.useState(!0),[Ua,Cr]=a.useState(!0),[Ba,Tr]=a.useState(!0),[Va,Ir]=a.useState("Article"),[Ha,Lr]=a.useState(300),[Ya,Ar]=a.useState(!0),[Wa,jt]=a.useState(300),[Ga,ft]=a.useState(150),[$a,yt]=a.useState(!0),[Qa,Ja]=a.useState(!1),[Xa,Wn]=a.useState(!1),[Za,vt]=a.useState(20),[en,Gn]=a.useState(!0),[sn,Er]=a.useState("medium"),[tn,$n]=a.useState(!0),[an,bt]=a.useState(2),[nn,_t]=a.useState(3),[rn,Dr]=a.useState(!1),[cn,Pr]=a.useState(!1),[ln,Mr]=a.useState(!0),[on,Fr]=a.useState("authority"),[dn,Rr]=a.useState(!1),[un,Or]=a.useState(5),[mn,qr]=a.useState(!0),[hn,Kr]=a.useState(!0),[xn,Nt]=a.useState(!1),[pn,wt]=a.useState(6),[gn,kt]=a.useState(!0),[jn,St]=a.useState(!0),[fn,Ct]=a.useState(!0),[yn,Tt]=a.useState(!0),[vn,It]=a.useState(3),[bn,zr]=a.useState(""),[Ur,Dc]=a.useState("mixed"),[Br,Vr]=a.useState(5),[Hr,Yr]=a.useState(!0),[Wr,Gr]=a.useState(!0),[$r,Qr]=a.useState(!0),[Jr,Xr]=a.useState(!0),[Zr,ei]=a.useState(!0),[si,ti]=a.useState(!0),[ai,ni]=a.useState(!0),[ri,ii]=a.useState(!0),[ci,li]=a.useState(!0),[oi,di]=a.useState(!0),[ui,mi]=a.useState(!0),[hi,xi]=a.useState(!0),[pi,gi]=a.useState(!0),[ji,fi]=a.useState(!0),[yi,vi]=a.useState(!0),[bi,_i]=a.useState(!0),[Ni,wi]=a.useState(!0),[ki,Si]=a.useState(!0),[Ci,Ti]=a.useState(!0),[Ii,Li]=a.useState(!0),[Ai,Ei]=a.useState(!0),[Di,Pi]=a.useState(!0),[Mi,Fi]=a.useState(!0),[Ri,Oi]=a.useState(!0),[qi,Fd]=a.useState(2),[Ki,Rd]=a.useState(800),[zi,Od]=a.useState(!0),[Ui,qd]=a.useState(!1),[us,Pc]=a.useState(""),[_s,Mc]=a.useState(""),{t}=Ae(),{locale:Ll,formatNumber:Q}=Ql(),Fc=s=>t(`generate.steps.${s}.label`),Al=s=>t(`generate.steps.${s}.description`),{toast:X}=dc(),Rc=Jl(),{user:_,subscription:Lt,session:Ns}=xc(),{isWhiteLabelClient:At,brand:Et}=Xl(),Oc=(Lt==null?void 0:Lt.tier)==="unlimited",qc=["pro","business","agency","unlimited"].includes(Lt==null?void 0:Lt.tier),{isAdmin:El}=Zl(),Bi=Pd.filter(s=>!(s.id==="geo"||s.id==="aeo"&&!El)),{data:Qn}=Rn({queryKey:["user-api-key-status-generate"],queryFn:async()=>{if(!(Ns!=null&&Ns.access_token))return null;const{data:s,error:N}=await oe.functions.invoke("manage-user-api-key",{body:{action:"validate",provider:"gemini"},headers:{Authorization:`Bearer ${Ns.access_token}`}});return N?null:s},enabled:Oc&&!!(Ns!=null&&Ns.access_token)}),Kc=Oc&&Qn!==void 0&&(Qn==null?void 0:Qn.valid)!==!0,{data:Dl=[]}=Rn({queryKey:["knowledge-documents-active",_==null?void 0:_.id],queryFn:async()=>{const{data:s,error:N}=await oe.from("knowledge_documents").select("id, title, category, content_text, file_name, is_active").eq("is_active",!0).order("title");if(N)throw N;return s},enabled:!!_&&Ot}),{wordsUsed:Pl,wordsLimit:Vi,totalWordsAvailable:Ml,wordsRemaining:Jn,wordsPercentage:_n,imagesUsed:Kd,imagesLimit:Hi,imagesRemaining:Nn,imagesPercentage:zd,isLoading:zc}=no(),{defaultTemplate:Yi}=fc(w),Wi=a.useCallback(()=>({word_count:parseInt(ee),language:Z,tone:Ce,point_of_view:Pe,reading_level:Me,formality:J[0],humanization_level:os,introduction_style:es,include_h2:Te,include_h3:ve,include_conclusion:be,include_faq:_e,include_bold:Ne,include_italic:we,include_takeaways:Ie,include_quotes:Fe,include_links:Re,generate_meta_title:Oe,generate_meta_description:qe,article_schema:Ke,faq_schema:ze,auto_add_sources:ns,keyword_density:parseFloat(fs),external_link_type:bs,generate_images:se,image_text_overlay:se&&Vn,nlp_rules:te,nlp_featured_snippets:te.paragraph_snippets??!0,nlp_semantic_triples:te.semantic_triples??!0,nlp_entity_focused:te.entity_focus??!0,nlp_avoid_analogies:te.avoid_analogies??!0,nlp_numeric_values:te.numeric_specifics??!0,nlp_short_sentences:te.short_sentences??!0,nlp_cite_sources:te.cite_sources??!0,rm_target_score:zt,rm_min_headings:Ut,rm_human_style:Bt,rm_lsi_keywords:Vt,rm_power_words:Ht,rm_faq_count:Yt,rm_keyword_in_title:Wt,rm_keyword_at_beginning:Gt,rm_keyword_in_meta:$t,rm_keyword_in_url:Qt,rm_keyword_in_first_10:Jt,rm_keyword_in_content:Xt,rm_keyword_in_subheadings:Zt,rm_keyword_in_alt:ea,rm_min_content_length:sa,rm_short_paragraphs:ta,rm_max_paragraph_length:aa,rm_table_of_contents:na,rm_media_presence:ra,rm_min_
345images:ia,rm_min_videos:ca,rm_search_intent:la,rm_top_of_page_clarity:oa,rm_entity_coverage:da,rm_original_value:ua,rm_freshness_date:!1,rm_min_external_links:ma,rm_dofollow_external:ha,rm_min_internal_links:pa,rm_duplicate_keyword_check:ga,rm_keyword_density:ja,rm_title_sentiment:fa,rm_number_in_title:ya,rm_url_length_check:va,yoast_keyword_density:ba,yoast_transition_pct:_a,yoast_passive_max:Na,yoast_flesch_target:wa,yoast_subheading_check:ka,yoast_sentence_check:Sa,yoast_keyphrase_length:Ca,yoast_keyphrase_in_title:Ta,yoast_keyphrase_in_slug:Ia,yoast_keyphrase_in_meta:La,yoast_keyphrase_in_intro:Aa,yoast_keyphrase_in_subheading:Ea,yoast_keyphrase_in_conclusion:Da,yoast_keyphrase_distribution:Pa,yoast_check_duplicate_keyphrase:Ma,yoast_use_synonyms:Fa,yoast_title_width:Oa,yoast_single_h1:qa,yoast_meta_length:Ka,yoast_title_uniqueness:za,yoast_meta_uniqueness:Ua,yoast_open_graph:Ba,yoast_schema_type:Va,yoast_min_text_length:Ha,yoast_text_structure:Ya,yoast_subheading_interval:Wa,yoast_max_paragraph_length:Ga,yoast_include_lists:$a,yoast_cornerstone:Qa,yoast_table_of_contents:Xa,yoast_max_sentence_length:Za,yoast_consecutive_sentences:en,yoast_word_complexity:sn,yoast_inclusive_language:tn,yoast_min_outbound_links:an,yoast_min_internal_links:nn,yoast_internal_suggestions:rn,yoast_orphaned_check:cn,yoast_competing_links:ln,yoast_link_authority_type:on,yoast_nofollow_external:dn,yoast_images_check:!0,yoast_min_images:1,yoast_keyphrase_in_alt:!0,yoast_alt_required:!0,yoast_max_slug_length:un,yoast_remove_stop_words:mn,yoast_clean_slug:hn,eeat_outline_table:xn,eeat_faq_count:pn,eeat_citations:gn,eeat_expert_quotes:jn,eeat_statistics:fn,eeat_experience:yn,eeat_external_links:vn,disclaimer:bn||null,hcu_style_mode:Ur,hcu_faq_count:Br,hcu_who_this_is_for:Hr,hcu_mistakes_to_avoid:Wr,hcu_comparison_tables:$r,hcu_checklists:Jr,hcu_answer_first:Zr,hcu_sentence_variation:si,hcu_lexical_diversity:ai,hcu_avoid_cliches:ri,hcu_idiomatic:ci,hcu_emotional_variance:oi,hcu_metaphor_originality:ui,hcu_require_citations:hi,hcu_statistical_validation:pi,hcu_source_quality:ji,hcu_no_keyword_stuffing:yi,hcu_no_thin_content:bi,hcu_no_fake_experts:Ni,hcu_no_excessive_cta:ki,hcu_no_auto_faq:Ci,hcu_schema_grounding:Ii,hcu_structured_faq:Ai,hcu_semantic_html:Di,hcu_speakable_schema:Mi,hcu_llm_utility:Ri,ps_max_solutions:qi,ps_max_word_count:Ki,ps_include_mistakes:zi,ps_strict_mode:Ui,custom_prompt:us||null,bv_company_name:Se.company_name||null,bv_audience:Se.audience||null,bv_tone:Se.tone||null,bv_writing_style:Se.writing_style||null,bv_cta_style:Se.cta_style||null,bv_point_of_view:Se.point_of_view||null,bv_preferred_words:Se.preferred_words,bv_avoid_words:Se.avoid_words,bv_sample_paragraph:Se.sample_paragraph||null,bv_reading_level:Se.reading_level||null,bv_sentence_length:Se.sentence_length||null}),[ee,Z,Ce,Pe,Me,J,os,es,Te,ve,be,_e,Ne,we,Ie,Fe,Re,Oe,qe,Ke,ze,ns,fs,bs,se,Vn,te,zt,Ut,Bt,Vt,Ht,Yt,Wt,Gt,$t,Qt,Jt,Xt,Zt,ea,sa,ta,aa,na,ra,ia,ca,la,oa,da,ua,ma,ha,pa,ga,ja,fa,ya,va,ba,_a,Na,wa,ka,Sa,Ca,Ta,Ia,La,Aa,Ea,Da,Pa,Ma,Fa,Oa,qa,Ka,za,Ua,Ba,Va,Ha,Ya,Wa,Ga,$a,Qa,Xa,Za,en,sn,tn,an,nn,rn,cn,ln,on,dn,un,mn,hn,xn,pn,gn,jn,fn,yn,vn,bn,Ur,Br,Hr,Wr,$r,Jr,Zr,si,ai,ri,ci,oi,ui,hi,pi,ji,yi,bi,Ni,ki,Ci,Ii,Ai,Di,Mi,Ri,qi,Ki,zi,Ui,us,Se]),wn=a.useCallback((s,N=!1)=>{var V,ae;Ee(((V=s.word_count)==null?void 0:V.toString())||"1500"),xe(s.language||"English"),Ye(s.tone||"informative"),We(s.point_of_view||"third"),Ge(s.reading_level||"grade7"),ue([s.formality||6]),ps(s.humanization_level||"medium"),gs(s.introduction_style||"statistic"),$e(s.include_h2??!0),is(s.include_h3??!0),Qe(s.include_conclusion??!0),Je(s.include_faq??!0),Xe(s.include_bold??!0),x(s.include_italic??!0),Ze(s.include_takeaways??!1),cs(s.include_quotes??!1),ls(s.include_links??!0),js(s.generate_meta_title??!0),ss(s.generate_meta_description??!0),ts(s.article_schema??!0),as(s.faq_schema??!0),$(s.auto_add_sources??!0),Cs(((ae=s.keyword_density)==null?void 0:ae.toString())||"1.3"),ds(s.external_link_type||"authority"),Cc(s.generate_images??!1),Ic(s.image_text_overlay??!1),s.nlp_rules&&typeof s.nlp_rules=="object"&&Object.keys(s.nlp_rules).length>0?Kt(P=>({...P,...s.nlp_rules})):Kt(P=>({...P,paragraph_snippets:s.nlp_featured_snippets??P.paragraph_snippets,semantic_triples:s.nlp_semantic_triples??P.semantic_triples,entity_focus:s.nlp_entity_focused??P.entity_focus,avoid_analogies:s.nlp_avoid_analogies??P.avoid_analogies,numeric_specifics:s.nlp_numeric_values??P.numeric_specifics,short_sentences:s.nlp_short_sentences??P.short_sentences,cite_sources:s.nlp_cite_sources??P.cite_sources})),Es(s.rm_target_score??80),Ds(s.rm_min_headings??25),gr(s.rm_human_style??!0),jr(s.rm_lsi_keywords??!0),Ps(s.rm_power_words??!0),Ms(s.rm_faq_count??6),Fs(s.rm_keyword_in_title??!0),Rs(s.rm_keyword_at_beginning??!0),Os(s.rm_keyword_in_meta??!0),qs(s.rm_keyword_in_url??!0),Ks(s.rm_keyword_in_first_10??!0),zs(s.rm_keyword_in_content??!0),Us(s.rm_keyword_in_subheadings??!0),Bs(s.rm_keyword_in_alt??!0),Vs(s.rm_min_content_length??1500),Hs(s.rm_short_paragraphs??!0),Ys(s.rm_max_paragraph_length??150),Ws(s.rm_table_of_contents??!0),Gs(s.rm_media_presence??!0),$s(s.rm_min_
345images??2),fr(s.rm_min_videos??0),yr(s.rm_search_intent||"informational"),Qs(s.rm_top_of_page_clarity??!0),Js(s.rm_entity_coverage??!0),Xs(s.rm_original_value??!0),Zs(s.rm_min_external_links??2),xa(s.rm_dofollow_external??!0),et(s.rm_min_internal_links??3),vr(s.rm_duplicate_keyword_check??!0),st(s.rm_keyword_density??1.3),br(s.rm_title_sentiment||"neutral"),tt(s.rm_number_in_title??!0),_r(s.rm_url_length_check??!0),at(s.yoast_keyword_density??1.3),nt(s.yoast_transition_pct??30),rt(s.yoast_passive_max??10),it(s.yoast_flesch_target??60),Nr(s.yoast_subheading_check??!0),wr(s.yoast_sentence_check??!0),ct(s.yoast_keyphrase_length??3),lt(s.yoast_keyphrase_in_title??!0),ot(s.yoast_keyphrase_in_slug??!0),dt(s.yoast_keyphrase_in_meta??!0),ut(s.yoast_keyphrase_in_intro??!0),mt(s.yoast_keyphrase_in_subheading??!0),ht(s.yoast_keyphrase_in_conclusion??!0),xt(s.yoast_keyphrase_distribution??!0),Yn(s.yoast_check_duplicate_keyphrase??!0),Ra(s.yoast_use_synonyms??!0),pt(s.yoast_title_width??60),kr(s.yoast_single_h1??!0),gt(s.yoast_meta_length??155),Sr(s.yoast_title_uniqueness??!0),Cr(s.yoast_meta_uniqueness??!0),Tr(s.yoast_open_graph??!0),Ir(s.yoast_schema_type||"Article"),Lr(s.yoast_min_text_length??300),Ar(s.yoast_text_structure??!0),jt(s.yoast_subheading_interval??300),ft(s.yoast_max_paragraph_length??150),yt(s.yoast_include_lists??!0),Ja(s.yoast_cornerstone??!1),Wn(s.yoast_table_of_contents??!1),vt(s.yoast_max_sentence_length??20),Gn(s.yoast_consecutive_sentences??!0),Er(s.yoast_word_complexity||"medium"),$n(s.yoast_inclusive_language??!0),bt(s.yoast_min_outbound_links??2),_t(s.yoast_min_internal_links??3),Dr(s.yoast_internal_suggestions??!1),Pr(s.yoast_orphaned_check??!1),Mr(s.yoast_competing_links??!0),Fr(s.yoast_link_authority_type||"authority"),Rr(s.yoast_nofollow_external??!1),Or(s.yoast_max_slug_length??5),qr(s.yoast_remove_stop_words??!0),Kr(s.yoast_clean_slug??!0),Nt(s.eeat_outline_table??!1),wt(s.eeat_faq_count??6),kt(s.eeat_citations??!0),St(s.eeat_expert_quotes??!0),Ct(s.eeat_statistics??!0),Tt(s.eeat_experience??!0),It(s.eeat_external_links??3),zr(s.disclaimer||""),Dc(s.hcu_style_mode||"mixed"),Vr(s.hcu_faq_count??5),Yr(s.hcu_who_this_is_for??!0),Gr(s.hcu_mistakes_to_avoid??!0),Qr(s.hcu_comparison_tables??!0),Xr(s.hcu_checklists??!0),ei(s.hcu_answer_first??!0),ti(s.hcu_sentence_variation??!0),ni(s.hcu_lexical_diversity??!0),ii(s.hcu_avoid_cliches??!0),li(s.hcu_idiomatic??!0),di(s.hcu_emotional_variance??!0),mi(s.hcu_metaphor_originality??!0),xi(s.hcu_require_citations??!0),gi(s.hcu_statistical_validation??!0),fi(s.hcu_source_quality??!0),vi(s.hcu_no_keyword_stuffing??!0),_i(s.hcu_no_thin_content??!0),wi(s.hcu_no_fake_experts??!0),Si(s.hcu_no_excessive_cta??!0),Ti(s.hcu_no_auto_faq??!0),Li(s.hcu_schema_grounding??!0),Ei(s.hcu_structured_faq??!0),Pi(s.hcu_semantic_html??!0),Fi(s.hcu_speakable_schema??!0),Oi(s.hcu_llm_utility??!0),Pc(s.custom_prompt||"");const C=s;(C.bv_company_name||C.bv_audience||C.bv_tone||C.bv_writing_style||C.bv_cta_style||C.bv_point_of_view||C.bv_sample_paragraph||C.bv_reading_level||C.bv_sentence_length||Array.isArray(C.bv_preferred_words)&&C.bv_preferred_words.length||Array.isArray(C.bv_avoid_words)&&C.bv_avoid_words.length)&&(Un({company_name:C.bv_company_name??"",audience:C.bv_audience??"",tone:C.bv_tone??"",writing_style:C.bv_writing_style??"",cta_style:C.bv_cta_style??"",point_of_view:C.bv_point_of_view??"",preferred_words:C.bv_preferred_words??[],avoid_words:C.bv_avoid_words??[],sample_paragraph:C.bv_sample_paragraph??"",reading_level:C.bv_reading_level??"",sentence_length:C.bv_sentence_length??""}),Bn(`template: ${s.name}`)),N||X({title:t("generate.templateApplied"),description:t("generate.templateAppliedDesc")})},[X]),kn=a.useRef(null),Gi=a.useRef(!1),Xn=a.useRef(!1),$i=a.useRef(!1),Uc=a.useCallback(s=>({version:xr,savedAt:new Date().toISOString(),activeStep:(s==null?void 0:s.activeStep)??i,topics:(s==null?void 0:s.topics)??L,jobName:(s==null?void 0:s.jobName)??j,seoMode:w,settings:Wi(),ui:{topicAccordionItems:E,showOptionalSettings:h,showStructureFormat:b}
345,extras:{imageCount:As,isCustomWordCount:ge,customInstructions:_s,internalLinkingUrl:F,urlSlug:vs,brandSiteKey:Rt,brandSite:le,knowledgeBaseEnabled:Ot,selectedKnowledgeDocIds:qt,knowledgeBaseInstructions:Hn,aeoSettings:de,geoSettings:D}}),[i,L,j,w,Wi,E,h,b,As,ge,_s,F,vs,Rt,le,Ot,qt,Hn,de,D]),Zn=a.useCallback(s=>!(_!=null&&_.id)||$i.current?!1:Sl(localStorage,_.id,Uc(s)),[_==null?void 0:_.id,Uc]),Qi=a.useRef(!1);a.useEffect(()=>{const s=()=>{Qi.current=!0};return window.addEventListener("pointerdown",s,!0),window.addEventListener("keydown",s,!0),()=>{window.removeEventListener("pointerdown",s,!0),window.removeEventListener("keydown",s,!0)}},[]),a.useEffect(()=>{if(!(_!=null&&_.id)||kn.current===_.id)return;if(Qi.current){kn.current=_.id,Gi.current=!0,Xn.current=!0;return}const s=Ad(localStorage,_.id)??Dd(localStorage,_.id);kn.current=_.id,Gi.current=!!s,Xn.current=!1,s&&(pe(s.seoMode),wn(s.settings,!0),d(s.activeStep),ce(s.topics),U(s.jobName),M(Array.isArray(s.ui.topicAccordionItems)?s.ui.topicAccordionItems:[]),v(s.ui.showOptionalSettings===!0),k(s.ui.showStructureFormat===!0),Tc(Number.isFinite(s.extras.imageCount)?s.extras.imageCount:2),De(s.extras.isCu
345stomWordCount===!0),Mc(typeof s.extras.customInstructions=="string"?s.extras.customInstructions:""),ke(typeof s.extras.internalLinkingUrl=="string"?s.extras.internalLinkingUrl:""),Ls(typeof s.extras.urlSlug=="string"?s.extras.urlSlug:""),R(typeof s.extras.brandSiteKey=="string"?s.extras.brandSiteKey:null),kc(s.extras.brandSite),Lc(s.extras.knowledgeBaseEnabled===!0),Ac(Array.isArray(s.extras.selectedKnowledgeDocIds)?s.extras.selectedKnowledgeDocIds:[]),Ec(typeof s.extras.knowledgeBaseInstructions=="string"?s.extras.knowledgeBaseInstructions:""),s.extras.aeoSettings&&Object.keys(s.extras.aeoSettings).length&&S(s.extras.aeoSettings),s.extras.geoSettings&&Object.keys(s.extras.geoSettings).length&&B(s.extras.geoSettings))},[_==null?void 0:_.id,wn]),a.useEffect(()=>{!(_!=null&&_.id)||kn.current!==_.id||Gi.current||Xn.current||!Yi||(Xn.current=!0,!Qi.current&&wn(Yi,!0))},[_==null?void 0:_.id,Yi,wn]),a.useEffect(()=>{if(!(_!=null&&_.id)||kn.current!==_.id||$i.current)return;const s=window.setTimeout(()=>Zn(),500);return()=>window.clearTimeout(s)},[_==null?void 0:_.id,Zn]);const Be=w==="custom",me=L.split(`
346`).filter(s=>s.trim()),he=Be?us.trim()?1:0:me.length,Bc=s=>{pe(s)},Sn=he*parseInt(ee),Dt=Jn>=Sn,je=_n>=100,Fl=_n>=75&&_n<100,Pt=se?he*As:0,ws=!se||Nn>=Pt,Ji=Nn===0,Xi=a.useRef(!1),er=a.useRef(null);a.useEffect(()=>{Xi.current=!1},[]),a.useEffect(()=>()=>{L.trim()&&!Xi.current&&to("generate_abandon",{topicCount:L.trim().split(`
347`).filter(Boolean).length,seoMode:w})},[L,w]);const sr=async()=>{if(zc){X({title:"Loading usage data",description:"Please wait a moment while we load your current usage, then try again."});return}if(Kc){X({title:"API Key Required",description:"Unlimited tier requires connecting your own Gemini API key in Settings → API Keys.",variant:"destructive"}),Rc("/settings?tab=api-keys");return}if(w==="hcu-optimized"&&!qc){X({title:t("generate.premiumFeature"),description:t("generate.hcuPremiumOnly"),variant:"destructive"});return}if(je){X({title:t("generate.wordLimitReached"),description:t("generate.wordLimitReachedDesc",{limit:Q(Vi)}),variant:"destructive"});return}if(!Dt&&me.length>0){X({title:"Insufficient Words",description:t("This job requires approximately {{needed}} words, but you only have {{remaining}} remaining.",{needed:Q(Sn),remaining:Q(Jn)}),variant:"destructive"});return}if(se){if(Ji){X({title:"Image Limit Reached",description:`You've used all ${Hi} monthly images. Upgrade to a higher plan or disable image generation.`,variant:"destructive"});return}if(!ws){X({title:"Insufficient Image Quota",description:`This job needs ~${Pt} images but you only have ${Nn} remaining.`,variant:"destructive"});return}}if(Be){if(!us.trim()){X({title:"Custom Prompt Required",description:"Please enter your custom instructions to generate content.",variant:"destructive"});return}}else if(me.length===0){X({title:"Topics Required",description:"Please enter at least one topic to generate articles.",variant:"destructive"});return}Zn(),Xi.current=!0,m(!0);try{let s=!1;try{if(!(localStorage.getItem(`generate:first-template-prompt:${_==null?void 0:_.id}:v1`)==="1")&&(_!=null&&_.id)){const{count:P}=await oe.from("jobs").select("id",{count:"exact",head:!0}).eq("user_id",_.id);s=P===0}}catch{}const N=j.trim()||`Bulk Job ${new Date().toLocaleString()}`;let C=null;if(le){const ae=Cl.find(P=>{var rc;return((rc=P.name)==null?void 0:rc.toLowerCase())===le.label.toLowerCase()});if(ae)C=ae.id;else try{const P=await Tl.mutateAsync({name:le.label});C=(P==null?void 0:P.id)??null}catch(P){console.warn("Could not create site folder, articles will land in Unsorted",P)}}const{data:fe,error:V}=await oe.from("jobs").insert({name:N,status:"processing",total_articles:Be?1:me.length,completed_articles:0,failed_articles:0,topics:Be?[us.substring(0,80)+(us.length>80?"...":"")]:me,language:Z,user_id:_==null?void 0:_.id,word_count:parseInt(ee),seo_mode:w,tone:Ce,point_of_view:Pe,reading_level:Me,formality:J[0],include_h2:Te,include_h3:ve,include_conclusion:be,include_faq:_e,include_bold:Ne,include_italic:we,include_takeaways:Ie,include_quotes:Fe,include_links:Re,humanization_level:os,introduction_style:es,generate_meta_title:Oe,generate_meta_description:qe,article_schema:Ke,faq_schema:ze,auto_add_sources:ns,keyword_density:parseFloat(fs),internal_linking_url:F||(le==null?void 0:le.root_url)||null,url_slug:vs||null,external_link_type:bs,target_folder_id:C,brand_site_id:(le==null?void 0:le.site_id)??null,brand_site_type:(le==null?void 0:le.site_type)??null,nlp_rules:te,nlp_featured_snippets:te.paragraph_snippets??!0,nlp_semantic_triples:te.semantic_triples??!0,nlp_entity_focused:te.entity_focus??!0,nlp_avoid_analogies:te.avoid_analogies??!0,nlp_numeric_values:te.numeric_specifics??!0,nlp_short_sentences:te.short_sentences??!0,nlp_cite_sources:te.cite_sources??!0,rm_target_score:zt,rm_min_headings:Ut,rm_human_style:Bt,rm_lsi_keywords:Vt,rm_power_words:Ht,rm_faq_count:Yt,rm_keyword_in_title:Wt,rm_keyword_at_beginning:Gt,rm_keyword_in_meta:$t,rm_keyword_in_url:Qt,rm_keyword_in_first_10:Jt,rm_keyword_in_content:Xt,rm_keyword_in_subheadings:Zt,rm_keyword_in_alt:ea,rm_min_content_length:sa,rm_short_paragraphs:ta,rm_max_paragraph_length:aa,rm_table_of_contents:na,rm_media_presence:ra,rm_min_
347images:ia,rm_min_videos:ca,rm_search_intent:la,rm_top_of_page_clarity:oa,rm_entity_coverage:da,rm_original_value:ua,rm_freshness_date:!1,rm_min_external_links:ma,rm_dofollow_external:ha,rm_min_internal_links:pa,rm_duplicate_keyword_check:ga,rm_keyword_density:ja,rm_title_sentiment:fa,rm_number_in_title:ya,rm_url_length_check:va,yoast_keyword_density:ba,yoast_transition_pct:_a,yoast_passive_max:Na,yoast_flesch_target:wa,yoast_subheading_check:ka,yoast_sentence_check:Sa,yoast_keyphrase_length:Ca,yoast_keyphrase_in_title:Ta,yoast_keyphrase_in_slug:Ia,yoast_keyphrase_in_meta:La,yoast_keyphrase_in_intro:Aa,yoast_keyphrase_in_subheading:Ea,yoast_keyphrase_in_conclusion:Da,yoast_keyphrase_distribution:Pa,yoast_check_duplicate_keyphrase:Ma,yoast_use_synonyms:Fa,yoast_title_width:Oa,yoast_single_h1:qa,yoast_meta_length:Ka,yoast_title_uniqueness:za,yoast_meta_uniqueness:Ua,yoast_open_graph:Ba,yoast_schema_type:Va,yoast_min_text_length:Ha,yoast_text_structure:Ya,yoast_subheading_interval:Wa,yoast_max_paragraph_length:Ga,yoast_include_lists:$a,yoast_cornerstone:Qa,yoast_table_of_contents:Xa,yoast_max_sentence_length:Za,yoast_consecutive_sentences:en,yoast_word_complexity:sn,yoast_inclusive_language:tn,yoast_min_outbound_links:an,yoast_min_internal_links:nn,yoast_internal_suggestions:rn,yoast_orphaned_check:cn,yoast_competing_links:ln,yoast_link_authority_type:on,yoast_nofollow_external:dn,yoast_images_check:!0,yoast_min_images:1,yoast_keyphrase_in_alt:!0,yoast_alt_required:!0,yoast_max_slug_length:un,yoast_remove_stop_words:mn,yoast_clean_slug:hn,eeat_outline_table:xn,eeat_faq_count:pn,eeat_citations:gn,eeat_expert_quotes:jn,eeat_statistics:fn,eeat_experience:yn,eeat_external_links:vn,generate_images:se,image_count:se?As:2,image_text_overlay:se&&Vn,disclaimer:bn||null,ps_max_solutions:qi,ps_max_word_count:Ki,ps_include_mistakes:zi,ps_strict_mode:Ui,custom_prompt:w==="custom"&&us||null,custom_instructions:_s.trim()?_s.trim():null,knowledge_context:Ot&&qt.length>0?yd(Dl,qt,Hn):null}).select().single();if(V)throw new Error(V.message);if(oe.functions.invoke("process-job",{body:{jobId:fe.id}}).catch(ae=>{console.error("Error starting job processing:",ae)}),eo("generate_articles",{seo_mode:w,article_count:me.length,language:Z,word_count:parseInt(ee)}),X({title:t("generate.jobCreated"),description:t("generate.jobCreatedDesc",{count:he}),action:e.jsx(so,{altText:"View articles",onClick:()=>Rc("/articles"),children:t("articles.title","My Articles")})}),s){try{localStorage.setItem(`generate:first-template-prompt:${_==null?void 0:_.id}:v1`,"1")}catch{}l(!0)}ce(""),d("topics"),Zn({topics:"",activeStep:"topics"})}catch(s){console.error("Job creation error:",s),X({title:t("generate.failedToCreateJob"),description:s instanceof Error?s.message:t("generate.failedToCreateJob"),variant:"destructive"})}finally{m(!1)}},Rl=w==="nlp-semantic"||w==="hybrid-max",Ol=w==="rank-math"||w==="hybrid-max",ql=w==="yoast"||w==="hybrid-max",Kl=w==="full-seo-faqs"||w==="hybrid-max",zl=w==="hybrid-max",Ul=w==="hcu-optimized",Bl=w==="aeo",Vl=w==="geo",Hl=w==="custom",Zi=s=>{s==="recommended"?(Es(80),Ds(25),Ms(6),Fs(!0),Rs(!0),Os(!0),qs(!0),Ks(!0),zs(!0),Us(!0),Bs(!0),Vs(1500),Hs(!0),Ys(150),Ws(!0),Gs(!0),$s(2),Qs(!0),Js(!0),Xs(!0),Zs(2),xa(!0),et(3),st(1.3),tt(!0),Ps(!0)):s==="strict"?(Es(90),Ds(30),Ms(8),Fs(!0),Rs(!0),Os(!0),qs(!0),Ks(!0),zs(!0),Us(!0),Bs(!0),Vs(2500),Hs(!0),Ys(120),Ws(!0),Gs(!0),$s(4),Qs(!0),Js(!0),Xs(!0),Zs(3),xa(!0),et(5),st(1.5),tt(!0),Ps(!0)):(Es(70),Ds(15),Ms(4),Fs(!0),Rs(!1),Os(!0),qs(!0),Ks(!0),zs(!0),Us(!1),Bs(!1),Vs(1e3),Hs(!0),Ys(200),Ws(!1),Gs(!0),$s(1),Qs(!0),Js(!1),Xs(!1),Zs(1),et(2),st(1),tt(!1),Ps(!1)),X({title:t("generate.presetApplied",{preset:s.charAt(0).toUpperCase()+s.slice(1)})})},ec=s=>{s==="recommended"?(at(1.5),nt(30),rt(10),it(60),ct(3),lt(!0),ot(!0),dt(!0),ut(!0),mt(!0),ht(!0),xt(!0),Ra(!0),pt(60),gt(155),jt(300),ft(150),yt(!0),bt(2),_t(3),vt(20)):s==="strict"?(at(2),nt(40),rt(5),it(70),ct(3),lt(!0),ot(!0),dt(!0),ut(!0),mt(!0),ht(!0),xt(!0),Yn(!0),Ra(!0),pt(55),gt(150),jt(250),ft(100),yt(!0),Ja(!0),Wn(!0),bt(3),_t(5),vt(18),Gn(!0),$n(!0)):s==="relaxed"&&(at(1),nt(25),rt(15),it(55),ct(4),lt(!0),ot(!0),dt(!0),ut(!0),mt(!1),ht(!1),xt(!1),pt(65),gt(155),jt(400),ft(175),yt(!1),Ja(!1),bt(1),_t(2),vt(25))},sc=s=>{Kt({...nd[s]}),X({title:t("generate.presetApplied",{preset:s.charAt(0).toUpperCase()+s.slice(1)})})},tc=s=>{s==="recommended"?(wt(6),It(4),Nt(!0),kt(!0),St(!0),Ct(!0),Tt(!0)):s==="strict"?(wt(10),It(6),Nt(!0),kt(!0),St(!0),Ct(!0),Tt(!0)):(wt(4),It(2),Nt(!1),kt(!1),St(!1),Ct(!0),Tt(!1)),X({title:t("generate.presetApplied",{preset:s.charAt(0).toUpperCase()+s.slice(1)})})},Yl=s=>
347{const N=s==="recommended"||s==="strict";Yr(N),Gr(N),Qr(N),Xr(N),ei(N),ti(!0),ni(!0),ii(N),li(s!=="relaxed"),di(s!=="relaxed"),mi(s!=="relaxed"),xi(N),gi(s==="strict"),fi(N),vi(!0),_i(!0),wi(!0),Si(N),Ti(N),Li(!0),Ei(N),Pi(!0),Fi(s==="strict"),Oi(N),Vr(s==="strict"?7:s==="recommended"?5:3),X({title:t("generate.presetApplied",{preset:s.charAt(0).toUpperCase()+s.slice(1)})})},ac=s=>{sc(s),Zi(s),ec(s),tc(s)},ks=Mt.findIndex(s=>s.id===i),nc=Bi.find(s=>s.id===w)??Bi[0],Vc=()=>{if(i==="topics"&&he===0){X({title:t("generate.addAtLeastOneTopic"),description:t("generate.addTopicBeforeOptimize"),variant:"destructive"});return}const s=Mt[ks+1];s&&(d(s.id),window.scrollTo({top:0,behavior:"smooth"}))},Hc=()=>{const s=Mt[ks-1];s&&(d(s.id),window.scrollTo({top:0,behavior:"smooth"}))},Wl=()=>{$i.current=!0,_!=null&&_.id&&Ed(localStorage,_.id),n(!1),window.location.reload()};return e.jsxs(e.Fragment,{children:[e.jsxs(ro,{title:t("header.welcomeBack"),children:[e.jsx(ao,{title:t("generate.title"),description:t("generate.seoDescription"),noindex:!0}),e.jsxs("div",{className:"generate-flow mx-auto max-w-6xl space-y-4 md:space-y-5",children:[e.jsxs("section",{className:"brand-highlight relative overflow-hidden rounded-2xl border px-4 py-5 shadow-sm md:px-6 md:py-6",children:[e.jsx("div",{className:"pointer-events-none absolute -top-16 -end-12 h-44 w-44 rounded-full bg-primary/10 blur-3xl"}),e.jsxs("div",{className:"relative flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:gap-3.5",children:[e.jsx("div",{className:"brand-gradient flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl",children:e.jsx(Le,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight text-foreground md:text-3xl",children:t("generate.createArticleBatch")}),e.jsx(W,{variant:"secondary",className:"rounded-full",children:t("generate.guidedSetup")})]}),e.jsx("p",{className:"max-w-2xl text-sm leading-6 text-muted-foreground",children:t("generate.guidedSetupDescription")})]})]}),e.jsxs("div",{className:"space-y-2 sm:min-w-[210px]",children:[e.jsxs(rs,{to:"/quick-write",className:"flex items-center justify-center gap-2 rounded-lg border bg-background px-3 py-2 text-sm font-medium text-primary hover:bg-primary/5",children:[e.jsx(Le,{className:"h-4 w-4"}),"Try Quick Write"]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 rounded-xl border border-border bg-muted/40 p-2 text-center",children:[e.jsxs("div",{className:"rounded-lg bg-background px-3 py-2",children:[e.jsx("div",{className:"text-lg font-bold tabular-nums text-foreground",children:he}),e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("common.articles")})]}),e.jsxs("div",{className:"rounded-lg bg-background px-3 py-2",children:[e.jsx("div",{className:"text-lg font-bold tabular-nums text-foreground",children:Q(Sn)}),e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("generate.estimatedWords")})]})]}),e.jsxs(I,{type:"button",variant:"ghost",size:"sm",className:"w-full gap-2 text-muted-foreground hover:text-foreground",onClick:()=>n(!0),children:[e.jsx(sl,{className:"h-3.5 w-3.5"})," ",t("generate.resetToDefaults")]})]})]})]}),e.jsx("nav",{"aria-label":t("generate.generationSteps"),className:"rounded-2xl border border-border bg-card p-2 shadow-sm",children:e.jsx("ol",{className:"grid grid-cols-4 gap-1.5",children:Mt.map((s,N)=>{const C=s.id===i,fe=N<ks,V=s.icon;return e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>d(s.id),"aria-current":C?"step":void 0,className:`group flex w-full flex-col items-center gap-1 rounded-xl px-2 py-2.5 text-center transition-all sm:flex-row sm:justify-center sm:gap-2.5 sm:px-3 ${C?"brand-gradient":fe?"bg-primary/10 text-primary hover:bg-primary/15":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[e.jsx("span",{className:`flex h-7 w-7 items-center justify-center rounded-lg ${C?"bg-white/15":"bg-background/70"}`,children:fe?e.jsx(bl,{className:"h-4 w-4"}):e.jsx(V,{className:"h-4 w-4"})}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-xs font-semibold sm:text-sm",children:Fc(s.id)}),e.jsx("span",{className:`hidden text-[11px] sm:block ${C?"text-primary-foreground
347/75":"text-muted-foreground"}`,children:Al(s.id)})]})]})},s.id)})})}),je&&e.jsxs(ar,{variant:"destructive",className:"border-destructive/50 bg-destructive/10",children:[e.jsx(Ss,{className:"h-4 w-4"}),e.jsx(nr,{children:t("generate.wordLimitReached")}),e.jsxs(rr,{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[e.jsx("span",{children:At?t("You've used 100% of your monthly word limit ({{limit}} words). Contact {{brand}} to increase your limit.",{limit:Q(Vi),brand:(Et==null?void 0:Et.brandName)||t("your agency")}):t("generate.wordLimitReachedDesc",{limit:Q(Vi)})}),!At&&e.jsx(I,{asChild:!0,size:"sm",className:"w-fit",children:e.jsxs(rs,{to:"/subscription",children:[e.jsx(Jo,{className:"h-4 w-4 mr-2"}),t("common.upgradePlan")]})})]})]}),Fl&&!je&&e.jsxs(ar,{className:"border-warning/50 bg-warning/10",children:[e.jsx(Ss,{className:"h-4 w-4 text-warning"}),e.jsx(nr,{className:"text-warning",children:t("generate.approachingWordLimit")}),e.jsxs(rr,{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[e.jsx("span",{children:t("generate.approachingWordLimitDesc",{percent:Q(_n),used:Q(Pl),total:Q(Ml)})}),!At&&e.jsx(I,{asChild:!0,variant:"outline",size:"sm",className:"w-fit",children:e.jsx(rs,{to:"/subscription",children:t("common.viewPlans")})})]})]}),!je&&!Dt&&me.length>0&&e.jsxs(ar,{variant:"destructive",className:"border-destructive/50 bg-destructive/10",children:[e.jsx(Ss,{className:"h-4 w-4"}),e.jsx(nr,{children:t("generate.insufficientWords")}),e.jsx(rr,{children:t("generate.insufficientWordsDesc",{needed:Q(Sn),remaining:Q(Jn)})})]}),Kc&&e.jsxs(ar,{className:"border-warning/50 bg-warning/10",children:[e.jsx(or,{className:"h-4 w-4 text-warning"}),e.jsx(nr,{className:"text-warning",children:"Connect Your Gemini API Key to Generate Articles"}),e.jsxs(rr,{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[e.jsxs("span",{children:["Your Unlimited plan uses your own Google Gemini API key. Without it, article generation will fail. Go to ",e.jsx("strong",{children:"Settings → API Keys"})," to add your key — it's free from Google AI Studio."]}),e.jsx(I,{asChild:!0,size:"sm",className:"w-fit shrink-0 gap-1.5",children:e.jsxs(rs,{to:"/settings?tab=api-keys",children:[e.jsx(or,{className:"h-3.5 w-3.5"}),"Add API Key"]})})]})]}),e.jsx("section",{"aria-labelledby":"topics-step-title",className:i==="topics"?"space-y-4":"hidden",children:e.jsxs("div",{className:"rounded-2xl bg-card border border-border p-4 md:p-6 space-y-5 opacity-0 animate-fade-in shadow-sm",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-primary/10 text-primary",children:e.jsx(Ve,{className:"h-4 w-4"})}),e.jsx("h2",{id:"topics-step-title",className:"font-semibold text-foreground",children:t("generate.addTopics")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("generate.addTopicsDescription")})]}),e.jsx("input",{ref:er,type:"file",accept:".csv,text/csv,text/plain",className:"hidden",onChange:s=>{var fe;const N=(fe=s.target.files)==null?void 0:fe[0];if(!N)return;const C=new FileReader;C.onload=()=>{const ae=String(C.result||"").split(/\r?\n/).map(P=>(P.split(",")[0]??"").trim().replace(/^"|"$/g,"").trim()).filter(P=>P&&P.toLowerCase()!=="topic"&&P.toLowerCase()!=="keyword"&&P.toLowerCase()!=="topics"&&P.toLowerCase()!=="keywords");ae.length===0?X({title:t("generate.emptyCsv"),description:t("generate.emptyCsvDescription"),variant:"destructive"}):(ce(P=>(P?P.trimEnd()+`
348`:"")+ae.join(`
349`)),X({title:t("generate.csvLoaded"),description:t("generate.topicCount",{count:ae.length})})),er.current&&(er.current.value="")},C.onerror=()=>{X({title:t("generate.csvReadFailed"),variant:"destructive"})},C.readAsText(N)}}),e.jsxs(I,{type:"button",variant:"outline",size:"sm",className:"gap-2 w-full transition-all hover:brand-gradient hover:text-white sm:w-auto",onClick:()=>{var s;return(s=er.current)==null?void 0:s.click()},children:[e.jsx(Xo,{className:"h-4 w-4"}),t("generate.uploadCSV")]})]}),e.jsxs(Tn,{type:"multiple",value:E,onValueChange:M,className:"space-y-2",children:[e.jsxs(ne,{value:"website-brand",className:"overflow-hidden rounded-xl border border-border bg-muted/20 px-4",children:[e.jsx(re,{className:"min-w-0 gap-2 py-3 hover:no-underline",children:e.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2 text-start",children:[e.jsx(Le,{className:"h-4 w-4 shrink-0 text-primary"}),e.jsx("span",{className:"min-w-0 text-sm font-medium leading-snug",children:t("generate.websiteBrandVoice")}),e.jsx(W,{variant:"secondary",className:"shrink-0 text-[11px]",children:t("generate.optional")}),le&&e.jsx("span",{className:"hidden truncate text-xs font-normal text-muted-foreground sm:inline",children:le.label})]})}),e.jsx(ie,{className:"pb-4 pt-1",children:e.jsx(vd,{compact:!0,value:Rt,onChange:s=>{kc(s),R(s?`${s.site_type}:${s.site_id}`:null),s!=null&&s.root_url&&!F&&ke(s.root_url),s?Il(s):(Un(oc),Bn(null))}})})]}),e.jsxs(ne,{value:"job-name",className:"overflow-hidden rounded-xl border border-border bg-muted/20 px-4",children:[e.jsx(re,{className:"py-3 hover:no-underline",children:e.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2 text-start",children:[e.jsx(Ve,{className:"h-4 w-4 shrink-0 text-primary"}),e.jsx("span",{className:"truncate text-sm font-medium",children:t("generate.jobName")}
349),j&&e.jsx("span",{className:"hidden truncate text-xs font-normal text-muted-foreground sm:inline",children:j})]})}),e.jsx(ie,{className:"pb-4 pt-1",children:e.jsx(Y,{value:j,onChange:s=>U(s.target.value),placeholder:t("generate.jobNamePlaceholder"),className:"bg-input hover:brand-gradient hover:text-white hover:placeholder:text-white/70"})})]})]}),!Be&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.enterTopicPerLine")}),e.jsx(ye,{placeholder:t("generate.topicsPlaceholder"),className:"min-h-[150px] bg-input resize-none text-sm",value:L,onChange:s=>ce(s.target.value)}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[e.jsxs("span",{children:[Q(L.length)," ",t("generate.characters")]}),e.jsx("span",{className:"font-medium text-primary",children:t("generate.articleCount",{count:Q(me.length)})})]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2 rounded-xl border border-border bg-muted/25 p-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.targetLanguage")}),e.jsx(Qo,{value:Z,onValueChange:xe})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.articleSize")}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(O,{value:ge?"custom":ee,onValueChange:s=>{s==="custom"?De(!0):(De(!1),Ee(s))},children:[e.jsx(q,{className:"bg-input hover:brand-gradient hover:text-white",children:e.jsx(K,{children:ge?t("generate.custom"):t("generate.wordsPlus",{count:Q(Number(ee),{useGrouping:!1})})})}),e.jsxs(z,{children:[[500,750,1e3,1500,2e3,2500,3e3,4e3,5e3,6e3,8e3,1e4].map(s=>e.jsx(o,{value:String(s),children:t("generate.wordsPlus",{count:s})},s)),e.jsx(o,{value:"custom",children:t("generate.custom")})]})]},`article-size-${Ll}`),ge&&e.jsx(Y,{type:"number",min:200,max:15e3,value:ee,onChange:s=>Ee(s.target.value),className:"bg-input w-28",placeholder:t("generate.exampleWordCount")})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between border-t border-border pt-4 mt-2",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(r,{htmlFor:"generateImages",className:"cursor-pointer",children:t("generate.generateImages")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("generate.articleImagesDescription")})]}),e.jsx(u,{id:"generateImages",checked:se,onCheckedChange:Cc,disabled:je})]}),se&&e.jsxs("div",{className:"space-y-3 rounded-xl border border-border/70 bg-muted/20 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx(r,{className:"text-sm",children:t("generate.imagesPerArticle")}),e.jsxs(O,{value:As.toString(),onValueChange:s=>Tc(parseInt(s)),children:[e.jsx(q,{className:"w-24 bg-input hover:brand-gradient hover:text-white",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"1",children:"1"}),e.jsx(o,{value:"2",children:"2"}),e.jsx(o,{value:"3",children:"3"}),e.jsx(o,{value:"4",children:"4"}),e.jsx(o,{value:"6",children:"6"}),e.jsx(o,{value:"8",children:"8"})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 border-t border-border/70 pt-3",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(r,{htmlFor:"imageTextOverlay",className:"cursor-pointer text-sm",children:t("generate.addTextToImages")}),e.jsx("p",{id:"imageTextOverlayDescription",className:"text-xs text-muted-foreground",children:t("generate.addTextToImagesDescription")})]}),e.jsx(u,{id:"imageTextOverlay",checked:Vn,onCheckedChange:Ic,"aria-describedby":"imageTextOverlayDescription"})]})]})]})}),e.jsxs("section",{"aria-labelledby":"optimize-step-title",className:i==="optimize"?"space-y-4":"hidden",children:[e.jsxs("div",{className:"rounded-2xl bg-card border border-border p-4 md:p-6 space-y-5 opacity-0 animate-fade-in shadow-sm",style:{animationDelay:"100ms"},children:[e.jsx("div",{className:"flex items-center justify-between flex-wrap gap-2",children:e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-primary/10 text-primary",children:e.jsx(uc,{className:"h-4 w-4"})}),e.jsx("h2",{id:"optimize-step-title",className:"font-semibold text-foreground",children:"Choose an optimization strategy"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Start with one mode. Open its detailed controls only if you want to override the defaults."})]})}),e.jsx(io,{value:w,onValueChange:Bc,className:"space-y-5",children:["ai","search"].map(s=>{const N=Bi.filter(V=>(V.group??"search")===s);if(!N.length)return null;const C=s==="ai"?"AI and Answer Search":"Search Results",fe=s==="ai"?"For AI Overviews, AI Mode, ChatGPT Search, Copilot, Perplexity and similar surfaces.":"Classic SEO plugins and frameworks.";return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:C}),e.jsx("span",{className:"text-[11px] text-muted-foreground hidden sm:inline",children:fe})]}),e.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:N.map(V=>{const ae=V.premiumOnly&&!qc;return e.jsxs("div",{className:`flex items-start space-x-3 rounded-xl border p-3.5 transition-all ${ae?"opacity-60 cursor-not-allowed border-border":w===V.id?"border-primary bg-primary/10 cursor-pointer":"border-border hover:border-primary/50 cursor-pointer"}`,onClick:()=>{ae||Bc(V.id)},children:[ae?e.jsx(hl,{className:"h-4 w-4 mt-1 text-muted-foreground shrink-0"}):e.jsx(co,{value:V.id,id:V.id,className:"mt-1"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(r,{htmlFor:V.id,className:`font-medium ${ae?"cursor-not-allowed":"cursor-pointer"}`,children:V.name}),V.badge&&e.jsx(W,{className:"bg-amber-500/10 text-amber-600 border-amber-500/30 text-xs",variant:"outline",children:V.badge}),V.betaBadge&&e.jsx(W,{className:"bg-blue-500/10 text-blue-600 border-blue-500/30 text-xs",variant:"outline",children:"Beta"}),ae&&e.jsx(W,{className:"bg-primary/10 text-primary border-primary/30 text-xs",variant:"outline",children:"Pro"})]}),e.jsxs("p",{className:"text-xs leading-5 text-muted-foreground mx-px mt-2",children:[V.description,V.videoId&&e.jsx("span",{className:"ml-2",children:e.jsx(On,{youtubeId:V.videoId})})]}),ae&&e.jsx(rs,{to:"/subscription",className:"text-xs text-primary hover:underline mt-1 inline-block",children:t("generate.upgradeToUnlock")})]})]},V.id)})})]},s)})})]}),e.jsx(jd,{seoMode:w,onApplyTemplate:wn,collectCurrentSettings:Wi,openSaveRequest:f,onSelectedTemplateChange:A}),Ul&&e.jsx(md,{hcuStyleMode:Ur,setHcuStyleMode:Dc,hcuFaqCount:Br,setHcuFaqCount:Vr,hcuWhoThisIsFor:Hr,setHcuWhoThisIsFor:Yr,hcuMistakesToAvoid:Wr,setHcuMistakesToAvoid:Gr,hcuComparisonTables:$r,setHcuComparisonTables:Qr,hcuChecklists:Jr,setHcuChecklists:Xr,hcuAnswerFirst:Zr,setHcuAnswerFirst:ei,hcuSentenceVariation:si,setHcuSentenceVariation:ti,hcuLexicalDiversity:ai,setHcuLexicalDiversity:ni,hcuAvoidCliches:ri,setHcuAvoidCliches:ii,hcuIdiomatic:ci,setHcuIdiomatic:li,hcuEmotionalVariance:oi,setHcuEmotionalVariance:
349di,hcuMetaphorOriginality:ui,setHcuMetaphorOriginality:mi,hcuRequireCitations:hi,setHcuRequireCitations:xi,hcuStatisticalValidation:pi,setHcuStatisticalValidation:gi,hcuSourceQuality:ji,setHcuSourceQuality:fi,hcuNoKeywordStuffing:yi,setHcuNoKeywordStuffing:vi,hcuNoThinContent:bi,setHcuNoThinContent:_i,hcuNoFakeExperts:Ni,setHcuNoFakeExperts:wi,hcuNoExcessiveCTA:ki,setHcuNoExcessiveCTA:Si,hcuNoAutoFAQ:Ci,setHcuNoAutoFAQ:Ti,hcuSchemaGrounding:Ii,setHcuSchemaGrounding:Li,hcuStructuredFAQ:Ai,setHcuStructuredFAQ:Ei,hcuSemanticHTML:Di,setHcuSemanticHTML:Pi,hcuSpeakableSchema:Mi,setHcuSpeakableSchema:Fi,hcuLLMUtility:Ri,setHcuLLMUtility:Oi,onApplyPreset:Yl}),Hl&&e.jsx("div",{className:"rounded-xl bg-card border border-border p-4 md:p-6 opacity-0 animate-fade-in",children:e.jsx(_d,{customPrompt:us,setCustomPrompt:Pc})}),Be&&e.jsx(Tn,{type:"single",collapsible:!0,className:"space-y-2",children:e.jsxs(ne,{value:"advanced",className:"rounded-xl bg-card border border-border overflow-hidden",children:[e.jsx(re,{className:"px-4 md:px-6 py-4 hover:no-underline",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(cc,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"font-semibold text-foreground",children:t("generate.advancedOptions")})]})}),e.jsx(ie,{children:e.jsxs("div",{className:"px-4 md:px-6 pb-4 md:pb-6 space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wide",children:t("generate.seoSettings")}),e.jsxs("div",{className:"grid gap-3 grid-cols-1 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r,{htmlFor:"cm-metaTitle",className:"cursor-pointer",children:t("generate.generateMetaTitle")}),e.jsx(u,{id:"cm-metaTitle",checked:Oe,onCheckedChange:js})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r,{htmlFor:"cm-metaDesc",className:"cursor-pointer",children:t("generate.generateMetaDescription")}),e.jsx(u,{id:"cm-metaDesc",checked:qe,onCheckedChange:ss})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r,{htmlFor:"cm-articleSchema",className:"cursor-pointer",children:t("generate.articleSchemaMarkup")}),e.jsx(u,{id:"cm-articleSchema",checked:Ke,onCheckedChange:ts})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r,{htmlFor:"cm-faqSchema",className:"cursor-pointer",children:t("generate.faqSchemaMarkup")}),e.jsx(u,{id:"cm-faqSchema",checked:ze,onCheckedChange:as})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r,{htmlFor:"cm-autoSources",className:"cursor-pointer",children:t("generate.autoAddSources")}),e.jsx(u,{id:"cm-autoSources",checked:ns,onCheckedChange:$})]})]})]}),e.jsxs("div",{className:"space-y-3 border-t border-border pt-4",children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wide",children:t("generate.linkInsertion")}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.keywordDensity")}),e.jsx(Y,{type:"number",value:fs,onChange:s=>Cs(s.target.value),step:"0.1",className:"bg-input"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.internalLinkingWebsite")}),Ue.length>0?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(O,{value:F,onValueChange:s=>ke(s==="__custom__"?"":s),children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{placeholder:t("generate.selectSitePlaceholder")})}),e.jsxs(z,{children:[Ue.map(s=>e.jsx(o,{value:s,children:s},s)),e.jsx(o,{value:"__custom__",children:t("generate.enterNewUrl")})]})]}),F&&Ue.includes(F)&&e.jsx(I,{variant:"outline",size:"icon",className:"shrink-0 text-destructive hover:text-destructive",onClick:()=>{Is(F),ys(!0)},children:e.jsx(hs,{className:"h-4 w-4"})})]}),(!F||!Ue.includes(F))&&e.jsx(Y,{placeholder:t("generate.websiteUrlPlaceholder"),value:F,onChange:s=>ke(s.target.value),className:"bg-input"})]}):e.jsx(Y,{placeholder:t("generate.websiteUrlPlaceholder"),value:F,onChange:s=>ke(s.target.value),className:"bg-input"}),e.jsx(dl,{siteUrl:F,onFetchSitemap:()=>{F&&Kn(F)},isFetching:qn})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.urlSlug")}),e.jsx(Y,{placeholder:t("generate.urlSlugPlaceholder"),value:vs,onChange:s=>Ls(s.target.value),className:"bg-input"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("generate.urlSlugHelp")})]})]}),e.jsxs("div",{className:"space-y-3 border-t border-border pt-4",children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wide",children:t("generate.outboundLinks")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.externalLinkType")}),e.jsxs(O,{value:bs,onValueChange:ds,children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"authority",children:t("generate.externalLinks.authority")}),e.jsx(o,{value:"educational",children:t("generate.externalLinks.educational")}),e.jsx(o,{value:"mixed",children:t("generate.externalLinks.mixed")}),e.jsx(o,{value:"none",children:t("generate.externalLinks.none")})]})]})]})]}),e.jsxs("div",{className:"space-y-2 border-t border-border pt-4",children:[e.jsx(r,{children:t("generate.customDisclaimer")}),e.jsx(ye,{placeholder:t("generate.disclaimerPlaceholder"),value:bn,onChange:s=>zr(s.target.value),className:"bg-input min-h-[80px] resize-none"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("generate.disclaimerHelp")})]})]})})]})}),zl?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"rounded-xl bg-gradient-to-r from-indigo-500/10 to-violet-500/10 border border-indigo-500/20 p-4 md:p-6 opacity-0 animate-fade-in",style:{animationDelay:"110ms"},children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground",children:t("generate.hybridMaxMasterPresets")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("generate.applyPresetToAll")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(I,{variant:"outline",size:"sm",onClick:()=>ac("relaxed"),className:"text-xs h-8",children:t("generate.relaxed")}),e.jsx(I,{variant:"outline",size:"sm",onClick:()=>ac("recommended"),className:"text-xs h-8 border-primary/50",children:t("generate.recommended")}),e.jsx(I,{variant:"outline",size:"sm",onClick:()=>ac("strict"),className:"text-xs h-8",children:t("generate.strict")})]})]})}),e.jsxs(Tn,{type:"multiple",className:"space-y-3",children:[e.jsxs(ne,{value:"nlp",className:"border-0",children:[e.jsx(re,{className:"rounded-xl bg-card border border-border p-4 md:p-6 hover:no-underline",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-purple-500"}),e.jsx("span",{className:"font-semibold",children:t("generate.nlpSettings")})]})}),e.jsx(ie,{className:"pt-0 pb-0",children:e.jsx(rl,{nlpRules:te,setNlpRules:Kt,onApplyPreset:sc})})]}),e.jsxs(ne,{value:"rankmath",className:"border-0",children:[e.jsx(re,{className:"rounded-xl bg-card border border-border p-4 md:p-6 hover:no-underline",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),e.jsx("span",{className:"font-semibold",children:t("generate.rankMathSettings")})]})}),e.jsx(ie,{className:"pt-0 pb-0",children:e.jsx(il,{rmTargetScore:zt,setRmTarget
349Score:Es,rmMinHeadings:Ut,setRmMinHeadings:Ds,rmHumanStyle:Bt,setRmHumanStyle:gr,rmLsiKeywords:Vt,setRmLsiKeywords:jr,rmPowerWords:Ht,setRmPowerWords:Ps,rmFaqCount:Yt,setRmFaqCount:Ms,rmKeywordInTitle:Wt,setRmKeywordInTitle:Fs,rmKeywordAtBeginning:Gt,setRmKeywordAtBeginning:Rs,rmKeywordInMeta:$t,setRmKeywordInMeta:Os,rmKeywordInUrl:Qt,setRmKeywordInUrl:qs,rmKeywordInFirst10:Jt,setRmKeywordInFirst10:Ks,rmKeywordInContent:Xt,setRmKeywordInContent:zs,rmKeywordInSubheadings:Zt,setRmKeywordInSubheadings:Us,rmKeywordInAlt:ea,setRmKeywordInAlt:Bs,rmMinContentLength:sa,setRmMinContentLength:Vs,rmShortParagraphs:ta,setRmShortParagraphs:Hs,rmMaxParagraphLength:aa,setRmMaxParagraphLength:Ys,rmTableOfContents:na,setRmTableOfContents:Ws,rmMediaPresence:ra,setRmMediaPresence:Gs,rmMinImages:ia,setRmMinImages:$s,rmMinVideos:ca,setRmMinVideos:fr,rmSearchIntent:la,setRmSearchIntent:yr,rmTopOfPageClarity:oa,setRmTopOfPageClarity:Qs,rmEntityCoverage:da,setRmEntityCoverage:Js,rmOriginalValue:ua,setRmOriginalValue:Xs,rmMinExternalLinks:ma,setRmMinExternalLinks:Zs,rmDofollowExternal:ha,setRmDofollowExternal:xa,rmMinInternalLinks:pa,setRmMinInternalLinks:et,rmDuplicateKeywordCheck:ga,setRmDuplicateKeywordCheck:vr,rmKeywordDensity:ja,setRmKeywordDensity:st,rmTitleSentiment:fa,setRmTitleSentiment:br,rmNumberInTitle:ya,setRmNumberInTitle:tt,rmUrlLengthCheck:va,setRmUrlLengthCheck:_r,onApplyPreset:Zi})})]}),e.jsxs(ne,{value:"yoast",className:"border-0",children:[e.jsx(re,{className:"rounded-xl bg-card border border-border p-4 md:p-6 hover:no-underline",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-orange-500"}),e.jsx("span",{className:"font-semibold",children:t("generate.yoastSettings")})]})}),e.jsx(ie,{className:"pt-0 pb-0",children:e.jsx(cl,{yoastKeywordDensity:ba,setYoastKeywordDensity:at,yoastTransitionPct:_a,setYoastTransitionPct:nt,yoastPassiveMax:Na,setYoastPassiveMax:rt,yoastFleschTarget:wa,setYoastFleschTarget:it,yoastSubheadingCheck:ka,setYoastSubheadingCheck:Nr,yoastSentenceCheck:Sa,setYoastSentenceCheck:wr,yoastKeyphraseLength:Ca,setYoastKeyphraseLength:ct,yoastKeyphraseInTitle:Ta,setYoastKeyphraseInTitle:lt,yoastKeyphraseInSlug:Ia,setYoastKeyphraseInSlug:ot,yoastKeyphraseInMeta:La,setYoastKeyphraseInMeta:dt,yoastKeyphraseInIntro:Aa,setYoastKeyphraseInIntro:ut,yoastKeyphraseInSubheading:Ea,setYoastKeyphraseInSubheading:mt,yoastKeyphraseInConclusion:Da,setYoastKeyphraseInConclusion:ht,yoastKeyphraseDistribution:Pa,setYoastKeyphraseDistribution:xt,yoastCheckDuplicateKeyphrase:Ma,setYoastCheckDuplicateKeyphrase:Yn,yoastUseSynonyms:Fa,setYoastUseSynonyms:Ra,yoastTitleWidth:Oa,setYoastTitleWidth:pt,yoastSingleH1:qa,setYoastSingleH1:kr,yoastMetaLength:Ka,setYoastMetaLength:gt,yoastTitleUniqueness:za,setYoastTitleUniqueness:Sr,yoastMetaUniqueness:Ua,setYoastMetaUniqueness:Cr,yoastOpenGraph:Ba,setYoastOpenGraph:Tr,yoastSchemaType:Va,setYoastSchemaType:Ir,yoastMinTextLength:Ha,setYoastMinTextLength:Lr,yoastTextStructure:Ya,setYoastTextStructure:Ar,yoastSubheadingInterval:Wa,setYoastSubheadingInterval:jt,yoastMaxParagraphLength:Ga,setYoastMaxParagraphLength:ft,yoastIncludeLists:$a,setYoastIncludeLists:yt,yoastCornerstone:Qa,setYoastCornerstone:Ja,yoastTableOfContents:Xa,setYoastTableOfContents:Wn,yoastMaxSentenceLength:Za,setYoastMaxSentenceLength:vt,yoastConsecutiveSentences:en,setYoastConsecutiveSentences:Gn,yoastWordComplexity:sn,setYoastWordComplexity:Er,yoastInclusiveLanguage:tn,setYoastInclusiveLanguage:$n,yoastMinOutboundLinks:an,setYoastMinOutboundLinks:bt,yoastMinInternalLinks:nn,setYoastMinInternalLinks:_t,yoastInternalSuggestions:rn,setYoastInternalSuggestions:Dr,yoastOrphanedCheck:cn,setYoastOrphanedCheck:Pr,yoastCompetingLinks:ln,setYoastCompetingLinks:Mr,yoastLinkAuthorityType:on,setYoastLinkAuthorityType:Fr,yoastNofollowExternal:dn,setYoastNofollowExternal:Rr,yoastMaxSlugLength:un,setYoastMaxSlugLength:Or,yoastRemoveStopWords:mn,setYoastRemoveStopWords:qr,yoastCleanSlug:hn,setYoastCleanSlug:Kr,onApplyPreset:ec})})]}),e.jsxs(ne,{value:"eeat",className:"border-0",children:[e.jsx(re,{className:"rounded-xl bg-card border border-border p-4 md:p-6 hover:no-underline",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-blue-500"}),e.jsx("span",{className:"font-semibold",children:t("generate.eeatSettings")})]})}),e.jsx(ie,{className:"pt-0 pb-0",children:e.jsx(ll,{eeatOutlineTable:xn,setEeatOutlineTable:Nt,eeatFaqCount:pn,setEeatFaqCount:wt,eeatCitations:gn,setEeatCitations:kt,eeatExpertQuotes:jn,setEeatExpertQuotes:St,eeatStatistics:fn,setEeatStatistics:Ct,eeatExperience:yn,setEeatExperience:Tt,eeatExternalLinks:vn,setEeatExter
349nalLinks:It,onApplyPreset:tc})})]})]})]}):e.jsxs(e.Fragment,{children:[Rl&&e.jsx(rl,{nlpRules:te,setNlpRules:Kt,onApplyPreset:sc}),Ol&&e.jsx(il,{rmTargetScore:zt,setRmTargetScore:Es,rmMinHeadings:Ut,setRmMinHeadings:Ds,rmHumanStyle:Bt,setRmHumanStyle:gr,rmLsiKeywords:Vt,setRmLsiKeywords:jr,rmPowerWords:Ht,setRmPowerWords:Ps,rmFaqCount:Yt,setRmFaqCount:Ms,rmKeywordInTitle:Wt,setRmKeywordInTitle:Fs,rmKeywordAtBeginning:Gt,setRmKeywordAtBeginning:Rs,rmKeywordInMeta:$t,setRmKeywordInMeta:Os,rmKeywordInUrl:Qt,setRmKeywordInUrl:qs,rmKeywordInFirst10:Jt,setRmKeywordInFirst10:Ks,rmKeywordInContent:Xt,setRmKeywordInContent:zs,rmKeywordInSubheadings:Zt,setRmKeywordInSubheadings:Us,rmKeywordInAlt:ea,setRmKeywordInAlt:Bs,rmMinContentLength:sa,setRmMinContentLength:Vs,rmShortParagraphs:ta,setRmShortParagraphs:Hs,rmMaxParagraphLength:aa,setRmMaxParagraphLength:Ys,rmTableOfContents:na,setRmTableOfContents:Ws,rmMediaPresence:ra,setRmMediaPresence:Gs,rmMinImages:ia,setRmMinImages:$s,rmMinVideos:ca,setRmMinVideos:fr,rmSearchIntent:la,setRmSearchIntent:yr,rmTopOfPageClarity:oa,setRmTopOfPageClarity:Qs,rmEntityCoverage:da,setRmEntityCoverage:Js,rmOriginalValue:ua,setRmOriginalValue:Xs,rmMinExternalLinks:ma,setRmMinExternalLinks:Zs,rmDofollowExternal:ha,setRmDofollowExternal:xa,rmMinInternalLinks:pa,setRmMinInternalLinks:et,rmDuplicateKeywordCheck:ga,setRmDuplicateKeywordCheck:vr,rmKeywordDensity:ja,setRmKeywordDensity:st,rmTitleSentiment:fa,setRmTitleSentiment:br,rmNumberInTitle:ya,setRmNumberInTitle:tt,rmUrlLengthCheck:va,setRmUrlLengthCheck:_r,onApplyPreset:Zi}),ql&&e.jsx(cl,{yoastKeywordDensity:ba,setYoastKeywordDensity:at,yoastTransitionPct:_a,setYoastTransitionPct:nt,yoastPassiveMax:Na,setYoastPassiveMax:rt,yoastFleschTarget:wa,setYoastFleschTarget:it,yoastSubheadingCheck:ka,setYoastSubheadingCheck:Nr,yoastSentenceCheck:Sa,setYoastSentenceCheck:wr,yoastKeyphraseLength:Ca,setYoastKeyphraseLength:ct,yoastKeyphraseInTitle:Ta,setYoastKeyphraseInTitle:lt,yoastKeyphraseInSlug:Ia,setYoastKeyphraseInSlug:ot,yoastKeyphraseInMeta:La,setYoastKeyphraseInMeta:dt,yoastKeyphraseInIntro:Aa,setYoastKeyphraseInIntro:ut,yoastKeyphraseInSubheading:Ea,setYoastKeyphraseInSubheading:mt,yoastKeyphraseInConclusion:Da,setYoastKeyphraseInConclusion:ht,yoastKeyphraseDistribution:Pa,setYoastKeyphraseDistribution:xt,yoastCheckDuplicateKeyphrase:Ma,setYoastCheckDuplicateKeyphrase:Yn,yoastUseSynonyms:Fa,setYoastUseSynonyms:Ra,yoastTitleWidth:Oa,setYoastTitleWidth:pt,yoastSingleH1:qa,setYoastSingleH1:kr,yoastMetaLength:Ka,setYoastMetaLength:gt,yoastTitleUniqueness:za,setYoastTitleUniqueness:Sr,yoastMetaUniqueness:Ua,setYoastMetaUniqueness:Cr,yoastOpenGraph:Ba,setYoastOpenGraph:Tr,yoastSchemaType:Va,setYoastSchemaType:Ir,yoastMinTextLength:Ha,setYoastMinTextLength:Lr,yoastTextStructure:Ya,setYoastTextStructure:Ar,yoastSubheadingInterval:Wa,setYoastSubheadingInterval:jt,yoastMaxParagraphLength:Ga,setYoastMaxParagraphLength:ft,yoastIncludeLists:$a,setYoastIncludeLists:yt,yoastCornerstone:Qa,setYoastCornerstone:Ja,yoastTableOfContents:Xa,setYoastTableOfContents:Wn,yoastMaxSentenceLength:Za,setYoastMaxSentenceLength:vt,yoastConsecutiveSentences:en,setYoastConsecutiveSentences:Gn,yoastWordComplexity:sn,setYoastWordComplexity:Er,yoastInclusiveLanguage:tn,setYoastInclusiveLanguage:$n,yoastMinOutboundLinks:an,setYoastMinOutboundLinks:bt,yoastMinInternalLinks:nn,setYoastMinInternalLinks:_t,yoastInternalSuggestions:rn,setYoastInternalSuggestions:Dr,yoastOrphanedCheck:cn,setYoastOrphanedCheck:Pr,yoastCompetingLinks:ln,setYoastCompetingLinks:Mr,yoastLinkAuthorityType:on,setYoastLinkAuthorityType:Fr,yoastNofollowExternal:dn,setYoastNofollowExternal:Rr,yoastMaxSlugLength:un,setYoastMaxSlugLength:Or,yoastRemoveStopWords:mn,setYoastRemoveStopWords:qr,yoastCleanSlug:hn,setYoastCleanSlug:Kr,onApplyPreset:ec}),Kl&&e.jsx(ll,{eeatOutlineTable:xn,setEeatOutlineTable:Nt,eeatFaqCount:pn,setEeatFaqCount:wt,eeatCitations:gn,setEeatCitations:kt,eeatExpertQuotes:jn,setEeatExpertQuotes:St,eeatStatistics:fn,setEeatStatistics:Ct,eeatExperience:yn,setEeatExperience:Tt,eeatExternalLinks:vn,setEeatExter
349nalLinks:It,onApplyPreset:tc})]}),Bl&&e.jsx(ld,{value:de,onChange:S}),Vl&&e.jsx(ud,{value:D,onChange:B})]}),e.jsxs("section",{"aria-labelledby":"customize-step-title",className:i==="customize"?"space-y-4":"hidden",children:[e.jsx("div",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm md:p-5",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:e.jsx(Nc,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("h2",{id:"customize-step-title",className:"font-semibold text-foreground",children:t("generate.customizeWriting")}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:t("generate.customizeWritingDescription")})]})]})}),!Be&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-xl bg-card border border-border p-4 md:p-6 space-y-4 opacity-0 animate-fade-in",style:{animationDelay:"150ms"},children:[e.jsx("h3",{className:"font-semibold text-foreground",children:t("generate.writingStyle")}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.toneOfVoice")}),e.jsxs(O,{value:Ce,onValueChange:Ye,children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"informative",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t("generate.tones.informative")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("generate.toneDescriptions.informative")})]})}),e.jsx(o,{value:"conversational",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t("generate.tones.conversational")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("generate.toneDescriptions.conversational")})]})}),e.jsx(o,{value:"professional",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t("generate.tones.professional")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("generate.toneDescriptions.professional")})]})}),e.jsx(o,{value:"casual",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t("generate.tones.casual")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("generate.toneDescriptions.casual")})]})}),e.jsx(o,{value:"friendly",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t("generate.tones.friendly")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("generate.toneDescriptions.friendly")})]})}),e.jsx(o,{value:"authoritative",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t("generate.tones.authoritative")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("generate.toneDescriptions.authoritative")})]})}),e.jsx(o,{value:"enthusiastic",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t("generate.tones.enthusiastic")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("generate.toneDescriptions.enthusiastic")})]})}),e.jsx(o,{value:"neutral",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t("generate.tones.neutral")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("generate.toneDescriptions.neutral")})]})}),e.jsx(o,{value:"persuasive",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t("generate.tones.persuasive")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("generate.toneDescriptions.persuasive")})]})}),e.jsx(o,{value:"academic",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t("generate.tones.academic")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("generate.toneDescriptions.academic")})]})}),e.jsx(o,{value:"empathetic",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t("generate.tones.empathetic")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("generate.toneDescriptions.empathetic")})]})}),e.jsx(o,{value:"witty",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t("generate.tones.witty")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("generate.toneDescriptions.witty")})]})}),e.jsx(o,{value:"inspirational",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t("generate.tones.inspirational")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("generate.toneDescriptions.inspirational")})]})}),e.jsx(o,{value:"technical",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t("generate.tones.technical")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("generate.toneDescriptions.technical")})]})})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.pointOfVie
349w")}),e.jsxs(O,{value:Pe,onValueChange:We,children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"first",children:t("generate.firstPerson")}),e.jsx(o,{value:"second",children:t("generate.secondPerson")}),e.jsx(o,{value:"third",children:t("generate.thirdPerson")})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.readingLevel")}),e.jsxs(O,{value:Me,onValueChange:Ge,children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"grade5",children:t("generate.readingLevels.grade5")}),e.jsx(o,{value:"grade7",children:t("generate.readingLevels.grade7")}),e.jsx(o,{value:"grade9",children:t("generate.readingLevels.grade9")}),e.jsx(o,{value:"college",children:t("generate.readingLevels.college")})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.humanizationLevel")}),e.jsxs(O,{value:os,onValueChange:ps,children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"low",children:t("generate.humanizationLevels.low")}),e.jsx(o,{value:"medium",children:t("generate.humanizationLevels.medium")}),e.jsx(o,{value:"high",children:t("generate.humanizationLevels.high")})]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex justify-between",children:e.jsxs(r,{children:[t("generate.formalityLevel"),": ",J[0]]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:t("generate.casual")}),e.jsx(H,{value:J,onValueChange:ue,max:10,min:1,step:1,className:"flex-1"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:t("generate.formal")})]})]})]}),e.jsx(fd,{enabled:Ot,onEnabledChange:Lc,selectedDocIds:qt,onSelectedDocsChange:Ac,instructions:Hn,onInstructionsChange:Ec}),e.jsxs("div",{className:"rounded-xl bg-card border border-border p-4 md:p-6 space-y-4 opacity-0 animate-fade-in",style:{animationDelay:"200ms"},children:[e.jsxs(I,{type:"button",variant:"outline",className:"w-full justify-between hover:brand-gradient hover:text-white",onClick:()=>k(s=>!s),"aria-expanded":b,children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(cc,{className:"h-4 w-4"})," ",t("generate.structureFormat")]}),e.jsx(tr,{className:`h-4 w-4 transition-transform ${b?"rotate-90":""}`})]}),b&&e.jsxs("div",{className:"space-y-4 border-t border-border pt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.introductionStyle")}),e.jsxs(O,{value:es,onValueChange:gs,children:[e.jsx(q,{className:"bg-input hover:brand-gradient hover:text-white",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"statistic",children:t("generate.statisticFact")}),e.jsx(o,{value:"question",children:t("generate.questionHook")}),e.jsx(o,{value:"story",children:t("generate.storyOpening")}),e.jsx(o,{value:"direct",children:t("generate.directStatement")}),e.jsx(o,{value:"bold-claim",children:t("generate.introStyles.boldClaim")}),e.jsx(o,{value:"contrast",children:t("generate.introStyles.contrast")}),e.jsx(o,{value:"scenario",children:t("generate.introStyles.scenario")}),e.jsx(o,{value:"quote",children:t("generate.introStyles.quote")}),e.jsx(o,{value:"problem",children:t("generate.introStyles.problem")})]})]})]}),e.jsxs("div",{className:"grid gap-2.5 md:gap-4 grid-cols-1 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex min-h-12 items-center justify-between gap-4 rounded-lg border border-border/60 bg-muted/20 px-3 py-2.5",children:[e.jsx(r,{htmlFor:"h2",className:"cursor-pointer",children:t("generate.h2Headings")}),e.jsx(u,{id:"h2",checked:Te,onCheckedChange:$e})]}),e.jsxs("div",{className:"flex min-h-12 items-center justify-between gap-4 rounded-lg border border-border/60 bg-muted/20 px-3 py-2.5",children:[e.jsx(r,{htmlFor:"h3",className:"cursor-pointer",children:t("generate.h3Headings")}),e.jsx(u,{id:"h3",checked:ve,onCheckedChange:is}
349)]}),e.jsxs("div",{className:"flex min-h-12 items-center justify-between gap-4 rounded-lg border border-border/60 bg-muted/20 px-3 py-2.5",children:[e.jsx(r,{htmlFor:"conclusion",className:"cursor-pointer",children:t("generate.includeConclusion")}),e.jsx(u,{id:"conclusion",checked:be,onCheckedChange:Qe})]}),e.jsxs("div",{className:"flex min-h-12 items-center justify-between gap-4 rounded-lg border border-border/60 bg-muted/20 px-3 py-2.5",children:[e.jsx(r,{htmlFor:"faq",className:"cursor-pointer",children:t("generate.includeFAQ")}),e.jsx(u,{id:"faq",checked:_e,onCheckedChange:Je})]}),e.jsxs("div",{className:"flex min-h-12 items-center justify-between gap-4 rounded-lg border border-border/60 bg-muted/20 px-3 py-2.5",children:[e.jsx(r,{htmlFor:"takeaways",className:"cursor-pointer",children:t("generate.includeKeyTakeaways")}),e.jsx(u,{id:"takeaways",checked:Ie,onCheckedChange:Ze})]}),e.jsxs("div",{className:"flex min-h-12 items-center justify-between gap-4 rounded-lg border border-border/60 bg-muted/20 px-3 py-2.5",children:[e.jsx(r,{htmlFor:"bold",className:"cursor-pointer",children:t("generate.boldText")}),e.jsx(u,{id:"bold",checked:Ne,onCheckedChange:Xe})]}),e.jsxs("div",{className:"flex min-h-12 items-center justify-between gap-4 rounded-lg border border-border/60 bg-muted/20 px-3 py-2.5",children:[e.jsx(r,{htmlFor:"italic",className:"cursor-pointer",children:t("generate.italicText")}),e.jsx(u,{id:"italic",checked:we,onCheckedChange:x})]})]})]})]}),e.jsxs("div",{className:"rounded-xl bg-card border border-border p-4 md:p-6 space-y-4 opacity-0 animate-fade-in",style:{animationDelay:"250ms"},children:[e.jsx("h3",{className:"font-semibold text-foreground",children:t("generate.seoSettings")}),e.jsxs("div",{className:"grid gap-3 md:gap-4 grid-cols-1 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r,{htmlFor:"metaTitle",className:"cursor-pointer",children:t("generate.generateMetaTitle")}),e.jsx(u,{id:"metaTitle",checked:Oe,onCheckedChange:js})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r,{htmlFor:"metaDesc",className:"cursor-pointer",children:t("generate.generateMetaDescription")}),e.jsx(u,{id:"metaDesc",checked:qe,onCheckedChange:ss})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r,{htmlFor:"articleSchema",className:"cursor-pointer",children:t("generate.articleSchemaMarkup")}),e.jsx(u,{id:"articleSchema",checked:Ke,onCheckedChange:ts})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r,{htmlFor:"faqSchema",className:"cursor-pointer",children:t("generate.faqSchemaMarkup")}),e.jsx(u,{id:"faqSchema",checked:ze,onCheckedChange:as})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r,{htmlFor:"autoSources",className:"cursor-pointer",children:t("generate.autoAddSources")}),e.jsx(u,{id:"autoSources",checked:ns,onCheckedChange:$})]})]}),se&&me.length>0&&e.jsx("div",{className:`text-xs p-3 rounded-lg border ${Ji?"bg-destructive/10 border-destructive/20 text-destructive":ws?"bg-muted/50 border-transparent text-muted-foreground":"bg-amber-500/10 border-amber-500/20 text-amber-600"}`,children:Ji?e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ss,{className:"h-4 w-4"}),e.jsxs("p",{children:["You've reached your monthly limit of ",Hi," images."]})]}),At?e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Contact ",(Et==null?void 0:Et.brandName)||"your agency"]}):e.jsx(I,{asChild:!0,size:"sm",variant:"destructive",children:e.jsx(rs,{to:"/subscription",children:"Upgrade Plan"})})]}):ws?e.jsxs("p",{children:["📸 ",t("This job will generate approximately {{count}} images",{count:Q(Pt)})," •"," ",t("You have {{remaining}} of {{limit}} remaining",{remaining:Q(Nn),limit:Q(Hi)})]}):e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ss,{className:"h-4 w-4"}),e.jsxs("p",{children:["This job needs ~",Pt," images but you only have ",Nn," remaining."]})]}),e.jsx(I,{asChild:!0,size:"sm",variant:"outline",children:e.jsx(rs,{to:"/subscription",children:"Upgrade"})})]})}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.keywordDensity")}),e.jsx(Y,{type:"number",value:fs,onChange:s=>Cs(s.target.value),step:"0.1",className:"bg-input"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.internalLinkingWebsite")}),Ue.length>0?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(O,{value:F,onValueChange:s=>ke(s==="__custom__"?"":s),children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{placeholder:t("generate.selectSitePlaceholder")})}),e.jsxs(z,{children:[Ue.map(s=>e.jsx(o,{value:s,children:s},s)),e.jsx(o,{value:"__custom__",children:t("generate.enterNewUrl")})]})]}),F&&Ue.includes(F)&&e.jsx(I,{variant:"outline",size:"icon",className:"shrink-0 text-destructive hover:text-destructive",onClick:()=>{Is(F),ys(!0)},children:e.jsx(hs,{className:"h-4 w-4"})})]}),(!F||!Ue.includes(F))&&e.jsx(Y,{placeholder:t("generate.websiteUrlPlaceholder"),value:F,onChange:s=>ke(s.target.value),className:"bg-input"})]}):e.jsx(Y,{placeholder:t("generate.websiteUrlPlaceholder"),value:F,onChange:s=>ke(s.target.value),className:"bg-input"}),e.jsx(dl,{siteUrl:F,onFetchSitemap:()=>{F&&Kn(F)},isFetching:qn})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.urlSlug")}),e.jsx(Y,{placeholder:t("generate.urlSlugPlaceholder"),value:vs,onChange:s=>Ls(s.target.value),className:"bg-input"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("generate.urlSlugHelp")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:t("generate.externalLinkType")}),e.jsxs(O,{value:bs,onValueChange:ds,children:[e.jsx(q,{className:"bg-input",children:e.jsx(K,{})}),e.jsxs(z,{children:[e.jsx(o,{value:"authority",children:t("generate.externalLinks.authority")}),e.jsx(o,{value:"educational",children:t("generate.externalLinks.educational")}),e.jsx(o,{value:"mixed",children:t("generate.externalLinks.mixed")}),e.jsx(o,{value:"none",children:t("generate.externalLinks.none")})]})]})]}),e.jsx("div",{className:"border-t border-border pt-4",children:e.jsxs(I,{type:"button",variant:"outline",className:"w-full justify-between hover:brand-gradient hover:text-white",onClick:()=>v(s=>!s),"aria-expanded":h,children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(cc,{className:"h-4 w-4"})," ",t("generate.optionalSettings")]}),e.jsx(tr,{className:`h-4 w-4 transition-transform ${h?"rotate-90":""}`})]})}),h&&e.jsxs("div",{className:"space-y-2 rounded-xl border border-border bg-muted/20 p-4",children:[e.jsx(r,{children:t("generate.customDisclaimer")}),e.jsx(ye,{placeholder:t("generate.disclaimerPlaceholder"),value:bn,onChange:s=>zr(s.target.value),className:"bg-input min-h-[80px] resize-none"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("generate.disclaimerHelp")})]}),h&&e.jsxs("div",{className:"space-y-2 rounded-xl border border-border bg-muted/20 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Le,{className:"h-4 w-4 text-primary"}),e.jsx(r,{className:"font-semibold",children:t("generate.customInstru
349ctions")}),_s.trim()&&e.jsx(W,{variant:"secondary",className:"ml-1",children:t("generate.active")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("generate.customInstructionsHelp")}),e.jsx(ye,{value:_s,onChange:s=>Mc(s.target.value),placeholder:t("generate.customInstructionsPlaceholder"),className:"min-h-[120px] bg-input resize-none",maxLength:2e3}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:t("generate.appliedToEveryArticle")}),e.jsxs("span",{children:[_s.length,"/2000"]})]})]})]})]})]}),e.jsxs("section",{"aria-labelledby":"review-step-title",className:i==="review"?"space-y-4":"hidden",children:[e.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border bg-card shadow-sm",children:[e.jsx("div",{className:"border-b border-border bg-gradient-to-r from-primary/10 via-primary/5 to-transparent p-5 md:p-6",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"brand-gradient flex h-9 w-9 shrink-0 items-center justify-center rounded-xl",children:e.jsx(Zo,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("h2",{id:"review-step-title",className:"text-lg font-semibold text-foreground",children:t("generate.reviewBatch")}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t("generate.reviewBatchDescription")})]})]})}),e.jsx("div",{className:"grid gap-px bg-border sm:grid-cols-2 lg:grid-cols-4",children:[{icon:Ve,label:t("common.articles"),value:he.toString(),detail:j||t("generate.untitledBatch")},{icon:uc,label:t("generate.optimization"),value:(nc==null?void 0:nc.name)||w,detail:t("generate.seoMode")},{icon:ed,label:t("common.language"),value:Z,detail:t("generate.wordsEach",{count:Q(Number(ee))})},{icon:sd,label:t("common.images"),value:se?t("generate.imageCountEach",{count:As}):t("generate.off"),detail:se?t("generate.totalImages",{count:Pt}):t("generate.contentOnly")}].map(s=>e.jsxs("div",{className:"bg-card p-4 md:p-5",children:[e.jsx("div",{className:"brand-gradient mb-3 flex h-8 w-8 items-center justify-center rounded-lg",children:e.jsx(s.icon,{className:"h-4 w-4"})}),e.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:s.label}),e.jsx("div",{className:"mt-1 line-clamp-2 font-semibold text-foreground",children:s.value}),e.jsx("div",{className:"mt-1 truncate text-xs text-muted-foreground",children:s.detail})]},s.label))}),!Be&&me.length>0&&e.jsxs("div",{className:"p-5 md:p-6",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:t("generate.topicsInBatch")}),e.jsx("button",{type:"button",onClick:()=>d("topics"),className:"text-xs font-medium text-primary hover:underline",children:t("generate.editTopics")})]}),e.jsx("div",{className:"divide-y divide-border overflow-hidden rounded-xl border border-border",children:me.slice(0,5).map((s,N)=>e.jsxs("div",{className:"flex items-center gap-3 bg-muted/20 px-3.5 py-2.5 text-sm text-foreground",children:[e.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md bg-background text-[11px] font-semibold text-muted-foreground",children:N+1}),e.jsx("span",{className:"truncate",children:s})]},`${s}-${N}`))}),me.length>5&&e.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["+ ",me.length-5," more topics"]})]})]}),!zc&&he>0&&e.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-muted/30 px-4 py-3 text-xs text-muted-foreground sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("span",{children:[t("Estimated usage:")," ",e.jsxs("strong",{className:"text-foreground",children:["~",Q(Sn)," ",t("words"),se?` + ~${Q(Pt)} ${t("images")}`:""]})]}),e.jsxs("span",{children:[Q(Jn)," ",t("words remaining")," · ",Q(100-_n),"% ",t("available")]})]})]}),e.jsxs("div",{className:"hidden items-center justify-between gap-3 rounded-2xl border border-border bg-card p-3 shadow-sm md:flex",children:[e.jsxs(I,{variant:"ghost",onClick:Hc,disabled:ks===0,className:"gap-2 hover:brand-gradient hover:text-white",children:[e.jsx(tl,{className:"h-4 w-4 rtl:rotate-180"})," ",t("generate.back")]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t("generate.stepOf",{current:ks+1,total:Mt.length})}),i!=="review"?e.jsxs("div",{className:"flex items-center gap-2",children:[i==="optimize"&&T&&e.jsxs(I,{variant:"outline",onClick:sr,disabled:p||he===0||je||!Dt&&he>0||se&&!ws,className:"gap-2 hover:brand-gradient hover:text-white",children:[e.jsx(Le,{className:"h-4 w-4"})," ",t("generate.generateWithTemplate")]}),e.jsxs(I,{onClick:Vc,className:"gap-2 px-6",children:[t("generate.continue")," ",e.jsx(tr,{className:"h-4 w-4 rtl:rotate-180"})]})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(I,{type:"button",variant:"outline",size:"lg",className:"gap-2",onClick:()=>y(s=>s+1),children:[e.jsx(dr,{className:"h-4 w-4"}),t("generate.templates.saveAsTemplate")]}),e.jsxs(I,{size:"lg",className:"gap-2 px-7",onClick:sr,disabled:p||he===0||je||!Dt&&he>0||se&&!ws,children:[p?e.jsx(He,{className:"h-5 w-5 animate-spin"}):je?e.jsx(Ss,{className:"h-5 w-5"}):e.jsx(Le,{className:"h-5 w-5"}),p?t("generate.creatingJob"):je?t(At?"generate.wordLimitReached":"generate.wordLimitExceeded"):Be?t("common.generateContent"):t("generate.generateCount",{count:me.length})]})]})]}),e.jsx("div",{className:"h-20 md:hidden"})]}),e.jsxs("div",{className:"fixed inset-x-0 bottom-[calc(4rem+env(safe-area-inset-bottom))] z-40 flex items-center gap-2 border-t border-border bg-background/95 px-3 py-3 pb-4 backdrop-blur-sm md:hidden",children:[ks>0&&e.jsx(I,{size:"icon",variant:"outline",onClick:Hc,"aria-label":t("generate.previousStep"),className:"h-11 w-11 shrink-0",children:e.jsx(tl,{className:"h-5 w-5 rtl:rotate-180"})}),i==="optimize"&&T&&e.jsx(I,{size:"icon",variant:"outline",onClick:sr,disabled:p||he===0||je||!Dt&&he>0||se&&!ws,"aria-label":t("generate.generateWithSelectedTemplate"),className:"h-11 w-11 shrink-0 hover:brand-gradient hover:text-white",children:e.jsx(Le,{className:"h-5 w-5"})}
349),i==="review"&&e.jsx(I,{type:"button",size:"icon",variant:"outline",onClick:()=>y(s=>s+1),"aria-label":t("generate.templates.saveAsTemplate"),title:t("generate.templates.saveAsTemplate"),className:"h-11 w-11 shrink-0",children:e.jsx(dr,{className:"h-5 w-5"})}),e.jsxs(I,{size:"default",className:"w-full h-11 gap-2 text-sm",onClick:i==="review"?sr:Vc,disabled:i==="review"&&(p||he===0||je||!Dt&&he>0||se&&!ws),children:[i!=="review"?e.jsx(tr,{className:"h-5 w-5 rtl:rotate-180"}):p?e.jsx(He,{className:"h-5 w-5 animate-spin"}):je?e.jsx(Ss,{className:"h-5 w-5"}):e.jsx(Le,{className:"h-5 w-5"}),i!=="review"?t("generate.continueTo",{step:Fc(((Yc=Mt[ks+1])==null?void 0:Yc.id)??"review")}):p?t("generate.creatingJob"):je?t(At?"generate.wordLimitReached":"common.upgradePlan"):Be?t("common.generateContent"):t("generate.generateCount",{count:me.length})]})]}),e.jsx(In,{open:c,onOpenChange:l,children:e.jsxs(Ln,{children:[e.jsxs(An,{children:[e.jsx(En,{children:"Save this setup for next time?"}),e.jsx(Dn,{children:"Your first article batch is running. Save the SEO mode, brand voice, structure, language, and advanced settings as a reusable template so your next batch takes fewer clicks."})]}),e.jsxs(Pn,{children:[e.jsx(Mn,{children:"Not now"}),e.jsx(Fn,{onClick:()=>{l(!1),y(s=>s+1)},children:"Save as template"})]})]})}),e.jsx(In,{open:g,onOpenChange:n,children:e.jsxs(Ln,{children:[e.jsxs(An,{children:[e.jsx(En,{children:t("generate.resetConfirmTitle")}),e.jsx(Dn,{children:t("generate.resetConfirmDescription")})]}),e.jsxs(Pn,{children:[e.jsx(Mn,{children:t("common.cancel")}),e.jsxs(Fn,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:Wl,children:[e.jsx(sl,{className:"mr-2 h-4 w-4"})," ",t("generate.resetToDefaults")]})]})]})})]}),e.jsx(In,{open:pr,onOpenChange:ys,children:e.jsxs(Ln,{children:[e.jsxs(An,{children:[e.jsx(En,{children:"Remove Site"}),e.jsxs(Dn,{children:["This will remove all internal link targets for ",e.jsx("strong",{children:Ts}),". This action cannot be undone."]})]}),e.jsxs(Pn,{children:[e.jsx(Mn,{children:"Cancel"}),e.jsxs(Fn,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{Ts&&(zn.mutate(Ts),F===Ts&&ke(""),Is(null),ys(!1))},children:[e.jsx(hs,{className:"mr-2 h-4 w-4"}),"Remove"]})]})]})})]})}export{gh 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.